diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..672f10c --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,36 @@ +name: Deploy Lambda + +on: + push: + branches: + - feat/lamda + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup Node 20 + uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: Install dependencies + run: npm install --production + + - name: Create ZIP + run: | + zip -r function.zip . \ + -x "*.git*" \ + -x "node_modules/.cache/*" + + - name: Deploy to Lambda + uses: appleboy/lambda-action@v0.1.5 + with: + aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws_region: us-east-1 + function_name: digifymenu-apis + zip_file: function.zip \ No newline at end of file diff --git a/config/db.connect.js b/config/db.connect.js index e3dbc51..a8baf96 100644 --- a/config/db.connect.js +++ b/config/db.connect.js @@ -1,14 +1,39 @@ -const mongoose = require('mongoose'); +const mongoose = require("mongoose"); + +let isConnected = false; +let connectionPromise = null; + +const isProduction = process.env.NODE_ENV === "production"; const connectDB = async () => { - try { - await mongoose.connect(process.env.DATABASE_URI, { - useUnifiedTopology: true, - useNewUrlParser: true - }); - } catch (err) { - console.error(err); - } -} - -module.exports = connectDB + if (isConnected) { + return; + } + + if (connectionPromise) { + await connectionPromise; + return; + } + + connectionPromise = mongoose.connect(process.env.DATABASE_URI, { + serverSelectionTimeoutMS: 5000, + socketTimeoutMS: 45000, + // Production optimizations + autoIndex: !isProduction, // Don't rebuild indexes on Lambda cold starts + maxPoolSize: 10, // Allow more concurrent queries + minPoolSize: 2, // Keep warm connections + }).then((db) => { + isConnected = db.connections[0].readyState === 1; + return db; + }).catch((error) => { + isConnected = false; + connectionPromise = null; + console.error("MongoDB connection error:", error); + throw error; + }); + + await connectionPromise; +}; + +module.exports = connectDB; + diff --git a/controller/adsController.js b/controller/adsController.js index 5fa0608..fea704d 100644 --- a/controller/adsController.js +++ b/controller/adsController.js @@ -61,11 +61,14 @@ const getAds = async (req, res) => { const filter = { branch_id, is_admin: false, is_expired: false }; - const count = await Ads.countDocuments(filter); - const rows = await Ads.find(filter) - .sort({ _id: -1 }) - .skip(skip) - .limit(limit); + const [count, rows] = await Promise.all([ + Ads.countDocuments(filter), + Ads.find(filter) + .sort({ _id: -1 }) + .skip(skip) + .limit(limit) + .lean(), + ]); return res.status(200).json({ success: true, @@ -93,7 +96,7 @@ const getActiveAds = async (req, res) => { branch_id, valid_from: { $lte: now }, valid_to: { $gte: now }, - }).sort({ _id: -1 }); + }).sort({ _id: -1 }).lean(); return res.status(200).json({ success: true, data: ads }); } catch (error) { @@ -175,7 +178,7 @@ const checkAdsImageExistsDB = async (fileName, id = null) => { filter._id = { $ne: id }; } - const exists = await Ads.findOne(filter); + const exists = await Ads.findOne(filter).select('_id').lean(); return { success: true, diff --git a/controller/categoryController.js b/controller/categoryController.js index 0da08b0..e8654c1 100644 --- a/controller/categoryController.js +++ b/controller/categoryController.js @@ -62,11 +62,14 @@ const getCategories = async (req, res) => { const filter = { branch_id, is_deleted: false }; - const totalCount = await Category.countDocuments(filter); - const rows = await Category.find(filter) - .sort({ display_order: 1 }) // ASC - .skip(skip) - .limit(limit); + const [totalCount, rows] = await Promise.all([ + Category.countDocuments(filter), + Category.find(filter) + .sort({ display_order: 1 }) + .skip(skip) + .limit(limit) + .lean(), + ]); return sendResponse(res, 200, "Categories fetched successfully", rows, { totalCount: totalCount, @@ -87,7 +90,7 @@ const getCategoryById = async (req, res) => { try { const { id } = req.params; - const category = await Category.findById(id); + const category = await Category.findById(id).lean(); if (!category) { return res.status(404).json({ success: false, @@ -202,7 +205,8 @@ const searchCategory = async (req, res) => { const categories = await Category.find(filter) .sort({ name: 1 }) - .limit(10); + .limit(10) + .lean(); return sendResponse(res, 200, "Categories fetched successfully", categories); @@ -228,7 +232,7 @@ const checkCategoryImageExistsDB = async (fileName, id = null) => { filter._id = { $ne: id }; } - const exists = await Category.findOne(filter); + const exists = await Category.findOne(filter).select('_id').lean(); return { success: true, diff --git a/controller/menuController.js b/controller/menuController.js index 302ef75..da68c8c 100644 --- a/controller/menuController.js +++ b/controller/menuController.js @@ -1,185 +1,363 @@ const { Ads } = require("../model/adsModal"); const { Category } = require("../model/categoryModel"); const { MenuItem } = require("../model/menuItemModel"); -const { Branch, Restaurant } = require("../model/resturantModel"); +const { Branch } = require("../model/resturantModel"); const { SpecialTag } = require("../model/specialTagModel"); const { MenuAccessLog } = require("../model/menuAccessLogModel"); const { sendResponse } = require("../utils/responseHelper"); const errorHandler = require("../error/joiErrorHandler/joiErrorHandler"); -// Helper to get branch ID from slug -const getBranchIdFromSlug = async (slug) => { - const branch = await Branch.findOne({ slug: slug, is_active: true }).select('_id').lean(); - return branch ? branch._id : null; -}; +// ─── Reusable field projections ─── +const BRANCH_SELECT = "-__v"; +const CATEGORY_SELECT = "_id name image_url is_active display_order"; +const MENU_ITEM_SELECT = + "_id category_id name description image_url is_available special_note tag no_price options"; +const CAROUSEL_SELECT = "_id branch_id title ad_type image_url valid_from valid_to"; +const SPECIAL_TAG_SELECT = "_id title display_order menu_items"; // API for Restaurant Details const getBranchDetailsByslug = async (req, res) => { - try { - const { slug } = req.params; - - const branch = await Branch.findOne({ slug: slug, is_active: true }).lean(); - // Settings are embedded, so we already have them in branch.settings + try { + const { slug } = req.params; - if (!branch) { - return sendResponse(res, 404, "Branch not found"); - } + const branch = await Branch.findOne({ slug, is_active: true }) + .select(BRANCH_SELECT) + .lean(); - return sendResponse(res, 200, "Branch details fetched successfully", branch); - } catch (error) { - console.error("Get Restaurant Details By Branch Slug Error:", error); - return sendResponse(res, 500, "Internal Server Error", errorHandler(error)); + if (!branch) { + return sendResponse(res, 404, "Branch not found"); } -}; + return sendResponse(res, 200, "Branch details fetched successfully", branch); + } catch (error) { + console.error("Get Restaurant Details By Branch Slug Error:", error); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error)); + } +}; const getCategoriesbyIdForMenu = async (req, res) => { - try { - const { branchId } = req.params; - - if (!branchId) { - return res.status(400).json({ - success: false, - message: "Branch ID is required", - }); - } - - const category = await Category.find({ - branch_id: branchId, - is_active: true, - is_deleted: false - }) - .sort({ display_order: 1 }) - .lean(); + try { + const { branchId } = req.params; - return sendResponse(res, 200, "Categories fetched successfully", category); - } catch (error) { - console.error("Get Category By Branch Slug Error:", error); - return sendResponse(res, 500, "Internal Server Error", errorHandler(error)); + if (!branchId) { + return sendResponse(res, 400, "Branch ID is required"); } + + const category = await Category.find({ + branch_id: branchId, + is_active: true, + is_deleted: false, + }) + .sort({ display_order: 1 }) + .select(CATEGORY_SELECT) + .lean(); + + return sendResponse(res, 200, "Categories fetched successfully", category); + } catch (error) { + console.error("Get Category By Branch Slug Error:", error); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error)); + } }; // API for Menu Items (fetching all menu items for a specific branch) const getMenuItemsByBranchIdForMenu = async (req, res) => { - try { - const { branchId } = req.params; + try { + const { branchId } = req.params; - if (!branchId) { - return sendResponse(res, 404, "Branch not found"); - } + if (!branchId) { + return sendResponse(res, 404, "Branch not found"); + } + + // Fetch categories and build name map — avoids populate() round-trip + const branchCategories = await Category.find({ + branch_id: branchId, + is_deleted: false, + }) + .select("_id name") + .lean(); - // Get all categories for this branch - const branchCategories = await Category.find({ branch_id: branchId,is_deleted: false }).select('_id').lean(); - const categoryIds = branchCategories.map(c => c._id); + const categoryIds = branchCategories.map((c) => c._id); - // Get Menu Items - const menuItems = await MenuItem.find({ - category_id: { $in: categoryIds } - }) - .sort({ is_available: -1,created_at: 1 }) - .populate({ path: 'category_id', select: 'name' }) - .lean(); + if (categoryIds.length === 0) { + return sendResponse(res, 200, "Menu items fetched successfully", []); + } + + // Build O(1) lookup map instead of populate + const categoryNameMap = {}; + for (let i = 0; i < branchCategories.length; i++) { + categoryNameMap[branchCategories[i]._id.toString()] = branchCategories[i].name; + } - return sendResponse(res, 200, "Menu items fetched successfully", menuItems); - } catch (error) { - console.error("Get Menu Items By Branch Slug Error:", error); - return sendResponse(res, 500, "Internal Server Error", errorHandler(error)); + const menuItems = await MenuItem.find({ + category_id: { $in: categoryIds }, + }) + .sort({ is_available: -1, created_at: 1 }) + .select(MENU_ITEM_SELECT) + .lean(); + + // Attach category name in-memory (replaces populate) + for (let i = 0; i < menuItems.length; i++) { + const item = menuItems[i]; + item.category_id = { + _id: item.category_id, + name: categoryNameMap[item.category_id.toString()] || null, + }; } + + return sendResponse(res, 200, "Menu items fetched successfully", menuItems); + } catch (error) { + console.error("Get Menu Items By Branch Slug Error:", error); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error)); + } }; const getSpecialMenuItemsByBranchId = async (req, res) => { - try { - const { branchId } = req.params; + try { + const { branchId } = req.params; - if (!branchId) { - return sendResponse(res, 400, "Branch ID is required"); - } + if (!branchId) { + return sendResponse(res, 400, "Branch ID is required"); + } - // In the new model, SpecialTag has `menu_items` array of References. - // We populate that array. - const specialMenuItems = await SpecialTag.find({ branch_id: branchId }) - .sort({ display_order: 1 }) - .populate({ - path: 'menu_items', - model: 'MenuItem', - }) - .lean(); - - // Filter out tags that might have empty menu_items if desired, or just map - const finalData = specialMenuItems.map(tag => ({ - id: tag._id, - title: tag.title, - special_items: tag.menu_items - })); - - return sendResponse(res, 200, "Special menu items fetched successfully", finalData); - } catch (error) { - console.error("Get Special Menu Items By Branch ID Error:", error); - return sendResponse(res, 500, "Internal Server Error", errorHandler(error)); + const specialMenuItems = await SpecialTag.find({ branch_id: branchId }) + .sort({ display_order: 1 }) + .select(SPECIAL_TAG_SELECT) + .populate({ + path: "menu_items", + model: "MenuItem", + select: MENU_ITEM_SELECT, + }) + .lean(); + + // Pre-allocate result array + const finalData = new Array(specialMenuItems.length); + for (let i = 0; i < specialMenuItems.length; i++) { + const tag = specialMenuItems[i]; + finalData[i] = { + id: tag._id, + title: tag.title, + special_items: tag.menu_items, + }; } + + return sendResponse( + res, + 200, + "Special menu items fetched successfully", + finalData, + ); + } catch (error) { + console.error("Get Special Menu Items By Branch ID Error:", error); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error)); + } }; const getCarasoulByBranchId = async (req, res) => { - try { - const { branchId } = req.params; + try { + const { branchId } = req.params; - if (!branchId) { - return sendResponse(res, 400, "Branch ID is required"); - } + if (!branchId) { + return sendResponse(res, 400, "Branch ID is required"); + } + + const now = new Date(); + const carasoulMenuItems = await Ads.find({ + branch_id: branchId, + is_expired: false, + valid_from: { $lte: now }, + valid_to: { $gte: now }, + }) + .select(CAROUSEL_SELECT) + .lean(); + + return sendResponse( + res, + 200, + "Carousel items fetched successfully", + carasoulMenuItems, + ); + } catch (error) { + console.error("Get Carasoul Menu Items By Branch ID Error:", error); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error)); + } +}; + +// API for logging menu access — fire-and-forget for fastest response +const logMenuAccess = async (req, res) => { + try { + const { slug } = req.params; - const now = new Date(); - const carasoulMenuItems = await Ads.find({ - branch_id: branchId, - is_expired: false, - valid_from: { $lte: now }, - valid_to: { $gte: now } - }).lean(); + const branch = await Branch.findOne({ slug, is_active: true }) + .select("_id") + .lean(); - console.log("Carousel items fetched successfully", carasoulMenuItems); + if (!branch) { + return sendResponse(res, 404, "Branch not found"); + } - return sendResponse(res, 200, "Carousel items fetched successfully", carasoulMenuItems); - } catch (error) { - console.error("Get Carasoul Menu Items By Branch ID Error:", error); - return sendResponse(res, 500, "Internal Server Error", errorHandler(error)); + // Respond immediately, write log in background (fire-and-forget) + sendResponse(res, 201, "Menu access logged successfully", { + branch_id: branch._id, + accessed_at: new Date(), + }); + + // Non-blocking DB write — uses create() (single round-trip vs new+save) + MenuAccessLog.create({ + branch_id: branch._id, + accessed_at: new Date(), + }).catch((err) => console.error("Menu access log write failed:", err)); + } catch (error) { + console.error("Log Menu Access Error:", error); + // Only send error if headers haven't been sent + if (!res.headersSent) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error)); } + } }; +// ─── FULL MENU — Maximum Optimization ─── +const getFullMenuBySlug = async (req, res) => { + try { + const { slug } = req.params; -// API for logging menu access when QR code is scanned -const logMenuAccess = async (req, res) => { - try { - const { slug } = req.params; + // 1. Branch lookup — required before parallel queries + const branch = await Branch.findOne({ slug, is_active: true }) + .select(BRANCH_SELECT) + .lean(); - // Find branch by slug - const branch = await Branch.findOne({ slug: slug, is_active: true }).select('_id'); + if (!branch) { + return sendResponse(res, 404, "Branch not found"); + } + + const branchId = branch._id; + const now = new Date(); + + // 2. Launch ALL independent queries in parallel + const [categories, specialTagsRaw, carasoulMenuItems] = await Promise.all([ + // Categories + Category.find({ + branch_id: branchId, + is_active: true, + is_deleted: false, + }) + .sort({ display_order: 1 }) + .select(CATEGORY_SELECT) + .lean(), - if (!branch) { - return sendResponse(res, 404, "Branch not found"); + // Special tags (without populate — we'll batch-fetch items separately) + SpecialTag.find({ branch_id: branchId }) + .sort({ display_order: 1 }) + .select(SPECIAL_TAG_SELECT) + .lean(), + + // Carousel / Ads + Ads.find({ + branch_id: branchId, + is_expired: false, + valid_from: { $lte: now }, + valid_to: { $gte: now }, + }) + .select(CAROUSEL_SELECT) + .lean(), + ]); + + // 3. Build category ID list and name map (O(n) — microseconds) + const categoryIds = new Array(categories.length); + const categoryNameMap = {}; + for (let i = 0; i < categories.length; i++) { + const cat = categories[i]; + categoryIds[i] = cat._id; + categoryNameMap[cat._id.toString()] = cat.name; + } + + // 4. Collect all special item IDs for batch fetch + const specialItemIdSet = new Set(); + for (let i = 0; i < specialTagsRaw.length; i++) { + const items = specialTagsRaw[i].menu_items; + if (items) { + for (let j = 0; j < items.length; j++) { + specialItemIdSet.add(items[j].toString()); } + } + } + const specialItemIds = Array.from(specialItemIdSet); + + // 5. Fetch menu items and special items in parallel (no populate!) + const menuItemsQuery = + categoryIds.length > 0 + ? MenuItem.find({ category_id: { $in: categoryIds } }) + .sort({ is_available: -1, created_at: 1 }) + .select(MENU_ITEM_SELECT) + .lean() + : Promise.resolve([]); + + const specialItemsQuery = + specialItemIds.length > 0 + ? MenuItem.find({ _id: { $in: specialItemIds } }) + .select(MENU_ITEM_SELECT) + .lean() + : Promise.resolve([]); + + const [menuItems, specialItemDocs] = await Promise.all([ + menuItemsQuery, + specialItemsQuery, + ]); + + // 6. Attach category names to menuItems in-memory (replaces populate) + for (let i = 0; i < menuItems.length; i++) { + const item = menuItems[i]; + item.category_id = { + _id: item.category_id, + name: categoryNameMap[item.category_id.toString()] || null, + }; + } - // Create log entry - const logEntry = new MenuAccessLog({ - branch_id: branch._id, - accessed_at: new Date() - }); - await logEntry.save(); - - return sendResponse(res, 201, "Menu access logged successfully", { - log_id: logEntry._id, - branch_id: logEntry.branch_id, - accessed_at: logEntry.accessed_at - }); - } catch (error) { - console.error("Log Menu Access Error:", error); - return sendResponse(res, 500, "Internal Server Error", errorHandler(error)); + // 7. Build special item lookup map (O(n)) + const specialItemMap = {}; + for (let i = 0; i < specialItemDocs.length; i++) { + specialItemMap[specialItemDocs[i]._id.toString()] = specialItemDocs[i]; } + + // 8. Format special tags with resolved items + const specialMenuItems = new Array(specialTagsRaw.length); + for (let i = 0; i < specialTagsRaw.length; i++) { + const tag = specialTagsRaw[i]; + const resolvedItems = []; + if (tag.menu_items) { + for (let j = 0; j < tag.menu_items.length; j++) { + const doc = specialItemMap[tag.menu_items[j].toString()]; + if (doc) resolvedItems.push(doc); + } + } + specialMenuItems[i] = { + id: tag._id, + title: tag.title, + special_items: resolvedItems, + }; + } + + // 9. Set cache header and respond + res.set("Cache-Control", "public, max-age=120"); + + return sendResponse(res, 200, "Full menu retrieved successfully", { + restaurant: branch, + categories, + menuItems, + specialItems: specialMenuItems, + carousel: carasoulMenuItems, + }); + } catch (error) { + console.error("Get Full Menu By Slug Error:", error); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error)); + } }; module.exports = { - getBranchDetailsByslug, - getCategoriesbyIdForMenu, - getMenuItemsByBranchIdForMenu, - getSpecialMenuItemsByBranchId, - getCarasoulByBranchId, - logMenuAccess + getFullMenuBySlug, + getBranchDetailsByslug, + getCategoriesbyIdForMenu, + getMenuItemsByBranchIdForMenu, + getSpecialMenuItemsByBranchId, + getCarasoulByBranchId, + logMenuAccess, }; diff --git a/controller/menuItemController.js b/controller/menuItemController.js index dd970fc..7a3d9b5 100644 --- a/controller/menuItemController.js +++ b/controller/menuItemController.js @@ -90,7 +90,7 @@ const getMenuItems = async (req, res) => { // 🟥 FILTER: BRANCH if (branch_id) { // Find all categories for this branch first - const branchCategories = await Category.find({ branch_id: branch_id }).select('_id'); + const branchCategories = await Category.find({ branch_id: branch_id }).select('_id').lean(); const categoryIds = branchCategories.map(c => c._id); // If we also had a category_id filter, we need to make sure it belongs to the branch @@ -110,12 +110,15 @@ const getMenuItems = async (req, res) => { } } - const totalCount = await MenuItem.countDocuments(filter); - const rows = await MenuItem.find(filter) - .populate('category_id') // Populate category info if needed - .sort({ _id: -1 }) - .skip(skip) - .limit(limit); + const [totalCount, rows] = await Promise.all([ + MenuItem.countDocuments(filter), + MenuItem.find(filter) + .populate('category_id') + .sort({ _id: -1 }) + .skip(skip) + .limit(limit) + .lean(), + ]); return sendResponse(res, 200, "Menu items fetched successfully", rows, { totalCount: totalCount, @@ -138,7 +141,8 @@ const getItemsByCategory = async (req, res) => { const { category_id } = req.params; const items = await MenuItem.find({ category_id }) - .sort({ _id: -1 }); + .sort({ _id: -1 }) + .lean(); return sendResponse(res, 200, "Menu items fetched successfully", items); @@ -154,7 +158,7 @@ const getMenuItemById = async (req, res) => { try { const { id } = req.params; - const item = await MenuItem.findById(id); + const item = await MenuItem.findById(id).lean(); if (!item) { return sendResponse(res, 404, "Menu item not found"); } @@ -270,7 +274,8 @@ const searchMenuItem = async (req, res) => { const items = await MenuItem.find(filter) .sort({ name: 1 }) - .limit(10); + .limit(10) + .lean(); return sendResponse(res, 200, "Menu items fetched successfully", items); @@ -296,7 +301,7 @@ const checkMenuItemImageExistsDB = async (fileName, id = null) => { filter._id = { $ne: id }; } - const exists = await MenuItem.findOne(filter); + const exists = await MenuItem.findOne(filter).select('_id').lean(); return { success: true, @@ -352,7 +357,7 @@ const getInactiveMenuItems = async (req, res) => { // 🟥 FILTER: BRANCH if (branch_id) { // Find all categories for this branch first - const branchCategories = await Category.find({ branch_id: branch_id }).select('_id'); + const branchCategories = await Category.find({ branch_id: branch_id }).select('_id').lean(); const categoryIds = branchCategories.map(c => c._id); // If we also had a category_id filter, we need to make sure it belongs to the branch @@ -372,12 +377,15 @@ const getInactiveMenuItems = async (req, res) => { } } - const totalCount = await MenuItem.countDocuments(filter); - const rows = await MenuItem.find(filter) - .populate('category_id') // Populate category info if needed - .sort({ _id: -1 }) - .skip(skip) - .limit(limit); + const [totalCount, rows] = await Promise.all([ + MenuItem.countDocuments(filter), + MenuItem.find(filter) + .populate('category_id') + .sort({ _id: -1 }) + .skip(skip) + .limit(limit) + .lean(), + ]); return sendResponse(res, 200, "Inactive menu items fetched successfully", rows, { totalCount: totalCount, diff --git a/controller/restaurantController.js b/controller/restaurantController.js index 3cdbf56..db9272a 100644 --- a/controller/restaurantController.js +++ b/controller/restaurantController.js @@ -28,7 +28,7 @@ const searchRestaurants = async (req, res) => { filter.name = { $regex: search, $options: "i" }; // Case-insensitive partial match } - const restaurants = await Restaurant.find(filter).select("name logo"); + const restaurants = await Restaurant.find(filter).select("name logo").lean(); // Map _id to id for frontend compatibility if needed, or just return as is // Mongoose returns _id by default. @@ -182,7 +182,6 @@ const createBranch = async (req, res) => { const user = await User.findById(userId).session(session); - console.log(user); // Mongoose objects are BSON, need .toObject() or direct access usually works but better to be safe for JWT const userPayload = { @@ -230,7 +229,7 @@ const getResturantById = async (req, res) => { const { branchId } = req.user; // In Mongoose, settings are embedded in Branch - const restaurant = await Branch.findById(branchId); + const restaurant = await Branch.findById(branchId).lean(); if (!restaurant) { return sendResponse(res, 404, "Restaurant not found"); @@ -368,7 +367,7 @@ const getAnalytics = async (req, res) => { try { const { slug } = req.params; - const branch = await Branch.findOne({ slug: slug, is_active: true }); + const branch = await Branch.findOne({ slug: slug, is_active: true }).select('_id').lean(); if (!branch) { return res.status(404).json({ @@ -379,39 +378,32 @@ const getAnalytics = async (req, res) => { const branchId = branch._id; - // 1) categories - const totalCategories = await Category.countDocuments({ - branch_id: branchId, - is_active: true, - }); - - // 2) items (through category) if categories are linked - // In Mongoose, MenuItem has category_id. We need to find categories for this branch first? - // Or if MenuItem has direct branch_id? - // Checking MenuItem model... Only category_id. - // So: Find all categories for branch -> Get their IDs -> Count MenuItems with those Category IDs. - + // Parallelize all counts — no dependencies between them const branchCategories = await Category.find({ branch_id: branchId, - }).select("_id"); + }).select("_id").lean(); const categoryIds = branchCategories.map((c) => c._id); - const totalItems = await MenuItem.countDocuments({ - category_id: { $in: categoryIds }, - }); - - // 3) monthly visitors - const visitors = await MenuAccessLog.aggregate([ - { $match: { branch_id: branchId } }, - { - $group: { - _id: { - month: { $month: "$accessed_at" }, - year: { $year: "$accessed_at" }, + const [totalCategories, totalItems, visitors] = await Promise.all([ + Category.countDocuments({ + branch_id: branchId, + is_active: true, + }), + categoryIds.length > 0 + ? MenuItem.countDocuments({ category_id: { $in: categoryIds } }) + : Promise.resolve(0), + MenuAccessLog.aggregate([ + { $match: { branch_id: branchId } }, + { + $group: { + _id: { + month: { $month: "$accessed_at" }, + year: { $year: "$accessed_at" }, + }, + count: { $sum: 1 }, }, - count: { $sum: 1 }, }, - }, + ]), ]); let monthlyVisitors = Array(12).fill(0); diff --git a/controller/specialTagController.js b/controller/specialTagController.js index 3073aa5..1f1a606 100644 --- a/controller/specialTagController.js +++ b/controller/specialTagController.js @@ -56,7 +56,8 @@ const getSpecialTags = async (req, res) => { const branch_id = req.user.branchId; const tags = await SpecialTag.find({ branch_id }) - .sort({ display_order: 1 }); + .sort({ display_order: 1 }) + .lean(); return sendResponse(res, 200, "Special tags fetched successfully", tags); @@ -132,7 +133,7 @@ const getSpecialTagItems = async (req, res) => { const tag = await SpecialTag.findById(tag_id).populate({ path: 'menu_items', select: 'name image_url' - }); + }).lean(); if (!tag) { return sendResponse(res, 404, "Special tag not found"); diff --git a/controller/userController.js b/controller/userController.js index c3609a1..95a0e95 100644 --- a/controller/userController.js +++ b/controller/userController.js @@ -21,7 +21,6 @@ const checkUser = async (req, res) => { return sendResponse(res, 400, "Email is required"); } - // Check if user exists const user = await User.findOne({ email: email }); @@ -47,7 +46,7 @@ const checkUser = async (req, res) => { if (emailSent) { // Mongoose uses _id, not id by default, but virtual 'id' might exist. Safer to use _id return sendResponse(res, 200, "OTP sent to email", { - otpId: otpRecord._id, + otpId: otpRecord._id, email: email, }); } else { @@ -82,7 +81,6 @@ const signin = async (req, res) => { } let tokenPayload = {}; - console.log(user.branch_id); if (user.branch_id !== null) { tokenPayload = { @@ -99,13 +97,9 @@ const signin = async (req, res) => { }; } - console.log(tokenPayload); - const accessToken = generateAccessToken(tokenPayload); const refreshToken = generateRefreshToken(tokenPayload); - console.log(accessToken); - console.log(refreshToken); res.cookie("accessToken", accessToken, { httpOnly: true, @@ -128,7 +122,7 @@ const signin = async (req, res) => { }, redirect: user.branch_id ? "/dashboard" : "/registration", success: true, - token: accessToken, + token: accessToken, }); } catch (error) { console.error("Error in signin:", error); @@ -146,7 +140,7 @@ const verifyOTPAndRegister = async (req, res) => { return sendResponse( res, 400, - "All fields are required: otpId, otp, email, password" + "All fields are required: otpId, otp, email, password", ); } @@ -179,9 +173,9 @@ const verifyOTPAndRegister = async (req, res) => { const user = await User.create({ email: email, - Password: hashedPassword, - username: email.split("@")[0], - branch_id: null, + Password: hashedPassword, + username: email.split("@")[0], + branch_id: null, }); // Mark OTP as validated @@ -189,7 +183,6 @@ const verifyOTPAndRegister = async (req, res) => { await otpRecord.save(); let tokenPayload = {}; - console.log(user.branch_id); if (user.branch_id !== null) { tokenPayload = { @@ -206,8 +199,6 @@ const verifyOTPAndRegister = async (req, res) => { }; } - console.log(tokenPayload); - const accessToken = generateAccessToken(tokenPayload); const refreshToken = generateRefreshToken(tokenPayload); diff --git a/esbuild.config.js b/esbuild.config.js new file mode 100644 index 0000000..dc99e13 --- /dev/null +++ b/esbuild.config.js @@ -0,0 +1,17 @@ +const esbuild = require("esbuild"); + +esbuild.build({ + entryPoints: ["server.js"], + bundle: true, + platform: "node", + target: "node20", + outfile: "lambda.js", + external: [ + "mock-aws-s3", + "aws-sdk", + "nock", + "bcrypt", + "sharp" + ], + logLevel: "info", +}).catch(() => process.exit(1)); diff --git a/lambda.js b/lambda.js new file mode 100644 index 0000000..33a5144 --- /dev/null +++ b/lambda.js @@ -0,0 +1,152867 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn2, res) => function __init() { + return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res; +}; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/depd/lib/compat/callsite-tostring.js +var require_callsite_tostring = __commonJS({ + "node_modules/depd/lib/compat/callsite-tostring.js"(exports2, module2) { + "use strict"; + module2.exports = callSiteToString2; + function callSiteFileLocation(callSite) { + var fileName; + var fileLocation = ""; + if (callSite.isNative()) { + fileLocation = "native"; + } else if (callSite.isEval()) { + fileName = callSite.getScriptNameOrSourceURL(); + if (!fileName) { + fileLocation = callSite.getEvalOrigin(); + } + } else { + fileName = callSite.getFileName(); + } + if (fileName) { + fileLocation += fileName; + var lineNumber = callSite.getLineNumber(); + if (lineNumber != null) { + fileLocation += ":" + lineNumber; + var columnNumber = callSite.getColumnNumber(); + if (columnNumber) { + fileLocation += ":" + columnNumber; + } + } + } + return fileLocation || "unknown source"; + } + function callSiteToString2(callSite) { + var addSuffix = true; + var fileLocation = callSiteFileLocation(callSite); + var functionName = callSite.getFunctionName(); + var isConstructor = callSite.isConstructor(); + var isMethodCall = !(callSite.isToplevel() || isConstructor); + var line = ""; + if (isMethodCall) { + var methodName = callSite.getMethodName(); + var typeName = getConstructorName(callSite); + if (functionName) { + if (typeName && functionName.indexOf(typeName) !== 0) { + line += typeName + "."; + } + line += functionName; + if (methodName && functionName.lastIndexOf("." + methodName) !== functionName.length - methodName.length - 1) { + line += " [as " + methodName + "]"; + } + } else { + line += typeName + "." + (methodName || ""); + } + } else if (isConstructor) { + line += "new " + (functionName || ""); + } else if (functionName) { + line += functionName; + } else { + addSuffix = false; + line += fileLocation; + } + if (addSuffix) { + line += " (" + fileLocation + ")"; + } + return line; + } + function getConstructorName(obj) { + var receiver = obj.receiver; + return receiver.constructor && receiver.constructor.name || null; + } + } +}); + +// node_modules/depd/lib/compat/event-listener-count.js +var require_event_listener_count = __commonJS({ + "node_modules/depd/lib/compat/event-listener-count.js"(exports2, module2) { + "use strict"; + module2.exports = eventListenerCount2; + function eventListenerCount2(emitter, type) { + return emitter.listeners(type).length; + } + } +}); + +// node_modules/depd/lib/compat/index.js +var require_compat = __commonJS({ + "node_modules/depd/lib/compat/index.js"(exports2, module2) { + "use strict"; + var EventEmitter = require("events").EventEmitter; + lazyProperty(module2.exports, "callSiteToString", function callSiteToString2() { + var limit = Error.stackTraceLimit; + var obj = {}; + var prep = Error.prepareStackTrace; + function prepareObjectStackTrace2(obj2, stack3) { + return stack3; + } + Error.prepareStackTrace = prepareObjectStackTrace2; + Error.stackTraceLimit = 2; + Error.captureStackTrace(obj); + var stack2 = obj.stack.slice(); + Error.prepareStackTrace = prep; + Error.stackTraceLimit = limit; + return stack2[0].toString ? toString : require_callsite_tostring(); + }); + lazyProperty(module2.exports, "eventListenerCount", function eventListenerCount2() { + return EventEmitter.listenerCount || require_event_listener_count(); + }); + function lazyProperty(obj, prop, getter) { + function get2() { + var val = getter(); + Object.defineProperty(obj, prop, { + configurable: true, + enumerable: true, + value: val + }); + return val; + } + Object.defineProperty(obj, prop, { + configurable: true, + enumerable: true, + get: get2 + }); + } + function toString(obj) { + return obj.toString(); + } + } +}); + +// node_modules/depd/index.js +var require_depd = __commonJS({ + "node_modules/depd/index.js"(exports, module) { + var callSiteToString = require_compat().callSiteToString; + var eventListenerCount = require_compat().eventListenerCount; + var relative = require("path").relative; + module.exports = depd; + var basePath = process.cwd(); + function containsNamespace(str, namespace) { + var vals = str.split(/[ ,]+/); + var ns = String(namespace).toLowerCase(); + for (var i4 = 0; i4 < vals.length; i4++) { + var val = vals[i4]; + if (val && (val === "*" || val.toLowerCase() === ns)) { + return true; + } + } + return false; + } + function convertDataDescriptorToAccessor(obj, prop, message2) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + var value = descriptor.value; + descriptor.get = function getter() { + return value; + }; + if (descriptor.writable) { + descriptor.set = function setter(val) { + return value = val; + }; + } + delete descriptor.value; + delete descriptor.writable; + Object.defineProperty(obj, prop, descriptor); + return descriptor; + } + function createArgumentsString(arity) { + var str = ""; + for (var i4 = 0; i4 < arity; i4++) { + str += ", arg" + i4; + } + return str.substr(2); + } + function createStackString(stack2) { + var str = this.name + ": " + this.namespace; + if (this.message) { + str += " deprecated " + this.message; + } + for (var i4 = 0; i4 < stack2.length; i4++) { + str += "\n at " + callSiteToString(stack2[i4]); + } + return str; + } + function depd(namespace) { + if (!namespace) { + throw new TypeError("argument namespace is required"); + } + var stack2 = getStack(); + var site2 = callSiteLocation(stack2[1]); + var file = site2[0]; + function deprecate2(message2) { + log.call(deprecate2, message2); + } + deprecate2._file = file; + deprecate2._ignored = isignored(namespace); + deprecate2._namespace = namespace; + deprecate2._traced = istraced(namespace); + deprecate2._warned = /* @__PURE__ */ Object.create(null); + deprecate2.function = wrapfunction; + deprecate2.property = wrapproperty; + return deprecate2; + } + function isignored(namespace) { + if (process.noDeprecation) { + return true; + } + var str = process.env.NO_DEPRECATION || ""; + return containsNamespace(str, namespace); + } + function istraced(namespace) { + if (process.traceDeprecation) { + return true; + } + var str = process.env.TRACE_DEPRECATION || ""; + return containsNamespace(str, namespace); + } + function log(message2, site2) { + var haslisteners = eventListenerCount(process, "deprecation") !== 0; + if (!haslisteners && this._ignored) { + return; + } + var caller; + var callFile; + var callSite; + var depSite; + var i4 = 0; + var seen = false; + var stack2 = getStack(); + var file = this._file; + if (site2) { + depSite = site2; + callSite = callSiteLocation(stack2[1]); + callSite.name = depSite.name; + file = callSite[0]; + } else { + i4 = 2; + depSite = callSiteLocation(stack2[i4]); + callSite = depSite; + } + for (; i4 < stack2.length; i4++) { + caller = callSiteLocation(stack2[i4]); + callFile = caller[0]; + if (callFile === file) { + seen = true; + } else if (callFile === this._file) { + file = this._file; + } else if (seen) { + break; + } + } + var key = caller ? depSite.join(":") + "__" + caller.join(":") : void 0; + if (key !== void 0 && key in this._warned) { + return; + } + this._warned[key] = true; + var msg = message2; + if (!msg) { + msg = callSite === depSite || !callSite.name ? defaultMessage(depSite) : defaultMessage(callSite); + } + if (haslisteners) { + var err = DeprecationError(this._namespace, msg, stack2.slice(i4)); + process.emit("deprecation", err); + return; + } + var format2 = process.stderr.isTTY ? formatColor : formatPlain; + var output = format2.call(this, msg, caller, stack2.slice(i4)); + process.stderr.write(output + "\n", "utf8"); + } + function callSiteLocation(callSite) { + var file = callSite.getFileName() || ""; + var line = callSite.getLineNumber(); + var colm = callSite.getColumnNumber(); + if (callSite.isEval()) { + file = callSite.getEvalOrigin() + ", " + file; + } + var site2 = [file, line, colm]; + site2.callSite = callSite; + site2.name = callSite.getFunctionName(); + return site2; + } + function defaultMessage(site2) { + var callSite = site2.callSite; + var funcName = site2.name; + if (!funcName) { + funcName = ""; + } + var context = callSite.getThis(); + var typeName = context && callSite.getTypeName(); + if (typeName === "Object") { + typeName = void 0; + } + if (typeName === "Function") { + typeName = context.name || typeName; + } + return typeName && callSite.getMethodName() ? typeName + "." + funcName : funcName; + } + function formatPlain(msg, caller, stack2) { + var timestamp = (/* @__PURE__ */ new Date()).toUTCString(); + var formatted = timestamp + " " + this._namespace + " deprecated " + msg; + if (this._traced) { + for (var i4 = 0; i4 < stack2.length; i4++) { + formatted += "\n at " + callSiteToString(stack2[i4]); + } + return formatted; + } + if (caller) { + formatted += " at " + formatLocation(caller); + } + return formatted; + } + function formatColor(msg, caller, stack2) { + var formatted = "\x1B[36;1m" + this._namespace + "\x1B[22;39m \x1B[33;1mdeprecated\x1B[22;39m \x1B[0m" + msg + "\x1B[39m"; + if (this._traced) { + for (var i4 = 0; i4 < stack2.length; i4++) { + formatted += "\n \x1B[36mat " + callSiteToString(stack2[i4]) + "\x1B[39m"; + } + return formatted; + } + if (caller) { + formatted += " \x1B[36m" + formatLocation(caller) + "\x1B[39m"; + } + return formatted; + } + function formatLocation(callSite) { + return relative(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2]; + } + function getStack() { + var limit = Error.stackTraceLimit; + var obj = {}; + var prep = Error.prepareStackTrace; + Error.prepareStackTrace = prepareObjectStackTrace; + Error.stackTraceLimit = Math.max(10, limit); + Error.captureStackTrace(obj); + var stack2 = obj.stack.slice(1); + Error.prepareStackTrace = prep; + Error.stackTraceLimit = limit; + return stack2; + } + function prepareObjectStackTrace(obj, stack2) { + return stack2; + } + function wrapfunction(fn, message) { + if (typeof fn !== "function") { + throw new TypeError("argument fn must be a function"); + } + var args = createArgumentsString(fn.length); + var deprecate = this; + var stack = getStack(); + var site = callSiteLocation(stack[1]); + site.name = fn.name; + var deprecatedfn = eval("(function (" + args + ') {\n"use strict"\nlog.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n})'); + return deprecatedfn; + } + function wrapproperty(obj, prop, message2) { + if (!obj || typeof obj !== "object" && typeof obj !== "function") { + throw new TypeError("argument obj must be object"); + } + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + if (!descriptor) { + throw new TypeError("must call property on owner object"); + } + if (!descriptor.configurable) { + throw new TypeError("property must be configurable"); + } + var deprecate2 = this; + var stack2 = getStack(); + var site2 = callSiteLocation(stack2[1]); + site2.name = prop; + if ("value" in descriptor) { + descriptor = convertDataDescriptorToAccessor(obj, prop, message2); + } + var get2 = descriptor.get; + var set = descriptor.set; + if (typeof get2 === "function") { + descriptor.get = function getter() { + log.call(deprecate2, message2, site2); + return get2.apply(this, arguments); + }; + } + if (typeof set === "function") { + descriptor.set = function setter() { + log.call(deprecate2, message2, site2); + return set.apply(this, arguments); + }; + } + Object.defineProperty(obj, prop, descriptor); + } + function DeprecationError(namespace, message2, stack2) { + var error2 = new Error(); + var stackString; + Object.defineProperty(error2, "constructor", { + value: DeprecationError + }); + Object.defineProperty(error2, "message", { + configurable: true, + enumerable: false, + value: message2, + writable: true + }); + Object.defineProperty(error2, "name", { + enumerable: false, + configurable: true, + value: "DeprecationError", + writable: true + }); + Object.defineProperty(error2, "namespace", { + configurable: true, + enumerable: false, + value: namespace, + writable: true + }); + Object.defineProperty(error2, "stack", { + configurable: true, + enumerable: false, + get: function() { + if (stackString !== void 0) { + return stackString; + } + return stackString = createStackString.call(this, stack2); + }, + set: function setter(val) { + stackString = val; + } + }); + return error2; + } + } +}); + +// node_modules/setprototypeof/index.js +var require_setprototypeof = __commonJS({ + "node_modules/setprototypeof/index.js"(exports2, module2) { + module2.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties); + function setProtoOf(obj, proto) { + obj.__proto__ = proto; + return obj; + } + function mixinProperties(obj, proto) { + for (var prop in proto) { + if (!obj.hasOwnProperty(prop)) { + obj[prop] = proto[prop]; + } + } + return obj; + } + } +}); + +// node_modules/statuses/codes.json +var require_codes = __commonJS({ + "node_modules/statuses/codes.json"(exports2, module2) { + module2.exports = { + "100": "Continue", + "101": "Switching Protocols", + "102": "Processing", + "200": "OK", + "201": "Created", + "202": "Accepted", + "203": "Non-Authoritative Information", + "204": "No Content", + "205": "Reset Content", + "206": "Partial Content", + "207": "Multi-Status", + "208": "Already Reported", + "226": "IM Used", + "300": "Multiple Choices", + "301": "Moved Permanently", + "302": "Found", + "303": "See Other", + "304": "Not Modified", + "305": "Use Proxy", + "306": "(Unused)", + "307": "Temporary Redirect", + "308": "Permanent Redirect", + "400": "Bad Request", + "401": "Unauthorized", + "402": "Payment Required", + "403": "Forbidden", + "404": "Not Found", + "405": "Method Not Allowed", + "406": "Not Acceptable", + "407": "Proxy Authentication Required", + "408": "Request Timeout", + "409": "Conflict", + "410": "Gone", + "411": "Length Required", + "412": "Precondition Failed", + "413": "Payload Too Large", + "414": "URI Too Long", + "415": "Unsupported Media Type", + "416": "Range Not Satisfiable", + "417": "Expectation Failed", + "418": "I'm a teapot", + "421": "Misdirected Request", + "422": "Unprocessable Entity", + "423": "Locked", + "424": "Failed Dependency", + "425": "Unordered Collection", + "426": "Upgrade Required", + "428": "Precondition Required", + "429": "Too Many Requests", + "431": "Request Header Fields Too Large", + "451": "Unavailable For Legal Reasons", + "500": "Internal Server Error", + "501": "Not Implemented", + "502": "Bad Gateway", + "503": "Service Unavailable", + "504": "Gateway Timeout", + "505": "HTTP Version Not Supported", + "506": "Variant Also Negotiates", + "507": "Insufficient Storage", + "508": "Loop Detected", + "509": "Bandwidth Limit Exceeded", + "510": "Not Extended", + "511": "Network Authentication Required" + }; + } +}); + +// node_modules/statuses/index.js +var require_statuses = __commonJS({ + "node_modules/statuses/index.js"(exports2, module2) { + "use strict"; + var codes = require_codes(); + module2.exports = status; + status.STATUS_CODES = codes; + status.codes = populateStatusesMap(status, codes); + status.redirect = { + 300: true, + 301: true, + 302: true, + 303: true, + 305: true, + 307: true, + 308: true + }; + status.empty = { + 204: true, + 205: true, + 304: true + }; + status.retry = { + 502: true, + 503: true, + 504: true + }; + function populateStatusesMap(statuses, codes2) { + var arr = []; + Object.keys(codes2).forEach(function forEachCode(code) { + var message2 = codes2[code]; + var status2 = Number(code); + statuses[status2] = message2; + statuses[message2] = status2; + statuses[message2.toLowerCase()] = status2; + arr.push(status2); + }); + return arr; + } + function status(code) { + if (typeof code === "number") { + if (!status[code]) throw new Error("invalid status code: " + code); + return code; + } + if (typeof code !== "string") { + throw new TypeError("code must be a number or string"); + } + var n4 = parseInt(code, 10); + if (!isNaN(n4)) { + if (!status[n4]) throw new Error("invalid status code: " + n4); + return n4; + } + n4 = status[code.toLowerCase()]; + if (!n4) throw new Error('invalid status message: "' + code + '"'); + return n4; + } + } +}); + +// node_modules/inherits/inherits_browser.js +var require_inherits_browser = __commonJS({ + "node_modules/inherits/inherits_browser.js"(exports2, module2) { + if (typeof Object.create === "function") { + module2.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; + } else { + module2.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + }; + } + } +}); + +// node_modules/inherits/inherits.js +var require_inherits = __commonJS({ + "node_modules/inherits/inherits.js"(exports2, module2) { + try { + util = require("util"); + if (typeof util.inherits !== "function") throw ""; + module2.exports = util.inherits; + } catch (e4) { + module2.exports = require_inherits_browser(); + } + var util; + } +}); + +// node_modules/http-errors/index.js +var require_http_errors = __commonJS({ + "node_modules/http-errors/index.js"(exports2, module2) { + "use strict"; + var deprecate2 = require_depd()("http-errors"); + var setPrototypeOf = require_setprototypeof(); + var statuses = require_statuses(); + var inherits = require_inherits(); + module2.exports = createError2; + module2.exports.HttpError = createHttpErrorConstructor(); + populateConstructorExports(module2.exports, statuses.codes, module2.exports.HttpError); + function codeClass(status) { + return Number(String(status).charAt(0) + "00"); + } + function createError2() { + var err; + var msg; + var status = 500; + var props = {}; + for (var i4 = 0; i4 < arguments.length; i4++) { + var arg = arguments[i4]; + if (arg instanceof Error) { + err = arg; + status = err.status || err.statusCode || status; + continue; + } + switch (typeof arg) { + case "string": + msg = arg; + break; + case "number": + status = arg; + if (i4 !== 0) { + deprecate2("non-first-argument status code; replace with createError(" + arg + ", ...)"); + } + break; + case "object": + props = arg; + break; + } + } + if (typeof status === "number" && (status < 400 || status >= 600)) { + deprecate2("non-error status code; use only 4xx or 5xx status codes"); + } + if (typeof status !== "number" || !statuses[status] && (status < 400 || status >= 600)) { + status = 500; + } + var HttpError = createError2[status] || createError2[codeClass(status)]; + if (!err) { + err = HttpError ? new HttpError(msg) : new Error(msg || statuses[status]); + Error.captureStackTrace(err, createError2); + } + if (!HttpError || !(err instanceof HttpError) || err.status !== status) { + err.expose = status < 500; + err.status = err.statusCode = status; + } + for (var key in props) { + if (key !== "status" && key !== "statusCode") { + err[key] = props[key]; + } + } + return err; + } + function createHttpErrorConstructor() { + function HttpError() { + throw new TypeError("cannot construct abstract class"); + } + inherits(HttpError, Error); + return HttpError; + } + function createClientErrorConstructor(HttpError, name, code) { + var className = name.match(/Error$/) ? name : name + "Error"; + function ClientError(message2) { + var msg = message2 != null ? message2 : statuses[code]; + var err = new Error(msg); + Error.captureStackTrace(err, ClientError); + setPrototypeOf(err, ClientError.prototype); + Object.defineProperty(err, "message", { + enumerable: true, + configurable: true, + value: msg, + writable: true + }); + Object.defineProperty(err, "name", { + enumerable: false, + configurable: true, + value: className, + writable: true + }); + return err; + } + inherits(ClientError, HttpError); + ClientError.prototype.status = code; + ClientError.prototype.statusCode = code; + ClientError.prototype.expose = true; + return ClientError; + } + function createServerErrorConstructor(HttpError, name, code) { + var className = name.match(/Error$/) ? name : name + "Error"; + function ServerError(message2) { + var msg = message2 != null ? message2 : statuses[code]; + var err = new Error(msg); + Error.captureStackTrace(err, ServerError); + setPrototypeOf(err, ServerError.prototype); + Object.defineProperty(err, "message", { + enumerable: true, + configurable: true, + value: msg, + writable: true + }); + Object.defineProperty(err, "name", { + enumerable: false, + configurable: true, + value: className, + writable: true + }); + return err; + } + inherits(ServerError, HttpError); + ServerError.prototype.status = code; + ServerError.prototype.statusCode = code; + ServerError.prototype.expose = false; + return ServerError; + } + function populateConstructorExports(exports3, codes, HttpError) { + codes.forEach(function forEachCode(code) { + var CodeError; + var name = toIdentifier(statuses[code]); + switch (codeClass(code)) { + case 400: + CodeError = createClientErrorConstructor(HttpError, name, code); + break; + case 500: + CodeError = createServerErrorConstructor(HttpError, name, code); + break; + } + if (CodeError) { + exports3[code] = CodeError; + exports3[name] = CodeError; + } + }); + exports3["I'mateapot"] = deprecate2.function( + exports3.ImATeapot, + `"I'mateapot"; use "ImATeapot" instead` + ); + } + function toIdentifier(str) { + return str.split(" ").map(function(token) { + return token.slice(0, 1).toUpperCase() + token.slice(1); + }).join("").replace(/[^ _0-9a-z]/gi, ""); + } + } +}); + +// node_modules/bytes/index.js +var require_bytes = __commonJS({ + "node_modules/bytes/index.js"(exports2, module2) { + "use strict"; + module2.exports = bytes; + module2.exports.format = format2; + module2.exports.parse = parse; + var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g; + var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/; + var map2 = { + b: 1, + kb: 1 << 10, + mb: 1 << 20, + gb: 1 << 30, + tb: (1 << 30) * 1024 + }; + var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb)$/i; + function bytes(value, options) { + if (typeof value === "string") { + return parse(value); + } + if (typeof value === "number") { + return format2(value, options); + } + return null; + } + function format2(value, options) { + if (!Number.isFinite(value)) { + return null; + } + var mag = Math.abs(value); + var thousandsSeparator = options && options.thousandsSeparator || ""; + var unitSeparator = options && options.unitSeparator || ""; + var decimalPlaces = options && options.decimalPlaces !== void 0 ? options.decimalPlaces : 2; + var fixedDecimals = Boolean(options && options.fixedDecimals); + var unit = options && options.unit || ""; + if (!unit || !map2[unit.toLowerCase()]) { + if (mag >= map2.tb) { + unit = "TB"; + } else if (mag >= map2.gb) { + unit = "GB"; + } else if (mag >= map2.mb) { + unit = "MB"; + } else if (mag >= map2.kb) { + unit = "KB"; + } else { + unit = "B"; + } + } + var val = value / map2[unit.toLowerCase()]; + var str = val.toFixed(decimalPlaces); + if (!fixedDecimals) { + str = str.replace(formatDecimalsRegExp, "$1"); + } + if (thousandsSeparator) { + str = str.replace(formatThousandsRegExp, thousandsSeparator); + } + return str + unitSeparator + unit; + } + function parse(val) { + if (typeof val === "number" && !isNaN(val)) { + return val; + } + if (typeof val !== "string") { + return null; + } + var results = parseRegExp.exec(val); + var floatValue; + var unit = "b"; + if (!results) { + floatValue = parseInt(val, 10); + unit = "b"; + } else { + floatValue = parseFloat(results[1]); + unit = results[4].toLowerCase(); + } + return Math.floor(map2[unit] * floatValue); + } + } +}); + +// node_modules/content-type/index.js +var require_content_type = __commonJS({ + "node_modules/content-type/index.js"(exports2) { + "use strict"; + var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g; + var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/; + var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; + var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g; + var QUOTE_REGEXP = /([\\"])/g; + var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; + exports2.format = format2; + exports2.parse = parse; + function format2(obj) { + if (!obj || typeof obj !== "object") { + throw new TypeError("argument obj is required"); + } + var parameters = obj.parameters; + var type = obj.type; + if (!type || !TYPE_REGEXP.test(type)) { + throw new TypeError("invalid type"); + } + var string = type; + if (parameters && typeof parameters === "object") { + var param; + var params = Object.keys(parameters).sort(); + for (var i4 = 0; i4 < params.length; i4++) { + param = params[i4]; + if (!TOKEN_REGEXP.test(param)) { + throw new TypeError("invalid parameter name"); + } + string += "; " + param + "=" + qstring(parameters[param]); + } + } + return string; + } + function parse(string) { + if (!string) { + throw new TypeError("argument string is required"); + } + var header = typeof string === "object" ? getcontenttype(string) : string; + if (typeof header !== "string") { + throw new TypeError("argument string is required to be a string"); + } + var index = header.indexOf(";"); + var type = index !== -1 ? header.slice(0, index).trim() : header.trim(); + if (!TYPE_REGEXP.test(type)) { + throw new TypeError("invalid media type"); + } + var obj = new ContentType(type.toLowerCase()); + if (index !== -1) { + var key; + var match; + var value; + PARAM_REGEXP.lastIndex = index; + while (match = PARAM_REGEXP.exec(header)) { + if (match.index !== index) { + throw new TypeError("invalid parameter format"); + } + index += match[0].length; + key = match[1].toLowerCase(); + value = match[2]; + if (value.charCodeAt(0) === 34) { + value = value.slice(1, -1); + if (value.indexOf("\\") !== -1) { + value = value.replace(QESC_REGEXP, "$1"); + } + } + obj.parameters[key] = value; + } + if (index !== header.length) { + throw new TypeError("invalid parameter format"); + } + } + return obj; + } + function getcontenttype(obj) { + var header; + if (typeof obj.getHeader === "function") { + header = obj.getHeader("content-type"); + } else if (typeof obj.headers === "object") { + header = obj.headers && obj.headers["content-type"]; + } + if (typeof header !== "string") { + throw new TypeError("content-type header is missing from object"); + } + return header; + } + function qstring(val) { + var str = String(val); + if (TOKEN_REGEXP.test(str)) { + return str; + } + if (str.length > 0 && !TEXT_REGEXP.test(str)) { + throw new TypeError("invalid parameter value"); + } + return '"' + str.replace(QUOTE_REGEXP, "\\$1") + '"'; + } + function ContentType(type) { + this.parameters = /* @__PURE__ */ Object.create(null); + this.type = type; + } + } +}); + +// node_modules/ms/index.js +var require_ms = __commonJS({ + "node_modules/ms/index.js"(exports2, module2) { + var s4 = 1e3; + var m4 = s4 * 60; + var h4 = m4 * 60; + var d4 = h4 * 24; + var y2 = d4 * 365.25; + module2.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === "string" && val.length > 0) { + return parse(val); + } else if (type === "number" && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) + ); + }; + function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n4 = parseFloat(match[1]); + var type = (match[2] || "ms").toLowerCase(); + switch (type) { + case "years": + case "year": + case "yrs": + case "yr": + case "y": + return n4 * y2; + case "days": + case "day": + case "d": + return n4 * d4; + case "hours": + case "hour": + case "hrs": + case "hr": + case "h": + return n4 * h4; + case "minutes": + case "minute": + case "mins": + case "min": + case "m": + return n4 * m4; + case "seconds": + case "second": + case "secs": + case "sec": + case "s": + return n4 * s4; + case "milliseconds": + case "millisecond": + case "msecs": + case "msec": + case "ms": + return n4; + default: + return void 0; + } + } + function fmtShort(ms) { + if (ms >= d4) { + return Math.round(ms / d4) + "d"; + } + if (ms >= h4) { + return Math.round(ms / h4) + "h"; + } + if (ms >= m4) { + return Math.round(ms / m4) + "m"; + } + if (ms >= s4) { + return Math.round(ms / s4) + "s"; + } + return ms + "ms"; + } + function fmtLong(ms) { + return plural(ms, d4, "day") || plural(ms, h4, "hour") || plural(ms, m4, "minute") || plural(ms, s4, "second") || ms + " ms"; + } + function plural(ms, n4, name) { + if (ms < n4) { + return; + } + if (ms < n4 * 1.5) { + return Math.floor(ms / n4) + " " + name; + } + return Math.ceil(ms / n4) + " " + name + "s"; + } + } +}); + +// node_modules/debug/src/debug.js +var require_debug = __commonJS({ + "node_modules/debug/src/debug.js"(exports2, module2) { + exports2 = module2.exports = createDebug.debug = createDebug["default"] = createDebug; + exports2.coerce = coerce; + exports2.disable = disable; + exports2.enable = enable; + exports2.enabled = enabled; + exports2.humanize = require_ms(); + exports2.names = []; + exports2.skips = []; + exports2.formatters = {}; + var prevTime; + function selectColor(namespace) { + var hash = 0, i4; + for (i4 in namespace) { + hash = (hash << 5) - hash + namespace.charCodeAt(i4); + hash |= 0; + } + return exports2.colors[Math.abs(hash) % exports2.colors.length]; + } + function createDebug(namespace) { + function debug() { + if (!debug.enabled) return; + var self2 = debug; + var curr = +/* @__PURE__ */ new Date(); + var ms = curr - (prevTime || curr); + self2.diff = ms; + self2.prev = prevTime; + self2.curr = curr; + prevTime = curr; + var args2 = new Array(arguments.length); + for (var i4 = 0; i4 < args2.length; i4++) { + args2[i4] = arguments[i4]; + } + args2[0] = exports2.coerce(args2[0]); + if ("string" !== typeof args2[0]) { + args2.unshift("%O"); + } + var index = 0; + args2[0] = args2[0].replace(/%([a-zA-Z%])/g, function(match, format2) { + if (match === "%%") return match; + index++; + var formatter = exports2.formatters[format2]; + if ("function" === typeof formatter) { + var val = args2[index]; + match = formatter.call(self2, val); + args2.splice(index, 1); + index--; + } + return match; + }); + exports2.formatArgs.call(self2, args2); + var logFn = debug.log || exports2.log || console.log.bind(console); + logFn.apply(self2, args2); + } + debug.namespace = namespace; + debug.enabled = exports2.enabled(namespace); + debug.useColors = exports2.useColors(); + debug.color = selectColor(namespace); + if ("function" === typeof exports2.init) { + exports2.init(debug); + } + return debug; + } + function enable(namespaces) { + exports2.save(namespaces); + exports2.names = []; + exports2.skips = []; + var split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/); + var len = split.length; + for (var i4 = 0; i4 < len; i4++) { + if (!split[i4]) continue; + namespaces = split[i4].replace(/\*/g, ".*?"); + if (namespaces[0] === "-") { + exports2.skips.push(new RegExp("^" + namespaces.substr(1) + "$")); + } else { + exports2.names.push(new RegExp("^" + namespaces + "$")); + } + } + } + function disable() { + exports2.enable(""); + } + function enabled(name) { + var i4, len; + for (i4 = 0, len = exports2.skips.length; i4 < len; i4++) { + if (exports2.skips[i4].test(name)) { + return false; + } + } + for (i4 = 0, len = exports2.names.length; i4 < len; i4++) { + if (exports2.names[i4].test(name)) { + return true; + } + } + return false; + } + function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; + } + } +}); + +// node_modules/debug/src/browser.js +var require_browser = __commonJS({ + "node_modules/debug/src/browser.js"(exports2, module2) { + exports2 = module2.exports = require_debug(); + exports2.log = log2; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load; + exports2.useColors = useColors; + exports2.storage = "undefined" != typeof chrome && "undefined" != typeof chrome.storage ? chrome.storage.local : localstorage(); + exports2.colors = [ + "lightseagreen", + "forestgreen", + "goldenrod", + "dodgerblue", + "darkorchid", + "crimson" + ]; + function useColors() { + if (typeof window !== "undefined" && window.process && window.process.type === "renderer") { + return true; + } + return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker + typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); + } + exports2.formatters.j = function(v4) { + try { + return JSON.stringify(v4); + } catch (err) { + return "[UnexpectedJSONParseError]: " + err.message; + } + }; + function formatArgs(args2) { + var useColors2 = this.useColors; + args2[0] = (useColors2 ? "%c" : "") + this.namespace + (useColors2 ? " %c" : " ") + args2[0] + (useColors2 ? "%c " : " ") + "+" + exports2.humanize(this.diff); + if (!useColors2) return; + var c4 = "color: " + this.color; + args2.splice(1, 0, c4, "color: inherit"); + var index = 0; + var lastC = 0; + args2[0].replace(/%[a-zA-Z%]/g, function(match) { + if ("%%" === match) return; + index++; + if ("%c" === match) { + lastC = index; + } + }); + args2.splice(lastC, 0, c4); + } + function log2() { + return "object" === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments); + } + function save(namespaces) { + try { + if (null == namespaces) { + exports2.storage.removeItem("debug"); + } else { + exports2.storage.debug = namespaces; + } + } catch (e4) { + } + } + function load() { + var r4; + try { + r4 = exports2.storage.debug; + } catch (e4) { + } + if (!r4 && typeof process !== "undefined" && "env" in process) { + r4 = process.env.DEBUG; + } + return r4; + } + exports2.enable(load()); + function localstorage() { + try { + return window.localStorage; + } catch (e4) { + } + } + } +}); + +// node_modules/debug/src/node.js +var require_node = __commonJS({ + "node_modules/debug/src/node.js"(exports2, module2) { + var tty = require("tty"); + var util = require("util"); + exports2 = module2.exports = require_debug(); + exports2.init = init; + exports2.log = log2; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load; + exports2.useColors = useColors; + exports2.colors = [6, 2, 3, 4, 5, 1]; + exports2.inspectOpts = Object.keys(process.env).filter(function(key) { + return /^debug_/i.test(key); + }).reduce(function(obj, key) { + var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function(_, k4) { + return k4.toUpperCase(); + }); + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === "null") val = null; + else val = Number(val); + obj[prop] = val; + return obj; + }, {}); + var fd = parseInt(process.env.DEBUG_FD, 10) || 2; + if (1 !== fd && 2 !== fd) { + util.deprecate(function() { + }, "except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")(); + } + var stream = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd); + function useColors() { + return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(fd); + } + exports2.formatters.o = function(v4) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v4, this.inspectOpts).split("\n").map(function(str) { + return str.trim(); + }).join(" "); + }; + exports2.formatters.O = function(v4) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v4, this.inspectOpts); + }; + function formatArgs(args2) { + var name = this.namespace; + var useColors2 = this.useColors; + if (useColors2) { + var c4 = this.color; + var prefix = " \x1B[3" + c4 + ";1m" + name + " \x1B[0m"; + args2[0] = prefix + args2[0].split("\n").join("\n" + prefix); + args2.push("\x1B[3" + c4 + "m+" + exports2.humanize(this.diff) + "\x1B[0m"); + } else { + args2[0] = (/* @__PURE__ */ new Date()).toUTCString() + " " + name + " " + args2[0]; + } + } + function log2() { + return stream.write(util.format.apply(util, arguments) + "\n"); + } + function save(namespaces) { + if (null == namespaces) { + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } + } + function load() { + return process.env.DEBUG; + } + function createWritableStdioStream(fd2) { + var stream2; + var tty_wrap = process.binding("tty_wrap"); + switch (tty_wrap.guessHandleType(fd2)) { + case "TTY": + stream2 = new tty.WriteStream(fd2); + stream2._type = "tty"; + if (stream2._handle && stream2._handle.unref) { + stream2._handle.unref(); + } + break; + case "FILE": + var fs = require("fs"); + stream2 = new fs.SyncWriteStream(fd2, { autoClose: false }); + stream2._type = "fs"; + break; + case "PIPE": + case "TCP": + var net = require("net"); + stream2 = new net.Socket({ + fd: fd2, + readable: false, + writable: true + }); + stream2.readable = false; + stream2.read = null; + stream2._type = "pipe"; + if (stream2._handle && stream2._handle.unref) { + stream2._handle.unref(); + } + break; + default: + throw new Error("Implement me. Unknown stream file type!"); + } + stream2.fd = fd2; + stream2._isStdio = true; + return stream2; + } + function init(debug) { + debug.inspectOpts = {}; + var keys = Object.keys(exports2.inspectOpts); + for (var i4 = 0; i4 < keys.length; i4++) { + debug.inspectOpts[keys[i4]] = exports2.inspectOpts[keys[i4]]; + } + } + exports2.enable(load()); + } +}); + +// node_modules/debug/src/index.js +var require_src = __commonJS({ + "node_modules/debug/src/index.js"(exports2, module2) { + if (typeof process !== "undefined" && process.type === "renderer") { + module2.exports = require_browser(); + } else { + module2.exports = require_node(); + } + } +}); + +// node_modules/safer-buffer/safer.js +var require_safer = __commonJS({ + "node_modules/safer-buffer/safer.js"(exports2, module2) { + "use strict"; + var buffer = require("buffer"); + var Buffer2 = buffer.Buffer; + var safer = {}; + var key; + for (key in buffer) { + if (!buffer.hasOwnProperty(key)) continue; + if (key === "SlowBuffer" || key === "Buffer") continue; + safer[key] = buffer[key]; + } + var Safer = safer.Buffer = {}; + for (key in Buffer2) { + if (!Buffer2.hasOwnProperty(key)) continue; + if (key === "allocUnsafe" || key === "allocUnsafeSlow") continue; + Safer[key] = Buffer2[key]; + } + safer.Buffer.prototype = Buffer2.prototype; + if (!Safer.from || Safer.from === Uint8Array.from) { + Safer.from = function(value, encodingOrOffset, length) { + if (typeof value === "number") { + throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value); + } + if (value && typeof value.length === "undefined") { + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + return Buffer2(value, encodingOrOffset, length); + }; + } + if (!Safer.alloc) { + Safer.alloc = function(size, fill, encoding) { + if (typeof size !== "number") { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size); + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + var buf = Buffer2(size); + if (!fill || fill.length === 0) { + buf.fill(0); + } else if (typeof encoding === "string") { + buf.fill(fill, encoding); + } else { + buf.fill(fill); + } + return buf; + }; + } + if (!safer.kStringMaxLength) { + try { + safer.kStringMaxLength = process.binding("buffer").kStringMaxLength; + } catch (e4) { + } + } + if (!safer.constants) { + safer.constants = { + MAX_LENGTH: safer.kMaxLength + }; + if (safer.kStringMaxLength) { + safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength; + } + } + module2.exports = safer; + } +}); + +// node_modules/iconv-lite/lib/bom-handling.js +var require_bom_handling = __commonJS({ + "node_modules/iconv-lite/lib/bom-handling.js"(exports2) { + "use strict"; + var BOMChar = "\uFEFF"; + exports2.PrependBOM = PrependBOMWrapper; + function PrependBOMWrapper(encoder, options) { + this.encoder = encoder; + this.addBOM = true; + } + PrependBOMWrapper.prototype.write = function(str) { + if (this.addBOM) { + str = BOMChar + str; + this.addBOM = false; + } + return this.encoder.write(str); + }; + PrependBOMWrapper.prototype.end = function() { + return this.encoder.end(); + }; + exports2.StripBOM = StripBOMWrapper; + function StripBOMWrapper(decoder, options) { + this.decoder = decoder; + this.pass = false; + this.options = options || {}; + } + StripBOMWrapper.prototype.write = function(buf) { + var res = this.decoder.write(buf); + if (this.pass || !res) + return res; + if (res[0] === BOMChar) { + res = res.slice(1); + if (typeof this.options.stripBOM === "function") + this.options.stripBOM(); + } + this.pass = true; + return res; + }; + StripBOMWrapper.prototype.end = function() { + return this.decoder.end(); + }; + } +}); + +// node_modules/iconv-lite/encodings/internal.js +var require_internal = __commonJS({ + "node_modules/iconv-lite/encodings/internal.js"(exports2, module2) { + "use strict"; + var Buffer2 = require_safer().Buffer; + module2.exports = { + // Encodings + utf8: { type: "_internal", bomAware: true }, + cesu8: { type: "_internal", bomAware: true }, + unicode11utf8: "utf8", + ucs2: { type: "_internal", bomAware: true }, + utf16le: "ucs2", + binary: { type: "_internal" }, + base64: { type: "_internal" }, + hex: { type: "_internal" }, + // Codec. + _internal: InternalCodec + }; + function InternalCodec(codecOptions, iconv) { + this.enc = codecOptions.encodingName; + this.bomAware = codecOptions.bomAware; + if (this.enc === "base64") + this.encoder = InternalEncoderBase64; + else if (this.enc === "cesu8") { + this.enc = "utf8"; + this.encoder = InternalEncoderCesu8; + if (Buffer2.from("eda0bdedb2a9", "hex").toString() !== "\u{1F4A9}") { + this.decoder = InternalDecoderCesu8; + this.defaultCharUnicode = iconv.defaultCharUnicode; + } + } + } + InternalCodec.prototype.encoder = InternalEncoder; + InternalCodec.prototype.decoder = InternalDecoder; + var StringDecoder = require("string_decoder").StringDecoder; + if (!StringDecoder.prototype.end) + StringDecoder.prototype.end = function() { + }; + function InternalDecoder(options, codec) { + StringDecoder.call(this, codec.enc); + } + InternalDecoder.prototype = StringDecoder.prototype; + function InternalEncoder(options, codec) { + this.enc = codec.enc; + } + InternalEncoder.prototype.write = function(str) { + return Buffer2.from(str, this.enc); + }; + InternalEncoder.prototype.end = function() { + }; + function InternalEncoderBase64(options, codec) { + this.prevStr = ""; + } + InternalEncoderBase64.prototype.write = function(str) { + str = this.prevStr + str; + var completeQuads = str.length - str.length % 4; + this.prevStr = str.slice(completeQuads); + str = str.slice(0, completeQuads); + return Buffer2.from(str, "base64"); + }; + InternalEncoderBase64.prototype.end = function() { + return Buffer2.from(this.prevStr, "base64"); + }; + function InternalEncoderCesu8(options, codec) { + } + InternalEncoderCesu8.prototype.write = function(str) { + var buf = Buffer2.alloc(str.length * 3), bufIdx = 0; + for (var i4 = 0; i4 < str.length; i4++) { + var charCode = str.charCodeAt(i4); + if (charCode < 128) + buf[bufIdx++] = charCode; + else if (charCode < 2048) { + buf[bufIdx++] = 192 + (charCode >>> 6); + buf[bufIdx++] = 128 + (charCode & 63); + } else { + buf[bufIdx++] = 224 + (charCode >>> 12); + buf[bufIdx++] = 128 + (charCode >>> 6 & 63); + buf[bufIdx++] = 128 + (charCode & 63); + } + } + return buf.slice(0, bufIdx); + }; + InternalEncoderCesu8.prototype.end = function() { + }; + function InternalDecoderCesu8(options, codec) { + this.acc = 0; + this.contBytes = 0; + this.accBytes = 0; + this.defaultCharUnicode = codec.defaultCharUnicode; + } + InternalDecoderCesu8.prototype.write = function(buf) { + var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, res = ""; + for (var i4 = 0; i4 < buf.length; i4++) { + var curByte = buf[i4]; + if ((curByte & 192) !== 128) { + if (contBytes > 0) { + res += this.defaultCharUnicode; + contBytes = 0; + } + if (curByte < 128) { + res += String.fromCharCode(curByte); + } else if (curByte < 224) { + acc = curByte & 31; + contBytes = 1; + accBytes = 1; + } else if (curByte < 240) { + acc = curByte & 15; + contBytes = 2; + accBytes = 1; + } else { + res += this.defaultCharUnicode; + } + } else { + if (contBytes > 0) { + acc = acc << 6 | curByte & 63; + contBytes--; + accBytes++; + if (contBytes === 0) { + if (accBytes === 2 && acc < 128 && acc > 0) + res += this.defaultCharUnicode; + else if (accBytes === 3 && acc < 2048) + res += this.defaultCharUnicode; + else + res += String.fromCharCode(acc); + } + } else { + res += this.defaultCharUnicode; + } + } + } + this.acc = acc; + this.contBytes = contBytes; + this.accBytes = accBytes; + return res; + }; + InternalDecoderCesu8.prototype.end = function() { + var res = 0; + if (this.contBytes > 0) + res += this.defaultCharUnicode; + return res; + }; + } +}); + +// node_modules/iconv-lite/encodings/utf16.js +var require_utf16 = __commonJS({ + "node_modules/iconv-lite/encodings/utf16.js"(exports2) { + "use strict"; + var Buffer2 = require_safer().Buffer; + exports2.utf16be = Utf16BECodec; + function Utf16BECodec() { + } + Utf16BECodec.prototype.encoder = Utf16BEEncoder; + Utf16BECodec.prototype.decoder = Utf16BEDecoder; + Utf16BECodec.prototype.bomAware = true; + function Utf16BEEncoder() { + } + Utf16BEEncoder.prototype.write = function(str) { + var buf = Buffer2.from(str, "ucs2"); + for (var i4 = 0; i4 < buf.length; i4 += 2) { + var tmp = buf[i4]; + buf[i4] = buf[i4 + 1]; + buf[i4 + 1] = tmp; + } + return buf; + }; + Utf16BEEncoder.prototype.end = function() { + }; + function Utf16BEDecoder() { + this.overflowByte = -1; + } + Utf16BEDecoder.prototype.write = function(buf) { + if (buf.length == 0) + return ""; + var buf2 = Buffer2.alloc(buf.length + 1), i4 = 0, j4 = 0; + if (this.overflowByte !== -1) { + buf2[0] = buf[0]; + buf2[1] = this.overflowByte; + i4 = 1; + j4 = 2; + } + for (; i4 < buf.length - 1; i4 += 2, j4 += 2) { + buf2[j4] = buf[i4 + 1]; + buf2[j4 + 1] = buf[i4]; + } + this.overflowByte = i4 == buf.length - 1 ? buf[buf.length - 1] : -1; + return buf2.slice(0, j4).toString("ucs2"); + }; + Utf16BEDecoder.prototype.end = function() { + }; + exports2.utf16 = Utf16Codec; + function Utf16Codec(codecOptions, iconv) { + this.iconv = iconv; + } + Utf16Codec.prototype.encoder = Utf16Encoder; + Utf16Codec.prototype.decoder = Utf16Decoder; + function Utf16Encoder(options, codec) { + options = options || {}; + if (options.addBOM === void 0) + options.addBOM = true; + this.encoder = codec.iconv.getEncoder("utf-16le", options); + } + Utf16Encoder.prototype.write = function(str) { + return this.encoder.write(str); + }; + Utf16Encoder.prototype.end = function() { + return this.encoder.end(); + }; + function Utf16Decoder(options, codec) { + this.decoder = null; + this.initialBytes = []; + this.initialBytesLen = 0; + this.options = options || {}; + this.iconv = codec.iconv; + } + Utf16Decoder.prototype.write = function(buf) { + if (!this.decoder) { + this.initialBytes.push(buf); + this.initialBytesLen += buf.length; + if (this.initialBytesLen < 16) + return ""; + var buf = Buffer2.concat(this.initialBytes), encoding = detectEncoding(buf, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + this.initialBytes.length = this.initialBytesLen = 0; + } + return this.decoder.write(buf); + }; + Utf16Decoder.prototype.end = function() { + if (!this.decoder) { + var buf = Buffer2.concat(this.initialBytes), encoding = detectEncoding(buf, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + var res = this.decoder.write(buf), trail = this.decoder.end(); + return trail ? res + trail : res; + } + return this.decoder.end(); + }; + function detectEncoding(buf, defaultEncoding) { + var enc = defaultEncoding || "utf-16le"; + if (buf.length >= 2) { + if (buf[0] == 254 && buf[1] == 255) + enc = "utf-16be"; + else if (buf[0] == 255 && buf[1] == 254) + enc = "utf-16le"; + else { + var asciiCharsLE = 0, asciiCharsBE = 0, _len = Math.min(buf.length - buf.length % 2, 64); + for (var i4 = 0; i4 < _len; i4 += 2) { + if (buf[i4] === 0 && buf[i4 + 1] !== 0) asciiCharsBE++; + if (buf[i4] !== 0 && buf[i4 + 1] === 0) asciiCharsLE++; + } + if (asciiCharsBE > asciiCharsLE) + enc = "utf-16be"; + else if (asciiCharsBE < asciiCharsLE) + enc = "utf-16le"; + } + } + return enc; + } + } +}); + +// node_modules/iconv-lite/encodings/utf7.js +var require_utf7 = __commonJS({ + "node_modules/iconv-lite/encodings/utf7.js"(exports2) { + "use strict"; + var Buffer2 = require_safer().Buffer; + exports2.utf7 = Utf7Codec; + exports2.unicode11utf7 = "utf7"; + function Utf7Codec(codecOptions, iconv) { + this.iconv = iconv; + } + Utf7Codec.prototype.encoder = Utf7Encoder; + Utf7Codec.prototype.decoder = Utf7Decoder; + Utf7Codec.prototype.bomAware = true; + var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; + function Utf7Encoder(options, codec) { + this.iconv = codec.iconv; + } + Utf7Encoder.prototype.write = function(str) { + return Buffer2.from(str.replace(nonDirectChars, function(chunk) { + return "+" + (chunk === "+" ? "" : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) + "-"; + }.bind(this))); + }; + Utf7Encoder.prototype.end = function() { + }; + function Utf7Decoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ""; + } + var base64Regex = /[A-Za-z0-9\/+]/; + var base64Chars = []; + for (i4 = 0; i4 < 256; i4++) + base64Chars[i4] = base64Regex.test(String.fromCharCode(i4)); + var i4; + var plusChar = "+".charCodeAt(0); + var minusChar = "-".charCodeAt(0); + var andChar = "&".charCodeAt(0); + Utf7Decoder.prototype.write = function(buf) { + var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum; + for (var i5 = 0; i5 < buf.length; i5++) { + if (!inBase64) { + if (buf[i5] == plusChar) { + res += this.iconv.decode(buf.slice(lastI, i5), "ascii"); + lastI = i5 + 1; + inBase64 = true; + } + } else { + if (!base64Chars[buf[i5]]) { + if (i5 == lastI && buf[i5] == minusChar) { + res += "+"; + } else { + var b64str = base64Accum + buf.slice(lastI, i5).toString(); + res += this.iconv.decode(Buffer2.from(b64str, "base64"), "utf16-be"); + } + if (buf[i5] != minusChar) + i5--; + lastI = i5 + 1; + inBase64 = false; + base64Accum = ""; + } + } + } + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); + } else { + var b64str = base64Accum + buf.slice(lastI).toString(); + var canBeDecoded = b64str.length - b64str.length % 8; + base64Accum = b64str.slice(canBeDecoded); + b64str = b64str.slice(0, canBeDecoded); + res += this.iconv.decode(Buffer2.from(b64str, "base64"), "utf16-be"); + } + this.inBase64 = inBase64; + this.base64Accum = base64Accum; + return res; + }; + Utf7Decoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer2.from(this.base64Accum, "base64"), "utf16-be"); + this.inBase64 = false; + this.base64Accum = ""; + return res; + }; + exports2.utf7imap = Utf7IMAPCodec; + function Utf7IMAPCodec(codecOptions, iconv) { + this.iconv = iconv; + } + Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; + Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; + Utf7IMAPCodec.prototype.bomAware = true; + function Utf7IMAPEncoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = Buffer2.alloc(6); + this.base64AccumIdx = 0; + } + Utf7IMAPEncoder.prototype.write = function(str) { + var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = Buffer2.alloc(str.length * 5 + 10), bufIdx = 0; + for (var i5 = 0; i5 < str.length; i5++) { + var uChar = str.charCodeAt(i5); + if (32 <= uChar && uChar <= 126) { + if (inBase64) { + if (base64AccumIdx > 0) { + bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx); + base64AccumIdx = 0; + } + buf[bufIdx++] = minusChar; + inBase64 = false; + } + if (!inBase64) { + buf[bufIdx++] = uChar; + if (uChar === andChar) + buf[bufIdx++] = minusChar; + } + } else { + if (!inBase64) { + buf[bufIdx++] = andChar; + inBase64 = true; + } + if (inBase64) { + base64Accum[base64AccumIdx++] = uChar >> 8; + base64Accum[base64AccumIdx++] = uChar & 255; + if (base64AccumIdx == base64Accum.length) { + bufIdx += buf.write(base64Accum.toString("base64").replace(/\//g, ","), bufIdx); + base64AccumIdx = 0; + } + } + } + } + this.inBase64 = inBase64; + this.base64AccumIdx = base64AccumIdx; + return buf.slice(0, bufIdx); + }; + Utf7IMAPEncoder.prototype.end = function() { + var buf = Buffer2.alloc(10), bufIdx = 0; + if (this.inBase64) { + if (this.base64AccumIdx > 0) { + bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx); + this.base64AccumIdx = 0; + } + buf[bufIdx++] = minusChar; + this.inBase64 = false; + } + return buf.slice(0, bufIdx); + }; + function Utf7IMAPDecoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ""; + } + var base64IMAPChars = base64Chars.slice(); + base64IMAPChars[",".charCodeAt(0)] = true; + Utf7IMAPDecoder.prototype.write = function(buf) { + var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum; + for (var i5 = 0; i5 < buf.length; i5++) { + if (!inBase64) { + if (buf[i5] == andChar) { + res += this.iconv.decode(buf.slice(lastI, i5), "ascii"); + lastI = i5 + 1; + inBase64 = true; + } + } else { + if (!base64IMAPChars[buf[i5]]) { + if (i5 == lastI && buf[i5] == minusChar) { + res += "&"; + } else { + var b64str = base64Accum + buf.slice(lastI, i5).toString().replace(/,/g, "/"); + res += this.iconv.decode(Buffer2.from(b64str, "base64"), "utf16-be"); + } + if (buf[i5] != minusChar) + i5--; + lastI = i5 + 1; + inBase64 = false; + base64Accum = ""; + } + } + } + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); + } else { + var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, "/"); + var canBeDecoded = b64str.length - b64str.length % 8; + base64Accum = b64str.slice(canBeDecoded); + b64str = b64str.slice(0, canBeDecoded); + res += this.iconv.decode(Buffer2.from(b64str, "base64"), "utf16-be"); + } + this.inBase64 = inBase64; + this.base64Accum = base64Accum; + return res; + }; + Utf7IMAPDecoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer2.from(this.base64Accum, "base64"), "utf16-be"); + this.inBase64 = false; + this.base64Accum = ""; + return res; + }; + } +}); + +// node_modules/iconv-lite/encodings/sbcs-codec.js +var require_sbcs_codec = __commonJS({ + "node_modules/iconv-lite/encodings/sbcs-codec.js"(exports2) { + "use strict"; + var Buffer2 = require_safer().Buffer; + exports2._sbcs = SBCSCodec; + function SBCSCodec(codecOptions, iconv) { + if (!codecOptions) + throw new Error("SBCS codec is called without the data."); + if (!codecOptions.chars || codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256) + throw new Error("Encoding '" + codecOptions.type + "' has incorrect 'chars' (must be of len 128 or 256)"); + if (codecOptions.chars.length === 128) { + var asciiString = ""; + for (var i4 = 0; i4 < 128; i4++) + asciiString += String.fromCharCode(i4); + codecOptions.chars = asciiString + codecOptions.chars; + } + this.decodeBuf = new Buffer2.from(codecOptions.chars, "ucs2"); + var encodeBuf = new Buffer2.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); + for (var i4 = 0; i4 < codecOptions.chars.length; i4++) + encodeBuf[codecOptions.chars.charCodeAt(i4)] = i4; + this.encodeBuf = encodeBuf; + } + SBCSCodec.prototype.encoder = SBCSEncoder; + SBCSCodec.prototype.decoder = SBCSDecoder; + function SBCSEncoder(options, codec) { + this.encodeBuf = codec.encodeBuf; + } + SBCSEncoder.prototype.write = function(str) { + var buf = Buffer2.alloc(str.length); + for (var i4 = 0; i4 < str.length; i4++) + buf[i4] = this.encodeBuf[str.charCodeAt(i4)]; + return buf; + }; + SBCSEncoder.prototype.end = function() { + }; + function SBCSDecoder(options, codec) { + this.decodeBuf = codec.decodeBuf; + } + SBCSDecoder.prototype.write = function(buf) { + var decodeBuf = this.decodeBuf; + var newBuf = Buffer2.alloc(buf.length * 2); + var idx1 = 0, idx2 = 0; + for (var i4 = 0; i4 < buf.length; i4++) { + idx1 = buf[i4] * 2; + idx2 = i4 * 2; + newBuf[idx2] = decodeBuf[idx1]; + newBuf[idx2 + 1] = decodeBuf[idx1 + 1]; + } + return newBuf.toString("ucs2"); + }; + SBCSDecoder.prototype.end = function() { + }; + } +}); + +// node_modules/iconv-lite/encodings/sbcs-data.js +var require_sbcs_data = __commonJS({ + "node_modules/iconv-lite/encodings/sbcs-data.js"(exports2, module2) { + "use strict"; + module2.exports = { + // Not supported by iconv, not sure why. + "10029": "maccenteuro", + "maccenteuro": { + "type": "_sbcs", + "chars": "\xC4\u0100\u0101\xC9\u0104\xD6\xDC\xE1\u0105\u010C\xE4\u010D\u0106\u0107\xE9\u0179\u017A\u010E\xED\u010F\u0112\u0113\u0116\xF3\u0117\xF4\xF6\xF5\xFA\u011A\u011B\xFC\u2020\xB0\u0118\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\u0119\xA8\u2260\u0123\u012E\u012F\u012A\u2264\u2265\u012B\u0136\u2202\u2211\u0142\u013B\u013C\u013D\u013E\u0139\u013A\u0145\u0146\u0143\xAC\u221A\u0144\u0147\u2206\xAB\xBB\u2026\xA0\u0148\u0150\xD5\u0151\u014C\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\u014D\u0154\u0155\u0158\u2039\u203A\u0159\u0156\u0157\u0160\u201A\u201E\u0161\u015A\u015B\xC1\u0164\u0165\xCD\u017D\u017E\u016A\xD3\xD4\u016B\u016E\xDA\u016F\u0170\u0171\u0172\u0173\xDD\xFD\u0137\u017B\u0141\u017C\u0122\u02C7" + }, + "808": "cp808", + "ibm808": "cp808", + "cp808": { + "type": "_sbcs", + "chars": "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0404\u0454\u0407\u0457\u040E\u045E\xB0\u2219\xB7\u221A\u2116\u20AC\u25A0\xA0" + }, + // Aliases of generated encodings. + "ascii8bit": "ascii", + "usascii": "ascii", + "ansix34": "ascii", + "ansix341968": "ascii", + "ansix341986": "ascii", + "csascii": "ascii", + "cp367": "ascii", + "ibm367": "ascii", + "isoir6": "ascii", + "iso646us": "ascii", + "iso646irv": "ascii", + "us": "ascii", + "latin1": "iso88591", + "latin2": "iso88592", + "latin3": "iso88593", + "latin4": "iso88594", + "latin5": "iso88599", + "latin6": "iso885910", + "latin7": "iso885913", + "latin8": "iso885914", + "latin9": "iso885915", + "latin10": "iso885916", + "csisolatin1": "iso88591", + "csisolatin2": "iso88592", + "csisolatin3": "iso88593", + "csisolatin4": "iso88594", + "csisolatincyrillic": "iso88595", + "csisolatinarabic": "iso88596", + "csisolatingreek": "iso88597", + "csisolatinhebrew": "iso88598", + "csisolatin5": "iso88599", + "csisolatin6": "iso885910", + "l1": "iso88591", + "l2": "iso88592", + "l3": "iso88593", + "l4": "iso88594", + "l5": "iso88599", + "l6": "iso885910", + "l7": "iso885913", + "l8": "iso885914", + "l9": "iso885915", + "l10": "iso885916", + "isoir14": "iso646jp", + "isoir57": "iso646cn", + "isoir100": "iso88591", + "isoir101": "iso88592", + "isoir109": "iso88593", + "isoir110": "iso88594", + "isoir144": "iso88595", + "isoir127": "iso88596", + "isoir126": "iso88597", + "isoir138": "iso88598", + "isoir148": "iso88599", + "isoir157": "iso885910", + "isoir166": "tis620", + "isoir179": "iso885913", + "isoir199": "iso885914", + "isoir203": "iso885915", + "isoir226": "iso885916", + "cp819": "iso88591", + "ibm819": "iso88591", + "cyrillic": "iso88595", + "arabic": "iso88596", + "arabic8": "iso88596", + "ecma114": "iso88596", + "asmo708": "iso88596", + "greek": "iso88597", + "greek8": "iso88597", + "ecma118": "iso88597", + "elot928": "iso88597", + "hebrew": "iso88598", + "hebrew8": "iso88598", + "turkish": "iso88599", + "turkish8": "iso88599", + "thai": "iso885911", + "thai8": "iso885911", + "celtic": "iso885914", + "celtic8": "iso885914", + "isoceltic": "iso885914", + "tis6200": "tis620", + "tis62025291": "tis620", + "tis62025330": "tis620", + "10000": "macroman", + "10006": "macgreek", + "10007": "maccyrillic", + "10079": "maciceland", + "10081": "macturkish", + "cspc8codepage437": "cp437", + "cspc775baltic": "cp775", + "cspc850multilingual": "cp850", + "cspcp852": "cp852", + "cspc862latinhebrew": "cp862", + "cpgr": "cp869", + "msee": "cp1250", + "mscyrl": "cp1251", + "msansi": "cp1252", + "msgreek": "cp1253", + "msturk": "cp1254", + "mshebr": "cp1255", + "msarab": "cp1256", + "winbaltrim": "cp1257", + "cp20866": "koi8r", + "20866": "koi8r", + "ibm878": "koi8r", + "cskoi8r": "koi8r", + "cp21866": "koi8u", + "21866": "koi8u", + "ibm1168": "koi8u", + "strk10482002": "rk1048", + "tcvn5712": "tcvn", + "tcvn57121": "tcvn", + "gb198880": "iso646cn", + "cn": "iso646cn", + "csiso14jisc6220ro": "iso646jp", + "jisc62201969ro": "iso646jp", + "jp": "iso646jp", + "cshproman8": "hproman8", + "r8": "hproman8", + "roman8": "hproman8", + "xroman8": "hproman8", + "ibm1051": "hproman8", + "mac": "macintosh", + "csmacintosh": "macintosh" + }; + } +}); + +// node_modules/iconv-lite/encodings/sbcs-data-generated.js +var require_sbcs_data_generated = __commonJS({ + "node_modules/iconv-lite/encodings/sbcs-data-generated.js"(exports2, module2) { + "use strict"; + module2.exports = { + "437": "cp437", + "737": "cp737", + "775": "cp775", + "850": "cp850", + "852": "cp852", + "855": "cp855", + "856": "cp856", + "857": "cp857", + "858": "cp858", + "860": "cp860", + "861": "cp861", + "862": "cp862", + "863": "cp863", + "864": "cp864", + "865": "cp865", + "866": "cp866", + "869": "cp869", + "874": "windows874", + "922": "cp922", + "1046": "cp1046", + "1124": "cp1124", + "1125": "cp1125", + "1129": "cp1129", + "1133": "cp1133", + "1161": "cp1161", + "1162": "cp1162", + "1163": "cp1163", + "1250": "windows1250", + "1251": "windows1251", + "1252": "windows1252", + "1253": "windows1253", + "1254": "windows1254", + "1255": "windows1255", + "1256": "windows1256", + "1257": "windows1257", + "1258": "windows1258", + "28591": "iso88591", + "28592": "iso88592", + "28593": "iso88593", + "28594": "iso88594", + "28595": "iso88595", + "28596": "iso88596", + "28597": "iso88597", + "28598": "iso88598", + "28599": "iso88599", + "28600": "iso885910", + "28601": "iso885911", + "28603": "iso885913", + "28604": "iso885914", + "28605": "iso885915", + "28606": "iso885916", + "windows874": { + "type": "_sbcs", + "chars": "\u20AC\uFFFD\uFFFD\uFFFD\uFFFD\u2026\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xA0\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD" + }, + "win874": "windows874", + "cp874": "windows874", + "windows1250": { + "type": "_sbcs", + "chars": "\u20AC\uFFFD\u201A\uFFFD\u201E\u2026\u2020\u2021\uFFFD\u2030\u0160\u2039\u015A\u0164\u017D\u0179\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\u0161\u203A\u015B\u0165\u017E\u017A\xA0\u02C7\u02D8\u0141\xA4\u0104\xA6\xA7\xA8\xA9\u015E\xAB\xAC\xAD\xAE\u017B\xB0\xB1\u02DB\u0142\xB4\xB5\xB6\xB7\xB8\u0105\u015F\xBB\u013D\u02DD\u013E\u017C\u0154\xC1\xC2\u0102\xC4\u0139\u0106\xC7\u010C\xC9\u0118\xCB\u011A\xCD\xCE\u010E\u0110\u0143\u0147\xD3\xD4\u0150\xD6\xD7\u0158\u016E\xDA\u0170\xDC\xDD\u0162\xDF\u0155\xE1\xE2\u0103\xE4\u013A\u0107\xE7\u010D\xE9\u0119\xEB\u011B\xED\xEE\u010F\u0111\u0144\u0148\xF3\xF4\u0151\xF6\xF7\u0159\u016F\xFA\u0171\xFC\xFD\u0163\u02D9" + }, + "win1250": "windows1250", + "cp1250": "windows1250", + "windows1251": { + "type": "_sbcs", + "chars": "\u0402\u0403\u201A\u0453\u201E\u2026\u2020\u2021\u20AC\u2030\u0409\u2039\u040A\u040C\u040B\u040F\u0452\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\u0459\u203A\u045A\u045C\u045B\u045F\xA0\u040E\u045E\u0408\xA4\u0490\xA6\xA7\u0401\xA9\u0404\xAB\xAC\xAD\xAE\u0407\xB0\xB1\u0406\u0456\u0491\xB5\xB6\xB7\u0451\u2116\u0454\xBB\u0458\u0405\u0455\u0457\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F" + }, + "win1251": "windows1251", + "cp1251": "windows1251", + "windows1252": { + "type": "_sbcs", + "chars": "\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\uFFFD\u017D\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\uFFFD\u017E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF" + }, + "win1252": "windows1252", + "cp1252": "windows1252", + "windows1253": { + "type": "_sbcs", + "chars": "\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\uFFFD\u2030\uFFFD\u2039\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\uFFFD\u203A\uFFFD\uFFFD\uFFFD\uFFFD\xA0\u0385\u0386\xA3\xA4\xA5\xA6\xA7\xA8\xA9\uFFFD\xAB\xAC\xAD\xAE\u2015\xB0\xB1\xB2\xB3\u0384\xB5\xB6\xB7\u0388\u0389\u038A\xBB\u038C\xBD\u038E\u038F\u0390\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\uFFFD\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03AA\u03AB\u03AC\u03AD\u03AE\u03AF\u03B0\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C2\u03C3\u03C4\u03C5\u03C6\u03C7\u03C8\u03C9\u03CA\u03CB\u03CC\u03CD\u03CE\uFFFD" + }, + "win1253": "windows1253", + "cp1253": "windows1253", + "windows1254": { + "type": "_sbcs", + "chars": "\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\uFFFD\uFFFD\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u011E\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u0130\u015E\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u011F\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u0131\u015F\xFF" + }, + "win1254": "windows1254", + "cp1254": "windows1254", + "windows1255": { + "type": "_sbcs", + "chars": "\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\uFFFD\u2039\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\uFFFD\u203A\uFFFD\uFFFD\uFFFD\uFFFD\xA0\xA1\xA2\xA3\u20AA\xA5\xA6\xA7\xA8\xA9\xD7\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xF7\xBB\xBC\xBD\xBE\xBF\u05B0\u05B1\u05B2\u05B3\u05B4\u05B5\u05B6\u05B7\u05B8\u05B9\u05BA\u05BB\u05BC\u05BD\u05BE\u05BF\u05C0\u05C1\u05C2\u05C3\u05F0\u05F1\u05F2\u05F3\u05F4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\uFFFD\uFFFD\u200E\u200F\uFFFD" + }, + "win1255": "windows1255", + "cp1255": "windows1255", + "windows1256": { + "type": "_sbcs", + "chars": "\u20AC\u067E\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0679\u2039\u0152\u0686\u0698\u0688\u06AF\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u06A9\u2122\u0691\u203A\u0153\u200C\u200D\u06BA\xA0\u060C\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\u06BE\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\u061B\xBB\xBC\xBD\xBE\u061F\u06C1\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\xD7\u0637\u0638\u0639\u063A\u0640\u0641\u0642\u0643\xE0\u0644\xE2\u0645\u0646\u0647\u0648\xE7\xE8\xE9\xEA\xEB\u0649\u064A\xEE\xEF\u064B\u064C\u064D\u064E\xF4\u064F\u0650\xF7\u0651\xF9\u0652\xFB\xFC\u200E\u200F\u06D2" + }, + "win1256": "windows1256", + "cp1256": "windows1256", + "windows1257": { + "type": "_sbcs", + "chars": "\u20AC\uFFFD\u201A\uFFFD\u201E\u2026\u2020\u2021\uFFFD\u2030\uFFFD\u2039\uFFFD\xA8\u02C7\xB8\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\uFFFD\u203A\uFFFD\xAF\u02DB\uFFFD\xA0\uFFFD\xA2\xA3\xA4\uFFFD\xA6\xA7\xD8\xA9\u0156\xAB\xAC\xAD\xAE\xC6\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xF8\xB9\u0157\xBB\xBC\xBD\xBE\xE6\u0104\u012E\u0100\u0106\xC4\xC5\u0118\u0112\u010C\xC9\u0179\u0116\u0122\u0136\u012A\u013B\u0160\u0143\u0145\xD3\u014C\xD5\xD6\xD7\u0172\u0141\u015A\u016A\xDC\u017B\u017D\xDF\u0105\u012F\u0101\u0107\xE4\xE5\u0119\u0113\u010D\xE9\u017A\u0117\u0123\u0137\u012B\u013C\u0161\u0144\u0146\xF3\u014D\xF5\xF6\xF7\u0173\u0142\u015B\u016B\xFC\u017C\u017E\u02D9" + }, + "win1257": "windows1257", + "cp1257": "windows1257", + "windows1258": { + "type": "_sbcs", + "chars": "\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\uFFFD\u2039\u0152\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\uFFFD\u203A\u0153\uFFFD\uFFFD\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\u0102\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\u0300\xCD\xCE\xCF\u0110\xD1\u0309\xD3\xD4\u01A0\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u01AF\u0303\xDF\xE0\xE1\xE2\u0103\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\u0301\xED\xEE\xEF\u0111\xF1\u0323\xF3\xF4\u01A1\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u01B0\u20AB\xFF" + }, + "win1258": "windows1258", + "cp1258": "windows1258", + "iso88591": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF" + }, + "cp28591": "iso88591", + "iso88592": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u02D8\u0141\xA4\u013D\u015A\xA7\xA8\u0160\u015E\u0164\u0179\xAD\u017D\u017B\xB0\u0105\u02DB\u0142\xB4\u013E\u015B\u02C7\xB8\u0161\u015F\u0165\u017A\u02DD\u017E\u017C\u0154\xC1\xC2\u0102\xC4\u0139\u0106\xC7\u010C\xC9\u0118\xCB\u011A\xCD\xCE\u010E\u0110\u0143\u0147\xD3\xD4\u0150\xD6\xD7\u0158\u016E\xDA\u0170\xDC\xDD\u0162\xDF\u0155\xE1\xE2\u0103\xE4\u013A\u0107\xE7\u010D\xE9\u0119\xEB\u011B\xED\xEE\u010F\u0111\u0144\u0148\xF3\xF4\u0151\xF6\xF7\u0159\u016F\xFA\u0171\xFC\xFD\u0163\u02D9" + }, + "cp28592": "iso88592", + "iso88593": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0126\u02D8\xA3\xA4\uFFFD\u0124\xA7\xA8\u0130\u015E\u011E\u0134\xAD\uFFFD\u017B\xB0\u0127\xB2\xB3\xB4\xB5\u0125\xB7\xB8\u0131\u015F\u011F\u0135\xBD\uFFFD\u017C\xC0\xC1\xC2\uFFFD\xC4\u010A\u0108\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\uFFFD\xD1\xD2\xD3\xD4\u0120\xD6\xD7\u011C\xD9\xDA\xDB\xDC\u016C\u015C\xDF\xE0\xE1\xE2\uFFFD\xE4\u010B\u0109\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\uFFFD\xF1\xF2\xF3\xF4\u0121\xF6\xF7\u011D\xF9\xFA\xFB\xFC\u016D\u015D\u02D9" + }, + "cp28593": "iso88593", + "iso88594": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u0138\u0156\xA4\u0128\u013B\xA7\xA8\u0160\u0112\u0122\u0166\xAD\u017D\xAF\xB0\u0105\u02DB\u0157\xB4\u0129\u013C\u02C7\xB8\u0161\u0113\u0123\u0167\u014A\u017E\u014B\u0100\xC1\xC2\xC3\xC4\xC5\xC6\u012E\u010C\xC9\u0118\xCB\u0116\xCD\xCE\u012A\u0110\u0145\u014C\u0136\xD4\xD5\xD6\xD7\xD8\u0172\xDA\xDB\xDC\u0168\u016A\xDF\u0101\xE1\xE2\xE3\xE4\xE5\xE6\u012F\u010D\xE9\u0119\xEB\u0117\xED\xEE\u012B\u0111\u0146\u014D\u0137\xF4\xF5\xF6\xF7\xF8\u0173\xFA\xFB\xFC\u0169\u016B\u02D9" + }, + "cp28594": "iso88594", + "iso88595": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0401\u0402\u0403\u0404\u0405\u0406\u0407\u0408\u0409\u040A\u040B\u040C\xAD\u040E\u040F\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u2116\u0451\u0452\u0453\u0454\u0455\u0456\u0457\u0458\u0459\u045A\u045B\u045C\xA7\u045E\u045F" + }, + "cp28595": "iso88595", + "iso88596": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\uFFFD\uFFFD\uFFFD\xA4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u060C\xAD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u061B\uFFFD\uFFFD\uFFFD\u061F\uFFFD\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0640\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u064B\u064C\u064D\u064E\u064F\u0650\u0651\u0652\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD" + }, + "cp28596": "iso88596", + "iso88597": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u2018\u2019\xA3\u20AC\u20AF\xA6\xA7\xA8\xA9\u037A\xAB\xAC\xAD\uFFFD\u2015\xB0\xB1\xB2\xB3\u0384\u0385\u0386\xB7\u0388\u0389\u038A\xBB\u038C\xBD\u038E\u038F\u0390\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\uFFFD\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03AA\u03AB\u03AC\u03AD\u03AE\u03AF\u03B0\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C2\u03C3\u03C4\u03C5\u03C6\u03C7\u03C8\u03C9\u03CA\u03CB\u03CC\u03CD\u03CE\uFFFD" + }, + "cp28597": "iso88597", + "iso88598": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\uFFFD\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xD7\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xF7\xBB\xBC\xBD\xBE\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2017\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\uFFFD\uFFFD\u200E\u200F\uFFFD" + }, + "cp28598": "iso88598", + "iso88599": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u011E\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u0130\u015E\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u011F\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u0131\u015F\xFF" + }, + "cp28599": "iso88599", + "iso885910": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u0112\u0122\u012A\u0128\u0136\xA7\u013B\u0110\u0160\u0166\u017D\xAD\u016A\u014A\xB0\u0105\u0113\u0123\u012B\u0129\u0137\xB7\u013C\u0111\u0161\u0167\u017E\u2015\u016B\u014B\u0100\xC1\xC2\xC3\xC4\xC5\xC6\u012E\u010C\xC9\u0118\xCB\u0116\xCD\xCE\xCF\xD0\u0145\u014C\xD3\xD4\xD5\xD6\u0168\xD8\u0172\xDA\xDB\xDC\xDD\xDE\xDF\u0101\xE1\xE2\xE3\xE4\xE5\xE6\u012F\u010D\xE9\u0119\xEB\u0117\xED\xEE\xEF\xF0\u0146\u014D\xF3\xF4\xF5\xF6\u0169\xF8\u0173\xFA\xFB\xFC\xFD\xFE\u0138" + }, + "cp28600": "iso885910", + "iso885911": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD" + }, + "cp28601": "iso885911", + "iso885913": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u201D\xA2\xA3\xA4\u201E\xA6\xA7\xD8\xA9\u0156\xAB\xAC\xAD\xAE\xC6\xB0\xB1\xB2\xB3\u201C\xB5\xB6\xB7\xF8\xB9\u0157\xBB\xBC\xBD\xBE\xE6\u0104\u012E\u0100\u0106\xC4\xC5\u0118\u0112\u010C\xC9\u0179\u0116\u0122\u0136\u012A\u013B\u0160\u0143\u0145\xD3\u014C\xD5\xD6\xD7\u0172\u0141\u015A\u016A\xDC\u017B\u017D\xDF\u0105\u012F\u0101\u0107\xE4\xE5\u0119\u0113\u010D\xE9\u017A\u0117\u0123\u0137\u012B\u013C\u0161\u0144\u0146\xF3\u014D\xF5\xF6\xF7\u0173\u0142\u015B\u016B\xFC\u017C\u017E\u2019" + }, + "cp28603": "iso885913", + "iso885914": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u1E02\u1E03\xA3\u010A\u010B\u1E0A\xA7\u1E80\xA9\u1E82\u1E0B\u1EF2\xAD\xAE\u0178\u1E1E\u1E1F\u0120\u0121\u1E40\u1E41\xB6\u1E56\u1E81\u1E57\u1E83\u1E60\u1EF3\u1E84\u1E85\u1E61\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0174\xD1\xD2\xD3\xD4\xD5\xD6\u1E6A\xD8\xD9\xDA\xDB\xDC\xDD\u0176\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0175\xF1\xF2\xF3\xF4\xF5\xF6\u1E6B\xF8\xF9\xFA\xFB\xFC\xFD\u0177\xFF" + }, + "cp28604": "iso885914", + "iso885915": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\u20AC\xA5\u0160\xA7\u0161\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\u017D\xB5\xB6\xB7\u017E\xB9\xBA\xBB\u0152\u0153\u0178\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF" + }, + "cp28605": "iso885915", + "iso885916": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u0105\u0141\u20AC\u201E\u0160\xA7\u0161\xA9\u0218\xAB\u0179\xAD\u017A\u017B\xB0\xB1\u010C\u0142\u017D\u201D\xB6\xB7\u017E\u010D\u0219\xBB\u0152\u0153\u0178\u017C\xC0\xC1\xC2\u0102\xC4\u0106\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0110\u0143\xD2\xD3\xD4\u0150\xD6\u015A\u0170\xD9\xDA\xDB\xDC\u0118\u021A\xDF\xE0\xE1\xE2\u0103\xE4\u0107\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0111\u0144\xF2\xF3\xF4\u0151\xF6\u015B\u0171\xF9\xFA\xFB\xFC\u0119\u021B\xFF" + }, + "cp28606": "iso885916", + "cp437": { + "type": "_sbcs", + "chars": "\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0" + }, + "ibm437": "cp437", + "csibm437": "cp437", + "cp737": { + "type": "_sbcs", + "chars": "\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C2\u03C4\u03C5\u03C6\u03C7\u03C8\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03C9\u03AC\u03AD\u03AE\u03CA\u03AF\u03CC\u03CD\u03CB\u03CE\u0386\u0388\u0389\u038A\u038C\u038E\u038F\xB1\u2265\u2264\u03AA\u03AB\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0" + }, + "ibm737": "cp737", + "csibm737": "cp737", + "cp775": { + "type": "_sbcs", + "chars": "\u0106\xFC\xE9\u0101\xE4\u0123\xE5\u0107\u0142\u0113\u0156\u0157\u012B\u0179\xC4\xC5\xC9\xE6\xC6\u014D\xF6\u0122\xA2\u015A\u015B\xD6\xDC\xF8\xA3\xD8\xD7\xA4\u0100\u012A\xF3\u017B\u017C\u017A\u201D\xA6\xA9\xAE\xAC\xBD\xBC\u0141\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u0104\u010C\u0118\u0116\u2563\u2551\u2557\u255D\u012E\u0160\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u0172\u016A\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u017D\u0105\u010D\u0119\u0117\u012F\u0161\u0173\u016B\u017E\u2518\u250C\u2588\u2584\u258C\u2590\u2580\xD3\xDF\u014C\u0143\xF5\xD5\xB5\u0144\u0136\u0137\u013B\u013C\u0146\u0112\u0145\u2019\xAD\xB1\u201C\xBE\xB6\xA7\xF7\u201E\xB0\u2219\xB7\xB9\xB3\xB2\u25A0\xA0" + }, + "ibm775": "cp775", + "csibm775": "cp775", + "cp850": { + "type": "_sbcs", + "chars": "\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\xD7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xF0\xD0\xCA\xCB\xC8\u0131\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\xFE\xDE\xDA\xDB\xD9\xFD\xDD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0" + }, + "ibm850": "cp850", + "csibm850": "cp850", + "cp852": { + "type": "_sbcs", + "chars": "\xC7\xFC\xE9\xE2\xE4\u016F\u0107\xE7\u0142\xEB\u0150\u0151\xEE\u0179\xC4\u0106\xC9\u0139\u013A\xF4\xF6\u013D\u013E\u015A\u015B\xD6\xDC\u0164\u0165\u0141\xD7\u010D\xE1\xED\xF3\xFA\u0104\u0105\u017D\u017E\u0118\u0119\xAC\u017A\u010C\u015F\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\u011A\u015E\u2563\u2551\u2557\u255D\u017B\u017C\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u0102\u0103\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\u0111\u0110\u010E\xCB\u010F\u0147\xCD\xCE\u011B\u2518\u250C\u2588\u2584\u0162\u016E\u2580\xD3\xDF\xD4\u0143\u0144\u0148\u0160\u0161\u0154\xDA\u0155\u0170\xFD\xDD\u0163\xB4\xAD\u02DD\u02DB\u02C7\u02D8\xA7\xF7\xB8\xB0\xA8\u02D9\u0171\u0158\u0159\u25A0\xA0" + }, + "ibm852": "cp852", + "csibm852": "cp852", + "cp855": { + "type": "_sbcs", + "chars": "\u0452\u0402\u0453\u0403\u0451\u0401\u0454\u0404\u0455\u0405\u0456\u0406\u0457\u0407\u0458\u0408\u0459\u0409\u045A\u040A\u045B\u040B\u045C\u040C\u045E\u040E\u045F\u040F\u044E\u042E\u044A\u042A\u0430\u0410\u0431\u0411\u0446\u0426\u0434\u0414\u0435\u0415\u0444\u0424\u0433\u0413\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u0445\u0425\u0438\u0418\u2563\u2551\u2557\u255D\u0439\u0419\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u043A\u041A\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\u043B\u041B\u043C\u041C\u043D\u041D\u043E\u041E\u043F\u2518\u250C\u2588\u2584\u041F\u044F\u2580\u042F\u0440\u0420\u0441\u0421\u0442\u0422\u0443\u0423\u0436\u0416\u0432\u0412\u044C\u042C\u2116\xAD\u044B\u042B\u0437\u0417\u0448\u0428\u044D\u042D\u0449\u0429\u0447\u0427\xA7\u25A0\xA0" + }, + "ibm855": "cp855", + "csibm855": "cp855", + "cp856": { + "type": "_sbcs", + "chars": "\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\uFFFD\xA3\uFFFD\xD7\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xAE\xAC\xBD\xBC\uFFFD\xAB\xBB\u2591\u2592\u2593\u2502\u2524\uFFFD\uFFFD\uFFFD\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\uFFFD\uFFFD\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2518\u250C\u2588\u2584\xA6\uFFFD\u2580\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xB5\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0" + }, + "ibm856": "cp856", + "csibm856": "cp856", + "cp857": { + "type": "_sbcs", + "chars": "\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\u0131\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\u0130\xD6\xDC\xF8\xA3\xD8\u015E\u015F\xE1\xED\xF3\xFA\xF1\xD1\u011E\u011F\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xBA\xAA\xCA\xCB\xC8\uFFFD\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\uFFFD\xD7\xDA\xDB\xD9\xEC\xFF\xAF\xB4\xAD\xB1\uFFFD\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0" + }, + "ibm857": "cp857", + "csibm857": "cp857", + "cp858": { + "type": "_sbcs", + "chars": "\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\xD7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xF0\xD0\xCA\xCB\xC8\u20AC\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\xFE\xDE\xDA\xDB\xD9\xFD\xDD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0" + }, + "ibm858": "cp858", + "csibm858": "cp858", + "cp860": { + "type": "_sbcs", + "chars": "\xC7\xFC\xE9\xE2\xE3\xE0\xC1\xE7\xEA\xCA\xE8\xCD\xD4\xEC\xC3\xC2\xC9\xC0\xC8\xF4\xF5\xF2\xDA\xF9\xCC\xD5\xDC\xA2\xA3\xD9\u20A7\xD3\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xD2\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0" + }, + "ibm860": "cp860", + "csibm860": "cp860", + "cp861": { + "type": "_sbcs", + "chars": "\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xD0\xF0\xDE\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xFE\xFB\xDD\xFD\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xC1\xCD\xD3\xDA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0" + }, + "ibm861": "cp861", + "csibm861": "cp861", + "cp862": { + "type": "_sbcs", + "chars": "\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0" + }, + "ibm862": "cp862", + "csibm862": "cp862", + "cp863": { + "type": "_sbcs", + "chars": "\xC7\xFC\xE9\xE2\xC2\xE0\xB6\xE7\xEA\xEB\xE8\xEF\xEE\u2017\xC0\xA7\xC9\xC8\xCA\xF4\xCB\xCF\xFB\xF9\xA4\xD4\xDC\xA2\xA3\xD9\xDB\u0192\xA6\xB4\xF3\xFA\xA8\xB8\xB3\xAF\xCE\u2310\xAC\xBD\xBC\xBE\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0" + }, + "ibm863": "cp863", + "csibm863": "cp863", + "cp864": { + "type": "_sbcs", + "chars": "\0\x07\b \n\v\f\r\x1B !\"#$\u066A&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xB0\xB7\u2219\u221A\u2592\u2500\u2502\u253C\u2524\u252C\u251C\u2534\u2510\u250C\u2514\u2518\u03B2\u221E\u03C6\xB1\xBD\xBC\u2248\xAB\xBB\uFEF7\uFEF8\uFFFD\uFFFD\uFEFB\uFEFC\uFFFD\xA0\xAD\uFE82\xA3\xA4\uFE84\uFFFD\uFFFD\uFE8E\uFE8F\uFE95\uFE99\u060C\uFE9D\uFEA1\uFEA5\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\uFED1\u061B\uFEB1\uFEB5\uFEB9\u061F\xA2\uFE80\uFE81\uFE83\uFE85\uFECA\uFE8B\uFE8D\uFE91\uFE93\uFE97\uFE9B\uFE9F\uFEA3\uFEA7\uFEA9\uFEAB\uFEAD\uFEAF\uFEB3\uFEB7\uFEBB\uFEBF\uFEC1\uFEC5\uFECB\uFECF\xA6\xAC\xF7\xD7\uFEC9\u0640\uFED3\uFED7\uFEDB\uFEDF\uFEE3\uFEE7\uFEEB\uFEED\uFEEF\uFEF3\uFEBD\uFECC\uFECE\uFECD\uFEE1\uFE7D\u0651\uFEE5\uFEE9\uFEEC\uFEF0\uFEF2\uFED0\uFED5\uFEF5\uFEF6\uFEDD\uFED9\uFEF1\u25A0\uFFFD" + }, + "ibm864": "cp864", + "csibm864": "cp864", + "cp865": { + "type": "_sbcs", + "chars": "\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xA4\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0" + }, + "ibm865": "cp865", + "csibm865": "cp865", + "cp866": { + "type": "_sbcs", + "chars": "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0404\u0454\u0407\u0457\u040E\u045E\xB0\u2219\xB7\u221A\u2116\xA4\u25A0\xA0" + }, + "ibm866": "cp866", + "csibm866": "cp866", + "cp869": { + "type": "_sbcs", + "chars": "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0386\uFFFD\xB7\xAC\xA6\u2018\u2019\u0388\u2015\u0389\u038A\u03AA\u038C\uFFFD\uFFFD\u038E\u03AB\xA9\u038F\xB2\xB3\u03AC\xA3\u03AD\u03AE\u03AF\u03CA\u0390\u03CC\u03CD\u0391\u0392\u0393\u0394\u0395\u0396\u0397\xBD\u0398\u0399\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u039A\u039B\u039C\u039D\u2563\u2551\u2557\u255D\u039E\u039F\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u03A0\u03A1\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u2518\u250C\u2588\u2584\u03B4\u03B5\u2580\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C2\u03C4\u0384\xAD\xB1\u03C5\u03C6\u03C7\xA7\u03C8\u0385\xB0\xA8\u03C9\u03CB\u03B0\u03CE\u25A0\xA0" + }, + "ibm869": "cp869", + "csibm869": "cp869", + "cp922": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\u203E\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0160\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\u017D\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0161\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\u017E\xFF" + }, + "ibm922": "cp922", + "csibm922": "cp922", + "cp1046": { + "type": "_sbcs", + "chars": "\uFE88\xD7\xF7\uF8F6\uF8F5\uF8F4\uF8F7\uFE71\x88\u25A0\u2502\u2500\u2510\u250C\u2514\u2518\uFE79\uFE7B\uFE7D\uFE7F\uFE77\uFE8A\uFEF0\uFEF3\uFEF2\uFECE\uFECF\uFED0\uFEF6\uFEF8\uFEFA\uFEFC\xA0\uF8FA\uF8F9\uF8F8\xA4\uF8FB\uFE8B\uFE91\uFE97\uFE9B\uFE9F\uFEA3\u060C\xAD\uFEA7\uFEB3\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\uFEB7\u061B\uFEBB\uFEBF\uFECA\u061F\uFECB\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\uFEC7\u0639\u063A\uFECC\uFE82\uFE84\uFE8E\uFED3\u0640\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u064B\u064C\u064D\u064E\u064F\u0650\u0651\u0652\uFED7\uFEDB\uFEDF\uF8FC\uFEF5\uFEF7\uFEF9\uFEFB\uFEE3\uFEE7\uFEEC\uFEE9\uFFFD" + }, + "ibm1046": "cp1046", + "csibm1046": "cp1046", + "cp1124": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0401\u0402\u0490\u0404\u0405\u0406\u0407\u0408\u0409\u040A\u040B\u040C\xAD\u040E\u040F\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u2116\u0451\u0452\u0491\u0454\u0455\u0456\u0457\u0458\u0459\u045A\u045B\u045C\xA7\u045E\u045F" + }, + "ibm1124": "cp1124", + "csibm1124": "cp1124", + "cp1125": { + "type": "_sbcs", + "chars": "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0490\u0491\u0404\u0454\u0406\u0456\u0407\u0457\xB7\u221A\u2116\xA4\u25A0\xA0" + }, + "ibm1125": "cp1125", + "csibm1125": "cp1125", + "cp1129": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\u0153\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\u0178\xB5\xB6\xB7\u0152\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\u0102\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\u0300\xCD\xCE\xCF\u0110\xD1\u0309\xD3\xD4\u01A0\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u01AF\u0303\xDF\xE0\xE1\xE2\u0103\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\u0301\xED\xEE\xEF\u0111\xF1\u0323\xF3\xF4\u01A1\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u01B0\u20AB\xFF" + }, + "ibm1129": "cp1129", + "csibm1129": "cp1129", + "cp1133": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0E81\u0E82\u0E84\u0E87\u0E88\u0EAA\u0E8A\u0E8D\u0E94\u0E95\u0E96\u0E97\u0E99\u0E9A\u0E9B\u0E9C\u0E9D\u0E9E\u0E9F\u0EA1\u0EA2\u0EA3\u0EA5\u0EA7\u0EAB\u0EAD\u0EAE\uFFFD\uFFFD\uFFFD\u0EAF\u0EB0\u0EB2\u0EB3\u0EB4\u0EB5\u0EB6\u0EB7\u0EB8\u0EB9\u0EBC\u0EB1\u0EBB\u0EBD\uFFFD\uFFFD\uFFFD\u0EC0\u0EC1\u0EC2\u0EC3\u0EC4\u0EC8\u0EC9\u0ECA\u0ECB\u0ECC\u0ECD\u0EC6\uFFFD\u0EDC\u0EDD\u20AD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0ED0\u0ED1\u0ED2\u0ED3\u0ED4\u0ED5\u0ED6\u0ED7\u0ED8\u0ED9\uFFFD\uFFFD\xA2\xAC\xA6\uFFFD" + }, + "ibm1133": "cp1133", + "csibm1133": "cp1133", + "cp1161": { + "type": "_sbcs", + "chars": "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0E48\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\u0E49\u0E4A\u0E4B\u20AC\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\xA2\xAC\xA6\xA0" + }, + "ibm1161": "cp1161", + "csibm1161": "cp1161", + "cp1162": { + "type": "_sbcs", + "chars": "\u20AC\x81\x82\x83\x84\u2026\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD" + }, + "ibm1162": "cp1162", + "csibm1162": "cp1162", + "cp1163": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\u20AC\xA5\xA6\xA7\u0153\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\u0178\xB5\xB6\xB7\u0152\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\u0102\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\u0300\xCD\xCE\xCF\u0110\xD1\u0309\xD3\xD4\u01A0\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u01AF\u0303\xDF\xE0\xE1\xE2\u0103\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\u0301\xED\xEE\xEF\u0111\xF1\u0323\xF3\xF4\u01A1\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u01B0\u20AB\xFF" + }, + "ibm1163": "cp1163", + "csibm1163": "cp1163", + "maccroatian": { + "type": "_sbcs", + "chars": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\u0160\u2122\xB4\xA8\u2260\u017D\xD8\u221E\xB1\u2264\u2265\u2206\xB5\u2202\u2211\u220F\u0161\u222B\xAA\xBA\u2126\u017E\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u0106\xAB\u010C\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u0110\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\uFFFD\xA9\u2044\xA4\u2039\u203A\xC6\xBB\u2013\xB7\u201A\u201E\u2030\xC2\u0107\xC1\u010D\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u0111\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u03C0\xCB\u02DA\xB8\xCA\xE6\u02C7" + }, + "maccyrillic": { + "type": "_sbcs", + "chars": "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u2020\xB0\xA2\xA3\xA7\u2022\xB6\u0406\xAE\xA9\u2122\u0402\u0452\u2260\u0403\u0453\u221E\xB1\u2264\u2265\u0456\xB5\u2202\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040A\u045A\u0458\u0405\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\u040B\u045B\u040C\u045C\u0455\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u201E\u040E\u045E\u040F\u045F\u2116\u0401\u0451\u044F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\xA4" + }, + "macgreek": { + "type": "_sbcs", + "chars": "\xC4\xB9\xB2\xC9\xB3\xD6\xDC\u0385\xE0\xE2\xE4\u0384\xA8\xE7\xE9\xE8\xEA\xEB\xA3\u2122\xEE\xEF\u2022\xBD\u2030\xF4\xF6\xA6\xAD\xF9\xFB\xFC\u2020\u0393\u0394\u0398\u039B\u039E\u03A0\xDF\xAE\xA9\u03A3\u03AA\xA7\u2260\xB0\u0387\u0391\xB1\u2264\u2265\xA5\u0392\u0395\u0396\u0397\u0399\u039A\u039C\u03A6\u03AB\u03A8\u03A9\u03AC\u039D\xAC\u039F\u03A1\u2248\u03A4\xAB\xBB\u2026\xA0\u03A5\u03A7\u0386\u0388\u0153\u2013\u2015\u201C\u201D\u2018\u2019\xF7\u0389\u038A\u038C\u038E\u03AD\u03AE\u03AF\u03CC\u038F\u03CD\u03B1\u03B2\u03C8\u03B4\u03B5\u03C6\u03B3\u03B7\u03B9\u03BE\u03BA\u03BB\u03BC\u03BD\u03BF\u03C0\u03CE\u03C1\u03C3\u03C4\u03B8\u03C9\u03C2\u03C7\u03C5\u03B6\u03CA\u03CB\u0390\u03B0\uFFFD" + }, + "maciceland": { + "type": "_sbcs", + "chars": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\xDD\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\xD0\xF0\xDE\xFE\xFD\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7" + }, + "macroman": { + "type": "_sbcs", + "chars": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7" + }, + "macromania": { + "type": "_sbcs", + "chars": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\u0102\u015E\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\u0103\u015F\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\u2039\u203A\u0162\u0163\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7" + }, + "macthai": { + "type": "_sbcs", + "chars": "\xAB\xBB\u2026\uF88C\uF88F\uF892\uF895\uF898\uF88B\uF88E\uF891\uF894\uF897\u201C\u201D\uF899\uFFFD\u2022\uF884\uF889\uF885\uF886\uF887\uF888\uF88A\uF88D\uF890\uF893\uF896\u2018\u2019\uFFFD\xA0\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFEFF\u200B\u2013\u2014\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u2122\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\xAE\xA9\uFFFD\uFFFD\uFFFD\uFFFD" + }, + "macturkish": { + "type": "_sbcs", + "chars": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u011E\u011F\u0130\u0131\u015E\u015F\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\uFFFD\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7" + }, + "macukraine": { + "type": "_sbcs", + "chars": "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u2020\xB0\u0490\xA3\xA7\u2022\xB6\u0406\xAE\xA9\u2122\u0402\u0452\u2260\u0403\u0453\u221E\xB1\u2264\u2265\u0456\xB5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040A\u045A\u0458\u0405\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\u040B\u045B\u040C\u045C\u0455\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u201E\u040E\u045E\u040F\u045F\u2116\u0401\u0451\u044F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\xA4" + }, + "koi8r": { + "type": "_sbcs", + "chars": "\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2580\u2584\u2588\u258C\u2590\u2591\u2592\u2593\u2320\u25A0\u2219\u221A\u2248\u2264\u2265\xA0\u2321\xB0\xB2\xB7\xF7\u2550\u2551\u2552\u0451\u2553\u2554\u2555\u2556\u2557\u2558\u2559\u255A\u255B\u255C\u255D\u255E\u255F\u2560\u2561\u0401\u2562\u2563\u2564\u2565\u2566\u2567\u2568\u2569\u256A\u256B\u256C\xA9\u044E\u0430\u0431\u0446\u0434\u0435\u0444\u0433\u0445\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u044F\u0440\u0441\u0442\u0443\u0436\u0432\u044C\u044B\u0437\u0448\u044D\u0449\u0447\u044A\u042E\u0410\u0411\u0426\u0414\u0415\u0424\u0413\u0425\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u042F\u0420\u0421\u0422\u0423\u0416\u0412\u042C\u042B\u0417\u0428\u042D\u0429\u0427\u042A" + }, + "koi8u": { + "type": "_sbcs", + "chars": "\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2580\u2584\u2588\u258C\u2590\u2591\u2592\u2593\u2320\u25A0\u2219\u221A\u2248\u2264\u2265\xA0\u2321\xB0\xB2\xB7\xF7\u2550\u2551\u2552\u0451\u0454\u2554\u0456\u0457\u2557\u2558\u2559\u255A\u255B\u0491\u255D\u255E\u255F\u2560\u2561\u0401\u0404\u2563\u0406\u0407\u2566\u2567\u2568\u2569\u256A\u0490\u256C\xA9\u044E\u0430\u0431\u0446\u0434\u0435\u0444\u0433\u0445\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u044F\u0440\u0441\u0442\u0443\u0436\u0432\u044C\u044B\u0437\u0448\u044D\u0449\u0447\u044A\u042E\u0410\u0411\u0426\u0414\u0415\u0424\u0413\u0425\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u042F\u0420\u0421\u0422\u0423\u0416\u0412\u042C\u042B\u0417\u0428\u042D\u0429\u0427\u042A" + }, + "koi8ru": { + "type": "_sbcs", + "chars": "\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2580\u2584\u2588\u258C\u2590\u2591\u2592\u2593\u2320\u25A0\u2219\u221A\u2248\u2264\u2265\xA0\u2321\xB0\xB2\xB7\xF7\u2550\u2551\u2552\u0451\u0454\u2554\u0456\u0457\u2557\u2558\u2559\u255A\u255B\u0491\u045E\u255E\u255F\u2560\u2561\u0401\u0404\u2563\u0406\u0407\u2566\u2567\u2568\u2569\u256A\u0490\u040E\xA9\u044E\u0430\u0431\u0446\u0434\u0435\u0444\u0433\u0445\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u044F\u0440\u0441\u0442\u0443\u0436\u0432\u044C\u044B\u0437\u0448\u044D\u0449\u0447\u044A\u042E\u0410\u0411\u0426\u0414\u0415\u0424\u0413\u0425\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u042F\u0420\u0421\u0422\u0423\u0416\u0412\u042C\u042B\u0417\u0428\u042D\u0429\u0427\u042A" + }, + "koi8t": { + "type": "_sbcs", + "chars": "\u049B\u0493\u201A\u0492\u201E\u2026\u2020\u2021\uFFFD\u2030\u04B3\u2039\u04B2\u04B7\u04B6\uFFFD\u049A\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\uFFFD\u203A\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u04EF\u04EE\u0451\xA4\u04E3\xA6\xA7\uFFFD\uFFFD\uFFFD\xAB\xAC\xAD\xAE\uFFFD\xB0\xB1\xB2\u0401\uFFFD\u04E2\xB6\xB7\uFFFD\u2116\uFFFD\xBB\uFFFD\uFFFD\uFFFD\xA9\u044E\u0430\u0431\u0446\u0434\u0435\u0444\u0433\u0445\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u044F\u0440\u0441\u0442\u0443\u0436\u0432\u044C\u044B\u0437\u0448\u044D\u0449\u0447\u044A\u042E\u0410\u0411\u0426\u0414\u0415\u0424\u0413\u0425\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u042F\u0420\u0421\u0422\u0423\u0416\u0412\u042C\u042B\u0417\u0428\u042D\u0429\u0427\u042A" + }, + "armscii8": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\uFFFD\u0587\u0589)(\xBB\xAB\u2014.\u055D,-\u058A\u2026\u055C\u055B\u055E\u0531\u0561\u0532\u0562\u0533\u0563\u0534\u0564\u0535\u0565\u0536\u0566\u0537\u0567\u0538\u0568\u0539\u0569\u053A\u056A\u053B\u056B\u053C\u056C\u053D\u056D\u053E\u056E\u053F\u056F\u0540\u0570\u0541\u0571\u0542\u0572\u0543\u0573\u0544\u0574\u0545\u0575\u0546\u0576\u0547\u0577\u0548\u0578\u0549\u0579\u054A\u057A\u054B\u057B\u054C\u057C\u054D\u057D\u054E\u057E\u054F\u057F\u0550\u0580\u0551\u0581\u0552\u0582\u0553\u0583\u0554\u0584\u0555\u0585\u0556\u0586\u055A\uFFFD" + }, + "rk1048": { + "type": "_sbcs", + "chars": "\u0402\u0403\u201A\u0453\u201E\u2026\u2020\u2021\u20AC\u2030\u0409\u2039\u040A\u049A\u04BA\u040F\u0452\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\u0459\u203A\u045A\u049B\u04BB\u045F\xA0\u04B0\u04B1\u04D8\xA4\u04E8\xA6\xA7\u0401\xA9\u0492\xAB\xAC\xAD\xAE\u04AE\xB0\xB1\u0406\u0456\u04E9\xB5\xB6\xB7\u0451\u2116\u0493\xBB\u04D9\u04A2\u04A3\u04AF\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F" + }, + "tcvn": { + "type": "_sbcs", + "chars": "\0\xDA\u1EE4\u1EEA\u1EEC\u1EEE\x07\b \n\v\f\r\u1EE8\u1EF0\u1EF2\u1EF6\u1EF8\xDD\u1EF4\x1B !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xC0\u1EA2\xC3\xC1\u1EA0\u1EB6\u1EAC\xC8\u1EBA\u1EBC\xC9\u1EB8\u1EC6\xCC\u1EC8\u0128\xCD\u1ECA\xD2\u1ECE\xD5\xD3\u1ECC\u1ED8\u1EDC\u1EDE\u1EE0\u1EDA\u1EE2\xD9\u1EE6\u0168\xA0\u0102\xC2\xCA\xD4\u01A0\u01AF\u0110\u0103\xE2\xEA\xF4\u01A1\u01B0\u0111\u1EB0\u0300\u0309\u0303\u0301\u0323\xE0\u1EA3\xE3\xE1\u1EA1\u1EB2\u1EB1\u1EB3\u1EB5\u1EAF\u1EB4\u1EAE\u1EA6\u1EA8\u1EAA\u1EA4\u1EC0\u1EB7\u1EA7\u1EA9\u1EAB\u1EA5\u1EAD\xE8\u1EC2\u1EBB\u1EBD\xE9\u1EB9\u1EC1\u1EC3\u1EC5\u1EBF\u1EC7\xEC\u1EC9\u1EC4\u1EBE\u1ED2\u0129\xED\u1ECB\xF2\u1ED4\u1ECF\xF5\xF3\u1ECD\u1ED3\u1ED5\u1ED7\u1ED1\u1ED9\u1EDD\u1EDF\u1EE1\u1EDB\u1EE3\xF9\u1ED6\u1EE7\u0169\xFA\u1EE5\u1EEB\u1EED\u1EEF\u1EE9\u1EF1\u1EF3\u1EF7\u1EF9\xFD\u1EF5\u1ED0" + }, + "georgianacademy": { + "type": "_sbcs", + "chars": "\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10EF\u10F0\u10F1\u10F2\u10F3\u10F4\u10F5\u10F6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF" + }, + "georgianps": { + "type": "_sbcs", + "chars": "\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10F1\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10F2\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10F3\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10F4\u10EF\u10F0\u10F5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF" + }, + "pt154": { + "type": "_sbcs", + "chars": "\u0496\u0492\u04EE\u0493\u201E\u2026\u04B6\u04AE\u04B2\u04AF\u04A0\u04E2\u04A2\u049A\u04BA\u04B8\u0497\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u04B3\u04B7\u04A1\u04E3\u04A3\u049B\u04BB\u04B9\xA0\u040E\u045E\u0408\u04E8\u0498\u04B0\xA7\u0401\xA9\u04D8\xAB\xAC\u04EF\xAE\u049C\xB0\u04B1\u0406\u0456\u0499\u04E9\xB6\xB7\u0451\u2116\u04D9\xBB\u0458\u04AA\u04AB\u049D\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F" + }, + "viscii": { + "type": "_sbcs", + "chars": "\0\u1EB2\u1EB4\u1EAA\x07\b \n\v\f\r\u1EF6\u1EF8\x1B\u1EF4 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7F\u1EA0\u1EAE\u1EB0\u1EB6\u1EA4\u1EA6\u1EA8\u1EAC\u1EBC\u1EB8\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EE2\u1EDA\u1EDC\u1EDE\u1ECA\u1ECE\u1ECC\u1EC8\u1EE6\u0168\u1EE4\u1EF2\xD5\u1EAF\u1EB1\u1EB7\u1EA5\u1EA7\u1EA9\u1EAD\u1EBD\u1EB9\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1ED1\u1ED3\u1ED5\u1ED7\u1EE0\u01A0\u1ED9\u1EDD\u1EDF\u1ECB\u1EF0\u1EE8\u1EEA\u1EEC\u01A1\u1EDB\u01AF\xC0\xC1\xC2\xC3\u1EA2\u0102\u1EB3\u1EB5\xC8\xC9\xCA\u1EBA\xCC\xCD\u0128\u1EF3\u0110\u1EE9\xD2\xD3\xD4\u1EA1\u1EF7\u1EEB\u1EED\xD9\xDA\u1EF9\u1EF5\xDD\u1EE1\u01B0\xE0\xE1\xE2\xE3\u1EA3\u0103\u1EEF\u1EAB\xE8\xE9\xEA\u1EBB\xEC\xED\u0129\u1EC9\u0111\u1EF1\xF2\xF3\xF4\xF5\u1ECF\u1ECD\u1EE5\xF9\xFA\u0169\u1EE7\xFD\u1EE3\u1EEE" + }, + "iso646cn": { + "type": "_sbcs", + "chars": "\0\x07\b \n\v\f\r\x1B !\"#\xA5%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD" + }, + "iso646jp": { + "type": "_sbcs", + "chars": "\0\x07\b \n\v\f\r\x1B !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\xA5]^_`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD" + }, + "hproman8": { + "type": "_sbcs", + "chars": "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xC0\xC2\xC8\xCA\xCB\xCE\xCF\xB4\u02CB\u02C6\xA8\u02DC\xD9\xDB\u20A4\xAF\xDD\xFD\xB0\xC7\xE7\xD1\xF1\xA1\xBF\xA4\xA3\xA5\xA7\u0192\xA2\xE2\xEA\xF4\xFB\xE1\xE9\xF3\xFA\xE0\xE8\xF2\xF9\xE4\xEB\xF6\xFC\xC5\xEE\xD8\xC6\xE5\xED\xF8\xE6\xC4\xEC\xD6\xDC\xC9\xEF\xDF\xD4\xC1\xC3\xE3\xD0\xF0\xCD\xCC\xD3\xD2\xD5\xF5\u0160\u0161\xDA\u0178\xFF\xDE\xFE\xB7\xB5\xB6\xBE\u2014\xBC\xBD\xAA\xBA\xAB\u25A0\xBB\xB1\uFFFD" + }, + "macintosh": { + "type": "_sbcs", + "chars": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7" + }, + "ascii": { + "type": "_sbcs", + "chars": "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD" + }, + "tis620": { + "type": "_sbcs", + "chars": "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD" + } + }; + } +}); + +// node_modules/iconv-lite/encodings/dbcs-codec.js +var require_dbcs_codec = __commonJS({ + "node_modules/iconv-lite/encodings/dbcs-codec.js"(exports2) { + "use strict"; + var Buffer2 = require_safer().Buffer; + exports2._dbcs = DBCSCodec; + var UNASSIGNED = -1; + var GB18030_CODE = -2; + var SEQ_START = -10; + var NODE_START = -1e3; + var UNASSIGNED_NODE = new Array(256); + var DEF_CHAR = -1; + for (i4 = 0; i4 < 256; i4++) + UNASSIGNED_NODE[i4] = UNASSIGNED; + var i4; + function DBCSCodec(codecOptions, iconv) { + this.encodingName = codecOptions.encodingName; + if (!codecOptions) + throw new Error("DBCS codec is called without the data."); + if (!codecOptions.table) + throw new Error("Encoding '" + this.encodingName + "' has no data."); + var mappingTable = codecOptions.table(); + this.decodeTables = []; + this.decodeTables[0] = UNASSIGNED_NODE.slice(0); + this.decodeTableSeq = []; + for (var i5 = 0; i5 < mappingTable.length; i5++) + this._addDecodeChunk(mappingTable[i5]); + this.defaultCharUnicode = iconv.defaultCharUnicode; + this.encodeTable = []; + this.encodeTableSeq = []; + var skipEncodeChars = {}; + if (codecOptions.encodeSkipVals) + for (var i5 = 0; i5 < codecOptions.encodeSkipVals.length; i5++) { + var val = codecOptions.encodeSkipVals[i5]; + if (typeof val === "number") + skipEncodeChars[val] = true; + else + for (var j4 = val.from; j4 <= val.to; j4++) + skipEncodeChars[j4] = true; + } + this._fillEncodeTable(0, 0, skipEncodeChars); + if (codecOptions.encodeAdd) { + for (var uChar in codecOptions.encodeAdd) + if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) + this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); + } + this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; + if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]["?"]; + if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); + if (typeof codecOptions.gb18030 === "function") { + this.gb18030 = codecOptions.gb18030(); + var thirdByteNodeIdx = this.decodeTables.length; + var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0); + var fourthByteNodeIdx = this.decodeTables.length; + var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0); + for (var i5 = 129; i5 <= 254; i5++) { + var secondByteNodeIdx = NODE_START - this.decodeTables[0][i5]; + var secondByteNode = this.decodeTables[secondByteNodeIdx]; + for (var j4 = 48; j4 <= 57; j4++) + secondByteNode[j4] = NODE_START - thirdByteNodeIdx; + } + for (var i5 = 129; i5 <= 254; i5++) + thirdByteNode[i5] = NODE_START - fourthByteNodeIdx; + for (var i5 = 48; i5 <= 57; i5++) + fourthByteNode[i5] = GB18030_CODE; + } + } + DBCSCodec.prototype.encoder = DBCSEncoder; + DBCSCodec.prototype.decoder = DBCSDecoder; + DBCSCodec.prototype._getDecodeTrieNode = function(addr) { + var bytes = []; + for (; addr > 0; addr >>= 8) + bytes.push(addr & 255); + if (bytes.length == 0) + bytes.push(0); + var node = this.decodeTables[0]; + for (var i5 = bytes.length - 1; i5 > 0; i5--) { + var val = node[bytes[i5]]; + if (val == UNASSIGNED) { + node[bytes[i5]] = NODE_START - this.decodeTables.length; + this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); + } else if (val <= NODE_START) { + node = this.decodeTables[NODE_START - val]; + } else + throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); + } + return node; + }; + DBCSCodec.prototype._addDecodeChunk = function(chunk) { + var curAddr = parseInt(chunk[0], 16); + var writeTable = this._getDecodeTrieNode(curAddr); + curAddr = curAddr & 255; + for (var k4 = 1; k4 < chunk.length; k4++) { + var part = chunk[k4]; + if (typeof part === "string") { + for (var l4 = 0; l4 < part.length; ) { + var code = part.charCodeAt(l4++); + if (55296 <= code && code < 56320) { + var codeTrail = part.charCodeAt(l4++); + if (56320 <= codeTrail && codeTrail < 57344) + writeTable[curAddr++] = 65536 + (code - 55296) * 1024 + (codeTrail - 56320); + else + throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); + } else if (4080 < code && code <= 4095) { + var len = 4095 - code + 2; + var seq = []; + for (var m4 = 0; m4 < len; m4++) + seq.push(part.charCodeAt(l4++)); + writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; + this.decodeTableSeq.push(seq); + } else + writeTable[curAddr++] = code; + } + } else if (typeof part === "number") { + var charCode = writeTable[curAddr - 1] + 1; + for (var l4 = 0; l4 < part; l4++) + writeTable[curAddr++] = charCode++; + } else + throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); + } + if (curAddr > 255) + throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); + }; + DBCSCodec.prototype._getEncodeBucket = function(uCode) { + var high = uCode >> 8; + if (this.encodeTable[high] === void 0) + this.encodeTable[high] = UNASSIGNED_NODE.slice(0); + return this.encodeTable[high]; + }; + DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 255; + if (bucket[low] <= SEQ_START) + this.encodeTableSeq[SEQ_START - bucket[low]][DEF_CHAR] = dbcsCode; + else if (bucket[low] == UNASSIGNED) + bucket[low] = dbcsCode; + }; + DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { + var uCode = seq[0]; + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 255; + var node; + if (bucket[low] <= SEQ_START) { + node = this.encodeTableSeq[SEQ_START - bucket[low]]; + } else { + node = {}; + if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; + bucket[low] = SEQ_START - this.encodeTableSeq.length; + this.encodeTableSeq.push(node); + } + for (var j4 = 1; j4 < seq.length - 1; j4++) { + var oldVal = node[uCode]; + if (typeof oldVal === "object") + node = oldVal; + else { + node = node[uCode] = {}; + if (oldVal !== void 0) + node[DEF_CHAR] = oldVal; + } + } + uCode = seq[seq.length - 1]; + node[uCode] = dbcsCode; + }; + DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { + var node = this.decodeTables[nodeIdx]; + for (var i5 = 0; i5 < 256; i5++) { + var uCode = node[i5]; + var mbCode = prefix + i5; + if (skipEncodeChars[mbCode]) + continue; + if (uCode >= 0) + this._setEncodeChar(uCode, mbCode); + else if (uCode <= NODE_START) + this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars); + else if (uCode <= SEQ_START) + this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); + } + }; + function DBCSEncoder(options, codec) { + this.leadSurrogate = -1; + this.seqObj = void 0; + this.encodeTable = codec.encodeTable; + this.encodeTableSeq = codec.encodeTableSeq; + this.defaultCharSingleByte = codec.defCharSB; + this.gb18030 = codec.gb18030; + } + DBCSEncoder.prototype.write = function(str) { + var newBuf = Buffer2.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i5 = 0, j4 = 0; + while (true) { + if (nextChar === -1) { + if (i5 == str.length) break; + var uCode = str.charCodeAt(i5++); + } else { + var uCode = nextChar; + nextChar = -1; + } + if (55296 <= uCode && uCode < 57344) { + if (uCode < 56320) { + if (leadSurrogate === -1) { + leadSurrogate = uCode; + continue; + } else { + leadSurrogate = uCode; + uCode = UNASSIGNED; + } + } else { + if (leadSurrogate !== -1) { + uCode = 65536 + (leadSurrogate - 55296) * 1024 + (uCode - 56320); + leadSurrogate = -1; + } else { + uCode = UNASSIGNED; + } + } + } else if (leadSurrogate !== -1) { + nextChar = uCode; + uCode = UNASSIGNED; + leadSurrogate = -1; + } + var dbcsCode = UNASSIGNED; + if (seqObj !== void 0 && uCode != UNASSIGNED) { + var resCode = seqObj[uCode]; + if (typeof resCode === "object") { + seqObj = resCode; + continue; + } else if (typeof resCode == "number") { + dbcsCode = resCode; + } else if (resCode == void 0) { + resCode = seqObj[DEF_CHAR]; + if (resCode !== void 0) { + dbcsCode = resCode; + nextChar = uCode; + } else { + } + } + seqObj = void 0; + } else if (uCode >= 0) { + var subtable = this.encodeTable[uCode >> 8]; + if (subtable !== void 0) + dbcsCode = subtable[uCode & 255]; + if (dbcsCode <= SEQ_START) { + seqObj = this.encodeTableSeq[SEQ_START - dbcsCode]; + continue; + } + if (dbcsCode == UNASSIGNED && this.gb18030) { + var idx = findIdx(this.gb18030.uChars, uCode); + if (idx != -1) { + var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); + newBuf[j4++] = 129 + Math.floor(dbcsCode / 12600); + dbcsCode = dbcsCode % 12600; + newBuf[j4++] = 48 + Math.floor(dbcsCode / 1260); + dbcsCode = dbcsCode % 1260; + newBuf[j4++] = 129 + Math.floor(dbcsCode / 10); + dbcsCode = dbcsCode % 10; + newBuf[j4++] = 48 + dbcsCode; + continue; + } + } + } + if (dbcsCode === UNASSIGNED) + dbcsCode = this.defaultCharSingleByte; + if (dbcsCode < 256) { + newBuf[j4++] = dbcsCode; + } else if (dbcsCode < 65536) { + newBuf[j4++] = dbcsCode >> 8; + newBuf[j4++] = dbcsCode & 255; + } else { + newBuf[j4++] = dbcsCode >> 16; + newBuf[j4++] = dbcsCode >> 8 & 255; + newBuf[j4++] = dbcsCode & 255; + } + } + this.seqObj = seqObj; + this.leadSurrogate = leadSurrogate; + return newBuf.slice(0, j4); + }; + DBCSEncoder.prototype.end = function() { + if (this.leadSurrogate === -1 && this.seqObj === void 0) + return; + var newBuf = Buffer2.alloc(10), j4 = 0; + if (this.seqObj) { + var dbcsCode = this.seqObj[DEF_CHAR]; + if (dbcsCode !== void 0) { + if (dbcsCode < 256) { + newBuf[j4++] = dbcsCode; + } else { + newBuf[j4++] = dbcsCode >> 8; + newBuf[j4++] = dbcsCode & 255; + } + } else { + } + this.seqObj = void 0; + } + if (this.leadSurrogate !== -1) { + newBuf[j4++] = this.defaultCharSingleByte; + this.leadSurrogate = -1; + } + return newBuf.slice(0, j4); + }; + DBCSEncoder.prototype.findIdx = findIdx; + function DBCSDecoder(options, codec) { + this.nodeIdx = 0; + this.prevBuf = Buffer2.alloc(0); + this.decodeTables = codec.decodeTables; + this.decodeTableSeq = codec.decodeTableSeq; + this.defaultCharUnicode = codec.defaultCharUnicode; + this.gb18030 = codec.gb18030; + } + DBCSDecoder.prototype.write = function(buf) { + var newBuf = Buffer2.alloc(buf.length * 2), nodeIdx = this.nodeIdx, prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length, seqStart = -this.prevBuf.length, uCode; + if (prevBufOffset > 0) + prevBuf = Buffer2.concat([prevBuf, buf.slice(0, 10)]); + for (var i5 = 0, j4 = 0; i5 < buf.length; i5++) { + var curByte = i5 >= 0 ? buf[i5] : prevBuf[i5 + prevBufOffset]; + var uCode = this.decodeTables[nodeIdx][curByte]; + if (uCode >= 0) { + } else if (uCode === UNASSIGNED) { + i5 = seqStart; + uCode = this.defaultCharUnicode.charCodeAt(0); + } else if (uCode === GB18030_CODE) { + var curSeq = seqStart >= 0 ? buf.slice(seqStart, i5 + 1) : prevBuf.slice(seqStart + prevBufOffset, i5 + 1 + prevBufOffset); + var ptr = (curSeq[0] - 129) * 12600 + (curSeq[1] - 48) * 1260 + (curSeq[2] - 129) * 10 + (curSeq[3] - 48); + var idx = findIdx(this.gb18030.gbChars, ptr); + uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; + } else if (uCode <= NODE_START) { + nodeIdx = NODE_START - uCode; + continue; + } else if (uCode <= SEQ_START) { + var seq = this.decodeTableSeq[SEQ_START - uCode]; + for (var k4 = 0; k4 < seq.length - 1; k4++) { + uCode = seq[k4]; + newBuf[j4++] = uCode & 255; + newBuf[j4++] = uCode >> 8; + } + uCode = seq[seq.length - 1]; + } else + throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); + if (uCode > 65535) { + uCode -= 65536; + var uCodeLead = 55296 + Math.floor(uCode / 1024); + newBuf[j4++] = uCodeLead & 255; + newBuf[j4++] = uCodeLead >> 8; + uCode = 56320 + uCode % 1024; + } + newBuf[j4++] = uCode & 255; + newBuf[j4++] = uCode >> 8; + nodeIdx = 0; + seqStart = i5 + 1; + } + this.nodeIdx = nodeIdx; + this.prevBuf = seqStart >= 0 ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset); + return newBuf.slice(0, j4).toString("ucs2"); + }; + DBCSDecoder.prototype.end = function() { + var ret = ""; + while (this.prevBuf.length > 0) { + ret += this.defaultCharUnicode; + var buf = this.prevBuf.slice(1); + this.prevBuf = Buffer2.alloc(0); + this.nodeIdx = 0; + if (buf.length > 0) + ret += this.write(buf); + } + this.nodeIdx = 0; + return ret; + }; + function findIdx(table, val) { + if (table[0] > val) + return -1; + var l4 = 0, r4 = table.length; + while (l4 < r4 - 1) { + var mid = l4 + Math.floor((r4 - l4 + 1) / 2); + if (table[mid] <= val) + l4 = mid; + else + r4 = mid; + } + return l4; + } + } +}); + +// node_modules/iconv-lite/encodings/tables/shiftjis.json +var require_shiftjis = __commonJS({ + "node_modules/iconv-lite/encodings/tables/shiftjis.json"(exports2, module2) { + module2.exports = [ + ["0", "\0", 128], + ["a1", "\uFF61", 62], + ["8140", "\u3000\u3001\u3002\uFF0C\uFF0E\u30FB\uFF1A\uFF1B\uFF1F\uFF01\u309B\u309C\xB4\uFF40\xA8\uFF3E\uFFE3\uFF3F\u30FD\u30FE\u309D\u309E\u3003\u4EDD\u3005\u3006\u3007\u30FC\u2015\u2010\uFF0F\uFF3C\uFF5E\u2225\uFF5C\u2026\u2025\u2018\u2019\u201C\u201D\uFF08\uFF09\u3014\u3015\uFF3B\uFF3D\uFF5B\uFF5D\u3008", 9, "\uFF0B\uFF0D\xB1\xD7"], + ["8180", "\xF7\uFF1D\u2260\uFF1C\uFF1E\u2266\u2267\u221E\u2234\u2642\u2640\xB0\u2032\u2033\u2103\uFFE5\uFF04\uFFE0\uFFE1\uFF05\uFF03\uFF06\uFF0A\uFF20\xA7\u2606\u2605\u25CB\u25CF\u25CE\u25C7\u25C6\u25A1\u25A0\u25B3\u25B2\u25BD\u25BC\u203B\u3012\u2192\u2190\u2191\u2193\u3013"], + ["81b8", "\u2208\u220B\u2286\u2287\u2282\u2283\u222A\u2229"], + ["81c8", "\u2227\u2228\uFFE2\u21D2\u21D4\u2200\u2203"], + ["81da", "\u2220\u22A5\u2312\u2202\u2207\u2261\u2252\u226A\u226B\u221A\u223D\u221D\u2235\u222B\u222C"], + ["81f0", "\u212B\u2030\u266F\u266D\u266A\u2020\u2021\xB6"], + ["81fc", "\u25EF"], + ["824f", "\uFF10", 9], + ["8260", "\uFF21", 25], + ["8281", "\uFF41", 25], + ["829f", "\u3041", 82], + ["8340", "\u30A1", 62], + ["8380", "\u30E0", 22], + ["839f", "\u0391", 16, "\u03A3", 6], + ["83bf", "\u03B1", 16, "\u03C3", 6], + ["8440", "\u0410", 5, "\u0401\u0416", 25], + ["8470", "\u0430", 5, "\u0451\u0436", 7], + ["8480", "\u043E", 17], + ["849f", "\u2500\u2502\u250C\u2510\u2518\u2514\u251C\u252C\u2524\u2534\u253C\u2501\u2503\u250F\u2513\u251B\u2517\u2523\u2533\u252B\u253B\u254B\u2520\u252F\u2528\u2537\u253F\u251D\u2530\u2525\u2538\u2542"], + ["8740", "\u2460", 19, "\u2160", 9], + ["875f", "\u3349\u3314\u3322\u334D\u3318\u3327\u3303\u3336\u3351\u3357\u330D\u3326\u3323\u332B\u334A\u333B\u339C\u339D\u339E\u338E\u338F\u33C4\u33A1"], + ["877e", "\u337B"], + ["8780", "\u301D\u301F\u2116\u33CD\u2121\u32A4", 4, "\u3231\u3232\u3239\u337E\u337D\u337C\u2252\u2261\u222B\u222E\u2211\u221A\u22A5\u2220\u221F\u22BF\u2235\u2229\u222A"], + ["889f", "\u4E9C\u5516\u5A03\u963F\u54C0\u611B\u6328\u59F6\u9022\u8475\u831C\u7A50\u60AA\u63E1\u6E25\u65ED\u8466\u82A6\u9BF5\u6893\u5727\u65A1\u6271\u5B9B\u59D0\u867B\u98F4\u7D62\u7DBE\u9B8E\u6216\u7C9F\u88B7\u5B89\u5EB5\u6309\u6697\u6848\u95C7\u978D\u674F\u4EE5\u4F0A\u4F4D\u4F9D\u5049\u56F2\u5937\u59D4\u5A01\u5C09\u60DF\u610F\u6170\u6613\u6905\u70BA\u754F\u7570\u79FB\u7DAD\u7DEF\u80C3\u840E\u8863\u8B02\u9055\u907A\u533B\u4E95\u4EA5\u57DF\u80B2\u90C1\u78EF\u4E00\u58F1\u6EA2\u9038\u7A32\u8328\u828B\u9C2F\u5141\u5370\u54BD\u54E1\u56E0\u59FB\u5F15\u98F2\u6DEB\u80E4\u852D"], + ["8940", "\u9662\u9670\u96A0\u97FB\u540B\u53F3\u5B87\u70CF\u7FBD\u8FC2\u96E8\u536F\u9D5C\u7ABA\u4E11\u7893\u81FC\u6E26\u5618\u5504\u6B1D\u851A\u9C3B\u59E5\u53A9\u6D66\u74DC\u958F\u5642\u4E91\u904B\u96F2\u834F\u990C\u53E1\u55B6\u5B30\u5F71\u6620\u66F3\u6804\u6C38\u6CF3\u6D29\u745B\u76C8\u7A4E\u9834\u82F1\u885B\u8A60\u92ED\u6DB2\u75AB\u76CA\u99C5\u60A6\u8B01\u8D8A\u95B2\u698E\u53AD\u5186"], + ["8980", "\u5712\u5830\u5944\u5BB4\u5EF6\u6028\u63A9\u63F4\u6CBF\u6F14\u708E\u7114\u7159\u71D5\u733F\u7E01\u8276\u82D1\u8597\u9060\u925B\u9D1B\u5869\u65BC\u6C5A\u7525\u51F9\u592E\u5965\u5F80\u5FDC\u62BC\u65FA\u6A2A\u6B27\u6BB4\u738B\u7FC1\u8956\u9D2C\u9D0E\u9EC4\u5CA1\u6C96\u837B\u5104\u5C4B\u61B6\u81C6\u6876\u7261\u4E59\u4FFA\u5378\u6069\u6E29\u7A4F\u97F3\u4E0B\u5316\u4EEE\u4F55\u4F3D\u4FA1\u4F73\u52A0\u53EF\u5609\u590F\u5AC1\u5BB6\u5BE1\u79D1\u6687\u679C\u67B6\u6B4C\u6CB3\u706B\u73C2\u798D\u79BE\u7A3C\u7B87\u82B1\u82DB\u8304\u8377\u83EF\u83D3\u8766\u8AB2\u5629\u8CA8\u8FE6\u904E\u971E\u868A\u4FC4\u5CE8\u6211\u7259\u753B\u81E5\u82BD\u86FE\u8CC0\u96C5\u9913\u99D5\u4ECB\u4F1A\u89E3\u56DE\u584A\u58CA\u5EFB\u5FEB\u602A\u6094\u6062\u61D0\u6212\u62D0\u6539"], + ["8a40", "\u9B41\u6666\u68B0\u6D77\u7070\u754C\u7686\u7D75\u82A5\u87F9\u958B\u968E\u8C9D\u51F1\u52BE\u5916\u54B3\u5BB3\u5D16\u6168\u6982\u6DAF\u788D\u84CB\u8857\u8A72\u93A7\u9AB8\u6D6C\u99A8\u86D9\u57A3\u67FF\u86CE\u920E\u5283\u5687\u5404\u5ED3\u62E1\u64B9\u683C\u6838\u6BBB\u7372\u78BA\u7A6B\u899A\u89D2\u8D6B\u8F03\u90ED\u95A3\u9694\u9769\u5B66\u5CB3\u697D\u984D\u984E\u639B\u7B20\u6A2B"], + ["8a80", "\u6A7F\u68B6\u9C0D\u6F5F\u5272\u559D\u6070\u62EC\u6D3B\u6E07\u6ED1\u845B\u8910\u8F44\u4E14\u9C39\u53F6\u691B\u6A3A\u9784\u682A\u515C\u7AC3\u84B2\u91DC\u938C\u565B\u9D28\u6822\u8305\u8431\u7CA5\u5208\u82C5\u74E6\u4E7E\u4F83\u51A0\u5BD2\u520A\u52D8\u52E7\u5DFB\u559A\u582A\u59E6\u5B8C\u5B98\u5BDB\u5E72\u5E79\u60A3\u611F\u6163\u61BE\u63DB\u6562\u67D1\u6853\u68FA\u6B3E\u6B53\u6C57\u6F22\u6F97\u6F45\u74B0\u7518\u76E3\u770B\u7AFF\u7BA1\u7C21\u7DE9\u7F36\u7FF0\u809D\u8266\u839E\u89B3\u8ACC\u8CAB\u9084\u9451\u9593\u9591\u95A2\u9665\u97D3\u9928\u8218\u4E38\u542B\u5CB8\u5DCC\u73A9\u764C\u773C\u5CA9\u7FEB\u8D0B\u96C1\u9811\u9854\u9858\u4F01\u4F0E\u5371\u559C\u5668\u57FA\u5947\u5B09\u5BC4\u5C90\u5E0C\u5E7E\u5FCC\u63EE\u673A\u65D7\u65E2\u671F\u68CB\u68C4"], + ["8b40", "\u6A5F\u5E30\u6BC5\u6C17\u6C7D\u757F\u7948\u5B63\u7A00\u7D00\u5FBD\u898F\u8A18\u8CB4\u8D77\u8ECC\u8F1D\u98E2\u9A0E\u9B3C\u4E80\u507D\u5100\u5993\u5B9C\u622F\u6280\u64EC\u6B3A\u72A0\u7591\u7947\u7FA9\u87FB\u8ABC\u8B70\u63AC\u83CA\u97A0\u5409\u5403\u55AB\u6854\u6A58\u8A70\u7827\u6775\u9ECD\u5374\u5BA2\u811A\u8650\u9006\u4E18\u4E45\u4EC7\u4F11\u53CA\u5438\u5BAE\u5F13\u6025\u6551"], + ["8b80", "\u673D\u6C42\u6C72\u6CE3\u7078\u7403\u7A76\u7AAE\u7B08\u7D1A\u7CFE\u7D66\u65E7\u725B\u53BB\u5C45\u5DE8\u62D2\u62E0\u6319\u6E20\u865A\u8A31\u8DDD\u92F8\u6F01\u79A6\u9B5A\u4EA8\u4EAB\u4EAC\u4F9B\u4FA0\u50D1\u5147\u7AF6\u5171\u51F6\u5354\u5321\u537F\u53EB\u55AC\u5883\u5CE1\u5F37\u5F4A\u602F\u6050\u606D\u631F\u6559\u6A4B\u6CC1\u72C2\u72ED\u77EF\u80F8\u8105\u8208\u854E\u90F7\u93E1\u97FF\u9957\u9A5A\u4EF0\u51DD\u5C2D\u6681\u696D\u5C40\u66F2\u6975\u7389\u6850\u7C81\u50C5\u52E4\u5747\u5DFE\u9326\u65A4\u6B23\u6B3D\u7434\u7981\u79BD\u7B4B\u7DCA\u82B9\u83CC\u887F\u895F\u8B39\u8FD1\u91D1\u541F\u9280\u4E5D\u5036\u53E5\u533A\u72D7\u7396\u77E9\u82E6\u8EAF\u99C6\u99C8\u99D2\u5177\u611A\u865E\u55B0\u7A7A\u5076\u5BD3\u9047\u9685\u4E32\u6ADB\u91E7\u5C51\u5C48"], + ["8c40", "\u6398\u7A9F\u6C93\u9774\u8F61\u7AAA\u718A\u9688\u7C82\u6817\u7E70\u6851\u936C\u52F2\u541B\u85AB\u8A13\u7FA4\u8ECD\u90E1\u5366\u8888\u7941\u4FC2\u50BE\u5211\u5144\u5553\u572D\u73EA\u578B\u5951\u5F62\u5F84\u6075\u6176\u6167\u61A9\u63B2\u643A\u656C\u666F\u6842\u6E13\u7566\u7A3D\u7CFB\u7D4C\u7D99\u7E4B\u7F6B\u830E\u834A\u86CD\u8A08\u8A63\u8B66\u8EFD\u981A\u9D8F\u82B8\u8FCE\u9BE8"], + ["8c80", "\u5287\u621F\u6483\u6FC0\u9699\u6841\u5091\u6B20\u6C7A\u6F54\u7A74\u7D50\u8840\u8A23\u6708\u4EF6\u5039\u5026\u5065\u517C\u5238\u5263\u55A7\u570F\u5805\u5ACC\u5EFA\u61B2\u61F8\u62F3\u6372\u691C\u6A29\u727D\u72AC\u732E\u7814\u786F\u7D79\u770C\u80A9\u898B\u8B19\u8CE2\u8ED2\u9063\u9375\u967A\u9855\u9A13\u9E78\u5143\u539F\u53B3\u5E7B\u5F26\u6E1B\u6E90\u7384\u73FE\u7D43\u8237\u8A00\u8AFA\u9650\u4E4E\u500B\u53E4\u547C\u56FA\u59D1\u5B64\u5DF1\u5EAB\u5F27\u6238\u6545\u67AF\u6E56\u72D0\u7CCA\u88B4\u80A1\u80E1\u83F0\u864E\u8A87\u8DE8\u9237\u96C7\u9867\u9F13\u4E94\u4E92\u4F0D\u5348\u5449\u543E\u5A2F\u5F8C\u5FA1\u609F\u68A7\u6A8E\u745A\u7881\u8A9E\u8AA4\u8B77\u9190\u4E5E\u9BC9\u4EA4\u4F7C\u4FAF\u5019\u5016\u5149\u516C\u529F\u52B9\u52FE\u539A\u53E3\u5411"], + ["8d40", "\u540E\u5589\u5751\u57A2\u597D\u5B54\u5B5D\u5B8F\u5DE5\u5DE7\u5DF7\u5E78\u5E83\u5E9A\u5EB7\u5F18\u6052\u614C\u6297\u62D8\u63A7\u653B\u6602\u6643\u66F4\u676D\u6821\u6897\u69CB\u6C5F\u6D2A\u6D69\u6E2F\u6E9D\u7532\u7687\u786C\u7A3F\u7CE0\u7D05\u7D18\u7D5E\u7DB1\u8015\u8003\u80AF\u80B1\u8154\u818F\u822A\u8352\u884C\u8861\u8B1B\u8CA2\u8CFC\u90CA\u9175\u9271\u783F\u92FC\u95A4\u964D"], + ["8d80", "\u9805\u9999\u9AD8\u9D3B\u525B\u52AB\u53F7\u5408\u58D5\u62F7\u6FE0\u8C6A\u8F5F\u9EB9\u514B\u523B\u544A\u56FD\u7A40\u9177\u9D60\u9ED2\u7344\u6F09\u8170\u7511\u5FFD\u60DA\u9AA8\u72DB\u8FBC\u6B64\u9803\u4ECA\u56F0\u5764\u58BE\u5A5A\u6068\u61C7\u660F\u6606\u6839\u68B1\u6DF7\u75D5\u7D3A\u826E\u9B42\u4E9B\u4F50\u53C9\u5506\u5D6F\u5DE6\u5DEE\u67FB\u6C99\u7473\u7802\u8A50\u9396\u88DF\u5750\u5EA7\u632B\u50B5\u50AC\u518D\u6700\u54C9\u585E\u59BB\u5BB0\u5F69\u624D\u63A1\u683D\u6B73\u6E08\u707D\u91C7\u7280\u7815\u7826\u796D\u658E\u7D30\u83DC\u88C1\u8F09\u969B\u5264\u5728\u6750\u7F6A\u8CA1\u51B4\u5742\u962A\u583A\u698A\u80B4\u54B2\u5D0E\u57FC\u7895\u9DFA\u4F5C\u524A\u548B\u643E\u6628\u6714\u67F5\u7A84\u7B56\u7D22\u932F\u685C\u9BAD\u7B39\u5319\u518A\u5237"], + ["8e40", "\u5BDF\u62F6\u64AE\u64E6\u672D\u6BBA\u85A9\u96D1\u7690\u9BD6\u634C\u9306\u9BAB\u76BF\u6652\u4E09\u5098\u53C2\u5C71\u60E8\u6492\u6563\u685F\u71E6\u73CA\u7523\u7B97\u7E82\u8695\u8B83\u8CDB\u9178\u9910\u65AC\u66AB\u6B8B\u4ED5\u4ED4\u4F3A\u4F7F\u523A\u53F8\u53F2\u55E3\u56DB\u58EB\u59CB\u59C9\u59FF\u5B50\u5C4D\u5E02\u5E2B\u5FD7\u601D\u6307\u652F\u5B5C\u65AF\u65BD\u65E8\u679D\u6B62"], + ["8e80", "\u6B7B\u6C0F\u7345\u7949\u79C1\u7CF8\u7D19\u7D2B\u80A2\u8102\u81F3\u8996\u8A5E\u8A69\u8A66\u8A8C\u8AEE\u8CC7\u8CDC\u96CC\u98FC\u6B6F\u4E8B\u4F3C\u4F8D\u5150\u5B57\u5BFA\u6148\u6301\u6642\u6B21\u6ECB\u6CBB\u723E\u74BD\u75D4\u78C1\u793A\u800C\u8033\u81EA\u8494\u8F9E\u6C50\u9E7F\u5F0F\u8B58\u9D2B\u7AFA\u8EF8\u5B8D\u96EB\u4E03\u53F1\u57F7\u5931\u5AC9\u5BA4\u6089\u6E7F\u6F06\u75BE\u8CEA\u5B9F\u8500\u7BE0\u5072\u67F4\u829D\u5C61\u854A\u7E1E\u820E\u5199\u5C04\u6368\u8D66\u659C\u716E\u793E\u7D17\u8005\u8B1D\u8ECA\u906E\u86C7\u90AA\u501F\u52FA\u5C3A\u6753\u707C\u7235\u914C\u91C8\u932B\u82E5\u5BC2\u5F31\u60F9\u4E3B\u53D6\u5B88\u624B\u6731\u6B8A\u72E9\u73E0\u7A2E\u816B\u8DA3\u9152\u9996\u5112\u53D7\u546A\u5BFF\u6388\u6A39\u7DAC\u9700\u56DA\u53CE\u5468"], + ["8f40", "\u5B97\u5C31\u5DDE\u4FEE\u6101\u62FE\u6D32\u79C0\u79CB\u7D42\u7E4D\u7FD2\u81ED\u821F\u8490\u8846\u8972\u8B90\u8E74\u8F2F\u9031\u914B\u916C\u96C6\u919C\u4EC0\u4F4F\u5145\u5341\u5F93\u620E\u67D4\u6C41\u6E0B\u7363\u7E26\u91CD\u9283\u53D4\u5919\u5BBF\u6DD1\u795D\u7E2E\u7C9B\u587E\u719F\u51FA\u8853\u8FF0\u4FCA\u5CFB\u6625\u77AC\u7AE3\u821C\u99FF\u51C6\u5FAA\u65EC\u696F\u6B89\u6DF3"], + ["8f80", "\u6E96\u6F64\u76FE\u7D14\u5DE1\u9075\u9187\u9806\u51E6\u521D\u6240\u6691\u66D9\u6E1A\u5EB6\u7DD2\u7F72\u66F8\u85AF\u85F7\u8AF8\u52A9\u53D9\u5973\u5E8F\u5F90\u6055\u92E4\u9664\u50B7\u511F\u52DD\u5320\u5347\u53EC\u54E8\u5546\u5531\u5617\u5968\u59BE\u5A3C\u5BB5\u5C06\u5C0F\u5C11\u5C1A\u5E84\u5E8A\u5EE0\u5F70\u627F\u6284\u62DB\u638C\u6377\u6607\u660C\u662D\u6676\u677E\u68A2\u6A1F\u6A35\u6CBC\u6D88\u6E09\u6E58\u713C\u7126\u7167\u75C7\u7701\u785D\u7901\u7965\u79F0\u7AE0\u7B11\u7CA7\u7D39\u8096\u83D6\u848B\u8549\u885D\u88F3\u8A1F\u8A3C\u8A54\u8A73\u8C61\u8CDE\u91A4\u9266\u937E\u9418\u969C\u9798\u4E0A\u4E08\u4E1E\u4E57\u5197\u5270\u57CE\u5834\u58CC\u5B22\u5E38\u60C5\u64FE\u6761\u6756\u6D44\u72B6\u7573\u7A63\u84B8\u8B72\u91B8\u9320\u5631\u57F4\u98FE"], + ["9040", "\u62ED\u690D\u6B96\u71ED\u7E54\u8077\u8272\u89E6\u98DF\u8755\u8FB1\u5C3B\u4F38\u4FE1\u4FB5\u5507\u5A20\u5BDD\u5BE9\u5FC3\u614E\u632F\u65B0\u664B\u68EE\u699B\u6D78\u6DF1\u7533\u75B9\u771F\u795E\u79E6\u7D33\u81E3\u82AF\u85AA\u89AA\u8A3A\u8EAB\u8F9B\u9032\u91DD\u9707\u4EBA\u4EC1\u5203\u5875\u58EC\u5C0B\u751A\u5C3D\u814E\u8A0A\u8FC5\u9663\u976D\u7B25\u8ACF\u9808\u9162\u56F3\u53A8"], + ["9080", "\u9017\u5439\u5782\u5E25\u63A8\u6C34\u708A\u7761\u7C8B\u7FE0\u8870\u9042\u9154\u9310\u9318\u968F\u745E\u9AC4\u5D07\u5D69\u6570\u67A2\u8DA8\u96DB\u636E\u6749\u6919\u83C5\u9817\u96C0\u88FE\u6F84\u647A\u5BF8\u4E16\u702C\u755D\u662F\u51C4\u5236\u52E2\u59D3\u5F81\u6027\u6210\u653F\u6574\u661F\u6674\u68F2\u6816\u6B63\u6E05\u7272\u751F\u76DB\u7CBE\u8056\u58F0\u88FD\u897F\u8AA0\u8A93\u8ACB\u901D\u9192\u9752\u9759\u6589\u7A0E\u8106\u96BB\u5E2D\u60DC\u621A\u65A5\u6614\u6790\u77F3\u7A4D\u7C4D\u7E3E\u810A\u8CAC\u8D64\u8DE1\u8E5F\u78A9\u5207\u62D9\u63A5\u6442\u6298\u8A2D\u7A83\u7BC0\u8AAC\u96EA\u7D76\u820C\u8749\u4ED9\u5148\u5343\u5360\u5BA3\u5C02\u5C16\u5DDD\u6226\u6247\u64B0\u6813\u6834\u6CC9\u6D45\u6D17\u67D3\u6F5C\u714E\u717D\u65CB\u7A7F\u7BAD\u7DDA"], + ["9140", "\u7E4A\u7FA8\u817A\u821B\u8239\u85A6\u8A6E\u8CCE\u8DF5\u9078\u9077\u92AD\u9291\u9583\u9BAE\u524D\u5584\u6F38\u7136\u5168\u7985\u7E55\u81B3\u7CCE\u564C\u5851\u5CA8\u63AA\u66FE\u66FD\u695A\u72D9\u758F\u758E\u790E\u7956\u79DF\u7C97\u7D20\u7D44\u8607\u8A34\u963B\u9061\u9F20\u50E7\u5275\u53CC\u53E2\u5009\u55AA\u58EE\u594F\u723D\u5B8B\u5C64\u531D\u60E3\u60F3\u635C\u6383\u633F\u63BB"], + ["9180", "\u64CD\u65E9\u66F9\u5DE3\u69CD\u69FD\u6F15\u71E5\u4E89\u75E9\u76F8\u7A93\u7CDF\u7DCF\u7D9C\u8061\u8349\u8358\u846C\u84BC\u85FB\u88C5\u8D70\u9001\u906D\u9397\u971C\u9A12\u50CF\u5897\u618E\u81D3\u8535\u8D08\u9020\u4FC3\u5074\u5247\u5373\u606F\u6349\u675F\u6E2C\u8DB3\u901F\u4FD7\u5C5E\u8CCA\u65CF\u7D9A\u5352\u8896\u5176\u63C3\u5B58\u5B6B\u5C0A\u640D\u6751\u905C\u4ED6\u591A\u592A\u6C70\u8A51\u553E\u5815\u59A5\u60F0\u6253\u67C1\u8235\u6955\u9640\u99C4\u9A28\u4F53\u5806\u5BFE\u8010\u5CB1\u5E2F\u5F85\u6020\u614B\u6234\u66FF\u6CF0\u6EDE\u80CE\u817F\u82D4\u888B\u8CB8\u9000\u902E\u968A\u9EDB\u9BDB\u4EE3\u53F0\u5927\u7B2C\u918D\u984C\u9DF9\u6EDD\u7027\u5353\u5544\u5B85\u6258\u629E\u62D3\u6CA2\u6FEF\u7422\u8A17\u9438\u6FC1\u8AFE\u8338\u51E7\u86F8\u53EA"], + ["9240", "\u53E9\u4F46\u9054\u8FB0\u596A\u8131\u5DFD\u7AEA\u8FBF\u68DA\u8C37\u72F8\u9C48\u6A3D\u8AB0\u4E39\u5358\u5606\u5766\u62C5\u63A2\u65E6\u6B4E\u6DE1\u6E5B\u70AD\u77ED\u7AEF\u7BAA\u7DBB\u803D\u80C6\u86CB\u8A95\u935B\u56E3\u58C7\u5F3E\u65AD\u6696\u6A80\u6BB5\u7537\u8AC7\u5024\u77E5\u5730\u5F1B\u6065\u667A\u6C60\u75F4\u7A1A\u7F6E\u81F4\u8718\u9045\u99B3\u7BC9\u755C\u7AF9\u7B51\u84C4"], + ["9280", "\u9010\u79E9\u7A92\u8336\u5AE1\u7740\u4E2D\u4EF2\u5B99\u5FE0\u62BD\u663C\u67F1\u6CE8\u866B\u8877\u8A3B\u914E\u92F3\u99D0\u6A17\u7026\u732A\u82E7\u8457\u8CAF\u4E01\u5146\u51CB\u558B\u5BF5\u5E16\u5E33\u5E81\u5F14\u5F35\u5F6B\u5FB4\u61F2\u6311\u66A2\u671D\u6F6E\u7252\u753A\u773A\u8074\u8139\u8178\u8776\u8ABF\u8ADC\u8D85\u8DF3\u929A\u9577\u9802\u9CE5\u52C5\u6357\u76F4\u6715\u6C88\u73CD\u8CC3\u93AE\u9673\u6D25\u589C\u690E\u69CC\u8FFD\u939A\u75DB\u901A\u585A\u6802\u63B4\u69FB\u4F43\u6F2C\u67D8\u8FBB\u8526\u7DB4\u9354\u693F\u6F70\u576A\u58F7\u5B2C\u7D2C\u722A\u540A\u91E3\u9DB4\u4EAD\u4F4E\u505C\u5075\u5243\u8C9E\u5448\u5824\u5B9A\u5E1D\u5E95\u5EAD\u5EF7\u5F1F\u608C\u62B5\u633A\u63D0\u68AF\u6C40\u7887\u798E\u7A0B\u7DE0\u8247\u8A02\u8AE6\u8E44\u9013"], + ["9340", "\u90B8\u912D\u91D8\u9F0E\u6CE5\u6458\u64E2\u6575\u6EF4\u7684\u7B1B\u9069\u93D1\u6EBA\u54F2\u5FB9\u64A4\u8F4D\u8FED\u9244\u5178\u586B\u5929\u5C55\u5E97\u6DFB\u7E8F\u751C\u8CBC\u8EE2\u985B\u70B9\u4F1D\u6BBF\u6FB1\u7530\u96FB\u514E\u5410\u5835\u5857\u59AC\u5C60\u5F92\u6597\u675C\u6E21\u767B\u83DF\u8CED\u9014\u90FD\u934D\u7825\u783A\u52AA\u5EA6\u571F\u5974\u6012\u5012\u515A\u51AC"], + ["9380", "\u51CD\u5200\u5510\u5854\u5858\u5957\u5B95\u5CF6\u5D8B\u60BC\u6295\u642D\u6771\u6843\u68BC\u68DF\u76D7\u6DD8\u6E6F\u6D9B\u706F\u71C8\u5F53\u75D8\u7977\u7B49\u7B54\u7B52\u7CD6\u7D71\u5230\u8463\u8569\u85E4\u8A0E\u8B04\u8C46\u8E0F\u9003\u900F\u9419\u9676\u982D\u9A30\u95D8\u50CD\u52D5\u540C\u5802\u5C0E\u61A7\u649E\u6D1E\u77B3\u7AE5\u80F4\u8404\u9053\u9285\u5CE0\u9D07\u533F\u5F97\u5FB3\u6D9C\u7279\u7763\u79BF\u7BE4\u6BD2\u72EC\u8AAD\u6803\u6A61\u51F8\u7A81\u6934\u5C4A\u9CF6\u82EB\u5BC5\u9149\u701E\u5678\u5C6F\u60C7\u6566\u6C8C\u8C5A\u9041\u9813\u5451\u66C7\u920D\u5948\u90A3\u5185\u4E4D\u51EA\u8599\u8B0E\u7058\u637A\u934B\u6962\u99B4\u7E04\u7577\u5357\u6960\u8EDF\u96E3\u6C5D\u4E8C\u5C3C\u5F10\u8FE9\u5302\u8CD1\u8089\u8679\u5EFF\u65E5\u4E73\u5165"], + ["9440", "\u5982\u5C3F\u97EE\u4EFB\u598A\u5FCD\u8A8D\u6FE1\u79B0\u7962\u5BE7\u8471\u732B\u71B1\u5E74\u5FF5\u637B\u649A\u71C3\u7C98\u4E43\u5EFC\u4E4B\u57DC\u56A2\u60A9\u6FC3\u7D0D\u80FD\u8133\u81BF\u8FB2\u8997\u86A4\u5DF4\u628A\u64AD\u8987\u6777\u6CE2\u6D3E\u7436\u7834\u5A46\u7F75\u82AD\u99AC\u4FF3\u5EC3\u62DD\u6392\u6557\u676F\u76C3\u724C\u80CC\u80BA\u8F29\u914D\u500D\u57F9\u5A92\u6885"], + ["9480", "\u6973\u7164\u72FD\u8CB7\u58F2\u8CE0\u966A\u9019\u877F\u79E4\u77E7\u8429\u4F2F\u5265\u535A\u62CD\u67CF\u6CCA\u767D\u7B94\u7C95\u8236\u8584\u8FEB\u66DD\u6F20\u7206\u7E1B\u83AB\u99C1\u9EA6\u51FD\u7BB1\u7872\u7BB8\u8087\u7B48\u6AE8\u5E61\u808C\u7551\u7560\u516B\u9262\u6E8C\u767A\u9197\u9AEA\u4F10\u7F70\u629C\u7B4F\u95A5\u9CE9\u567A\u5859\u86E4\u96BC\u4F34\u5224\u534A\u53CD\u53DB\u5E06\u642C\u6591\u677F\u6C3E\u6C4E\u7248\u72AF\u73ED\u7554\u7E41\u822C\u85E9\u8CA9\u7BC4\u91C6\u7169\u9812\u98EF\u633D\u6669\u756A\u76E4\u78D0\u8543\u86EE\u532A\u5351\u5426\u5983\u5E87\u5F7C\u60B2\u6249\u6279\u62AB\u6590\u6BD4\u6CCC\u75B2\u76AE\u7891\u79D8\u7DCB\u7F77\u80A5\u88AB\u8AB9\u8CBB\u907F\u975E\u98DB\u6A0B\u7C38\u5099\u5C3E\u5FAE\u6787\u6BD8\u7435\u7709\u7F8E"], + ["9540", "\u9F3B\u67CA\u7A17\u5339\u758B\u9AED\u5F66\u819D\u83F1\u8098\u5F3C\u5FC5\u7562\u7B46\u903C\u6867\u59EB\u5A9B\u7D10\u767E\u8B2C\u4FF5\u5F6A\u6A19\u6C37\u6F02\u74E2\u7968\u8868\u8A55\u8C79\u5EDF\u63CF\u75C5\u79D2\u82D7\u9328\u92F2\u849C\u86ED\u9C2D\u54C1\u5F6C\u658C\u6D5C\u7015\u8CA7\u8CD3\u983B\u654F\u74F6\u4E0D\u4ED8\u57E0\u592B\u5A66\u5BCC\u51A8\u5E03\u5E9C\u6016\u6276\u6577"], + ["9580", "\u65A7\u666E\u6D6E\u7236\u7B26\u8150\u819A\u8299\u8B5C\u8CA0\u8CE6\u8D74\u961C\u9644\u4FAE\u64AB\u6B66\u821E\u8461\u856A\u90E8\u5C01\u6953\u98A8\u847A\u8557\u4F0F\u526F\u5FA9\u5E45\u670D\u798F\u8179\u8907\u8986\u6DF5\u5F17\u6255\u6CB8\u4ECF\u7269\u9B92\u5206\u543B\u5674\u58B3\u61A4\u626E\u711A\u596E\u7C89\u7CDE\u7D1B\u96F0\u6587\u805E\u4E19\u4F75\u5175\u5840\u5E63\u5E73\u5F0A\u67C4\u4E26\u853D\u9589\u965B\u7C73\u9801\u50FB\u58C1\u7656\u78A7\u5225\u77A5\u8511\u7B86\u504F\u5909\u7247\u7BC7\u7DE8\u8FBA\u8FD4\u904D\u4FBF\u52C9\u5A29\u5F01\u97AD\u4FDD\u8217\u92EA\u5703\u6355\u6B69\u752B\u88DC\u8F14\u7A42\u52DF\u5893\u6155\u620A\u66AE\u6BCD\u7C3F\u83E9\u5023\u4FF8\u5305\u5446\u5831\u5949\u5B9D\u5CF0\u5CEF\u5D29\u5E96\u62B1\u6367\u653E\u65B9\u670B"], + ["9640", "\u6CD5\u6CE1\u70F9\u7832\u7E2B\u80DE\u82B3\u840C\u84EC\u8702\u8912\u8A2A\u8C4A\u90A6\u92D2\u98FD\u9CF3\u9D6C\u4E4F\u4EA1\u508D\u5256\u574A\u59A8\u5E3D\u5FD8\u5FD9\u623F\u66B4\u671B\u67D0\u68D2\u5192\u7D21\u80AA\u81A8\u8B00\u8C8C\u8CBF\u927E\u9632\u5420\u982C\u5317\u50D5\u535C\u58A8\u64B2\u6734\u7267\u7766\u7A46\u91E6\u52C3\u6CA1\u6B86\u5800\u5E4C\u5954\u672C\u7FFB\u51E1\u76C6"], + ["9680", "\u6469\u78E8\u9B54\u9EBB\u57CB\u59B9\u6627\u679A\u6BCE\u54E9\u69D9\u5E55\u819C\u6795\u9BAA\u67FE\u9C52\u685D\u4EA6\u4FE3\u53C8\u62B9\u672B\u6CAB\u8FC4\u4FAD\u7E6D\u9EBF\u4E07\u6162\u6E80\u6F2B\u8513\u5473\u672A\u9B45\u5DF3\u7B95\u5CAC\u5BC6\u871C\u6E4A\u84D1\u7A14\u8108\u5999\u7C8D\u6C11\u7720\u52D9\u5922\u7121\u725F\u77DB\u9727\u9D61\u690B\u5A7F\u5A18\u51A5\u540D\u547D\u660E\u76DF\u8FF7\u9298\u9CF4\u59EA\u725D\u6EC5\u514D\u68C9\u7DBF\u7DEC\u9762\u9EBA\u6478\u6A21\u8302\u5984\u5B5F\u6BDB\u731B\u76F2\u7DB2\u8017\u8499\u5132\u6728\u9ED9\u76EE\u6762\u52FF\u9905\u5C24\u623B\u7C7E\u8CB0\u554F\u60B6\u7D0B\u9580\u5301\u4E5F\u51B6\u591C\u723A\u8036\u91CE\u5F25\u77E2\u5384\u5F79\u7D04\u85AC\u8A33\u8E8D\u9756\u67F3\u85AE\u9453\u6109\u6108\u6CB9\u7652"], + ["9740", "\u8AED\u8F38\u552F\u4F51\u512A\u52C7\u53CB\u5BA5\u5E7D\u60A0\u6182\u63D6\u6709\u67DA\u6E67\u6D8C\u7336\u7337\u7531\u7950\u88D5\u8A98\u904A\u9091\u90F5\u96C4\u878D\u5915\u4E88\u4F59\u4E0E\u8A89\u8F3F\u9810\u50AD\u5E7C\u5996\u5BB9\u5EB8\u63DA\u63FA\u64C1\u66DC\u694A\u69D8\u6D0B\u6EB6\u7194\u7528\u7AAF\u7F8A\u8000\u8449\u84C9\u8981\u8B21\u8E0A\u9065\u967D\u990A\u617E\u6291\u6B32"], + ["9780", "\u6C83\u6D74\u7FCC\u7FFC\u6DC0\u7F85\u87BA\u88F8\u6765\u83B1\u983C\u96F7\u6D1B\u7D61\u843D\u916A\u4E71\u5375\u5D50\u6B04\u6FEB\u85CD\u862D\u89A7\u5229\u540F\u5C65\u674E\u68A8\u7406\u7483\u75E2\u88CF\u88E1\u91CC\u96E2\u9678\u5F8B\u7387\u7ACB\u844E\u63A0\u7565\u5289\u6D41\u6E9C\u7409\u7559\u786B\u7C92\u9686\u7ADC\u9F8D\u4FB6\u616E\u65C5\u865C\u4E86\u4EAE\u50DA\u4E21\u51CC\u5BEE\u6599\u6881\u6DBC\u731F\u7642\u77AD\u7A1C\u7CE7\u826F\u8AD2\u907C\u91CF\u9675\u9818\u529B\u7DD1\u502B\u5398\u6797\u6DCB\u71D0\u7433\u81E8\u8F2A\u96A3\u9C57\u9E9F\u7460\u5841\u6D99\u7D2F\u985E\u4EE4\u4F36\u4F8B\u51B7\u52B1\u5DBA\u601C\u73B2\u793C\u82D3\u9234\u96B7\u96F6\u970A\u9E97\u9F62\u66A6\u6B74\u5217\u52A3\u70C8\u88C2\u5EC9\u604B\u6190\u6F23\u7149\u7C3E\u7DF4\u806F"], + ["9840", "\u84EE\u9023\u932C\u5442\u9B6F\u6AD3\u7089\u8CC2\u8DEF\u9732\u52B4\u5A41\u5ECA\u5F04\u6717\u697C\u6994\u6D6A\u6F0F\u7262\u72FC\u7BED\u8001\u807E\u874B\u90CE\u516D\u9E93\u7984\u808B\u9332\u8AD6\u502D\u548C\u8A71\u6B6A\u8CC4\u8107\u60D1\u67A0\u9DF2\u4E99\u4E98\u9C10\u8A6B\u85C1\u8568\u6900\u6E7E\u7897\u8155"], + ["989f", "\u5F0C\u4E10\u4E15\u4E2A\u4E31\u4E36\u4E3C\u4E3F\u4E42\u4E56\u4E58\u4E82\u4E85\u8C6B\u4E8A\u8212\u5F0D\u4E8E\u4E9E\u4E9F\u4EA0\u4EA2\u4EB0\u4EB3\u4EB6\u4ECE\u4ECD\u4EC4\u4EC6\u4EC2\u4ED7\u4EDE\u4EED\u4EDF\u4EF7\u4F09\u4F5A\u4F30\u4F5B\u4F5D\u4F57\u4F47\u4F76\u4F88\u4F8F\u4F98\u4F7B\u4F69\u4F70\u4F91\u4F6F\u4F86\u4F96\u5118\u4FD4\u4FDF\u4FCE\u4FD8\u4FDB\u4FD1\u4FDA\u4FD0\u4FE4\u4FE5\u501A\u5028\u5014\u502A\u5025\u5005\u4F1C\u4FF6\u5021\u5029\u502C\u4FFE\u4FEF\u5011\u5006\u5043\u5047\u6703\u5055\u5050\u5048\u505A\u5056\u506C\u5078\u5080\u509A\u5085\u50B4\u50B2"], + ["9940", "\u50C9\u50CA\u50B3\u50C2\u50D6\u50DE\u50E5\u50ED\u50E3\u50EE\u50F9\u50F5\u5109\u5101\u5102\u5116\u5115\u5114\u511A\u5121\u513A\u5137\u513C\u513B\u513F\u5140\u5152\u514C\u5154\u5162\u7AF8\u5169\u516A\u516E\u5180\u5182\u56D8\u518C\u5189\u518F\u5191\u5193\u5195\u5196\u51A4\u51A6\u51A2\u51A9\u51AA\u51AB\u51B3\u51B1\u51B2\u51B0\u51B5\u51BD\u51C5\u51C9\u51DB\u51E0\u8655\u51E9\u51ED"], + ["9980", "\u51F0\u51F5\u51FE\u5204\u520B\u5214\u520E\u5227\u522A\u522E\u5233\u5239\u524F\u5244\u524B\u524C\u525E\u5254\u526A\u5274\u5269\u5273\u527F\u527D\u528D\u5294\u5292\u5271\u5288\u5291\u8FA8\u8FA7\u52AC\u52AD\u52BC\u52B5\u52C1\u52CD\u52D7\u52DE\u52E3\u52E6\u98ED\u52E0\u52F3\u52F5\u52F8\u52F9\u5306\u5308\u7538\u530D\u5310\u530F\u5315\u531A\u5323\u532F\u5331\u5333\u5338\u5340\u5346\u5345\u4E17\u5349\u534D\u51D6\u535E\u5369\u536E\u5918\u537B\u5377\u5382\u5396\u53A0\u53A6\u53A5\u53AE\u53B0\u53B6\u53C3\u7C12\u96D9\u53DF\u66FC\u71EE\u53EE\u53E8\u53ED\u53FA\u5401\u543D\u5440\u542C\u542D\u543C\u542E\u5436\u5429\u541D\u544E\u548F\u5475\u548E\u545F\u5471\u5477\u5470\u5492\u547B\u5480\u5476\u5484\u5490\u5486\u54C7\u54A2\u54B8\u54A5\u54AC\u54C4\u54C8\u54A8"], + ["9a40", "\u54AB\u54C2\u54A4\u54BE\u54BC\u54D8\u54E5\u54E6\u550F\u5514\u54FD\u54EE\u54ED\u54FA\u54E2\u5539\u5540\u5563\u554C\u552E\u555C\u5545\u5556\u5557\u5538\u5533\u555D\u5599\u5580\u54AF\u558A\u559F\u557B\u557E\u5598\u559E\u55AE\u557C\u5583\u55A9\u5587\u55A8\u55DA\u55C5\u55DF\u55C4\u55DC\u55E4\u55D4\u5614\u55F7\u5616\u55FE\u55FD\u561B\u55F9\u564E\u5650\u71DF\u5634\u5636\u5632\u5638"], + ["9a80", "\u566B\u5664\u562F\u566C\u566A\u5686\u5680\u568A\u56A0\u5694\u568F\u56A5\u56AE\u56B6\u56B4\u56C2\u56BC\u56C1\u56C3\u56C0\u56C8\u56CE\u56D1\u56D3\u56D7\u56EE\u56F9\u5700\u56FF\u5704\u5709\u5708\u570B\u570D\u5713\u5718\u5716\u55C7\u571C\u5726\u5737\u5738\u574E\u573B\u5740\u574F\u5769\u57C0\u5788\u5761\u577F\u5789\u5793\u57A0\u57B3\u57A4\u57AA\u57B0\u57C3\u57C6\u57D4\u57D2\u57D3\u580A\u57D6\u57E3\u580B\u5819\u581D\u5872\u5821\u5862\u584B\u5870\u6BC0\u5852\u583D\u5879\u5885\u58B9\u589F\u58AB\u58BA\u58DE\u58BB\u58B8\u58AE\u58C5\u58D3\u58D1\u58D7\u58D9\u58D8\u58E5\u58DC\u58E4\u58DF\u58EF\u58FA\u58F9\u58FB\u58FC\u58FD\u5902\u590A\u5910\u591B\u68A6\u5925\u592C\u592D\u5932\u5938\u593E\u7AD2\u5955\u5950\u594E\u595A\u5958\u5962\u5960\u5967\u596C\u5969"], + ["9b40", "\u5978\u5981\u599D\u4F5E\u4FAB\u59A3\u59B2\u59C6\u59E8\u59DC\u598D\u59D9\u59DA\u5A25\u5A1F\u5A11\u5A1C\u5A09\u5A1A\u5A40\u5A6C\u5A49\u5A35\u5A36\u5A62\u5A6A\u5A9A\u5ABC\u5ABE\u5ACB\u5AC2\u5ABD\u5AE3\u5AD7\u5AE6\u5AE9\u5AD6\u5AFA\u5AFB\u5B0C\u5B0B\u5B16\u5B32\u5AD0\u5B2A\u5B36\u5B3E\u5B43\u5B45\u5B40\u5B51\u5B55\u5B5A\u5B5B\u5B65\u5B69\u5B70\u5B73\u5B75\u5B78\u6588\u5B7A\u5B80"], + ["9b80", "\u5B83\u5BA6\u5BB8\u5BC3\u5BC7\u5BC9\u5BD4\u5BD0\u5BE4\u5BE6\u5BE2\u5BDE\u5BE5\u5BEB\u5BF0\u5BF6\u5BF3\u5C05\u5C07\u5C08\u5C0D\u5C13\u5C20\u5C22\u5C28\u5C38\u5C39\u5C41\u5C46\u5C4E\u5C53\u5C50\u5C4F\u5B71\u5C6C\u5C6E\u4E62\u5C76\u5C79\u5C8C\u5C91\u5C94\u599B\u5CAB\u5CBB\u5CB6\u5CBC\u5CB7\u5CC5\u5CBE\u5CC7\u5CD9\u5CE9\u5CFD\u5CFA\u5CED\u5D8C\u5CEA\u5D0B\u5D15\u5D17\u5D5C\u5D1F\u5D1B\u5D11\u5D14\u5D22\u5D1A\u5D19\u5D18\u5D4C\u5D52\u5D4E\u5D4B\u5D6C\u5D73\u5D76\u5D87\u5D84\u5D82\u5DA2\u5D9D\u5DAC\u5DAE\u5DBD\u5D90\u5DB7\u5DBC\u5DC9\u5DCD\u5DD3\u5DD2\u5DD6\u5DDB\u5DEB\u5DF2\u5DF5\u5E0B\u5E1A\u5E19\u5E11\u5E1B\u5E36\u5E37\u5E44\u5E43\u5E40\u5E4E\u5E57\u5E54\u5E5F\u5E62\u5E64\u5E47\u5E75\u5E76\u5E7A\u9EBC\u5E7F\u5EA0\u5EC1\u5EC2\u5EC8\u5ED0\u5ECF"], + ["9c40", "\u5ED6\u5EE3\u5EDD\u5EDA\u5EDB\u5EE2\u5EE1\u5EE8\u5EE9\u5EEC\u5EF1\u5EF3\u5EF0\u5EF4\u5EF8\u5EFE\u5F03\u5F09\u5F5D\u5F5C\u5F0B\u5F11\u5F16\u5F29\u5F2D\u5F38\u5F41\u5F48\u5F4C\u5F4E\u5F2F\u5F51\u5F56\u5F57\u5F59\u5F61\u5F6D\u5F73\u5F77\u5F83\u5F82\u5F7F\u5F8A\u5F88\u5F91\u5F87\u5F9E\u5F99\u5F98\u5FA0\u5FA8\u5FAD\u5FBC\u5FD6\u5FFB\u5FE4\u5FF8\u5FF1\u5FDD\u60B3\u5FFF\u6021\u6060"], + ["9c80", "\u6019\u6010\u6029\u600E\u6031\u601B\u6015\u602B\u6026\u600F\u603A\u605A\u6041\u606A\u6077\u605F\u604A\u6046\u604D\u6063\u6043\u6064\u6042\u606C\u606B\u6059\u6081\u608D\u60E7\u6083\u609A\u6084\u609B\u6096\u6097\u6092\u60A7\u608B\u60E1\u60B8\u60E0\u60D3\u60B4\u5FF0\u60BD\u60C6\u60B5\u60D8\u614D\u6115\u6106\u60F6\u60F7\u6100\u60F4\u60FA\u6103\u6121\u60FB\u60F1\u610D\u610E\u6147\u613E\u6128\u6127\u614A\u613F\u613C\u612C\u6134\u613D\u6142\u6144\u6173\u6177\u6158\u6159\u615A\u616B\u6174\u616F\u6165\u6171\u615F\u615D\u6153\u6175\u6199\u6196\u6187\u61AC\u6194\u619A\u618A\u6191\u61AB\u61AE\u61CC\u61CA\u61C9\u61F7\u61C8\u61C3\u61C6\u61BA\u61CB\u7F79\u61CD\u61E6\u61E3\u61F6\u61FA\u61F4\u61FF\u61FD\u61FC\u61FE\u6200\u6208\u6209\u620D\u620C\u6214\u621B"], + ["9d40", "\u621E\u6221\u622A\u622E\u6230\u6232\u6233\u6241\u624E\u625E\u6263\u625B\u6260\u6268\u627C\u6282\u6289\u627E\u6292\u6293\u6296\u62D4\u6283\u6294\u62D7\u62D1\u62BB\u62CF\u62FF\u62C6\u64D4\u62C8\u62DC\u62CC\u62CA\u62C2\u62C7\u629B\u62C9\u630C\u62EE\u62F1\u6327\u6302\u6308\u62EF\u62F5\u6350\u633E\u634D\u641C\u634F\u6396\u638E\u6380\u63AB\u6376\u63A3\u638F\u6389\u639F\u63B5\u636B"], + ["9d80", "\u6369\u63BE\u63E9\u63C0\u63C6\u63E3\u63C9\u63D2\u63F6\u63C4\u6416\u6434\u6406\u6413\u6426\u6436\u651D\u6417\u6428\u640F\u6467\u646F\u6476\u644E\u652A\u6495\u6493\u64A5\u64A9\u6488\u64BC\u64DA\u64D2\u64C5\u64C7\u64BB\u64D8\u64C2\u64F1\u64E7\u8209\u64E0\u64E1\u62AC\u64E3\u64EF\u652C\u64F6\u64F4\u64F2\u64FA\u6500\u64FD\u6518\u651C\u6505\u6524\u6523\u652B\u6534\u6535\u6537\u6536\u6538\u754B\u6548\u6556\u6555\u654D\u6558\u655E\u655D\u6572\u6578\u6582\u6583\u8B8A\u659B\u659F\u65AB\u65B7\u65C3\u65C6\u65C1\u65C4\u65CC\u65D2\u65DB\u65D9\u65E0\u65E1\u65F1\u6772\u660A\u6603\u65FB\u6773\u6635\u6636\u6634\u661C\u664F\u6644\u6649\u6641\u665E\u665D\u6664\u6667\u6668\u665F\u6662\u6670\u6683\u6688\u668E\u6689\u6684\u6698\u669D\u66C1\u66B9\u66C9\u66BE\u66BC"], + ["9e40", "\u66C4\u66B8\u66D6\u66DA\u66E0\u663F\u66E6\u66E9\u66F0\u66F5\u66F7\u670F\u6716\u671E\u6726\u6727\u9738\u672E\u673F\u6736\u6741\u6738\u6737\u6746\u675E\u6760\u6759\u6763\u6764\u6789\u6770\u67A9\u677C\u676A\u678C\u678B\u67A6\u67A1\u6785\u67B7\u67EF\u67B4\u67EC\u67B3\u67E9\u67B8\u67E4\u67DE\u67DD\u67E2\u67EE\u67B9\u67CE\u67C6\u67E7\u6A9C\u681E\u6846\u6829\u6840\u684D\u6832\u684E"], + ["9e80", "\u68B3\u682B\u6859\u6863\u6877\u687F\u689F\u688F\u68AD\u6894\u689D\u689B\u6883\u6AAE\u68B9\u6874\u68B5\u68A0\u68BA\u690F\u688D\u687E\u6901\u68CA\u6908\u68D8\u6922\u6926\u68E1\u690C\u68CD\u68D4\u68E7\u68D5\u6936\u6912\u6904\u68D7\u68E3\u6925\u68F9\u68E0\u68EF\u6928\u692A\u691A\u6923\u6921\u68C6\u6979\u6977\u695C\u6978\u696B\u6954\u697E\u696E\u6939\u6974\u693D\u6959\u6930\u6961\u695E\u695D\u6981\u696A\u69B2\u69AE\u69D0\u69BF\u69C1\u69D3\u69BE\u69CE\u5BE8\u69CA\u69DD\u69BB\u69C3\u69A7\u6A2E\u6991\u69A0\u699C\u6995\u69B4\u69DE\u69E8\u6A02\u6A1B\u69FF\u6B0A\u69F9\u69F2\u69E7\u6A05\u69B1\u6A1E\u69ED\u6A14\u69EB\u6A0A\u6A12\u6AC1\u6A23\u6A13\u6A44\u6A0C\u6A72\u6A36\u6A78\u6A47\u6A62\u6A59\u6A66\u6A48\u6A38\u6A22\u6A90\u6A8D\u6AA0\u6A84\u6AA2\u6AA3"], + ["9f40", "\u6A97\u8617\u6ABB\u6AC3\u6AC2\u6AB8\u6AB3\u6AAC\u6ADE\u6AD1\u6ADF\u6AAA\u6ADA\u6AEA\u6AFB\u6B05\u8616\u6AFA\u6B12\u6B16\u9B31\u6B1F\u6B38\u6B37\u76DC\u6B39\u98EE\u6B47\u6B43\u6B49\u6B50\u6B59\u6B54\u6B5B\u6B5F\u6B61\u6B78\u6B79\u6B7F\u6B80\u6B84\u6B83\u6B8D\u6B98\u6B95\u6B9E\u6BA4\u6BAA\u6BAB\u6BAF\u6BB2\u6BB1\u6BB3\u6BB7\u6BBC\u6BC6\u6BCB\u6BD3\u6BDF\u6BEC\u6BEB\u6BF3\u6BEF"], + ["9f80", "\u9EBE\u6C08\u6C13\u6C14\u6C1B\u6C24\u6C23\u6C5E\u6C55\u6C62\u6C6A\u6C82\u6C8D\u6C9A\u6C81\u6C9B\u6C7E\u6C68\u6C73\u6C92\u6C90\u6CC4\u6CF1\u6CD3\u6CBD\u6CD7\u6CC5\u6CDD\u6CAE\u6CB1\u6CBE\u6CBA\u6CDB\u6CEF\u6CD9\u6CEA\u6D1F\u884D\u6D36\u6D2B\u6D3D\u6D38\u6D19\u6D35\u6D33\u6D12\u6D0C\u6D63\u6D93\u6D64\u6D5A\u6D79\u6D59\u6D8E\u6D95\u6FE4\u6D85\u6DF9\u6E15\u6E0A\u6DB5\u6DC7\u6DE6\u6DB8\u6DC6\u6DEC\u6DDE\u6DCC\u6DE8\u6DD2\u6DC5\u6DFA\u6DD9\u6DE4\u6DD5\u6DEA\u6DEE\u6E2D\u6E6E\u6E2E\u6E19\u6E72\u6E5F\u6E3E\u6E23\u6E6B\u6E2B\u6E76\u6E4D\u6E1F\u6E43\u6E3A\u6E4E\u6E24\u6EFF\u6E1D\u6E38\u6E82\u6EAA\u6E98\u6EC9\u6EB7\u6ED3\u6EBD\u6EAF\u6EC4\u6EB2\u6ED4\u6ED5\u6E8F\u6EA5\u6EC2\u6E9F\u6F41\u6F11\u704C\u6EEC\u6EF8\u6EFE\u6F3F\u6EF2\u6F31\u6EEF\u6F32\u6ECC"], + ["e040", "\u6F3E\u6F13\u6EF7\u6F86\u6F7A\u6F78\u6F81\u6F80\u6F6F\u6F5B\u6FF3\u6F6D\u6F82\u6F7C\u6F58\u6F8E\u6F91\u6FC2\u6F66\u6FB3\u6FA3\u6FA1\u6FA4\u6FB9\u6FC6\u6FAA\u6FDF\u6FD5\u6FEC\u6FD4\u6FD8\u6FF1\u6FEE\u6FDB\u7009\u700B\u6FFA\u7011\u7001\u700F\u6FFE\u701B\u701A\u6F74\u701D\u7018\u701F\u7030\u703E\u7032\u7051\u7063\u7099\u7092\u70AF\u70F1\u70AC\u70B8\u70B3\u70AE\u70DF\u70CB\u70DD"], + ["e080", "\u70D9\u7109\u70FD\u711C\u7119\u7165\u7155\u7188\u7166\u7162\u714C\u7156\u716C\u718F\u71FB\u7184\u7195\u71A8\u71AC\u71D7\u71B9\u71BE\u71D2\u71C9\u71D4\u71CE\u71E0\u71EC\u71E7\u71F5\u71FC\u71F9\u71FF\u720D\u7210\u721B\u7228\u722D\u722C\u7230\u7232\u723B\u723C\u723F\u7240\u7246\u724B\u7258\u7274\u727E\u7282\u7281\u7287\u7292\u7296\u72A2\u72A7\u72B9\u72B2\u72C3\u72C6\u72C4\u72CE\u72D2\u72E2\u72E0\u72E1\u72F9\u72F7\u500F\u7317\u730A\u731C\u7316\u731D\u7334\u732F\u7329\u7325\u733E\u734E\u734F\u9ED8\u7357\u736A\u7368\u7370\u7378\u7375\u737B\u737A\u73C8\u73B3\u73CE\u73BB\u73C0\u73E5\u73EE\u73DE\u74A2\u7405\u746F\u7425\u73F8\u7432\u743A\u7455\u743F\u745F\u7459\u7441\u745C\u7469\u7470\u7463\u746A\u7476\u747E\u748B\u749E\u74A7\u74CA\u74CF\u74D4\u73F1"], + ["e140", "\u74E0\u74E3\u74E7\u74E9\u74EE\u74F2\u74F0\u74F1\u74F8\u74F7\u7504\u7503\u7505\u750C\u750E\u750D\u7515\u7513\u751E\u7526\u752C\u753C\u7544\u754D\u754A\u7549\u755B\u7546\u755A\u7569\u7564\u7567\u756B\u756D\u7578\u7576\u7586\u7587\u7574\u758A\u7589\u7582\u7594\u759A\u759D\u75A5\u75A3\u75C2\u75B3\u75C3\u75B5\u75BD\u75B8\u75BC\u75B1\u75CD\u75CA\u75D2\u75D9\u75E3\u75DE\u75FE\u75FF"], + ["e180", "\u75FC\u7601\u75F0\u75FA\u75F2\u75F3\u760B\u760D\u7609\u761F\u7627\u7620\u7621\u7622\u7624\u7634\u7630\u763B\u7647\u7648\u7646\u765C\u7658\u7661\u7662\u7668\u7669\u766A\u7667\u766C\u7670\u7672\u7676\u7678\u767C\u7680\u7683\u7688\u768B\u768E\u7696\u7693\u7699\u769A\u76B0\u76B4\u76B8\u76B9\u76BA\u76C2\u76CD\u76D6\u76D2\u76DE\u76E1\u76E5\u76E7\u76EA\u862F\u76FB\u7708\u7707\u7704\u7729\u7724\u771E\u7725\u7726\u771B\u7737\u7738\u7747\u775A\u7768\u776B\u775B\u7765\u777F\u777E\u7779\u778E\u778B\u7791\u77A0\u779E\u77B0\u77B6\u77B9\u77BF\u77BC\u77BD\u77BB\u77C7\u77CD\u77D7\u77DA\u77DC\u77E3\u77EE\u77FC\u780C\u7812\u7926\u7820\u792A\u7845\u788E\u7874\u7886\u787C\u789A\u788C\u78A3\u78B5\u78AA\u78AF\u78D1\u78C6\u78CB\u78D4\u78BE\u78BC\u78C5\u78CA\u78EC"], + ["e240", "\u78E7\u78DA\u78FD\u78F4\u7907\u7912\u7911\u7919\u792C\u792B\u7940\u7960\u7957\u795F\u795A\u7955\u7953\u797A\u797F\u798A\u799D\u79A7\u9F4B\u79AA\u79AE\u79B3\u79B9\u79BA\u79C9\u79D5\u79E7\u79EC\u79E1\u79E3\u7A08\u7A0D\u7A18\u7A19\u7A20\u7A1F\u7980\u7A31\u7A3B\u7A3E\u7A37\u7A43\u7A57\u7A49\u7A61\u7A62\u7A69\u9F9D\u7A70\u7A79\u7A7D\u7A88\u7A97\u7A95\u7A98\u7A96\u7AA9\u7AC8\u7AB0"], + ["e280", "\u7AB6\u7AC5\u7AC4\u7ABF\u9083\u7AC7\u7ACA\u7ACD\u7ACF\u7AD5\u7AD3\u7AD9\u7ADA\u7ADD\u7AE1\u7AE2\u7AE6\u7AED\u7AF0\u7B02\u7B0F\u7B0A\u7B06\u7B33\u7B18\u7B19\u7B1E\u7B35\u7B28\u7B36\u7B50\u7B7A\u7B04\u7B4D\u7B0B\u7B4C\u7B45\u7B75\u7B65\u7B74\u7B67\u7B70\u7B71\u7B6C\u7B6E\u7B9D\u7B98\u7B9F\u7B8D\u7B9C\u7B9A\u7B8B\u7B92\u7B8F\u7B5D\u7B99\u7BCB\u7BC1\u7BCC\u7BCF\u7BB4\u7BC6\u7BDD\u7BE9\u7C11\u7C14\u7BE6\u7BE5\u7C60\u7C00\u7C07\u7C13\u7BF3\u7BF7\u7C17\u7C0D\u7BF6\u7C23\u7C27\u7C2A\u7C1F\u7C37\u7C2B\u7C3D\u7C4C\u7C43\u7C54\u7C4F\u7C40\u7C50\u7C58\u7C5F\u7C64\u7C56\u7C65\u7C6C\u7C75\u7C83\u7C90\u7CA4\u7CAD\u7CA2\u7CAB\u7CA1\u7CA8\u7CB3\u7CB2\u7CB1\u7CAE\u7CB9\u7CBD\u7CC0\u7CC5\u7CC2\u7CD8\u7CD2\u7CDC\u7CE2\u9B3B\u7CEF\u7CF2\u7CF4\u7CF6\u7CFA\u7D06"], + ["e340", "\u7D02\u7D1C\u7D15\u7D0A\u7D45\u7D4B\u7D2E\u7D32\u7D3F\u7D35\u7D46\u7D73\u7D56\u7D4E\u7D72\u7D68\u7D6E\u7D4F\u7D63\u7D93\u7D89\u7D5B\u7D8F\u7D7D\u7D9B\u7DBA\u7DAE\u7DA3\u7DB5\u7DC7\u7DBD\u7DAB\u7E3D\u7DA2\u7DAF\u7DDC\u7DB8\u7D9F\u7DB0\u7DD8\u7DDD\u7DE4\u7DDE\u7DFB\u7DF2\u7DE1\u7E05\u7E0A\u7E23\u7E21\u7E12\u7E31\u7E1F\u7E09\u7E0B\u7E22\u7E46\u7E66\u7E3B\u7E35\u7E39\u7E43\u7E37"], + ["e380", "\u7E32\u7E3A\u7E67\u7E5D\u7E56\u7E5E\u7E59\u7E5A\u7E79\u7E6A\u7E69\u7E7C\u7E7B\u7E83\u7DD5\u7E7D\u8FAE\u7E7F\u7E88\u7E89\u7E8C\u7E92\u7E90\u7E93\u7E94\u7E96\u7E8E\u7E9B\u7E9C\u7F38\u7F3A\u7F45\u7F4C\u7F4D\u7F4E\u7F50\u7F51\u7F55\u7F54\u7F58\u7F5F\u7F60\u7F68\u7F69\u7F67\u7F78\u7F82\u7F86\u7F83\u7F88\u7F87\u7F8C\u7F94\u7F9E\u7F9D\u7F9A\u7FA3\u7FAF\u7FB2\u7FB9\u7FAE\u7FB6\u7FB8\u8B71\u7FC5\u7FC6\u7FCA\u7FD5\u7FD4\u7FE1\u7FE6\u7FE9\u7FF3\u7FF9\u98DC\u8006\u8004\u800B\u8012\u8018\u8019\u801C\u8021\u8028\u803F\u803B\u804A\u8046\u8052\u8058\u805A\u805F\u8062\u8068\u8073\u8072\u8070\u8076\u8079\u807D\u807F\u8084\u8086\u8085\u809B\u8093\u809A\u80AD\u5190\u80AC\u80DB\u80E5\u80D9\u80DD\u80C4\u80DA\u80D6\u8109\u80EF\u80F1\u811B\u8129\u8123\u812F\u814B"], + ["e440", "\u968B\u8146\u813E\u8153\u8151\u80FC\u8171\u816E\u8165\u8166\u8174\u8183\u8188\u818A\u8180\u8182\u81A0\u8195\u81A4\u81A3\u815F\u8193\u81A9\u81B0\u81B5\u81BE\u81B8\u81BD\u81C0\u81C2\u81BA\u81C9\u81CD\u81D1\u81D9\u81D8\u81C8\u81DA\u81DF\u81E0\u81E7\u81FA\u81FB\u81FE\u8201\u8202\u8205\u8207\u820A\u820D\u8210\u8216\u8229\u822B\u8238\u8233\u8240\u8259\u8258\u825D\u825A\u825F\u8264"], + ["e480", "\u8262\u8268\u826A\u826B\u822E\u8271\u8277\u8278\u827E\u828D\u8292\u82AB\u829F\u82BB\u82AC\u82E1\u82E3\u82DF\u82D2\u82F4\u82F3\u82FA\u8393\u8303\u82FB\u82F9\u82DE\u8306\u82DC\u8309\u82D9\u8335\u8334\u8316\u8332\u8331\u8340\u8339\u8350\u8345\u832F\u832B\u8317\u8318\u8385\u839A\u83AA\u839F\u83A2\u8396\u8323\u838E\u8387\u838A\u837C\u83B5\u8373\u8375\u83A0\u8389\u83A8\u83F4\u8413\u83EB\u83CE\u83FD\u8403\u83D8\u840B\u83C1\u83F7\u8407\u83E0\u83F2\u840D\u8422\u8420\u83BD\u8438\u8506\u83FB\u846D\u842A\u843C\u855A\u8484\u8477\u846B\u84AD\u846E\u8482\u8469\u8446\u842C\u846F\u8479\u8435\u84CA\u8462\u84B9\u84BF\u849F\u84D9\u84CD\u84BB\u84DA\u84D0\u84C1\u84C6\u84D6\u84A1\u8521\u84FF\u84F4\u8517\u8518\u852C\u851F\u8515\u8514\u84FC\u8540\u8563\u8558\u8548"], + ["e540", "\u8541\u8602\u854B\u8555\u8580\u85A4\u8588\u8591\u858A\u85A8\u856D\u8594\u859B\u85EA\u8587\u859C\u8577\u857E\u8590\u85C9\u85BA\u85CF\u85B9\u85D0\u85D5\u85DD\u85E5\u85DC\u85F9\u860A\u8613\u860B\u85FE\u85FA\u8606\u8622\u861A\u8630\u863F\u864D\u4E55\u8654\u865F\u8667\u8671\u8693\u86A3\u86A9\u86AA\u868B\u868C\u86B6\u86AF\u86C4\u86C6\u86B0\u86C9\u8823\u86AB\u86D4\u86DE\u86E9\u86EC"], + ["e580", "\u86DF\u86DB\u86EF\u8712\u8706\u8708\u8700\u8703\u86FB\u8711\u8709\u870D\u86F9\u870A\u8734\u873F\u8737\u873B\u8725\u8729\u871A\u8760\u875F\u8778\u874C\u874E\u8774\u8757\u8768\u876E\u8759\u8753\u8763\u876A\u8805\u87A2\u879F\u8782\u87AF\u87CB\u87BD\u87C0\u87D0\u96D6\u87AB\u87C4\u87B3\u87C7\u87C6\u87BB\u87EF\u87F2\u87E0\u880F\u880D\u87FE\u87F6\u87F7\u880E\u87D2\u8811\u8816\u8815\u8822\u8821\u8831\u8836\u8839\u8827\u883B\u8844\u8842\u8852\u8859\u885E\u8862\u886B\u8881\u887E\u889E\u8875\u887D\u88B5\u8872\u8882\u8897\u8892\u88AE\u8899\u88A2\u888D\u88A4\u88B0\u88BF\u88B1\u88C3\u88C4\u88D4\u88D8\u88D9\u88DD\u88F9\u8902\u88FC\u88F4\u88E8\u88F2\u8904\u890C\u890A\u8913\u8943\u891E\u8925\u892A\u892B\u8941\u8944\u893B\u8936\u8938\u894C\u891D\u8960\u895E"], + ["e640", "\u8966\u8964\u896D\u896A\u896F\u8974\u8977\u897E\u8983\u8988\u898A\u8993\u8998\u89A1\u89A9\u89A6\u89AC\u89AF\u89B2\u89BA\u89BD\u89BF\u89C0\u89DA\u89DC\u89DD\u89E7\u89F4\u89F8\u8A03\u8A16\u8A10\u8A0C\u8A1B\u8A1D\u8A25\u8A36\u8A41\u8A5B\u8A52\u8A46\u8A48\u8A7C\u8A6D\u8A6C\u8A62\u8A85\u8A82\u8A84\u8AA8\u8AA1\u8A91\u8AA5\u8AA6\u8A9A\u8AA3\u8AC4\u8ACD\u8AC2\u8ADA\u8AEB\u8AF3\u8AE7"], + ["e680", "\u8AE4\u8AF1\u8B14\u8AE0\u8AE2\u8AF7\u8ADE\u8ADB\u8B0C\u8B07\u8B1A\u8AE1\u8B16\u8B10\u8B17\u8B20\u8B33\u97AB\u8B26\u8B2B\u8B3E\u8B28\u8B41\u8B4C\u8B4F\u8B4E\u8B49\u8B56\u8B5B\u8B5A\u8B6B\u8B5F\u8B6C\u8B6F\u8B74\u8B7D\u8B80\u8B8C\u8B8E\u8B92\u8B93\u8B96\u8B99\u8B9A\u8C3A\u8C41\u8C3F\u8C48\u8C4C\u8C4E\u8C50\u8C55\u8C62\u8C6C\u8C78\u8C7A\u8C82\u8C89\u8C85\u8C8A\u8C8D\u8C8E\u8C94\u8C7C\u8C98\u621D\u8CAD\u8CAA\u8CBD\u8CB2\u8CB3\u8CAE\u8CB6\u8CC8\u8CC1\u8CE4\u8CE3\u8CDA\u8CFD\u8CFA\u8CFB\u8D04\u8D05\u8D0A\u8D07\u8D0F\u8D0D\u8D10\u9F4E\u8D13\u8CCD\u8D14\u8D16\u8D67\u8D6D\u8D71\u8D73\u8D81\u8D99\u8DC2\u8DBE\u8DBA\u8DCF\u8DDA\u8DD6\u8DCC\u8DDB\u8DCB\u8DEA\u8DEB\u8DDF\u8DE3\u8DFC\u8E08\u8E09\u8DFF\u8E1D\u8E1E\u8E10\u8E1F\u8E42\u8E35\u8E30\u8E34\u8E4A"], + ["e740", "\u8E47\u8E49\u8E4C\u8E50\u8E48\u8E59\u8E64\u8E60\u8E2A\u8E63\u8E55\u8E76\u8E72\u8E7C\u8E81\u8E87\u8E85\u8E84\u8E8B\u8E8A\u8E93\u8E91\u8E94\u8E99\u8EAA\u8EA1\u8EAC\u8EB0\u8EC6\u8EB1\u8EBE\u8EC5\u8EC8\u8ECB\u8EDB\u8EE3\u8EFC\u8EFB\u8EEB\u8EFE\u8F0A\u8F05\u8F15\u8F12\u8F19\u8F13\u8F1C\u8F1F\u8F1B\u8F0C\u8F26\u8F33\u8F3B\u8F39\u8F45\u8F42\u8F3E\u8F4C\u8F49\u8F46\u8F4E\u8F57\u8F5C"], + ["e780", "\u8F62\u8F63\u8F64\u8F9C\u8F9F\u8FA3\u8FAD\u8FAF\u8FB7\u8FDA\u8FE5\u8FE2\u8FEA\u8FEF\u9087\u8FF4\u9005\u8FF9\u8FFA\u9011\u9015\u9021\u900D\u901E\u9016\u900B\u9027\u9036\u9035\u9039\u8FF8\u904F\u9050\u9051\u9052\u900E\u9049\u903E\u9056\u9058\u905E\u9068\u906F\u9076\u96A8\u9072\u9082\u907D\u9081\u9080\u908A\u9089\u908F\u90A8\u90AF\u90B1\u90B5\u90E2\u90E4\u6248\u90DB\u9102\u9112\u9119\u9132\u9130\u914A\u9156\u9158\u9163\u9165\u9169\u9173\u9172\u918B\u9189\u9182\u91A2\u91AB\u91AF\u91AA\u91B5\u91B4\u91BA\u91C0\u91C1\u91C9\u91CB\u91D0\u91D6\u91DF\u91E1\u91DB\u91FC\u91F5\u91F6\u921E\u91FF\u9214\u922C\u9215\u9211\u925E\u9257\u9245\u9249\u9264\u9248\u9295\u923F\u924B\u9250\u929C\u9296\u9293\u929B\u925A\u92CF\u92B9\u92B7\u92E9\u930F\u92FA\u9344\u932E"], + ["e840", "\u9319\u9322\u931A\u9323\u933A\u9335\u933B\u935C\u9360\u937C\u936E\u9356\u93B0\u93AC\u93AD\u9394\u93B9\u93D6\u93D7\u93E8\u93E5\u93D8\u93C3\u93DD\u93D0\u93C8\u93E4\u941A\u9414\u9413\u9403\u9407\u9410\u9436\u942B\u9435\u9421\u943A\u9441\u9452\u9444\u945B\u9460\u9462\u945E\u946A\u9229\u9470\u9475\u9477\u947D\u945A\u947C\u947E\u9481\u947F\u9582\u9587\u958A\u9594\u9596\u9598\u9599"], + ["e880", "\u95A0\u95A8\u95A7\u95AD\u95BC\u95BB\u95B9\u95BE\u95CA\u6FF6\u95C3\u95CD\u95CC\u95D5\u95D4\u95D6\u95DC\u95E1\u95E5\u95E2\u9621\u9628\u962E\u962F\u9642\u964C\u964F\u964B\u9677\u965C\u965E\u965D\u965F\u9666\u9672\u966C\u968D\u9698\u9695\u9697\u96AA\u96A7\u96B1\u96B2\u96B0\u96B4\u96B6\u96B8\u96B9\u96CE\u96CB\u96C9\u96CD\u894D\u96DC\u970D\u96D5\u96F9\u9704\u9706\u9708\u9713\u970E\u9711\u970F\u9716\u9719\u9724\u972A\u9730\u9739\u973D\u973E\u9744\u9746\u9748\u9742\u9749\u975C\u9760\u9764\u9766\u9768\u52D2\u976B\u9771\u9779\u9785\u977C\u9781\u977A\u9786\u978B\u978F\u9790\u979C\u97A8\u97A6\u97A3\u97B3\u97B4\u97C3\u97C6\u97C8\u97CB\u97DC\u97ED\u9F4F\u97F2\u7ADF\u97F6\u97F5\u980F\u980C\u9838\u9824\u9821\u9837\u983D\u9846\u984F\u984B\u986B\u986F\u9870"], + ["e940", "\u9871\u9874\u9873\u98AA\u98AF\u98B1\u98B6\u98C4\u98C3\u98C6\u98E9\u98EB\u9903\u9909\u9912\u9914\u9918\u9921\u991D\u991E\u9924\u9920\u992C\u992E\u993D\u993E\u9942\u9949\u9945\u9950\u994B\u9951\u9952\u994C\u9955\u9997\u9998\u99A5\u99AD\u99AE\u99BC\u99DF\u99DB\u99DD\u99D8\u99D1\u99ED\u99EE\u99F1\u99F2\u99FB\u99F8\u9A01\u9A0F\u9A05\u99E2\u9A19\u9A2B\u9A37\u9A45\u9A42\u9A40\u9A43"], + ["e980", "\u9A3E\u9A55\u9A4D\u9A5B\u9A57\u9A5F\u9A62\u9A65\u9A64\u9A69\u9A6B\u9A6A\u9AAD\u9AB0\u9ABC\u9AC0\u9ACF\u9AD1\u9AD3\u9AD4\u9ADE\u9ADF\u9AE2\u9AE3\u9AE6\u9AEF\u9AEB\u9AEE\u9AF4\u9AF1\u9AF7\u9AFB\u9B06\u9B18\u9B1A\u9B1F\u9B22\u9B23\u9B25\u9B27\u9B28\u9B29\u9B2A\u9B2E\u9B2F\u9B32\u9B44\u9B43\u9B4F\u9B4D\u9B4E\u9B51\u9B58\u9B74\u9B93\u9B83\u9B91\u9B96\u9B97\u9B9F\u9BA0\u9BA8\u9BB4\u9BC0\u9BCA\u9BB9\u9BC6\u9BCF\u9BD1\u9BD2\u9BE3\u9BE2\u9BE4\u9BD4\u9BE1\u9C3A\u9BF2\u9BF1\u9BF0\u9C15\u9C14\u9C09\u9C13\u9C0C\u9C06\u9C08\u9C12\u9C0A\u9C04\u9C2E\u9C1B\u9C25\u9C24\u9C21\u9C30\u9C47\u9C32\u9C46\u9C3E\u9C5A\u9C60\u9C67\u9C76\u9C78\u9CE7\u9CEC\u9CF0\u9D09\u9D08\u9CEB\u9D03\u9D06\u9D2A\u9D26\u9DAF\u9D23\u9D1F\u9D44\u9D15\u9D12\u9D41\u9D3F\u9D3E\u9D46\u9D48"], + ["ea40", "\u9D5D\u9D5E\u9D64\u9D51\u9D50\u9D59\u9D72\u9D89\u9D87\u9DAB\u9D6F\u9D7A\u9D9A\u9DA4\u9DA9\u9DB2\u9DC4\u9DC1\u9DBB\u9DB8\u9DBA\u9DC6\u9DCF\u9DC2\u9DD9\u9DD3\u9DF8\u9DE6\u9DED\u9DEF\u9DFD\u9E1A\u9E1B\u9E1E\u9E75\u9E79\u9E7D\u9E81\u9E88\u9E8B\u9E8C\u9E92\u9E95\u9E91\u9E9D\u9EA5\u9EA9\u9EB8\u9EAA\u9EAD\u9761\u9ECC\u9ECE\u9ECF\u9ED0\u9ED4\u9EDC\u9EDE\u9EDD\u9EE0\u9EE5\u9EE8\u9EEF"], + ["ea80", "\u9EF4\u9EF6\u9EF7\u9EF9\u9EFB\u9EFC\u9EFD\u9F07\u9F08\u76B7\u9F15\u9F21\u9F2C\u9F3E\u9F4A\u9F52\u9F54\u9F63\u9F5F\u9F60\u9F61\u9F66\u9F67\u9F6C\u9F6A\u9F77\u9F72\u9F76\u9F95\u9F9C\u9FA0\u582F\u69C7\u9059\u7464\u51DC\u7199"], + ["ed40", "\u7E8A\u891C\u9348\u9288\u84DC\u4FC9\u70BB\u6631\u68C8\u92F9\u66FB\u5F45\u4E28\u4EE1\u4EFC\u4F00\u4F03\u4F39\u4F56\u4F92\u4F8A\u4F9A\u4F94\u4FCD\u5040\u5022\u4FFF\u501E\u5046\u5070\u5042\u5094\u50F4\u50D8\u514A\u5164\u519D\u51BE\u51EC\u5215\u529C\u52A6\u52C0\u52DB\u5300\u5307\u5324\u5372\u5393\u53B2\u53DD\uFA0E\u549C\u548A\u54A9\u54FF\u5586\u5759\u5765\u57AC\u57C8\u57C7\uFA0F"], + ["ed80", "\uFA10\u589E\u58B2\u590B\u5953\u595B\u595D\u5963\u59A4\u59BA\u5B56\u5BC0\u752F\u5BD8\u5BEC\u5C1E\u5CA6\u5CBA\u5CF5\u5D27\u5D53\uFA11\u5D42\u5D6D\u5DB8\u5DB9\u5DD0\u5F21\u5F34\u5F67\u5FB7\u5FDE\u605D\u6085\u608A\u60DE\u60D5\u6120\u60F2\u6111\u6137\u6130\u6198\u6213\u62A6\u63F5\u6460\u649D\u64CE\u654E\u6600\u6615\u663B\u6609\u662E\u661E\u6624\u6665\u6657\u6659\uFA12\u6673\u6699\u66A0\u66B2\u66BF\u66FA\u670E\uF929\u6766\u67BB\u6852\u67C0\u6801\u6844\u68CF\uFA13\u6968\uFA14\u6998\u69E2\u6A30\u6A6B\u6A46\u6A73\u6A7E\u6AE2\u6AE4\u6BD6\u6C3F\u6C5C\u6C86\u6C6F\u6CDA\u6D04\u6D87\u6D6F\u6D96\u6DAC\u6DCF\u6DF8\u6DF2\u6DFC\u6E39\u6E5C\u6E27\u6E3C\u6EBF\u6F88\u6FB5\u6FF5\u7005\u7007\u7028\u7085\u70AB\u710F\u7104\u715C\u7146\u7147\uFA15\u71C1\u71FE\u72B1"], + ["ee40", "\u72BE\u7324\uFA16\u7377\u73BD\u73C9\u73D6\u73E3\u73D2\u7407\u73F5\u7426\u742A\u7429\u742E\u7462\u7489\u749F\u7501\u756F\u7682\u769C\u769E\u769B\u76A6\uFA17\u7746\u52AF\u7821\u784E\u7864\u787A\u7930\uFA18\uFA19\uFA1A\u7994\uFA1B\u799B\u7AD1\u7AE7\uFA1C\u7AEB\u7B9E\uFA1D\u7D48\u7D5C\u7DB7\u7DA0\u7DD6\u7E52\u7F47\u7FA1\uFA1E\u8301\u8362\u837F\u83C7\u83F6\u8448\u84B4\u8553\u8559"], + ["ee80", "\u856B\uFA1F\u85B0\uFA20\uFA21\u8807\u88F5\u8A12\u8A37\u8A79\u8AA7\u8ABE\u8ADF\uFA22\u8AF6\u8B53\u8B7F\u8CF0\u8CF4\u8D12\u8D76\uFA23\u8ECF\uFA24\uFA25\u9067\u90DE\uFA26\u9115\u9127\u91DA\u91D7\u91DE\u91ED\u91EE\u91E4\u91E5\u9206\u9210\u920A\u923A\u9240\u923C\u924E\u9259\u9251\u9239\u9267\u92A7\u9277\u9278\u92E7\u92D7\u92D9\u92D0\uFA27\u92D5\u92E0\u92D3\u9325\u9321\u92FB\uFA28\u931E\u92FF\u931D\u9302\u9370\u9357\u93A4\u93C6\u93DE\u93F8\u9431\u9445\u9448\u9592\uF9DC\uFA29\u969D\u96AF\u9733\u973B\u9743\u974D\u974F\u9751\u9755\u9857\u9865\uFA2A\uFA2B\u9927\uFA2C\u999E\u9A4E\u9AD9\u9ADC\u9B75\u9B72\u9B8F\u9BB1\u9BBB\u9C00\u9D70\u9D6B\uFA2D\u9E19\u9ED1"], + ["eeef", "\u2170", 9, "\uFFE2\uFFE4\uFF07\uFF02"], + ["f040", "\uE000", 62], + ["f080", "\uE03F", 124], + ["f140", "\uE0BC", 62], + ["f180", "\uE0FB", 124], + ["f240", "\uE178", 62], + ["f280", "\uE1B7", 124], + ["f340", "\uE234", 62], + ["f380", "\uE273", 124], + ["f440", "\uE2F0", 62], + ["f480", "\uE32F", 124], + ["f540", "\uE3AC", 62], + ["f580", "\uE3EB", 124], + ["f640", "\uE468", 62], + ["f680", "\uE4A7", 124], + ["f740", "\uE524", 62], + ["f780", "\uE563", 124], + ["f840", "\uE5E0", 62], + ["f880", "\uE61F", 124], + ["f940", "\uE69C"], + ["fa40", "\u2170", 9, "\u2160", 9, "\uFFE2\uFFE4\uFF07\uFF02\u3231\u2116\u2121\u2235\u7E8A\u891C\u9348\u9288\u84DC\u4FC9\u70BB\u6631\u68C8\u92F9\u66FB\u5F45\u4E28\u4EE1\u4EFC\u4F00\u4F03\u4F39\u4F56\u4F92\u4F8A\u4F9A\u4F94\u4FCD\u5040\u5022\u4FFF\u501E\u5046\u5070\u5042\u5094\u50F4\u50D8\u514A"], + ["fa80", "\u5164\u519D\u51BE\u51EC\u5215\u529C\u52A6\u52C0\u52DB\u5300\u5307\u5324\u5372\u5393\u53B2\u53DD\uFA0E\u549C\u548A\u54A9\u54FF\u5586\u5759\u5765\u57AC\u57C8\u57C7\uFA0F\uFA10\u589E\u58B2\u590B\u5953\u595B\u595D\u5963\u59A4\u59BA\u5B56\u5BC0\u752F\u5BD8\u5BEC\u5C1E\u5CA6\u5CBA\u5CF5\u5D27\u5D53\uFA11\u5D42\u5D6D\u5DB8\u5DB9\u5DD0\u5F21\u5F34\u5F67\u5FB7\u5FDE\u605D\u6085\u608A\u60DE\u60D5\u6120\u60F2\u6111\u6137\u6130\u6198\u6213\u62A6\u63F5\u6460\u649D\u64CE\u654E\u6600\u6615\u663B\u6609\u662E\u661E\u6624\u6665\u6657\u6659\uFA12\u6673\u6699\u66A0\u66B2\u66BF\u66FA\u670E\uF929\u6766\u67BB\u6852\u67C0\u6801\u6844\u68CF\uFA13\u6968\uFA14\u6998\u69E2\u6A30\u6A6B\u6A46\u6A73\u6A7E\u6AE2\u6AE4\u6BD6\u6C3F\u6C5C\u6C86\u6C6F\u6CDA\u6D04\u6D87\u6D6F"], + ["fb40", "\u6D96\u6DAC\u6DCF\u6DF8\u6DF2\u6DFC\u6E39\u6E5C\u6E27\u6E3C\u6EBF\u6F88\u6FB5\u6FF5\u7005\u7007\u7028\u7085\u70AB\u710F\u7104\u715C\u7146\u7147\uFA15\u71C1\u71FE\u72B1\u72BE\u7324\uFA16\u7377\u73BD\u73C9\u73D6\u73E3\u73D2\u7407\u73F5\u7426\u742A\u7429\u742E\u7462\u7489\u749F\u7501\u756F\u7682\u769C\u769E\u769B\u76A6\uFA17\u7746\u52AF\u7821\u784E\u7864\u787A\u7930\uFA18\uFA19"], + ["fb80", "\uFA1A\u7994\uFA1B\u799B\u7AD1\u7AE7\uFA1C\u7AEB\u7B9E\uFA1D\u7D48\u7D5C\u7DB7\u7DA0\u7DD6\u7E52\u7F47\u7FA1\uFA1E\u8301\u8362\u837F\u83C7\u83F6\u8448\u84B4\u8553\u8559\u856B\uFA1F\u85B0\uFA20\uFA21\u8807\u88F5\u8A12\u8A37\u8A79\u8AA7\u8ABE\u8ADF\uFA22\u8AF6\u8B53\u8B7F\u8CF0\u8CF4\u8D12\u8D76\uFA23\u8ECF\uFA24\uFA25\u9067\u90DE\uFA26\u9115\u9127\u91DA\u91D7\u91DE\u91ED\u91EE\u91E4\u91E5\u9206\u9210\u920A\u923A\u9240\u923C\u924E\u9259\u9251\u9239\u9267\u92A7\u9277\u9278\u92E7\u92D7\u92D9\u92D0\uFA27\u92D5\u92E0\u92D3\u9325\u9321\u92FB\uFA28\u931E\u92FF\u931D\u9302\u9370\u9357\u93A4\u93C6\u93DE\u93F8\u9431\u9445\u9448\u9592\uF9DC\uFA29\u969D\u96AF\u9733\u973B\u9743\u974D\u974F\u9751\u9755\u9857\u9865\uFA2A\uFA2B\u9927\uFA2C\u999E\u9A4E\u9AD9"], + ["fc40", "\u9ADC\u9B75\u9B72\u9B8F\u9BB1\u9BBB\u9C00\u9D70\u9D6B\uFA2D\u9E19\u9ED1"] + ]; + } +}); + +// node_modules/iconv-lite/encodings/tables/eucjp.json +var require_eucjp = __commonJS({ + "node_modules/iconv-lite/encodings/tables/eucjp.json"(exports2, module2) { + module2.exports = [ + ["0", "\0", 127], + ["8ea1", "\uFF61", 62], + ["a1a1", "\u3000\u3001\u3002\uFF0C\uFF0E\u30FB\uFF1A\uFF1B\uFF1F\uFF01\u309B\u309C\xB4\uFF40\xA8\uFF3E\uFFE3\uFF3F\u30FD\u30FE\u309D\u309E\u3003\u4EDD\u3005\u3006\u3007\u30FC\u2015\u2010\uFF0F\uFF3C\uFF5E\u2225\uFF5C\u2026\u2025\u2018\u2019\u201C\u201D\uFF08\uFF09\u3014\u3015\uFF3B\uFF3D\uFF5B\uFF5D\u3008", 9, "\uFF0B\uFF0D\xB1\xD7\xF7\uFF1D\u2260\uFF1C\uFF1E\u2266\u2267\u221E\u2234\u2642\u2640\xB0\u2032\u2033\u2103\uFFE5\uFF04\uFFE0\uFFE1\uFF05\uFF03\uFF06\uFF0A\uFF20\xA7\u2606\u2605\u25CB\u25CF\u25CE\u25C7"], + ["a2a1", "\u25C6\u25A1\u25A0\u25B3\u25B2\u25BD\u25BC\u203B\u3012\u2192\u2190\u2191\u2193\u3013"], + ["a2ba", "\u2208\u220B\u2286\u2287\u2282\u2283\u222A\u2229"], + ["a2ca", "\u2227\u2228\uFFE2\u21D2\u21D4\u2200\u2203"], + ["a2dc", "\u2220\u22A5\u2312\u2202\u2207\u2261\u2252\u226A\u226B\u221A\u223D\u221D\u2235\u222B\u222C"], + ["a2f2", "\u212B\u2030\u266F\u266D\u266A\u2020\u2021\xB6"], + ["a2fe", "\u25EF"], + ["a3b0", "\uFF10", 9], + ["a3c1", "\uFF21", 25], + ["a3e1", "\uFF41", 25], + ["a4a1", "\u3041", 82], + ["a5a1", "\u30A1", 85], + ["a6a1", "\u0391", 16, "\u03A3", 6], + ["a6c1", "\u03B1", 16, "\u03C3", 6], + ["a7a1", "\u0410", 5, "\u0401\u0416", 25], + ["a7d1", "\u0430", 5, "\u0451\u0436", 25], + ["a8a1", "\u2500\u2502\u250C\u2510\u2518\u2514\u251C\u252C\u2524\u2534\u253C\u2501\u2503\u250F\u2513\u251B\u2517\u2523\u2533\u252B\u253B\u254B\u2520\u252F\u2528\u2537\u253F\u251D\u2530\u2525\u2538\u2542"], + ["ada1", "\u2460", 19, "\u2160", 9], + ["adc0", "\u3349\u3314\u3322\u334D\u3318\u3327\u3303\u3336\u3351\u3357\u330D\u3326\u3323\u332B\u334A\u333B\u339C\u339D\u339E\u338E\u338F\u33C4\u33A1"], + ["addf", "\u337B\u301D\u301F\u2116\u33CD\u2121\u32A4", 4, "\u3231\u3232\u3239\u337E\u337D\u337C\u2252\u2261\u222B\u222E\u2211\u221A\u22A5\u2220\u221F\u22BF\u2235\u2229\u222A"], + ["b0a1", "\u4E9C\u5516\u5A03\u963F\u54C0\u611B\u6328\u59F6\u9022\u8475\u831C\u7A50\u60AA\u63E1\u6E25\u65ED\u8466\u82A6\u9BF5\u6893\u5727\u65A1\u6271\u5B9B\u59D0\u867B\u98F4\u7D62\u7DBE\u9B8E\u6216\u7C9F\u88B7\u5B89\u5EB5\u6309\u6697\u6848\u95C7\u978D\u674F\u4EE5\u4F0A\u4F4D\u4F9D\u5049\u56F2\u5937\u59D4\u5A01\u5C09\u60DF\u610F\u6170\u6613\u6905\u70BA\u754F\u7570\u79FB\u7DAD\u7DEF\u80C3\u840E\u8863\u8B02\u9055\u907A\u533B\u4E95\u4EA5\u57DF\u80B2\u90C1\u78EF\u4E00\u58F1\u6EA2\u9038\u7A32\u8328\u828B\u9C2F\u5141\u5370\u54BD\u54E1\u56E0\u59FB\u5F15\u98F2\u6DEB\u80E4\u852D"], + ["b1a1", "\u9662\u9670\u96A0\u97FB\u540B\u53F3\u5B87\u70CF\u7FBD\u8FC2\u96E8\u536F\u9D5C\u7ABA\u4E11\u7893\u81FC\u6E26\u5618\u5504\u6B1D\u851A\u9C3B\u59E5\u53A9\u6D66\u74DC\u958F\u5642\u4E91\u904B\u96F2\u834F\u990C\u53E1\u55B6\u5B30\u5F71\u6620\u66F3\u6804\u6C38\u6CF3\u6D29\u745B\u76C8\u7A4E\u9834\u82F1\u885B\u8A60\u92ED\u6DB2\u75AB\u76CA\u99C5\u60A6\u8B01\u8D8A\u95B2\u698E\u53AD\u5186\u5712\u5830\u5944\u5BB4\u5EF6\u6028\u63A9\u63F4\u6CBF\u6F14\u708E\u7114\u7159\u71D5\u733F\u7E01\u8276\u82D1\u8597\u9060\u925B\u9D1B\u5869\u65BC\u6C5A\u7525\u51F9\u592E\u5965\u5F80\u5FDC"], + ["b2a1", "\u62BC\u65FA\u6A2A\u6B27\u6BB4\u738B\u7FC1\u8956\u9D2C\u9D0E\u9EC4\u5CA1\u6C96\u837B\u5104\u5C4B\u61B6\u81C6\u6876\u7261\u4E59\u4FFA\u5378\u6069\u6E29\u7A4F\u97F3\u4E0B\u5316\u4EEE\u4F55\u4F3D\u4FA1\u4F73\u52A0\u53EF\u5609\u590F\u5AC1\u5BB6\u5BE1\u79D1\u6687\u679C\u67B6\u6B4C\u6CB3\u706B\u73C2\u798D\u79BE\u7A3C\u7B87\u82B1\u82DB\u8304\u8377\u83EF\u83D3\u8766\u8AB2\u5629\u8CA8\u8FE6\u904E\u971E\u868A\u4FC4\u5CE8\u6211\u7259\u753B\u81E5\u82BD\u86FE\u8CC0\u96C5\u9913\u99D5\u4ECB\u4F1A\u89E3\u56DE\u584A\u58CA\u5EFB\u5FEB\u602A\u6094\u6062\u61D0\u6212\u62D0\u6539"], + ["b3a1", "\u9B41\u6666\u68B0\u6D77\u7070\u754C\u7686\u7D75\u82A5\u87F9\u958B\u968E\u8C9D\u51F1\u52BE\u5916\u54B3\u5BB3\u5D16\u6168\u6982\u6DAF\u788D\u84CB\u8857\u8A72\u93A7\u9AB8\u6D6C\u99A8\u86D9\u57A3\u67FF\u86CE\u920E\u5283\u5687\u5404\u5ED3\u62E1\u64B9\u683C\u6838\u6BBB\u7372\u78BA\u7A6B\u899A\u89D2\u8D6B\u8F03\u90ED\u95A3\u9694\u9769\u5B66\u5CB3\u697D\u984D\u984E\u639B\u7B20\u6A2B\u6A7F\u68B6\u9C0D\u6F5F\u5272\u559D\u6070\u62EC\u6D3B\u6E07\u6ED1\u845B\u8910\u8F44\u4E14\u9C39\u53F6\u691B\u6A3A\u9784\u682A\u515C\u7AC3\u84B2\u91DC\u938C\u565B\u9D28\u6822\u8305\u8431"], + ["b4a1", "\u7CA5\u5208\u82C5\u74E6\u4E7E\u4F83\u51A0\u5BD2\u520A\u52D8\u52E7\u5DFB\u559A\u582A\u59E6\u5B8C\u5B98\u5BDB\u5E72\u5E79\u60A3\u611F\u6163\u61BE\u63DB\u6562\u67D1\u6853\u68FA\u6B3E\u6B53\u6C57\u6F22\u6F97\u6F45\u74B0\u7518\u76E3\u770B\u7AFF\u7BA1\u7C21\u7DE9\u7F36\u7FF0\u809D\u8266\u839E\u89B3\u8ACC\u8CAB\u9084\u9451\u9593\u9591\u95A2\u9665\u97D3\u9928\u8218\u4E38\u542B\u5CB8\u5DCC\u73A9\u764C\u773C\u5CA9\u7FEB\u8D0B\u96C1\u9811\u9854\u9858\u4F01\u4F0E\u5371\u559C\u5668\u57FA\u5947\u5B09\u5BC4\u5C90\u5E0C\u5E7E\u5FCC\u63EE\u673A\u65D7\u65E2\u671F\u68CB\u68C4"], + ["b5a1", "\u6A5F\u5E30\u6BC5\u6C17\u6C7D\u757F\u7948\u5B63\u7A00\u7D00\u5FBD\u898F\u8A18\u8CB4\u8D77\u8ECC\u8F1D\u98E2\u9A0E\u9B3C\u4E80\u507D\u5100\u5993\u5B9C\u622F\u6280\u64EC\u6B3A\u72A0\u7591\u7947\u7FA9\u87FB\u8ABC\u8B70\u63AC\u83CA\u97A0\u5409\u5403\u55AB\u6854\u6A58\u8A70\u7827\u6775\u9ECD\u5374\u5BA2\u811A\u8650\u9006\u4E18\u4E45\u4EC7\u4F11\u53CA\u5438\u5BAE\u5F13\u6025\u6551\u673D\u6C42\u6C72\u6CE3\u7078\u7403\u7A76\u7AAE\u7B08\u7D1A\u7CFE\u7D66\u65E7\u725B\u53BB\u5C45\u5DE8\u62D2\u62E0\u6319\u6E20\u865A\u8A31\u8DDD\u92F8\u6F01\u79A6\u9B5A\u4EA8\u4EAB\u4EAC"], + ["b6a1", "\u4F9B\u4FA0\u50D1\u5147\u7AF6\u5171\u51F6\u5354\u5321\u537F\u53EB\u55AC\u5883\u5CE1\u5F37\u5F4A\u602F\u6050\u606D\u631F\u6559\u6A4B\u6CC1\u72C2\u72ED\u77EF\u80F8\u8105\u8208\u854E\u90F7\u93E1\u97FF\u9957\u9A5A\u4EF0\u51DD\u5C2D\u6681\u696D\u5C40\u66F2\u6975\u7389\u6850\u7C81\u50C5\u52E4\u5747\u5DFE\u9326\u65A4\u6B23\u6B3D\u7434\u7981\u79BD\u7B4B\u7DCA\u82B9\u83CC\u887F\u895F\u8B39\u8FD1\u91D1\u541F\u9280\u4E5D\u5036\u53E5\u533A\u72D7\u7396\u77E9\u82E6\u8EAF\u99C6\u99C8\u99D2\u5177\u611A\u865E\u55B0\u7A7A\u5076\u5BD3\u9047\u9685\u4E32\u6ADB\u91E7\u5C51\u5C48"], + ["b7a1", "\u6398\u7A9F\u6C93\u9774\u8F61\u7AAA\u718A\u9688\u7C82\u6817\u7E70\u6851\u936C\u52F2\u541B\u85AB\u8A13\u7FA4\u8ECD\u90E1\u5366\u8888\u7941\u4FC2\u50BE\u5211\u5144\u5553\u572D\u73EA\u578B\u5951\u5F62\u5F84\u6075\u6176\u6167\u61A9\u63B2\u643A\u656C\u666F\u6842\u6E13\u7566\u7A3D\u7CFB\u7D4C\u7D99\u7E4B\u7F6B\u830E\u834A\u86CD\u8A08\u8A63\u8B66\u8EFD\u981A\u9D8F\u82B8\u8FCE\u9BE8\u5287\u621F\u6483\u6FC0\u9699\u6841\u5091\u6B20\u6C7A\u6F54\u7A74\u7D50\u8840\u8A23\u6708\u4EF6\u5039\u5026\u5065\u517C\u5238\u5263\u55A7\u570F\u5805\u5ACC\u5EFA\u61B2\u61F8\u62F3\u6372"], + ["b8a1", "\u691C\u6A29\u727D\u72AC\u732E\u7814\u786F\u7D79\u770C\u80A9\u898B\u8B19\u8CE2\u8ED2\u9063\u9375\u967A\u9855\u9A13\u9E78\u5143\u539F\u53B3\u5E7B\u5F26\u6E1B\u6E90\u7384\u73FE\u7D43\u8237\u8A00\u8AFA\u9650\u4E4E\u500B\u53E4\u547C\u56FA\u59D1\u5B64\u5DF1\u5EAB\u5F27\u6238\u6545\u67AF\u6E56\u72D0\u7CCA\u88B4\u80A1\u80E1\u83F0\u864E\u8A87\u8DE8\u9237\u96C7\u9867\u9F13\u4E94\u4E92\u4F0D\u5348\u5449\u543E\u5A2F\u5F8C\u5FA1\u609F\u68A7\u6A8E\u745A\u7881\u8A9E\u8AA4\u8B77\u9190\u4E5E\u9BC9\u4EA4\u4F7C\u4FAF\u5019\u5016\u5149\u516C\u529F\u52B9\u52FE\u539A\u53E3\u5411"], + ["b9a1", "\u540E\u5589\u5751\u57A2\u597D\u5B54\u5B5D\u5B8F\u5DE5\u5DE7\u5DF7\u5E78\u5E83\u5E9A\u5EB7\u5F18\u6052\u614C\u6297\u62D8\u63A7\u653B\u6602\u6643\u66F4\u676D\u6821\u6897\u69CB\u6C5F\u6D2A\u6D69\u6E2F\u6E9D\u7532\u7687\u786C\u7A3F\u7CE0\u7D05\u7D18\u7D5E\u7DB1\u8015\u8003\u80AF\u80B1\u8154\u818F\u822A\u8352\u884C\u8861\u8B1B\u8CA2\u8CFC\u90CA\u9175\u9271\u783F\u92FC\u95A4\u964D\u9805\u9999\u9AD8\u9D3B\u525B\u52AB\u53F7\u5408\u58D5\u62F7\u6FE0\u8C6A\u8F5F\u9EB9\u514B\u523B\u544A\u56FD\u7A40\u9177\u9D60\u9ED2\u7344\u6F09\u8170\u7511\u5FFD\u60DA\u9AA8\u72DB\u8FBC"], + ["baa1", "\u6B64\u9803\u4ECA\u56F0\u5764\u58BE\u5A5A\u6068\u61C7\u660F\u6606\u6839\u68B1\u6DF7\u75D5\u7D3A\u826E\u9B42\u4E9B\u4F50\u53C9\u5506\u5D6F\u5DE6\u5DEE\u67FB\u6C99\u7473\u7802\u8A50\u9396\u88DF\u5750\u5EA7\u632B\u50B5\u50AC\u518D\u6700\u54C9\u585E\u59BB\u5BB0\u5F69\u624D\u63A1\u683D\u6B73\u6E08\u707D\u91C7\u7280\u7815\u7826\u796D\u658E\u7D30\u83DC\u88C1\u8F09\u969B\u5264\u5728\u6750\u7F6A\u8CA1\u51B4\u5742\u962A\u583A\u698A\u80B4\u54B2\u5D0E\u57FC\u7895\u9DFA\u4F5C\u524A\u548B\u643E\u6628\u6714\u67F5\u7A84\u7B56\u7D22\u932F\u685C\u9BAD\u7B39\u5319\u518A\u5237"], + ["bba1", "\u5BDF\u62F6\u64AE\u64E6\u672D\u6BBA\u85A9\u96D1\u7690\u9BD6\u634C\u9306\u9BAB\u76BF\u6652\u4E09\u5098\u53C2\u5C71\u60E8\u6492\u6563\u685F\u71E6\u73CA\u7523\u7B97\u7E82\u8695\u8B83\u8CDB\u9178\u9910\u65AC\u66AB\u6B8B\u4ED5\u4ED4\u4F3A\u4F7F\u523A\u53F8\u53F2\u55E3\u56DB\u58EB\u59CB\u59C9\u59FF\u5B50\u5C4D\u5E02\u5E2B\u5FD7\u601D\u6307\u652F\u5B5C\u65AF\u65BD\u65E8\u679D\u6B62\u6B7B\u6C0F\u7345\u7949\u79C1\u7CF8\u7D19\u7D2B\u80A2\u8102\u81F3\u8996\u8A5E\u8A69\u8A66\u8A8C\u8AEE\u8CC7\u8CDC\u96CC\u98FC\u6B6F\u4E8B\u4F3C\u4F8D\u5150\u5B57\u5BFA\u6148\u6301\u6642"], + ["bca1", "\u6B21\u6ECB\u6CBB\u723E\u74BD\u75D4\u78C1\u793A\u800C\u8033\u81EA\u8494\u8F9E\u6C50\u9E7F\u5F0F\u8B58\u9D2B\u7AFA\u8EF8\u5B8D\u96EB\u4E03\u53F1\u57F7\u5931\u5AC9\u5BA4\u6089\u6E7F\u6F06\u75BE\u8CEA\u5B9F\u8500\u7BE0\u5072\u67F4\u829D\u5C61\u854A\u7E1E\u820E\u5199\u5C04\u6368\u8D66\u659C\u716E\u793E\u7D17\u8005\u8B1D\u8ECA\u906E\u86C7\u90AA\u501F\u52FA\u5C3A\u6753\u707C\u7235\u914C\u91C8\u932B\u82E5\u5BC2\u5F31\u60F9\u4E3B\u53D6\u5B88\u624B\u6731\u6B8A\u72E9\u73E0\u7A2E\u816B\u8DA3\u9152\u9996\u5112\u53D7\u546A\u5BFF\u6388\u6A39\u7DAC\u9700\u56DA\u53CE\u5468"], + ["bda1", "\u5B97\u5C31\u5DDE\u4FEE\u6101\u62FE\u6D32\u79C0\u79CB\u7D42\u7E4D\u7FD2\u81ED\u821F\u8490\u8846\u8972\u8B90\u8E74\u8F2F\u9031\u914B\u916C\u96C6\u919C\u4EC0\u4F4F\u5145\u5341\u5F93\u620E\u67D4\u6C41\u6E0B\u7363\u7E26\u91CD\u9283\u53D4\u5919\u5BBF\u6DD1\u795D\u7E2E\u7C9B\u587E\u719F\u51FA\u8853\u8FF0\u4FCA\u5CFB\u6625\u77AC\u7AE3\u821C\u99FF\u51C6\u5FAA\u65EC\u696F\u6B89\u6DF3\u6E96\u6F64\u76FE\u7D14\u5DE1\u9075\u9187\u9806\u51E6\u521D\u6240\u6691\u66D9\u6E1A\u5EB6\u7DD2\u7F72\u66F8\u85AF\u85F7\u8AF8\u52A9\u53D9\u5973\u5E8F\u5F90\u6055\u92E4\u9664\u50B7\u511F"], + ["bea1", "\u52DD\u5320\u5347\u53EC\u54E8\u5546\u5531\u5617\u5968\u59BE\u5A3C\u5BB5\u5C06\u5C0F\u5C11\u5C1A\u5E84\u5E8A\u5EE0\u5F70\u627F\u6284\u62DB\u638C\u6377\u6607\u660C\u662D\u6676\u677E\u68A2\u6A1F\u6A35\u6CBC\u6D88\u6E09\u6E58\u713C\u7126\u7167\u75C7\u7701\u785D\u7901\u7965\u79F0\u7AE0\u7B11\u7CA7\u7D39\u8096\u83D6\u848B\u8549\u885D\u88F3\u8A1F\u8A3C\u8A54\u8A73\u8C61\u8CDE\u91A4\u9266\u937E\u9418\u969C\u9798\u4E0A\u4E08\u4E1E\u4E57\u5197\u5270\u57CE\u5834\u58CC\u5B22\u5E38\u60C5\u64FE\u6761\u6756\u6D44\u72B6\u7573\u7A63\u84B8\u8B72\u91B8\u9320\u5631\u57F4\u98FE"], + ["bfa1", "\u62ED\u690D\u6B96\u71ED\u7E54\u8077\u8272\u89E6\u98DF\u8755\u8FB1\u5C3B\u4F38\u4FE1\u4FB5\u5507\u5A20\u5BDD\u5BE9\u5FC3\u614E\u632F\u65B0\u664B\u68EE\u699B\u6D78\u6DF1\u7533\u75B9\u771F\u795E\u79E6\u7D33\u81E3\u82AF\u85AA\u89AA\u8A3A\u8EAB\u8F9B\u9032\u91DD\u9707\u4EBA\u4EC1\u5203\u5875\u58EC\u5C0B\u751A\u5C3D\u814E\u8A0A\u8FC5\u9663\u976D\u7B25\u8ACF\u9808\u9162\u56F3\u53A8\u9017\u5439\u5782\u5E25\u63A8\u6C34\u708A\u7761\u7C8B\u7FE0\u8870\u9042\u9154\u9310\u9318\u968F\u745E\u9AC4\u5D07\u5D69\u6570\u67A2\u8DA8\u96DB\u636E\u6749\u6919\u83C5\u9817\u96C0\u88FE"], + ["c0a1", "\u6F84\u647A\u5BF8\u4E16\u702C\u755D\u662F\u51C4\u5236\u52E2\u59D3\u5F81\u6027\u6210\u653F\u6574\u661F\u6674\u68F2\u6816\u6B63\u6E05\u7272\u751F\u76DB\u7CBE\u8056\u58F0\u88FD\u897F\u8AA0\u8A93\u8ACB\u901D\u9192\u9752\u9759\u6589\u7A0E\u8106\u96BB\u5E2D\u60DC\u621A\u65A5\u6614\u6790\u77F3\u7A4D\u7C4D\u7E3E\u810A\u8CAC\u8D64\u8DE1\u8E5F\u78A9\u5207\u62D9\u63A5\u6442\u6298\u8A2D\u7A83\u7BC0\u8AAC\u96EA\u7D76\u820C\u8749\u4ED9\u5148\u5343\u5360\u5BA3\u5C02\u5C16\u5DDD\u6226\u6247\u64B0\u6813\u6834\u6CC9\u6D45\u6D17\u67D3\u6F5C\u714E\u717D\u65CB\u7A7F\u7BAD\u7DDA"], + ["c1a1", "\u7E4A\u7FA8\u817A\u821B\u8239\u85A6\u8A6E\u8CCE\u8DF5\u9078\u9077\u92AD\u9291\u9583\u9BAE\u524D\u5584\u6F38\u7136\u5168\u7985\u7E55\u81B3\u7CCE\u564C\u5851\u5CA8\u63AA\u66FE\u66FD\u695A\u72D9\u758F\u758E\u790E\u7956\u79DF\u7C97\u7D20\u7D44\u8607\u8A34\u963B\u9061\u9F20\u50E7\u5275\u53CC\u53E2\u5009\u55AA\u58EE\u594F\u723D\u5B8B\u5C64\u531D\u60E3\u60F3\u635C\u6383\u633F\u63BB\u64CD\u65E9\u66F9\u5DE3\u69CD\u69FD\u6F15\u71E5\u4E89\u75E9\u76F8\u7A93\u7CDF\u7DCF\u7D9C\u8061\u8349\u8358\u846C\u84BC\u85FB\u88C5\u8D70\u9001\u906D\u9397\u971C\u9A12\u50CF\u5897\u618E"], + ["c2a1", "\u81D3\u8535\u8D08\u9020\u4FC3\u5074\u5247\u5373\u606F\u6349\u675F\u6E2C\u8DB3\u901F\u4FD7\u5C5E\u8CCA\u65CF\u7D9A\u5352\u8896\u5176\u63C3\u5B58\u5B6B\u5C0A\u640D\u6751\u905C\u4ED6\u591A\u592A\u6C70\u8A51\u553E\u5815\u59A5\u60F0\u6253\u67C1\u8235\u6955\u9640\u99C4\u9A28\u4F53\u5806\u5BFE\u8010\u5CB1\u5E2F\u5F85\u6020\u614B\u6234\u66FF\u6CF0\u6EDE\u80CE\u817F\u82D4\u888B\u8CB8\u9000\u902E\u968A\u9EDB\u9BDB\u4EE3\u53F0\u5927\u7B2C\u918D\u984C\u9DF9\u6EDD\u7027\u5353\u5544\u5B85\u6258\u629E\u62D3\u6CA2\u6FEF\u7422\u8A17\u9438\u6FC1\u8AFE\u8338\u51E7\u86F8\u53EA"], + ["c3a1", "\u53E9\u4F46\u9054\u8FB0\u596A\u8131\u5DFD\u7AEA\u8FBF\u68DA\u8C37\u72F8\u9C48\u6A3D\u8AB0\u4E39\u5358\u5606\u5766\u62C5\u63A2\u65E6\u6B4E\u6DE1\u6E5B\u70AD\u77ED\u7AEF\u7BAA\u7DBB\u803D\u80C6\u86CB\u8A95\u935B\u56E3\u58C7\u5F3E\u65AD\u6696\u6A80\u6BB5\u7537\u8AC7\u5024\u77E5\u5730\u5F1B\u6065\u667A\u6C60\u75F4\u7A1A\u7F6E\u81F4\u8718\u9045\u99B3\u7BC9\u755C\u7AF9\u7B51\u84C4\u9010\u79E9\u7A92\u8336\u5AE1\u7740\u4E2D\u4EF2\u5B99\u5FE0\u62BD\u663C\u67F1\u6CE8\u866B\u8877\u8A3B\u914E\u92F3\u99D0\u6A17\u7026\u732A\u82E7\u8457\u8CAF\u4E01\u5146\u51CB\u558B\u5BF5"], + ["c4a1", "\u5E16\u5E33\u5E81\u5F14\u5F35\u5F6B\u5FB4\u61F2\u6311\u66A2\u671D\u6F6E\u7252\u753A\u773A\u8074\u8139\u8178\u8776\u8ABF\u8ADC\u8D85\u8DF3\u929A\u9577\u9802\u9CE5\u52C5\u6357\u76F4\u6715\u6C88\u73CD\u8CC3\u93AE\u9673\u6D25\u589C\u690E\u69CC\u8FFD\u939A\u75DB\u901A\u585A\u6802\u63B4\u69FB\u4F43\u6F2C\u67D8\u8FBB\u8526\u7DB4\u9354\u693F\u6F70\u576A\u58F7\u5B2C\u7D2C\u722A\u540A\u91E3\u9DB4\u4EAD\u4F4E\u505C\u5075\u5243\u8C9E\u5448\u5824\u5B9A\u5E1D\u5E95\u5EAD\u5EF7\u5F1F\u608C\u62B5\u633A\u63D0\u68AF\u6C40\u7887\u798E\u7A0B\u7DE0\u8247\u8A02\u8AE6\u8E44\u9013"], + ["c5a1", "\u90B8\u912D\u91D8\u9F0E\u6CE5\u6458\u64E2\u6575\u6EF4\u7684\u7B1B\u9069\u93D1\u6EBA\u54F2\u5FB9\u64A4\u8F4D\u8FED\u9244\u5178\u586B\u5929\u5C55\u5E97\u6DFB\u7E8F\u751C\u8CBC\u8EE2\u985B\u70B9\u4F1D\u6BBF\u6FB1\u7530\u96FB\u514E\u5410\u5835\u5857\u59AC\u5C60\u5F92\u6597\u675C\u6E21\u767B\u83DF\u8CED\u9014\u90FD\u934D\u7825\u783A\u52AA\u5EA6\u571F\u5974\u6012\u5012\u515A\u51AC\u51CD\u5200\u5510\u5854\u5858\u5957\u5B95\u5CF6\u5D8B\u60BC\u6295\u642D\u6771\u6843\u68BC\u68DF\u76D7\u6DD8\u6E6F\u6D9B\u706F\u71C8\u5F53\u75D8\u7977\u7B49\u7B54\u7B52\u7CD6\u7D71\u5230"], + ["c6a1", "\u8463\u8569\u85E4\u8A0E\u8B04\u8C46\u8E0F\u9003\u900F\u9419\u9676\u982D\u9A30\u95D8\u50CD\u52D5\u540C\u5802\u5C0E\u61A7\u649E\u6D1E\u77B3\u7AE5\u80F4\u8404\u9053\u9285\u5CE0\u9D07\u533F\u5F97\u5FB3\u6D9C\u7279\u7763\u79BF\u7BE4\u6BD2\u72EC\u8AAD\u6803\u6A61\u51F8\u7A81\u6934\u5C4A\u9CF6\u82EB\u5BC5\u9149\u701E\u5678\u5C6F\u60C7\u6566\u6C8C\u8C5A\u9041\u9813\u5451\u66C7\u920D\u5948\u90A3\u5185\u4E4D\u51EA\u8599\u8B0E\u7058\u637A\u934B\u6962\u99B4\u7E04\u7577\u5357\u6960\u8EDF\u96E3\u6C5D\u4E8C\u5C3C\u5F10\u8FE9\u5302\u8CD1\u8089\u8679\u5EFF\u65E5\u4E73\u5165"], + ["c7a1", "\u5982\u5C3F\u97EE\u4EFB\u598A\u5FCD\u8A8D\u6FE1\u79B0\u7962\u5BE7\u8471\u732B\u71B1\u5E74\u5FF5\u637B\u649A\u71C3\u7C98\u4E43\u5EFC\u4E4B\u57DC\u56A2\u60A9\u6FC3\u7D0D\u80FD\u8133\u81BF\u8FB2\u8997\u86A4\u5DF4\u628A\u64AD\u8987\u6777\u6CE2\u6D3E\u7436\u7834\u5A46\u7F75\u82AD\u99AC\u4FF3\u5EC3\u62DD\u6392\u6557\u676F\u76C3\u724C\u80CC\u80BA\u8F29\u914D\u500D\u57F9\u5A92\u6885\u6973\u7164\u72FD\u8CB7\u58F2\u8CE0\u966A\u9019\u877F\u79E4\u77E7\u8429\u4F2F\u5265\u535A\u62CD\u67CF\u6CCA\u767D\u7B94\u7C95\u8236\u8584\u8FEB\u66DD\u6F20\u7206\u7E1B\u83AB\u99C1\u9EA6"], + ["c8a1", "\u51FD\u7BB1\u7872\u7BB8\u8087\u7B48\u6AE8\u5E61\u808C\u7551\u7560\u516B\u9262\u6E8C\u767A\u9197\u9AEA\u4F10\u7F70\u629C\u7B4F\u95A5\u9CE9\u567A\u5859\u86E4\u96BC\u4F34\u5224\u534A\u53CD\u53DB\u5E06\u642C\u6591\u677F\u6C3E\u6C4E\u7248\u72AF\u73ED\u7554\u7E41\u822C\u85E9\u8CA9\u7BC4\u91C6\u7169\u9812\u98EF\u633D\u6669\u756A\u76E4\u78D0\u8543\u86EE\u532A\u5351\u5426\u5983\u5E87\u5F7C\u60B2\u6249\u6279\u62AB\u6590\u6BD4\u6CCC\u75B2\u76AE\u7891\u79D8\u7DCB\u7F77\u80A5\u88AB\u8AB9\u8CBB\u907F\u975E\u98DB\u6A0B\u7C38\u5099\u5C3E\u5FAE\u6787\u6BD8\u7435\u7709\u7F8E"], + ["c9a1", "\u9F3B\u67CA\u7A17\u5339\u758B\u9AED\u5F66\u819D\u83F1\u8098\u5F3C\u5FC5\u7562\u7B46\u903C\u6867\u59EB\u5A9B\u7D10\u767E\u8B2C\u4FF5\u5F6A\u6A19\u6C37\u6F02\u74E2\u7968\u8868\u8A55\u8C79\u5EDF\u63CF\u75C5\u79D2\u82D7\u9328\u92F2\u849C\u86ED\u9C2D\u54C1\u5F6C\u658C\u6D5C\u7015\u8CA7\u8CD3\u983B\u654F\u74F6\u4E0D\u4ED8\u57E0\u592B\u5A66\u5BCC\u51A8\u5E03\u5E9C\u6016\u6276\u6577\u65A7\u666E\u6D6E\u7236\u7B26\u8150\u819A\u8299\u8B5C\u8CA0\u8CE6\u8D74\u961C\u9644\u4FAE\u64AB\u6B66\u821E\u8461\u856A\u90E8\u5C01\u6953\u98A8\u847A\u8557\u4F0F\u526F\u5FA9\u5E45\u670D"], + ["caa1", "\u798F\u8179\u8907\u8986\u6DF5\u5F17\u6255\u6CB8\u4ECF\u7269\u9B92\u5206\u543B\u5674\u58B3\u61A4\u626E\u711A\u596E\u7C89\u7CDE\u7D1B\u96F0\u6587\u805E\u4E19\u4F75\u5175\u5840\u5E63\u5E73\u5F0A\u67C4\u4E26\u853D\u9589\u965B\u7C73\u9801\u50FB\u58C1\u7656\u78A7\u5225\u77A5\u8511\u7B86\u504F\u5909\u7247\u7BC7\u7DE8\u8FBA\u8FD4\u904D\u4FBF\u52C9\u5A29\u5F01\u97AD\u4FDD\u8217\u92EA\u5703\u6355\u6B69\u752B\u88DC\u8F14\u7A42\u52DF\u5893\u6155\u620A\u66AE\u6BCD\u7C3F\u83E9\u5023\u4FF8\u5305\u5446\u5831\u5949\u5B9D\u5CF0\u5CEF\u5D29\u5E96\u62B1\u6367\u653E\u65B9\u670B"], + ["cba1", "\u6CD5\u6CE1\u70F9\u7832\u7E2B\u80DE\u82B3\u840C\u84EC\u8702\u8912\u8A2A\u8C4A\u90A6\u92D2\u98FD\u9CF3\u9D6C\u4E4F\u4EA1\u508D\u5256\u574A\u59A8\u5E3D\u5FD8\u5FD9\u623F\u66B4\u671B\u67D0\u68D2\u5192\u7D21\u80AA\u81A8\u8B00\u8C8C\u8CBF\u927E\u9632\u5420\u982C\u5317\u50D5\u535C\u58A8\u64B2\u6734\u7267\u7766\u7A46\u91E6\u52C3\u6CA1\u6B86\u5800\u5E4C\u5954\u672C\u7FFB\u51E1\u76C6\u6469\u78E8\u9B54\u9EBB\u57CB\u59B9\u6627\u679A\u6BCE\u54E9\u69D9\u5E55\u819C\u6795\u9BAA\u67FE\u9C52\u685D\u4EA6\u4FE3\u53C8\u62B9\u672B\u6CAB\u8FC4\u4FAD\u7E6D\u9EBF\u4E07\u6162\u6E80"], + ["cca1", "\u6F2B\u8513\u5473\u672A\u9B45\u5DF3\u7B95\u5CAC\u5BC6\u871C\u6E4A\u84D1\u7A14\u8108\u5999\u7C8D\u6C11\u7720\u52D9\u5922\u7121\u725F\u77DB\u9727\u9D61\u690B\u5A7F\u5A18\u51A5\u540D\u547D\u660E\u76DF\u8FF7\u9298\u9CF4\u59EA\u725D\u6EC5\u514D\u68C9\u7DBF\u7DEC\u9762\u9EBA\u6478\u6A21\u8302\u5984\u5B5F\u6BDB\u731B\u76F2\u7DB2\u8017\u8499\u5132\u6728\u9ED9\u76EE\u6762\u52FF\u9905\u5C24\u623B\u7C7E\u8CB0\u554F\u60B6\u7D0B\u9580\u5301\u4E5F\u51B6\u591C\u723A\u8036\u91CE\u5F25\u77E2\u5384\u5F79\u7D04\u85AC\u8A33\u8E8D\u9756\u67F3\u85AE\u9453\u6109\u6108\u6CB9\u7652"], + ["cda1", "\u8AED\u8F38\u552F\u4F51\u512A\u52C7\u53CB\u5BA5\u5E7D\u60A0\u6182\u63D6\u6709\u67DA\u6E67\u6D8C\u7336\u7337\u7531\u7950\u88D5\u8A98\u904A\u9091\u90F5\u96C4\u878D\u5915\u4E88\u4F59\u4E0E\u8A89\u8F3F\u9810\u50AD\u5E7C\u5996\u5BB9\u5EB8\u63DA\u63FA\u64C1\u66DC\u694A\u69D8\u6D0B\u6EB6\u7194\u7528\u7AAF\u7F8A\u8000\u8449\u84C9\u8981\u8B21\u8E0A\u9065\u967D\u990A\u617E\u6291\u6B32\u6C83\u6D74\u7FCC\u7FFC\u6DC0\u7F85\u87BA\u88F8\u6765\u83B1\u983C\u96F7\u6D1B\u7D61\u843D\u916A\u4E71\u5375\u5D50\u6B04\u6FEB\u85CD\u862D\u89A7\u5229\u540F\u5C65\u674E\u68A8\u7406\u7483"], + ["cea1", "\u75E2\u88CF\u88E1\u91CC\u96E2\u9678\u5F8B\u7387\u7ACB\u844E\u63A0\u7565\u5289\u6D41\u6E9C\u7409\u7559\u786B\u7C92\u9686\u7ADC\u9F8D\u4FB6\u616E\u65C5\u865C\u4E86\u4EAE\u50DA\u4E21\u51CC\u5BEE\u6599\u6881\u6DBC\u731F\u7642\u77AD\u7A1C\u7CE7\u826F\u8AD2\u907C\u91CF\u9675\u9818\u529B\u7DD1\u502B\u5398\u6797\u6DCB\u71D0\u7433\u81E8\u8F2A\u96A3\u9C57\u9E9F\u7460\u5841\u6D99\u7D2F\u985E\u4EE4\u4F36\u4F8B\u51B7\u52B1\u5DBA\u601C\u73B2\u793C\u82D3\u9234\u96B7\u96F6\u970A\u9E97\u9F62\u66A6\u6B74\u5217\u52A3\u70C8\u88C2\u5EC9\u604B\u6190\u6F23\u7149\u7C3E\u7DF4\u806F"], + ["cfa1", "\u84EE\u9023\u932C\u5442\u9B6F\u6AD3\u7089\u8CC2\u8DEF\u9732\u52B4\u5A41\u5ECA\u5F04\u6717\u697C\u6994\u6D6A\u6F0F\u7262\u72FC\u7BED\u8001\u807E\u874B\u90CE\u516D\u9E93\u7984\u808B\u9332\u8AD6\u502D\u548C\u8A71\u6B6A\u8CC4\u8107\u60D1\u67A0\u9DF2\u4E99\u4E98\u9C10\u8A6B\u85C1\u8568\u6900\u6E7E\u7897\u8155"], + ["d0a1", "\u5F0C\u4E10\u4E15\u4E2A\u4E31\u4E36\u4E3C\u4E3F\u4E42\u4E56\u4E58\u4E82\u4E85\u8C6B\u4E8A\u8212\u5F0D\u4E8E\u4E9E\u4E9F\u4EA0\u4EA2\u4EB0\u4EB3\u4EB6\u4ECE\u4ECD\u4EC4\u4EC6\u4EC2\u4ED7\u4EDE\u4EED\u4EDF\u4EF7\u4F09\u4F5A\u4F30\u4F5B\u4F5D\u4F57\u4F47\u4F76\u4F88\u4F8F\u4F98\u4F7B\u4F69\u4F70\u4F91\u4F6F\u4F86\u4F96\u5118\u4FD4\u4FDF\u4FCE\u4FD8\u4FDB\u4FD1\u4FDA\u4FD0\u4FE4\u4FE5\u501A\u5028\u5014\u502A\u5025\u5005\u4F1C\u4FF6\u5021\u5029\u502C\u4FFE\u4FEF\u5011\u5006\u5043\u5047\u6703\u5055\u5050\u5048\u505A\u5056\u506C\u5078\u5080\u509A\u5085\u50B4\u50B2"], + ["d1a1", "\u50C9\u50CA\u50B3\u50C2\u50D6\u50DE\u50E5\u50ED\u50E3\u50EE\u50F9\u50F5\u5109\u5101\u5102\u5116\u5115\u5114\u511A\u5121\u513A\u5137\u513C\u513B\u513F\u5140\u5152\u514C\u5154\u5162\u7AF8\u5169\u516A\u516E\u5180\u5182\u56D8\u518C\u5189\u518F\u5191\u5193\u5195\u5196\u51A4\u51A6\u51A2\u51A9\u51AA\u51AB\u51B3\u51B1\u51B2\u51B0\u51B5\u51BD\u51C5\u51C9\u51DB\u51E0\u8655\u51E9\u51ED\u51F0\u51F5\u51FE\u5204\u520B\u5214\u520E\u5227\u522A\u522E\u5233\u5239\u524F\u5244\u524B\u524C\u525E\u5254\u526A\u5274\u5269\u5273\u527F\u527D\u528D\u5294\u5292\u5271\u5288\u5291\u8FA8"], + ["d2a1", "\u8FA7\u52AC\u52AD\u52BC\u52B5\u52C1\u52CD\u52D7\u52DE\u52E3\u52E6\u98ED\u52E0\u52F3\u52F5\u52F8\u52F9\u5306\u5308\u7538\u530D\u5310\u530F\u5315\u531A\u5323\u532F\u5331\u5333\u5338\u5340\u5346\u5345\u4E17\u5349\u534D\u51D6\u535E\u5369\u536E\u5918\u537B\u5377\u5382\u5396\u53A0\u53A6\u53A5\u53AE\u53B0\u53B6\u53C3\u7C12\u96D9\u53DF\u66FC\u71EE\u53EE\u53E8\u53ED\u53FA\u5401\u543D\u5440\u542C\u542D\u543C\u542E\u5436\u5429\u541D\u544E\u548F\u5475\u548E\u545F\u5471\u5477\u5470\u5492\u547B\u5480\u5476\u5484\u5490\u5486\u54C7\u54A2\u54B8\u54A5\u54AC\u54C4\u54C8\u54A8"], + ["d3a1", "\u54AB\u54C2\u54A4\u54BE\u54BC\u54D8\u54E5\u54E6\u550F\u5514\u54FD\u54EE\u54ED\u54FA\u54E2\u5539\u5540\u5563\u554C\u552E\u555C\u5545\u5556\u5557\u5538\u5533\u555D\u5599\u5580\u54AF\u558A\u559F\u557B\u557E\u5598\u559E\u55AE\u557C\u5583\u55A9\u5587\u55A8\u55DA\u55C5\u55DF\u55C4\u55DC\u55E4\u55D4\u5614\u55F7\u5616\u55FE\u55FD\u561B\u55F9\u564E\u5650\u71DF\u5634\u5636\u5632\u5638\u566B\u5664\u562F\u566C\u566A\u5686\u5680\u568A\u56A0\u5694\u568F\u56A5\u56AE\u56B6\u56B4\u56C2\u56BC\u56C1\u56C3\u56C0\u56C8\u56CE\u56D1\u56D3\u56D7\u56EE\u56F9\u5700\u56FF\u5704\u5709"], + ["d4a1", "\u5708\u570B\u570D\u5713\u5718\u5716\u55C7\u571C\u5726\u5737\u5738\u574E\u573B\u5740\u574F\u5769\u57C0\u5788\u5761\u577F\u5789\u5793\u57A0\u57B3\u57A4\u57AA\u57B0\u57C3\u57C6\u57D4\u57D2\u57D3\u580A\u57D6\u57E3\u580B\u5819\u581D\u5872\u5821\u5862\u584B\u5870\u6BC0\u5852\u583D\u5879\u5885\u58B9\u589F\u58AB\u58BA\u58DE\u58BB\u58B8\u58AE\u58C5\u58D3\u58D1\u58D7\u58D9\u58D8\u58E5\u58DC\u58E4\u58DF\u58EF\u58FA\u58F9\u58FB\u58FC\u58FD\u5902\u590A\u5910\u591B\u68A6\u5925\u592C\u592D\u5932\u5938\u593E\u7AD2\u5955\u5950\u594E\u595A\u5958\u5962\u5960\u5967\u596C\u5969"], + ["d5a1", "\u5978\u5981\u599D\u4F5E\u4FAB\u59A3\u59B2\u59C6\u59E8\u59DC\u598D\u59D9\u59DA\u5A25\u5A1F\u5A11\u5A1C\u5A09\u5A1A\u5A40\u5A6C\u5A49\u5A35\u5A36\u5A62\u5A6A\u5A9A\u5ABC\u5ABE\u5ACB\u5AC2\u5ABD\u5AE3\u5AD7\u5AE6\u5AE9\u5AD6\u5AFA\u5AFB\u5B0C\u5B0B\u5B16\u5B32\u5AD0\u5B2A\u5B36\u5B3E\u5B43\u5B45\u5B40\u5B51\u5B55\u5B5A\u5B5B\u5B65\u5B69\u5B70\u5B73\u5B75\u5B78\u6588\u5B7A\u5B80\u5B83\u5BA6\u5BB8\u5BC3\u5BC7\u5BC9\u5BD4\u5BD0\u5BE4\u5BE6\u5BE2\u5BDE\u5BE5\u5BEB\u5BF0\u5BF6\u5BF3\u5C05\u5C07\u5C08\u5C0D\u5C13\u5C20\u5C22\u5C28\u5C38\u5C39\u5C41\u5C46\u5C4E\u5C53"], + ["d6a1", "\u5C50\u5C4F\u5B71\u5C6C\u5C6E\u4E62\u5C76\u5C79\u5C8C\u5C91\u5C94\u599B\u5CAB\u5CBB\u5CB6\u5CBC\u5CB7\u5CC5\u5CBE\u5CC7\u5CD9\u5CE9\u5CFD\u5CFA\u5CED\u5D8C\u5CEA\u5D0B\u5D15\u5D17\u5D5C\u5D1F\u5D1B\u5D11\u5D14\u5D22\u5D1A\u5D19\u5D18\u5D4C\u5D52\u5D4E\u5D4B\u5D6C\u5D73\u5D76\u5D87\u5D84\u5D82\u5DA2\u5D9D\u5DAC\u5DAE\u5DBD\u5D90\u5DB7\u5DBC\u5DC9\u5DCD\u5DD3\u5DD2\u5DD6\u5DDB\u5DEB\u5DF2\u5DF5\u5E0B\u5E1A\u5E19\u5E11\u5E1B\u5E36\u5E37\u5E44\u5E43\u5E40\u5E4E\u5E57\u5E54\u5E5F\u5E62\u5E64\u5E47\u5E75\u5E76\u5E7A\u9EBC\u5E7F\u5EA0\u5EC1\u5EC2\u5EC8\u5ED0\u5ECF"], + ["d7a1", "\u5ED6\u5EE3\u5EDD\u5EDA\u5EDB\u5EE2\u5EE1\u5EE8\u5EE9\u5EEC\u5EF1\u5EF3\u5EF0\u5EF4\u5EF8\u5EFE\u5F03\u5F09\u5F5D\u5F5C\u5F0B\u5F11\u5F16\u5F29\u5F2D\u5F38\u5F41\u5F48\u5F4C\u5F4E\u5F2F\u5F51\u5F56\u5F57\u5F59\u5F61\u5F6D\u5F73\u5F77\u5F83\u5F82\u5F7F\u5F8A\u5F88\u5F91\u5F87\u5F9E\u5F99\u5F98\u5FA0\u5FA8\u5FAD\u5FBC\u5FD6\u5FFB\u5FE4\u5FF8\u5FF1\u5FDD\u60B3\u5FFF\u6021\u6060\u6019\u6010\u6029\u600E\u6031\u601B\u6015\u602B\u6026\u600F\u603A\u605A\u6041\u606A\u6077\u605F\u604A\u6046\u604D\u6063\u6043\u6064\u6042\u606C\u606B\u6059\u6081\u608D\u60E7\u6083\u609A"], + ["d8a1", "\u6084\u609B\u6096\u6097\u6092\u60A7\u608B\u60E1\u60B8\u60E0\u60D3\u60B4\u5FF0\u60BD\u60C6\u60B5\u60D8\u614D\u6115\u6106\u60F6\u60F7\u6100\u60F4\u60FA\u6103\u6121\u60FB\u60F1\u610D\u610E\u6147\u613E\u6128\u6127\u614A\u613F\u613C\u612C\u6134\u613D\u6142\u6144\u6173\u6177\u6158\u6159\u615A\u616B\u6174\u616F\u6165\u6171\u615F\u615D\u6153\u6175\u6199\u6196\u6187\u61AC\u6194\u619A\u618A\u6191\u61AB\u61AE\u61CC\u61CA\u61C9\u61F7\u61C8\u61C3\u61C6\u61BA\u61CB\u7F79\u61CD\u61E6\u61E3\u61F6\u61FA\u61F4\u61FF\u61FD\u61FC\u61FE\u6200\u6208\u6209\u620D\u620C\u6214\u621B"], + ["d9a1", "\u621E\u6221\u622A\u622E\u6230\u6232\u6233\u6241\u624E\u625E\u6263\u625B\u6260\u6268\u627C\u6282\u6289\u627E\u6292\u6293\u6296\u62D4\u6283\u6294\u62D7\u62D1\u62BB\u62CF\u62FF\u62C6\u64D4\u62C8\u62DC\u62CC\u62CA\u62C2\u62C7\u629B\u62C9\u630C\u62EE\u62F1\u6327\u6302\u6308\u62EF\u62F5\u6350\u633E\u634D\u641C\u634F\u6396\u638E\u6380\u63AB\u6376\u63A3\u638F\u6389\u639F\u63B5\u636B\u6369\u63BE\u63E9\u63C0\u63C6\u63E3\u63C9\u63D2\u63F6\u63C4\u6416\u6434\u6406\u6413\u6426\u6436\u651D\u6417\u6428\u640F\u6467\u646F\u6476\u644E\u652A\u6495\u6493\u64A5\u64A9\u6488\u64BC"], + ["daa1", "\u64DA\u64D2\u64C5\u64C7\u64BB\u64D8\u64C2\u64F1\u64E7\u8209\u64E0\u64E1\u62AC\u64E3\u64EF\u652C\u64F6\u64F4\u64F2\u64FA\u6500\u64FD\u6518\u651C\u6505\u6524\u6523\u652B\u6534\u6535\u6537\u6536\u6538\u754B\u6548\u6556\u6555\u654D\u6558\u655E\u655D\u6572\u6578\u6582\u6583\u8B8A\u659B\u659F\u65AB\u65B7\u65C3\u65C6\u65C1\u65C4\u65CC\u65D2\u65DB\u65D9\u65E0\u65E1\u65F1\u6772\u660A\u6603\u65FB\u6773\u6635\u6636\u6634\u661C\u664F\u6644\u6649\u6641\u665E\u665D\u6664\u6667\u6668\u665F\u6662\u6670\u6683\u6688\u668E\u6689\u6684\u6698\u669D\u66C1\u66B9\u66C9\u66BE\u66BC"], + ["dba1", "\u66C4\u66B8\u66D6\u66DA\u66E0\u663F\u66E6\u66E9\u66F0\u66F5\u66F7\u670F\u6716\u671E\u6726\u6727\u9738\u672E\u673F\u6736\u6741\u6738\u6737\u6746\u675E\u6760\u6759\u6763\u6764\u6789\u6770\u67A9\u677C\u676A\u678C\u678B\u67A6\u67A1\u6785\u67B7\u67EF\u67B4\u67EC\u67B3\u67E9\u67B8\u67E4\u67DE\u67DD\u67E2\u67EE\u67B9\u67CE\u67C6\u67E7\u6A9C\u681E\u6846\u6829\u6840\u684D\u6832\u684E\u68B3\u682B\u6859\u6863\u6877\u687F\u689F\u688F\u68AD\u6894\u689D\u689B\u6883\u6AAE\u68B9\u6874\u68B5\u68A0\u68BA\u690F\u688D\u687E\u6901\u68CA\u6908\u68D8\u6922\u6926\u68E1\u690C\u68CD"], + ["dca1", "\u68D4\u68E7\u68D5\u6936\u6912\u6904\u68D7\u68E3\u6925\u68F9\u68E0\u68EF\u6928\u692A\u691A\u6923\u6921\u68C6\u6979\u6977\u695C\u6978\u696B\u6954\u697E\u696E\u6939\u6974\u693D\u6959\u6930\u6961\u695E\u695D\u6981\u696A\u69B2\u69AE\u69D0\u69BF\u69C1\u69D3\u69BE\u69CE\u5BE8\u69CA\u69DD\u69BB\u69C3\u69A7\u6A2E\u6991\u69A0\u699C\u6995\u69B4\u69DE\u69E8\u6A02\u6A1B\u69FF\u6B0A\u69F9\u69F2\u69E7\u6A05\u69B1\u6A1E\u69ED\u6A14\u69EB\u6A0A\u6A12\u6AC1\u6A23\u6A13\u6A44\u6A0C\u6A72\u6A36\u6A78\u6A47\u6A62\u6A59\u6A66\u6A48\u6A38\u6A22\u6A90\u6A8D\u6AA0\u6A84\u6AA2\u6AA3"], + ["dda1", "\u6A97\u8617\u6ABB\u6AC3\u6AC2\u6AB8\u6AB3\u6AAC\u6ADE\u6AD1\u6ADF\u6AAA\u6ADA\u6AEA\u6AFB\u6B05\u8616\u6AFA\u6B12\u6B16\u9B31\u6B1F\u6B38\u6B37\u76DC\u6B39\u98EE\u6B47\u6B43\u6B49\u6B50\u6B59\u6B54\u6B5B\u6B5F\u6B61\u6B78\u6B79\u6B7F\u6B80\u6B84\u6B83\u6B8D\u6B98\u6B95\u6B9E\u6BA4\u6BAA\u6BAB\u6BAF\u6BB2\u6BB1\u6BB3\u6BB7\u6BBC\u6BC6\u6BCB\u6BD3\u6BDF\u6BEC\u6BEB\u6BF3\u6BEF\u9EBE\u6C08\u6C13\u6C14\u6C1B\u6C24\u6C23\u6C5E\u6C55\u6C62\u6C6A\u6C82\u6C8D\u6C9A\u6C81\u6C9B\u6C7E\u6C68\u6C73\u6C92\u6C90\u6CC4\u6CF1\u6CD3\u6CBD\u6CD7\u6CC5\u6CDD\u6CAE\u6CB1\u6CBE"], + ["dea1", "\u6CBA\u6CDB\u6CEF\u6CD9\u6CEA\u6D1F\u884D\u6D36\u6D2B\u6D3D\u6D38\u6D19\u6D35\u6D33\u6D12\u6D0C\u6D63\u6D93\u6D64\u6D5A\u6D79\u6D59\u6D8E\u6D95\u6FE4\u6D85\u6DF9\u6E15\u6E0A\u6DB5\u6DC7\u6DE6\u6DB8\u6DC6\u6DEC\u6DDE\u6DCC\u6DE8\u6DD2\u6DC5\u6DFA\u6DD9\u6DE4\u6DD5\u6DEA\u6DEE\u6E2D\u6E6E\u6E2E\u6E19\u6E72\u6E5F\u6E3E\u6E23\u6E6B\u6E2B\u6E76\u6E4D\u6E1F\u6E43\u6E3A\u6E4E\u6E24\u6EFF\u6E1D\u6E38\u6E82\u6EAA\u6E98\u6EC9\u6EB7\u6ED3\u6EBD\u6EAF\u6EC4\u6EB2\u6ED4\u6ED5\u6E8F\u6EA5\u6EC2\u6E9F\u6F41\u6F11\u704C\u6EEC\u6EF8\u6EFE\u6F3F\u6EF2\u6F31\u6EEF\u6F32\u6ECC"], + ["dfa1", "\u6F3E\u6F13\u6EF7\u6F86\u6F7A\u6F78\u6F81\u6F80\u6F6F\u6F5B\u6FF3\u6F6D\u6F82\u6F7C\u6F58\u6F8E\u6F91\u6FC2\u6F66\u6FB3\u6FA3\u6FA1\u6FA4\u6FB9\u6FC6\u6FAA\u6FDF\u6FD5\u6FEC\u6FD4\u6FD8\u6FF1\u6FEE\u6FDB\u7009\u700B\u6FFA\u7011\u7001\u700F\u6FFE\u701B\u701A\u6F74\u701D\u7018\u701F\u7030\u703E\u7032\u7051\u7063\u7099\u7092\u70AF\u70F1\u70AC\u70B8\u70B3\u70AE\u70DF\u70CB\u70DD\u70D9\u7109\u70FD\u711C\u7119\u7165\u7155\u7188\u7166\u7162\u714C\u7156\u716C\u718F\u71FB\u7184\u7195\u71A8\u71AC\u71D7\u71B9\u71BE\u71D2\u71C9\u71D4\u71CE\u71E0\u71EC\u71E7\u71F5\u71FC"], + ["e0a1", "\u71F9\u71FF\u720D\u7210\u721B\u7228\u722D\u722C\u7230\u7232\u723B\u723C\u723F\u7240\u7246\u724B\u7258\u7274\u727E\u7282\u7281\u7287\u7292\u7296\u72A2\u72A7\u72B9\u72B2\u72C3\u72C6\u72C4\u72CE\u72D2\u72E2\u72E0\u72E1\u72F9\u72F7\u500F\u7317\u730A\u731C\u7316\u731D\u7334\u732F\u7329\u7325\u733E\u734E\u734F\u9ED8\u7357\u736A\u7368\u7370\u7378\u7375\u737B\u737A\u73C8\u73B3\u73CE\u73BB\u73C0\u73E5\u73EE\u73DE\u74A2\u7405\u746F\u7425\u73F8\u7432\u743A\u7455\u743F\u745F\u7459\u7441\u745C\u7469\u7470\u7463\u746A\u7476\u747E\u748B\u749E\u74A7\u74CA\u74CF\u74D4\u73F1"], + ["e1a1", "\u74E0\u74E3\u74E7\u74E9\u74EE\u74F2\u74F0\u74F1\u74F8\u74F7\u7504\u7503\u7505\u750C\u750E\u750D\u7515\u7513\u751E\u7526\u752C\u753C\u7544\u754D\u754A\u7549\u755B\u7546\u755A\u7569\u7564\u7567\u756B\u756D\u7578\u7576\u7586\u7587\u7574\u758A\u7589\u7582\u7594\u759A\u759D\u75A5\u75A3\u75C2\u75B3\u75C3\u75B5\u75BD\u75B8\u75BC\u75B1\u75CD\u75CA\u75D2\u75D9\u75E3\u75DE\u75FE\u75FF\u75FC\u7601\u75F0\u75FA\u75F2\u75F3\u760B\u760D\u7609\u761F\u7627\u7620\u7621\u7622\u7624\u7634\u7630\u763B\u7647\u7648\u7646\u765C\u7658\u7661\u7662\u7668\u7669\u766A\u7667\u766C\u7670"], + ["e2a1", "\u7672\u7676\u7678\u767C\u7680\u7683\u7688\u768B\u768E\u7696\u7693\u7699\u769A\u76B0\u76B4\u76B8\u76B9\u76BA\u76C2\u76CD\u76D6\u76D2\u76DE\u76E1\u76E5\u76E7\u76EA\u862F\u76FB\u7708\u7707\u7704\u7729\u7724\u771E\u7725\u7726\u771B\u7737\u7738\u7747\u775A\u7768\u776B\u775B\u7765\u777F\u777E\u7779\u778E\u778B\u7791\u77A0\u779E\u77B0\u77B6\u77B9\u77BF\u77BC\u77BD\u77BB\u77C7\u77CD\u77D7\u77DA\u77DC\u77E3\u77EE\u77FC\u780C\u7812\u7926\u7820\u792A\u7845\u788E\u7874\u7886\u787C\u789A\u788C\u78A3\u78B5\u78AA\u78AF\u78D1\u78C6\u78CB\u78D4\u78BE\u78BC\u78C5\u78CA\u78EC"], + ["e3a1", "\u78E7\u78DA\u78FD\u78F4\u7907\u7912\u7911\u7919\u792C\u792B\u7940\u7960\u7957\u795F\u795A\u7955\u7953\u797A\u797F\u798A\u799D\u79A7\u9F4B\u79AA\u79AE\u79B3\u79B9\u79BA\u79C9\u79D5\u79E7\u79EC\u79E1\u79E3\u7A08\u7A0D\u7A18\u7A19\u7A20\u7A1F\u7980\u7A31\u7A3B\u7A3E\u7A37\u7A43\u7A57\u7A49\u7A61\u7A62\u7A69\u9F9D\u7A70\u7A79\u7A7D\u7A88\u7A97\u7A95\u7A98\u7A96\u7AA9\u7AC8\u7AB0\u7AB6\u7AC5\u7AC4\u7ABF\u9083\u7AC7\u7ACA\u7ACD\u7ACF\u7AD5\u7AD3\u7AD9\u7ADA\u7ADD\u7AE1\u7AE2\u7AE6\u7AED\u7AF0\u7B02\u7B0F\u7B0A\u7B06\u7B33\u7B18\u7B19\u7B1E\u7B35\u7B28\u7B36\u7B50"], + ["e4a1", "\u7B7A\u7B04\u7B4D\u7B0B\u7B4C\u7B45\u7B75\u7B65\u7B74\u7B67\u7B70\u7B71\u7B6C\u7B6E\u7B9D\u7B98\u7B9F\u7B8D\u7B9C\u7B9A\u7B8B\u7B92\u7B8F\u7B5D\u7B99\u7BCB\u7BC1\u7BCC\u7BCF\u7BB4\u7BC6\u7BDD\u7BE9\u7C11\u7C14\u7BE6\u7BE5\u7C60\u7C00\u7C07\u7C13\u7BF3\u7BF7\u7C17\u7C0D\u7BF6\u7C23\u7C27\u7C2A\u7C1F\u7C37\u7C2B\u7C3D\u7C4C\u7C43\u7C54\u7C4F\u7C40\u7C50\u7C58\u7C5F\u7C64\u7C56\u7C65\u7C6C\u7C75\u7C83\u7C90\u7CA4\u7CAD\u7CA2\u7CAB\u7CA1\u7CA8\u7CB3\u7CB2\u7CB1\u7CAE\u7CB9\u7CBD\u7CC0\u7CC5\u7CC2\u7CD8\u7CD2\u7CDC\u7CE2\u9B3B\u7CEF\u7CF2\u7CF4\u7CF6\u7CFA\u7D06"], + ["e5a1", "\u7D02\u7D1C\u7D15\u7D0A\u7D45\u7D4B\u7D2E\u7D32\u7D3F\u7D35\u7D46\u7D73\u7D56\u7D4E\u7D72\u7D68\u7D6E\u7D4F\u7D63\u7D93\u7D89\u7D5B\u7D8F\u7D7D\u7D9B\u7DBA\u7DAE\u7DA3\u7DB5\u7DC7\u7DBD\u7DAB\u7E3D\u7DA2\u7DAF\u7DDC\u7DB8\u7D9F\u7DB0\u7DD8\u7DDD\u7DE4\u7DDE\u7DFB\u7DF2\u7DE1\u7E05\u7E0A\u7E23\u7E21\u7E12\u7E31\u7E1F\u7E09\u7E0B\u7E22\u7E46\u7E66\u7E3B\u7E35\u7E39\u7E43\u7E37\u7E32\u7E3A\u7E67\u7E5D\u7E56\u7E5E\u7E59\u7E5A\u7E79\u7E6A\u7E69\u7E7C\u7E7B\u7E83\u7DD5\u7E7D\u8FAE\u7E7F\u7E88\u7E89\u7E8C\u7E92\u7E90\u7E93\u7E94\u7E96\u7E8E\u7E9B\u7E9C\u7F38\u7F3A"], + ["e6a1", "\u7F45\u7F4C\u7F4D\u7F4E\u7F50\u7F51\u7F55\u7F54\u7F58\u7F5F\u7F60\u7F68\u7F69\u7F67\u7F78\u7F82\u7F86\u7F83\u7F88\u7F87\u7F8C\u7F94\u7F9E\u7F9D\u7F9A\u7FA3\u7FAF\u7FB2\u7FB9\u7FAE\u7FB6\u7FB8\u8B71\u7FC5\u7FC6\u7FCA\u7FD5\u7FD4\u7FE1\u7FE6\u7FE9\u7FF3\u7FF9\u98DC\u8006\u8004\u800B\u8012\u8018\u8019\u801C\u8021\u8028\u803F\u803B\u804A\u8046\u8052\u8058\u805A\u805F\u8062\u8068\u8073\u8072\u8070\u8076\u8079\u807D\u807F\u8084\u8086\u8085\u809B\u8093\u809A\u80AD\u5190\u80AC\u80DB\u80E5\u80D9\u80DD\u80C4\u80DA\u80D6\u8109\u80EF\u80F1\u811B\u8129\u8123\u812F\u814B"], + ["e7a1", "\u968B\u8146\u813E\u8153\u8151\u80FC\u8171\u816E\u8165\u8166\u8174\u8183\u8188\u818A\u8180\u8182\u81A0\u8195\u81A4\u81A3\u815F\u8193\u81A9\u81B0\u81B5\u81BE\u81B8\u81BD\u81C0\u81C2\u81BA\u81C9\u81CD\u81D1\u81D9\u81D8\u81C8\u81DA\u81DF\u81E0\u81E7\u81FA\u81FB\u81FE\u8201\u8202\u8205\u8207\u820A\u820D\u8210\u8216\u8229\u822B\u8238\u8233\u8240\u8259\u8258\u825D\u825A\u825F\u8264\u8262\u8268\u826A\u826B\u822E\u8271\u8277\u8278\u827E\u828D\u8292\u82AB\u829F\u82BB\u82AC\u82E1\u82E3\u82DF\u82D2\u82F4\u82F3\u82FA\u8393\u8303\u82FB\u82F9\u82DE\u8306\u82DC\u8309\u82D9"], + ["e8a1", "\u8335\u8334\u8316\u8332\u8331\u8340\u8339\u8350\u8345\u832F\u832B\u8317\u8318\u8385\u839A\u83AA\u839F\u83A2\u8396\u8323\u838E\u8387\u838A\u837C\u83B5\u8373\u8375\u83A0\u8389\u83A8\u83F4\u8413\u83EB\u83CE\u83FD\u8403\u83D8\u840B\u83C1\u83F7\u8407\u83E0\u83F2\u840D\u8422\u8420\u83BD\u8438\u8506\u83FB\u846D\u842A\u843C\u855A\u8484\u8477\u846B\u84AD\u846E\u8482\u8469\u8446\u842C\u846F\u8479\u8435\u84CA\u8462\u84B9\u84BF\u849F\u84D9\u84CD\u84BB\u84DA\u84D0\u84C1\u84C6\u84D6\u84A1\u8521\u84FF\u84F4\u8517\u8518\u852C\u851F\u8515\u8514\u84FC\u8540\u8563\u8558\u8548"], + ["e9a1", "\u8541\u8602\u854B\u8555\u8580\u85A4\u8588\u8591\u858A\u85A8\u856D\u8594\u859B\u85EA\u8587\u859C\u8577\u857E\u8590\u85C9\u85BA\u85CF\u85B9\u85D0\u85D5\u85DD\u85E5\u85DC\u85F9\u860A\u8613\u860B\u85FE\u85FA\u8606\u8622\u861A\u8630\u863F\u864D\u4E55\u8654\u865F\u8667\u8671\u8693\u86A3\u86A9\u86AA\u868B\u868C\u86B6\u86AF\u86C4\u86C6\u86B0\u86C9\u8823\u86AB\u86D4\u86DE\u86E9\u86EC\u86DF\u86DB\u86EF\u8712\u8706\u8708\u8700\u8703\u86FB\u8711\u8709\u870D\u86F9\u870A\u8734\u873F\u8737\u873B\u8725\u8729\u871A\u8760\u875F\u8778\u874C\u874E\u8774\u8757\u8768\u876E\u8759"], + ["eaa1", "\u8753\u8763\u876A\u8805\u87A2\u879F\u8782\u87AF\u87CB\u87BD\u87C0\u87D0\u96D6\u87AB\u87C4\u87B3\u87C7\u87C6\u87BB\u87EF\u87F2\u87E0\u880F\u880D\u87FE\u87F6\u87F7\u880E\u87D2\u8811\u8816\u8815\u8822\u8821\u8831\u8836\u8839\u8827\u883B\u8844\u8842\u8852\u8859\u885E\u8862\u886B\u8881\u887E\u889E\u8875\u887D\u88B5\u8872\u8882\u8897\u8892\u88AE\u8899\u88A2\u888D\u88A4\u88B0\u88BF\u88B1\u88C3\u88C4\u88D4\u88D8\u88D9\u88DD\u88F9\u8902\u88FC\u88F4\u88E8\u88F2\u8904\u890C\u890A\u8913\u8943\u891E\u8925\u892A\u892B\u8941\u8944\u893B\u8936\u8938\u894C\u891D\u8960\u895E"], + ["eba1", "\u8966\u8964\u896D\u896A\u896F\u8974\u8977\u897E\u8983\u8988\u898A\u8993\u8998\u89A1\u89A9\u89A6\u89AC\u89AF\u89B2\u89BA\u89BD\u89BF\u89C0\u89DA\u89DC\u89DD\u89E7\u89F4\u89F8\u8A03\u8A16\u8A10\u8A0C\u8A1B\u8A1D\u8A25\u8A36\u8A41\u8A5B\u8A52\u8A46\u8A48\u8A7C\u8A6D\u8A6C\u8A62\u8A85\u8A82\u8A84\u8AA8\u8AA1\u8A91\u8AA5\u8AA6\u8A9A\u8AA3\u8AC4\u8ACD\u8AC2\u8ADA\u8AEB\u8AF3\u8AE7\u8AE4\u8AF1\u8B14\u8AE0\u8AE2\u8AF7\u8ADE\u8ADB\u8B0C\u8B07\u8B1A\u8AE1\u8B16\u8B10\u8B17\u8B20\u8B33\u97AB\u8B26\u8B2B\u8B3E\u8B28\u8B41\u8B4C\u8B4F\u8B4E\u8B49\u8B56\u8B5B\u8B5A\u8B6B"], + ["eca1", "\u8B5F\u8B6C\u8B6F\u8B74\u8B7D\u8B80\u8B8C\u8B8E\u8B92\u8B93\u8B96\u8B99\u8B9A\u8C3A\u8C41\u8C3F\u8C48\u8C4C\u8C4E\u8C50\u8C55\u8C62\u8C6C\u8C78\u8C7A\u8C82\u8C89\u8C85\u8C8A\u8C8D\u8C8E\u8C94\u8C7C\u8C98\u621D\u8CAD\u8CAA\u8CBD\u8CB2\u8CB3\u8CAE\u8CB6\u8CC8\u8CC1\u8CE4\u8CE3\u8CDA\u8CFD\u8CFA\u8CFB\u8D04\u8D05\u8D0A\u8D07\u8D0F\u8D0D\u8D10\u9F4E\u8D13\u8CCD\u8D14\u8D16\u8D67\u8D6D\u8D71\u8D73\u8D81\u8D99\u8DC2\u8DBE\u8DBA\u8DCF\u8DDA\u8DD6\u8DCC\u8DDB\u8DCB\u8DEA\u8DEB\u8DDF\u8DE3\u8DFC\u8E08\u8E09\u8DFF\u8E1D\u8E1E\u8E10\u8E1F\u8E42\u8E35\u8E30\u8E34\u8E4A"], + ["eda1", "\u8E47\u8E49\u8E4C\u8E50\u8E48\u8E59\u8E64\u8E60\u8E2A\u8E63\u8E55\u8E76\u8E72\u8E7C\u8E81\u8E87\u8E85\u8E84\u8E8B\u8E8A\u8E93\u8E91\u8E94\u8E99\u8EAA\u8EA1\u8EAC\u8EB0\u8EC6\u8EB1\u8EBE\u8EC5\u8EC8\u8ECB\u8EDB\u8EE3\u8EFC\u8EFB\u8EEB\u8EFE\u8F0A\u8F05\u8F15\u8F12\u8F19\u8F13\u8F1C\u8F1F\u8F1B\u8F0C\u8F26\u8F33\u8F3B\u8F39\u8F45\u8F42\u8F3E\u8F4C\u8F49\u8F46\u8F4E\u8F57\u8F5C\u8F62\u8F63\u8F64\u8F9C\u8F9F\u8FA3\u8FAD\u8FAF\u8FB7\u8FDA\u8FE5\u8FE2\u8FEA\u8FEF\u9087\u8FF4\u9005\u8FF9\u8FFA\u9011\u9015\u9021\u900D\u901E\u9016\u900B\u9027\u9036\u9035\u9039\u8FF8"], + ["eea1", "\u904F\u9050\u9051\u9052\u900E\u9049\u903E\u9056\u9058\u905E\u9068\u906F\u9076\u96A8\u9072\u9082\u907D\u9081\u9080\u908A\u9089\u908F\u90A8\u90AF\u90B1\u90B5\u90E2\u90E4\u6248\u90DB\u9102\u9112\u9119\u9132\u9130\u914A\u9156\u9158\u9163\u9165\u9169\u9173\u9172\u918B\u9189\u9182\u91A2\u91AB\u91AF\u91AA\u91B5\u91B4\u91BA\u91C0\u91C1\u91C9\u91CB\u91D0\u91D6\u91DF\u91E1\u91DB\u91FC\u91F5\u91F6\u921E\u91FF\u9214\u922C\u9215\u9211\u925E\u9257\u9245\u9249\u9264\u9248\u9295\u923F\u924B\u9250\u929C\u9296\u9293\u929B\u925A\u92CF\u92B9\u92B7\u92E9\u930F\u92FA\u9344\u932E"], + ["efa1", "\u9319\u9322\u931A\u9323\u933A\u9335\u933B\u935C\u9360\u937C\u936E\u9356\u93B0\u93AC\u93AD\u9394\u93B9\u93D6\u93D7\u93E8\u93E5\u93D8\u93C3\u93DD\u93D0\u93C8\u93E4\u941A\u9414\u9413\u9403\u9407\u9410\u9436\u942B\u9435\u9421\u943A\u9441\u9452\u9444\u945B\u9460\u9462\u945E\u946A\u9229\u9470\u9475\u9477\u947D\u945A\u947C\u947E\u9481\u947F\u9582\u9587\u958A\u9594\u9596\u9598\u9599\u95A0\u95A8\u95A7\u95AD\u95BC\u95BB\u95B9\u95BE\u95CA\u6FF6\u95C3\u95CD\u95CC\u95D5\u95D4\u95D6\u95DC\u95E1\u95E5\u95E2\u9621\u9628\u962E\u962F\u9642\u964C\u964F\u964B\u9677\u965C\u965E"], + ["f0a1", "\u965D\u965F\u9666\u9672\u966C\u968D\u9698\u9695\u9697\u96AA\u96A7\u96B1\u96B2\u96B0\u96B4\u96B6\u96B8\u96B9\u96CE\u96CB\u96C9\u96CD\u894D\u96DC\u970D\u96D5\u96F9\u9704\u9706\u9708\u9713\u970E\u9711\u970F\u9716\u9719\u9724\u972A\u9730\u9739\u973D\u973E\u9744\u9746\u9748\u9742\u9749\u975C\u9760\u9764\u9766\u9768\u52D2\u976B\u9771\u9779\u9785\u977C\u9781\u977A\u9786\u978B\u978F\u9790\u979C\u97A8\u97A6\u97A3\u97B3\u97B4\u97C3\u97C6\u97C8\u97CB\u97DC\u97ED\u9F4F\u97F2\u7ADF\u97F6\u97F5\u980F\u980C\u9838\u9824\u9821\u9837\u983D\u9846\u984F\u984B\u986B\u986F\u9870"], + ["f1a1", "\u9871\u9874\u9873\u98AA\u98AF\u98B1\u98B6\u98C4\u98C3\u98C6\u98E9\u98EB\u9903\u9909\u9912\u9914\u9918\u9921\u991D\u991E\u9924\u9920\u992C\u992E\u993D\u993E\u9942\u9949\u9945\u9950\u994B\u9951\u9952\u994C\u9955\u9997\u9998\u99A5\u99AD\u99AE\u99BC\u99DF\u99DB\u99DD\u99D8\u99D1\u99ED\u99EE\u99F1\u99F2\u99FB\u99F8\u9A01\u9A0F\u9A05\u99E2\u9A19\u9A2B\u9A37\u9A45\u9A42\u9A40\u9A43\u9A3E\u9A55\u9A4D\u9A5B\u9A57\u9A5F\u9A62\u9A65\u9A64\u9A69\u9A6B\u9A6A\u9AAD\u9AB0\u9ABC\u9AC0\u9ACF\u9AD1\u9AD3\u9AD4\u9ADE\u9ADF\u9AE2\u9AE3\u9AE6\u9AEF\u9AEB\u9AEE\u9AF4\u9AF1\u9AF7"], + ["f2a1", "\u9AFB\u9B06\u9B18\u9B1A\u9B1F\u9B22\u9B23\u9B25\u9B27\u9B28\u9B29\u9B2A\u9B2E\u9B2F\u9B32\u9B44\u9B43\u9B4F\u9B4D\u9B4E\u9B51\u9B58\u9B74\u9B93\u9B83\u9B91\u9B96\u9B97\u9B9F\u9BA0\u9BA8\u9BB4\u9BC0\u9BCA\u9BB9\u9BC6\u9BCF\u9BD1\u9BD2\u9BE3\u9BE2\u9BE4\u9BD4\u9BE1\u9C3A\u9BF2\u9BF1\u9BF0\u9C15\u9C14\u9C09\u9C13\u9C0C\u9C06\u9C08\u9C12\u9C0A\u9C04\u9C2E\u9C1B\u9C25\u9C24\u9C21\u9C30\u9C47\u9C32\u9C46\u9C3E\u9C5A\u9C60\u9C67\u9C76\u9C78\u9CE7\u9CEC\u9CF0\u9D09\u9D08\u9CEB\u9D03\u9D06\u9D2A\u9D26\u9DAF\u9D23\u9D1F\u9D44\u9D15\u9D12\u9D41\u9D3F\u9D3E\u9D46\u9D48"], + ["f3a1", "\u9D5D\u9D5E\u9D64\u9D51\u9D50\u9D59\u9D72\u9D89\u9D87\u9DAB\u9D6F\u9D7A\u9D9A\u9DA4\u9DA9\u9DB2\u9DC4\u9DC1\u9DBB\u9DB8\u9DBA\u9DC6\u9DCF\u9DC2\u9DD9\u9DD3\u9DF8\u9DE6\u9DED\u9DEF\u9DFD\u9E1A\u9E1B\u9E1E\u9E75\u9E79\u9E7D\u9E81\u9E88\u9E8B\u9E8C\u9E92\u9E95\u9E91\u9E9D\u9EA5\u9EA9\u9EB8\u9EAA\u9EAD\u9761\u9ECC\u9ECE\u9ECF\u9ED0\u9ED4\u9EDC\u9EDE\u9EDD\u9EE0\u9EE5\u9EE8\u9EEF\u9EF4\u9EF6\u9EF7\u9EF9\u9EFB\u9EFC\u9EFD\u9F07\u9F08\u76B7\u9F15\u9F21\u9F2C\u9F3E\u9F4A\u9F52\u9F54\u9F63\u9F5F\u9F60\u9F61\u9F66\u9F67\u9F6C\u9F6A\u9F77\u9F72\u9F76\u9F95\u9F9C\u9FA0"], + ["f4a1", "\u582F\u69C7\u9059\u7464\u51DC\u7199"], + ["f9a1", "\u7E8A\u891C\u9348\u9288\u84DC\u4FC9\u70BB\u6631\u68C8\u92F9\u66FB\u5F45\u4E28\u4EE1\u4EFC\u4F00\u4F03\u4F39\u4F56\u4F92\u4F8A\u4F9A\u4F94\u4FCD\u5040\u5022\u4FFF\u501E\u5046\u5070\u5042\u5094\u50F4\u50D8\u514A\u5164\u519D\u51BE\u51EC\u5215\u529C\u52A6\u52C0\u52DB\u5300\u5307\u5324\u5372\u5393\u53B2\u53DD\uFA0E\u549C\u548A\u54A9\u54FF\u5586\u5759\u5765\u57AC\u57C8\u57C7\uFA0F\uFA10\u589E\u58B2\u590B\u5953\u595B\u595D\u5963\u59A4\u59BA\u5B56\u5BC0\u752F\u5BD8\u5BEC\u5C1E\u5CA6\u5CBA\u5CF5\u5D27\u5D53\uFA11\u5D42\u5D6D\u5DB8\u5DB9\u5DD0\u5F21\u5F34\u5F67\u5FB7"], + ["faa1", "\u5FDE\u605D\u6085\u608A\u60DE\u60D5\u6120\u60F2\u6111\u6137\u6130\u6198\u6213\u62A6\u63F5\u6460\u649D\u64CE\u654E\u6600\u6615\u663B\u6609\u662E\u661E\u6624\u6665\u6657\u6659\uFA12\u6673\u6699\u66A0\u66B2\u66BF\u66FA\u670E\uF929\u6766\u67BB\u6852\u67C0\u6801\u6844\u68CF\uFA13\u6968\uFA14\u6998\u69E2\u6A30\u6A6B\u6A46\u6A73\u6A7E\u6AE2\u6AE4\u6BD6\u6C3F\u6C5C\u6C86\u6C6F\u6CDA\u6D04\u6D87\u6D6F\u6D96\u6DAC\u6DCF\u6DF8\u6DF2\u6DFC\u6E39\u6E5C\u6E27\u6E3C\u6EBF\u6F88\u6FB5\u6FF5\u7005\u7007\u7028\u7085\u70AB\u710F\u7104\u715C\u7146\u7147\uFA15\u71C1\u71FE\u72B1"], + ["fba1", "\u72BE\u7324\uFA16\u7377\u73BD\u73C9\u73D6\u73E3\u73D2\u7407\u73F5\u7426\u742A\u7429\u742E\u7462\u7489\u749F\u7501\u756F\u7682\u769C\u769E\u769B\u76A6\uFA17\u7746\u52AF\u7821\u784E\u7864\u787A\u7930\uFA18\uFA19\uFA1A\u7994\uFA1B\u799B\u7AD1\u7AE7\uFA1C\u7AEB\u7B9E\uFA1D\u7D48\u7D5C\u7DB7\u7DA0\u7DD6\u7E52\u7F47\u7FA1\uFA1E\u8301\u8362\u837F\u83C7\u83F6\u8448\u84B4\u8553\u8559\u856B\uFA1F\u85B0\uFA20\uFA21\u8807\u88F5\u8A12\u8A37\u8A79\u8AA7\u8ABE\u8ADF\uFA22\u8AF6\u8B53\u8B7F\u8CF0\u8CF4\u8D12\u8D76\uFA23\u8ECF\uFA24\uFA25\u9067\u90DE\uFA26\u9115\u9127\u91DA"], + ["fca1", "\u91D7\u91DE\u91ED\u91EE\u91E4\u91E5\u9206\u9210\u920A\u923A\u9240\u923C\u924E\u9259\u9251\u9239\u9267\u92A7\u9277\u9278\u92E7\u92D7\u92D9\u92D0\uFA27\u92D5\u92E0\u92D3\u9325\u9321\u92FB\uFA28\u931E\u92FF\u931D\u9302\u9370\u9357\u93A4\u93C6\u93DE\u93F8\u9431\u9445\u9448\u9592\uF9DC\uFA29\u969D\u96AF\u9733\u973B\u9743\u974D\u974F\u9751\u9755\u9857\u9865\uFA2A\uFA2B\u9927\uFA2C\u999E\u9A4E\u9AD9\u9ADC\u9B75\u9B72\u9B8F\u9BB1\u9BBB\u9C00\u9D70\u9D6B\uFA2D\u9E19\u9ED1"], + ["fcf1", "\u2170", 9, "\uFFE2\uFFE4\uFF07\uFF02"], + ["8fa2af", "\u02D8\u02C7\xB8\u02D9\u02DD\xAF\u02DB\u02DA\uFF5E\u0384\u0385"], + ["8fa2c2", "\xA1\xA6\xBF"], + ["8fa2eb", "\xBA\xAA\xA9\xAE\u2122\xA4\u2116"], + ["8fa6e1", "\u0386\u0388\u0389\u038A\u03AA"], + ["8fa6e7", "\u038C"], + ["8fa6e9", "\u038E\u03AB"], + ["8fa6ec", "\u038F"], + ["8fa6f1", "\u03AC\u03AD\u03AE\u03AF\u03CA\u0390\u03CC\u03C2\u03CD\u03CB\u03B0\u03CE"], + ["8fa7c2", "\u0402", 10, "\u040E\u040F"], + ["8fa7f2", "\u0452", 10, "\u045E\u045F"], + ["8fa9a1", "\xC6\u0110"], + ["8fa9a4", "\u0126"], + ["8fa9a6", "\u0132"], + ["8fa9a8", "\u0141\u013F"], + ["8fa9ab", "\u014A\xD8\u0152"], + ["8fa9af", "\u0166\xDE"], + ["8fa9c1", "\xE6\u0111\xF0\u0127\u0131\u0133\u0138\u0142\u0140\u0149\u014B\xF8\u0153\xDF\u0167\xFE"], + ["8faaa1", "\xC1\xC0\xC4\xC2\u0102\u01CD\u0100\u0104\xC5\xC3\u0106\u0108\u010C\xC7\u010A\u010E\xC9\xC8\xCB\xCA\u011A\u0116\u0112\u0118"], + ["8faaba", "\u011C\u011E\u0122\u0120\u0124\xCD\xCC\xCF\xCE\u01CF\u0130\u012A\u012E\u0128\u0134\u0136\u0139\u013D\u013B\u0143\u0147\u0145\xD1\xD3\xD2\xD6\xD4\u01D1\u0150\u014C\xD5\u0154\u0158\u0156\u015A\u015C\u0160\u015E\u0164\u0162\xDA\xD9\xDC\xDB\u016C\u01D3\u0170\u016A\u0172\u016E\u0168\u01D7\u01DB\u01D9\u01D5\u0174\xDD\u0178\u0176\u0179\u017D\u017B"], + ["8faba1", "\xE1\xE0\xE4\xE2\u0103\u01CE\u0101\u0105\xE5\xE3\u0107\u0109\u010D\xE7\u010B\u010F\xE9\xE8\xEB\xEA\u011B\u0117\u0113\u0119\u01F5\u011D\u011F"], + ["8fabbd", "\u0121\u0125\xED\xEC\xEF\xEE\u01D0"], + ["8fabc5", "\u012B\u012F\u0129\u0135\u0137\u013A\u013E\u013C\u0144\u0148\u0146\xF1\xF3\xF2\xF6\xF4\u01D2\u0151\u014D\xF5\u0155\u0159\u0157\u015B\u015D\u0161\u015F\u0165\u0163\xFA\xF9\xFC\xFB\u016D\u01D4\u0171\u016B\u0173\u016F\u0169\u01D8\u01DC\u01DA\u01D6\u0175\xFD\xFF\u0177\u017A\u017E\u017C"], + ["8fb0a1", "\u4E02\u4E04\u4E05\u4E0C\u4E12\u4E1F\u4E23\u4E24\u4E28\u4E2B\u4E2E\u4E2F\u4E30\u4E35\u4E40\u4E41\u4E44\u4E47\u4E51\u4E5A\u4E5C\u4E63\u4E68\u4E69\u4E74\u4E75\u4E79\u4E7F\u4E8D\u4E96\u4E97\u4E9D\u4EAF\u4EB9\u4EC3\u4ED0\u4EDA\u4EDB\u4EE0\u4EE1\u4EE2\u4EE8\u4EEF\u4EF1\u4EF3\u4EF5\u4EFD\u4EFE\u4EFF\u4F00\u4F02\u4F03\u4F08\u4F0B\u4F0C\u4F12\u4F15\u4F16\u4F17\u4F19\u4F2E\u4F31\u4F60\u4F33\u4F35\u4F37\u4F39\u4F3B\u4F3E\u4F40\u4F42\u4F48\u4F49\u4F4B\u4F4C\u4F52\u4F54\u4F56\u4F58\u4F5F\u4F63\u4F6A\u4F6C\u4F6E\u4F71\u4F77\u4F78\u4F79\u4F7A\u4F7D\u4F7E\u4F81\u4F82\u4F84"], + ["8fb1a1", "\u4F85\u4F89\u4F8A\u4F8C\u4F8E\u4F90\u4F92\u4F93\u4F94\u4F97\u4F99\u4F9A\u4F9E\u4F9F\u4FB2\u4FB7\u4FB9\u4FBB\u4FBC\u4FBD\u4FBE\u4FC0\u4FC1\u4FC5\u4FC6\u4FC8\u4FC9\u4FCB\u4FCC\u4FCD\u4FCF\u4FD2\u4FDC\u4FE0\u4FE2\u4FF0\u4FF2\u4FFC\u4FFD\u4FFF\u5000\u5001\u5004\u5007\u500A\u500C\u500E\u5010\u5013\u5017\u5018\u501B\u501C\u501D\u501E\u5022\u5027\u502E\u5030\u5032\u5033\u5035\u5040\u5041\u5042\u5045\u5046\u504A\u504C\u504E\u5051\u5052\u5053\u5057\u5059\u505F\u5060\u5062\u5063\u5066\u5067\u506A\u506D\u5070\u5071\u503B\u5081\u5083\u5084\u5086\u508A\u508E\u508F\u5090"], + ["8fb2a1", "\u5092\u5093\u5094\u5096\u509B\u509C\u509E", 4, "\u50AA\u50AF\u50B0\u50B9\u50BA\u50BD\u50C0\u50C3\u50C4\u50C7\u50CC\u50CE\u50D0\u50D3\u50D4\u50D8\u50DC\u50DD\u50DF\u50E2\u50E4\u50E6\u50E8\u50E9\u50EF\u50F1\u50F6\u50FA\u50FE\u5103\u5106\u5107\u5108\u510B\u510C\u510D\u510E\u50F2\u5110\u5117\u5119\u511B\u511C\u511D\u511E\u5123\u5127\u5128\u512C\u512D\u512F\u5131\u5133\u5134\u5135\u5138\u5139\u5142\u514A\u514F\u5153\u5155\u5157\u5158\u515F\u5164\u5166\u517E\u5183\u5184\u518B\u518E\u5198\u519D\u51A1\u51A3\u51AD\u51B8\u51BA\u51BC\u51BE\u51BF\u51C2"], + ["8fb3a1", "\u51C8\u51CF\u51D1\u51D2\u51D3\u51D5\u51D8\u51DE\u51E2\u51E5\u51EE\u51F2\u51F3\u51F4\u51F7\u5201\u5202\u5205\u5212\u5213\u5215\u5216\u5218\u5222\u5228\u5231\u5232\u5235\u523C\u5245\u5249\u5255\u5257\u5258\u525A\u525C\u525F\u5260\u5261\u5266\u526E\u5277\u5278\u5279\u5280\u5282\u5285\u528A\u528C\u5293\u5295\u5296\u5297\u5298\u529A\u529C\u52A4\u52A5\u52A6\u52A7\u52AF\u52B0\u52B6\u52B7\u52B8\u52BA\u52BB\u52BD\u52C0\u52C4\u52C6\u52C8\u52CC\u52CF\u52D1\u52D4\u52D6\u52DB\u52DC\u52E1\u52E5\u52E8\u52E9\u52EA\u52EC\u52F0\u52F1\u52F4\u52F6\u52F7\u5300\u5303\u530A\u530B"], + ["8fb4a1", "\u530C\u5311\u5313\u5318\u531B\u531C\u531E\u531F\u5325\u5327\u5328\u5329\u532B\u532C\u532D\u5330\u5332\u5335\u533C\u533D\u533E\u5342\u534C\u534B\u5359\u535B\u5361\u5363\u5365\u536C\u536D\u5372\u5379\u537E\u5383\u5387\u5388\u538E\u5393\u5394\u5399\u539D\u53A1\u53A4\u53AA\u53AB\u53AF\u53B2\u53B4\u53B5\u53B7\u53B8\u53BA\u53BD\u53C0\u53C5\u53CF\u53D2\u53D3\u53D5\u53DA\u53DD\u53DE\u53E0\u53E6\u53E7\u53F5\u5402\u5413\u541A\u5421\u5427\u5428\u542A\u542F\u5431\u5434\u5435\u5443\u5444\u5447\u544D\u544F\u545E\u5462\u5464\u5466\u5467\u5469\u546B\u546D\u546E\u5474\u547F"], + ["8fb5a1", "\u5481\u5483\u5485\u5488\u5489\u548D\u5491\u5495\u5496\u549C\u549F\u54A1\u54A6\u54A7\u54A9\u54AA\u54AD\u54AE\u54B1\u54B7\u54B9\u54BA\u54BB\u54BF\u54C6\u54CA\u54CD\u54CE\u54E0\u54EA\u54EC\u54EF\u54F6\u54FC\u54FE\u54FF\u5500\u5501\u5505\u5508\u5509\u550C\u550D\u550E\u5515\u552A\u552B\u5532\u5535\u5536\u553B\u553C\u553D\u5541\u5547\u5549\u554A\u554D\u5550\u5551\u5558\u555A\u555B\u555E\u5560\u5561\u5564\u5566\u557F\u5581\u5582\u5586\u5588\u558E\u558F\u5591\u5592\u5593\u5594\u5597\u55A3\u55A4\u55AD\u55B2\u55BF\u55C1\u55C3\u55C6\u55C9\u55CB\u55CC\u55CE\u55D1\u55D2"], + ["8fb6a1", "\u55D3\u55D7\u55D8\u55DB\u55DE\u55E2\u55E9\u55F6\u55FF\u5605\u5608\u560A\u560D", 5, "\u5619\u562C\u5630\u5633\u5635\u5637\u5639\u563B\u563C\u563D\u563F\u5640\u5641\u5643\u5644\u5646\u5649\u564B\u564D\u564F\u5654\u565E\u5660\u5661\u5662\u5663\u5666\u5669\u566D\u566F\u5671\u5672\u5675\u5684\u5685\u5688\u568B\u568C\u5695\u5699\u569A\u569D\u569E\u569F\u56A6\u56A7\u56A8\u56A9\u56AB\u56AC\u56AD\u56B1\u56B3\u56B7\u56BE\u56C5\u56C9\u56CA\u56CB\u56CF\u56D0\u56CC\u56CD\u56D9\u56DC\u56DD\u56DF\u56E1\u56E4", 4, "\u56F1\u56EB\u56ED"], + ["8fb7a1", "\u56F6\u56F7\u5701\u5702\u5707\u570A\u570C\u5711\u5715\u571A\u571B\u571D\u5720\u5722\u5723\u5724\u5725\u5729\u572A\u572C\u572E\u572F\u5733\u5734\u573D\u573E\u573F\u5745\u5746\u574C\u574D\u5752\u5762\u5765\u5767\u5768\u576B\u576D", 4, "\u5773\u5774\u5775\u5777\u5779\u577A\u577B\u577C\u577E\u5781\u5783\u578C\u5794\u5797\u5799\u579A\u579C\u579D\u579E\u579F\u57A1\u5795\u57A7\u57A8\u57A9\u57AC\u57B8\u57BD\u57C7\u57C8\u57CC\u57CF\u57D5\u57DD\u57DE\u57E4\u57E6\u57E7\u57E9\u57ED\u57F0\u57F5\u57F6\u57F8\u57FD\u57FE\u57FF\u5803\u5804\u5808\u5809\u57E1"], + ["8fb8a1", "\u580C\u580D\u581B\u581E\u581F\u5820\u5826\u5827\u582D\u5832\u5839\u583F\u5849\u584C\u584D\u584F\u5850\u5855\u585F\u5861\u5864\u5867\u5868\u5878\u587C\u587F\u5880\u5881\u5887\u5888\u5889\u588A\u588C\u588D\u588F\u5890\u5894\u5896\u589D\u58A0\u58A1\u58A2\u58A6\u58A9\u58B1\u58B2\u58C4\u58BC\u58C2\u58C8\u58CD\u58CE\u58D0\u58D2\u58D4\u58D6\u58DA\u58DD\u58E1\u58E2\u58E9\u58F3\u5905\u5906\u590B\u590C\u5912\u5913\u5914\u8641\u591D\u5921\u5923\u5924\u5928\u592F\u5930\u5933\u5935\u5936\u593F\u5943\u5946\u5952\u5953\u5959\u595B\u595D\u595E\u595F\u5961\u5963\u596B\u596D"], + ["8fb9a1", "\u596F\u5972\u5975\u5976\u5979\u597B\u597C\u598B\u598C\u598E\u5992\u5995\u5997\u599F\u59A4\u59A7\u59AD\u59AE\u59AF\u59B0\u59B3\u59B7\u59BA\u59BC\u59C1\u59C3\u59C4\u59C8\u59CA\u59CD\u59D2\u59DD\u59DE\u59DF\u59E3\u59E4\u59E7\u59EE\u59EF\u59F1\u59F2\u59F4\u59F7\u5A00\u5A04\u5A0C\u5A0D\u5A0E\u5A12\u5A13\u5A1E\u5A23\u5A24\u5A27\u5A28\u5A2A\u5A2D\u5A30\u5A44\u5A45\u5A47\u5A48\u5A4C\u5A50\u5A55\u5A5E\u5A63\u5A65\u5A67\u5A6D\u5A77\u5A7A\u5A7B\u5A7E\u5A8B\u5A90\u5A93\u5A96\u5A99\u5A9C\u5A9E\u5A9F\u5AA0\u5AA2\u5AA7\u5AAC\u5AB1\u5AB2\u5AB3\u5AB5\u5AB8\u5ABA\u5ABB\u5ABF"], + ["8fbaa1", "\u5AC4\u5AC6\u5AC8\u5ACF\u5ADA\u5ADC\u5AE0\u5AE5\u5AEA\u5AEE\u5AF5\u5AF6\u5AFD\u5B00\u5B01\u5B08\u5B17\u5B34\u5B19\u5B1B\u5B1D\u5B21\u5B25\u5B2D\u5B38\u5B41\u5B4B\u5B4C\u5B52\u5B56\u5B5E\u5B68\u5B6E\u5B6F\u5B7C\u5B7D\u5B7E\u5B7F\u5B81\u5B84\u5B86\u5B8A\u5B8E\u5B90\u5B91\u5B93\u5B94\u5B96\u5BA8\u5BA9\u5BAC\u5BAD\u5BAF\u5BB1\u5BB2\u5BB7\u5BBA\u5BBC\u5BC0\u5BC1\u5BCD\u5BCF\u5BD6", 4, "\u5BE0\u5BEF\u5BF1\u5BF4\u5BFD\u5C0C\u5C17\u5C1E\u5C1F\u5C23\u5C26\u5C29\u5C2B\u5C2C\u5C2E\u5C30\u5C32\u5C35\u5C36\u5C59\u5C5A\u5C5C\u5C62\u5C63\u5C67\u5C68\u5C69"], + ["8fbba1", "\u5C6D\u5C70\u5C74\u5C75\u5C7A\u5C7B\u5C7C\u5C7D\u5C87\u5C88\u5C8A\u5C8F\u5C92\u5C9D\u5C9F\u5CA0\u5CA2\u5CA3\u5CA6\u5CAA\u5CB2\u5CB4\u5CB5\u5CBA\u5CC9\u5CCB\u5CD2\u5CDD\u5CD7\u5CEE\u5CF1\u5CF2\u5CF4\u5D01\u5D06\u5D0D\u5D12\u5D2B\u5D23\u5D24\u5D26\u5D27\u5D31\u5D34\u5D39\u5D3D\u5D3F\u5D42\u5D43\u5D46\u5D48\u5D55\u5D51\u5D59\u5D4A\u5D5F\u5D60\u5D61\u5D62\u5D64\u5D6A\u5D6D\u5D70\u5D79\u5D7A\u5D7E\u5D7F\u5D81\u5D83\u5D88\u5D8A\u5D92\u5D93\u5D94\u5D95\u5D99\u5D9B\u5D9F\u5DA0\u5DA7\u5DAB\u5DB0\u5DB4\u5DB8\u5DB9\u5DC3\u5DC7\u5DCB\u5DD0\u5DCE\u5DD8\u5DD9\u5DE0\u5DE4"], + ["8fbca1", "\u5DE9\u5DF8\u5DF9\u5E00\u5E07\u5E0D\u5E12\u5E14\u5E15\u5E18\u5E1F\u5E20\u5E2E\u5E28\u5E32\u5E35\u5E3E\u5E4B\u5E50\u5E49\u5E51\u5E56\u5E58\u5E5B\u5E5C\u5E5E\u5E68\u5E6A", 4, "\u5E70\u5E80\u5E8B\u5E8E\u5EA2\u5EA4\u5EA5\u5EA8\u5EAA\u5EAC\u5EB1\u5EB3\u5EBD\u5EBE\u5EBF\u5EC6\u5ECC\u5ECB\u5ECE\u5ED1\u5ED2\u5ED4\u5ED5\u5EDC\u5EDE\u5EE5\u5EEB\u5F02\u5F06\u5F07\u5F08\u5F0E\u5F19\u5F1C\u5F1D\u5F21\u5F22\u5F23\u5F24\u5F28\u5F2B\u5F2C\u5F2E\u5F30\u5F34\u5F36\u5F3B\u5F3D\u5F3F\u5F40\u5F44\u5F45\u5F47\u5F4D\u5F50\u5F54\u5F58\u5F5B\u5F60\u5F63\u5F64\u5F67"], + ["8fbda1", "\u5F6F\u5F72\u5F74\u5F75\u5F78\u5F7A\u5F7D\u5F7E\u5F89\u5F8D\u5F8F\u5F96\u5F9C\u5F9D\u5FA2\u5FA7\u5FAB\u5FA4\u5FAC\u5FAF\u5FB0\u5FB1\u5FB8\u5FC4\u5FC7\u5FC8\u5FC9\u5FCB\u5FD0", 4, "\u5FDE\u5FE1\u5FE2\u5FE8\u5FE9\u5FEA\u5FEC\u5FED\u5FEE\u5FEF\u5FF2\u5FF3\u5FF6\u5FFA\u5FFC\u6007\u600A\u600D\u6013\u6014\u6017\u6018\u601A\u601F\u6024\u602D\u6033\u6035\u6040\u6047\u6048\u6049\u604C\u6051\u6054\u6056\u6057\u605D\u6061\u6067\u6071\u607E\u607F\u6082\u6086\u6088\u608A\u608E\u6091\u6093\u6095\u6098\u609D\u609E\u60A2\u60A4\u60A5\u60A8\u60B0\u60B1\u60B7"], + ["8fbea1", "\u60BB\u60BE\u60C2\u60C4\u60C8\u60C9\u60CA\u60CB\u60CE\u60CF\u60D4\u60D5\u60D9\u60DB\u60DD\u60DE\u60E2\u60E5\u60F2\u60F5\u60F8\u60FC\u60FD\u6102\u6107\u610A\u610C\u6110", 4, "\u6116\u6117\u6119\u611C\u611E\u6122\u612A\u612B\u6130\u6131\u6135\u6136\u6137\u6139\u6141\u6145\u6146\u6149\u615E\u6160\u616C\u6172\u6178\u617B\u617C\u617F\u6180\u6181\u6183\u6184\u618B\u618D\u6192\u6193\u6197\u6198\u619C\u619D\u619F\u61A0\u61A5\u61A8\u61AA\u61AD\u61B8\u61B9\u61BC\u61C0\u61C1\u61C2\u61CE\u61CF\u61D5\u61DC\u61DD\u61DE\u61DF\u61E1\u61E2\u61E7\u61E9\u61E5"], + ["8fbfa1", "\u61EC\u61ED\u61EF\u6201\u6203\u6204\u6207\u6213\u6215\u621C\u6220\u6222\u6223\u6227\u6229\u622B\u6239\u623D\u6242\u6243\u6244\u6246\u624C\u6250\u6251\u6252\u6254\u6256\u625A\u625C\u6264\u626D\u626F\u6273\u627A\u627D\u628D\u628E\u628F\u6290\u62A6\u62A8\u62B3\u62B6\u62B7\u62BA\u62BE\u62BF\u62C4\u62CE\u62D5\u62D6\u62DA\u62EA\u62F2\u62F4\u62FC\u62FD\u6303\u6304\u630A\u630B\u630D\u6310\u6313\u6316\u6318\u6329\u632A\u632D\u6335\u6336\u6339\u633C\u6341\u6342\u6343\u6344\u6346\u634A\u634B\u634E\u6352\u6353\u6354\u6358\u635B\u6365\u6366\u636C\u636D\u6371\u6374\u6375"], + ["8fc0a1", "\u6378\u637C\u637D\u637F\u6382\u6384\u6387\u638A\u6390\u6394\u6395\u6399\u639A\u639E\u63A4\u63A6\u63AD\u63AE\u63AF\u63BD\u63C1\u63C5\u63C8\u63CE\u63D1\u63D3\u63D4\u63D5\u63DC\u63E0\u63E5\u63EA\u63EC\u63F2\u63F3\u63F5\u63F8\u63F9\u6409\u640A\u6410\u6412\u6414\u6418\u641E\u6420\u6422\u6424\u6425\u6429\u642A\u642F\u6430\u6435\u643D\u643F\u644B\u644F\u6451\u6452\u6453\u6454\u645A\u645B\u645C\u645D\u645F\u6460\u6461\u6463\u646D\u6473\u6474\u647B\u647D\u6485\u6487\u648F\u6490\u6491\u6498\u6499\u649B\u649D\u649F\u64A1\u64A3\u64A6\u64A8\u64AC\u64B3\u64BD\u64BE\u64BF"], + ["8fc1a1", "\u64C4\u64C9\u64CA\u64CB\u64CC\u64CE\u64D0\u64D1\u64D5\u64D7\u64E4\u64E5\u64E9\u64EA\u64ED\u64F0\u64F5\u64F7\u64FB\u64FF\u6501\u6504\u6508\u6509\u650A\u650F\u6513\u6514\u6516\u6519\u651B\u651E\u651F\u6522\u6526\u6529\u652E\u6531\u653A\u653C\u653D\u6543\u6547\u6549\u6550\u6552\u6554\u655F\u6560\u6567\u656B\u657A\u657D\u6581\u6585\u658A\u6592\u6595\u6598\u659D\u65A0\u65A3\u65A6\u65AE\u65B2\u65B3\u65B4\u65BF\u65C2\u65C8\u65C9\u65CE\u65D0\u65D4\u65D6\u65D8\u65DF\u65F0\u65F2\u65F4\u65F5\u65F9\u65FE\u65FF\u6600\u6604\u6608\u6609\u660D\u6611\u6612\u6615\u6616\u661D"], + ["8fc2a1", "\u661E\u6621\u6622\u6623\u6624\u6626\u6629\u662A\u662B\u662C\u662E\u6630\u6631\u6633\u6639\u6637\u6640\u6645\u6646\u664A\u664C\u6651\u664E\u6657\u6658\u6659\u665B\u665C\u6660\u6661\u66FB\u666A\u666B\u666C\u667E\u6673\u6675\u667F\u6677\u6678\u6679\u667B\u6680\u667C\u668B\u668C\u668D\u6690\u6692\u6699\u669A\u669B\u669C\u669F\u66A0\u66A4\u66AD\u66B1\u66B2\u66B5\u66BB\u66BF\u66C0\u66C2\u66C3\u66C8\u66CC\u66CE\u66CF\u66D4\u66DB\u66DF\u66E8\u66EB\u66EC\u66EE\u66FA\u6705\u6707\u670E\u6713\u6719\u671C\u6720\u6722\u6733\u673E\u6745\u6747\u6748\u674C\u6754\u6755\u675D"], + ["8fc3a1", "\u6766\u676C\u676E\u6774\u6776\u677B\u6781\u6784\u678E\u678F\u6791\u6793\u6796\u6798\u6799\u679B\u67B0\u67B1\u67B2\u67B5\u67BB\u67BC\u67BD\u67F9\u67C0\u67C2\u67C3\u67C5\u67C8\u67C9\u67D2\u67D7\u67D9\u67DC\u67E1\u67E6\u67F0\u67F2\u67F6\u67F7\u6852\u6814\u6819\u681D\u681F\u6828\u6827\u682C\u682D\u682F\u6830\u6831\u6833\u683B\u683F\u6844\u6845\u684A\u684C\u6855\u6857\u6858\u685B\u686B\u686E", 4, "\u6875\u6879\u687A\u687B\u687C\u6882\u6884\u6886\u6888\u6896\u6898\u689A\u689C\u68A1\u68A3\u68A5\u68A9\u68AA\u68AE\u68B2\u68BB\u68C5\u68C8\u68CC\u68CF"], + ["8fc4a1", "\u68D0\u68D1\u68D3\u68D6\u68D9\u68DC\u68DD\u68E5\u68E8\u68EA\u68EB\u68EC\u68ED\u68F0\u68F1\u68F5\u68F6\u68FB\u68FC\u68FD\u6906\u6909\u690A\u6910\u6911\u6913\u6916\u6917\u6931\u6933\u6935\u6938\u693B\u6942\u6945\u6949\u694E\u6957\u695B\u6963\u6964\u6965\u6966\u6968\u6969\u696C\u6970\u6971\u6972\u697A\u697B\u697F\u6980\u698D\u6992\u6996\u6998\u69A1\u69A5\u69A6\u69A8\u69AB\u69AD\u69AF\u69B7\u69B8\u69BA\u69BC\u69C5\u69C8\u69D1\u69D6\u69D7\u69E2\u69E5\u69EE\u69EF\u69F1\u69F3\u69F5\u69FE\u6A00\u6A01\u6A03\u6A0F\u6A11\u6A15\u6A1A\u6A1D\u6A20\u6A24\u6A28\u6A30\u6A32"], + ["8fc5a1", "\u6A34\u6A37\u6A3B\u6A3E\u6A3F\u6A45\u6A46\u6A49\u6A4A\u6A4E\u6A50\u6A51\u6A52\u6A55\u6A56\u6A5B\u6A64\u6A67\u6A6A\u6A71\u6A73\u6A7E\u6A81\u6A83\u6A86\u6A87\u6A89\u6A8B\u6A91\u6A9B\u6A9D\u6A9E\u6A9F\u6AA5\u6AAB\u6AAF\u6AB0\u6AB1\u6AB4\u6ABD\u6ABE\u6ABF\u6AC6\u6AC9\u6AC8\u6ACC\u6AD0\u6AD4\u6AD5\u6AD6\u6ADC\u6ADD\u6AE4\u6AE7\u6AEC\u6AF0\u6AF1\u6AF2\u6AFC\u6AFD\u6B02\u6B03\u6B06\u6B07\u6B09\u6B0F\u6B10\u6B11\u6B17\u6B1B\u6B1E\u6B24\u6B28\u6B2B\u6B2C\u6B2F\u6B35\u6B36\u6B3B\u6B3F\u6B46\u6B4A\u6B4D\u6B52\u6B56\u6B58\u6B5D\u6B60\u6B67\u6B6B\u6B6E\u6B70\u6B75\u6B7D"], + ["8fc6a1", "\u6B7E\u6B82\u6B85\u6B97\u6B9B\u6B9F\u6BA0\u6BA2\u6BA3\u6BA8\u6BA9\u6BAC\u6BAD\u6BAE\u6BB0\u6BB8\u6BB9\u6BBD\u6BBE\u6BC3\u6BC4\u6BC9\u6BCC\u6BD6\u6BDA\u6BE1\u6BE3\u6BE6\u6BE7\u6BEE\u6BF1\u6BF7\u6BF9\u6BFF\u6C02\u6C04\u6C05\u6C09\u6C0D\u6C0E\u6C10\u6C12\u6C19\u6C1F\u6C26\u6C27\u6C28\u6C2C\u6C2E\u6C33\u6C35\u6C36\u6C3A\u6C3B\u6C3F\u6C4A\u6C4B\u6C4D\u6C4F\u6C52\u6C54\u6C59\u6C5B\u6C5C\u6C6B\u6C6D\u6C6F\u6C74\u6C76\u6C78\u6C79\u6C7B\u6C85\u6C86\u6C87\u6C89\u6C94\u6C95\u6C97\u6C98\u6C9C\u6C9F\u6CB0\u6CB2\u6CB4\u6CC2\u6CC6\u6CCD\u6CCF\u6CD0\u6CD1\u6CD2\u6CD4\u6CD6"], + ["8fc7a1", "\u6CDA\u6CDC\u6CE0\u6CE7\u6CE9\u6CEB\u6CEC\u6CEE\u6CF2\u6CF4\u6D04\u6D07\u6D0A\u6D0E\u6D0F\u6D11\u6D13\u6D1A\u6D26\u6D27\u6D28\u6C67\u6D2E\u6D2F\u6D31\u6D39\u6D3C\u6D3F\u6D57\u6D5E\u6D5F\u6D61\u6D65\u6D67\u6D6F\u6D70\u6D7C\u6D82\u6D87\u6D91\u6D92\u6D94\u6D96\u6D97\u6D98\u6DAA\u6DAC\u6DB4\u6DB7\u6DB9\u6DBD\u6DBF\u6DC4\u6DC8\u6DCA\u6DCE\u6DCF\u6DD6\u6DDB\u6DDD\u6DDF\u6DE0\u6DE2\u6DE5\u6DE9\u6DEF\u6DF0\u6DF4\u6DF6\u6DFC\u6E00\u6E04\u6E1E\u6E22\u6E27\u6E32\u6E36\u6E39\u6E3B\u6E3C\u6E44\u6E45\u6E48\u6E49\u6E4B\u6E4F\u6E51\u6E52\u6E53\u6E54\u6E57\u6E5C\u6E5D\u6E5E"], + ["8fc8a1", "\u6E62\u6E63\u6E68\u6E73\u6E7B\u6E7D\u6E8D\u6E93\u6E99\u6EA0\u6EA7\u6EAD\u6EAE\u6EB1\u6EB3\u6EBB\u6EBF\u6EC0\u6EC1\u6EC3\u6EC7\u6EC8\u6ECA\u6ECD\u6ECE\u6ECF\u6EEB\u6EED\u6EEE\u6EF9\u6EFB\u6EFD\u6F04\u6F08\u6F0A\u6F0C\u6F0D\u6F16\u6F18\u6F1A\u6F1B\u6F26\u6F29\u6F2A\u6F2F\u6F30\u6F33\u6F36\u6F3B\u6F3C\u6F2D\u6F4F\u6F51\u6F52\u6F53\u6F57\u6F59\u6F5A\u6F5D\u6F5E\u6F61\u6F62\u6F68\u6F6C\u6F7D\u6F7E\u6F83\u6F87\u6F88\u6F8B\u6F8C\u6F8D\u6F90\u6F92\u6F93\u6F94\u6F96\u6F9A\u6F9F\u6FA0\u6FA5\u6FA6\u6FA7\u6FA8\u6FAE\u6FAF\u6FB0\u6FB5\u6FB6\u6FBC\u6FC5\u6FC7\u6FC8\u6FCA"], + ["8fc9a1", "\u6FDA\u6FDE\u6FE8\u6FE9\u6FF0\u6FF5\u6FF9\u6FFC\u6FFD\u7000\u7005\u7006\u7007\u700D\u7017\u7020\u7023\u702F\u7034\u7037\u7039\u703C\u7043\u7044\u7048\u7049\u704A\u704B\u7054\u7055\u705D\u705E\u704E\u7064\u7065\u706C\u706E\u7075\u7076\u707E\u7081\u7085\u7086\u7094", 4, "\u709B\u70A4\u70AB\u70B0\u70B1\u70B4\u70B7\u70CA\u70D1\u70D3\u70D4\u70D5\u70D6\u70D8\u70DC\u70E4\u70FA\u7103", 4, "\u710B\u710C\u710F\u711E\u7120\u712B\u712D\u712F\u7130\u7131\u7138\u7141\u7145\u7146\u7147\u714A\u714B\u7150\u7152\u7157\u715A\u715C\u715E\u7160"], + ["8fcaa1", "\u7168\u7179\u7180\u7185\u7187\u718C\u7192\u719A\u719B\u71A0\u71A2\u71AF\u71B0\u71B2\u71B3\u71BA\u71BF\u71C0\u71C1\u71C4\u71CB\u71CC\u71D3\u71D6\u71D9\u71DA\u71DC\u71F8\u71FE\u7200\u7207\u7208\u7209\u7213\u7217\u721A\u721D\u721F\u7224\u722B\u722F\u7234\u7238\u7239\u7241\u7242\u7243\u7245\u724E\u724F\u7250\u7253\u7255\u7256\u725A\u725C\u725E\u7260\u7263\u7268\u726B\u726E\u726F\u7271\u7277\u7278\u727B\u727C\u727F\u7284\u7289\u728D\u728E\u7293\u729B\u72A8\u72AD\u72AE\u72B1\u72B4\u72BE\u72C1\u72C7\u72C9\u72CC\u72D5\u72D6\u72D8\u72DF\u72E5\u72F3\u72F4\u72FA\u72FB"], + ["8fcba1", "\u72FE\u7302\u7304\u7305\u7307\u730B\u730D\u7312\u7313\u7318\u7319\u731E\u7322\u7324\u7327\u7328\u732C\u7331\u7332\u7335\u733A\u733B\u733D\u7343\u734D\u7350\u7352\u7356\u7358\u735D\u735E\u735F\u7360\u7366\u7367\u7369\u736B\u736C\u736E\u736F\u7371\u7377\u7379\u737C\u7380\u7381\u7383\u7385\u7386\u738E\u7390\u7393\u7395\u7397\u7398\u739C\u739E\u739F\u73A0\u73A2\u73A5\u73A6\u73AA\u73AB\u73AD\u73B5\u73B7\u73B9\u73BC\u73BD\u73BF\u73C5\u73C6\u73C9\u73CB\u73CC\u73CF\u73D2\u73D3\u73D6\u73D9\u73DD\u73E1\u73E3\u73E6\u73E7\u73E9\u73F4\u73F5\u73F7\u73F9\u73FA\u73FB\u73FD"], + ["8fcca1", "\u73FF\u7400\u7401\u7404\u7407\u740A\u7411\u741A\u741B\u7424\u7426\u7428", 9, "\u7439\u7440\u7443\u7444\u7446\u7447\u744B\u744D\u7451\u7452\u7457\u745D\u7462\u7466\u7467\u7468\u746B\u746D\u746E\u7471\u7472\u7480\u7481\u7485\u7486\u7487\u7489\u748F\u7490\u7491\u7492\u7498\u7499\u749A\u749C\u749F\u74A0\u74A1\u74A3\u74A6\u74A8\u74A9\u74AA\u74AB\u74AE\u74AF\u74B1\u74B2\u74B5\u74B9\u74BB\u74BF\u74C8\u74C9\u74CC\u74D0\u74D3\u74D8\u74DA\u74DB\u74DE\u74DF\u74E4\u74E8\u74EA\u74EB\u74EF\u74F4\u74FA\u74FB\u74FC\u74FF\u7506"], + ["8fcda1", "\u7512\u7516\u7517\u7520\u7521\u7524\u7527\u7529\u752A\u752F\u7536\u7539\u753D\u753E\u753F\u7540\u7543\u7547\u7548\u754E\u7550\u7552\u7557\u755E\u755F\u7561\u756F\u7571\u7579", 5, "\u7581\u7585\u7590\u7592\u7593\u7595\u7599\u759C\u75A2\u75A4\u75B4\u75BA\u75BF\u75C0\u75C1\u75C4\u75C6\u75CC\u75CE\u75CF\u75D7\u75DC\u75DF\u75E0\u75E1\u75E4\u75E7\u75EC\u75EE\u75EF\u75F1\u75F9\u7600\u7602\u7603\u7604\u7607\u7608\u760A\u760C\u760F\u7612\u7613\u7615\u7616\u7619\u761B\u761C\u761D\u761E\u7623\u7625\u7626\u7629\u762D\u7632\u7633\u7635\u7638\u7639"], + ["8fcea1", "\u763A\u763C\u764A\u7640\u7641\u7643\u7644\u7645\u7649\u764B\u7655\u7659\u765F\u7664\u7665\u766D\u766E\u766F\u7671\u7674\u7681\u7685\u768C\u768D\u7695\u769B\u769C\u769D\u769F\u76A0\u76A2", 6, "\u76AA\u76AD\u76BD\u76C1\u76C5\u76C9\u76CB\u76CC\u76CE\u76D4\u76D9\u76E0\u76E6\u76E8\u76EC\u76F0\u76F1\u76F6\u76F9\u76FC\u7700\u7706\u770A\u770E\u7712\u7714\u7715\u7717\u7719\u771A\u771C\u7722\u7728\u772D\u772E\u772F\u7734\u7735\u7736\u7739\u773D\u773E\u7742\u7745\u7746\u774A\u774D\u774E\u774F\u7752\u7756\u7757\u775C\u775E\u775F\u7760\u7762"], + ["8fcfa1", "\u7764\u7767\u776A\u776C\u7770\u7772\u7773\u7774\u777A\u777D\u7780\u7784\u778C\u778D\u7794\u7795\u7796\u779A\u779F\u77A2\u77A7\u77AA\u77AE\u77AF\u77B1\u77B5\u77BE\u77C3\u77C9\u77D1\u77D2\u77D5\u77D9\u77DE\u77DF\u77E0\u77E4\u77E6\u77EA\u77EC\u77F0\u77F1\u77F4\u77F8\u77FB\u7805\u7806\u7809\u780D\u780E\u7811\u781D\u7821\u7822\u7823\u782D\u782E\u7830\u7835\u7837\u7843\u7844\u7847\u7848\u784C\u784E\u7852\u785C\u785E\u7860\u7861\u7863\u7864\u7868\u786A\u786E\u787A\u787E\u788A\u788F\u7894\u7898\u78A1\u789D\u789E\u789F\u78A4\u78A8\u78AC\u78AD\u78B0\u78B1\u78B2\u78B3"], + ["8fd0a1", "\u78BB\u78BD\u78BF\u78C7\u78C8\u78C9\u78CC\u78CE\u78D2\u78D3\u78D5\u78D6\u78E4\u78DB\u78DF\u78E0\u78E1\u78E6\u78EA\u78F2\u78F3\u7900\u78F6\u78F7\u78FA\u78FB\u78FF\u7906\u790C\u7910\u791A\u791C\u791E\u791F\u7920\u7925\u7927\u7929\u792D\u7931\u7934\u7935\u793B\u793D\u793F\u7944\u7945\u7946\u794A\u794B\u794F\u7951\u7954\u7958\u795B\u795C\u7967\u7969\u796B\u7972\u7979\u797B\u797C\u797E\u798B\u798C\u7991\u7993\u7994\u7995\u7996\u7998\u799B\u799C\u79A1\u79A8\u79A9\u79AB\u79AF\u79B1\u79B4\u79B8\u79BB\u79C2\u79C4\u79C7\u79C8\u79CA\u79CF\u79D4\u79D6\u79DA\u79DD\u79DE"], + ["8fd1a1", "\u79E0\u79E2\u79E5\u79EA\u79EB\u79ED\u79F1\u79F8\u79FC\u7A02\u7A03\u7A07\u7A09\u7A0A\u7A0C\u7A11\u7A15\u7A1B\u7A1E\u7A21\u7A27\u7A2B\u7A2D\u7A2F\u7A30\u7A34\u7A35\u7A38\u7A39\u7A3A\u7A44\u7A45\u7A47\u7A48\u7A4C\u7A55\u7A56\u7A59\u7A5C\u7A5D\u7A5F\u7A60\u7A65\u7A67\u7A6A\u7A6D\u7A75\u7A78\u7A7E\u7A80\u7A82\u7A85\u7A86\u7A8A\u7A8B\u7A90\u7A91\u7A94\u7A9E\u7AA0\u7AA3\u7AAC\u7AB3\u7AB5\u7AB9\u7ABB\u7ABC\u7AC6\u7AC9\u7ACC\u7ACE\u7AD1\u7ADB\u7AE8\u7AE9\u7AEB\u7AEC\u7AF1\u7AF4\u7AFB\u7AFD\u7AFE\u7B07\u7B14\u7B1F\u7B23\u7B27\u7B29\u7B2A\u7B2B\u7B2D\u7B2E\u7B2F\u7B30"], + ["8fd2a1", "\u7B31\u7B34\u7B3D\u7B3F\u7B40\u7B41\u7B47\u7B4E\u7B55\u7B60\u7B64\u7B66\u7B69\u7B6A\u7B6D\u7B6F\u7B72\u7B73\u7B77\u7B84\u7B89\u7B8E\u7B90\u7B91\u7B96\u7B9B\u7B9E\u7BA0\u7BA5\u7BAC\u7BAF\u7BB0\u7BB2\u7BB5\u7BB6\u7BBA\u7BBB\u7BBC\u7BBD\u7BC2\u7BC5\u7BC8\u7BCA\u7BD4\u7BD6\u7BD7\u7BD9\u7BDA\u7BDB\u7BE8\u7BEA\u7BF2\u7BF4\u7BF5\u7BF8\u7BF9\u7BFA\u7BFC\u7BFE\u7C01\u7C02\u7C03\u7C04\u7C06\u7C09\u7C0B\u7C0C\u7C0E\u7C0F\u7C19\u7C1B\u7C20\u7C25\u7C26\u7C28\u7C2C\u7C31\u7C33\u7C34\u7C36\u7C39\u7C3A\u7C46\u7C4A\u7C55\u7C51\u7C52\u7C53\u7C59", 5], + ["8fd3a1", "\u7C61\u7C63\u7C67\u7C69\u7C6D\u7C6E\u7C70\u7C72\u7C79\u7C7C\u7C7D\u7C86\u7C87\u7C8F\u7C94\u7C9E\u7CA0\u7CA6\u7CB0\u7CB6\u7CB7\u7CBA\u7CBB\u7CBC\u7CBF\u7CC4\u7CC7\u7CC8\u7CC9\u7CCD\u7CCF\u7CD3\u7CD4\u7CD5\u7CD7\u7CD9\u7CDA\u7CDD\u7CE6\u7CE9\u7CEB\u7CF5\u7D03\u7D07\u7D08\u7D09\u7D0F\u7D11\u7D12\u7D13\u7D16\u7D1D\u7D1E\u7D23\u7D26\u7D2A\u7D2D\u7D31\u7D3C\u7D3D\u7D3E\u7D40\u7D41\u7D47\u7D48\u7D4D\u7D51\u7D53\u7D57\u7D59\u7D5A\u7D5C\u7D5D\u7D65\u7D67\u7D6A\u7D70\u7D78\u7D7A\u7D7B\u7D7F\u7D81\u7D82\u7D83\u7D85\u7D86\u7D88\u7D8B\u7D8C\u7D8D\u7D91\u7D96\u7D97\u7D9D"], + ["8fd4a1", "\u7D9E\u7DA6\u7DA7\u7DAA\u7DB3\u7DB6\u7DB7\u7DB9\u7DC2", 4, "\u7DCC\u7DCD\u7DCE\u7DD7\u7DD9\u7E00\u7DE2\u7DE5\u7DE6\u7DEA\u7DEB\u7DED\u7DF1\u7DF5\u7DF6\u7DF9\u7DFA\u7E08\u7E10\u7E11\u7E15\u7E17\u7E1C\u7E1D\u7E20\u7E27\u7E28\u7E2C\u7E2D\u7E2F\u7E33\u7E36\u7E3F\u7E44\u7E45\u7E47\u7E4E\u7E50\u7E52\u7E58\u7E5F\u7E61\u7E62\u7E65\u7E6B\u7E6E\u7E6F\u7E73\u7E78\u7E7E\u7E81\u7E86\u7E87\u7E8A\u7E8D\u7E91\u7E95\u7E98\u7E9A\u7E9D\u7E9E\u7F3C\u7F3B\u7F3D\u7F3E\u7F3F\u7F43\u7F44\u7F47\u7F4F\u7F52\u7F53\u7F5B\u7F5C\u7F5D\u7F61\u7F63\u7F64\u7F65\u7F66\u7F6D"], + ["8fd5a1", "\u7F71\u7F7D\u7F7E\u7F7F\u7F80\u7F8B\u7F8D\u7F8F\u7F90\u7F91\u7F96\u7F97\u7F9C\u7FA1\u7FA2\u7FA6\u7FAA\u7FAD\u7FB4\u7FBC\u7FBF\u7FC0\u7FC3\u7FC8\u7FCE\u7FCF\u7FDB\u7FDF\u7FE3\u7FE5\u7FE8\u7FEC\u7FEE\u7FEF\u7FF2\u7FFA\u7FFD\u7FFE\u7FFF\u8007\u8008\u800A\u800D\u800E\u800F\u8011\u8013\u8014\u8016\u801D\u801E\u801F\u8020\u8024\u8026\u802C\u802E\u8030\u8034\u8035\u8037\u8039\u803A\u803C\u803E\u8040\u8044\u8060\u8064\u8066\u806D\u8071\u8075\u8081\u8088\u808E\u809C\u809E\u80A6\u80A7\u80AB\u80B8\u80B9\u80C8\u80CD\u80CF\u80D2\u80D4\u80D5\u80D7\u80D8\u80E0\u80ED\u80EE"], + ["8fd6a1", "\u80F0\u80F2\u80F3\u80F6\u80F9\u80FA\u80FE\u8103\u810B\u8116\u8117\u8118\u811C\u811E\u8120\u8124\u8127\u812C\u8130\u8135\u813A\u813C\u8145\u8147\u814A\u814C\u8152\u8157\u8160\u8161\u8167\u8168\u8169\u816D\u816F\u8177\u8181\u8190\u8184\u8185\u8186\u818B\u818E\u8196\u8198\u819B\u819E\u81A2\u81AE\u81B2\u81B4\u81BB\u81CB\u81C3\u81C5\u81CA\u81CE\u81CF\u81D5\u81D7\u81DB\u81DD\u81DE\u81E1\u81E4\u81EB\u81EC\u81F0\u81F1\u81F2\u81F5\u81F6\u81F8\u81F9\u81FD\u81FF\u8200\u8203\u820F\u8213\u8214\u8219\u821A\u821D\u8221\u8222\u8228\u8232\u8234\u823A\u8243\u8244\u8245\u8246"], + ["8fd7a1", "\u824B\u824E\u824F\u8251\u8256\u825C\u8260\u8263\u8267\u826D\u8274\u827B\u827D\u827F\u8280\u8281\u8283\u8284\u8287\u8289\u828A\u828E\u8291\u8294\u8296\u8298\u829A\u829B\u82A0\u82A1\u82A3\u82A4\u82A7\u82A8\u82A9\u82AA\u82AE\u82B0\u82B2\u82B4\u82B7\u82BA\u82BC\u82BE\u82BF\u82C6\u82D0\u82D5\u82DA\u82E0\u82E2\u82E4\u82E8\u82EA\u82ED\u82EF\u82F6\u82F7\u82FD\u82FE\u8300\u8301\u8307\u8308\u830A\u830B\u8354\u831B\u831D\u831E\u831F\u8321\u8322\u832C\u832D\u832E\u8330\u8333\u8337\u833A\u833C\u833D\u8342\u8343\u8344\u8347\u834D\u834E\u8351\u8355\u8356\u8357\u8370\u8378"], + ["8fd8a1", "\u837D\u837F\u8380\u8382\u8384\u8386\u838D\u8392\u8394\u8395\u8398\u8399\u839B\u839C\u839D\u83A6\u83A7\u83A9\u83AC\u83BE\u83BF\u83C0\u83C7\u83C9\u83CF\u83D0\u83D1\u83D4\u83DD\u8353\u83E8\u83EA\u83F6\u83F8\u83F9\u83FC\u8401\u8406\u840A\u840F\u8411\u8415\u8419\u83AD\u842F\u8439\u8445\u8447\u8448\u844A\u844D\u844F\u8451\u8452\u8456\u8458\u8459\u845A\u845C\u8460\u8464\u8465\u8467\u846A\u8470\u8473\u8474\u8476\u8478\u847C\u847D\u8481\u8485\u8492\u8493\u8495\u849E\u84A6\u84A8\u84A9\u84AA\u84AF\u84B1\u84B4\u84BA\u84BD\u84BE\u84C0\u84C2\u84C7\u84C8\u84CC\u84CF\u84D3"], + ["8fd9a1", "\u84DC\u84E7\u84EA\u84EF\u84F0\u84F1\u84F2\u84F7\u8532\u84FA\u84FB\u84FD\u8502\u8503\u8507\u850C\u850E\u8510\u851C\u851E\u8522\u8523\u8524\u8525\u8527\u852A\u852B\u852F\u8533\u8534\u8536\u853F\u8546\u854F", 4, "\u8556\u8559\u855C", 6, "\u8564\u856B\u856F\u8579\u857A\u857B\u857D\u857F\u8581\u8585\u8586\u8589\u858B\u858C\u858F\u8593\u8598\u859D\u859F\u85A0\u85A2\u85A5\u85A7\u85B4\u85B6\u85B7\u85B8\u85BC\u85BD\u85BE\u85BF\u85C2\u85C7\u85CA\u85CB\u85CE\u85AD\u85D8\u85DA\u85DF\u85E0\u85E6\u85E8\u85ED\u85F3\u85F6\u85FC"], + ["8fdaa1", "\u85FF\u8600\u8604\u8605\u860D\u860E\u8610\u8611\u8612\u8618\u8619\u861B\u861E\u8621\u8627\u8629\u8636\u8638\u863A\u863C\u863D\u8640\u8642\u8646\u8652\u8653\u8656\u8657\u8658\u8659\u865D\u8660", 4, "\u8669\u866C\u866F\u8675\u8676\u8677\u867A\u868D\u8691\u8696\u8698\u869A\u869C\u86A1\u86A6\u86A7\u86A8\u86AD\u86B1\u86B3\u86B4\u86B5\u86B7\u86B8\u86B9\u86BF\u86C0\u86C1\u86C3\u86C5\u86D1\u86D2\u86D5\u86D7\u86DA\u86DC\u86E0\u86E3\u86E5\u86E7\u8688\u86FA\u86FC\u86FD\u8704\u8705\u8707\u870B\u870E\u870F\u8710\u8713\u8714\u8719\u871E\u871F\u8721\u8723"], + ["8fdba1", "\u8728\u872E\u872F\u8731\u8732\u8739\u873A\u873C\u873D\u873E\u8740\u8743\u8745\u874D\u8758\u875D\u8761\u8764\u8765\u876F\u8771\u8772\u877B\u8783", 6, "\u878B\u878C\u8790\u8793\u8795\u8797\u8798\u8799\u879E\u87A0\u87A3\u87A7\u87AC\u87AD\u87AE\u87B1\u87B5\u87BE\u87BF\u87C1\u87C8\u87C9\u87CA\u87CE\u87D5\u87D6\u87D9\u87DA\u87DC\u87DF\u87E2\u87E3\u87E4\u87EA\u87EB\u87ED\u87F1\u87F3\u87F8\u87FA\u87FF\u8801\u8803\u8806\u8809\u880A\u880B\u8810\u8819\u8812\u8813\u8814\u8818\u881A\u881B\u881C\u881E\u881F\u8828\u882D\u882E\u8830\u8832\u8835"], + ["8fdca1", "\u883A\u883C\u8841\u8843\u8845\u8848\u8849\u884A\u884B\u884E\u8851\u8855\u8856\u8858\u885A\u885C\u885F\u8860\u8864\u8869\u8871\u8879\u887B\u8880\u8898\u889A\u889B\u889C\u889F\u88A0\u88A8\u88AA\u88BA\u88BD\u88BE\u88C0\u88CA", 4, "\u88D1\u88D2\u88D3\u88DB\u88DE\u88E7\u88EF\u88F0\u88F1\u88F5\u88F7\u8901\u8906\u890D\u890E\u890F\u8915\u8916\u8918\u8919\u891A\u891C\u8920\u8926\u8927\u8928\u8930\u8931\u8932\u8935\u8939\u893A\u893E\u8940\u8942\u8945\u8946\u8949\u894F\u8952\u8957\u895A\u895B\u895C\u8961\u8962\u8963\u896B\u896E\u8970\u8973\u8975\u897A"], + ["8fdda1", "\u897B\u897C\u897D\u8989\u898D\u8990\u8994\u8995\u899B\u899C\u899F\u89A0\u89A5\u89B0\u89B4\u89B5\u89B6\u89B7\u89BC\u89D4", 4, "\u89E5\u89E9\u89EB\u89ED\u89F1\u89F3\u89F6\u89F9\u89FD\u89FF\u8A04\u8A05\u8A07\u8A0F\u8A11\u8A12\u8A14\u8A15\u8A1E\u8A20\u8A22\u8A24\u8A26\u8A2B\u8A2C\u8A2F\u8A35\u8A37\u8A3D\u8A3E\u8A40\u8A43\u8A45\u8A47\u8A49\u8A4D\u8A4E\u8A53\u8A56\u8A57\u8A58\u8A5C\u8A5D\u8A61\u8A65\u8A67\u8A75\u8A76\u8A77\u8A79\u8A7A\u8A7B\u8A7E\u8A7F\u8A80\u8A83\u8A86\u8A8B\u8A8F\u8A90\u8A92\u8A96\u8A97\u8A99\u8A9F\u8AA7\u8AA9\u8AAE\u8AAF\u8AB3"], + ["8fdea1", "\u8AB6\u8AB7\u8ABB\u8ABE\u8AC3\u8AC6\u8AC8\u8AC9\u8ACA\u8AD1\u8AD3\u8AD4\u8AD5\u8AD7\u8ADD\u8ADF\u8AEC\u8AF0\u8AF4\u8AF5\u8AF6\u8AFC\u8AFF\u8B05\u8B06\u8B0B\u8B11\u8B1C\u8B1E\u8B1F\u8B0A\u8B2D\u8B30\u8B37\u8B3C\u8B42", 4, "\u8B48\u8B52\u8B53\u8B54\u8B59\u8B4D\u8B5E\u8B63\u8B6D\u8B76\u8B78\u8B79\u8B7C\u8B7E\u8B81\u8B84\u8B85\u8B8B\u8B8D\u8B8F\u8B94\u8B95\u8B9C\u8B9E\u8B9F\u8C38\u8C39\u8C3D\u8C3E\u8C45\u8C47\u8C49\u8C4B\u8C4F\u8C51\u8C53\u8C54\u8C57\u8C58\u8C5B\u8C5D\u8C59\u8C63\u8C64\u8C66\u8C68\u8C69\u8C6D\u8C73\u8C75\u8C76\u8C7B\u8C7E\u8C86"], + ["8fdfa1", "\u8C87\u8C8B\u8C90\u8C92\u8C93\u8C99\u8C9B\u8C9C\u8CA4\u8CB9\u8CBA\u8CC5\u8CC6\u8CC9\u8CCB\u8CCF\u8CD6\u8CD5\u8CD9\u8CDD\u8CE1\u8CE8\u8CEC\u8CEF\u8CF0\u8CF2\u8CF5\u8CF7\u8CF8\u8CFE\u8CFF\u8D01\u8D03\u8D09\u8D12\u8D17\u8D1B\u8D65\u8D69\u8D6C\u8D6E\u8D7F\u8D82\u8D84\u8D88\u8D8D\u8D90\u8D91\u8D95\u8D9E\u8D9F\u8DA0\u8DA6\u8DAB\u8DAC\u8DAF\u8DB2\u8DB5\u8DB7\u8DB9\u8DBB\u8DC0\u8DC5\u8DC6\u8DC7\u8DC8\u8DCA\u8DCE\u8DD1\u8DD4\u8DD5\u8DD7\u8DD9\u8DE4\u8DE5\u8DE7\u8DEC\u8DF0\u8DBC\u8DF1\u8DF2\u8DF4\u8DFD\u8E01\u8E04\u8E05\u8E06\u8E0B\u8E11\u8E14\u8E16\u8E20\u8E21\u8E22"], + ["8fe0a1", "\u8E23\u8E26\u8E27\u8E31\u8E33\u8E36\u8E37\u8E38\u8E39\u8E3D\u8E40\u8E41\u8E4B\u8E4D\u8E4E\u8E4F\u8E54\u8E5B\u8E5C\u8E5D\u8E5E\u8E61\u8E62\u8E69\u8E6C\u8E6D\u8E6F\u8E70\u8E71\u8E79\u8E7A\u8E7B\u8E82\u8E83\u8E89\u8E90\u8E92\u8E95\u8E9A\u8E9B\u8E9D\u8E9E\u8EA2\u8EA7\u8EA9\u8EAD\u8EAE\u8EB3\u8EB5\u8EBA\u8EBB\u8EC0\u8EC1\u8EC3\u8EC4\u8EC7\u8ECF\u8ED1\u8ED4\u8EDC\u8EE8\u8EEE\u8EF0\u8EF1\u8EF7\u8EF9\u8EFA\u8EED\u8F00\u8F02\u8F07\u8F08\u8F0F\u8F10\u8F16\u8F17\u8F18\u8F1E\u8F20\u8F21\u8F23\u8F25\u8F27\u8F28\u8F2C\u8F2D\u8F2E\u8F34\u8F35\u8F36\u8F37\u8F3A\u8F40\u8F41"], + ["8fe1a1", "\u8F43\u8F47\u8F4F\u8F51", 4, "\u8F58\u8F5D\u8F5E\u8F65\u8F9D\u8FA0\u8FA1\u8FA4\u8FA5\u8FA6\u8FB5\u8FB6\u8FB8\u8FBE\u8FC0\u8FC1\u8FC6\u8FCA\u8FCB\u8FCD\u8FD0\u8FD2\u8FD3\u8FD5\u8FE0\u8FE3\u8FE4\u8FE8\u8FEE\u8FF1\u8FF5\u8FF6\u8FFB\u8FFE\u9002\u9004\u9008\u900C\u9018\u901B\u9028\u9029\u902F\u902A\u902C\u902D\u9033\u9034\u9037\u903F\u9043\u9044\u904C\u905B\u905D\u9062\u9066\u9067\u906C\u9070\u9074\u9079\u9085\u9088\u908B\u908C\u908E\u9090\u9095\u9097\u9098\u9099\u909B\u90A0\u90A1\u90A2\u90A5\u90B0\u90B2\u90B3\u90B4\u90B6\u90BD\u90CC\u90BE\u90C3"], + ["8fe2a1", "\u90C4\u90C5\u90C7\u90C8\u90D5\u90D7\u90D8\u90D9\u90DC\u90DD\u90DF\u90E5\u90D2\u90F6\u90EB\u90EF\u90F0\u90F4\u90FE\u90FF\u9100\u9104\u9105\u9106\u9108\u910D\u9110\u9114\u9116\u9117\u9118\u911A\u911C\u911E\u9120\u9125\u9122\u9123\u9127\u9129\u912E\u912F\u9131\u9134\u9136\u9137\u9139\u913A\u913C\u913D\u9143\u9147\u9148\u914F\u9153\u9157\u9159\u915A\u915B\u9161\u9164\u9167\u916D\u9174\u9179\u917A\u917B\u9181\u9183\u9185\u9186\u918A\u918E\u9191\u9193\u9194\u9195\u9198\u919E\u91A1\u91A6\u91A8\u91AC\u91AD\u91AE\u91B0\u91B1\u91B2\u91B3\u91B6\u91BB\u91BC\u91BD\u91BF"], + ["8fe3a1", "\u91C2\u91C3\u91C5\u91D3\u91D4\u91D7\u91D9\u91DA\u91DE\u91E4\u91E5\u91E9\u91EA\u91EC", 5, "\u91F7\u91F9\u91FB\u91FD\u9200\u9201\u9204\u9205\u9206\u9207\u9209\u920A\u920C\u9210\u9212\u9213\u9216\u9218\u921C\u921D\u9223\u9224\u9225\u9226\u9228\u922E\u922F\u9230\u9233\u9235\u9236\u9238\u9239\u923A\u923C\u923E\u9240\u9242\u9243\u9246\u9247\u924A\u924D\u924E\u924F\u9251\u9258\u9259\u925C\u925D\u9260\u9261\u9265\u9267\u9268\u9269\u926E\u926F\u9270\u9275", 4, "\u927B\u927C\u927D\u927F\u9288\u9289\u928A\u928D\u928E\u9292\u9297"], + ["8fe4a1", "\u9299\u929F\u92A0\u92A4\u92A5\u92A7\u92A8\u92AB\u92AF\u92B2\u92B6\u92B8\u92BA\u92BB\u92BC\u92BD\u92BF", 4, "\u92C5\u92C6\u92C7\u92C8\u92CB\u92CC\u92CD\u92CE\u92D0\u92D3\u92D5\u92D7\u92D8\u92D9\u92DC\u92DD\u92DF\u92E0\u92E1\u92E3\u92E5\u92E7\u92E8\u92EC\u92EE\u92F0\u92F9\u92FB\u92FF\u9300\u9302\u9308\u930D\u9311\u9314\u9315\u931C\u931D\u931E\u931F\u9321\u9324\u9325\u9327\u9329\u932A\u9333\u9334\u9336\u9337\u9347\u9348\u9349\u9350\u9351\u9352\u9355\u9357\u9358\u935A\u935E\u9364\u9365\u9367\u9369\u936A\u936D\u936F\u9370\u9371\u9373\u9374\u9376"], + ["8fe5a1", "\u937A\u937D\u937F\u9380\u9381\u9382\u9388\u938A\u938B\u938D\u938F\u9392\u9395\u9398\u939B\u939E\u93A1\u93A3\u93A4\u93A6\u93A8\u93AB\u93B4\u93B5\u93B6\u93BA\u93A9\u93C1\u93C4\u93C5\u93C6\u93C7\u93C9", 4, "\u93D3\u93D9\u93DC\u93DE\u93DF\u93E2\u93E6\u93E7\u93F9\u93F7\u93F8\u93FA\u93FB\u93FD\u9401\u9402\u9404\u9408\u9409\u940D\u940E\u940F\u9415\u9416\u9417\u941F\u942E\u942F\u9431\u9432\u9433\u9434\u943B\u943F\u943D\u9443\u9445\u9448\u944A\u944C\u9455\u9459\u945C\u945F\u9461\u9463\u9468\u946B\u946D\u946E\u946F\u9471\u9472\u9484\u9483\u9578\u9579"], + ["8fe6a1", "\u957E\u9584\u9588\u958C\u958D\u958E\u959D\u959E\u959F\u95A1\u95A6\u95A9\u95AB\u95AC\u95B4\u95B6\u95BA\u95BD\u95BF\u95C6\u95C8\u95C9\u95CB\u95D0\u95D1\u95D2\u95D3\u95D9\u95DA\u95DD\u95DE\u95DF\u95E0\u95E4\u95E6\u961D\u961E\u9622\u9624\u9625\u9626\u962C\u9631\u9633\u9637\u9638\u9639\u963A\u963C\u963D\u9641\u9652\u9654\u9656\u9657\u9658\u9661\u966E\u9674\u967B\u967C\u967E\u967F\u9681\u9682\u9683\u9684\u9689\u9691\u9696\u969A\u969D\u969F\u96A4\u96A5\u96A6\u96A9\u96AE\u96AF\u96B3\u96BA\u96CA\u96D2\u5DB2\u96D8\u96DA\u96DD\u96DE\u96DF\u96E9\u96EF\u96F1\u96FA\u9702"], + ["8fe7a1", "\u9703\u9705\u9709\u971A\u971B\u971D\u9721\u9722\u9723\u9728\u9731\u9733\u9741\u9743\u974A\u974E\u974F\u9755\u9757\u9758\u975A\u975B\u9763\u9767\u976A\u976E\u9773\u9776\u9777\u9778\u977B\u977D\u977F\u9780\u9789\u9795\u9796\u9797\u9799\u979A\u979E\u979F\u97A2\u97AC\u97AE\u97B1\u97B2\u97B5\u97B6\u97B8\u97B9\u97BA\u97BC\u97BE\u97BF\u97C1\u97C4\u97C5\u97C7\u97C9\u97CA\u97CC\u97CD\u97CE\u97D0\u97D1\u97D4\u97D7\u97D8\u97D9\u97DD\u97DE\u97E0\u97DB\u97E1\u97E4\u97EF\u97F1\u97F4\u97F7\u97F8\u97FA\u9807\u980A\u9819\u980D\u980E\u9814\u9816\u981C\u981E\u9820\u9823\u9826"], + ["8fe8a1", "\u982B\u982E\u982F\u9830\u9832\u9833\u9835\u9825\u983E\u9844\u9847\u984A\u9851\u9852\u9853\u9856\u9857\u9859\u985A\u9862\u9863\u9865\u9866\u986A\u986C\u98AB\u98AD\u98AE\u98B0\u98B4\u98B7\u98B8\u98BA\u98BB\u98BF\u98C2\u98C5\u98C8\u98CC\u98E1\u98E3\u98E5\u98E6\u98E7\u98EA\u98F3\u98F6\u9902\u9907\u9908\u9911\u9915\u9916\u9917\u991A\u991B\u991C\u991F\u9922\u9926\u9927\u992B\u9931", 4, "\u9939\u993A\u993B\u993C\u9940\u9941\u9946\u9947\u9948\u994D\u994E\u9954\u9958\u9959\u995B\u995C\u995E\u995F\u9960\u999B\u999D\u999F\u99A6\u99B0\u99B1\u99B2\u99B5"], + ["8fe9a1", "\u99B9\u99BA\u99BD\u99BF\u99C3\u99C9\u99D3\u99D4\u99D9\u99DA\u99DC\u99DE\u99E7\u99EA\u99EB\u99EC\u99F0\u99F4\u99F5\u99F9\u99FD\u99FE\u9A02\u9A03\u9A04\u9A0B\u9A0C\u9A10\u9A11\u9A16\u9A1E\u9A20\u9A22\u9A23\u9A24\u9A27\u9A2D\u9A2E\u9A33\u9A35\u9A36\u9A38\u9A47\u9A41\u9A44\u9A4A\u9A4B\u9A4C\u9A4E\u9A51\u9A54\u9A56\u9A5D\u9AAA\u9AAC\u9AAE\u9AAF\u9AB2\u9AB4\u9AB5\u9AB6\u9AB9\u9ABB\u9ABE\u9ABF\u9AC1\u9AC3\u9AC6\u9AC8\u9ACE\u9AD0\u9AD2\u9AD5\u9AD6\u9AD7\u9ADB\u9ADC\u9AE0\u9AE4\u9AE5\u9AE7\u9AE9\u9AEC\u9AF2\u9AF3\u9AF5\u9AF9\u9AFA\u9AFD\u9AFF", 4], + ["8feaa1", "\u9B04\u9B05\u9B08\u9B09\u9B0B\u9B0C\u9B0D\u9B0E\u9B10\u9B12\u9B16\u9B19\u9B1B\u9B1C\u9B20\u9B26\u9B2B\u9B2D\u9B33\u9B34\u9B35\u9B37\u9B39\u9B3A\u9B3D\u9B48\u9B4B\u9B4C\u9B55\u9B56\u9B57\u9B5B\u9B5E\u9B61\u9B63\u9B65\u9B66\u9B68\u9B6A", 4, "\u9B73\u9B75\u9B77\u9B78\u9B79\u9B7F\u9B80\u9B84\u9B85\u9B86\u9B87\u9B89\u9B8A\u9B8B\u9B8D\u9B8F\u9B90\u9B94\u9B9A\u9B9D\u9B9E\u9BA6\u9BA7\u9BA9\u9BAC\u9BB0\u9BB1\u9BB2\u9BB7\u9BB8\u9BBB\u9BBC\u9BBE\u9BBF\u9BC1\u9BC7\u9BC8\u9BCE\u9BD0\u9BD7\u9BD8\u9BDD\u9BDF\u9BE5\u9BE7\u9BEA\u9BEB\u9BEF\u9BF3\u9BF7\u9BF8"], + ["8feba1", "\u9BF9\u9BFA\u9BFD\u9BFF\u9C00\u9C02\u9C0B\u9C0F\u9C11\u9C16\u9C18\u9C19\u9C1A\u9C1C\u9C1E\u9C22\u9C23\u9C26", 4, "\u9C31\u9C35\u9C36\u9C37\u9C3D\u9C41\u9C43\u9C44\u9C45\u9C49\u9C4A\u9C4E\u9C4F\u9C50\u9C53\u9C54\u9C56\u9C58\u9C5B\u9C5D\u9C5E\u9C5F\u9C63\u9C69\u9C6A\u9C5C\u9C6B\u9C68\u9C6E\u9C70\u9C72\u9C75\u9C77\u9C7B\u9CE6\u9CF2\u9CF7\u9CF9\u9D0B\u9D02\u9D11\u9D17\u9D18\u9D1C\u9D1D\u9D1E\u9D2F\u9D30\u9D32\u9D33\u9D34\u9D3A\u9D3C\u9D45\u9D3D\u9D42\u9D43\u9D47\u9D4A\u9D53\u9D54\u9D5F\u9D63\u9D62\u9D65\u9D69\u9D6A\u9D6B\u9D70\u9D76\u9D77\u9D7B"], + ["8feca1", "\u9D7C\u9D7E\u9D83\u9D84\u9D86\u9D8A\u9D8D\u9D8E\u9D92\u9D93\u9D95\u9D96\u9D97\u9D98\u9DA1\u9DAA\u9DAC\u9DAE\u9DB1\u9DB5\u9DB9\u9DBC\u9DBF\u9DC3\u9DC7\u9DC9\u9DCA\u9DD4\u9DD5\u9DD6\u9DD7\u9DDA\u9DDE\u9DDF\u9DE0\u9DE5\u9DE7\u9DE9\u9DEB\u9DEE\u9DF0\u9DF3\u9DF4\u9DFE\u9E0A\u9E02\u9E07\u9E0E\u9E10\u9E11\u9E12\u9E15\u9E16\u9E19\u9E1C\u9E1D\u9E7A\u9E7B\u9E7C\u9E80\u9E82\u9E83\u9E84\u9E85\u9E87\u9E8E\u9E8F\u9E96\u9E98\u9E9B\u9E9E\u9EA4\u9EA8\u9EAC\u9EAE\u9EAF\u9EB0\u9EB3\u9EB4\u9EB5\u9EC6\u9EC8\u9ECB\u9ED5\u9EDF\u9EE4\u9EE7\u9EEC\u9EED\u9EEE\u9EF0\u9EF1\u9EF2\u9EF5"], + ["8feda1", "\u9EF8\u9EFF\u9F02\u9F03\u9F09\u9F0F\u9F10\u9F11\u9F12\u9F14\u9F16\u9F17\u9F19\u9F1A\u9F1B\u9F1F\u9F22\u9F26\u9F2A\u9F2B\u9F2F\u9F31\u9F32\u9F34\u9F37\u9F39\u9F3A\u9F3C\u9F3D\u9F3F\u9F41\u9F43", 4, "\u9F53\u9F55\u9F56\u9F57\u9F58\u9F5A\u9F5D\u9F5E\u9F68\u9F69\u9F6D", 4, "\u9F73\u9F75\u9F7A\u9F7D\u9F8F\u9F90\u9F91\u9F92\u9F94\u9F96\u9F97\u9F9E\u9FA1\u9FA2\u9FA3\u9FA5"] + ]; + } +}); + +// node_modules/iconv-lite/encodings/tables/cp936.json +var require_cp936 = __commonJS({ + "node_modules/iconv-lite/encodings/tables/cp936.json"(exports2, module2) { + module2.exports = [ + ["0", "\0", 127, "\u20AC"], + ["8140", "\u4E02\u4E04\u4E05\u4E06\u4E0F\u4E12\u4E17\u4E1F\u4E20\u4E21\u4E23\u4E26\u4E29\u4E2E\u4E2F\u4E31\u4E33\u4E35\u4E37\u4E3C\u4E40\u4E41\u4E42\u4E44\u4E46\u4E4A\u4E51\u4E55\u4E57\u4E5A\u4E5B\u4E62\u4E63\u4E64\u4E65\u4E67\u4E68\u4E6A", 5, "\u4E72\u4E74", 9, "\u4E7F", 6, "\u4E87\u4E8A"], + ["8180", "\u4E90\u4E96\u4E97\u4E99\u4E9C\u4E9D\u4E9E\u4EA3\u4EAA\u4EAF\u4EB0\u4EB1\u4EB4\u4EB6\u4EB7\u4EB8\u4EB9\u4EBC\u4EBD\u4EBE\u4EC8\u4ECC\u4ECF\u4ED0\u4ED2\u4EDA\u4EDB\u4EDC\u4EE0\u4EE2\u4EE6\u4EE7\u4EE9\u4EED\u4EEE\u4EEF\u4EF1\u4EF4\u4EF8\u4EF9\u4EFA\u4EFC\u4EFE\u4F00\u4F02", 6, "\u4F0B\u4F0C\u4F12", 4, "\u4F1C\u4F1D\u4F21\u4F23\u4F28\u4F29\u4F2C\u4F2D\u4F2E\u4F31\u4F33\u4F35\u4F37\u4F39\u4F3B\u4F3E", 4, "\u4F44\u4F45\u4F47", 5, "\u4F52\u4F54\u4F56\u4F61\u4F62\u4F66\u4F68\u4F6A\u4F6B\u4F6D\u4F6E\u4F71\u4F72\u4F75\u4F77\u4F78\u4F79\u4F7A\u4F7D\u4F80\u4F81\u4F82\u4F85\u4F86\u4F87\u4F8A\u4F8C\u4F8E\u4F90\u4F92\u4F93\u4F95\u4F96\u4F98\u4F99\u4F9A\u4F9C\u4F9E\u4F9F\u4FA1\u4FA2"], + ["8240", "\u4FA4\u4FAB\u4FAD\u4FB0", 4, "\u4FB6", 8, "\u4FC0\u4FC1\u4FC2\u4FC6\u4FC7\u4FC8\u4FC9\u4FCB\u4FCC\u4FCD\u4FD2", 4, "\u4FD9\u4FDB\u4FE0\u4FE2\u4FE4\u4FE5\u4FE7\u4FEB\u4FEC\u4FF0\u4FF2\u4FF4\u4FF5\u4FF6\u4FF7\u4FF9\u4FFB\u4FFC\u4FFD\u4FFF", 11], + ["8280", "\u500B\u500E\u5010\u5011\u5013\u5015\u5016\u5017\u501B\u501D\u501E\u5020\u5022\u5023\u5024\u5027\u502B\u502F", 10, "\u503B\u503D\u503F\u5040\u5041\u5042\u5044\u5045\u5046\u5049\u504A\u504B\u504D\u5050", 4, "\u5056\u5057\u5058\u5059\u505B\u505D", 7, "\u5066", 5, "\u506D", 8, "\u5078\u5079\u507A\u507C\u507D\u5081\u5082\u5083\u5084\u5086\u5087\u5089\u508A\u508B\u508C\u508E", 20, "\u50A4\u50A6\u50AA\u50AB\u50AD", 4, "\u50B3", 6, "\u50BC"], + ["8340", "\u50BD", 17, "\u50D0", 5, "\u50D7\u50D8\u50D9\u50DB", 10, "\u50E8\u50E9\u50EA\u50EB\u50EF\u50F0\u50F1\u50F2\u50F4\u50F6", 4, "\u50FC", 9, "\u5108"], + ["8380", "\u5109\u510A\u510C", 5, "\u5113", 13, "\u5122", 28, "\u5142\u5147\u514A\u514C\u514E\u514F\u5150\u5152\u5153\u5157\u5158\u5159\u515B\u515D", 4, "\u5163\u5164\u5166\u5167\u5169\u516A\u516F\u5172\u517A\u517E\u517F\u5183\u5184\u5186\u5187\u518A\u518B\u518E\u518F\u5190\u5191\u5193\u5194\u5198\u519A\u519D\u519E\u519F\u51A1\u51A3\u51A6", 4, "\u51AD\u51AE\u51B4\u51B8\u51B9\u51BA\u51BE\u51BF\u51C1\u51C2\u51C3\u51C5\u51C8\u51CA\u51CD\u51CE\u51D0\u51D2", 5], + ["8440", "\u51D8\u51D9\u51DA\u51DC\u51DE\u51DF\u51E2\u51E3\u51E5", 5, "\u51EC\u51EE\u51F1\u51F2\u51F4\u51F7\u51FE\u5204\u5205\u5209\u520B\u520C\u520F\u5210\u5213\u5214\u5215\u521C\u521E\u521F\u5221\u5222\u5223\u5225\u5226\u5227\u522A\u522C\u522F\u5231\u5232\u5234\u5235\u523C\u523E\u5244", 5, "\u524B\u524E\u524F\u5252\u5253\u5255\u5257\u5258"], + ["8480", "\u5259\u525A\u525B\u525D\u525F\u5260\u5262\u5263\u5264\u5266\u5268\u526B\u526C\u526D\u526E\u5270\u5271\u5273", 9, "\u527E\u5280\u5283", 4, "\u5289", 6, "\u5291\u5292\u5294", 6, "\u529C\u52A4\u52A5\u52A6\u52A7\u52AE\u52AF\u52B0\u52B4", 9, "\u52C0\u52C1\u52C2\u52C4\u52C5\u52C6\u52C8\u52CA\u52CC\u52CD\u52CE\u52CF\u52D1\u52D3\u52D4\u52D5\u52D7\u52D9", 5, "\u52E0\u52E1\u52E2\u52E3\u52E5", 10, "\u52F1", 7, "\u52FB\u52FC\u52FD\u5301\u5302\u5303\u5304\u5307\u5309\u530A\u530B\u530C\u530E"], + ["8540", "\u5311\u5312\u5313\u5314\u5318\u531B\u531C\u531E\u531F\u5322\u5324\u5325\u5327\u5328\u5329\u532B\u532C\u532D\u532F", 9, "\u533C\u533D\u5340\u5342\u5344\u5346\u534B\u534C\u534D\u5350\u5354\u5358\u5359\u535B\u535D\u5365\u5368\u536A\u536C\u536D\u5372\u5376\u5379\u537B\u537C\u537D\u537E\u5380\u5381\u5383\u5387\u5388\u538A\u538E\u538F"], + ["8580", "\u5390", 4, "\u5396\u5397\u5399\u539B\u539C\u539E\u53A0\u53A1\u53A4\u53A7\u53AA\u53AB\u53AC\u53AD\u53AF", 6, "\u53B7\u53B8\u53B9\u53BA\u53BC\u53BD\u53BE\u53C0\u53C3", 4, "\u53CE\u53CF\u53D0\u53D2\u53D3\u53D5\u53DA\u53DC\u53DD\u53DE\u53E1\u53E2\u53E7\u53F4\u53FA\u53FE\u53FF\u5400\u5402\u5405\u5407\u540B\u5414\u5418\u5419\u541A\u541C\u5422\u5424\u5425\u542A\u5430\u5433\u5436\u5437\u543A\u543D\u543F\u5441\u5442\u5444\u5445\u5447\u5449\u544C\u544D\u544E\u544F\u5451\u545A\u545D", 4, "\u5463\u5465\u5467\u5469", 7, "\u5474\u5479\u547A\u547E\u547F\u5481\u5483\u5485\u5487\u5488\u5489\u548A\u548D\u5491\u5493\u5497\u5498\u549C\u549E\u549F\u54A0\u54A1"], + ["8640", "\u54A2\u54A5\u54AE\u54B0\u54B2\u54B5\u54B6\u54B7\u54B9\u54BA\u54BC\u54BE\u54C3\u54C5\u54CA\u54CB\u54D6\u54D8\u54DB\u54E0", 4, "\u54EB\u54EC\u54EF\u54F0\u54F1\u54F4", 5, "\u54FB\u54FE\u5500\u5502\u5503\u5504\u5505\u5508\u550A", 4, "\u5512\u5513\u5515", 5, "\u551C\u551D\u551E\u551F\u5521\u5525\u5526"], + ["8680", "\u5528\u5529\u552B\u552D\u5532\u5534\u5535\u5536\u5538\u5539\u553A\u553B\u553D\u5540\u5542\u5545\u5547\u5548\u554B", 4, "\u5551\u5552\u5553\u5554\u5557", 4, "\u555D\u555E\u555F\u5560\u5562\u5563\u5568\u5569\u556B\u556F", 5, "\u5579\u557A\u557D\u557F\u5585\u5586\u558C\u558D\u558E\u5590\u5592\u5593\u5595\u5596\u5597\u559A\u559B\u559E\u55A0", 6, "\u55A8", 8, "\u55B2\u55B4\u55B6\u55B8\u55BA\u55BC\u55BF", 4, "\u55C6\u55C7\u55C8\u55CA\u55CB\u55CE\u55CF\u55D0\u55D5\u55D7", 4, "\u55DE\u55E0\u55E2\u55E7\u55E9\u55ED\u55EE\u55F0\u55F1\u55F4\u55F6\u55F8", 4, "\u55FF\u5602\u5603\u5604\u5605"], + ["8740", "\u5606\u5607\u560A\u560B\u560D\u5610", 7, "\u5619\u561A\u561C\u561D\u5620\u5621\u5622\u5625\u5626\u5628\u5629\u562A\u562B\u562E\u562F\u5630\u5633\u5635\u5637\u5638\u563A\u563C\u563D\u563E\u5640", 11, "\u564F", 4, "\u5655\u5656\u565A\u565B\u565D", 4], + ["8780", "\u5663\u5665\u5666\u5667\u566D\u566E\u566F\u5670\u5672\u5673\u5674\u5675\u5677\u5678\u5679\u567A\u567D", 7, "\u5687", 6, "\u5690\u5691\u5692\u5694", 14, "\u56A4", 10, "\u56B0", 6, "\u56B8\u56B9\u56BA\u56BB\u56BD", 12, "\u56CB", 8, "\u56D5\u56D6\u56D8\u56D9\u56DC\u56E3\u56E5", 5, "\u56EC\u56EE\u56EF\u56F2\u56F3\u56F6\u56F7\u56F8\u56FB\u56FC\u5700\u5701\u5702\u5705\u5707\u570B", 6], + ["8840", "\u5712", 9, "\u571D\u571E\u5720\u5721\u5722\u5724\u5725\u5726\u5727\u572B\u5731\u5732\u5734", 4, "\u573C\u573D\u573F\u5741\u5743\u5744\u5745\u5746\u5748\u5749\u574B\u5752", 4, "\u5758\u5759\u5762\u5763\u5765\u5767\u576C\u576E\u5770\u5771\u5772\u5774\u5775\u5778\u5779\u577A\u577D\u577E\u577F\u5780"], + ["8880", "\u5781\u5787\u5788\u5789\u578A\u578D", 4, "\u5794", 6, "\u579C\u579D\u579E\u579F\u57A5\u57A8\u57AA\u57AC\u57AF\u57B0\u57B1\u57B3\u57B5\u57B6\u57B7\u57B9", 8, "\u57C4", 6, "\u57CC\u57CD\u57D0\u57D1\u57D3\u57D6\u57D7\u57DB\u57DC\u57DE\u57E1\u57E2\u57E3\u57E5", 7, "\u57EE\u57F0\u57F1\u57F2\u57F3\u57F5\u57F6\u57F7\u57FB\u57FC\u57FE\u57FF\u5801\u5803\u5804\u5805\u5808\u5809\u580A\u580C\u580E\u580F\u5810\u5812\u5813\u5814\u5816\u5817\u5818\u581A\u581B\u581C\u581D\u581F\u5822\u5823\u5825", 4, "\u582B", 4, "\u5831\u5832\u5833\u5834\u5836", 7], + ["8940", "\u583E", 5, "\u5845", 6, "\u584E\u584F\u5850\u5852\u5853\u5855\u5856\u5857\u5859", 4, "\u585F", 5, "\u5866", 4, "\u586D", 16, "\u587F\u5882\u5884\u5886\u5887\u5888\u588A\u588B\u588C"], + ["8980", "\u588D", 4, "\u5894", 4, "\u589B\u589C\u589D\u58A0", 7, "\u58AA", 17, "\u58BD\u58BE\u58BF\u58C0\u58C2\u58C3\u58C4\u58C6", 10, "\u58D2\u58D3\u58D4\u58D6", 13, "\u58E5", 5, "\u58ED\u58EF\u58F1\u58F2\u58F4\u58F5\u58F7\u58F8\u58FA", 7, "\u5903\u5905\u5906\u5908", 4, "\u590E\u5910\u5911\u5912\u5913\u5917\u5918\u591B\u591D\u591E\u5920\u5921\u5922\u5923\u5926\u5928\u592C\u5930\u5932\u5933\u5935\u5936\u593B"], + ["8a40", "\u593D\u593E\u593F\u5940\u5943\u5945\u5946\u594A\u594C\u594D\u5950\u5952\u5953\u5959\u595B", 4, "\u5961\u5963\u5964\u5966", 12, "\u5975\u5977\u597A\u597B\u597C\u597E\u597F\u5980\u5985\u5989\u598B\u598C\u598E\u598F\u5990\u5991\u5994\u5995\u5998\u599A\u599B\u599C\u599D\u599F\u59A0\u59A1\u59A2\u59A6"], + ["8a80", "\u59A7\u59AC\u59AD\u59B0\u59B1\u59B3", 5, "\u59BA\u59BC\u59BD\u59BF", 6, "\u59C7\u59C8\u59C9\u59CC\u59CD\u59CE\u59CF\u59D5\u59D6\u59D9\u59DB\u59DE", 4, "\u59E4\u59E6\u59E7\u59E9\u59EA\u59EB\u59ED", 11, "\u59FA\u59FC\u59FD\u59FE\u5A00\u5A02\u5A0A\u5A0B\u5A0D\u5A0E\u5A0F\u5A10\u5A12\u5A14\u5A15\u5A16\u5A17\u5A19\u5A1A\u5A1B\u5A1D\u5A1E\u5A21\u5A22\u5A24\u5A26\u5A27\u5A28\u5A2A", 6, "\u5A33\u5A35\u5A37", 4, "\u5A3D\u5A3E\u5A3F\u5A41", 4, "\u5A47\u5A48\u5A4B", 9, "\u5A56\u5A57\u5A58\u5A59\u5A5B", 5], + ["8b40", "\u5A61\u5A63\u5A64\u5A65\u5A66\u5A68\u5A69\u5A6B", 8, "\u5A78\u5A79\u5A7B\u5A7C\u5A7D\u5A7E\u5A80", 17, "\u5A93", 6, "\u5A9C", 13, "\u5AAB\u5AAC"], + ["8b80", "\u5AAD", 4, "\u5AB4\u5AB6\u5AB7\u5AB9", 4, "\u5ABF\u5AC0\u5AC3", 5, "\u5ACA\u5ACB\u5ACD", 4, "\u5AD3\u5AD5\u5AD7\u5AD9\u5ADA\u5ADB\u5ADD\u5ADE\u5ADF\u5AE2\u5AE4\u5AE5\u5AE7\u5AE8\u5AEA\u5AEC", 4, "\u5AF2", 22, "\u5B0A", 11, "\u5B18", 25, "\u5B33\u5B35\u5B36\u5B38", 7, "\u5B41", 6], + ["8c40", "\u5B48", 7, "\u5B52\u5B56\u5B5E\u5B60\u5B61\u5B67\u5B68\u5B6B\u5B6D\u5B6E\u5B6F\u5B72\u5B74\u5B76\u5B77\u5B78\u5B79\u5B7B\u5B7C\u5B7E\u5B7F\u5B82\u5B86\u5B8A\u5B8D\u5B8E\u5B90\u5B91\u5B92\u5B94\u5B96\u5B9F\u5BA7\u5BA8\u5BA9\u5BAC\u5BAD\u5BAE\u5BAF\u5BB1\u5BB2\u5BB7\u5BBA\u5BBB\u5BBC\u5BC0\u5BC1\u5BC3\u5BC8\u5BC9\u5BCA\u5BCB\u5BCD\u5BCE\u5BCF"], + ["8c80", "\u5BD1\u5BD4", 8, "\u5BE0\u5BE2\u5BE3\u5BE6\u5BE7\u5BE9", 4, "\u5BEF\u5BF1", 6, "\u5BFD\u5BFE\u5C00\u5C02\u5C03\u5C05\u5C07\u5C08\u5C0B\u5C0C\u5C0D\u5C0E\u5C10\u5C12\u5C13\u5C17\u5C19\u5C1B\u5C1E\u5C1F\u5C20\u5C21\u5C23\u5C26\u5C28\u5C29\u5C2A\u5C2B\u5C2D\u5C2E\u5C2F\u5C30\u5C32\u5C33\u5C35\u5C36\u5C37\u5C43\u5C44\u5C46\u5C47\u5C4C\u5C4D\u5C52\u5C53\u5C54\u5C56\u5C57\u5C58\u5C5A\u5C5B\u5C5C\u5C5D\u5C5F\u5C62\u5C64\u5C67", 6, "\u5C70\u5C72", 6, "\u5C7B\u5C7C\u5C7D\u5C7E\u5C80\u5C83", 4, "\u5C89\u5C8A\u5C8B\u5C8E\u5C8F\u5C92\u5C93\u5C95\u5C9D", 4, "\u5CA4", 4], + ["8d40", "\u5CAA\u5CAE\u5CAF\u5CB0\u5CB2\u5CB4\u5CB6\u5CB9\u5CBA\u5CBB\u5CBC\u5CBE\u5CC0\u5CC2\u5CC3\u5CC5", 5, "\u5CCC", 5, "\u5CD3", 5, "\u5CDA", 6, "\u5CE2\u5CE3\u5CE7\u5CE9\u5CEB\u5CEC\u5CEE\u5CEF\u5CF1", 9, "\u5CFC", 4], + ["8d80", "\u5D01\u5D04\u5D05\u5D08", 5, "\u5D0F", 4, "\u5D15\u5D17\u5D18\u5D19\u5D1A\u5D1C\u5D1D\u5D1F", 4, "\u5D25\u5D28\u5D2A\u5D2B\u5D2C\u5D2F", 4, "\u5D35", 7, "\u5D3F", 7, "\u5D48\u5D49\u5D4D", 10, "\u5D59\u5D5A\u5D5C\u5D5E", 10, "\u5D6A\u5D6D\u5D6E\u5D70\u5D71\u5D72\u5D73\u5D75", 12, "\u5D83", 21, "\u5D9A\u5D9B\u5D9C\u5D9E\u5D9F\u5DA0"], + ["8e40", "\u5DA1", 21, "\u5DB8", 12, "\u5DC6", 6, "\u5DCE", 12, "\u5DDC\u5DDF\u5DE0\u5DE3\u5DE4\u5DEA\u5DEC\u5DED"], + ["8e80", "\u5DF0\u5DF5\u5DF6\u5DF8", 4, "\u5DFF\u5E00\u5E04\u5E07\u5E09\u5E0A\u5E0B\u5E0D\u5E0E\u5E12\u5E13\u5E17\u5E1E", 7, "\u5E28", 4, "\u5E2F\u5E30\u5E32", 4, "\u5E39\u5E3A\u5E3E\u5E3F\u5E40\u5E41\u5E43\u5E46", 5, "\u5E4D", 6, "\u5E56", 4, "\u5E5C\u5E5D\u5E5F\u5E60\u5E63", 14, "\u5E75\u5E77\u5E79\u5E7E\u5E81\u5E82\u5E83\u5E85\u5E88\u5E89\u5E8C\u5E8D\u5E8E\u5E92\u5E98\u5E9B\u5E9D\u5EA1\u5EA2\u5EA3\u5EA4\u5EA8", 4, "\u5EAE", 4, "\u5EB4\u5EBA\u5EBB\u5EBC\u5EBD\u5EBF", 6], + ["8f40", "\u5EC6\u5EC7\u5EC8\u5ECB", 5, "\u5ED4\u5ED5\u5ED7\u5ED8\u5ED9\u5EDA\u5EDC", 11, "\u5EE9\u5EEB", 8, "\u5EF5\u5EF8\u5EF9\u5EFB\u5EFC\u5EFD\u5F05\u5F06\u5F07\u5F09\u5F0C\u5F0D\u5F0E\u5F10\u5F12\u5F14\u5F16\u5F19\u5F1A\u5F1C\u5F1D\u5F1E\u5F21\u5F22\u5F23\u5F24"], + ["8f80", "\u5F28\u5F2B\u5F2C\u5F2E\u5F30\u5F32", 6, "\u5F3B\u5F3D\u5F3E\u5F3F\u5F41", 14, "\u5F51\u5F54\u5F59\u5F5A\u5F5B\u5F5C\u5F5E\u5F5F\u5F60\u5F63\u5F65\u5F67\u5F68\u5F6B\u5F6E\u5F6F\u5F72\u5F74\u5F75\u5F76\u5F78\u5F7A\u5F7D\u5F7E\u5F7F\u5F83\u5F86\u5F8D\u5F8E\u5F8F\u5F91\u5F93\u5F94\u5F96\u5F9A\u5F9B\u5F9D\u5F9E\u5F9F\u5FA0\u5FA2", 5, "\u5FA9\u5FAB\u5FAC\u5FAF", 5, "\u5FB6\u5FB8\u5FB9\u5FBA\u5FBB\u5FBE", 4, "\u5FC7\u5FC8\u5FCA\u5FCB\u5FCE\u5FD3\u5FD4\u5FD5\u5FDA\u5FDB\u5FDC\u5FDE\u5FDF\u5FE2\u5FE3\u5FE5\u5FE6\u5FE8\u5FE9\u5FEC\u5FEF\u5FF0\u5FF2\u5FF3\u5FF4\u5FF6\u5FF7\u5FF9\u5FFA\u5FFC\u6007"], + ["9040", "\u6008\u6009\u600B\u600C\u6010\u6011\u6013\u6017\u6018\u601A\u601E\u601F\u6022\u6023\u6024\u602C\u602D\u602E\u6030", 4, "\u6036", 4, "\u603D\u603E\u6040\u6044", 6, "\u604C\u604E\u604F\u6051\u6053\u6054\u6056\u6057\u6058\u605B\u605C\u605E\u605F\u6060\u6061\u6065\u6066\u606E\u6071\u6072\u6074\u6075\u6077\u607E\u6080"], + ["9080", "\u6081\u6082\u6085\u6086\u6087\u6088\u608A\u608B\u608E\u608F\u6090\u6091\u6093\u6095\u6097\u6098\u6099\u609C\u609E\u60A1\u60A2\u60A4\u60A5\u60A7\u60A9\u60AA\u60AE\u60B0\u60B3\u60B5\u60B6\u60B7\u60B9\u60BA\u60BD", 7, "\u60C7\u60C8\u60C9\u60CC", 4, "\u60D2\u60D3\u60D4\u60D6\u60D7\u60D9\u60DB\u60DE\u60E1", 4, "\u60EA\u60F1\u60F2\u60F5\u60F7\u60F8\u60FB", 4, "\u6102\u6103\u6104\u6105\u6107\u610A\u610B\u610C\u6110", 4, "\u6116\u6117\u6118\u6119\u611B\u611C\u611D\u611E\u6121\u6122\u6125\u6128\u6129\u612A\u612C", 18, "\u6140", 6], + ["9140", "\u6147\u6149\u614B\u614D\u614F\u6150\u6152\u6153\u6154\u6156", 6, "\u615E\u615F\u6160\u6161\u6163\u6164\u6165\u6166\u6169", 6, "\u6171\u6172\u6173\u6174\u6176\u6178", 18, "\u618C\u618D\u618F", 4, "\u6195"], + ["9180", "\u6196", 6, "\u619E", 8, "\u61AA\u61AB\u61AD", 9, "\u61B8", 5, "\u61BF\u61C0\u61C1\u61C3", 4, "\u61C9\u61CC", 4, "\u61D3\u61D5", 16, "\u61E7", 13, "\u61F6", 8, "\u6200", 5, "\u6207\u6209\u6213\u6214\u6219\u621C\u621D\u621E\u6220\u6223\u6226\u6227\u6228\u6229\u622B\u622D\u622F\u6230\u6231\u6232\u6235\u6236\u6238", 4, "\u6242\u6244\u6245\u6246\u624A"], + ["9240", "\u624F\u6250\u6255\u6256\u6257\u6259\u625A\u625C", 6, "\u6264\u6265\u6268\u6271\u6272\u6274\u6275\u6277\u6278\u627A\u627B\u627D\u6281\u6282\u6283\u6285\u6286\u6287\u6288\u628B", 5, "\u6294\u6299\u629C\u629D\u629E\u62A3\u62A6\u62A7\u62A9\u62AA\u62AD\u62AE\u62AF\u62B0\u62B2\u62B3\u62B4\u62B6\u62B7\u62B8\u62BA\u62BE\u62C0\u62C1"], + ["9280", "\u62C3\u62CB\u62CF\u62D1\u62D5\u62DD\u62DE\u62E0\u62E1\u62E4\u62EA\u62EB\u62F0\u62F2\u62F5\u62F8\u62F9\u62FA\u62FB\u6300\u6303\u6304\u6305\u6306\u630A\u630B\u630C\u630D\u630F\u6310\u6312\u6313\u6314\u6315\u6317\u6318\u6319\u631C\u6326\u6327\u6329\u632C\u632D\u632E\u6330\u6331\u6333", 5, "\u633B\u633C\u633E\u633F\u6340\u6341\u6344\u6347\u6348\u634A\u6351\u6352\u6353\u6354\u6356", 7, "\u6360\u6364\u6365\u6366\u6368\u636A\u636B\u636C\u636F\u6370\u6372\u6373\u6374\u6375\u6378\u6379\u637C\u637D\u637E\u637F\u6381\u6383\u6384\u6385\u6386\u638B\u638D\u6391\u6393\u6394\u6395\u6397\u6399", 6, "\u63A1\u63A4\u63A6\u63AB\u63AF\u63B1\u63B2\u63B5\u63B6\u63B9\u63BB\u63BD\u63BF\u63C0"], + ["9340", "\u63C1\u63C2\u63C3\u63C5\u63C7\u63C8\u63CA\u63CB\u63CC\u63D1\u63D3\u63D4\u63D5\u63D7", 6, "\u63DF\u63E2\u63E4", 4, "\u63EB\u63EC\u63EE\u63EF\u63F0\u63F1\u63F3\u63F5\u63F7\u63F9\u63FA\u63FB\u63FC\u63FE\u6403\u6404\u6406", 4, "\u640D\u640E\u6411\u6412\u6415", 5, "\u641D\u641F\u6422\u6423\u6424"], + ["9380", "\u6425\u6427\u6428\u6429\u642B\u642E", 5, "\u6435", 4, "\u643B\u643C\u643E\u6440\u6442\u6443\u6449\u644B", 6, "\u6453\u6455\u6456\u6457\u6459", 4, "\u645F", 7, "\u6468\u646A\u646B\u646C\u646E", 9, "\u647B", 6, "\u6483\u6486\u6488", 8, "\u6493\u6494\u6497\u6498\u649A\u649B\u649C\u649D\u649F", 4, "\u64A5\u64A6\u64A7\u64A8\u64AA\u64AB\u64AF\u64B1\u64B2\u64B3\u64B4\u64B6\u64B9\u64BB\u64BD\u64BE\u64BF\u64C1\u64C3\u64C4\u64C6", 6, "\u64CF\u64D1\u64D3\u64D4\u64D5\u64D6\u64D9\u64DA"], + ["9440", "\u64DB\u64DC\u64DD\u64DF\u64E0\u64E1\u64E3\u64E5\u64E7", 24, "\u6501", 7, "\u650A", 7, "\u6513", 4, "\u6519", 8], + ["9480", "\u6522\u6523\u6524\u6526", 4, "\u652C\u652D\u6530\u6531\u6532\u6533\u6537\u653A\u653C\u653D\u6540", 4, "\u6546\u6547\u654A\u654B\u654D\u654E\u6550\u6552\u6553\u6554\u6557\u6558\u655A\u655C\u655F\u6560\u6561\u6564\u6565\u6567\u6568\u6569\u656A\u656D\u656E\u656F\u6571\u6573\u6575\u6576\u6578", 14, "\u6588\u6589\u658A\u658D\u658E\u658F\u6592\u6594\u6595\u6596\u6598\u659A\u659D\u659E\u65A0\u65A2\u65A3\u65A6\u65A8\u65AA\u65AC\u65AE\u65B1", 7, "\u65BA\u65BB\u65BE\u65BF\u65C0\u65C2\u65C7\u65C8\u65C9\u65CA\u65CD\u65D0\u65D1\u65D3\u65D4\u65D5\u65D8", 7, "\u65E1\u65E3\u65E4\u65EA\u65EB"], + ["9540", "\u65F2\u65F3\u65F4\u65F5\u65F8\u65F9\u65FB", 4, "\u6601\u6604\u6605\u6607\u6608\u6609\u660B\u660D\u6610\u6611\u6612\u6616\u6617\u6618\u661A\u661B\u661C\u661E\u6621\u6622\u6623\u6624\u6626\u6629\u662A\u662B\u662C\u662E\u6630\u6632\u6633\u6637", 4, "\u663D\u663F\u6640\u6642\u6644", 6, "\u664D\u664E\u6650\u6651\u6658"], + ["9580", "\u6659\u665B\u665C\u665D\u665E\u6660\u6662\u6663\u6665\u6667\u6669", 4, "\u6671\u6672\u6673\u6675\u6678\u6679\u667B\u667C\u667D\u667F\u6680\u6681\u6683\u6685\u6686\u6688\u6689\u668A\u668B\u668D\u668E\u668F\u6690\u6692\u6693\u6694\u6695\u6698", 4, "\u669E", 8, "\u66A9", 4, "\u66AF", 4, "\u66B5\u66B6\u66B7\u66B8\u66BA\u66BB\u66BC\u66BD\u66BF", 25, "\u66DA\u66DE", 7, "\u66E7\u66E8\u66EA", 5, "\u66F1\u66F5\u66F6\u66F8\u66FA\u66FB\u66FD\u6701\u6702\u6703"], + ["9640", "\u6704\u6705\u6706\u6707\u670C\u670E\u670F\u6711\u6712\u6713\u6716\u6718\u6719\u671A\u671C\u671E\u6720", 5, "\u6727\u6729\u672E\u6730\u6732\u6733\u6736\u6737\u6738\u6739\u673B\u673C\u673E\u673F\u6741\u6744\u6745\u6747\u674A\u674B\u674D\u6752\u6754\u6755\u6757", 4, "\u675D\u6762\u6763\u6764\u6766\u6767\u676B\u676C\u676E\u6771\u6774\u6776"], + ["9680", "\u6778\u6779\u677A\u677B\u677D\u6780\u6782\u6783\u6785\u6786\u6788\u678A\u678C\u678D\u678E\u678F\u6791\u6792\u6793\u6794\u6796\u6799\u679B\u679F\u67A0\u67A1\u67A4\u67A6\u67A9\u67AC\u67AE\u67B1\u67B2\u67B4\u67B9", 7, "\u67C2\u67C5", 9, "\u67D5\u67D6\u67D7\u67DB\u67DF\u67E1\u67E3\u67E4\u67E6\u67E7\u67E8\u67EA\u67EB\u67ED\u67EE\u67F2\u67F5", 7, "\u67FE\u6801\u6802\u6803\u6804\u6806\u680D\u6810\u6812\u6814\u6815\u6818", 4, "\u681E\u681F\u6820\u6822", 6, "\u682B", 6, "\u6834\u6835\u6836\u683A\u683B\u683F\u6847\u684B\u684D\u684F\u6852\u6856", 5], + ["9740", "\u685C\u685D\u685E\u685F\u686A\u686C", 7, "\u6875\u6878", 8, "\u6882\u6884\u6887", 7, "\u6890\u6891\u6892\u6894\u6895\u6896\u6898", 9, "\u68A3\u68A4\u68A5\u68A9\u68AA\u68AB\u68AC\u68AE\u68B1\u68B2\u68B4\u68B6\u68B7\u68B8"], + ["9780", "\u68B9", 6, "\u68C1\u68C3", 5, "\u68CA\u68CC\u68CE\u68CF\u68D0\u68D1\u68D3\u68D4\u68D6\u68D7\u68D9\u68DB", 4, "\u68E1\u68E2\u68E4", 9, "\u68EF\u68F2\u68F3\u68F4\u68F6\u68F7\u68F8\u68FB\u68FD\u68FE\u68FF\u6900\u6902\u6903\u6904\u6906", 4, "\u690C\u690F\u6911\u6913", 11, "\u6921\u6922\u6923\u6925", 7, "\u692E\u692F\u6931\u6932\u6933\u6935\u6936\u6937\u6938\u693A\u693B\u693C\u693E\u6940\u6941\u6943", 16, "\u6955\u6956\u6958\u6959\u695B\u695C\u695F"], + ["9840", "\u6961\u6962\u6964\u6965\u6967\u6968\u6969\u696A\u696C\u696D\u696F\u6970\u6972", 4, "\u697A\u697B\u697D\u697E\u697F\u6981\u6983\u6985\u698A\u698B\u698C\u698E", 5, "\u6996\u6997\u6999\u699A\u699D", 9, "\u69A9\u69AA\u69AC\u69AE\u69AF\u69B0\u69B2\u69B3\u69B5\u69B6\u69B8\u69B9\u69BA\u69BC\u69BD"], + ["9880", "\u69BE\u69BF\u69C0\u69C2", 7, "\u69CB\u69CD\u69CF\u69D1\u69D2\u69D3\u69D5", 5, "\u69DC\u69DD\u69DE\u69E1", 11, "\u69EE\u69EF\u69F0\u69F1\u69F3", 9, "\u69FE\u6A00", 9, "\u6A0B", 11, "\u6A19", 5, "\u6A20\u6A22", 5, "\u6A29\u6A2B\u6A2C\u6A2D\u6A2E\u6A30\u6A32\u6A33\u6A34\u6A36", 6, "\u6A3F", 4, "\u6A45\u6A46\u6A48", 7, "\u6A51", 6, "\u6A5A"], + ["9940", "\u6A5C", 4, "\u6A62\u6A63\u6A64\u6A66", 10, "\u6A72", 6, "\u6A7A\u6A7B\u6A7D\u6A7E\u6A7F\u6A81\u6A82\u6A83\u6A85", 8, "\u6A8F\u6A92", 4, "\u6A98", 7, "\u6AA1", 5], + ["9980", "\u6AA7\u6AA8\u6AAA\u6AAD", 114, "\u6B25\u6B26\u6B28", 6], + ["9a40", "\u6B2F\u6B30\u6B31\u6B33\u6B34\u6B35\u6B36\u6B38\u6B3B\u6B3C\u6B3D\u6B3F\u6B40\u6B41\u6B42\u6B44\u6B45\u6B48\u6B4A\u6B4B\u6B4D", 11, "\u6B5A", 7, "\u6B68\u6B69\u6B6B", 13, "\u6B7A\u6B7D\u6B7E\u6B7F\u6B80\u6B85\u6B88"], + ["9a80", "\u6B8C\u6B8E\u6B8F\u6B90\u6B91\u6B94\u6B95\u6B97\u6B98\u6B99\u6B9C", 4, "\u6BA2", 7, "\u6BAB", 7, "\u6BB6\u6BB8", 6, "\u6BC0\u6BC3\u6BC4\u6BC6", 4, "\u6BCC\u6BCE\u6BD0\u6BD1\u6BD8\u6BDA\u6BDC", 4, "\u6BE2", 7, "\u6BEC\u6BED\u6BEE\u6BF0\u6BF1\u6BF2\u6BF4\u6BF6\u6BF7\u6BF8\u6BFA\u6BFB\u6BFC\u6BFE", 6, "\u6C08", 4, "\u6C0E\u6C12\u6C17\u6C1C\u6C1D\u6C1E\u6C20\u6C23\u6C25\u6C2B\u6C2C\u6C2D\u6C31\u6C33\u6C36\u6C37\u6C39\u6C3A\u6C3B\u6C3C\u6C3E\u6C3F\u6C43\u6C44\u6C45\u6C48\u6C4B", 4, "\u6C51\u6C52\u6C53\u6C56\u6C58"], + ["9b40", "\u6C59\u6C5A\u6C62\u6C63\u6C65\u6C66\u6C67\u6C6B", 4, "\u6C71\u6C73\u6C75\u6C77\u6C78\u6C7A\u6C7B\u6C7C\u6C7F\u6C80\u6C84\u6C87\u6C8A\u6C8B\u6C8D\u6C8E\u6C91\u6C92\u6C95\u6C96\u6C97\u6C98\u6C9A\u6C9C\u6C9D\u6C9E\u6CA0\u6CA2\u6CA8\u6CAC\u6CAF\u6CB0\u6CB4\u6CB5\u6CB6\u6CB7\u6CBA\u6CC0\u6CC1\u6CC2\u6CC3\u6CC6\u6CC7\u6CC8\u6CCB\u6CCD\u6CCE\u6CCF\u6CD1\u6CD2\u6CD8"], + ["9b80", "\u6CD9\u6CDA\u6CDC\u6CDD\u6CDF\u6CE4\u6CE6\u6CE7\u6CE9\u6CEC\u6CED\u6CF2\u6CF4\u6CF9\u6CFF\u6D00\u6D02\u6D03\u6D05\u6D06\u6D08\u6D09\u6D0A\u6D0D\u6D0F\u6D10\u6D11\u6D13\u6D14\u6D15\u6D16\u6D18\u6D1C\u6D1D\u6D1F", 5, "\u6D26\u6D28\u6D29\u6D2C\u6D2D\u6D2F\u6D30\u6D34\u6D36\u6D37\u6D38\u6D3A\u6D3F\u6D40\u6D42\u6D44\u6D49\u6D4C\u6D50\u6D55\u6D56\u6D57\u6D58\u6D5B\u6D5D\u6D5F\u6D61\u6D62\u6D64\u6D65\u6D67\u6D68\u6D6B\u6D6C\u6D6D\u6D70\u6D71\u6D72\u6D73\u6D75\u6D76\u6D79\u6D7A\u6D7B\u6D7D", 4, "\u6D83\u6D84\u6D86\u6D87\u6D8A\u6D8B\u6D8D\u6D8F\u6D90\u6D92\u6D96", 4, "\u6D9C\u6DA2\u6DA5\u6DAC\u6DAD\u6DB0\u6DB1\u6DB3\u6DB4\u6DB6\u6DB7\u6DB9", 5, "\u6DC1\u6DC2\u6DC3\u6DC8\u6DC9\u6DCA"], + ["9c40", "\u6DCD\u6DCE\u6DCF\u6DD0\u6DD2\u6DD3\u6DD4\u6DD5\u6DD7\u6DDA\u6DDB\u6DDC\u6DDF\u6DE2\u6DE3\u6DE5\u6DE7\u6DE8\u6DE9\u6DEA\u6DED\u6DEF\u6DF0\u6DF2\u6DF4\u6DF5\u6DF6\u6DF8\u6DFA\u6DFD", 7, "\u6E06\u6E07\u6E08\u6E09\u6E0B\u6E0F\u6E12\u6E13\u6E15\u6E18\u6E19\u6E1B\u6E1C\u6E1E\u6E1F\u6E22\u6E26\u6E27\u6E28\u6E2A\u6E2C\u6E2E\u6E30\u6E31\u6E33\u6E35"], + ["9c80", "\u6E36\u6E37\u6E39\u6E3B", 7, "\u6E45", 7, "\u6E4F\u6E50\u6E51\u6E52\u6E55\u6E57\u6E59\u6E5A\u6E5C\u6E5D\u6E5E\u6E60", 10, "\u6E6C\u6E6D\u6E6F", 14, "\u6E80\u6E81\u6E82\u6E84\u6E87\u6E88\u6E8A", 4, "\u6E91", 6, "\u6E99\u6E9A\u6E9B\u6E9D\u6E9E\u6EA0\u6EA1\u6EA3\u6EA4\u6EA6\u6EA8\u6EA9\u6EAB\u6EAC\u6EAD\u6EAE\u6EB0\u6EB3\u6EB5\u6EB8\u6EB9\u6EBC\u6EBE\u6EBF\u6EC0\u6EC3\u6EC4\u6EC5\u6EC6\u6EC8\u6EC9\u6ECA\u6ECC\u6ECD\u6ECE\u6ED0\u6ED2\u6ED6\u6ED8\u6ED9\u6EDB\u6EDC\u6EDD\u6EE3\u6EE7\u6EEA", 5], + ["9d40", "\u6EF0\u6EF1\u6EF2\u6EF3\u6EF5\u6EF6\u6EF7\u6EF8\u6EFA", 7, "\u6F03\u6F04\u6F05\u6F07\u6F08\u6F0A", 4, "\u6F10\u6F11\u6F12\u6F16", 9, "\u6F21\u6F22\u6F23\u6F25\u6F26\u6F27\u6F28\u6F2C\u6F2E\u6F30\u6F32\u6F34\u6F35\u6F37", 6, "\u6F3F\u6F40\u6F41\u6F42"], + ["9d80", "\u6F43\u6F44\u6F45\u6F48\u6F49\u6F4A\u6F4C\u6F4E", 9, "\u6F59\u6F5A\u6F5B\u6F5D\u6F5F\u6F60\u6F61\u6F63\u6F64\u6F65\u6F67", 5, "\u6F6F\u6F70\u6F71\u6F73\u6F75\u6F76\u6F77\u6F79\u6F7B\u6F7D", 6, "\u6F85\u6F86\u6F87\u6F8A\u6F8B\u6F8F", 12, "\u6F9D\u6F9E\u6F9F\u6FA0\u6FA2", 4, "\u6FA8", 10, "\u6FB4\u6FB5\u6FB7\u6FB8\u6FBA", 5, "\u6FC1\u6FC3", 5, "\u6FCA", 6, "\u6FD3", 10, "\u6FDF\u6FE2\u6FE3\u6FE4\u6FE5"], + ["9e40", "\u6FE6", 7, "\u6FF0", 32, "\u7012", 7, "\u701C", 6, "\u7024", 6], + ["9e80", "\u702B", 9, "\u7036\u7037\u7038\u703A", 17, "\u704D\u704E\u7050", 13, "\u705F", 11, "\u706E\u7071\u7072\u7073\u7074\u7077\u7079\u707A\u707B\u707D\u7081\u7082\u7083\u7084\u7086\u7087\u7088\u708B\u708C\u708D\u708F\u7090\u7091\u7093\u7097\u7098\u709A\u709B\u709E", 12, "\u70B0\u70B2\u70B4\u70B5\u70B6\u70BA\u70BE\u70BF\u70C4\u70C5\u70C6\u70C7\u70C9\u70CB", 12, "\u70DA"], + ["9f40", "\u70DC\u70DD\u70DE\u70E0\u70E1\u70E2\u70E3\u70E5\u70EA\u70EE\u70F0", 6, "\u70F8\u70FA\u70FB\u70FC\u70FE", 10, "\u710B", 4, "\u7111\u7112\u7114\u7117\u711B", 10, "\u7127", 7, "\u7132\u7133\u7134"], + ["9f80", "\u7135\u7137", 13, "\u7146\u7147\u7148\u7149\u714B\u714D\u714F", 12, "\u715D\u715F", 4, "\u7165\u7169", 4, "\u716F\u7170\u7171\u7174\u7175\u7176\u7177\u7179\u717B\u717C\u717E", 5, "\u7185", 4, "\u718B\u718C\u718D\u718E\u7190\u7191\u7192\u7193\u7195\u7196\u7197\u719A", 4, "\u71A1", 6, "\u71A9\u71AA\u71AB\u71AD", 5, "\u71B4\u71B6\u71B7\u71B8\u71BA", 8, "\u71C4", 9, "\u71CF", 4], + ["a040", "\u71D6", 9, "\u71E1\u71E2\u71E3\u71E4\u71E6\u71E8", 5, "\u71EF", 9, "\u71FA", 11, "\u7207", 19], + ["a080", "\u721B\u721C\u721E", 9, "\u7229\u722B\u722D\u722E\u722F\u7232\u7233\u7234\u723A\u723C\u723E\u7240", 6, "\u7249\u724A\u724B\u724E\u724F\u7250\u7251\u7253\u7254\u7255\u7257\u7258\u725A\u725C\u725E\u7260\u7263\u7264\u7265\u7268\u726A\u726B\u726C\u726D\u7270\u7271\u7273\u7274\u7276\u7277\u7278\u727B\u727C\u727D\u7282\u7283\u7285", 4, "\u728C\u728E\u7290\u7291\u7293", 11, "\u72A0", 11, "\u72AE\u72B1\u72B2\u72B3\u72B5\u72BA", 6, "\u72C5\u72C6\u72C7\u72C9\u72CA\u72CB\u72CC\u72CF\u72D1\u72D3\u72D4\u72D5\u72D6\u72D8\u72DA\u72DB"], + ["a1a1", "\u3000\u3001\u3002\xB7\u02C9\u02C7\xA8\u3003\u3005\u2014\uFF5E\u2016\u2026\u2018\u2019\u201C\u201D\u3014\u3015\u3008", 7, "\u3016\u3017\u3010\u3011\xB1\xD7\xF7\u2236\u2227\u2228\u2211\u220F\u222A\u2229\u2208\u2237\u221A\u22A5\u2225\u2220\u2312\u2299\u222B\u222E\u2261\u224C\u2248\u223D\u221D\u2260\u226E\u226F\u2264\u2265\u221E\u2235\u2234\u2642\u2640\xB0\u2032\u2033\u2103\uFF04\xA4\uFFE0\uFFE1\u2030\xA7\u2116\u2606\u2605\u25CB\u25CF\u25CE\u25C7\u25C6\u25A1\u25A0\u25B3\u25B2\u203B\u2192\u2190\u2191\u2193\u3013"], + ["a2a1", "\u2170", 9], + ["a2b1", "\u2488", 19, "\u2474", 19, "\u2460", 9], + ["a2e5", "\u3220", 9], + ["a2f1", "\u2160", 11], + ["a3a1", "\uFF01\uFF02\uFF03\uFFE5\uFF05", 88, "\uFFE3"], + ["a4a1", "\u3041", 82], + ["a5a1", "\u30A1", 85], + ["a6a1", "\u0391", 16, "\u03A3", 6], + ["a6c1", "\u03B1", 16, "\u03C3", 6], + ["a6e0", "\uFE35\uFE36\uFE39\uFE3A\uFE3F\uFE40\uFE3D\uFE3E\uFE41\uFE42\uFE43\uFE44"], + ["a6ee", "\uFE3B\uFE3C\uFE37\uFE38\uFE31"], + ["a6f4", "\uFE33\uFE34"], + ["a7a1", "\u0410", 5, "\u0401\u0416", 25], + ["a7d1", "\u0430", 5, "\u0451\u0436", 25], + ["a840", "\u02CA\u02CB\u02D9\u2013\u2015\u2025\u2035\u2105\u2109\u2196\u2197\u2198\u2199\u2215\u221F\u2223\u2252\u2266\u2267\u22BF\u2550", 35, "\u2581", 6], + ["a880", "\u2588", 7, "\u2593\u2594\u2595\u25BC\u25BD\u25E2\u25E3\u25E4\u25E5\u2609\u2295\u3012\u301D\u301E"], + ["a8a1", "\u0101\xE1\u01CE\xE0\u0113\xE9\u011B\xE8\u012B\xED\u01D0\xEC\u014D\xF3\u01D2\xF2\u016B\xFA\u01D4\xF9\u01D6\u01D8\u01DA\u01DC\xFC\xEA\u0251"], + ["a8bd", "\u0144\u0148"], + ["a8c0", "\u0261"], + ["a8c5", "\u3105", 36], + ["a940", "\u3021", 8, "\u32A3\u338E\u338F\u339C\u339D\u339E\u33A1\u33C4\u33CE\u33D1\u33D2\u33D5\uFE30\uFFE2\uFFE4"], + ["a959", "\u2121\u3231"], + ["a95c", "\u2010"], + ["a960", "\u30FC\u309B\u309C\u30FD\u30FE\u3006\u309D\u309E\uFE49", 9, "\uFE54\uFE55\uFE56\uFE57\uFE59", 8], + ["a980", "\uFE62", 4, "\uFE68\uFE69\uFE6A\uFE6B"], + ["a996", "\u3007"], + ["a9a4", "\u2500", 75], + ["aa40", "\u72DC\u72DD\u72DF\u72E2", 5, "\u72EA\u72EB\u72F5\u72F6\u72F9\u72FD\u72FE\u72FF\u7300\u7302\u7304", 5, "\u730B\u730C\u730D\u730F\u7310\u7311\u7312\u7314\u7318\u7319\u731A\u731F\u7320\u7323\u7324\u7326\u7327\u7328\u732D\u732F\u7330\u7332\u7333\u7335\u7336\u733A\u733B\u733C\u733D\u7340", 8], + ["aa80", "\u7349\u734A\u734B\u734C\u734E\u734F\u7351\u7353\u7354\u7355\u7356\u7358", 7, "\u7361", 10, "\u736E\u7370\u7371"], + ["ab40", "\u7372", 11, "\u737F", 4, "\u7385\u7386\u7388\u738A\u738C\u738D\u738F\u7390\u7392\u7393\u7394\u7395\u7397\u7398\u7399\u739A\u739C\u739D\u739E\u73A0\u73A1\u73A3", 5, "\u73AA\u73AC\u73AD\u73B1\u73B4\u73B5\u73B6\u73B8\u73B9\u73BC\u73BD\u73BE\u73BF\u73C1\u73C3", 4], + ["ab80", "\u73CB\u73CC\u73CE\u73D2", 6, "\u73DA\u73DB\u73DC\u73DD\u73DF\u73E1\u73E2\u73E3\u73E4\u73E6\u73E8\u73EA\u73EB\u73EC\u73EE\u73EF\u73F0\u73F1\u73F3", 4], + ["ac40", "\u73F8", 10, "\u7404\u7407\u7408\u740B\u740C\u740D\u740E\u7411", 8, "\u741C", 5, "\u7423\u7424\u7427\u7429\u742B\u742D\u742F\u7431\u7432\u7437", 4, "\u743D\u743E\u743F\u7440\u7442", 11], + ["ac80", "\u744E", 6, "\u7456\u7458\u745D\u7460", 12, "\u746E\u746F\u7471", 4, "\u7478\u7479\u747A"], + ["ad40", "\u747B\u747C\u747D\u747F\u7482\u7484\u7485\u7486\u7488\u7489\u748A\u748C\u748D\u748F\u7491", 10, "\u749D\u749F", 7, "\u74AA", 15, "\u74BB", 12], + ["ad80", "\u74C8", 9, "\u74D3", 8, "\u74DD\u74DF\u74E1\u74E5\u74E7", 6, "\u74F0\u74F1\u74F2"], + ["ae40", "\u74F3\u74F5\u74F8", 6, "\u7500\u7501\u7502\u7503\u7505", 7, "\u750E\u7510\u7512\u7514\u7515\u7516\u7517\u751B\u751D\u751E\u7520", 4, "\u7526\u7527\u752A\u752E\u7534\u7536\u7539\u753C\u753D\u753F\u7541\u7542\u7543\u7544\u7546\u7547\u7549\u754A\u754D\u7550\u7551\u7552\u7553\u7555\u7556\u7557\u7558"], + ["ae80", "\u755D", 7, "\u7567\u7568\u7569\u756B", 6, "\u7573\u7575\u7576\u7577\u757A", 4, "\u7580\u7581\u7582\u7584\u7585\u7587"], + ["af40", "\u7588\u7589\u758A\u758C\u758D\u758E\u7590\u7593\u7595\u7598\u759B\u759C\u759E\u75A2\u75A6", 4, "\u75AD\u75B6\u75B7\u75BA\u75BB\u75BF\u75C0\u75C1\u75C6\u75CB\u75CC\u75CE\u75CF\u75D0\u75D1\u75D3\u75D7\u75D9\u75DA\u75DC\u75DD\u75DF\u75E0\u75E1\u75E5\u75E9\u75EC\u75ED\u75EE\u75EF\u75F2\u75F3\u75F5\u75F6\u75F7\u75F8\u75FA\u75FB\u75FD\u75FE\u7602\u7604\u7606\u7607"], + ["af80", "\u7608\u7609\u760B\u760D\u760E\u760F\u7611\u7612\u7613\u7614\u7616\u761A\u761C\u761D\u761E\u7621\u7623\u7627\u7628\u762C\u762E\u762F\u7631\u7632\u7636\u7637\u7639\u763A\u763B\u763D\u7641\u7642\u7644"], + ["b040", "\u7645", 6, "\u764E", 5, "\u7655\u7657", 4, "\u765D\u765F\u7660\u7661\u7662\u7664", 6, "\u766C\u766D\u766E\u7670", 7, "\u7679\u767A\u767C\u767F\u7680\u7681\u7683\u7685\u7689\u768A\u768C\u768D\u768F\u7690\u7692\u7694\u7695\u7697\u7698\u769A\u769B"], + ["b080", "\u769C", 7, "\u76A5", 8, "\u76AF\u76B0\u76B3\u76B5", 9, "\u76C0\u76C1\u76C3\u554A\u963F\u57C3\u6328\u54CE\u5509\u54C0\u7691\u764C\u853C\u77EE\u827E\u788D\u7231\u9698\u978D\u6C28\u5B89\u4FFA\u6309\u6697\u5CB8\u80FA\u6848\u80AE\u6602\u76CE\u51F9\u6556\u71AC\u7FF1\u8884\u50B2\u5965\u61CA\u6FB3\u82AD\u634C\u6252\u53ED\u5427\u7B06\u516B\u75A4\u5DF4\u62D4\u8DCB\u9776\u628A\u8019\u575D\u9738\u7F62\u7238\u767D\u67CF\u767E\u6446\u4F70\u8D25\u62DC\u7A17\u6591\u73ED\u642C\u6273\u822C\u9881\u677F\u7248\u626E\u62CC\u4F34\u74E3\u534A\u529E\u7ECA\u90A6\u5E2E\u6886\u699C\u8180\u7ED1\u68D2\u78C5\u868C\u9551\u508D\u8C24\u82DE\u80DE\u5305\u8912\u5265"], + ["b140", "\u76C4\u76C7\u76C9\u76CB\u76CC\u76D3\u76D5\u76D9\u76DA\u76DC\u76DD\u76DE\u76E0", 4, "\u76E6", 7, "\u76F0\u76F3\u76F5\u76F6\u76F7\u76FA\u76FB\u76FD\u76FF\u7700\u7702\u7703\u7705\u7706\u770A\u770C\u770E", 10, "\u771B\u771C\u771D\u771E\u7721\u7723\u7724\u7725\u7727\u772A\u772B"], + ["b180", "\u772C\u772E\u7730", 4, "\u7739\u773B\u773D\u773E\u773F\u7742\u7744\u7745\u7746\u7748", 7, "\u7752", 7, "\u775C\u8584\u96F9\u4FDD\u5821\u9971\u5B9D\u62B1\u62A5\u66B4\u8C79\u9C8D\u7206\u676F\u7891\u60B2\u5351\u5317\u8F88\u80CC\u8D1D\u94A1\u500D\u72C8\u5907\u60EB\u7119\u88AB\u5954\u82EF\u672C\u7B28\u5D29\u7EF7\u752D\u6CF5\u8E66\u8FF8\u903C\u9F3B\u6BD4\u9119\u7B14\u5F7C\u78A7\u84D6\u853D\u6BD5\u6BD9\u6BD6\u5E01\u5E87\u75F9\u95ED\u655D\u5F0A\u5FC5\u8F9F\u58C1\u81C2\u907F\u965B\u97AD\u8FB9\u7F16\u8D2C\u6241\u4FBF\u53D8\u535E\u8FA8\u8FA9\u8FAB\u904D\u6807\u5F6A\u8198\u8868\u9CD6\u618B\u522B\u762A\u5F6C\u658C\u6FD2\u6EE8\u5BBE\u6448\u5175\u51B0\u67C4\u4E19\u79C9\u997C\u70B3"], + ["b240", "\u775D\u775E\u775F\u7760\u7764\u7767\u7769\u776A\u776D", 11, "\u777A\u777B\u777C\u7781\u7782\u7783\u7786", 5, "\u778F\u7790\u7793", 11, "\u77A1\u77A3\u77A4\u77A6\u77A8\u77AB\u77AD\u77AE\u77AF\u77B1\u77B2\u77B4\u77B6", 4], + ["b280", "\u77BC\u77BE\u77C0", 12, "\u77CE", 8, "\u77D8\u77D9\u77DA\u77DD", 4, "\u77E4\u75C5\u5E76\u73BB\u83E0\u64AD\u62E8\u94B5\u6CE2\u535A\u52C3\u640F\u94C2\u7B94\u4F2F\u5E1B\u8236\u8116\u818A\u6E24\u6CCA\u9A73\u6355\u535C\u54FA\u8865\u57E0\u4E0D\u5E03\u6B65\u7C3F\u90E8\u6016\u64E6\u731C\u88C1\u6750\u624D\u8D22\u776C\u8E29\u91C7\u5F69\u83DC\u8521\u9910\u53C2\u8695\u6B8B\u60ED\u60E8\u707F\u82CD\u8231\u4ED3\u6CA7\u85CF\u64CD\u7CD9\u69FD\u66F9\u8349\u5395\u7B56\u4FA7\u518C\u6D4B\u5C42\u8E6D\u63D2\u53C9\u832C\u8336\u67E5\u78B4\u643D\u5BDF\u5C94\u5DEE\u8BE7\u62C6\u67F4\u8C7A\u6400\u63BA\u8749\u998B\u8C17\u7F20\u94F2\u4EA7\u9610\u98A4\u660C\u7316"], + ["b340", "\u77E6\u77E8\u77EA\u77EF\u77F0\u77F1\u77F2\u77F4\u77F5\u77F7\u77F9\u77FA\u77FB\u77FC\u7803", 5, "\u780A\u780B\u780E\u780F\u7810\u7813\u7815\u7819\u781B\u781E\u7820\u7821\u7822\u7824\u7828\u782A\u782B\u782E\u782F\u7831\u7832\u7833\u7835\u7836\u783D\u783F\u7841\u7842\u7843\u7844\u7846\u7848\u7849\u784A\u784B\u784D\u784F\u7851\u7853\u7854\u7858\u7859\u785A"], + ["b380", "\u785B\u785C\u785E", 11, "\u786F", 7, "\u7878\u7879\u787A\u787B\u787D", 6, "\u573A\u5C1D\u5E38\u957F\u507F\u80A0\u5382\u655E\u7545\u5531\u5021\u8D85\u6284\u949E\u671D\u5632\u6F6E\u5DE2\u5435\u7092\u8F66\u626F\u64A4\u63A3\u5F7B\u6F88\u90F4\u81E3\u8FB0\u5C18\u6668\u5FF1\u6C89\u9648\u8D81\u886C\u6491\u79F0\u57CE\u6A59\u6210\u5448\u4E58\u7A0B\u60E9\u6F84\u8BDA\u627F\u901E\u9A8B\u79E4\u5403\u75F4\u6301\u5319\u6C60\u8FDF\u5F1B\u9A70\u803B\u9F7F\u4F88\u5C3A\u8D64\u7FC5\u65A5\u70BD\u5145\u51B2\u866B\u5D07\u5BA0\u62BD\u916C\u7574\u8E0C\u7A20\u6101\u7B79\u4EC7\u7EF8\u7785\u4E11\u81ED\u521D\u51FA\u6A71\u53A8\u8E87\u9504\u96CF\u6EC1\u9664\u695A"], + ["b440", "\u7884\u7885\u7886\u7888\u788A\u788B\u788F\u7890\u7892\u7894\u7895\u7896\u7899\u789D\u789E\u78A0\u78A2\u78A4\u78A6\u78A8", 7, "\u78B5\u78B6\u78B7\u78B8\u78BA\u78BB\u78BC\u78BD\u78BF\u78C0\u78C2\u78C3\u78C4\u78C6\u78C7\u78C8\u78CC\u78CD\u78CE\u78CF\u78D1\u78D2\u78D3\u78D6\u78D7\u78D8\u78DA", 9], + ["b480", "\u78E4\u78E5\u78E6\u78E7\u78E9\u78EA\u78EB\u78ED", 4, "\u78F3\u78F5\u78F6\u78F8\u78F9\u78FB", 5, "\u7902\u7903\u7904\u7906", 6, "\u7840\u50A8\u77D7\u6410\u89E6\u5904\u63E3\u5DDD\u7A7F\u693D\u4F20\u8239\u5598\u4E32\u75AE\u7A97\u5E62\u5E8A\u95EF\u521B\u5439\u708A\u6376\u9524\u5782\u6625\u693F\u9187\u5507\u6DF3\u7EAF\u8822\u6233\u7EF0\u75B5\u8328\u78C1\u96CC\u8F9E\u6148\u74F7\u8BCD\u6B64\u523A\u8D50\u6B21\u806A\u8471\u56F1\u5306\u4ECE\u4E1B\u51D1\u7C97\u918B\u7C07\u4FC3\u8E7F\u7BE1\u7A9C\u6467\u5D14\u50AC\u8106\u7601\u7CB9\u6DEC\u7FE0\u6751\u5B58\u5BF8\u78CB\u64AE\u6413\u63AA\u632B\u9519\u642D\u8FBE\u7B54\u7629\u6253\u5927\u5446\u6B79\u50A3\u6234\u5E26\u6B86\u4EE3\u8D37\u888B\u5F85\u902E"], + ["b540", "\u790D", 5, "\u7914", 9, "\u791F", 4, "\u7925", 14, "\u7935", 4, "\u793D\u793F\u7942\u7943\u7944\u7945\u7947\u794A", 8, "\u7954\u7955\u7958\u7959\u7961\u7963"], + ["b580", "\u7964\u7966\u7969\u796A\u796B\u796C\u796E\u7970", 6, "\u7979\u797B", 4, "\u7982\u7983\u7986\u7987\u7988\u7989\u798B\u798C\u798D\u798E\u7990\u7991\u7992\u6020\u803D\u62C5\u4E39\u5355\u90F8\u63B8\u80C6\u65E6\u6C2E\u4F46\u60EE\u6DE1\u8BDE\u5F39\u86CB\u5F53\u6321\u515A\u8361\u6863\u5200\u6363\u8E48\u5012\u5C9B\u7977\u5BFC\u5230\u7A3B\u60BC\u9053\u76D7\u5FB7\u5F97\u7684\u8E6C\u706F\u767B\u7B49\u77AA\u51F3\u9093\u5824\u4F4E\u6EF4\u8FEA\u654C\u7B1B\u72C4\u6DA4\u7FDF\u5AE1\u62B5\u5E95\u5730\u8482\u7B2C\u5E1D\u5F1F\u9012\u7F14\u98A0\u6382\u6EC7\u7898\u70B9\u5178\u975B\u57AB\u7535\u4F43\u7538\u5E97\u60E6\u5960\u6DC0\u6BBF\u7889\u53FC\u96D5\u51CB\u5201\u6389\u540A\u9493\u8C03\u8DCC\u7239\u789F\u8776\u8FED\u8C0D\u53E0"], + ["b640", "\u7993", 6, "\u799B", 11, "\u79A8", 10, "\u79B4", 4, "\u79BC\u79BF\u79C2\u79C4\u79C5\u79C7\u79C8\u79CA\u79CC\u79CE\u79CF\u79D0\u79D3\u79D4\u79D6\u79D7\u79D9", 5, "\u79E0\u79E1\u79E2\u79E5\u79E8\u79EA"], + ["b680", "\u79EC\u79EE\u79F1", 6, "\u79F9\u79FA\u79FC\u79FE\u79FF\u7A01\u7A04\u7A05\u7A07\u7A08\u7A09\u7A0A\u7A0C\u7A0F", 4, "\u7A15\u7A16\u7A18\u7A19\u7A1B\u7A1C\u4E01\u76EF\u53EE\u9489\u9876\u9F0E\u952D\u5B9A\u8BA2\u4E22\u4E1C\u51AC\u8463\u61C2\u52A8\u680B\u4F97\u606B\u51BB\u6D1E\u515C\u6296\u6597\u9661\u8C46\u9017\u75D8\u90FD\u7763\u6BD2\u728A\u72EC\u8BFB\u5835\u7779\u8D4C\u675C\u9540\u809A\u5EA6\u6E21\u5992\u7AEF\u77ED\u953B\u6BB5\u65AD\u7F0E\u5806\u5151\u961F\u5BF9\u58A9\u5428\u8E72\u6566\u987F\u56E4\u949D\u76FE\u9041\u6387\u54C6\u591A\u593A\u579B\u8EB2\u6735\u8DFA\u8235\u5241\u60F0\u5815\u86FE\u5CE8\u9E45\u4FC4\u989D\u8BB9\u5A25\u6076\u5384\u627C\u904F\u9102\u997F\u6069\u800C\u513F\u8033\u5C14\u9975\u6D31\u4E8C"], + ["b740", "\u7A1D\u7A1F\u7A21\u7A22\u7A24", 14, "\u7A34\u7A35\u7A36\u7A38\u7A3A\u7A3E\u7A40", 5, "\u7A47", 9, "\u7A52", 4, "\u7A58", 16], + ["b780", "\u7A69", 6, "\u7A71\u7A72\u7A73\u7A75\u7A7B\u7A7C\u7A7D\u7A7E\u7A82\u7A85\u7A87\u7A89\u7A8A\u7A8B\u7A8C\u7A8E\u7A8F\u7A90\u7A93\u7A94\u7A99\u7A9A\u7A9B\u7A9E\u7AA1\u7AA2\u8D30\u53D1\u7F5A\u7B4F\u4F10\u4E4F\u9600\u6CD5\u73D0\u85E9\u5E06\u756A\u7FFB\u6A0A\u77FE\u9492\u7E41\u51E1\u70E6\u53CD\u8FD4\u8303\u8D29\u72AF\u996D\u6CDB\u574A\u82B3\u65B9\u80AA\u623F\u9632\u59A8\u4EFF\u8BBF\u7EBA\u653E\u83F2\u975E\u5561\u98DE\u80A5\u532A\u8BFD\u5420\u80BA\u5E9F\u6CB8\u8D39\u82AC\u915A\u5429\u6C1B\u5206\u7EB7\u575F\u711A\u6C7E\u7C89\u594B\u4EFD\u5FFF\u6124\u7CAA\u4E30\u5C01\u67AB\u8702\u5CF0\u950B\u98CE\u75AF\u70FD\u9022\u51AF\u7F1D\u8BBD\u5949\u51E4\u4F5B\u5426\u592B\u6577\u80A4\u5B75\u6276\u62C2\u8F90\u5E45\u6C1F\u7B26\u4F0F\u4FD8\u670D"], + ["b840", "\u7AA3\u7AA4\u7AA7\u7AA9\u7AAA\u7AAB\u7AAE", 4, "\u7AB4", 10, "\u7AC0", 10, "\u7ACC", 9, "\u7AD7\u7AD8\u7ADA\u7ADB\u7ADC\u7ADD\u7AE1\u7AE2\u7AE4\u7AE7", 5, "\u7AEE\u7AF0\u7AF1\u7AF2\u7AF3"], + ["b880", "\u7AF4", 4, "\u7AFB\u7AFC\u7AFE\u7B00\u7B01\u7B02\u7B05\u7B07\u7B09\u7B0C\u7B0D\u7B0E\u7B10\u7B12\u7B13\u7B16\u7B17\u7B18\u7B1A\u7B1C\u7B1D\u7B1F\u7B21\u7B22\u7B23\u7B27\u7B29\u7B2D\u6D6E\u6DAA\u798F\u88B1\u5F17\u752B\u629A\u8F85\u4FEF\u91DC\u65A7\u812F\u8151\u5E9C\u8150\u8D74\u526F\u8986\u8D4B\u590D\u5085\u4ED8\u961C\u7236\u8179\u8D1F\u5BCC\u8BA3\u9644\u5987\u7F1A\u5490\u5676\u560E\u8BE5\u6539\u6982\u9499\u76D6\u6E89\u5E72\u7518\u6746\u67D1\u7AFF\u809D\u8D76\u611F\u79C6\u6562\u8D63\u5188\u521A\u94A2\u7F38\u809B\u7EB2\u5C97\u6E2F\u6760\u7BD9\u768B\u9AD8\u818F\u7F94\u7CD5\u641E\u9550\u7A3F\u544A\u54E5\u6B4C\u6401\u6208\u9E3D\u80F3\u7599\u5272\u9769\u845B\u683C\u86E4\u9601\u9694\u94EC\u4E2A\u5404\u7ED9\u6839\u8DDF\u8015\u66F4\u5E9A\u7FB9"], + ["b940", "\u7B2F\u7B30\u7B32\u7B34\u7B35\u7B36\u7B37\u7B39\u7B3B\u7B3D\u7B3F", 5, "\u7B46\u7B48\u7B4A\u7B4D\u7B4E\u7B53\u7B55\u7B57\u7B59\u7B5C\u7B5E\u7B5F\u7B61\u7B63", 10, "\u7B6F\u7B70\u7B73\u7B74\u7B76\u7B78\u7B7A\u7B7C\u7B7D\u7B7F\u7B81\u7B82\u7B83\u7B84\u7B86", 6, "\u7B8E\u7B8F"], + ["b980", "\u7B91\u7B92\u7B93\u7B96\u7B98\u7B99\u7B9A\u7B9B\u7B9E\u7B9F\u7BA0\u7BA3\u7BA4\u7BA5\u7BAE\u7BAF\u7BB0\u7BB2\u7BB3\u7BB5\u7BB6\u7BB7\u7BB9", 7, "\u7BC2\u7BC3\u7BC4\u57C2\u803F\u6897\u5DE5\u653B\u529F\u606D\u9F9A\u4F9B\u8EAC\u516C\u5BAB\u5F13\u5DE9\u6C5E\u62F1\u8D21\u5171\u94A9\u52FE\u6C9F\u82DF\u72D7\u57A2\u6784\u8D2D\u591F\u8F9C\u83C7\u5495\u7B8D\u4F30\u6CBD\u5B64\u59D1\u9F13\u53E4\u86CA\u9AA8\u8C37\u80A1\u6545\u987E\u56FA\u96C7\u522E\u74DC\u5250\u5BE1\u6302\u8902\u4E56\u62D0\u602A\u68FA\u5173\u5B98\u51A0\u89C2\u7BA1\u9986\u7F50\u60EF\u704C\u8D2F\u5149\u5E7F\u901B\u7470\u89C4\u572D\u7845\u5F52\u9F9F\u95FA\u8F68\u9B3C\u8BE1\u7678\u6842\u67DC\u8DEA\u8D35\u523D\u8F8A\u6EDA\u68CD\u9505\u90ED\u56FD\u679C\u88F9\u8FC7\u54C8"], + ["ba40", "\u7BC5\u7BC8\u7BC9\u7BCA\u7BCB\u7BCD\u7BCE\u7BCF\u7BD0\u7BD2\u7BD4", 4, "\u7BDB\u7BDC\u7BDE\u7BDF\u7BE0\u7BE2\u7BE3\u7BE4\u7BE7\u7BE8\u7BE9\u7BEB\u7BEC\u7BED\u7BEF\u7BF0\u7BF2", 4, "\u7BF8\u7BF9\u7BFA\u7BFB\u7BFD\u7BFF", 7, "\u7C08\u7C09\u7C0A\u7C0D\u7C0E\u7C10", 5, "\u7C17\u7C18\u7C19"], + ["ba80", "\u7C1A", 4, "\u7C20", 5, "\u7C28\u7C29\u7C2B", 12, "\u7C39", 5, "\u7C42\u9AB8\u5B69\u6D77\u6C26\u4EA5\u5BB3\u9A87\u9163\u61A8\u90AF\u97E9\u542B\u6DB5\u5BD2\u51FD\u558A\u7F55\u7FF0\u64BC\u634D\u65F1\u61BE\u608D\u710A\u6C57\u6C49\u592F\u676D\u822A\u58D5\u568E\u8C6A\u6BEB\u90DD\u597D\u8017\u53F7\u6D69\u5475\u559D\u8377\u83CF\u6838\u79BE\u548C\u4F55\u5408\u76D2\u8C89\u9602\u6CB3\u6DB8\u8D6B\u8910\u9E64\u8D3A\u563F\u9ED1\u75D5\u5F88\u72E0\u6068\u54FC\u4EA8\u6A2A\u8861\u6052\u8F70\u54C4\u70D8\u8679\u9E3F\u6D2A\u5B8F\u5F18\u7EA2\u5589\u4FAF\u7334\u543C\u539A\u5019\u540E\u547C\u4E4E\u5FFD\u745A\u58F6\u846B\u80E1\u8774\u72D0\u7CCA\u6E56"], + ["bb40", "\u7C43", 9, "\u7C4E", 36, "\u7C75", 5, "\u7C7E", 9], + ["bb80", "\u7C88\u7C8A", 6, "\u7C93\u7C94\u7C96\u7C99\u7C9A\u7C9B\u7CA0\u7CA1\u7CA3\u7CA6\u7CA7\u7CA8\u7CA9\u7CAB\u7CAC\u7CAD\u7CAF\u7CB0\u7CB4", 4, "\u7CBA\u7CBB\u5F27\u864E\u552C\u62A4\u4E92\u6CAA\u6237\u82B1\u54D7\u534E\u733E\u6ED1\u753B\u5212\u5316\u8BDD\u69D0\u5F8A\u6000\u6DEE\u574F\u6B22\u73AF\u6853\u8FD8\u7F13\u6362\u60A3\u5524\u75EA\u8C62\u7115\u6DA3\u5BA6\u5E7B\u8352\u614C\u9EC4\u78FA\u8757\u7C27\u7687\u51F0\u60F6\u714C\u6643\u5E4C\u604D\u8C0E\u7070\u6325\u8F89\u5FBD\u6062\u86D4\u56DE\u6BC1\u6094\u6167\u5349\u60E0\u6666\u8D3F\u79FD\u4F1A\u70E9\u6C47\u8BB3\u8BF2\u7ED8\u8364\u660F\u5A5A\u9B42\u6D51\u6DF7\u8C41\u6D3B\u4F19\u706B\u83B7\u6216\u60D1\u970D\u8D27\u7978\u51FB\u573E\u57FA\u673A\u7578\u7A3D\u79EF\u7B95"], + ["bc40", "\u7CBF\u7CC0\u7CC2\u7CC3\u7CC4\u7CC6\u7CC9\u7CCB\u7CCE", 6, "\u7CD8\u7CDA\u7CDB\u7CDD\u7CDE\u7CE1", 6, "\u7CE9", 5, "\u7CF0", 7, "\u7CF9\u7CFA\u7CFC", 13, "\u7D0B", 5], + ["bc80", "\u7D11", 14, "\u7D21\u7D23\u7D24\u7D25\u7D26\u7D28\u7D29\u7D2A\u7D2C\u7D2D\u7D2E\u7D30", 6, "\u808C\u9965\u8FF9\u6FC0\u8BA5\u9E21\u59EC\u7EE9\u7F09\u5409\u6781\u68D8\u8F91\u7C4D\u96C6\u53CA\u6025\u75BE\u6C72\u5373\u5AC9\u7EA7\u6324\u51E0\u810A\u5DF1\u84DF\u6280\u5180\u5B63\u4F0E\u796D\u5242\u60B8\u6D4E\u5BC4\u5BC2\u8BA1\u8BB0\u65E2\u5FCC\u9645\u5993\u7EE7\u7EAA\u5609\u67B7\u5939\u4F73\u5BB6\u52A0\u835A\u988A\u8D3E\u7532\u94BE\u5047\u7A3C\u4EF7\u67B6\u9A7E\u5AC1\u6B7C\u76D1\u575A\u5C16\u7B3A\u95F4\u714E\u517C\u80A9\u8270\u5978\u7F04\u8327\u68C0\u67EC\u78B1\u7877\u62E3\u6361\u7B80\u4FED\u526A\u51CF\u8350\u69DB\u9274\u8DF5\u8D31\u89C1\u952E\u7BAD\u4EF6"], + ["bd40", "\u7D37", 54, "\u7D6F", 7], + ["bd80", "\u7D78", 32, "\u5065\u8230\u5251\u996F\u6E10\u6E85\u6DA7\u5EFA\u50F5\u59DC\u5C06\u6D46\u6C5F\u7586\u848B\u6868\u5956\u8BB2\u5320\u9171\u964D\u8549\u6912\u7901\u7126\u80F6\u4EA4\u90CA\u6D47\u9A84\u5A07\u56BC\u6405\u94F0\u77EB\u4FA5\u811A\u72E1\u89D2\u997A\u7F34\u7EDE\u527F\u6559\u9175\u8F7F\u8F83\u53EB\u7A96\u63ED\u63A5\u7686\u79F8\u8857\u9636\u622A\u52AB\u8282\u6854\u6770\u6377\u776B\u7AED\u6D01\u7ED3\u89E3\u59D0\u6212\u85C9\u82A5\u754C\u501F\u4ECB\u75A5\u8BEB\u5C4A\u5DFE\u7B4B\u65A4\u91D1\u4ECA\u6D25\u895F\u7D27\u9526\u4EC5\u8C28\u8FDB\u9773\u664B\u7981\u8FD1\u70EC\u6D78"], + ["be40", "\u7D99", 12, "\u7DA7", 6, "\u7DAF", 42], + ["be80", "\u7DDA", 32, "\u5C3D\u52B2\u8346\u5162\u830E\u775B\u6676\u9CB8\u4EAC\u60CA\u7CBE\u7CB3\u7ECF\u4E95\u8B66\u666F\u9888\u9759\u5883\u656C\u955C\u5F84\u75C9\u9756\u7ADF\u7ADE\u51C0\u70AF\u7A98\u63EA\u7A76\u7EA0\u7396\u97ED\u4E45\u7078\u4E5D\u9152\u53A9\u6551\u65E7\u81FC\u8205\u548E\u5C31\u759A\u97A0\u62D8\u72D9\u75BD\u5C45\u9A79\u83CA\u5C40\u5480\u77E9\u4E3E\u6CAE\u805A\u62D2\u636E\u5DE8\u5177\u8DDD\u8E1E\u952F\u4FF1\u53E5\u60E7\u70AC\u5267\u6350\u9E43\u5A1F\u5026\u7737\u5377\u7EE2\u6485\u652B\u6289\u6398\u5014\u7235\u89C9\u51B3\u8BC0\u7EDD\u5747\u83CC\u94A7\u519B\u541B\u5CFB"], + ["bf40", "\u7DFB", 62], + ["bf80", "\u7E3A\u7E3C", 4, "\u7E42", 4, "\u7E48", 21, "\u4FCA\u7AE3\u6D5A\u90E1\u9A8F\u5580\u5496\u5361\u54AF\u5F00\u63E9\u6977\u51EF\u6168\u520A\u582A\u52D8\u574E\u780D\u770B\u5EB7\u6177\u7CE0\u625B\u6297\u4EA2\u7095\u8003\u62F7\u70E4\u9760\u5777\u82DB\u67EF\u68F5\u78D5\u9897\u79D1\u58F3\u54B3\u53EF\u6E34\u514B\u523B\u5BA2\u8BFE\u80AF\u5543\u57A6\u6073\u5751\u542D\u7A7A\u6050\u5B54\u63A7\u62A0\u53E3\u6263\u5BC7\u67AF\u54ED\u7A9F\u82E6\u9177\u5E93\u88E4\u5938\u57AE\u630E\u8DE8\u80EF\u5757\u7B77\u4FA9\u5FEB\u5BBD\u6B3E\u5321\u7B50\u72C2\u6846\u77FF\u7736\u65F7\u51B5\u4E8F\u76D4\u5CBF\u7AA5\u8475\u594E\u9B41\u5080"], + ["c040", "\u7E5E", 35, "\u7E83", 23, "\u7E9C\u7E9D\u7E9E"], + ["c080", "\u7EAE\u7EB4\u7EBB\u7EBC\u7ED6\u7EE4\u7EEC\u7EF9\u7F0A\u7F10\u7F1E\u7F37\u7F39\u7F3B", 6, "\u7F43\u7F46", 9, "\u7F52\u7F53\u9988\u6127\u6E83\u5764\u6606\u6346\u56F0\u62EC\u6269\u5ED3\u9614\u5783\u62C9\u5587\u8721\u814A\u8FA3\u5566\u83B1\u6765\u8D56\u84DD\u5A6A\u680F\u62E6\u7BEE\u9611\u5170\u6F9C\u8C30\u63FD\u89C8\u61D2\u7F06\u70C2\u6EE5\u7405\u6994\u72FC\u5ECA\u90CE\u6717\u6D6A\u635E\u52B3\u7262\u8001\u4F6C\u59E5\u916A\u70D9\u6D9D\u52D2\u4E50\u96F7\u956D\u857E\u78CA\u7D2F\u5121\u5792\u64C2\u808B\u7C7B\u6CEA\u68F1\u695E\u51B7\u5398\u68A8\u7281\u9ECE\u7BF1\u72F8\u79BB\u6F13\u7406\u674E\u91CC\u9CA4\u793C\u8389\u8354\u540F\u6817\u4E3D\u5389\u52B1\u783E\u5386\u5229\u5088\u4F8B\u4FD0"], + ["c140", "\u7F56\u7F59\u7F5B\u7F5C\u7F5D\u7F5E\u7F60\u7F63", 4, "\u7F6B\u7F6C\u7F6D\u7F6F\u7F70\u7F73\u7F75\u7F76\u7F77\u7F78\u7F7A\u7F7B\u7F7C\u7F7D\u7F7F\u7F80\u7F82", 7, "\u7F8B\u7F8D\u7F8F", 4, "\u7F95", 4, "\u7F9B\u7F9C\u7FA0\u7FA2\u7FA3\u7FA5\u7FA6\u7FA8", 6, "\u7FB1"], + ["c180", "\u7FB3", 4, "\u7FBA\u7FBB\u7FBE\u7FC0\u7FC2\u7FC3\u7FC4\u7FC6\u7FC7\u7FC8\u7FC9\u7FCB\u7FCD\u7FCF", 4, "\u7FD6\u7FD7\u7FD9", 5, "\u7FE2\u7FE3\u75E2\u7ACB\u7C92\u6CA5\u96B6\u529B\u7483\u54E9\u4FE9\u8054\u83B2\u8FDE\u9570\u5EC9\u601C\u6D9F\u5E18\u655B\u8138\u94FE\u604B\u70BC\u7EC3\u7CAE\u51C9\u6881\u7CB1\u826F\u4E24\u8F86\u91CF\u667E\u4EAE\u8C05\u64A9\u804A\u50DA\u7597\u71CE\u5BE5\u8FBD\u6F66\u4E86\u6482\u9563\u5ED6\u6599\u5217\u88C2\u70C8\u52A3\u730E\u7433\u6797\u78F7\u9716\u4E34\u90BB\u9CDE\u6DCB\u51DB\u8D41\u541D\u62CE\u73B2\u83F1\u96F6\u9F84\u94C3\u4F36\u7F9A\u51CC\u7075\u9675\u5CAD\u9886\u53E6\u4EE4\u6E9C\u7409\u69B4\u786B\u998F\u7559\u5218\u7624\u6D41\u67F3\u516D\u9F99\u804B\u5499\u7B3C\u7ABF"], + ["c240", "\u7FE4\u7FE7\u7FE8\u7FEA\u7FEB\u7FEC\u7FED\u7FEF\u7FF2\u7FF4", 6, "\u7FFD\u7FFE\u7FFF\u8002\u8007\u8008\u8009\u800A\u800E\u800F\u8011\u8013\u801A\u801B\u801D\u801E\u801F\u8021\u8023\u8024\u802B", 5, "\u8032\u8034\u8039\u803A\u803C\u803E\u8040\u8041\u8044\u8045\u8047\u8048\u8049\u804E\u804F\u8050\u8051\u8053\u8055\u8056\u8057"], + ["c280", "\u8059\u805B", 13, "\u806B", 5, "\u8072", 11, "\u9686\u5784\u62E2\u9647\u697C\u5A04\u6402\u7BD3\u6F0F\u964B\u82A6\u5362\u9885\u5E90\u7089\u63B3\u5364\u864F\u9C81\u9E93\u788C\u9732\u8DEF\u8D42\u9E7F\u6F5E\u7984\u5F55\u9646\u622E\u9A74\u5415\u94DD\u4FA3\u65C5\u5C65\u5C61\u7F15\u8651\u6C2F\u5F8B\u7387\u6EE4\u7EFF\u5CE6\u631B\u5B6A\u6EE6\u5375\u4E71\u63A0\u7565\u62A1\u8F6E\u4F26\u4ED1\u6CA6\u7EB6\u8BBA\u841D\u87BA\u7F57\u903B\u9523\u7BA9\u9AA1\u88F8\u843D\u6D1B\u9A86\u7EDC\u5988\u9EBB\u739B\u7801\u8682\u9A6C\u9A82\u561B\u5417\u57CB\u4E70\u9EA6\u5356\u8FC8\u8109\u7792\u9992\u86EE\u6EE1\u8513\u66FC\u6162\u6F2B"], + ["c340", "\u807E\u8081\u8082\u8085\u8088\u808A\u808D", 5, "\u8094\u8095\u8097\u8099\u809E\u80A3\u80A6\u80A7\u80A8\u80AC\u80B0\u80B3\u80B5\u80B6\u80B8\u80B9\u80BB\u80C5\u80C7", 4, "\u80CF", 6, "\u80D8\u80DF\u80E0\u80E2\u80E3\u80E6\u80EE\u80F5\u80F7\u80F9\u80FB\u80FE\u80FF\u8100\u8101\u8103\u8104\u8105\u8107\u8108\u810B"], + ["c380", "\u810C\u8115\u8117\u8119\u811B\u811C\u811D\u811F", 12, "\u812D\u812E\u8130\u8133\u8134\u8135\u8137\u8139", 4, "\u813F\u8C29\u8292\u832B\u76F2\u6C13\u5FD9\u83BD\u732B\u8305\u951A\u6BDB\u77DB\u94C6\u536F\u8302\u5192\u5E3D\u8C8C\u8D38\u4E48\u73AB\u679A\u6885\u9176\u9709\u7164\u6CA1\u7709\u5A92\u9541\u6BCF\u7F8E\u6627\u5BD0\u59B9\u5A9A\u95E8\u95F7\u4EEC\u840C\u8499\u6AAC\u76DF\u9530\u731B\u68A6\u5B5F\u772F\u919A\u9761\u7CDC\u8FF7\u8C1C\u5F25\u7C73\u79D8\u89C5\u6CCC\u871C\u5BC6\u5E42\u68C9\u7720\u7EF5\u5195\u514D\u52C9\u5A29\u7F05\u9762\u82D7\u63CF\u7784\u85D0\u79D2\u6E3A\u5E99\u5999\u8511\u706D\u6C11\u62BF\u76BF\u654F\u60AF\u95FD\u660E\u879F\u9E23\u94ED\u540D\u547D\u8C2C\u6478"], + ["c440", "\u8140", 5, "\u8147\u8149\u814D\u814E\u814F\u8152\u8156\u8157\u8158\u815B", 4, "\u8161\u8162\u8163\u8164\u8166\u8168\u816A\u816B\u816C\u816F\u8172\u8173\u8175\u8176\u8177\u8178\u8181\u8183", 4, "\u8189\u818B\u818C\u818D\u818E\u8190\u8192", 5, "\u8199\u819A\u819E", 4, "\u81A4\u81A5"], + ["c480", "\u81A7\u81A9\u81AB", 7, "\u81B4", 5, "\u81BC\u81BD\u81BE\u81BF\u81C4\u81C5\u81C7\u81C8\u81C9\u81CB\u81CD", 6, "\u6479\u8611\u6A21\u819C\u78E8\u6469\u9B54\u62B9\u672B\u83AB\u58A8\u9ED8\u6CAB\u6F20\u5BDE\u964C\u8C0B\u725F\u67D0\u62C7\u7261\u4EA9\u59C6\u6BCD\u5893\u66AE\u5E55\u52DF\u6155\u6728\u76EE\u7766\u7267\u7A46\u62FF\u54EA\u5450\u94A0\u90A3\u5A1C\u7EB3\u6C16\u4E43\u5976\u8010\u5948\u5357\u7537\u96BE\u56CA\u6320\u8111\u607C\u95F9\u6DD6\u5462\u9981\u5185\u5AE9\u80FD\u59AE\u9713\u502A\u6CE5\u5C3C\u62DF\u4F60\u533F\u817B\u9006\u6EBA\u852B\u62C8\u5E74\u78BE\u64B5\u637B\u5FF5\u5A18\u917F\u9E1F\u5C3F\u634F\u8042\u5B7D\u556E\u954A\u954D\u6D85\u60A8\u67E0\u72DE\u51DD\u5B81"], + ["c540", "\u81D4", 14, "\u81E4\u81E5\u81E6\u81E8\u81E9\u81EB\u81EE", 4, "\u81F5", 5, "\u81FD\u81FF\u8203\u8207", 4, "\u820E\u820F\u8211\u8213\u8215", 5, "\u821D\u8220\u8224\u8225\u8226\u8227\u8229\u822E\u8232\u823A\u823C\u823D\u823F"], + ["c580", "\u8240\u8241\u8242\u8243\u8245\u8246\u8248\u824A\u824C\u824D\u824E\u8250", 7, "\u8259\u825B\u825C\u825D\u825E\u8260", 7, "\u8269\u62E7\u6CDE\u725B\u626D\u94AE\u7EBD\u8113\u6D53\u519C\u5F04\u5974\u52AA\u6012\u5973\u6696\u8650\u759F\u632A\u61E6\u7CEF\u8BFA\u54E6\u6B27\u9E25\u6BB4\u85D5\u5455\u5076\u6CA4\u556A\u8DB4\u722C\u5E15\u6015\u7436\u62CD\u6392\u724C\u5F98\u6E43\u6D3E\u6500\u6F58\u76D8\u78D0\u76FC\u7554\u5224\u53DB\u4E53\u5E9E\u65C1\u802A\u80D6\u629B\u5486\u5228\u70AE\u888D\u8DD1\u6CE1\u5478\u80DA\u57F9\u88F4\u8D54\u966A\u914D\u4F69\u6C9B\u55B7\u76C6\u7830\u62A8\u70F9\u6F8E\u5F6D\u84EC\u68DA\u787C\u7BF7\u81A8\u670B\u9E4F\u6367\u78B0\u576F\u7812\u9739\u6279\u62AB\u5288\u7435\u6BD7"], + ["c640", "\u826A\u826B\u826C\u826D\u8271\u8275\u8276\u8277\u8278\u827B\u827C\u8280\u8281\u8283\u8285\u8286\u8287\u8289\u828C\u8290\u8293\u8294\u8295\u8296\u829A\u829B\u829E\u82A0\u82A2\u82A3\u82A7\u82B2\u82B5\u82B6\u82BA\u82BB\u82BC\u82BF\u82C0\u82C2\u82C3\u82C5\u82C6\u82C9\u82D0\u82D6\u82D9\u82DA\u82DD\u82E2\u82E7\u82E8\u82E9\u82EA\u82EC\u82ED\u82EE\u82F0\u82F2\u82F3\u82F5\u82F6\u82F8"], + ["c680", "\u82FA\u82FC", 4, "\u830A\u830B\u830D\u8310\u8312\u8313\u8316\u8318\u8319\u831D", 9, "\u8329\u832A\u832E\u8330\u8332\u8337\u833B\u833D\u5564\u813E\u75B2\u76AE\u5339\u75DE\u50FB\u5C41\u8B6C\u7BC7\u504F\u7247\u9A97\u98D8\u6F02\u74E2\u7968\u6487\u77A5\u62FC\u9891\u8D2B\u54C1\u8058\u4E52\u576A\u82F9\u840D\u5E73\u51ED\u74F6\u8BC4\u5C4F\u5761\u6CFC\u9887\u5A46\u7834\u9B44\u8FEB\u7C95\u5256\u6251\u94FA\u4EC6\u8386\u8461\u83E9\u84B2\u57D4\u6734\u5703\u666E\u6D66\u8C31\u66DD\u7011\u671F\u6B3A\u6816\u621A\u59BB\u4E03\u51C4\u6F06\u67D2\u6C8F\u5176\u68CB\u5947\u6B67\u7566\u5D0E\u8110\u9F50\u65D7\u7948\u7941\u9A91\u8D77\u5C82\u4E5E\u4F01\u542F\u5951\u780C\u5668\u6C14\u8FC4\u5F03\u6C7D\u6CE3\u8BAB\u6390"], + ["c740", "\u833E\u833F\u8341\u8342\u8344\u8345\u8348\u834A", 4, "\u8353\u8355", 4, "\u835D\u8362\u8370", 6, "\u8379\u837A\u837E", 6, "\u8387\u8388\u838A\u838B\u838C\u838D\u838F\u8390\u8391\u8394\u8395\u8396\u8397\u8399\u839A\u839D\u839F\u83A1", 6, "\u83AC\u83AD\u83AE"], + ["c780", "\u83AF\u83B5\u83BB\u83BE\u83BF\u83C2\u83C3\u83C4\u83C6\u83C8\u83C9\u83CB\u83CD\u83CE\u83D0\u83D1\u83D2\u83D3\u83D5\u83D7\u83D9\u83DA\u83DB\u83DE\u83E2\u83E3\u83E4\u83E6\u83E7\u83E8\u83EB\u83EC\u83ED\u6070\u6D3D\u7275\u6266\u948E\u94C5\u5343\u8FC1\u7B7E\u4EDF\u8C26\u4E7E\u9ED4\u94B1\u94B3\u524D\u6F5C\u9063\u6D45\u8C34\u5811\u5D4C\u6B20\u6B49\u67AA\u545B\u8154\u7F8C\u5899\u8537\u5F3A\u62A2\u6A47\u9539\u6572\u6084\u6865\u77A7\u4E54\u4FA8\u5DE7\u9798\u64AC\u7FD8\u5CED\u4FCF\u7A8D\u5207\u8304\u4E14\u602F\u7A83\u94A6\u4FB5\u4EB2\u79E6\u7434\u52E4\u82B9\u64D2\u79BD\u5BDD\u6C81\u9752\u8F7B\u6C22\u503E\u537F\u6E05\u64CE\u6674\u6C30\u60C5\u9877\u8BF7\u5E86\u743C\u7A77\u79CB\u4E18\u90B1\u7403\u6C42\u56DA\u914B\u6CC5\u8D8B\u533A\u86C6\u66F2\u8EAF\u5C48\u9A71\u6E20"], + ["c840", "\u83EE\u83EF\u83F3", 4, "\u83FA\u83FB\u83FC\u83FE\u83FF\u8400\u8402\u8405\u8407\u8408\u8409\u840A\u8410\u8412", 5, "\u8419\u841A\u841B\u841E", 5, "\u8429", 7, "\u8432", 5, "\u8439\u843A\u843B\u843E", 7, "\u8447\u8448\u8449"], + ["c880", "\u844A", 6, "\u8452", 4, "\u8458\u845D\u845E\u845F\u8460\u8462\u8464", 4, "\u846A\u846E\u846F\u8470\u8472\u8474\u8477\u8479\u847B\u847C\u53D6\u5A36\u9F8B\u8DA3\u53BB\u5708\u98A7\u6743\u919B\u6CC9\u5168\u75CA\u62F3\u72AC\u5238\u529D\u7F3A\u7094\u7638\u5374\u9E4A\u69B7\u786E\u96C0\u88D9\u7FA4\u7136\u71C3\u5189\u67D3\u74E4\u58E4\u6518\u56B7\u8BA9\u9976\u6270\u7ED5\u60F9\u70ED\u58EC\u4EC1\u4EBA\u5FCD\u97E7\u4EFB\u8BA4\u5203\u598A\u7EAB\u6254\u4ECD\u65E5\u620E\u8338\u84C9\u8363\u878D\u7194\u6EB6\u5BB9\u7ED2\u5197\u63C9\u67D4\u8089\u8339\u8815\u5112\u5B7A\u5982\u8FB1\u4E73\u6C5D\u5165\u8925\u8F6F\u962E\u854A\u745E\u9510\u95F0\u6DA6\u82E5\u5F31\u6492\u6D12\u8428\u816E\u9CC3\u585E\u8D5B\u4E09\u53C1"], + ["c940", "\u847D", 4, "\u8483\u8484\u8485\u8486\u848A\u848D\u848F", 7, "\u8498\u849A\u849B\u849D\u849E\u849F\u84A0\u84A2", 12, "\u84B0\u84B1\u84B3\u84B5\u84B6\u84B7\u84BB\u84BC\u84BE\u84C0\u84C2\u84C3\u84C5\u84C6\u84C7\u84C8\u84CB\u84CC\u84CE\u84CF\u84D2\u84D4\u84D5\u84D7"], + ["c980", "\u84D8", 4, "\u84DE\u84E1\u84E2\u84E4\u84E7", 4, "\u84ED\u84EE\u84EF\u84F1", 10, "\u84FD\u84FE\u8500\u8501\u8502\u4F1E\u6563\u6851\u55D3\u4E27\u6414\u9A9A\u626B\u5AC2\u745F\u8272\u6DA9\u68EE\u50E7\u838E\u7802\u6740\u5239\u6C99\u7EB1\u50BB\u5565\u715E\u7B5B\u6652\u73CA\u82EB\u6749\u5C71\u5220\u717D\u886B\u95EA\u9655\u64C5\u8D61\u81B3\u5584\u6C55\u6247\u7F2E\u5892\u4F24\u5546\u8D4F\u664C\u4E0A\u5C1A\u88F3\u68A2\u634E\u7A0D\u70E7\u828D\u52FA\u97F6\u5C11\u54E8\u90B5\u7ECD\u5962\u8D4A\u86C7\u820C\u820D\u8D66\u6444\u5C04\u6151\u6D89\u793E\u8BBE\u7837\u7533\u547B\u4F38\u8EAB\u6DF1\u5A20\u7EC5\u795E\u6C88\u5BA1\u5A76\u751A\u80BE\u614E\u6E17\u58F0\u751F\u7525\u7272\u5347\u7EF3"], + ["ca40", "\u8503", 8, "\u850D\u850E\u850F\u8510\u8512\u8514\u8515\u8516\u8518\u8519\u851B\u851C\u851D\u851E\u8520\u8522", 8, "\u852D", 9, "\u853E", 4, "\u8544\u8545\u8546\u8547\u854B", 10], + ["ca80", "\u8557\u8558\u855A\u855B\u855C\u855D\u855F", 4, "\u8565\u8566\u8567\u8569", 8, "\u8573\u8575\u8576\u8577\u8578\u857C\u857D\u857F\u8580\u8581\u7701\u76DB\u5269\u80DC\u5723\u5E08\u5931\u72EE\u65BD\u6E7F\u8BD7\u5C38\u8671\u5341\u77F3\u62FE\u65F6\u4EC0\u98DF\u8680\u5B9E\u8BC6\u53F2\u77E2\u4F7F\u5C4E\u9A76\u59CB\u5F0F\u793A\u58EB\u4E16\u67FF\u4E8B\u62ED\u8A93\u901D\u52BF\u662F\u55DC\u566C\u9002\u4ED5\u4F8D\u91CA\u9970\u6C0F\u5E02\u6043\u5BA4\u89C6\u8BD5\u6536\u624B\u9996\u5B88\u5BFF\u6388\u552E\u53D7\u7626\u517D\u852C\u67A2\u68B3\u6B8A\u6292\u8F93\u53D4\u8212\u6DD1\u758F\u4E66\u8D4E\u5B70\u719F\u85AF\u6691\u66D9\u7F72\u8700\u9ECD\u9F20\u5C5E\u672F\u8FF0\u6811\u675F\u620D\u7AD6\u5885\u5EB6\u6570\u6F31"], + ["cb40", "\u8582\u8583\u8586\u8588", 6, "\u8590", 10, "\u859D", 6, "\u85A5\u85A6\u85A7\u85A9\u85AB\u85AC\u85AD\u85B1", 5, "\u85B8\u85BA", 6, "\u85C2", 6, "\u85CA", 4, "\u85D1\u85D2"], + ["cb80", "\u85D4\u85D6", 5, "\u85DD", 6, "\u85E5\u85E6\u85E7\u85E8\u85EA", 14, "\u6055\u5237\u800D\u6454\u8870\u7529\u5E05\u6813\u62F4\u971C\u53CC\u723D\u8C01\u6C34\u7761\u7A0E\u542E\u77AC\u987A\u821C\u8BF4\u7855\u6714\u70C1\u65AF\u6495\u5636\u601D\u79C1\u53F8\u4E1D\u6B7B\u8086\u5BFA\u55E3\u56DB\u4F3A\u4F3C\u9972\u5DF3\u677E\u8038\u6002\u9882\u9001\u5B8B\u8BBC\u8BF5\u641C\u8258\u64DE\u55FD\u82CF\u9165\u4FD7\u7D20\u901F\u7C9F\u50F3\u5851\u6EAF\u5BBF\u8BC9\u8083\u9178\u849C\u7B97\u867D\u968B\u968F\u7EE5\u9AD3\u788E\u5C81\u7A57\u9042\u96A7\u795F\u5B59\u635F\u7B0B\u84D1\u68AD\u5506\u7F29\u7410\u7D22\u9501\u6240\u584C\u4ED6\u5B83\u5979\u5854"], + ["cc40", "\u85F9\u85FA\u85FC\u85FD\u85FE\u8600", 4, "\u8606", 10, "\u8612\u8613\u8614\u8615\u8617", 15, "\u8628\u862A", 13, "\u8639\u863A\u863B\u863D\u863E\u863F\u8640"], + ["cc80", "\u8641", 11, "\u8652\u8653\u8655", 4, "\u865B\u865C\u865D\u865F\u8660\u8661\u8663", 7, "\u736D\u631E\u8E4B\u8E0F\u80CE\u82D4\u62AC\u53F0\u6CF0\u915E\u592A\u6001\u6C70\u574D\u644A\u8D2A\u762B\u6EE9\u575B\u6A80\u75F0\u6F6D\u8C2D\u8C08\u5766\u6BEF\u8892\u78B3\u63A2\u53F9\u70AD\u6C64\u5858\u642A\u5802\u68E0\u819B\u5510\u7CD6\u5018\u8EBA\u6DCC\u8D9F\u70EB\u638F\u6D9B\u6ED4\u7EE6\u8404\u6843\u9003\u6DD8\u9676\u8BA8\u5957\u7279\u85E4\u817E\u75BC\u8A8A\u68AF\u5254\u8E22\u9511\u63D0\u9898\u8E44\u557C\u4F53\u66FF\u568F\u60D5\u6D95\u5243\u5C49\u5929\u6DFB\u586B\u7530\u751C\u606C\u8214\u8146\u6311\u6761\u8FE2\u773A\u8DF3\u8D34\u94C1\u5E16\u5385\u542C\u70C3"], + ["cd40", "\u866D\u866F\u8670\u8672", 6, "\u8683", 6, "\u868E", 4, "\u8694\u8696", 5, "\u869E", 4, "\u86A5\u86A6\u86AB\u86AD\u86AE\u86B2\u86B3\u86B7\u86B8\u86B9\u86BB", 4, "\u86C1\u86C2\u86C3\u86C5\u86C8\u86CC\u86CD\u86D2\u86D3\u86D5\u86D6\u86D7\u86DA\u86DC"], + ["cd80", "\u86DD\u86E0\u86E1\u86E2\u86E3\u86E5\u86E6\u86E7\u86E8\u86EA\u86EB\u86EC\u86EF\u86F5\u86F6\u86F7\u86FA\u86FB\u86FC\u86FD\u86FF\u8701\u8704\u8705\u8706\u870B\u870C\u870E\u870F\u8710\u8711\u8714\u8716\u6C40\u5EF7\u505C\u4EAD\u5EAD\u633A\u8247\u901A\u6850\u916E\u77B3\u540C\u94DC\u5F64\u7AE5\u6876\u6345\u7B52\u7EDF\u75DB\u5077\u6295\u5934\u900F\u51F8\u79C3\u7A81\u56FE\u5F92\u9014\u6D82\u5C60\u571F\u5410\u5154\u6E4D\u56E2\u63A8\u9893\u817F\u8715\u892A\u9000\u541E\u5C6F\u81C0\u62D6\u6258\u8131\u9E35\u9640\u9A6E\u9A7C\u692D\u59A5\u62D3\u553E\u6316\u54C7\u86D9\u6D3C\u5A03\u74E6\u889C\u6B6A\u5916\u8C4C\u5F2F\u6E7E\u73A9\u987D\u4E38\u70F7\u5B8C\u7897\u633D\u665A\u7696\u60CB\u5B9B\u5A49\u4E07\u8155\u6C6A\u738B\u4EA1\u6789\u7F51\u5F80\u65FA\u671B\u5FD8\u5984\u5A01"], + ["ce40", "\u8719\u871B\u871D\u871F\u8720\u8724\u8726\u8727\u8728\u872A\u872B\u872C\u872D\u872F\u8730\u8732\u8733\u8735\u8736\u8738\u8739\u873A\u873C\u873D\u8740", 6, "\u874A\u874B\u874D\u874F\u8750\u8751\u8752\u8754\u8755\u8756\u8758\u875A", 5, "\u8761\u8762\u8766", 7, "\u876F\u8771\u8772\u8773\u8775"], + ["ce80", "\u8777\u8778\u8779\u877A\u877F\u8780\u8781\u8784\u8786\u8787\u8789\u878A\u878C\u878E", 4, "\u8794\u8795\u8796\u8798", 6, "\u87A0", 4, "\u5DCD\u5FAE\u5371\u97E6\u8FDD\u6845\u56F4\u552F\u60DF\u4E3A\u6F4D\u7EF4\u82C7\u840E\u59D4\u4F1F\u4F2A\u5C3E\u7EAC\u672A\u851A\u5473\u754F\u80C3\u5582\u9B4F\u4F4D\u6E2D\u8C13\u5C09\u6170\u536B\u761F\u6E29\u868A\u6587\u95FB\u7EB9\u543B\u7A33\u7D0A\u95EE\u55E1\u7FC1\u74EE\u631D\u8717\u6DA1\u7A9D\u6211\u65A1\u5367\u63E1\u6C83\u5DEB\u545C\u94A8\u4E4C\u6C61\u8BEC\u5C4B\u65E0\u829C\u68A7\u543E\u5434\u6BCB\u6B66\u4E94\u6342\u5348\u821E\u4F0D\u4FAE\u575E\u620A\u96FE\u6664\u7269\u52FF\u52A1\u609F\u8BEF\u6614\u7199\u6790\u897F\u7852\u77FD\u6670\u563B\u5438\u9521\u727A"], + ["cf40", "\u87A5\u87A6\u87A7\u87A9\u87AA\u87AE\u87B0\u87B1\u87B2\u87B4\u87B6\u87B7\u87B8\u87B9\u87BB\u87BC\u87BE\u87BF\u87C1", 4, "\u87C7\u87C8\u87C9\u87CC", 4, "\u87D4", 6, "\u87DC\u87DD\u87DE\u87DF\u87E1\u87E2\u87E3\u87E4\u87E6\u87E7\u87E8\u87E9\u87EB\u87EC\u87ED\u87EF", 9], + ["cf80", "\u87FA\u87FB\u87FC\u87FD\u87FF\u8800\u8801\u8802\u8804", 5, "\u880B", 7, "\u8814\u8817\u8818\u8819\u881A\u881C", 4, "\u8823\u7A00\u606F\u5E0C\u6089\u819D\u5915\u60DC\u7184\u70EF\u6EAA\u6C50\u7280\u6A84\u88AD\u5E2D\u4E60\u5AB3\u559C\u94E3\u6D17\u7CFB\u9699\u620F\u7EC6\u778E\u867E\u5323\u971E\u8F96\u6687\u5CE1\u4FA0\u72ED\u4E0B\u53A6\u590F\u5413\u6380\u9528\u5148\u4ED9\u9C9C\u7EA4\u54B8\u8D24\u8854\u8237\u95F2\u6D8E\u5F26\u5ACC\u663E\u9669\u73B0\u732E\u53BF\u817A\u9985\u7FA1\u5BAA\u9677\u9650\u7EBF\u76F8\u53A2\u9576\u9999\u7BB1\u8944\u6E58\u4E61\u7FD4\u7965\u8BE6\u60F3\u54CD\u4EAB\u9879\u5DF7\u6A61\u50CF\u5411\u8C61\u8427\u785D\u9704\u524A\u54EE\u56A3\u9500\u6D88\u5BB5\u6DC6\u6653"], + ["d040", "\u8824", 13, "\u8833", 5, "\u883A\u883B\u883D\u883E\u883F\u8841\u8842\u8843\u8846", 5, "\u884E", 5, "\u8855\u8856\u8858\u885A", 6, "\u8866\u8867\u886A\u886D\u886F\u8871\u8873\u8874\u8875\u8876\u8878\u8879\u887A"], + ["d080", "\u887B\u887C\u8880\u8883\u8886\u8887\u8889\u888A\u888C\u888E\u888F\u8890\u8891\u8893\u8894\u8895\u8897", 4, "\u889D", 4, "\u88A3\u88A5", 5, "\u5C0F\u5B5D\u6821\u8096\u5578\u7B11\u6548\u6954\u4E9B\u6B47\u874E\u978B\u534F\u631F\u643A\u90AA\u659C\u80C1\u8C10\u5199\u68B0\u5378\u87F9\u61C8\u6CC4\u6CFB\u8C22\u5C51\u85AA\u82AF\u950C\u6B23\u8F9B\u65B0\u5FFB\u5FC3\u4FE1\u8845\u661F\u8165\u7329\u60FA\u5174\u5211\u578B\u5F62\u90A2\u884C\u9192\u5E78\u674F\u6027\u59D3\u5144\u51F6\u80F8\u5308\u6C79\u96C4\u718A\u4F11\u4FEE\u7F9E\u673D\u55C5\u9508\u79C0\u8896\u7EE3\u589F\u620C\u9700\u865A\u5618\u987B\u5F90\u8BB8\u84C4\u9157\u53D9\u65ED\u5E8F\u755C\u6064\u7D6E\u5A7F\u7EEA\u7EED\u8F69\u55A7\u5BA3\u60AC\u65CB\u7384"], + ["d140", "\u88AC\u88AE\u88AF\u88B0\u88B2", 4, "\u88B8\u88B9\u88BA\u88BB\u88BD\u88BE\u88BF\u88C0\u88C3\u88C4\u88C7\u88C8\u88CA\u88CB\u88CC\u88CD\u88CF\u88D0\u88D1\u88D3\u88D6\u88D7\u88DA", 4, "\u88E0\u88E1\u88E6\u88E7\u88E9", 6, "\u88F2\u88F5\u88F6\u88F7\u88FA\u88FB\u88FD\u88FF\u8900\u8901\u8903", 5], + ["d180", "\u8909\u890B", 4, "\u8911\u8914", 4, "\u891C", 4, "\u8922\u8923\u8924\u8926\u8927\u8928\u8929\u892C\u892D\u892E\u892F\u8931\u8932\u8933\u8935\u8937\u9009\u7663\u7729\u7EDA\u9774\u859B\u5B66\u7A74\u96EA\u8840\u52CB\u718F\u5FAA\u65EC\u8BE2\u5BFB\u9A6F\u5DE1\u6B89\u6C5B\u8BAD\u8BAF\u900A\u8FC5\u538B\u62BC\u9E26\u9E2D\u5440\u4E2B\u82BD\u7259\u869C\u5D16\u8859\u6DAF\u96C5\u54D1\u4E9A\u8BB6\u7109\u54BD\u9609\u70DF\u6DF9\u76D0\u4E25\u7814\u8712\u5CA9\u5EF6\u8A00\u989C\u960E\u708E\u6CBF\u5944\u63A9\u773C\u884D\u6F14\u8273\u5830\u71D5\u538C\u781A\u96C1\u5501\u5F66\u7130\u5BB4\u8C1A\u9A8C\u6B83\u592E\u9E2F\u79E7\u6768\u626C\u4F6F\u75A1\u7F8A\u6D0B\u9633\u6C27\u4EF0\u75D2\u517B\u6837\u6F3E\u9080\u8170\u5996\u7476"], + ["d240", "\u8938", 8, "\u8942\u8943\u8945", 24, "\u8960", 5, "\u8967", 19, "\u897C"], + ["d280", "\u897D\u897E\u8980\u8982\u8984\u8985\u8987", 26, "\u6447\u5C27\u9065\u7A91\u8C23\u59DA\u54AC\u8200\u836F\u8981\u8000\u6930\u564E\u8036\u7237\u91CE\u51B6\u4E5F\u9875\u6396\u4E1A\u53F6\u66F3\u814B\u591C\u6DB2\u4E00\u58F9\u533B\u63D6\u94F1\u4F9D\u4F0A\u8863\u9890\u5937\u9057\u79FB\u4EEA\u80F0\u7591\u6C82\u5B9C\u59E8\u5F5D\u6905\u8681\u501A\u5DF2\u4E59\u77E3\u4EE5\u827A\u6291\u6613\u9091\u5C79\u4EBF\u5F79\u81C6\u9038\u8084\u75AB\u4EA6\u88D4\u610F\u6BC5\u5FC6\u4E49\u76CA\u6EA2\u8BE3\u8BAE\u8C0A\u8BD1\u5F02\u7FFC\u7FCC\u7ECE\u8335\u836B\u56E0\u6BB7\u97F3\u9634\u59FB\u541F\u94F6\u6DEB\u5BC5\u996E\u5C39\u5F15\u9690"], + ["d340", "\u89A2", 30, "\u89C3\u89CD\u89D3\u89D4\u89D5\u89D7\u89D8\u89D9\u89DB\u89DD\u89DF\u89E0\u89E1\u89E2\u89E4\u89E7\u89E8\u89E9\u89EA\u89EC\u89ED\u89EE\u89F0\u89F1\u89F2\u89F4", 6], + ["d380", "\u89FB", 4, "\u8A01", 5, "\u8A08", 21, "\u5370\u82F1\u6A31\u5A74\u9E70\u5E94\u7F28\u83B9\u8424\u8425\u8367\u8747\u8FCE\u8D62\u76C8\u5F71\u9896\u786C\u6620\u54DF\u62E5\u4F63\u81C3\u75C8\u5EB8\u96CD\u8E0A\u86F9\u548F\u6CF3\u6D8C\u6C38\u607F\u52C7\u7528\u5E7D\u4F18\u60A0\u5FE7\u5C24\u7531\u90AE\u94C0\u72B9\u6CB9\u6E38\u9149\u6709\u53CB\u53F3\u4F51\u91C9\u8BF1\u53C8\u5E7C\u8FC2\u6DE4\u4E8E\u76C2\u6986\u865E\u611A\u8206\u4F59\u4FDE\u903E\u9C7C\u6109\u6E1D\u6E14\u9685\u4E88\u5A31\u96E8\u4E0E\u5C7F\u79B9\u5B87\u8BED\u7FBD\u7389\u57DF\u828B\u90C1\u5401\u9047\u55BB\u5CEA\u5FA1\u6108\u6B32\u72F1\u80B2\u8A89"], + ["d440", "\u8A1E", 31, "\u8A3F", 8, "\u8A49", 21], + ["d480", "\u8A5F", 25, "\u8A7A", 6, "\u6D74\u5BD3\u88D5\u9884\u8C6B\u9A6D\u9E33\u6E0A\u51A4\u5143\u57A3\u8881\u539F\u63F4\u8F95\u56ED\u5458\u5706\u733F\u6E90\u7F18\u8FDC\u82D1\u613F\u6028\u9662\u66F0\u7EA6\u8D8A\u8DC3\u94A5\u5CB3\u7CA4\u6708\u60A6\u9605\u8018\u4E91\u90E7\u5300\u9668\u5141\u8FD0\u8574\u915D\u6655\u97F5\u5B55\u531D\u7838\u6742\u683D\u54C9\u707E\u5BB0\u8F7D\u518D\u5728\u54B1\u6512\u6682\u8D5E\u8D43\u810F\u846C\u906D\u7CDF\u51FF\u85FB\u67A3\u65E9\u6FA1\u86A4\u8E81\u566A\u9020\u7682\u7076\u71E5\u8D23\u62E9\u5219\u6CFD\u8D3C\u600E\u589E\u618E\u66FE\u8D60\u624E\u55B3\u6E23\u672D\u8F67"], + ["d540", "\u8A81", 7, "\u8A8B", 7, "\u8A94", 46], + ["d580", "\u8AC3", 32, "\u94E1\u95F8\u7728\u6805\u69A8\u548B\u4E4D\u70B8\u8BC8\u6458\u658B\u5B85\u7A84\u503A\u5BE8\u77BB\u6BE1\u8A79\u7C98\u6CBE\u76CF\u65A9\u8F97\u5D2D\u5C55\u8638\u6808\u5360\u6218\u7AD9\u6E5B\u7EFD\u6A1F\u7AE0\u5F70\u6F33\u5F20\u638C\u6DA8\u6756\u4E08\u5E10\u8D26\u4ED7\u80C0\u7634\u969C\u62DB\u662D\u627E\u6CBC\u8D75\u7167\u7F69\u5146\u8087\u53EC\u906E\u6298\u54F2\u86F0\u8F99\u8005\u9517\u8517\u8FD9\u6D59\u73CD\u659F\u771F\u7504\u7827\u81FB\u8D1E\u9488\u4FA6\u6795\u75B9\u8BCA\u9707\u632F\u9547\u9635\u84B8\u6323\u7741\u5F81\u72F0\u4E89\u6014\u6574\u62EF\u6B63\u653F"], + ["d640", "\u8AE4", 34, "\u8B08", 27], + ["d680", "\u8B24\u8B25\u8B27", 30, "\u5E27\u75C7\u90D1\u8BC1\u829D\u679D\u652F\u5431\u8718\u77E5\u80A2\u8102\u6C41\u4E4B\u7EC7\u804C\u76F4\u690D\u6B96\u6267\u503C\u4F84\u5740\u6307\u6B62\u8DBE\u53EA\u65E8\u7EB8\u5FD7\u631A\u63B7\u81F3\u81F4\u7F6E\u5E1C\u5CD9\u5236\u667A\u79E9\u7A1A\u8D28\u7099\u75D4\u6EDE\u6CBB\u7A92\u4E2D\u76C5\u5FE0\u949F\u8877\u7EC8\u79CD\u80BF\u91CD\u4EF2\u4F17\u821F\u5468\u5DDE\u6D32\u8BCC\u7CA5\u8F74\u8098\u5E1A\u5492\u76B1\u5B99\u663C\u9AA4\u73E0\u682A\u86DB\u6731\u732A\u8BF8\u8BDB\u9010\u7AF9\u70DB\u716E\u62C4\u77A9\u5631\u4E3B\u8457\u67F1\u52A9\u86C0\u8D2E\u94F8\u7B51"], + ["d740", "\u8B46", 31, "\u8B67", 4, "\u8B6D", 25], + ["d780", "\u8B87", 24, "\u8BAC\u8BB1\u8BBB\u8BC7\u8BD0\u8BEA\u8C09\u8C1E\u4F4F\u6CE8\u795D\u9A7B\u6293\u722A\u62FD\u4E13\u7816\u8F6C\u64B0\u8D5A\u7BC6\u6869\u5E84\u88C5\u5986\u649E\u58EE\u72B6\u690E\u9525\u8FFD\u8D58\u5760\u7F00\u8C06\u51C6\u6349\u62D9\u5353\u684C\u7422\u8301\u914C\u5544\u7740\u707C\u6D4A\u5179\u54A8\u8D44\u59FF\u6ECB\u6DC4\u5B5C\u7D2B\u4ED4\u7C7D\u6ED3\u5B50\u81EA\u6E0D\u5B57\u9B03\u68D5\u8E2A\u5B97\u7EFC\u603B\u7EB5\u90B9\u8D70\u594F\u63CD\u79DF\u8DB3\u5352\u65CF\u7956\u8BC5\u963B\u7EC4\u94BB\u7E82\u5634\u9189\u6700\u7F6A\u5C0A\u9075\u6628\u5DE6\u4F50\u67DE\u505A\u4F5C\u5750\u5EA7"], + ["d840", "\u8C38", 8, "\u8C42\u8C43\u8C44\u8C45\u8C48\u8C4A\u8C4B\u8C4D", 7, "\u8C56\u8C57\u8C58\u8C59\u8C5B", 5, "\u8C63", 6, "\u8C6C", 6, "\u8C74\u8C75\u8C76\u8C77\u8C7B", 6, "\u8C83\u8C84\u8C86\u8C87"], + ["d880", "\u8C88\u8C8B\u8C8D", 6, "\u8C95\u8C96\u8C97\u8C99", 20, "\u4E8D\u4E0C\u5140\u4E10\u5EFF\u5345\u4E15\u4E98\u4E1E\u9B32\u5B6C\u5669\u4E28\u79BA\u4E3F\u5315\u4E47\u592D\u723B\u536E\u6C10\u56DF\u80E4\u9997\u6BD3\u777E\u9F17\u4E36\u4E9F\u9F10\u4E5C\u4E69\u4E93\u8288\u5B5B\u556C\u560F\u4EC4\u538D\u539D\u53A3\u53A5\u53AE\u9765\u8D5D\u531A\u53F5\u5326\u532E\u533E\u8D5C\u5366\u5363\u5202\u5208\u520E\u522D\u5233\u523F\u5240\u524C\u525E\u5261\u525C\u84AF\u527D\u5282\u5281\u5290\u5293\u5182\u7F54\u4EBB\u4EC3\u4EC9\u4EC2\u4EE8\u4EE1\u4EEB\u4EDE\u4F1B\u4EF3\u4F22\u4F64\u4EF5\u4F25\u4F27\u4F09\u4F2B\u4F5E\u4F67\u6538\u4F5A\u4F5D"], + ["d940", "\u8CAE", 62], + ["d980", "\u8CED", 32, "\u4F5F\u4F57\u4F32\u4F3D\u4F76\u4F74\u4F91\u4F89\u4F83\u4F8F\u4F7E\u4F7B\u4FAA\u4F7C\u4FAC\u4F94\u4FE6\u4FE8\u4FEA\u4FC5\u4FDA\u4FE3\u4FDC\u4FD1\u4FDF\u4FF8\u5029\u504C\u4FF3\u502C\u500F\u502E\u502D\u4FFE\u501C\u500C\u5025\u5028\u507E\u5043\u5055\u5048\u504E\u506C\u507B\u50A5\u50A7\u50A9\u50BA\u50D6\u5106\u50ED\u50EC\u50E6\u50EE\u5107\u510B\u4EDD\u6C3D\u4F58\u4F65\u4FCE\u9FA0\u6C46\u7C74\u516E\u5DFD\u9EC9\u9998\u5181\u5914\u52F9\u530D\u8A07\u5310\u51EB\u5919\u5155\u4EA0\u5156\u4EB3\u886E\u88A4\u4EB5\u8114\u88D2\u7980\u5B34\u8803\u7FB8\u51AB\u51B1\u51BD\u51BC"], + ["da40", "\u8D0E", 14, "\u8D20\u8D51\u8D52\u8D57\u8D5F\u8D65\u8D68\u8D69\u8D6A\u8D6C\u8D6E\u8D6F\u8D71\u8D72\u8D78", 8, "\u8D82\u8D83\u8D86\u8D87\u8D88\u8D89\u8D8C", 4, "\u8D92\u8D93\u8D95", 9, "\u8DA0\u8DA1"], + ["da80", "\u8DA2\u8DA4", 12, "\u8DB2\u8DB6\u8DB7\u8DB9\u8DBB\u8DBD\u8DC0\u8DC1\u8DC2\u8DC5\u8DC7\u8DC8\u8DC9\u8DCA\u8DCD\u8DD0\u8DD2\u8DD3\u8DD4\u51C7\u5196\u51A2\u51A5\u8BA0\u8BA6\u8BA7\u8BAA\u8BB4\u8BB5\u8BB7\u8BC2\u8BC3\u8BCB\u8BCF\u8BCE\u8BD2\u8BD3\u8BD4\u8BD6\u8BD8\u8BD9\u8BDC\u8BDF\u8BE0\u8BE4\u8BE8\u8BE9\u8BEE\u8BF0\u8BF3\u8BF6\u8BF9\u8BFC\u8BFF\u8C00\u8C02\u8C04\u8C07\u8C0C\u8C0F\u8C11\u8C12\u8C14\u8C15\u8C16\u8C19\u8C1B\u8C18\u8C1D\u8C1F\u8C20\u8C21\u8C25\u8C27\u8C2A\u8C2B\u8C2E\u8C2F\u8C32\u8C33\u8C35\u8C36\u5369\u537A\u961D\u9622\u9621\u9631\u962A\u963D\u963C\u9642\u9649\u9654\u965F\u9667\u966C\u9672\u9674\u9688\u968D\u9697\u96B0\u9097\u909B\u909D\u9099\u90AC\u90A1\u90B4\u90B3\u90B6\u90BA"], + ["db40", "\u8DD5\u8DD8\u8DD9\u8DDC\u8DE0\u8DE1\u8DE2\u8DE5\u8DE6\u8DE7\u8DE9\u8DED\u8DEE\u8DF0\u8DF1\u8DF2\u8DF4\u8DF6\u8DFC\u8DFE", 6, "\u8E06\u8E07\u8E08\u8E0B\u8E0D\u8E0E\u8E10\u8E11\u8E12\u8E13\u8E15", 7, "\u8E20\u8E21\u8E24", 4, "\u8E2B\u8E2D\u8E30\u8E32\u8E33\u8E34\u8E36\u8E37\u8E38\u8E3B\u8E3C\u8E3E"], + ["db80", "\u8E3F\u8E43\u8E45\u8E46\u8E4C", 4, "\u8E53", 5, "\u8E5A", 11, "\u8E67\u8E68\u8E6A\u8E6B\u8E6E\u8E71\u90B8\u90B0\u90CF\u90C5\u90BE\u90D0\u90C4\u90C7\u90D3\u90E6\u90E2\u90DC\u90D7\u90DB\u90EB\u90EF\u90FE\u9104\u9122\u911E\u9123\u9131\u912F\u9139\u9143\u9146\u520D\u5942\u52A2\u52AC\u52AD\u52BE\u54FF\u52D0\u52D6\u52F0\u53DF\u71EE\u77CD\u5EF4\u51F5\u51FC\u9B2F\u53B6\u5F01\u755A\u5DEF\u574C\u57A9\u57A1\u587E\u58BC\u58C5\u58D1\u5729\u572C\u572A\u5733\u5739\u572E\u572F\u575C\u573B\u5742\u5769\u5785\u576B\u5786\u577C\u577B\u5768\u576D\u5776\u5773\u57AD\u57A4\u578C\u57B2\u57CF\u57A7\u57B4\u5793\u57A0\u57D5\u57D8\u57DA\u57D9\u57D2\u57B8\u57F4\u57EF\u57F8\u57E4\u57DD"], + ["dc40", "\u8E73\u8E75\u8E77", 4, "\u8E7D\u8E7E\u8E80\u8E82\u8E83\u8E84\u8E86\u8E88", 6, "\u8E91\u8E92\u8E93\u8E95", 6, "\u8E9D\u8E9F", 11, "\u8EAD\u8EAE\u8EB0\u8EB1\u8EB3", 6, "\u8EBB", 7], + ["dc80", "\u8EC3", 10, "\u8ECF", 21, "\u580B\u580D\u57FD\u57ED\u5800\u581E\u5819\u5844\u5820\u5865\u586C\u5881\u5889\u589A\u5880\u99A8\u9F19\u61FF\u8279\u827D\u827F\u828F\u828A\u82A8\u8284\u828E\u8291\u8297\u8299\u82AB\u82B8\u82BE\u82B0\u82C8\u82CA\u82E3\u8298\u82B7\u82AE\u82CB\u82CC\u82C1\u82A9\u82B4\u82A1\u82AA\u829F\u82C4\u82CE\u82A4\u82E1\u8309\u82F7\u82E4\u830F\u8307\u82DC\u82F4\u82D2\u82D8\u830C\u82FB\u82D3\u8311\u831A\u8306\u8314\u8315\u82E0\u82D5\u831C\u8351\u835B\u835C\u8308\u8392\u833C\u8334\u8331\u839B\u835E\u832F\u834F\u8347\u8343\u835F\u8340\u8317\u8360\u832D\u833A\u8333\u8366\u8365"], + ["dd40", "\u8EE5", 62], + ["dd80", "\u8F24", 32, "\u8368\u831B\u8369\u836C\u836A\u836D\u836E\u83B0\u8378\u83B3\u83B4\u83A0\u83AA\u8393\u839C\u8385\u837C\u83B6\u83A9\u837D\u83B8\u837B\u8398\u839E\u83A8\u83BA\u83BC\u83C1\u8401\u83E5\u83D8\u5807\u8418\u840B\u83DD\u83FD\u83D6\u841C\u8438\u8411\u8406\u83D4\u83DF\u840F\u8403\u83F8\u83F9\u83EA\u83C5\u83C0\u8426\u83F0\u83E1\u845C\u8451\u845A\u8459\u8473\u8487\u8488\u847A\u8489\u8478\u843C\u8446\u8469\u8476\u848C\u848E\u8431\u846D\u84C1\u84CD\u84D0\u84E6\u84BD\u84D3\u84CA\u84BF\u84BA\u84E0\u84A1\u84B9\u84B4\u8497\u84E5\u84E3\u850C\u750D\u8538\u84F0\u8539\u851F\u853A"], + ["de40", "\u8F45", 32, "\u8F6A\u8F80\u8F8C\u8F92\u8F9D\u8FA0\u8FA1\u8FA2\u8FA4\u8FA5\u8FA6\u8FA7\u8FAA\u8FAC\u8FAD\u8FAE\u8FAF\u8FB2\u8FB3\u8FB4\u8FB5\u8FB7\u8FB8\u8FBA\u8FBB\u8FBC\u8FBF\u8FC0\u8FC3\u8FC6"], + ["de80", "\u8FC9", 4, "\u8FCF\u8FD2\u8FD6\u8FD7\u8FDA\u8FE0\u8FE1\u8FE3\u8FE7\u8FEC\u8FEF\u8FF1\u8FF2\u8FF4\u8FF5\u8FF6\u8FFA\u8FFB\u8FFC\u8FFE\u8FFF\u9007\u9008\u900C\u900E\u9013\u9015\u9018\u8556\u853B\u84FF\u84FC\u8559\u8548\u8568\u8564\u855E\u857A\u77A2\u8543\u8572\u857B\u85A4\u85A8\u8587\u858F\u8579\u85AE\u859C\u8585\u85B9\u85B7\u85B0\u85D3\u85C1\u85DC\u85FF\u8627\u8605\u8629\u8616\u863C\u5EFE\u5F08\u593C\u5941\u8037\u5955\u595A\u5958\u530F\u5C22\u5C25\u5C2C\u5C34\u624C\u626A\u629F\u62BB\u62CA\u62DA\u62D7\u62EE\u6322\u62F6\u6339\u634B\u6343\u63AD\u63F6\u6371\u637A\u638E\u63B4\u636D\u63AC\u638A\u6369\u63AE\u63BC\u63F2\u63F8\u63E0\u63FF\u63C4\u63DE\u63CE\u6452\u63C6\u63BE\u6445\u6441\u640B\u641B\u6420\u640C\u6426\u6421\u645E\u6484\u646D\u6496"], + ["df40", "\u9019\u901C\u9023\u9024\u9025\u9027", 5, "\u9030", 4, "\u9037\u9039\u903A\u903D\u903F\u9040\u9043\u9045\u9046\u9048", 4, "\u904E\u9054\u9055\u9056\u9059\u905A\u905C", 5, "\u9064\u9066\u9067\u9069\u906A\u906B\u906C\u906F", 4, "\u9076", 6, "\u907E\u9081"], + ["df80", "\u9084\u9085\u9086\u9087\u9089\u908A\u908C", 4, "\u9092\u9094\u9096\u9098\u909A\u909C\u909E\u909F\u90A0\u90A4\u90A5\u90A7\u90A8\u90A9\u90AB\u90AD\u90B2\u90B7\u90BC\u90BD\u90BF\u90C0\u647A\u64B7\u64B8\u6499\u64BA\u64C0\u64D0\u64D7\u64E4\u64E2\u6509\u6525\u652E\u5F0B\u5FD2\u7519\u5F11\u535F\u53F1\u53FD\u53E9\u53E8\u53FB\u5412\u5416\u5406\u544B\u5452\u5453\u5454\u5456\u5443\u5421\u5457\u5459\u5423\u5432\u5482\u5494\u5477\u5471\u5464\u549A\u549B\u5484\u5476\u5466\u549D\u54D0\u54AD\u54C2\u54B4\u54D2\u54A7\u54A6\u54D3\u54D4\u5472\u54A3\u54D5\u54BB\u54BF\u54CC\u54D9\u54DA\u54DC\u54A9\u54AA\u54A4\u54DD\u54CF\u54DE\u551B\u54E7\u5520\u54FD\u5514\u54F3\u5522\u5523\u550F\u5511\u5527\u552A\u5567\u558F\u55B5\u5549\u556D\u5541\u5555\u553F\u5550\u553C"], + ["e040", "\u90C2\u90C3\u90C6\u90C8\u90C9\u90CB\u90CC\u90CD\u90D2\u90D4\u90D5\u90D6\u90D8\u90D9\u90DA\u90DE\u90DF\u90E0\u90E3\u90E4\u90E5\u90E9\u90EA\u90EC\u90EE\u90F0\u90F1\u90F2\u90F3\u90F5\u90F6\u90F7\u90F9\u90FA\u90FB\u90FC\u90FF\u9100\u9101\u9103\u9105", 19, "\u911A\u911B\u911C"], + ["e080", "\u911D\u911F\u9120\u9121\u9124", 10, "\u9130\u9132", 6, "\u913A", 8, "\u9144\u5537\u5556\u5575\u5576\u5577\u5533\u5530\u555C\u558B\u55D2\u5583\u55B1\u55B9\u5588\u5581\u559F\u557E\u55D6\u5591\u557B\u55DF\u55BD\u55BE\u5594\u5599\u55EA\u55F7\u55C9\u561F\u55D1\u55EB\u55EC\u55D4\u55E6\u55DD\u55C4\u55EF\u55E5\u55F2\u55F3\u55CC\u55CD\u55E8\u55F5\u55E4\u8F94\u561E\u5608\u560C\u5601\u5624\u5623\u55FE\u5600\u5627\u562D\u5658\u5639\u5657\u562C\u564D\u5662\u5659\u565C\u564C\u5654\u5686\u5664\u5671\u566B\u567B\u567C\u5685\u5693\u56AF\u56D4\u56D7\u56DD\u56E1\u56F5\u56EB\u56F9\u56FF\u5704\u570A\u5709\u571C\u5E0F\u5E19\u5E14\u5E11\u5E31\u5E3B\u5E3C"], + ["e140", "\u9145\u9147\u9148\u9151\u9153\u9154\u9155\u9156\u9158\u9159\u915B\u915C\u915F\u9160\u9166\u9167\u9168\u916B\u916D\u9173\u917A\u917B\u917C\u9180", 4, "\u9186\u9188\u918A\u918E\u918F\u9193", 6, "\u919C", 5, "\u91A4", 5, "\u91AB\u91AC\u91B0\u91B1\u91B2\u91B3\u91B6\u91B7\u91B8\u91B9\u91BB"], + ["e180", "\u91BC", 10, "\u91C8\u91CB\u91D0\u91D2", 9, "\u91DD", 8, "\u5E37\u5E44\u5E54\u5E5B\u5E5E\u5E61\u5C8C\u5C7A\u5C8D\u5C90\u5C96\u5C88\u5C98\u5C99\u5C91\u5C9A\u5C9C\u5CB5\u5CA2\u5CBD\u5CAC\u5CAB\u5CB1\u5CA3\u5CC1\u5CB7\u5CC4\u5CD2\u5CE4\u5CCB\u5CE5\u5D02\u5D03\u5D27\u5D26\u5D2E\u5D24\u5D1E\u5D06\u5D1B\u5D58\u5D3E\u5D34\u5D3D\u5D6C\u5D5B\u5D6F\u5D5D\u5D6B\u5D4B\u5D4A\u5D69\u5D74\u5D82\u5D99\u5D9D\u8C73\u5DB7\u5DC5\u5F73\u5F77\u5F82\u5F87\u5F89\u5F8C\u5F95\u5F99\u5F9C\u5FA8\u5FAD\u5FB5\u5FBC\u8862\u5F61\u72AD\u72B0\u72B4\u72B7\u72B8\u72C3\u72C1\u72CE\u72CD\u72D2\u72E8\u72EF\u72E9\u72F2\u72F4\u72F7\u7301\u72F3\u7303\u72FA"], + ["e240", "\u91E6", 62], + ["e280", "\u9225", 32, "\u72FB\u7317\u7313\u7321\u730A\u731E\u731D\u7315\u7322\u7339\u7325\u732C\u7338\u7331\u7350\u734D\u7357\u7360\u736C\u736F\u737E\u821B\u5925\u98E7\u5924\u5902\u9963\u9967", 5, "\u9974\u9977\u997D\u9980\u9984\u9987\u998A\u998D\u9990\u9991\u9993\u9994\u9995\u5E80\u5E91\u5E8B\u5E96\u5EA5\u5EA0\u5EB9\u5EB5\u5EBE\u5EB3\u8D53\u5ED2\u5ED1\u5EDB\u5EE8\u5EEA\u81BA\u5FC4\u5FC9\u5FD6\u5FCF\u6003\u5FEE\u6004\u5FE1\u5FE4\u5FFE\u6005\u6006\u5FEA\u5FED\u5FF8\u6019\u6035\u6026\u601B\u600F\u600D\u6029\u602B\u600A\u603F\u6021\u6078\u6079\u607B\u607A\u6042"], + ["e340", "\u9246", 45, "\u9275", 16], + ["e380", "\u9286", 7, "\u928F", 24, "\u606A\u607D\u6096\u609A\u60AD\u609D\u6083\u6092\u608C\u609B\u60EC\u60BB\u60B1\u60DD\u60D8\u60C6\u60DA\u60B4\u6120\u6126\u6115\u6123\u60F4\u6100\u610E\u612B\u614A\u6175\u61AC\u6194\u61A7\u61B7\u61D4\u61F5\u5FDD\u96B3\u95E9\u95EB\u95F1\u95F3\u95F5\u95F6\u95FC\u95FE\u9603\u9604\u9606\u9608\u960A\u960B\u960C\u960D\u960F\u9612\u9615\u9616\u9617\u9619\u961A\u4E2C\u723F\u6215\u6C35\u6C54\u6C5C\u6C4A\u6CA3\u6C85\u6C90\u6C94\u6C8C\u6C68\u6C69\u6C74\u6C76\u6C86\u6CA9\u6CD0\u6CD4\u6CAD\u6CF7\u6CF8\u6CF1\u6CD7\u6CB2\u6CE0\u6CD6\u6CFA\u6CEB\u6CEE\u6CB1\u6CD3\u6CEF\u6CFE"], + ["e440", "\u92A8", 5, "\u92AF", 24, "\u92C9", 31], + ["e480", "\u92E9", 32, "\u6D39\u6D27\u6D0C\u6D43\u6D48\u6D07\u6D04\u6D19\u6D0E\u6D2B\u6D4D\u6D2E\u6D35\u6D1A\u6D4F\u6D52\u6D54\u6D33\u6D91\u6D6F\u6D9E\u6DA0\u6D5E\u6D93\u6D94\u6D5C\u6D60\u6D7C\u6D63\u6E1A\u6DC7\u6DC5\u6DDE\u6E0E\u6DBF\u6DE0\u6E11\u6DE6\u6DDD\u6DD9\u6E16\u6DAB\u6E0C\u6DAE\u6E2B\u6E6E\u6E4E\u6E6B\u6EB2\u6E5F\u6E86\u6E53\u6E54\u6E32\u6E25\u6E44\u6EDF\u6EB1\u6E98\u6EE0\u6F2D\u6EE2\u6EA5\u6EA7\u6EBD\u6EBB\u6EB7\u6ED7\u6EB4\u6ECF\u6E8F\u6EC2\u6E9F\u6F62\u6F46\u6F47\u6F24\u6F15\u6EF9\u6F2F\u6F36\u6F4B\u6F74\u6F2A\u6F09\u6F29\u6F89\u6F8D\u6F8C\u6F78\u6F72\u6F7C\u6F7A\u6FD1"], + ["e540", "\u930A", 51, "\u933F", 10], + ["e580", "\u934A", 31, "\u936B\u6FC9\u6FA7\u6FB9\u6FB6\u6FC2\u6FE1\u6FEE\u6FDE\u6FE0\u6FEF\u701A\u7023\u701B\u7039\u7035\u704F\u705E\u5B80\u5B84\u5B95\u5B93\u5BA5\u5BB8\u752F\u9A9E\u6434\u5BE4\u5BEE\u8930\u5BF0\u8E47\u8B07\u8FB6\u8FD3\u8FD5\u8FE5\u8FEE\u8FE4\u8FE9\u8FE6\u8FF3\u8FE8\u9005\u9004\u900B\u9026\u9011\u900D\u9016\u9021\u9035\u9036\u902D\u902F\u9044\u9051\u9052\u9050\u9068\u9058\u9062\u905B\u66B9\u9074\u907D\u9082\u9088\u9083\u908B\u5F50\u5F57\u5F56\u5F58\u5C3B\u54AB\u5C50\u5C59\u5B71\u5C63\u5C66\u7FBC\u5F2A\u5F29\u5F2D\u8274\u5F3C\u9B3B\u5C6E\u5981\u5983\u598D\u59A9\u59AA\u59A3"], + ["e640", "\u936C", 34, "\u9390", 27], + ["e680", "\u93AC", 29, "\u93CB\u93CC\u93CD\u5997\u59CA\u59AB\u599E\u59A4\u59D2\u59B2\u59AF\u59D7\u59BE\u5A05\u5A06\u59DD\u5A08\u59E3\u59D8\u59F9\u5A0C\u5A09\u5A32\u5A34\u5A11\u5A23\u5A13\u5A40\u5A67\u5A4A\u5A55\u5A3C\u5A62\u5A75\u80EC\u5AAA\u5A9B\u5A77\u5A7A\u5ABE\u5AEB\u5AB2\u5AD2\u5AD4\u5AB8\u5AE0\u5AE3\u5AF1\u5AD6\u5AE6\u5AD8\u5ADC\u5B09\u5B17\u5B16\u5B32\u5B37\u5B40\u5C15\u5C1C\u5B5A\u5B65\u5B73\u5B51\u5B53\u5B62\u9A75\u9A77\u9A78\u9A7A\u9A7F\u9A7D\u9A80\u9A81\u9A85\u9A88\u9A8A\u9A90\u9A92\u9A93\u9A96\u9A98\u9A9B\u9A9C\u9A9D\u9A9F\u9AA0\u9AA2\u9AA3\u9AA5\u9AA7\u7E9F\u7EA1\u7EA3\u7EA5\u7EA8\u7EA9"], + ["e740", "\u93CE", 7, "\u93D7", 54], + ["e780", "\u940E", 32, "\u7EAD\u7EB0\u7EBE\u7EC0\u7EC1\u7EC2\u7EC9\u7ECB\u7ECC\u7ED0\u7ED4\u7ED7\u7EDB\u7EE0\u7EE1\u7EE8\u7EEB\u7EEE\u7EEF\u7EF1\u7EF2\u7F0D\u7EF6\u7EFA\u7EFB\u7EFE\u7F01\u7F02\u7F03\u7F07\u7F08\u7F0B\u7F0C\u7F0F\u7F11\u7F12\u7F17\u7F19\u7F1C\u7F1B\u7F1F\u7F21", 6, "\u7F2A\u7F2B\u7F2C\u7F2D\u7F2F", 4, "\u7F35\u5E7A\u757F\u5DDB\u753E\u9095\u738E\u7391\u73AE\u73A2\u739F\u73CF\u73C2\u73D1\u73B7\u73B3\u73C0\u73C9\u73C8\u73E5\u73D9\u987C\u740A\u73E9\u73E7\u73DE\u73BA\u73F2\u740F\u742A\u745B\u7426\u7425\u7428\u7430\u742E\u742C"], + ["e840", "\u942F", 14, "\u943F", 43, "\u946C\u946D\u946E\u946F"], + ["e880", "\u9470", 20, "\u9491\u9496\u9498\u94C7\u94CF\u94D3\u94D4\u94DA\u94E6\u94FB\u951C\u9520\u741B\u741A\u7441\u745C\u7457\u7455\u7459\u7477\u746D\u747E\u749C\u748E\u7480\u7481\u7487\u748B\u749E\u74A8\u74A9\u7490\u74A7\u74D2\u74BA\u97EA\u97EB\u97EC\u674C\u6753\u675E\u6748\u6769\u67A5\u6787\u676A\u6773\u6798\u67A7\u6775\u67A8\u679E\u67AD\u678B\u6777\u677C\u67F0\u6809\u67D8\u680A\u67E9\u67B0\u680C\u67D9\u67B5\u67DA\u67B3\u67DD\u6800\u67C3\u67B8\u67E2\u680E\u67C1\u67FD\u6832\u6833\u6860\u6861\u684E\u6862\u6844\u6864\u6883\u681D\u6855\u6866\u6841\u6867\u6840\u683E\u684A\u6849\u6829\u68B5\u688F\u6874\u6877\u6893\u686B\u68C2\u696E\u68FC\u691F\u6920\u68F9"], + ["e940", "\u9527\u9533\u953D\u9543\u9548\u954B\u9555\u955A\u9560\u956E\u9574\u9575\u9577", 7, "\u9580", 42], + ["e980", "\u95AB", 32, "\u6924\u68F0\u690B\u6901\u6957\u68E3\u6910\u6971\u6939\u6960\u6942\u695D\u6984\u696B\u6980\u6998\u6978\u6934\u69CC\u6987\u6988\u69CE\u6989\u6966\u6963\u6979\u699B\u69A7\u69BB\u69AB\u69AD\u69D4\u69B1\u69C1\u69CA\u69DF\u6995\u69E0\u698D\u69FF\u6A2F\u69ED\u6A17\u6A18\u6A65\u69F2\u6A44\u6A3E\u6AA0\u6A50\u6A5B\u6A35\u6A8E\u6A79\u6A3D\u6A28\u6A58\u6A7C\u6A91\u6A90\u6AA9\u6A97\u6AAB\u7337\u7352\u6B81\u6B82\u6B87\u6B84\u6B92\u6B93\u6B8D\u6B9A\u6B9B\u6BA1\u6BAA\u8F6B\u8F6D\u8F71\u8F72\u8F73\u8F75\u8F76\u8F78\u8F77\u8F79\u8F7A\u8F7C\u8F7E\u8F81\u8F82\u8F84\u8F87\u8F8B"], + ["ea40", "\u95CC", 27, "\u95EC\u95FF\u9607\u9613\u9618\u961B\u961E\u9620\u9623", 6, "\u962B\u962C\u962D\u962F\u9630\u9637\u9638\u9639\u963A\u963E\u9641\u9643\u964A\u964E\u964F\u9651\u9652\u9653\u9656\u9657"], + ["ea80", "\u9658\u9659\u965A\u965C\u965D\u965E\u9660\u9663\u9665\u9666\u966B\u966D", 4, "\u9673\u9678", 12, "\u9687\u9689\u968A\u8F8D\u8F8E\u8F8F\u8F98\u8F9A\u8ECE\u620B\u6217\u621B\u621F\u6222\u6221\u6225\u6224\u622C\u81E7\u74EF\u74F4\u74FF\u750F\u7511\u7513\u6534\u65EE\u65EF\u65F0\u660A\u6619\u6772\u6603\u6615\u6600\u7085\u66F7\u661D\u6634\u6631\u6636\u6635\u8006\u665F\u6654\u6641\u664F\u6656\u6661\u6657\u6677\u6684\u668C\u66A7\u669D\u66BE\u66DB\u66DC\u66E6\u66E9\u8D32\u8D33\u8D36\u8D3B\u8D3D\u8D40\u8D45\u8D46\u8D48\u8D49\u8D47\u8D4D\u8D55\u8D59\u89C7\u89CA\u89CB\u89CC\u89CE\u89CF\u89D0\u89D1\u726E\u729F\u725D\u7266\u726F\u727E\u727F\u7284\u728B\u728D\u728F\u7292\u6308\u6332\u63B0"], + ["eb40", "\u968C\u968E\u9691\u9692\u9693\u9695\u9696\u969A\u969B\u969D", 9, "\u96A8", 7, "\u96B1\u96B2\u96B4\u96B5\u96B7\u96B8\u96BA\u96BB\u96BF\u96C2\u96C3\u96C8\u96CA\u96CB\u96D0\u96D1\u96D3\u96D4\u96D6", 9, "\u96E1", 6, "\u96EB"], + ["eb80", "\u96EC\u96ED\u96EE\u96F0\u96F1\u96F2\u96F4\u96F5\u96F8\u96FA\u96FB\u96FC\u96FD\u96FF\u9702\u9703\u9705\u970A\u970B\u970C\u9710\u9711\u9712\u9714\u9715\u9717", 4, "\u971D\u971F\u9720\u643F\u64D8\u8004\u6BEA\u6BF3\u6BFD\u6BF5\u6BF9\u6C05\u6C07\u6C06\u6C0D\u6C15\u6C18\u6C19\u6C1A\u6C21\u6C29\u6C24\u6C2A\u6C32\u6535\u6555\u656B\u724D\u7252\u7256\u7230\u8662\u5216\u809F\u809C\u8093\u80BC\u670A\u80BD\u80B1\u80AB\u80AD\u80B4\u80B7\u80E7\u80E8\u80E9\u80EA\u80DB\u80C2\u80C4\u80D9\u80CD\u80D7\u6710\u80DD\u80EB\u80F1\u80F4\u80ED\u810D\u810E\u80F2\u80FC\u6715\u8112\u8C5A\u8136\u811E\u812C\u8118\u8132\u8148\u814C\u8153\u8174\u8159\u815A\u8171\u8160\u8169\u817C\u817D\u816D\u8167\u584D\u5AB5\u8188\u8182\u8191\u6ED5\u81A3\u81AA\u81CC\u6726\u81CA\u81BB"], + ["ec40", "\u9721", 8, "\u972B\u972C\u972E\u972F\u9731\u9733", 4, "\u973A\u973B\u973C\u973D\u973F", 18, "\u9754\u9755\u9757\u9758\u975A\u975C\u975D\u975F\u9763\u9764\u9766\u9767\u9768\u976A", 7], + ["ec80", "\u9772\u9775\u9777", 4, "\u977D", 7, "\u9786", 4, "\u978C\u978E\u978F\u9790\u9793\u9795\u9796\u9797\u9799", 4, "\u81C1\u81A6\u6B24\u6B37\u6B39\u6B43\u6B46\u6B59\u98D1\u98D2\u98D3\u98D5\u98D9\u98DA\u6BB3\u5F40\u6BC2\u89F3\u6590\u9F51\u6593\u65BC\u65C6\u65C4\u65C3\u65CC\u65CE\u65D2\u65D6\u7080\u709C\u7096\u709D\u70BB\u70C0\u70B7\u70AB\u70B1\u70E8\u70CA\u7110\u7113\u7116\u712F\u7131\u7173\u715C\u7168\u7145\u7172\u714A\u7178\u717A\u7198\u71B3\u71B5\u71A8\u71A0\u71E0\u71D4\u71E7\u71F9\u721D\u7228\u706C\u7118\u7166\u71B9\u623E\u623D\u6243\u6248\u6249\u793B\u7940\u7946\u7949\u795B\u795C\u7953\u795A\u7962\u7957\u7960\u796F\u7967\u797A\u7985\u798A\u799A\u79A7\u79B3\u5FD1\u5FD0"], + ["ed40", "\u979E\u979F\u97A1\u97A2\u97A4", 6, "\u97AC\u97AE\u97B0\u97B1\u97B3\u97B5", 46], + ["ed80", "\u97E4\u97E5\u97E8\u97EE", 4, "\u97F4\u97F7", 23, "\u603C\u605D\u605A\u6067\u6041\u6059\u6063\u60AB\u6106\u610D\u615D\u61A9\u619D\u61CB\u61D1\u6206\u8080\u807F\u6C93\u6CF6\u6DFC\u77F6\u77F8\u7800\u7809\u7817\u7818\u7811\u65AB\u782D\u781C\u781D\u7839\u783A\u783B\u781F\u783C\u7825\u782C\u7823\u7829\u784E\u786D\u7856\u7857\u7826\u7850\u7847\u784C\u786A\u789B\u7893\u789A\u7887\u789C\u78A1\u78A3\u78B2\u78B9\u78A5\u78D4\u78D9\u78C9\u78EC\u78F2\u7905\u78F4\u7913\u7924\u791E\u7934\u9F9B\u9EF9\u9EFB\u9EFC\u76F1\u7704\u770D\u76F9\u7707\u7708\u771A\u7722\u7719\u772D\u7726\u7735\u7738\u7750\u7751\u7747\u7743\u775A\u7768"], + ["ee40", "\u980F", 62], + ["ee80", "\u984E", 32, "\u7762\u7765\u777F\u778D\u777D\u7780\u778C\u7791\u779F\u77A0\u77B0\u77B5\u77BD\u753A\u7540\u754E\u754B\u7548\u755B\u7572\u7579\u7583\u7F58\u7F61\u7F5F\u8A48\u7F68\u7F74\u7F71\u7F79\u7F81\u7F7E\u76CD\u76E5\u8832\u9485\u9486\u9487\u948B\u948A\u948C\u948D\u948F\u9490\u9494\u9497\u9495\u949A\u949B\u949C\u94A3\u94A4\u94AB\u94AA\u94AD\u94AC\u94AF\u94B0\u94B2\u94B4\u94B6", 4, "\u94BC\u94BD\u94BF\u94C4\u94C8", 6, "\u94D0\u94D1\u94D2\u94D5\u94D6\u94D7\u94D9\u94D8\u94DB\u94DE\u94DF\u94E0\u94E2\u94E4\u94E5\u94E7\u94E8\u94EA"], + ["ef40", "\u986F", 5, "\u988B\u988E\u9892\u9895\u9899\u98A3\u98A8", 37, "\u98CF\u98D0\u98D4\u98D6\u98D7\u98DB\u98DC\u98DD\u98E0", 4], + ["ef80", "\u98E5\u98E6\u98E9", 30, "\u94E9\u94EB\u94EE\u94EF\u94F3\u94F4\u94F5\u94F7\u94F9\u94FC\u94FD\u94FF\u9503\u9502\u9506\u9507\u9509\u950A\u950D\u950E\u950F\u9512", 4, "\u9518\u951B\u951D\u951E\u951F\u9522\u952A\u952B\u9529\u952C\u9531\u9532\u9534\u9536\u9537\u9538\u953C\u953E\u953F\u9542\u9535\u9544\u9545\u9546\u9549\u954C\u954E\u954F\u9552\u9553\u9554\u9556\u9557\u9558\u9559\u955B\u955E\u955F\u955D\u9561\u9562\u9564", 8, "\u956F\u9571\u9572\u9573\u953A\u77E7\u77EC\u96C9\u79D5\u79ED\u79E3\u79EB\u7A06\u5D47\u7A03\u7A02\u7A1E\u7A14"], + ["f040", "\u9908", 4, "\u990E\u990F\u9911", 28, "\u992F", 26], + ["f080", "\u994A", 9, "\u9956", 12, "\u9964\u9966\u9973\u9978\u9979\u997B\u997E\u9982\u9983\u9989\u7A39\u7A37\u7A51\u9ECF\u99A5\u7A70\u7688\u768E\u7693\u7699\u76A4\u74DE\u74E0\u752C\u9E20\u9E22\u9E28", 4, "\u9E32\u9E31\u9E36\u9E38\u9E37\u9E39\u9E3A\u9E3E\u9E41\u9E42\u9E44\u9E46\u9E47\u9E48\u9E49\u9E4B\u9E4C\u9E4E\u9E51\u9E55\u9E57\u9E5A\u9E5B\u9E5C\u9E5E\u9E63\u9E66", 6, "\u9E71\u9E6D\u9E73\u7592\u7594\u7596\u75A0\u759D\u75AC\u75A3\u75B3\u75B4\u75B8\u75C4\u75B1\u75B0\u75C3\u75C2\u75D6\u75CD\u75E3\u75E8\u75E6\u75E4\u75EB\u75E7\u7603\u75F1\u75FC\u75FF\u7610\u7600\u7605\u760C\u7617\u760A\u7625\u7618\u7615\u7619"], + ["f140", "\u998C\u998E\u999A", 10, "\u99A6\u99A7\u99A9", 47], + ["f180", "\u99D9", 32, "\u761B\u763C\u7622\u7620\u7640\u762D\u7630\u763F\u7635\u7643\u763E\u7633\u764D\u765E\u7654\u765C\u7656\u766B\u766F\u7FCA\u7AE6\u7A78\u7A79\u7A80\u7A86\u7A88\u7A95\u7AA6\u7AA0\u7AAC\u7AA8\u7AAD\u7AB3\u8864\u8869\u8872\u887D\u887F\u8882\u88A2\u88C6\u88B7\u88BC\u88C9\u88E2\u88CE\u88E3\u88E5\u88F1\u891A\u88FC\u88E8\u88FE\u88F0\u8921\u8919\u8913\u891B\u890A\u8934\u892B\u8936\u8941\u8966\u897B\u758B\u80E5\u76B2\u76B4\u77DC\u8012\u8014\u8016\u801C\u8020\u8022\u8025\u8026\u8027\u8029\u8028\u8031\u800B\u8035\u8043\u8046\u804D\u8052\u8069\u8071\u8983\u9878\u9880\u9883"], + ["f240", "\u99FA", 62], + ["f280", "\u9A39", 32, "\u9889\u988C\u988D\u988F\u9894\u989A\u989B\u989E\u989F\u98A1\u98A2\u98A5\u98A6\u864D\u8654\u866C\u866E\u867F\u867A\u867C\u867B\u86A8\u868D\u868B\u86AC\u869D\u86A7\u86A3\u86AA\u8693\u86A9\u86B6\u86C4\u86B5\u86CE\u86B0\u86BA\u86B1\u86AF\u86C9\u86CF\u86B4\u86E9\u86F1\u86F2\u86ED\u86F3\u86D0\u8713\u86DE\u86F4\u86DF\u86D8\u86D1\u8703\u8707\u86F8\u8708\u870A\u870D\u8709\u8723\u873B\u871E\u8725\u872E\u871A\u873E\u8748\u8734\u8731\u8729\u8737\u873F\u8782\u8722\u877D\u877E\u877B\u8760\u8770\u874C\u876E\u878B\u8753\u8763\u877C\u8764\u8759\u8765\u8793\u87AF\u87A8\u87D2"], + ["f340", "\u9A5A", 17, "\u9A72\u9A83\u9A89\u9A8D\u9A8E\u9A94\u9A95\u9A99\u9AA6\u9AA9", 6, "\u9AB2\u9AB3\u9AB4\u9AB5\u9AB9\u9ABB\u9ABD\u9ABE\u9ABF\u9AC3\u9AC4\u9AC6", 4, "\u9ACD\u9ACE\u9ACF\u9AD0\u9AD2\u9AD4\u9AD5\u9AD6\u9AD7\u9AD9\u9ADA\u9ADB\u9ADC"], + ["f380", "\u9ADD\u9ADE\u9AE0\u9AE2\u9AE3\u9AE4\u9AE5\u9AE7\u9AE8\u9AE9\u9AEA\u9AEC\u9AEE\u9AF0", 8, "\u9AFA\u9AFC", 6, "\u9B04\u9B05\u9B06\u87C6\u8788\u8785\u87AD\u8797\u8783\u87AB\u87E5\u87AC\u87B5\u87B3\u87CB\u87D3\u87BD\u87D1\u87C0\u87CA\u87DB\u87EA\u87E0\u87EE\u8816\u8813\u87FE\u880A\u881B\u8821\u8839\u883C\u7F36\u7F42\u7F44\u7F45\u8210\u7AFA\u7AFD\u7B08\u7B03\u7B04\u7B15\u7B0A\u7B2B\u7B0F\u7B47\u7B38\u7B2A\u7B19\u7B2E\u7B31\u7B20\u7B25\u7B24\u7B33\u7B3E\u7B1E\u7B58\u7B5A\u7B45\u7B75\u7B4C\u7B5D\u7B60\u7B6E\u7B7B\u7B62\u7B72\u7B71\u7B90\u7BA6\u7BA7\u7BB8\u7BAC\u7B9D\u7BA8\u7B85\u7BAA\u7B9C\u7BA2\u7BAB\u7BB4\u7BD1\u7BC1\u7BCC\u7BDD\u7BDA\u7BE5\u7BE6\u7BEA\u7C0C\u7BFE\u7BFC\u7C0F\u7C16\u7C0B"], + ["f440", "\u9B07\u9B09", 5, "\u9B10\u9B11\u9B12\u9B14", 10, "\u9B20\u9B21\u9B22\u9B24", 10, "\u9B30\u9B31\u9B33", 7, "\u9B3D\u9B3E\u9B3F\u9B40\u9B46\u9B4A\u9B4B\u9B4C\u9B4E\u9B50\u9B52\u9B53\u9B55", 5], + ["f480", "\u9B5B", 32, "\u7C1F\u7C2A\u7C26\u7C38\u7C41\u7C40\u81FE\u8201\u8202\u8204\u81EC\u8844\u8221\u8222\u8223\u822D\u822F\u8228\u822B\u8238\u823B\u8233\u8234\u823E\u8244\u8249\u824B\u824F\u825A\u825F\u8268\u887E\u8885\u8888\u88D8\u88DF\u895E\u7F9D\u7F9F\u7FA7\u7FAF\u7FB0\u7FB2\u7C7C\u6549\u7C91\u7C9D\u7C9C\u7C9E\u7CA2\u7CB2\u7CBC\u7CBD\u7CC1\u7CC7\u7CCC\u7CCD\u7CC8\u7CC5\u7CD7\u7CE8\u826E\u66A8\u7FBF\u7FCE\u7FD5\u7FE5\u7FE1\u7FE6\u7FE9\u7FEE\u7FF3\u7CF8\u7D77\u7DA6\u7DAE\u7E47\u7E9B\u9EB8\u9EB4\u8D73\u8D84\u8D94\u8D91\u8DB1\u8D67\u8D6D\u8C47\u8C49\u914A\u9150\u914E\u914F\u9164"], + ["f540", "\u9B7C", 62], + ["f580", "\u9BBB", 32, "\u9162\u9161\u9170\u9169\u916F\u917D\u917E\u9172\u9174\u9179\u918C\u9185\u9190\u918D\u9191\u91A2\u91A3\u91AA\u91AD\u91AE\u91AF\u91B5\u91B4\u91BA\u8C55\u9E7E\u8DB8\u8DEB\u8E05\u8E59\u8E69\u8DB5\u8DBF\u8DBC\u8DBA\u8DC4\u8DD6\u8DD7\u8DDA\u8DDE\u8DCE\u8DCF\u8DDB\u8DC6\u8DEC\u8DF7\u8DF8\u8DE3\u8DF9\u8DFB\u8DE4\u8E09\u8DFD\u8E14\u8E1D\u8E1F\u8E2C\u8E2E\u8E23\u8E2F\u8E3A\u8E40\u8E39\u8E35\u8E3D\u8E31\u8E49\u8E41\u8E42\u8E51\u8E52\u8E4A\u8E70\u8E76\u8E7C\u8E6F\u8E74\u8E85\u8E8F\u8E94\u8E90\u8E9C\u8E9E\u8C78\u8C82\u8C8A\u8C85\u8C98\u8C94\u659B\u89D6\u89DE\u89DA\u89DC"], + ["f640", "\u9BDC", 62], + ["f680", "\u9C1B", 32, "\u89E5\u89EB\u89EF\u8A3E\u8B26\u9753\u96E9\u96F3\u96EF\u9706\u9701\u9708\u970F\u970E\u972A\u972D\u9730\u973E\u9F80\u9F83\u9F85", 5, "\u9F8C\u9EFE\u9F0B\u9F0D\u96B9\u96BC\u96BD\u96CE\u96D2\u77BF\u96E0\u928E\u92AE\u92C8\u933E\u936A\u93CA\u938F\u943E\u946B\u9C7F\u9C82\u9C85\u9C86\u9C87\u9C88\u7A23\u9C8B\u9C8E\u9C90\u9C91\u9C92\u9C94\u9C95\u9C9A\u9C9B\u9C9E", 5, "\u9CA5", 4, "\u9CAB\u9CAD\u9CAE\u9CB0", 7, "\u9CBA\u9CBB\u9CBC\u9CBD\u9CC4\u9CC5\u9CC6\u9CC7\u9CCA\u9CCB"], + ["f740", "\u9C3C", 62], + ["f780", "\u9C7B\u9C7D\u9C7E\u9C80\u9C83\u9C84\u9C89\u9C8A\u9C8C\u9C8F\u9C93\u9C96\u9C97\u9C98\u9C99\u9C9D\u9CAA\u9CAC\u9CAF\u9CB9\u9CBE", 4, "\u9CC8\u9CC9\u9CD1\u9CD2\u9CDA\u9CDB\u9CE0\u9CE1\u9CCC", 4, "\u9CD3\u9CD4\u9CD5\u9CD7\u9CD8\u9CD9\u9CDC\u9CDD\u9CDF\u9CE2\u977C\u9785\u9791\u9792\u9794\u97AF\u97AB\u97A3\u97B2\u97B4\u9AB1\u9AB0\u9AB7\u9E58\u9AB6\u9ABA\u9ABC\u9AC1\u9AC0\u9AC5\u9AC2\u9ACB\u9ACC\u9AD1\u9B45\u9B43\u9B47\u9B49\u9B48\u9B4D\u9B51\u98E8\u990D\u992E\u9955\u9954\u9ADF\u9AE1\u9AE6\u9AEF\u9AEB\u9AFB\u9AED\u9AF9\u9B08\u9B0F\u9B13\u9B1F\u9B23\u9EBD\u9EBE\u7E3B\u9E82\u9E87\u9E88\u9E8B\u9E92\u93D6\u9E9D\u9E9F\u9EDB\u9EDC\u9EDD\u9EE0\u9EDF\u9EE2\u9EE9\u9EE7\u9EE5\u9EEA\u9EEF\u9F22\u9F2C\u9F2F\u9F39\u9F37\u9F3D\u9F3E\u9F44"], + ["f840", "\u9CE3", 62], + ["f880", "\u9D22", 32], + ["f940", "\u9D43", 62], + ["f980", "\u9D82", 32], + ["fa40", "\u9DA3", 62], + ["fa80", "\u9DE2", 32], + ["fb40", "\u9E03", 27, "\u9E24\u9E27\u9E2E\u9E30\u9E34\u9E3B\u9E3C\u9E40\u9E4D\u9E50\u9E52\u9E53\u9E54\u9E56\u9E59\u9E5D\u9E5F\u9E60\u9E61\u9E62\u9E65\u9E6E\u9E6F\u9E72\u9E74", 9, "\u9E80"], + ["fb80", "\u9E81\u9E83\u9E84\u9E85\u9E86\u9E89\u9E8A\u9E8C", 5, "\u9E94", 8, "\u9E9E\u9EA0", 5, "\u9EA7\u9EA8\u9EA9\u9EAA"], + ["fc40", "\u9EAB", 8, "\u9EB5\u9EB6\u9EB7\u9EB9\u9EBA\u9EBC\u9EBF", 4, "\u9EC5\u9EC6\u9EC7\u9EC8\u9ECA\u9ECB\u9ECC\u9ED0\u9ED2\u9ED3\u9ED5\u9ED6\u9ED7\u9ED9\u9EDA\u9EDE\u9EE1\u9EE3\u9EE4\u9EE6\u9EE8\u9EEB\u9EEC\u9EED\u9EEE\u9EF0", 8, "\u9EFA\u9EFD\u9EFF", 6], + ["fc80", "\u9F06", 4, "\u9F0C\u9F0F\u9F11\u9F12\u9F14\u9F15\u9F16\u9F18\u9F1A", 5, "\u9F21\u9F23", 8, "\u9F2D\u9F2E\u9F30\u9F31"], + ["fd40", "\u9F32", 4, "\u9F38\u9F3A\u9F3C\u9F3F", 4, "\u9F45", 10, "\u9F52", 38], + ["fd80", "\u9F79", 5, "\u9F81\u9F82\u9F8D", 11, "\u9F9C\u9F9D\u9F9E\u9FA1", 4, "\uF92C\uF979\uF995\uF9E7\uF9F1"], + ["fe40", "\uFA0C\uFA0D\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA18\uFA1F\uFA20\uFA21\uFA23\uFA24\uFA27\uFA28\uFA29"] + ]; + } +}); + +// node_modules/iconv-lite/encodings/tables/gbk-added.json +var require_gbk_added = __commonJS({ + "node_modules/iconv-lite/encodings/tables/gbk-added.json"(exports2, module2) { + module2.exports = [ + ["a140", "\uE4C6", 62], + ["a180", "\uE505", 32], + ["a240", "\uE526", 62], + ["a280", "\uE565", 32], + ["a2ab", "\uE766", 5], + ["a2e3", "\u20AC\uE76D"], + ["a2ef", "\uE76E\uE76F"], + ["a2fd", "\uE770\uE771"], + ["a340", "\uE586", 62], + ["a380", "\uE5C5", 31, "\u3000"], + ["a440", "\uE5E6", 62], + ["a480", "\uE625", 32], + ["a4f4", "\uE772", 10], + ["a540", "\uE646", 62], + ["a580", "\uE685", 32], + ["a5f7", "\uE77D", 7], + ["a640", "\uE6A6", 62], + ["a680", "\uE6E5", 32], + ["a6b9", "\uE785", 7], + ["a6d9", "\uE78D", 6], + ["a6ec", "\uE794\uE795"], + ["a6f3", "\uE796"], + ["a6f6", "\uE797", 8], + ["a740", "\uE706", 62], + ["a780", "\uE745", 32], + ["a7c2", "\uE7A0", 14], + ["a7f2", "\uE7AF", 12], + ["a896", "\uE7BC", 10], + ["a8bc", "\uE7C7"], + ["a8bf", "\u01F9"], + ["a8c1", "\uE7C9\uE7CA\uE7CB\uE7CC"], + ["a8ea", "\uE7CD", 20], + ["a958", "\uE7E2"], + ["a95b", "\uE7E3"], + ["a95d", "\uE7E4\uE7E5\uE7E6"], + ["a989", "\u303E\u2FF0", 11], + ["a997", "\uE7F4", 12], + ["a9f0", "\uE801", 14], + ["aaa1", "\uE000", 93], + ["aba1", "\uE05E", 93], + ["aca1", "\uE0BC", 93], + ["ada1", "\uE11A", 93], + ["aea1", "\uE178", 93], + ["afa1", "\uE1D6", 93], + ["d7fa", "\uE810", 4], + ["f8a1", "\uE234", 93], + ["f9a1", "\uE292", 93], + ["faa1", "\uE2F0", 93], + ["fba1", "\uE34E", 93], + ["fca1", "\uE3AC", 93], + ["fda1", "\uE40A", 93], + ["fe50", "\u2E81\uE816\uE817\uE818\u2E84\u3473\u3447\u2E88\u2E8B\uE81E\u359E\u361A\u360E\u2E8C\u2E97\u396E\u3918\uE826\u39CF\u39DF\u3A73\u39D0\uE82B\uE82C\u3B4E\u3C6E\u3CE0\u2EA7\uE831\uE832\u2EAA\u4056\u415F\u2EAE\u4337\u2EB3\u2EB6\u2EB7\uE83B\u43B1\u43AC\u2EBB\u43DD\u44D6\u4661\u464C\uE843"], + ["fe80", "\u4723\u4729\u477C\u478D\u2ECA\u4947\u497A\u497D\u4982\u4983\u4985\u4986\u499F\u499B\u49B7\u49B6\uE854\uE855\u4CA3\u4C9F\u4CA0\u4CA1\u4C77\u4CA2\u4D13", 6, "\u4DAE\uE864\uE468", 93] + ]; + } +}); + +// node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +var require_gb18030_ranges = __commonJS({ + "node_modules/iconv-lite/encodings/tables/gb18030-ranges.json"(exports2, module2) { + module2.exports = { uChars: [128, 165, 169, 178, 184, 216, 226, 235, 238, 244, 248, 251, 253, 258, 276, 284, 300, 325, 329, 334, 364, 463, 465, 467, 469, 471, 473, 475, 477, 506, 594, 610, 712, 716, 730, 930, 938, 962, 970, 1026, 1104, 1106, 8209, 8215, 8218, 8222, 8231, 8241, 8244, 8246, 8252, 8365, 8452, 8454, 8458, 8471, 8482, 8556, 8570, 8596, 8602, 8713, 8720, 8722, 8726, 8731, 8737, 8740, 8742, 8748, 8751, 8760, 8766, 8777, 8781, 8787, 8802, 8808, 8816, 8854, 8858, 8870, 8896, 8979, 9322, 9372, 9548, 9588, 9616, 9622, 9634, 9652, 9662, 9672, 9676, 9680, 9702, 9735, 9738, 9793, 9795, 11906, 11909, 11913, 11917, 11928, 11944, 11947, 11951, 11956, 11960, 11964, 11979, 12284, 12292, 12312, 12319, 12330, 12351, 12436, 12447, 12535, 12543, 12586, 12842, 12850, 12964, 13200, 13215, 13218, 13253, 13263, 13267, 13270, 13384, 13428, 13727, 13839, 13851, 14617, 14703, 14801, 14816, 14964, 15183, 15471, 15585, 16471, 16736, 17208, 17325, 17330, 17374, 17623, 17997, 18018, 18212, 18218, 18301, 18318, 18760, 18811, 18814, 18820, 18823, 18844, 18848, 18872, 19576, 19620, 19738, 19887, 40870, 59244, 59336, 59367, 59413, 59417, 59423, 59431, 59437, 59443, 59452, 59460, 59478, 59493, 63789, 63866, 63894, 63976, 63986, 64016, 64018, 64021, 64025, 64034, 64037, 64042, 65074, 65093, 65107, 65112, 65127, 65132, 65375, 65510, 65536], gbChars: [0, 36, 38, 45, 50, 81, 89, 95, 96, 100, 103, 104, 105, 109, 126, 133, 148, 172, 175, 179, 208, 306, 307, 308, 309, 310, 311, 312, 313, 341, 428, 443, 544, 545, 558, 741, 742, 749, 750, 805, 819, 820, 7922, 7924, 7925, 7927, 7934, 7943, 7944, 7945, 7950, 8062, 8148, 8149, 8152, 8164, 8174, 8236, 8240, 8262, 8264, 8374, 8380, 8381, 8384, 8388, 8390, 8392, 8393, 8394, 8396, 8401, 8406, 8416, 8419, 8424, 8437, 8439, 8445, 8482, 8485, 8496, 8521, 8603, 8936, 8946, 9046, 9050, 9063, 9066, 9076, 9092, 9100, 9108, 9111, 9113, 9131, 9162, 9164, 9218, 9219, 11329, 11331, 11334, 11336, 11346, 11361, 11363, 11366, 11370, 11372, 11375, 11389, 11682, 11686, 11687, 11692, 11694, 11714, 11716, 11723, 11725, 11730, 11736, 11982, 11989, 12102, 12336, 12348, 12350, 12384, 12393, 12395, 12397, 12510, 12553, 12851, 12962, 12973, 13738, 13823, 13919, 13933, 14080, 14298, 14585, 14698, 15583, 15847, 16318, 16434, 16438, 16481, 16729, 17102, 17122, 17315, 17320, 17402, 17418, 17859, 17909, 17911, 17915, 17916, 17936, 17939, 17961, 18664, 18703, 18814, 18962, 19043, 33469, 33470, 33471, 33484, 33485, 33490, 33497, 33501, 33505, 33513, 33520, 33536, 33550, 37845, 37921, 37948, 38029, 38038, 38064, 38065, 38066, 38069, 38075, 38076, 38078, 39108, 39109, 39113, 39114, 39115, 39116, 39265, 39394, 189e3] }; + } +}); + +// node_modules/iconv-lite/encodings/tables/cp949.json +var require_cp949 = __commonJS({ + "node_modules/iconv-lite/encodings/tables/cp949.json"(exports2, module2) { + module2.exports = [ + ["0", "\0", 127], + ["8141", "\uAC02\uAC03\uAC05\uAC06\uAC0B", 4, "\uAC18\uAC1E\uAC1F\uAC21\uAC22\uAC23\uAC25", 6, "\uAC2E\uAC32\uAC33\uAC34"], + ["8161", "\uAC35\uAC36\uAC37\uAC3A\uAC3B\uAC3D\uAC3E\uAC3F\uAC41", 9, "\uAC4C\uAC4E", 5, "\uAC55"], + ["8181", "\uAC56\uAC57\uAC59\uAC5A\uAC5B\uAC5D", 18, "\uAC72\uAC73\uAC75\uAC76\uAC79\uAC7B", 4, "\uAC82\uAC87\uAC88\uAC8D\uAC8E\uAC8F\uAC91\uAC92\uAC93\uAC95", 6, "\uAC9E\uACA2", 5, "\uACAB\uACAD\uACAE\uACB1", 6, "\uACBA\uACBE\uACBF\uACC0\uACC2\uACC3\uACC5\uACC6\uACC7\uACC9\uACCA\uACCB\uACCD", 7, "\uACD6\uACD8", 7, "\uACE2\uACE3\uACE5\uACE6\uACE9\uACEB\uACED\uACEE\uACF2\uACF4\uACF7", 4, "\uACFE\uACFF\uAD01\uAD02\uAD03\uAD05\uAD07", 4, "\uAD0E\uAD10\uAD12\uAD13"], + ["8241", "\uAD14\uAD15\uAD16\uAD17\uAD19\uAD1A\uAD1B\uAD1D\uAD1E\uAD1F\uAD21", 7, "\uAD2A\uAD2B\uAD2E", 5], + ["8261", "\uAD36\uAD37\uAD39\uAD3A\uAD3B\uAD3D", 6, "\uAD46\uAD48\uAD4A", 5, "\uAD51\uAD52\uAD53\uAD55\uAD56\uAD57"], + ["8281", "\uAD59", 7, "\uAD62\uAD64", 7, "\uAD6E\uAD6F\uAD71\uAD72\uAD77\uAD78\uAD79\uAD7A\uAD7E\uAD80\uAD83", 4, "\uAD8A\uAD8B\uAD8D\uAD8E\uAD8F\uAD91", 10, "\uAD9E", 5, "\uADA5", 17, "\uADB8", 7, "\uADC2\uADC3\uADC5\uADC6\uADC7\uADC9", 6, "\uADD2\uADD4", 7, "\uADDD\uADDE\uADDF\uADE1\uADE2\uADE3\uADE5", 18], + ["8341", "\uADFA\uADFB\uADFD\uADFE\uAE02", 5, "\uAE0A\uAE0C\uAE0E", 5, "\uAE15", 7], + ["8361", "\uAE1D", 18, "\uAE32\uAE33\uAE35\uAE36\uAE39\uAE3B\uAE3C"], + ["8381", "\uAE3D\uAE3E\uAE3F\uAE42\uAE44\uAE47\uAE48\uAE49\uAE4B\uAE4F\uAE51\uAE52\uAE53\uAE55\uAE57", 4, "\uAE5E\uAE62\uAE63\uAE64\uAE66\uAE67\uAE6A\uAE6B\uAE6D\uAE6E\uAE6F\uAE71", 6, "\uAE7A\uAE7E", 5, "\uAE86", 5, "\uAE8D", 46, "\uAEBF\uAEC1\uAEC2\uAEC3\uAEC5", 6, "\uAECE\uAED2", 5, "\uAEDA\uAEDB\uAEDD", 8], + ["8441", "\uAEE6\uAEE7\uAEE9\uAEEA\uAEEC\uAEEE", 5, "\uAEF5\uAEF6\uAEF7\uAEF9\uAEFA\uAEFB\uAEFD", 8], + ["8461", "\uAF06\uAF09\uAF0A\uAF0B\uAF0C\uAF0E\uAF0F\uAF11", 18], + ["8481", "\uAF24", 7, "\uAF2E\uAF2F\uAF31\uAF33\uAF35", 6, "\uAF3E\uAF40\uAF44\uAF45\uAF46\uAF47\uAF4A", 5, "\uAF51", 10, "\uAF5E", 5, "\uAF66", 18, "\uAF7A", 5, "\uAF81\uAF82\uAF83\uAF85\uAF86\uAF87\uAF89", 6, "\uAF92\uAF93\uAF94\uAF96", 5, "\uAF9D", 26, "\uAFBA\uAFBB\uAFBD\uAFBE"], + ["8541", "\uAFBF\uAFC1", 5, "\uAFCA\uAFCC\uAFCF", 4, "\uAFD5", 6, "\uAFDD", 4], + ["8561", "\uAFE2", 5, "\uAFEA", 5, "\uAFF2\uAFF3\uAFF5\uAFF6\uAFF7\uAFF9", 6, "\uB002\uB003"], + ["8581", "\uB005", 6, "\uB00D\uB00E\uB00F\uB011\uB012\uB013\uB015", 6, "\uB01E", 9, "\uB029", 26, "\uB046\uB047\uB049\uB04B\uB04D\uB04F\uB050\uB051\uB052\uB056\uB058\uB05A\uB05B\uB05C\uB05E", 29, "\uB07E\uB07F\uB081\uB082\uB083\uB085", 6, "\uB08E\uB090\uB092", 5, "\uB09B\uB09D\uB09E\uB0A3\uB0A4"], + ["8641", "\uB0A5\uB0A6\uB0A7\uB0AA\uB0B0\uB0B2\uB0B6\uB0B7\uB0B9\uB0BA\uB0BB\uB0BD", 6, "\uB0C6\uB0CA", 5, "\uB0D2"], + ["8661", "\uB0D3\uB0D5\uB0D6\uB0D7\uB0D9", 6, "\uB0E1\uB0E2\uB0E3\uB0E4\uB0E6", 10], + ["8681", "\uB0F1", 22, "\uB10A\uB10D\uB10E\uB10F\uB111\uB114\uB115\uB116\uB117\uB11A\uB11E", 4, "\uB126\uB127\uB129\uB12A\uB12B\uB12D", 6, "\uB136\uB13A", 5, "\uB142\uB143\uB145\uB146\uB147\uB149", 6, "\uB152\uB153\uB156\uB157\uB159\uB15A\uB15B\uB15D\uB15E\uB15F\uB161", 22, "\uB17A\uB17B\uB17D\uB17E\uB17F\uB181\uB183", 4, "\uB18A\uB18C\uB18E\uB18F\uB190\uB191\uB195\uB196\uB197\uB199\uB19A\uB19B\uB19D"], + ["8741", "\uB19E", 9, "\uB1A9", 15], + ["8761", "\uB1B9", 18, "\uB1CD\uB1CE\uB1CF\uB1D1\uB1D2\uB1D3\uB1D5"], + ["8781", "\uB1D6", 5, "\uB1DE\uB1E0", 7, "\uB1EA\uB1EB\uB1ED\uB1EE\uB1EF\uB1F1", 7, "\uB1FA\uB1FC\uB1FE", 5, "\uB206\uB207\uB209\uB20A\uB20D", 6, "\uB216\uB218\uB21A", 5, "\uB221", 18, "\uB235", 6, "\uB23D", 26, "\uB259\uB25A\uB25B\uB25D\uB25E\uB25F\uB261", 6, "\uB26A", 4], + ["8841", "\uB26F", 4, "\uB276", 5, "\uB27D", 6, "\uB286\uB287\uB288\uB28A", 4], + ["8861", "\uB28F\uB292\uB293\uB295\uB296\uB297\uB29B", 4, "\uB2A2\uB2A4\uB2A7\uB2A8\uB2A9\uB2AB\uB2AD\uB2AE\uB2AF\uB2B1\uB2B2\uB2B3\uB2B5\uB2B6\uB2B7"], + ["8881", "\uB2B8", 15, "\uB2CA\uB2CB\uB2CD\uB2CE\uB2CF\uB2D1\uB2D3", 4, "\uB2DA\uB2DC\uB2DE\uB2DF\uB2E0\uB2E1\uB2E3\uB2E7\uB2E9\uB2EA\uB2F0\uB2F1\uB2F2\uB2F6\uB2FC\uB2FD\uB2FE\uB302\uB303\uB305\uB306\uB307\uB309", 6, "\uB312\uB316", 5, "\uB31D", 54, "\uB357\uB359\uB35A\uB35D\uB360\uB361\uB362\uB363"], + ["8941", "\uB366\uB368\uB36A\uB36C\uB36D\uB36F\uB372\uB373\uB375\uB376\uB377\uB379", 6, "\uB382\uB386", 5, "\uB38D"], + ["8961", "\uB38E\uB38F\uB391\uB392\uB393\uB395", 10, "\uB3A2", 5, "\uB3A9\uB3AA\uB3AB\uB3AD"], + ["8981", "\uB3AE", 21, "\uB3C6\uB3C7\uB3C9\uB3CA\uB3CD\uB3CF\uB3D1\uB3D2\uB3D3\uB3D6\uB3D8\uB3DA\uB3DC\uB3DE\uB3DF\uB3E1\uB3E2\uB3E3\uB3E5\uB3E6\uB3E7\uB3E9", 18, "\uB3FD", 18, "\uB411", 6, "\uB419\uB41A\uB41B\uB41D\uB41E\uB41F\uB421", 6, "\uB42A\uB42C", 7, "\uB435", 15], + ["8a41", "\uB445", 10, "\uB452\uB453\uB455\uB456\uB457\uB459", 6, "\uB462\uB464\uB466"], + ["8a61", "\uB467", 4, "\uB46D", 18, "\uB481\uB482"], + ["8a81", "\uB483", 4, "\uB489", 19, "\uB49E", 5, "\uB4A5\uB4A6\uB4A7\uB4A9\uB4AA\uB4AB\uB4AD", 7, "\uB4B6\uB4B8\uB4BA", 5, "\uB4C1\uB4C2\uB4C3\uB4C5\uB4C6\uB4C7\uB4C9", 6, "\uB4D1\uB4D2\uB4D3\uB4D4\uB4D6", 5, "\uB4DE\uB4DF\uB4E1\uB4E2\uB4E5\uB4E7", 4, "\uB4EE\uB4F0\uB4F2", 5, "\uB4F9", 26, "\uB516\uB517\uB519\uB51A\uB51D"], + ["8b41", "\uB51E", 5, "\uB526\uB52B", 4, "\uB532\uB533\uB535\uB536\uB537\uB539", 6, "\uB542\uB546"], + ["8b61", "\uB547\uB548\uB549\uB54A\uB54E\uB54F\uB551\uB552\uB553\uB555", 6, "\uB55E\uB562", 8], + ["8b81", "\uB56B", 52, "\uB5A2\uB5A3\uB5A5\uB5A6\uB5A7\uB5A9\uB5AC\uB5AD\uB5AE\uB5AF\uB5B2\uB5B6", 4, "\uB5BE\uB5BF\uB5C1\uB5C2\uB5C3\uB5C5", 6, "\uB5CE\uB5D2", 5, "\uB5D9", 18, "\uB5ED", 18], + ["8c41", "\uB600", 15, "\uB612\uB613\uB615\uB616\uB617\uB619", 4], + ["8c61", "\uB61E", 6, "\uB626", 5, "\uB62D", 6, "\uB635", 5], + ["8c81", "\uB63B", 12, "\uB649", 26, "\uB665\uB666\uB667\uB669", 50, "\uB69E\uB69F\uB6A1\uB6A2\uB6A3\uB6A5", 5, "\uB6AD\uB6AE\uB6AF\uB6B0\uB6B2", 16], + ["8d41", "\uB6C3", 16, "\uB6D5", 8], + ["8d61", "\uB6DE", 17, "\uB6F1\uB6F2\uB6F3\uB6F5\uB6F6\uB6F7\uB6F9\uB6FA"], + ["8d81", "\uB6FB", 4, "\uB702\uB703\uB704\uB706", 33, "\uB72A\uB72B\uB72D\uB72E\uB731", 6, "\uB73A\uB73C", 7, "\uB745\uB746\uB747\uB749\uB74A\uB74B\uB74D", 6, "\uB756", 9, "\uB761\uB762\uB763\uB765\uB766\uB767\uB769", 6, "\uB772\uB774\uB776", 5, "\uB77E\uB77F\uB781\uB782\uB783\uB785", 6, "\uB78E\uB793\uB794\uB795\uB79A\uB79B\uB79D\uB79E"], + ["8e41", "\uB79F\uB7A1", 6, "\uB7AA\uB7AE", 5, "\uB7B6\uB7B7\uB7B9", 8], + ["8e61", "\uB7C2", 4, "\uB7C8\uB7CA", 19], + ["8e81", "\uB7DE", 13, "\uB7EE\uB7EF\uB7F1\uB7F2\uB7F3\uB7F5", 6, "\uB7FE\uB802", 4, "\uB80A\uB80B\uB80D\uB80E\uB80F\uB811", 6, "\uB81A\uB81C\uB81E", 5, "\uB826\uB827\uB829\uB82A\uB82B\uB82D", 6, "\uB836\uB83A", 5, "\uB841\uB842\uB843\uB845", 11, "\uB852\uB854", 7, "\uB85E\uB85F\uB861\uB862\uB863\uB865", 6, "\uB86E\uB870\uB872", 5, "\uB879\uB87A\uB87B\uB87D", 7], + ["8f41", "\uB885", 7, "\uB88E", 17], + ["8f61", "\uB8A0", 7, "\uB8A9", 6, "\uB8B1\uB8B2\uB8B3\uB8B5\uB8B6\uB8B7\uB8B9", 4], + ["8f81", "\uB8BE\uB8BF\uB8C2\uB8C4\uB8C6", 5, "\uB8CD\uB8CE\uB8CF\uB8D1\uB8D2\uB8D3\uB8D5", 7, "\uB8DE\uB8E0\uB8E2", 5, "\uB8EA\uB8EB\uB8ED\uB8EE\uB8EF\uB8F1", 6, "\uB8FA\uB8FC\uB8FE", 5, "\uB905", 18, "\uB919", 6, "\uB921", 26, "\uB93E\uB93F\uB941\uB942\uB943\uB945", 6, "\uB94D\uB94E\uB950\uB952", 5], + ["9041", "\uB95A\uB95B\uB95D\uB95E\uB95F\uB961", 6, "\uB96A\uB96C\uB96E", 5, "\uB976\uB977\uB979\uB97A\uB97B\uB97D"], + ["9061", "\uB97E", 5, "\uB986\uB988\uB98B\uB98C\uB98F", 15], + ["9081", "\uB99F", 12, "\uB9AE\uB9AF\uB9B1\uB9B2\uB9B3\uB9B5", 6, "\uB9BE\uB9C0\uB9C2", 5, "\uB9CA\uB9CB\uB9CD\uB9D3", 4, "\uB9DA\uB9DC\uB9DF\uB9E0\uB9E2\uB9E6\uB9E7\uB9E9\uB9EA\uB9EB\uB9ED", 6, "\uB9F6\uB9FB", 4, "\uBA02", 5, "\uBA09", 11, "\uBA16", 33, "\uBA3A\uBA3B\uBA3D\uBA3E\uBA3F\uBA41\uBA43\uBA44\uBA45\uBA46"], + ["9141", "\uBA47\uBA4A\uBA4C\uBA4F\uBA50\uBA51\uBA52\uBA56\uBA57\uBA59\uBA5A\uBA5B\uBA5D", 6, "\uBA66\uBA6A", 5], + ["9161", "\uBA72\uBA73\uBA75\uBA76\uBA77\uBA79", 9, "\uBA86\uBA88\uBA89\uBA8A\uBA8B\uBA8D", 5], + ["9181", "\uBA93", 20, "\uBAAA\uBAAD\uBAAE\uBAAF\uBAB1\uBAB3", 4, "\uBABA\uBABC\uBABE", 5, "\uBAC5\uBAC6\uBAC7\uBAC9", 14, "\uBADA", 33, "\uBAFD\uBAFE\uBAFF\uBB01\uBB02\uBB03\uBB05", 7, "\uBB0E\uBB10\uBB12", 5, "\uBB19\uBB1A\uBB1B\uBB1D\uBB1E\uBB1F\uBB21", 6], + ["9241", "\uBB28\uBB2A\uBB2C", 7, "\uBB37\uBB39\uBB3A\uBB3F", 4, "\uBB46\uBB48\uBB4A\uBB4B\uBB4C\uBB4E\uBB51\uBB52"], + ["9261", "\uBB53\uBB55\uBB56\uBB57\uBB59", 7, "\uBB62\uBB64", 7, "\uBB6D", 4], + ["9281", "\uBB72", 21, "\uBB89\uBB8A\uBB8B\uBB8D\uBB8E\uBB8F\uBB91", 18, "\uBBA5\uBBA6\uBBA7\uBBA9\uBBAA\uBBAB\uBBAD", 6, "\uBBB5\uBBB6\uBBB8", 7, "\uBBC1\uBBC2\uBBC3\uBBC5\uBBC6\uBBC7\uBBC9", 6, "\uBBD1\uBBD2\uBBD4", 35, "\uBBFA\uBBFB\uBBFD\uBBFE\uBC01"], + ["9341", "\uBC03", 4, "\uBC0A\uBC0E\uBC10\uBC12\uBC13\uBC19\uBC1A\uBC20\uBC21\uBC22\uBC23\uBC26\uBC28\uBC2A\uBC2B\uBC2C\uBC2E\uBC2F\uBC32\uBC33\uBC35"], + ["9361", "\uBC36\uBC37\uBC39", 6, "\uBC42\uBC46\uBC47\uBC48\uBC4A\uBC4B\uBC4E\uBC4F\uBC51", 8], + ["9381", "\uBC5A\uBC5B\uBC5C\uBC5E", 37, "\uBC86\uBC87\uBC89\uBC8A\uBC8D\uBC8F", 4, "\uBC96\uBC98\uBC9B", 4, "\uBCA2\uBCA3\uBCA5\uBCA6\uBCA9", 6, "\uBCB2\uBCB6", 5, "\uBCBE\uBCBF\uBCC1\uBCC2\uBCC3\uBCC5", 7, "\uBCCE\uBCD2\uBCD3\uBCD4\uBCD6\uBCD7\uBCD9\uBCDA\uBCDB\uBCDD", 22, "\uBCF7\uBCF9\uBCFA\uBCFB\uBCFD"], + ["9441", "\uBCFE", 5, "\uBD06\uBD08\uBD0A", 5, "\uBD11\uBD12\uBD13\uBD15", 8], + ["9461", "\uBD1E", 5, "\uBD25", 6, "\uBD2D", 12], + ["9481", "\uBD3A", 5, "\uBD41", 6, "\uBD4A\uBD4B\uBD4D\uBD4E\uBD4F\uBD51", 6, "\uBD5A", 9, "\uBD65\uBD66\uBD67\uBD69", 22, "\uBD82\uBD83\uBD85\uBD86\uBD8B", 4, "\uBD92\uBD94\uBD96\uBD97\uBD98\uBD9B\uBD9D", 6, "\uBDA5", 10, "\uBDB1", 6, "\uBDB9", 24], + ["9541", "\uBDD2\uBDD3\uBDD6\uBDD7\uBDD9\uBDDA\uBDDB\uBDDD", 11, "\uBDEA", 5, "\uBDF1"], + ["9561", "\uBDF2\uBDF3\uBDF5\uBDF6\uBDF7\uBDF9", 6, "\uBE01\uBE02\uBE04\uBE06", 5, "\uBE0E\uBE0F\uBE11\uBE12\uBE13"], + ["9581", "\uBE15", 6, "\uBE1E\uBE20", 35, "\uBE46\uBE47\uBE49\uBE4A\uBE4B\uBE4D\uBE4F", 4, "\uBE56\uBE58\uBE5C\uBE5D\uBE5E\uBE5F\uBE62\uBE63\uBE65\uBE66\uBE67\uBE69\uBE6B", 4, "\uBE72\uBE76", 4, "\uBE7E\uBE7F\uBE81\uBE82\uBE83\uBE85", 6, "\uBE8E\uBE92", 5, "\uBE9A", 13, "\uBEA9", 14], + ["9641", "\uBEB8", 23, "\uBED2\uBED3"], + ["9661", "\uBED5\uBED6\uBED9", 6, "\uBEE1\uBEE2\uBEE6", 5, "\uBEED", 8], + ["9681", "\uBEF6", 10, "\uBF02", 5, "\uBF0A", 13, "\uBF1A\uBF1E", 33, "\uBF42\uBF43\uBF45\uBF46\uBF47\uBF49", 6, "\uBF52\uBF53\uBF54\uBF56", 44], + ["9741", "\uBF83", 16, "\uBF95", 8], + ["9761", "\uBF9E", 17, "\uBFB1", 7], + ["9781", "\uBFB9", 11, "\uBFC6", 5, "\uBFCE\uBFCF\uBFD1\uBFD2\uBFD3\uBFD5", 6, "\uBFDD\uBFDE\uBFE0\uBFE2", 89, "\uC03D\uC03E\uC03F"], + ["9841", "\uC040", 16, "\uC052", 5, "\uC059\uC05A\uC05B"], + ["9861", "\uC05D\uC05E\uC05F\uC061", 6, "\uC06A", 15], + ["9881", "\uC07A", 21, "\uC092\uC093\uC095\uC096\uC097\uC099", 6, "\uC0A2\uC0A4\uC0A6", 5, "\uC0AE\uC0B1\uC0B2\uC0B7", 4, "\uC0BE\uC0C2\uC0C3\uC0C4\uC0C6\uC0C7\uC0CA\uC0CB\uC0CD\uC0CE\uC0CF\uC0D1", 6, "\uC0DA\uC0DE", 5, "\uC0E6\uC0E7\uC0E9\uC0EA\uC0EB\uC0ED", 6, "\uC0F6\uC0F8\uC0FA", 5, "\uC101\uC102\uC103\uC105\uC106\uC107\uC109", 6, "\uC111\uC112\uC113\uC114\uC116", 5, "\uC121\uC122\uC125\uC128\uC129\uC12A\uC12B\uC12E"], + ["9941", "\uC132\uC133\uC134\uC135\uC137\uC13A\uC13B\uC13D\uC13E\uC13F\uC141", 6, "\uC14A\uC14E", 5, "\uC156\uC157"], + ["9961", "\uC159\uC15A\uC15B\uC15D", 6, "\uC166\uC16A", 5, "\uC171\uC172\uC173\uC175\uC176\uC177\uC179\uC17A\uC17B"], + ["9981", "\uC17C", 8, "\uC186", 5, "\uC18F\uC191\uC192\uC193\uC195\uC197", 4, "\uC19E\uC1A0\uC1A2\uC1A3\uC1A4\uC1A6\uC1A7\uC1AA\uC1AB\uC1AD\uC1AE\uC1AF\uC1B1", 11, "\uC1BE", 5, "\uC1C5\uC1C6\uC1C7\uC1C9\uC1CA\uC1CB\uC1CD", 6, "\uC1D5\uC1D6\uC1D9", 6, "\uC1E1\uC1E2\uC1E3\uC1E5\uC1E6\uC1E7\uC1E9", 6, "\uC1F2\uC1F4", 7, "\uC1FE\uC1FF\uC201\uC202\uC203\uC205", 6, "\uC20E\uC210\uC212", 5, "\uC21A\uC21B\uC21D\uC21E\uC221\uC222\uC223"], + ["9a41", "\uC224\uC225\uC226\uC227\uC22A\uC22C\uC22E\uC230\uC233\uC235", 16], + ["9a61", "\uC246\uC247\uC249", 6, "\uC252\uC253\uC255\uC256\uC257\uC259", 6, "\uC261\uC262\uC263\uC264\uC266"], + ["9a81", "\uC267", 4, "\uC26E\uC26F\uC271\uC272\uC273\uC275", 6, "\uC27E\uC280\uC282", 5, "\uC28A", 5, "\uC291", 6, "\uC299\uC29A\uC29C\uC29E", 5, "\uC2A6\uC2A7\uC2A9\uC2AA\uC2AB\uC2AE", 5, "\uC2B6\uC2B8\uC2BA", 33, "\uC2DE\uC2DF\uC2E1\uC2E2\uC2E5", 5, "\uC2EE\uC2F0\uC2F2\uC2F3\uC2F4\uC2F5\uC2F7\uC2FA\uC2FD\uC2FE\uC2FF\uC301", 6, "\uC30A\uC30B\uC30E\uC30F"], + ["9b41", "\uC310\uC311\uC312\uC316\uC317\uC319\uC31A\uC31B\uC31D", 6, "\uC326\uC327\uC32A", 8], + ["9b61", "\uC333", 17, "\uC346", 7], + ["9b81", "\uC34E", 25, "\uC36A\uC36B\uC36D\uC36E\uC36F\uC371\uC373", 4, "\uC37A\uC37B\uC37E", 5, "\uC385\uC386\uC387\uC389\uC38A\uC38B\uC38D", 50, "\uC3C1", 22, "\uC3DA"], + ["9c41", "\uC3DB\uC3DD\uC3DE\uC3E1\uC3E3", 4, "\uC3EA\uC3EB\uC3EC\uC3EE", 5, "\uC3F6\uC3F7\uC3F9", 5], + ["9c61", "\uC3FF", 8, "\uC409", 6, "\uC411", 9], + ["9c81", "\uC41B", 8, "\uC425", 6, "\uC42D\uC42E\uC42F\uC431\uC432\uC433\uC435", 6, "\uC43E", 9, "\uC449", 26, "\uC466\uC467\uC469\uC46A\uC46B\uC46D", 6, "\uC476\uC477\uC478\uC47A", 5, "\uC481", 18, "\uC495", 6, "\uC49D", 12], + ["9d41", "\uC4AA", 13, "\uC4B9\uC4BA\uC4BB\uC4BD", 8], + ["9d61", "\uC4C6", 25], + ["9d81", "\uC4E0", 8, "\uC4EA", 5, "\uC4F2\uC4F3\uC4F5\uC4F6\uC4F7\uC4F9\uC4FB\uC4FC\uC4FD\uC4FE\uC502", 9, "\uC50D\uC50E\uC50F\uC511\uC512\uC513\uC515", 6, "\uC51D", 10, "\uC52A\uC52B\uC52D\uC52E\uC52F\uC531", 6, "\uC53A\uC53C\uC53E", 5, "\uC546\uC547\uC54B\uC54F\uC550\uC551\uC552\uC556\uC55A\uC55B\uC55C\uC55F\uC562\uC563\uC565\uC566\uC567\uC569", 6, "\uC572\uC576", 5, "\uC57E\uC57F\uC581\uC582\uC583\uC585\uC586\uC588\uC589\uC58A\uC58B\uC58E\uC590\uC592\uC593\uC594"], + ["9e41", "\uC596\uC599\uC59A\uC59B\uC59D\uC59E\uC59F\uC5A1", 7, "\uC5AA", 9, "\uC5B6"], + ["9e61", "\uC5B7\uC5BA\uC5BF", 4, "\uC5CB\uC5CD\uC5CF\uC5D2\uC5D3\uC5D5\uC5D6\uC5D7\uC5D9", 6, "\uC5E2\uC5E4\uC5E6\uC5E7"], + ["9e81", "\uC5E8\uC5E9\uC5EA\uC5EB\uC5EF\uC5F1\uC5F2\uC5F3\uC5F5\uC5F8\uC5F9\uC5FA\uC5FB\uC602\uC603\uC604\uC609\uC60A\uC60B\uC60D\uC60E\uC60F\uC611", 6, "\uC61A\uC61D", 6, "\uC626\uC627\uC629\uC62A\uC62B\uC62F\uC631\uC632\uC636\uC638\uC63A\uC63C\uC63D\uC63E\uC63F\uC642\uC643\uC645\uC646\uC647\uC649", 6, "\uC652\uC656", 5, "\uC65E\uC65F\uC661", 10, "\uC66D\uC66E\uC670\uC672", 5, "\uC67A\uC67B\uC67D\uC67E\uC67F\uC681", 6, "\uC68A\uC68C\uC68E", 5, "\uC696\uC697\uC699\uC69A\uC69B\uC69D", 6, "\uC6A6"], + ["9f41", "\uC6A8\uC6AA", 5, "\uC6B2\uC6B3\uC6B5\uC6B6\uC6B7\uC6BB", 4, "\uC6C2\uC6C4\uC6C6", 5, "\uC6CE"], + ["9f61", "\uC6CF\uC6D1\uC6D2\uC6D3\uC6D5", 6, "\uC6DE\uC6DF\uC6E2", 5, "\uC6EA\uC6EB\uC6ED\uC6EE\uC6EF\uC6F1\uC6F2"], + ["9f81", "\uC6F3", 4, "\uC6FA\uC6FB\uC6FC\uC6FE", 5, "\uC706\uC707\uC709\uC70A\uC70B\uC70D", 6, "\uC716\uC718\uC71A", 5, "\uC722\uC723\uC725\uC726\uC727\uC729", 6, "\uC732\uC734\uC736\uC738\uC739\uC73A\uC73B\uC73E\uC73F\uC741\uC742\uC743\uC745", 4, "\uC74B\uC74E\uC750\uC759\uC75A\uC75B\uC75D\uC75E\uC75F\uC761", 6, "\uC769\uC76A\uC76C", 7, "\uC776\uC777\uC779\uC77A\uC77B\uC77F\uC780\uC781\uC782\uC786\uC78B\uC78C\uC78D\uC78F\uC792\uC793\uC795\uC799\uC79B", 4, "\uC7A2\uC7A7", 4, "\uC7AE\uC7AF\uC7B1\uC7B2\uC7B3\uC7B5\uC7B6\uC7B7"], + ["a041", "\uC7B8\uC7B9\uC7BA\uC7BB\uC7BE\uC7C2", 5, "\uC7CA\uC7CB\uC7CD\uC7CF\uC7D1", 6, "\uC7D9\uC7DA\uC7DB\uC7DC"], + ["a061", "\uC7DE", 5, "\uC7E5\uC7E6\uC7E7\uC7E9\uC7EA\uC7EB\uC7ED", 13], + ["a081", "\uC7FB", 4, "\uC802\uC803\uC805\uC806\uC807\uC809\uC80B", 4, "\uC812\uC814\uC817", 4, "\uC81E\uC81F\uC821\uC822\uC823\uC825", 6, "\uC82E\uC830\uC832", 5, "\uC839\uC83A\uC83B\uC83D\uC83E\uC83F\uC841", 6, "\uC84A\uC84B\uC84E", 5, "\uC855", 26, "\uC872\uC873\uC875\uC876\uC877\uC879\uC87B", 4, "\uC882\uC884\uC888\uC889\uC88A\uC88E", 5, "\uC895", 7, "\uC89E\uC8A0\uC8A2\uC8A3\uC8A4"], + ["a141", "\uC8A5\uC8A6\uC8A7\uC8A9", 18, "\uC8BE\uC8BF\uC8C0\uC8C1"], + ["a161", "\uC8C2\uC8C3\uC8C5\uC8C6\uC8C7\uC8C9\uC8CA\uC8CB\uC8CD", 6, "\uC8D6\uC8D8\uC8DA", 5, "\uC8E2\uC8E3\uC8E5"], + ["a181", "\uC8E6", 14, "\uC8F6", 5, "\uC8FE\uC8FF\uC901\uC902\uC903\uC907", 4, "\uC90E\u3000\u3001\u3002\xB7\u2025\u2026\xA8\u3003\xAD\u2015\u2225\uFF3C\u223C\u2018\u2019\u201C\u201D\u3014\u3015\u3008", 9, "\xB1\xD7\xF7\u2260\u2264\u2265\u221E\u2234\xB0\u2032\u2033\u2103\u212B\uFFE0\uFFE1\uFFE5\u2642\u2640\u2220\u22A5\u2312\u2202\u2207\u2261\u2252\xA7\u203B\u2606\u2605\u25CB\u25CF\u25CE\u25C7\u25C6\u25A1\u25A0\u25B3\u25B2\u25BD\u25BC\u2192\u2190\u2191\u2193\u2194\u3013\u226A\u226B\u221A\u223D\u221D\u2235\u222B\u222C\u2208\u220B\u2286\u2287\u2282\u2283\u222A\u2229\u2227\u2228\uFFE2"], + ["a241", "\uC910\uC912", 5, "\uC919", 18], + ["a261", "\uC92D", 6, "\uC935", 18], + ["a281", "\uC948", 7, "\uC952\uC953\uC955\uC956\uC957\uC959", 6, "\uC962\uC964", 7, "\uC96D\uC96E\uC96F\u21D2\u21D4\u2200\u2203\xB4\uFF5E\u02C7\u02D8\u02DD\u02DA\u02D9\xB8\u02DB\xA1\xBF\u02D0\u222E\u2211\u220F\xA4\u2109\u2030\u25C1\u25C0\u25B7\u25B6\u2664\u2660\u2661\u2665\u2667\u2663\u2299\u25C8\u25A3\u25D0\u25D1\u2592\u25A4\u25A5\u25A8\u25A7\u25A6\u25A9\u2668\u260F\u260E\u261C\u261E\xB6\u2020\u2021\u2195\u2197\u2199\u2196\u2198\u266D\u2669\u266A\u266C\u327F\u321C\u2116\u33C7\u2122\u33C2\u33D8\u2121\u20AC\xAE"], + ["a341", "\uC971\uC972\uC973\uC975", 6, "\uC97D", 10, "\uC98A\uC98B\uC98D\uC98E\uC98F"], + ["a361", "\uC991", 6, "\uC99A\uC99C\uC99E", 16], + ["a381", "\uC9AF", 16, "\uC9C2\uC9C3\uC9C5\uC9C6\uC9C9\uC9CB", 4, "\uC9D2\uC9D4\uC9D7\uC9D8\uC9DB\uFF01", 58, "\uFFE6\uFF3D", 32, "\uFFE3"], + ["a441", "\uC9DE\uC9DF\uC9E1\uC9E3\uC9E5\uC9E6\uC9E8\uC9E9\uC9EA\uC9EB\uC9EE\uC9F2", 5, "\uC9FA\uC9FB\uC9FD\uC9FE\uC9FF\uCA01\uCA02\uCA03\uCA04"], + ["a461", "\uCA05\uCA06\uCA07\uCA0A\uCA0E", 5, "\uCA15\uCA16\uCA17\uCA19", 12], + ["a481", "\uCA26\uCA27\uCA28\uCA2A", 28, "\u3131", 93], + ["a541", "\uCA47", 4, "\uCA4E\uCA4F\uCA51\uCA52\uCA53\uCA55", 6, "\uCA5E\uCA62", 5, "\uCA69\uCA6A"], + ["a561", "\uCA6B", 17, "\uCA7E", 5, "\uCA85\uCA86"], + ["a581", "\uCA87", 16, "\uCA99", 14, "\u2170", 9], + ["a5b0", "\u2160", 9], + ["a5c1", "\u0391", 16, "\u03A3", 6], + ["a5e1", "\u03B1", 16, "\u03C3", 6], + ["a641", "\uCAA8", 19, "\uCABE\uCABF\uCAC1\uCAC2\uCAC3\uCAC5"], + ["a661", "\uCAC6", 5, "\uCACE\uCAD0\uCAD2\uCAD4\uCAD5\uCAD6\uCAD7\uCADA", 5, "\uCAE1", 6], + ["a681", "\uCAE8\uCAE9\uCAEA\uCAEB\uCAED", 6, "\uCAF5", 18, "\uCB09\uCB0A\u2500\u2502\u250C\u2510\u2518\u2514\u251C\u252C\u2524\u2534\u253C\u2501\u2503\u250F\u2513\u251B\u2517\u2523\u2533\u252B\u253B\u254B\u2520\u252F\u2528\u2537\u253F\u251D\u2530\u2525\u2538\u2542\u2512\u2511\u251A\u2519\u2516\u2515\u250E\u250D\u251E\u251F\u2521\u2522\u2526\u2527\u2529\u252A\u252D\u252E\u2531\u2532\u2535\u2536\u2539\u253A\u253D\u253E\u2540\u2541\u2543", 7], + ["a741", "\uCB0B", 4, "\uCB11\uCB12\uCB13\uCB15\uCB16\uCB17\uCB19", 6, "\uCB22", 7], + ["a761", "\uCB2A", 22, "\uCB42\uCB43\uCB44"], + ["a781", "\uCB45\uCB46\uCB47\uCB4A\uCB4B\uCB4D\uCB4E\uCB4F\uCB51", 6, "\uCB5A\uCB5B\uCB5C\uCB5E", 5, "\uCB65", 7, "\u3395\u3396\u3397\u2113\u3398\u33C4\u33A3\u33A4\u33A5\u33A6\u3399", 9, "\u33CA\u338D\u338E\u338F\u33CF\u3388\u3389\u33C8\u33A7\u33A8\u33B0", 9, "\u3380", 4, "\u33BA", 5, "\u3390", 4, "\u2126\u33C0\u33C1\u338A\u338B\u338C\u33D6\u33C5\u33AD\u33AE\u33AF\u33DB\u33A9\u33AA\u33AB\u33AC\u33DD\u33D0\u33D3\u33C3\u33C9\u33DC\u33C6"], + ["a841", "\uCB6D", 10, "\uCB7A", 14], + ["a861", "\uCB89", 18, "\uCB9D", 6], + ["a881", "\uCBA4", 19, "\uCBB9", 11, "\xC6\xD0\xAA\u0126"], + ["a8a6", "\u0132"], + ["a8a8", "\u013F\u0141\xD8\u0152\xBA\xDE\u0166\u014A"], + ["a8b1", "\u3260", 27, "\u24D0", 25, "\u2460", 14, "\xBD\u2153\u2154\xBC\xBE\u215B\u215C\u215D\u215E"], + ["a941", "\uCBC5", 14, "\uCBD5", 10], + ["a961", "\uCBE0\uCBE1\uCBE2\uCBE3\uCBE5\uCBE6\uCBE8\uCBEA", 18], + ["a981", "\uCBFD", 14, "\uCC0E\uCC0F\uCC11\uCC12\uCC13\uCC15", 6, "\uCC1E\uCC1F\uCC20\uCC23\uCC24\xE6\u0111\xF0\u0127\u0131\u0133\u0138\u0140\u0142\xF8\u0153\xDF\xFE\u0167\u014B\u0149\u3200", 27, "\u249C", 25, "\u2474", 14, "\xB9\xB2\xB3\u2074\u207F\u2081\u2082\u2083\u2084"], + ["aa41", "\uCC25\uCC26\uCC2A\uCC2B\uCC2D\uCC2F\uCC31", 6, "\uCC3A\uCC3F", 4, "\uCC46\uCC47\uCC49\uCC4A\uCC4B\uCC4D\uCC4E"], + ["aa61", "\uCC4F", 4, "\uCC56\uCC5A", 5, "\uCC61\uCC62\uCC63\uCC65\uCC67\uCC69", 6, "\uCC71\uCC72"], + ["aa81", "\uCC73\uCC74\uCC76", 29, "\u3041", 82], + ["ab41", "\uCC94\uCC95\uCC96\uCC97\uCC9A\uCC9B\uCC9D\uCC9E\uCC9F\uCCA1", 6, "\uCCAA\uCCAE", 5, "\uCCB6\uCCB7\uCCB9"], + ["ab61", "\uCCBA\uCCBB\uCCBD", 6, "\uCCC6\uCCC8\uCCCA", 5, "\uCCD1\uCCD2\uCCD3\uCCD5", 5], + ["ab81", "\uCCDB", 8, "\uCCE5", 6, "\uCCED\uCCEE\uCCEF\uCCF1", 12, "\u30A1", 85], + ["ac41", "\uCCFE\uCCFF\uCD00\uCD02", 5, "\uCD0A\uCD0B\uCD0D\uCD0E\uCD0F\uCD11", 6, "\uCD1A\uCD1C\uCD1E\uCD1F\uCD20"], + ["ac61", "\uCD21\uCD22\uCD23\uCD25\uCD26\uCD27\uCD29\uCD2A\uCD2B\uCD2D", 11, "\uCD3A", 4], + ["ac81", "\uCD3F", 28, "\uCD5D\uCD5E\uCD5F\u0410", 5, "\u0401\u0416", 25], + ["acd1", "\u0430", 5, "\u0451\u0436", 25], + ["ad41", "\uCD61\uCD62\uCD63\uCD65", 6, "\uCD6E\uCD70\uCD72", 5, "\uCD79", 7], + ["ad61", "\uCD81", 6, "\uCD89", 10, "\uCD96\uCD97\uCD99\uCD9A\uCD9B\uCD9D\uCD9E\uCD9F"], + ["ad81", "\uCDA0\uCDA1\uCDA2\uCDA3\uCDA6\uCDA8\uCDAA", 5, "\uCDB1", 18, "\uCDC5"], + ["ae41", "\uCDC6", 5, "\uCDCD\uCDCE\uCDCF\uCDD1", 16], + ["ae61", "\uCDE2", 5, "\uCDE9\uCDEA\uCDEB\uCDED\uCDEE\uCDEF\uCDF1", 6, "\uCDFA\uCDFC\uCDFE", 4], + ["ae81", "\uCE03\uCE05\uCE06\uCE07\uCE09\uCE0A\uCE0B\uCE0D", 6, "\uCE15\uCE16\uCE17\uCE18\uCE1A", 5, "\uCE22\uCE23\uCE25\uCE26\uCE27\uCE29\uCE2A\uCE2B"], + ["af41", "\uCE2C\uCE2D\uCE2E\uCE2F\uCE32\uCE34\uCE36", 19], + ["af61", "\uCE4A", 13, "\uCE5A\uCE5B\uCE5D\uCE5E\uCE62", 5, "\uCE6A\uCE6C"], + ["af81", "\uCE6E", 5, "\uCE76\uCE77\uCE79\uCE7A\uCE7B\uCE7D", 6, "\uCE86\uCE88\uCE8A", 5, "\uCE92\uCE93\uCE95\uCE96\uCE97\uCE99"], + ["b041", "\uCE9A", 5, "\uCEA2\uCEA6", 5, "\uCEAE", 12], + ["b061", "\uCEBB", 5, "\uCEC2", 19], + ["b081", "\uCED6", 13, "\uCEE6\uCEE7\uCEE9\uCEEA\uCEED", 6, "\uCEF6\uCEFA", 5, "\uAC00\uAC01\uAC04\uAC07\uAC08\uAC09\uAC0A\uAC10", 7, "\uAC19", 4, "\uAC20\uAC24\uAC2C\uAC2D\uAC2F\uAC30\uAC31\uAC38\uAC39\uAC3C\uAC40\uAC4B\uAC4D\uAC54\uAC58\uAC5C\uAC70\uAC71\uAC74\uAC77\uAC78\uAC7A\uAC80\uAC81\uAC83\uAC84\uAC85\uAC86\uAC89\uAC8A\uAC8B\uAC8C\uAC90\uAC94\uAC9C\uAC9D\uAC9F\uACA0\uACA1\uACA8\uACA9\uACAA\uACAC\uACAF\uACB0\uACB8\uACB9\uACBB\uACBC\uACBD\uACC1\uACC4\uACC8\uACCC\uACD5\uACD7\uACE0\uACE1\uACE4\uACE7\uACE8\uACEA\uACEC\uACEF\uACF0\uACF1\uACF3\uACF5\uACF6\uACFC\uACFD\uAD00\uAD04\uAD06"], + ["b141", "\uCF02\uCF03\uCF05\uCF06\uCF07\uCF09", 6, "\uCF12\uCF14\uCF16", 5, "\uCF1D\uCF1E\uCF1F\uCF21\uCF22\uCF23"], + ["b161", "\uCF25", 6, "\uCF2E\uCF32", 5, "\uCF39", 11], + ["b181", "\uCF45", 14, "\uCF56\uCF57\uCF59\uCF5A\uCF5B\uCF5D", 6, "\uCF66\uCF68\uCF6A\uCF6B\uCF6C\uAD0C\uAD0D\uAD0F\uAD11\uAD18\uAD1C\uAD20\uAD29\uAD2C\uAD2D\uAD34\uAD35\uAD38\uAD3C\uAD44\uAD45\uAD47\uAD49\uAD50\uAD54\uAD58\uAD61\uAD63\uAD6C\uAD6D\uAD70\uAD73\uAD74\uAD75\uAD76\uAD7B\uAD7C\uAD7D\uAD7F\uAD81\uAD82\uAD88\uAD89\uAD8C\uAD90\uAD9C\uAD9D\uADA4\uADB7\uADC0\uADC1\uADC4\uADC8\uADD0\uADD1\uADD3\uADDC\uADE0\uADE4\uADF8\uADF9\uADFC\uADFF\uAE00\uAE01\uAE08\uAE09\uAE0B\uAE0D\uAE14\uAE30\uAE31\uAE34\uAE37\uAE38\uAE3A\uAE40\uAE41\uAE43\uAE45\uAE46\uAE4A\uAE4C\uAE4D\uAE4E\uAE50\uAE54\uAE56\uAE5C\uAE5D\uAE5F\uAE60\uAE61\uAE65\uAE68\uAE69\uAE6C\uAE70\uAE78"], + ["b241", "\uCF6D\uCF6E\uCF6F\uCF72\uCF73\uCF75\uCF76\uCF77\uCF79", 6, "\uCF81\uCF82\uCF83\uCF84\uCF86", 5, "\uCF8D"], + ["b261", "\uCF8E", 18, "\uCFA2", 5, "\uCFA9"], + ["b281", "\uCFAA", 5, "\uCFB1", 18, "\uCFC5", 6, "\uAE79\uAE7B\uAE7C\uAE7D\uAE84\uAE85\uAE8C\uAEBC\uAEBD\uAEBE\uAEC0\uAEC4\uAECC\uAECD\uAECF\uAED0\uAED1\uAED8\uAED9\uAEDC\uAEE8\uAEEB\uAEED\uAEF4\uAEF8\uAEFC\uAF07\uAF08\uAF0D\uAF10\uAF2C\uAF2D\uAF30\uAF32\uAF34\uAF3C\uAF3D\uAF3F\uAF41\uAF42\uAF43\uAF48\uAF49\uAF50\uAF5C\uAF5D\uAF64\uAF65\uAF79\uAF80\uAF84\uAF88\uAF90\uAF91\uAF95\uAF9C\uAFB8\uAFB9\uAFBC\uAFC0\uAFC7\uAFC8\uAFC9\uAFCB\uAFCD\uAFCE\uAFD4\uAFDC\uAFE8\uAFE9\uAFF0\uAFF1\uAFF4\uAFF8\uB000\uB001\uB004\uB00C\uB010\uB014\uB01C\uB01D\uB028\uB044\uB045\uB048\uB04A\uB04C\uB04E\uB053\uB054\uB055\uB057\uB059"], + ["b341", "\uCFCC", 19, "\uCFE2\uCFE3\uCFE5\uCFE6\uCFE7\uCFE9"], + ["b361", "\uCFEA", 5, "\uCFF2\uCFF4\uCFF6", 5, "\uCFFD\uCFFE\uCFFF\uD001\uD002\uD003\uD005", 5], + ["b381", "\uD00B", 5, "\uD012", 5, "\uD019", 19, "\uB05D\uB07C\uB07D\uB080\uB084\uB08C\uB08D\uB08F\uB091\uB098\uB099\uB09A\uB09C\uB09F\uB0A0\uB0A1\uB0A2\uB0A8\uB0A9\uB0AB", 4, "\uB0B1\uB0B3\uB0B4\uB0B5\uB0B8\uB0BC\uB0C4\uB0C5\uB0C7\uB0C8\uB0C9\uB0D0\uB0D1\uB0D4\uB0D8\uB0E0\uB0E5\uB108\uB109\uB10B\uB10C\uB110\uB112\uB113\uB118\uB119\uB11B\uB11C\uB11D\uB123\uB124\uB125\uB128\uB12C\uB134\uB135\uB137\uB138\uB139\uB140\uB141\uB144\uB148\uB150\uB151\uB154\uB155\uB158\uB15C\uB160\uB178\uB179\uB17C\uB180\uB182\uB188\uB189\uB18B\uB18D\uB192\uB193\uB194\uB198\uB19C\uB1A8\uB1CC\uB1D0\uB1D4\uB1DC\uB1DD"], + ["b441", "\uD02E", 5, "\uD036\uD037\uD039\uD03A\uD03B\uD03D", 6, "\uD046\uD048\uD04A", 5], + ["b461", "\uD051\uD052\uD053\uD055\uD056\uD057\uD059", 6, "\uD061", 10, "\uD06E\uD06F"], + ["b481", "\uD071\uD072\uD073\uD075", 6, "\uD07E\uD07F\uD080\uD082", 18, "\uB1DF\uB1E8\uB1E9\uB1EC\uB1F0\uB1F9\uB1FB\uB1FD\uB204\uB205\uB208\uB20B\uB20C\uB214\uB215\uB217\uB219\uB220\uB234\uB23C\uB258\uB25C\uB260\uB268\uB269\uB274\uB275\uB27C\uB284\uB285\uB289\uB290\uB291\uB294\uB298\uB299\uB29A\uB2A0\uB2A1\uB2A3\uB2A5\uB2A6\uB2AA\uB2AC\uB2B0\uB2B4\uB2C8\uB2C9\uB2CC\uB2D0\uB2D2\uB2D8\uB2D9\uB2DB\uB2DD\uB2E2\uB2E4\uB2E5\uB2E6\uB2E8\uB2EB", 4, "\uB2F3\uB2F4\uB2F5\uB2F7", 4, "\uB2FF\uB300\uB301\uB304\uB308\uB310\uB311\uB313\uB314\uB315\uB31C\uB354\uB355\uB356\uB358\uB35B\uB35C\uB35E\uB35F\uB364\uB365"], + ["b541", "\uD095", 14, "\uD0A6\uD0A7\uD0A9\uD0AA\uD0AB\uD0AD", 5], + ["b561", "\uD0B3\uD0B6\uD0B8\uD0BA", 5, "\uD0C2\uD0C3\uD0C5\uD0C6\uD0C7\uD0CA", 5, "\uD0D2\uD0D6", 4], + ["b581", "\uD0DB\uD0DE\uD0DF\uD0E1\uD0E2\uD0E3\uD0E5", 6, "\uD0EE\uD0F2", 5, "\uD0F9", 11, "\uB367\uB369\uB36B\uB36E\uB370\uB371\uB374\uB378\uB380\uB381\uB383\uB384\uB385\uB38C\uB390\uB394\uB3A0\uB3A1\uB3A8\uB3AC\uB3C4\uB3C5\uB3C8\uB3CB\uB3CC\uB3CE\uB3D0\uB3D4\uB3D5\uB3D7\uB3D9\uB3DB\uB3DD\uB3E0\uB3E4\uB3E8\uB3FC\uB410\uB418\uB41C\uB420\uB428\uB429\uB42B\uB434\uB450\uB451\uB454\uB458\uB460\uB461\uB463\uB465\uB46C\uB480\uB488\uB49D\uB4A4\uB4A8\uB4AC\uB4B5\uB4B7\uB4B9\uB4C0\uB4C4\uB4C8\uB4D0\uB4D5\uB4DC\uB4DD\uB4E0\uB4E3\uB4E4\uB4E6\uB4EC\uB4ED\uB4EF\uB4F1\uB4F8\uB514\uB515\uB518\uB51B\uB51C\uB524\uB525\uB527\uB528\uB529\uB52A\uB530\uB531\uB534\uB538"], + ["b641", "\uD105", 7, "\uD10E", 17], + ["b661", "\uD120", 15, "\uD132\uD133\uD135\uD136\uD137\uD139\uD13B\uD13C\uD13D\uD13E"], + ["b681", "\uD13F\uD142\uD146", 5, "\uD14E\uD14F\uD151\uD152\uD153\uD155", 6, "\uD15E\uD160\uD162", 5, "\uD169\uD16A\uD16B\uD16D\uB540\uB541\uB543\uB544\uB545\uB54B\uB54C\uB54D\uB550\uB554\uB55C\uB55D\uB55F\uB560\uB561\uB5A0\uB5A1\uB5A4\uB5A8\uB5AA\uB5AB\uB5B0\uB5B1\uB5B3\uB5B4\uB5B5\uB5BB\uB5BC\uB5BD\uB5C0\uB5C4\uB5CC\uB5CD\uB5CF\uB5D0\uB5D1\uB5D8\uB5EC\uB610\uB611\uB614\uB618\uB625\uB62C\uB634\uB648\uB664\uB668\uB69C\uB69D\uB6A0\uB6A4\uB6AB\uB6AC\uB6B1\uB6D4\uB6F0\uB6F4\uB6F8\uB700\uB701\uB705\uB728\uB729\uB72C\uB72F\uB730\uB738\uB739\uB73B\uB744\uB748\uB74C\uB754\uB755\uB760\uB764\uB768\uB770\uB771\uB773\uB775\uB77C\uB77D\uB780\uB784\uB78C\uB78D\uB78F\uB790\uB791\uB792\uB796\uB797"], + ["b741", "\uD16E", 13, "\uD17D", 6, "\uD185\uD186\uD187\uD189\uD18A"], + ["b761", "\uD18B", 20, "\uD1A2\uD1A3\uD1A5\uD1A6\uD1A7"], + ["b781", "\uD1A9", 6, "\uD1B2\uD1B4\uD1B6\uD1B7\uD1B8\uD1B9\uD1BB\uD1BD\uD1BE\uD1BF\uD1C1", 14, "\uB798\uB799\uB79C\uB7A0\uB7A8\uB7A9\uB7AB\uB7AC\uB7AD\uB7B4\uB7B5\uB7B8\uB7C7\uB7C9\uB7EC\uB7ED\uB7F0\uB7F4\uB7FC\uB7FD\uB7FF\uB800\uB801\uB807\uB808\uB809\uB80C\uB810\uB818\uB819\uB81B\uB81D\uB824\uB825\uB828\uB82C\uB834\uB835\uB837\uB838\uB839\uB840\uB844\uB851\uB853\uB85C\uB85D\uB860\uB864\uB86C\uB86D\uB86F\uB871\uB878\uB87C\uB88D\uB8A8\uB8B0\uB8B4\uB8B8\uB8C0\uB8C1\uB8C3\uB8C5\uB8CC\uB8D0\uB8D4\uB8DD\uB8DF\uB8E1\uB8E8\uB8E9\uB8EC\uB8F0\uB8F8\uB8F9\uB8FB\uB8FD\uB904\uB918\uB920\uB93C\uB93D\uB940\uB944\uB94C\uB94F\uB951\uB958\uB959\uB95C\uB960\uB968\uB969"], + ["b841", "\uD1D0", 7, "\uD1D9", 17], + ["b861", "\uD1EB", 8, "\uD1F5\uD1F6\uD1F7\uD1F9", 13], + ["b881", "\uD208\uD20A", 5, "\uD211", 24, "\uB96B\uB96D\uB974\uB975\uB978\uB97C\uB984\uB985\uB987\uB989\uB98A\uB98D\uB98E\uB9AC\uB9AD\uB9B0\uB9B4\uB9BC\uB9BD\uB9BF\uB9C1\uB9C8\uB9C9\uB9CC\uB9CE", 4, "\uB9D8\uB9D9\uB9DB\uB9DD\uB9DE\uB9E1\uB9E3\uB9E4\uB9E5\uB9E8\uB9EC\uB9F4\uB9F5\uB9F7\uB9F8\uB9F9\uB9FA\uBA00\uBA01\uBA08\uBA15\uBA38\uBA39\uBA3C\uBA40\uBA42\uBA48\uBA49\uBA4B\uBA4D\uBA4E\uBA53\uBA54\uBA55\uBA58\uBA5C\uBA64\uBA65\uBA67\uBA68\uBA69\uBA70\uBA71\uBA74\uBA78\uBA83\uBA84\uBA85\uBA87\uBA8C\uBAA8\uBAA9\uBAAB\uBAAC\uBAB0\uBAB2\uBAB8\uBAB9\uBABB\uBABD\uBAC4\uBAC8\uBAD8\uBAD9\uBAFC"], + ["b941", "\uD22A\uD22B\uD22E\uD22F\uD231\uD232\uD233\uD235", 6, "\uD23E\uD240\uD242", 5, "\uD249\uD24A\uD24B\uD24C"], + ["b961", "\uD24D", 14, "\uD25D", 6, "\uD265\uD266\uD267\uD268"], + ["b981", "\uD269", 22, "\uD282\uD283\uD285\uD286\uD287\uD289\uD28A\uD28B\uD28C\uBB00\uBB04\uBB0D\uBB0F\uBB11\uBB18\uBB1C\uBB20\uBB29\uBB2B\uBB34\uBB35\uBB36\uBB38\uBB3B\uBB3C\uBB3D\uBB3E\uBB44\uBB45\uBB47\uBB49\uBB4D\uBB4F\uBB50\uBB54\uBB58\uBB61\uBB63\uBB6C\uBB88\uBB8C\uBB90\uBBA4\uBBA8\uBBAC\uBBB4\uBBB7\uBBC0\uBBC4\uBBC8\uBBD0\uBBD3\uBBF8\uBBF9\uBBFC\uBBFF\uBC00\uBC02\uBC08\uBC09\uBC0B\uBC0C\uBC0D\uBC0F\uBC11\uBC14", 4, "\uBC1B", 4, "\uBC24\uBC25\uBC27\uBC29\uBC2D\uBC30\uBC31\uBC34\uBC38\uBC40\uBC41\uBC43\uBC44\uBC45\uBC49\uBC4C\uBC4D\uBC50\uBC5D\uBC84\uBC85\uBC88\uBC8B\uBC8C\uBC8E\uBC94\uBC95\uBC97"], + ["ba41", "\uD28D\uD28E\uD28F\uD292\uD293\uD294\uD296", 5, "\uD29D\uD29E\uD29F\uD2A1\uD2A2\uD2A3\uD2A5", 6, "\uD2AD"], + ["ba61", "\uD2AE\uD2AF\uD2B0\uD2B2", 5, "\uD2BA\uD2BB\uD2BD\uD2BE\uD2C1\uD2C3", 4, "\uD2CA\uD2CC", 5], + ["ba81", "\uD2D2\uD2D3\uD2D5\uD2D6\uD2D7\uD2D9\uD2DA\uD2DB\uD2DD", 6, "\uD2E6", 9, "\uD2F2\uD2F3\uD2F5\uD2F6\uD2F7\uD2F9\uD2FA\uBC99\uBC9A\uBCA0\uBCA1\uBCA4\uBCA7\uBCA8\uBCB0\uBCB1\uBCB3\uBCB4\uBCB5\uBCBC\uBCBD\uBCC0\uBCC4\uBCCD\uBCCF\uBCD0\uBCD1\uBCD5\uBCD8\uBCDC\uBCF4\uBCF5\uBCF6\uBCF8\uBCFC\uBD04\uBD05\uBD07\uBD09\uBD10\uBD14\uBD24\uBD2C\uBD40\uBD48\uBD49\uBD4C\uBD50\uBD58\uBD59\uBD64\uBD68\uBD80\uBD81\uBD84\uBD87\uBD88\uBD89\uBD8A\uBD90\uBD91\uBD93\uBD95\uBD99\uBD9A\uBD9C\uBDA4\uBDB0\uBDB8\uBDD4\uBDD5\uBDD8\uBDDC\uBDE9\uBDF0\uBDF4\uBDF8\uBE00\uBE03\uBE05\uBE0C\uBE0D\uBE10\uBE14\uBE1C\uBE1D\uBE1F\uBE44\uBE45\uBE48\uBE4C\uBE4E\uBE54\uBE55\uBE57\uBE59\uBE5A\uBE5B\uBE60\uBE61\uBE64"], + ["bb41", "\uD2FB", 4, "\uD302\uD304\uD306", 5, "\uD30F\uD311\uD312\uD313\uD315\uD317", 4, "\uD31E\uD322\uD323"], + ["bb61", "\uD324\uD326\uD327\uD32A\uD32B\uD32D\uD32E\uD32F\uD331", 6, "\uD33A\uD33E", 5, "\uD346\uD347\uD348\uD349"], + ["bb81", "\uD34A", 31, "\uBE68\uBE6A\uBE70\uBE71\uBE73\uBE74\uBE75\uBE7B\uBE7C\uBE7D\uBE80\uBE84\uBE8C\uBE8D\uBE8F\uBE90\uBE91\uBE98\uBE99\uBEA8\uBED0\uBED1\uBED4\uBED7\uBED8\uBEE0\uBEE3\uBEE4\uBEE5\uBEEC\uBF01\uBF08\uBF09\uBF18\uBF19\uBF1B\uBF1C\uBF1D\uBF40\uBF41\uBF44\uBF48\uBF50\uBF51\uBF55\uBF94\uBFB0\uBFC5\uBFCC\uBFCD\uBFD0\uBFD4\uBFDC\uBFDF\uBFE1\uC03C\uC051\uC058\uC05C\uC060\uC068\uC069\uC090\uC091\uC094\uC098\uC0A0\uC0A1\uC0A3\uC0A5\uC0AC\uC0AD\uC0AF\uC0B0\uC0B3\uC0B4\uC0B5\uC0B6\uC0BC\uC0BD\uC0BF\uC0C0\uC0C1\uC0C5\uC0C8\uC0C9\uC0CC\uC0D0\uC0D8\uC0D9\uC0DB\uC0DC\uC0DD\uC0E4"], + ["bc41", "\uD36A", 17, "\uD37E\uD37F\uD381\uD382\uD383\uD385\uD386\uD387"], + ["bc61", "\uD388\uD389\uD38A\uD38B\uD38E\uD392", 5, "\uD39A\uD39B\uD39D\uD39E\uD39F\uD3A1", 6, "\uD3AA\uD3AC\uD3AE"], + ["bc81", "\uD3AF", 4, "\uD3B5\uD3B6\uD3B7\uD3B9\uD3BA\uD3BB\uD3BD", 6, "\uD3C6\uD3C7\uD3CA", 5, "\uD3D1", 5, "\uC0E5\uC0E8\uC0EC\uC0F4\uC0F5\uC0F7\uC0F9\uC100\uC104\uC108\uC110\uC115\uC11C", 4, "\uC123\uC124\uC126\uC127\uC12C\uC12D\uC12F\uC130\uC131\uC136\uC138\uC139\uC13C\uC140\uC148\uC149\uC14B\uC14C\uC14D\uC154\uC155\uC158\uC15C\uC164\uC165\uC167\uC168\uC169\uC170\uC174\uC178\uC185\uC18C\uC18D\uC18E\uC190\uC194\uC196\uC19C\uC19D\uC19F\uC1A1\uC1A5\uC1A8\uC1A9\uC1AC\uC1B0\uC1BD\uC1C4\uC1C8\uC1CC\uC1D4\uC1D7\uC1D8\uC1E0\uC1E4\uC1E8\uC1F0\uC1F1\uC1F3\uC1FC\uC1FD\uC200\uC204\uC20C\uC20D\uC20F\uC211\uC218\uC219\uC21C\uC21F\uC220\uC228\uC229\uC22B\uC22D"], + ["bd41", "\uD3D7\uD3D9", 7, "\uD3E2\uD3E4", 7, "\uD3EE\uD3EF\uD3F1\uD3F2\uD3F3\uD3F5\uD3F6\uD3F7"], + ["bd61", "\uD3F8\uD3F9\uD3FA\uD3FB\uD3FE\uD400\uD402", 5, "\uD409", 13], + ["bd81", "\uD417", 5, "\uD41E", 25, "\uC22F\uC231\uC232\uC234\uC248\uC250\uC251\uC254\uC258\uC260\uC265\uC26C\uC26D\uC270\uC274\uC27C\uC27D\uC27F\uC281\uC288\uC289\uC290\uC298\uC29B\uC29D\uC2A4\uC2A5\uC2A8\uC2AC\uC2AD\uC2B4\uC2B5\uC2B7\uC2B9\uC2DC\uC2DD\uC2E0\uC2E3\uC2E4\uC2EB\uC2EC\uC2ED\uC2EF\uC2F1\uC2F6\uC2F8\uC2F9\uC2FB\uC2FC\uC300\uC308\uC309\uC30C\uC30D\uC313\uC314\uC315\uC318\uC31C\uC324\uC325\uC328\uC329\uC345\uC368\uC369\uC36C\uC370\uC372\uC378\uC379\uC37C\uC37D\uC384\uC388\uC38C\uC3C0\uC3D8\uC3D9\uC3DC\uC3DF\uC3E0\uC3E2\uC3E8\uC3E9\uC3ED\uC3F4\uC3F5\uC3F8\uC408\uC410\uC424\uC42C\uC430"], + ["be41", "\uD438", 7, "\uD441\uD442\uD443\uD445", 14], + ["be61", "\uD454", 7, "\uD45D\uD45E\uD45F\uD461\uD462\uD463\uD465", 7, "\uD46E\uD470\uD471\uD472"], + ["be81", "\uD473", 4, "\uD47A\uD47B\uD47D\uD47E\uD481\uD483", 4, "\uD48A\uD48C\uD48E", 5, "\uD495", 8, "\uC434\uC43C\uC43D\uC448\uC464\uC465\uC468\uC46C\uC474\uC475\uC479\uC480\uC494\uC49C\uC4B8\uC4BC\uC4E9\uC4F0\uC4F1\uC4F4\uC4F8\uC4FA\uC4FF\uC500\uC501\uC50C\uC510\uC514\uC51C\uC528\uC529\uC52C\uC530\uC538\uC539\uC53B\uC53D\uC544\uC545\uC548\uC549\uC54A\uC54C\uC54D\uC54E\uC553\uC554\uC555\uC557\uC558\uC559\uC55D\uC55E\uC560\uC561\uC564\uC568\uC570\uC571\uC573\uC574\uC575\uC57C\uC57D\uC580\uC584\uC587\uC58C\uC58D\uC58F\uC591\uC595\uC597\uC598\uC59C\uC5A0\uC5A9\uC5B4\uC5B5\uC5B8\uC5B9\uC5BB\uC5BC\uC5BD\uC5BE\uC5C4", 6, "\uC5CC\uC5CE"], + ["bf41", "\uD49E", 10, "\uD4AA", 14], + ["bf61", "\uD4B9", 18, "\uD4CD\uD4CE\uD4CF\uD4D1\uD4D2\uD4D3\uD4D5"], + ["bf81", "\uD4D6", 5, "\uD4DD\uD4DE\uD4E0", 7, "\uD4E9\uD4EA\uD4EB\uD4ED\uD4EE\uD4EF\uD4F1", 6, "\uD4F9\uD4FA\uD4FC\uC5D0\uC5D1\uC5D4\uC5D8\uC5E0\uC5E1\uC5E3\uC5E5\uC5EC\uC5ED\uC5EE\uC5F0\uC5F4\uC5F6\uC5F7\uC5FC", 5, "\uC605\uC606\uC607\uC608\uC60C\uC610\uC618\uC619\uC61B\uC61C\uC624\uC625\uC628\uC62C\uC62D\uC62E\uC630\uC633\uC634\uC635\uC637\uC639\uC63B\uC640\uC641\uC644\uC648\uC650\uC651\uC653\uC654\uC655\uC65C\uC65D\uC660\uC66C\uC66F\uC671\uC678\uC679\uC67C\uC680\uC688\uC689\uC68B\uC68D\uC694\uC695\uC698\uC69C\uC6A4\uC6A5\uC6A7\uC6A9\uC6B0\uC6B1\uC6B4\uC6B8\uC6B9\uC6BA\uC6C0\uC6C1\uC6C3\uC6C5\uC6CC\uC6CD\uC6D0\uC6D4\uC6DC\uC6DD\uC6E0\uC6E1\uC6E8"], + ["c041", "\uD4FE", 5, "\uD505\uD506\uD507\uD509\uD50A\uD50B\uD50D", 6, "\uD516\uD518", 5], + ["c061", "\uD51E", 25], + ["c081", "\uD538\uD539\uD53A\uD53B\uD53E\uD53F\uD541\uD542\uD543\uD545", 6, "\uD54E\uD550\uD552", 5, "\uD55A\uD55B\uD55D\uD55E\uD55F\uD561\uD562\uD563\uC6E9\uC6EC\uC6F0\uC6F8\uC6F9\uC6FD\uC704\uC705\uC708\uC70C\uC714\uC715\uC717\uC719\uC720\uC721\uC724\uC728\uC730\uC731\uC733\uC735\uC737\uC73C\uC73D\uC740\uC744\uC74A\uC74C\uC74D\uC74F\uC751", 7, "\uC75C\uC760\uC768\uC76B\uC774\uC775\uC778\uC77C\uC77D\uC77E\uC783\uC784\uC785\uC787\uC788\uC789\uC78A\uC78E\uC790\uC791\uC794\uC796\uC797\uC798\uC79A\uC7A0\uC7A1\uC7A3\uC7A4\uC7A5\uC7A6\uC7AC\uC7AD\uC7B0\uC7B4\uC7BC\uC7BD\uC7BF\uC7C0\uC7C1\uC7C8\uC7C9\uC7CC\uC7CE\uC7D0\uC7D8\uC7DD\uC7E4\uC7E8\uC7EC\uC800\uC801\uC804\uC808\uC80A"], + ["c141", "\uD564\uD566\uD567\uD56A\uD56C\uD56E", 5, "\uD576\uD577\uD579\uD57A\uD57B\uD57D", 6, "\uD586\uD58A\uD58B"], + ["c161", "\uD58C\uD58D\uD58E\uD58F\uD591", 19, "\uD5A6\uD5A7"], + ["c181", "\uD5A8", 31, "\uC810\uC811\uC813\uC815\uC816\uC81C\uC81D\uC820\uC824\uC82C\uC82D\uC82F\uC831\uC838\uC83C\uC840\uC848\uC849\uC84C\uC84D\uC854\uC870\uC871\uC874\uC878\uC87A\uC880\uC881\uC883\uC885\uC886\uC887\uC88B\uC88C\uC88D\uC894\uC89D\uC89F\uC8A1\uC8A8\uC8BC\uC8BD\uC8C4\uC8C8\uC8CC\uC8D4\uC8D5\uC8D7\uC8D9\uC8E0\uC8E1\uC8E4\uC8F5\uC8FC\uC8FD\uC900\uC904\uC905\uC906\uC90C\uC90D\uC90F\uC911\uC918\uC92C\uC934\uC950\uC951\uC954\uC958\uC960\uC961\uC963\uC96C\uC970\uC974\uC97C\uC988\uC989\uC98C\uC990\uC998\uC999\uC99B\uC99D\uC9C0\uC9C1\uC9C4\uC9C7\uC9C8\uC9CA\uC9D0\uC9D1\uC9D3"], + ["c241", "\uD5CA\uD5CB\uD5CD\uD5CE\uD5CF\uD5D1\uD5D3", 4, "\uD5DA\uD5DC\uD5DE", 5, "\uD5E6\uD5E7\uD5E9\uD5EA\uD5EB\uD5ED\uD5EE"], + ["c261", "\uD5EF", 4, "\uD5F6\uD5F8\uD5FA", 5, "\uD602\uD603\uD605\uD606\uD607\uD609", 6, "\uD612"], + ["c281", "\uD616", 5, "\uD61D\uD61E\uD61F\uD621\uD622\uD623\uD625", 7, "\uD62E", 9, "\uD63A\uD63B\uC9D5\uC9D6\uC9D9\uC9DA\uC9DC\uC9DD\uC9E0\uC9E2\uC9E4\uC9E7\uC9EC\uC9ED\uC9EF\uC9F0\uC9F1\uC9F8\uC9F9\uC9FC\uCA00\uCA08\uCA09\uCA0B\uCA0C\uCA0D\uCA14\uCA18\uCA29\uCA4C\uCA4D\uCA50\uCA54\uCA5C\uCA5D\uCA5F\uCA60\uCA61\uCA68\uCA7D\uCA84\uCA98\uCABC\uCABD\uCAC0\uCAC4\uCACC\uCACD\uCACF\uCAD1\uCAD3\uCAD8\uCAD9\uCAE0\uCAEC\uCAF4\uCB08\uCB10\uCB14\uCB18\uCB20\uCB21\uCB41\uCB48\uCB49\uCB4C\uCB50\uCB58\uCB59\uCB5D\uCB64\uCB78\uCB79\uCB9C\uCBB8\uCBD4\uCBE4\uCBE7\uCBE9\uCC0C\uCC0D\uCC10\uCC14\uCC1C\uCC1D\uCC21\uCC22\uCC27\uCC28\uCC29\uCC2C\uCC2E\uCC30\uCC38\uCC39\uCC3B"], + ["c341", "\uD63D\uD63E\uD63F\uD641\uD642\uD643\uD644\uD646\uD647\uD64A\uD64C\uD64E\uD64F\uD650\uD652\uD653\uD656\uD657\uD659\uD65A\uD65B\uD65D", 4], + ["c361", "\uD662", 4, "\uD668\uD66A", 5, "\uD672\uD673\uD675", 11], + ["c381", "\uD681\uD682\uD684\uD686", 5, "\uD68E\uD68F\uD691\uD692\uD693\uD695", 7, "\uD69E\uD6A0\uD6A2", 5, "\uD6A9\uD6AA\uCC3C\uCC3D\uCC3E\uCC44\uCC45\uCC48\uCC4C\uCC54\uCC55\uCC57\uCC58\uCC59\uCC60\uCC64\uCC66\uCC68\uCC70\uCC75\uCC98\uCC99\uCC9C\uCCA0\uCCA8\uCCA9\uCCAB\uCCAC\uCCAD\uCCB4\uCCB5\uCCB8\uCCBC\uCCC4\uCCC5\uCCC7\uCCC9\uCCD0\uCCD4\uCCE4\uCCEC\uCCF0\uCD01\uCD08\uCD09\uCD0C\uCD10\uCD18\uCD19\uCD1B\uCD1D\uCD24\uCD28\uCD2C\uCD39\uCD5C\uCD60\uCD64\uCD6C\uCD6D\uCD6F\uCD71\uCD78\uCD88\uCD94\uCD95\uCD98\uCD9C\uCDA4\uCDA5\uCDA7\uCDA9\uCDB0\uCDC4\uCDCC\uCDD0\uCDE8\uCDEC\uCDF0\uCDF8\uCDF9\uCDFB\uCDFD\uCE04\uCE08\uCE0C\uCE14\uCE19\uCE20\uCE21\uCE24\uCE28\uCE30\uCE31\uCE33\uCE35"], + ["c441", "\uD6AB\uD6AD\uD6AE\uD6AF\uD6B1", 7, "\uD6BA\uD6BC", 7, "\uD6C6\uD6C7\uD6C9\uD6CA\uD6CB"], + ["c461", "\uD6CD\uD6CE\uD6CF\uD6D0\uD6D2\uD6D3\uD6D5\uD6D6\uD6D8\uD6DA", 5, "\uD6E1\uD6E2\uD6E3\uD6E5\uD6E6\uD6E7\uD6E9", 4], + ["c481", "\uD6EE\uD6EF\uD6F1\uD6F2\uD6F3\uD6F4\uD6F6", 5, "\uD6FE\uD6FF\uD701\uD702\uD703\uD705", 11, "\uD712\uD713\uD714\uCE58\uCE59\uCE5C\uCE5F\uCE60\uCE61\uCE68\uCE69\uCE6B\uCE6D\uCE74\uCE75\uCE78\uCE7C\uCE84\uCE85\uCE87\uCE89\uCE90\uCE91\uCE94\uCE98\uCEA0\uCEA1\uCEA3\uCEA4\uCEA5\uCEAC\uCEAD\uCEC1\uCEE4\uCEE5\uCEE8\uCEEB\uCEEC\uCEF4\uCEF5\uCEF7\uCEF8\uCEF9\uCF00\uCF01\uCF04\uCF08\uCF10\uCF11\uCF13\uCF15\uCF1C\uCF20\uCF24\uCF2C\uCF2D\uCF2F\uCF30\uCF31\uCF38\uCF54\uCF55\uCF58\uCF5C\uCF64\uCF65\uCF67\uCF69\uCF70\uCF71\uCF74\uCF78\uCF80\uCF85\uCF8C\uCFA1\uCFA8\uCFB0\uCFC4\uCFE0\uCFE1\uCFE4\uCFE8\uCFF0\uCFF1\uCFF3\uCFF5\uCFFC\uD000\uD004\uD011\uD018\uD02D\uD034\uD035\uD038\uD03C"], + ["c541", "\uD715\uD716\uD717\uD71A\uD71B\uD71D\uD71E\uD71F\uD721", 6, "\uD72A\uD72C\uD72E", 5, "\uD736\uD737\uD739"], + ["c561", "\uD73A\uD73B\uD73D", 6, "\uD745\uD746\uD748\uD74A", 5, "\uD752\uD753\uD755\uD75A", 4], + ["c581", "\uD75F\uD762\uD764\uD766\uD767\uD768\uD76A\uD76B\uD76D\uD76E\uD76F\uD771\uD772\uD773\uD775", 6, "\uD77E\uD77F\uD780\uD782", 5, "\uD78A\uD78B\uD044\uD045\uD047\uD049\uD050\uD054\uD058\uD060\uD06C\uD06D\uD070\uD074\uD07C\uD07D\uD081\uD0A4\uD0A5\uD0A8\uD0AC\uD0B4\uD0B5\uD0B7\uD0B9\uD0C0\uD0C1\uD0C4\uD0C8\uD0C9\uD0D0\uD0D1\uD0D3\uD0D4\uD0D5\uD0DC\uD0DD\uD0E0\uD0E4\uD0EC\uD0ED\uD0EF\uD0F0\uD0F1\uD0F8\uD10D\uD130\uD131\uD134\uD138\uD13A\uD140\uD141\uD143\uD144\uD145\uD14C\uD14D\uD150\uD154\uD15C\uD15D\uD15F\uD161\uD168\uD16C\uD17C\uD184\uD188\uD1A0\uD1A1\uD1A4\uD1A8\uD1B0\uD1B1\uD1B3\uD1B5\uD1BA\uD1BC\uD1C0\uD1D8\uD1F4\uD1F8\uD207\uD209\uD210\uD22C\uD22D\uD230\uD234\uD23C\uD23D\uD23F\uD241\uD248\uD25C"], + ["c641", "\uD78D\uD78E\uD78F\uD791", 6, "\uD79A\uD79C\uD79E", 5], + ["c6a1", "\uD264\uD280\uD281\uD284\uD288\uD290\uD291\uD295\uD29C\uD2A0\uD2A4\uD2AC\uD2B1\uD2B8\uD2B9\uD2BC\uD2BF\uD2C0\uD2C2\uD2C8\uD2C9\uD2CB\uD2D4\uD2D8\uD2DC\uD2E4\uD2E5\uD2F0\uD2F1\uD2F4\uD2F8\uD300\uD301\uD303\uD305\uD30C\uD30D\uD30E\uD310\uD314\uD316\uD31C\uD31D\uD31F\uD320\uD321\uD325\uD328\uD329\uD32C\uD330\uD338\uD339\uD33B\uD33C\uD33D\uD344\uD345\uD37C\uD37D\uD380\uD384\uD38C\uD38D\uD38F\uD390\uD391\uD398\uD399\uD39C\uD3A0\uD3A8\uD3A9\uD3AB\uD3AD\uD3B4\uD3B8\uD3BC\uD3C4\uD3C5\uD3C8\uD3C9\uD3D0\uD3D8\uD3E1\uD3E3\uD3EC\uD3ED\uD3F0\uD3F4\uD3FC\uD3FD\uD3FF\uD401"], + ["c7a1", "\uD408\uD41D\uD440\uD444\uD45C\uD460\uD464\uD46D\uD46F\uD478\uD479\uD47C\uD47F\uD480\uD482\uD488\uD489\uD48B\uD48D\uD494\uD4A9\uD4CC\uD4D0\uD4D4\uD4DC\uD4DF\uD4E8\uD4EC\uD4F0\uD4F8\uD4FB\uD4FD\uD504\uD508\uD50C\uD514\uD515\uD517\uD53C\uD53D\uD540\uD544\uD54C\uD54D\uD54F\uD551\uD558\uD559\uD55C\uD560\uD565\uD568\uD569\uD56B\uD56D\uD574\uD575\uD578\uD57C\uD584\uD585\uD587\uD588\uD589\uD590\uD5A5\uD5C8\uD5C9\uD5CC\uD5D0\uD5D2\uD5D8\uD5D9\uD5DB\uD5DD\uD5E4\uD5E5\uD5E8\uD5EC\uD5F4\uD5F5\uD5F7\uD5F9\uD600\uD601\uD604\uD608\uD610\uD611\uD613\uD614\uD615\uD61C\uD620"], + ["c8a1", "\uD624\uD62D\uD638\uD639\uD63C\uD640\uD645\uD648\uD649\uD64B\uD64D\uD651\uD654\uD655\uD658\uD65C\uD667\uD669\uD670\uD671\uD674\uD683\uD685\uD68C\uD68D\uD690\uD694\uD69D\uD69F\uD6A1\uD6A8\uD6AC\uD6B0\uD6B9\uD6BB\uD6C4\uD6C5\uD6C8\uD6CC\uD6D1\uD6D4\uD6D7\uD6D9\uD6E0\uD6E4\uD6E8\uD6F0\uD6F5\uD6FC\uD6FD\uD700\uD704\uD711\uD718\uD719\uD71C\uD720\uD728\uD729\uD72B\uD72D\uD734\uD735\uD738\uD73C\uD744\uD747\uD749\uD750\uD751\uD754\uD756\uD757\uD758\uD759\uD760\uD761\uD763\uD765\uD769\uD76C\uD770\uD774\uD77C\uD77D\uD781\uD788\uD789\uD78C\uD790\uD798\uD799\uD79B\uD79D"], + ["caa1", "\u4F3D\u4F73\u5047\u50F9\u52A0\u53EF\u5475\u54E5\u5609\u5AC1\u5BB6\u6687\u67B6\u67B7\u67EF\u6B4C\u73C2\u75C2\u7A3C\u82DB\u8304\u8857\u8888\u8A36\u8CC8\u8DCF\u8EFB\u8FE6\u99D5\u523B\u5374\u5404\u606A\u6164\u6BBC\u73CF\u811A\u89BA\u89D2\u95A3\u4F83\u520A\u58BE\u5978\u59E6\u5E72\u5E79\u61C7\u63C0\u6746\u67EC\u687F\u6F97\u764E\u770B\u78F5\u7A08\u7AFF\u7C21\u809D\u826E\u8271\u8AEB\u9593\u4E6B\u559D\u66F7\u6E34\u78A3\u7AED\u845B\u8910\u874E\u97A8\u52D8\u574E\u582A\u5D4C\u611F\u61BE\u6221\u6562\u67D1\u6A44\u6E1B\u7518\u75B3\u76E3\u77B0\u7D3A\u90AF\u9451\u9452\u9F95"], + ["cba1", "\u5323\u5CAC\u7532\u80DB\u9240\u9598\u525B\u5808\u59DC\u5CA1\u5D17\u5EB7\u5F3A\u5F4A\u6177\u6C5F\u757A\u7586\u7CE0\u7D73\u7DB1\u7F8C\u8154\u8221\u8591\u8941\u8B1B\u92FC\u964D\u9C47\u4ECB\u4EF7\u500B\u51F1\u584F\u6137\u613E\u6168\u6539\u69EA\u6F11\u75A5\u7686\u76D6\u7B87\u82A5\u84CB\uF900\u93A7\u958B\u5580\u5BA2\u5751\uF901\u7CB3\u7FB9\u91B5\u5028\u53BB\u5C45\u5DE8\u62D2\u636E\u64DA\u64E7\u6E20\u70AC\u795B\u8DDD\u8E1E\uF902\u907D\u9245\u92F8\u4E7E\u4EF6\u5065\u5DFE\u5EFA\u6106\u6957\u8171\u8654\u8E47\u9375\u9A2B\u4E5E\u5091\u6770\u6840\u5109\u528D\u5292\u6AA2"], + ["cca1", "\u77BC\u9210\u9ED4\u52AB\u602F\u8FF2\u5048\u61A9\u63ED\u64CA\u683C\u6A84\u6FC0\u8188\u89A1\u9694\u5805\u727D\u72AC\u7504\u7D79\u7E6D\u80A9\u898B\u8B74\u9063\u9D51\u6289\u6C7A\u6F54\u7D50\u7F3A\u8A23\u517C\u614A\u7B9D\u8B19\u9257\u938C\u4EAC\u4FD3\u501E\u50BE\u5106\u52C1\u52CD\u537F\u5770\u5883\u5E9A\u5F91\u6176\u61AC\u64CE\u656C\u666F\u66BB\u66F4\u6897\u6D87\u7085\u70F1\u749F\u74A5\u74CA\u75D9\u786C\u78EC\u7ADF\u7AF6\u7D45\u7D93\u8015\u803F\u811B\u8396\u8B66\u8F15\u9015\u93E1\u9803\u9838\u9A5A\u9BE8\u4FC2\u5553\u583A\u5951\u5B63\u5C46\u60B8\u6212\u6842\u68B0"], + ["cda1", "\u68E8\u6EAA\u754C\u7678\u78CE\u7A3D\u7CFB\u7E6B\u7E7C\u8A08\u8AA1\u8C3F\u968E\u9DC4\u53E4\u53E9\u544A\u5471\u56FA\u59D1\u5B64\u5C3B\u5EAB\u62F7\u6537\u6545\u6572\u66A0\u67AF\u69C1\u6CBD\u75FC\u7690\u777E\u7A3F\u7F94\u8003\u80A1\u818F\u82E6\u82FD\u83F0\u85C1\u8831\u88B4\u8AA5\uF903\u8F9C\u932E\u96C7\u9867\u9AD8\u9F13\u54ED\u659B\u66F2\u688F\u7A40\u8C37\u9D60\u56F0\u5764\u5D11\u6606\u68B1\u68CD\u6EFE\u7428\u889E\u9BE4\u6C68\uF904\u9AA8\u4F9B\u516C\u5171\u529F\u5B54\u5DE5\u6050\u606D\u62F1\u63A7\u653B\u73D9\u7A7A\u86A3\u8CA2\u978F\u4E32\u5BE1\u6208\u679C\u74DC"], + ["cea1", "\u79D1\u83D3\u8A87\u8AB2\u8DE8\u904E\u934B\u9846\u5ED3\u69E8\u85FF\u90ED\uF905\u51A0\u5B98\u5BEC\u6163\u68FA\u6B3E\u704C\u742F\u74D8\u7BA1\u7F50\u83C5\u89C0\u8CAB\u95DC\u9928\u522E\u605D\u62EC\u9002\u4F8A\u5149\u5321\u58D9\u5EE3\u66E0\u6D38\u709A\u72C2\u73D6\u7B50\u80F1\u945B\u5366\u639B\u7F6B\u4E56\u5080\u584A\u58DE\u602A\u6127\u62D0\u69D0\u9B41\u5B8F\u7D18\u80B1\u8F5F\u4EA4\u50D1\u54AC\u55AC\u5B0C\u5DA0\u5DE7\u652A\u654E\u6821\u6A4B\u72E1\u768E\u77EF\u7D5E\u7FF9\u81A0\u854E\u86DF\u8F03\u8F4E\u90CA\u9903\u9A55\u9BAB\u4E18\u4E45\u4E5D\u4EC7\u4FF1\u5177\u52FE"], + ["cfa1", "\u5340\u53E3\u53E5\u548E\u5614\u5775\u57A2\u5BC7\u5D87\u5ED0\u61FC\u62D8\u6551\u67B8\u67E9\u69CB\u6B50\u6BC6\u6BEC\u6C42\u6E9D\u7078\u72D7\u7396\u7403\u77BF\u77E9\u7A76\u7D7F\u8009\u81FC\u8205\u820A\u82DF\u8862\u8B33\u8CFC\u8EC0\u9011\u90B1\u9264\u92B6\u99D2\u9A45\u9CE9\u9DD7\u9F9C\u570B\u5C40\u83CA\u97A0\u97AB\u9EB4\u541B\u7A98\u7FA4\u88D9\u8ECD\u90E1\u5800\u5C48\u6398\u7A9F\u5BAE\u5F13\u7A79\u7AAE\u828E\u8EAC\u5026\u5238\u52F8\u5377\u5708\u62F3\u6372\u6B0A\u6DC3\u7737\u53A5\u7357\u8568\u8E76\u95D5\u673A\u6AC3\u6F70\u8A6D\u8ECC\u994B\uF906\u6677\u6B78\u8CB4"], + ["d0a1", "\u9B3C\uF907\u53EB\u572D\u594E\u63C6\u69FB\u73EA\u7845\u7ABA\u7AC5\u7CFE\u8475\u898F\u8D73\u9035\u95A8\u52FB\u5747\u7547\u7B60\u83CC\u921E\uF908\u6A58\u514B\u524B\u5287\u621F\u68D8\u6975\u9699\u50C5\u52A4\u52E4\u61C3\u65A4\u6839\u69FF\u747E\u7B4B\u82B9\u83EB\u89B2\u8B39\u8FD1\u9949\uF909\u4ECA\u5997\u64D2\u6611\u6A8E\u7434\u7981\u79BD\u82A9\u887E\u887F\u895F\uF90A\u9326\u4F0B\u53CA\u6025\u6271\u6C72\u7D1A\u7D66\u4E98\u5162\u77DC\u80AF\u4F01\u4F0E\u5176\u5180\u55DC\u5668\u573B\u57FA\u57FC\u5914\u5947\u5993\u5BC4\u5C90\u5D0E\u5DF1\u5E7E\u5FCC\u6280\u65D7\u65E3"], + ["d1a1", "\u671E\u671F\u675E\u68CB\u68C4\u6A5F\u6B3A\u6C23\u6C7D\u6C82\u6DC7\u7398\u7426\u742A\u7482\u74A3\u7578\u757F\u7881\u78EF\u7941\u7947\u7948\u797A\u7B95\u7D00\u7DBA\u7F88\u8006\u802D\u808C\u8A18\u8B4F\u8C48\u8D77\u9321\u9324\u98E2\u9951\u9A0E\u9A0F\u9A65\u9E92\u7DCA\u4F76\u5409\u62EE\u6854\u91D1\u55AB\u513A\uF90B\uF90C\u5A1C\u61E6\uF90D\u62CF\u62FF\uF90E", 5, "\u90A3\uF914", 4, "\u8AFE\uF919\uF91A\uF91B\uF91C\u6696\uF91D\u7156\uF91E\uF91F\u96E3\uF920\u634F\u637A\u5357\uF921\u678F\u6960\u6E73\uF922\u7537\uF923\uF924\uF925"], + ["d2a1", "\u7D0D\uF926\uF927\u8872\u56CA\u5A18\uF928", 4, "\u4E43\uF92D\u5167\u5948\u67F0\u8010\uF92E\u5973\u5E74\u649A\u79CA\u5FF5\u606C\u62C8\u637B\u5BE7\u5BD7\u52AA\uF92F\u5974\u5F29\u6012\uF930\uF931\uF932\u7459\uF933", 5, "\u99D1\uF939", 10, "\u6FC3\uF944\uF945\u81BF\u8FB2\u60F1\uF946\uF947\u8166\uF948\uF949\u5C3F\uF94A", 7, "\u5AE9\u8A25\u677B\u7D10\uF952", 5, "\u80FD\uF958\uF959\u5C3C\u6CE5\u533F\u6EBA\u591A\u8336"], + ["d3a1", "\u4E39\u4EB6\u4F46\u55AE\u5718\u58C7\u5F56\u65B7\u65E6\u6A80\u6BB5\u6E4D\u77ED\u7AEF\u7C1E\u7DDE\u86CB\u8892\u9132\u935B\u64BB\u6FBE\u737A\u75B8\u9054\u5556\u574D\u61BA\u64D4\u66C7\u6DE1\u6E5B\u6F6D\u6FB9\u75F0\u8043\u81BD\u8541\u8983\u8AC7\u8B5A\u931F\u6C93\u7553\u7B54\u8E0F\u905D\u5510\u5802\u5858\u5E62\u6207\u649E\u68E0\u7576\u7CD6\u87B3\u9EE8\u4EE3\u5788\u576E\u5927\u5C0D\u5CB1\u5E36\u5F85\u6234\u64E1\u73B3\u81FA\u888B\u8CB8\u968A\u9EDB\u5B85\u5FB7\u60B3\u5012\u5200\u5230\u5716\u5835\u5857\u5C0E\u5C60\u5CF6\u5D8B\u5EA6\u5F92\u60BC\u6311\u6389\u6417\u6843"], + ["d4a1", "\u68F9\u6AC2\u6DD8\u6E21\u6ED4\u6FE4\u71FE\u76DC\u7779\u79B1\u7A3B\u8404\u89A9\u8CED\u8DF3\u8E48\u9003\u9014\u9053\u90FD\u934D\u9676\u97DC\u6BD2\u7006\u7258\u72A2\u7368\u7763\u79BF\u7BE4\u7E9B\u8B80\u58A9\u60C7\u6566\u65FD\u66BE\u6C8C\u711E\u71C9\u8C5A\u9813\u4E6D\u7A81\u4EDD\u51AC\u51CD\u52D5\u540C\u61A7\u6771\u6850\u68DF\u6D1E\u6F7C\u75BC\u77B3\u7AE5\u80F4\u8463\u9285\u515C\u6597\u675C\u6793\u75D8\u7AC7\u8373\uF95A\u8C46\u9017\u982D\u5C6F\u81C0\u829A\u9041\u906F\u920D\u5F97\u5D9D\u6A59\u71C8\u767B\u7B49\u85E4\u8B04\u9127\u9A30\u5587\u61F6\uF95B\u7669\u7F85"], + ["d5a1", "\u863F\u87BA\u88F8\u908F\uF95C\u6D1B\u70D9\u73DE\u7D61\u843D\uF95D\u916A\u99F1\uF95E\u4E82\u5375\u6B04\u6B12\u703E\u721B\u862D\u9E1E\u524C\u8FA3\u5D50\u64E5\u652C\u6B16\u6FEB\u7C43\u7E9C\u85CD\u8964\u89BD\u62C9\u81D8\u881F\u5ECA\u6717\u6D6A\u72FC\u7405\u746F\u8782\u90DE\u4F86\u5D0D\u5FA0\u840A\u51B7\u63A0\u7565\u4EAE\u5006\u5169\u51C9\u6881\u6A11\u7CAE\u7CB1\u7CE7\u826F\u8AD2\u8F1B\u91CF\u4FB6\u5137\u52F5\u5442\u5EEC\u616E\u623E\u65C5\u6ADA\u6FFE\u792A\u85DC\u8823\u95AD\u9A62\u9A6A\u9E97\u9ECE\u529B\u66C6\u6B77\u701D\u792B\u8F62\u9742\u6190\u6200\u6523\u6F23"], + ["d6a1", "\u7149\u7489\u7DF4\u806F\u84EE\u8F26\u9023\u934A\u51BD\u5217\u52A3\u6D0C\u70C8\u88C2\u5EC9\u6582\u6BAE\u6FC2\u7C3E\u7375\u4EE4\u4F36\u56F9\uF95F\u5CBA\u5DBA\u601C\u73B2\u7B2D\u7F9A\u7FCE\u8046\u901E\u9234\u96F6\u9748\u9818\u9F61\u4F8B\u6FA7\u79AE\u91B4\u96B7\u52DE\uF960\u6488\u64C4\u6AD3\u6F5E\u7018\u7210\u76E7\u8001\u8606\u865C\u8DEF\u8F05\u9732\u9B6F\u9DFA\u9E75\u788C\u797F\u7DA0\u83C9\u9304\u9E7F\u9E93\u8AD6\u58DF\u5F04\u6727\u7027\u74CF\u7C60\u807E\u5121\u7028\u7262\u78CA\u8CC2\u8CDA\u8CF4\u96F7\u4E86\u50DA\u5BEE\u5ED6\u6599\u71CE\u7642\u77AD\u804A\u84FC"], + ["d7a1", "\u907C\u9B27\u9F8D\u58D8\u5A41\u5C62\u6A13\u6DDA\u6F0F\u763B\u7D2F\u7E37\u851E\u8938\u93E4\u964B\u5289\u65D2\u67F3\u69B4\u6D41\u6E9C\u700F\u7409\u7460\u7559\u7624\u786B\u8B2C\u985E\u516D\u622E\u9678\u4F96\u502B\u5D19\u6DEA\u7DB8\u8F2A\u5F8B\u6144\u6817\uF961\u9686\u52D2\u808B\u51DC\u51CC\u695E\u7A1C\u7DBE\u83F1\u9675\u4FDA\u5229\u5398\u540F\u550E\u5C65\u60A7\u674E\u68A8\u6D6C\u7281\u72F8\u7406\u7483\uF962\u75E2\u7C6C\u7F79\u7FB8\u8389\u88CF\u88E1\u91CC\u91D0\u96E2\u9BC9\u541D\u6F7E\u71D0\u7498\u85FA\u8EAA\u96A3\u9C57\u9E9F\u6797\u6DCB\u7433\u81E8\u9716\u782C"], + ["d8a1", "\u7ACB\u7B20\u7C92\u6469\u746A\u75F2\u78BC\u78E8\u99AC\u9B54\u9EBB\u5BDE\u5E55\u6F20\u819C\u83AB\u9088\u4E07\u534D\u5A29\u5DD2\u5F4E\u6162\u633D\u6669\u66FC\u6EFF\u6F2B\u7063\u779E\u842C\u8513\u883B\u8F13\u9945\u9C3B\u551C\u62B9\u672B\u6CAB\u8309\u896A\u977A\u4EA1\u5984\u5FD8\u5FD9\u671B\u7DB2\u7F54\u8292\u832B\u83BD\u8F1E\u9099\u57CB\u59B9\u5A92\u5BD0\u6627\u679A\u6885\u6BCF\u7164\u7F75\u8CB7\u8CE3\u9081\u9B45\u8108\u8C8A\u964C\u9A40\u9EA5\u5B5F\u6C13\u731B\u76F2\u76DF\u840C\u51AA\u8993\u514D\u5195\u52C9\u68C9\u6C94\u7704\u7720\u7DBF\u7DEC\u9762\u9EB5\u6EC5"], + ["d9a1", "\u8511\u51A5\u540D\u547D\u660E\u669D\u6927\u6E9F\u76BF\u7791\u8317\u84C2\u879F\u9169\u9298\u9CF4\u8882\u4FAE\u5192\u52DF\u59C6\u5E3D\u6155\u6478\u6479\u66AE\u67D0\u6A21\u6BCD\u6BDB\u725F\u7261\u7441\u7738\u77DB\u8017\u82BC\u8305\u8B00\u8B28\u8C8C\u6728\u6C90\u7267\u76EE\u7766\u7A46\u9DA9\u6B7F\u6C92\u5922\u6726\u8499\u536F\u5893\u5999\u5EDF\u63CF\u6634\u6773\u6E3A\u732B\u7AD7\u82D7\u9328\u52D9\u5DEB\u61AE\u61CB\u620A\u62C7\u64AB\u65E0\u6959\u6B66\u6BCB\u7121\u73F7\u755D\u7E46\u821E\u8302\u856A\u8AA3\u8CBF\u9727\u9D61\u58A8\u9ED8\u5011\u520E\u543B\u554F\u6587"], + ["daa1", "\u6C76\u7D0A\u7D0B\u805E\u868A\u9580\u96EF\u52FF\u6C95\u7269\u5473\u5A9A\u5C3E\u5D4B\u5F4C\u5FAE\u672A\u68B6\u6963\u6E3C\u6E44\u7709\u7C73\u7F8E\u8587\u8B0E\u8FF7\u9761\u9EF4\u5CB7\u60B6\u610D\u61AB\u654F\u65FB\u65FC\u6C11\u6CEF\u739F\u73C9\u7DE1\u9594\u5BC6\u871C\u8B10\u525D\u535A\u62CD\u640F\u64B2\u6734\u6A38\u6CCA\u73C0\u749E\u7B94\u7C95\u7E1B\u818A\u8236\u8584\u8FEB\u96F9\u99C1\u4F34\u534A\u53CD\u53DB\u62CC\u642C\u6500\u6591\u69C3\u6CEE\u6F58\u73ED\u7554\u7622\u76E4\u76FC\u78D0\u78FB\u792C\u7D46\u822C\u87E0\u8FD4\u9812\u98EF\u52C3\u62D4\u64A5\u6E24\u6F51"], + ["dba1", "\u767C\u8DCB\u91B1\u9262\u9AEE\u9B43\u5023\u508D\u574A\u59A8\u5C28\u5E47\u5F77\u623F\u653E\u65B9\u65C1\u6609\u678B\u699C\u6EC2\u78C5\u7D21\u80AA\u8180\u822B\u82B3\u84A1\u868C\u8A2A\u8B17\u90A6\u9632\u9F90\u500D\u4FF3\uF963\u57F9\u5F98\u62DC\u6392\u676F\u6E43\u7119\u76C3\u80CC\u80DA\u88F4\u88F5\u8919\u8CE0\u8F29\u914D\u966A\u4F2F\u4F70\u5E1B\u67CF\u6822\u767D\u767E\u9B44\u5E61\u6A0A\u7169\u71D4\u756A\uF964\u7E41\u8543\u85E9\u98DC\u4F10\u7B4F\u7F70\u95A5\u51E1\u5E06\u68B5\u6C3E\u6C4E\u6CDB\u72AF\u7BC4\u8303\u6CD5\u743A\u50FB\u5288\u58C1\u64D8\u6A97\u74A7\u7656"], + ["dca1", "\u78A7\u8617\u95E2\u9739\uF965\u535E\u5F01\u8B8A\u8FA8\u8FAF\u908A\u5225\u77A5\u9C49\u9F08\u4E19\u5002\u5175\u5C5B\u5E77\u661E\u663A\u67C4\u68C5\u70B3\u7501\u75C5\u79C9\u7ADD\u8F27\u9920\u9A08\u4FDD\u5821\u5831\u5BF6\u666E\u6B65\u6D11\u6E7A\u6F7D\u73E4\u752B\u83E9\u88DC\u8913\u8B5C\u8F14\u4F0F\u50D5\u5310\u535C\u5B93\u5FA9\u670D\u798F\u8179\u832F\u8514\u8907\u8986\u8F39\u8F3B\u99A5\u9C12\u672C\u4E76\u4FF8\u5949\u5C01\u5CEF\u5CF0\u6367\u68D2\u70FD\u71A2\u742B\u7E2B\u84EC\u8702\u9022\u92D2\u9CF3\u4E0D\u4ED8\u4FEF\u5085\u5256\u526F\u5426\u5490\u57E0\u592B\u5A66"], + ["dda1", "\u5B5A\u5B75\u5BCC\u5E9C\uF966\u6276\u6577\u65A7\u6D6E\u6EA5\u7236\u7B26\u7C3F\u7F36\u8150\u8151\u819A\u8240\u8299\u83A9\u8A03\u8CA0\u8CE6\u8CFB\u8D74\u8DBA\u90E8\u91DC\u961C\u9644\u99D9\u9CE7\u5317\u5206\u5429\u5674\u58B3\u5954\u596E\u5FFF\u61A4\u626E\u6610\u6C7E\u711A\u76C6\u7C89\u7CDE\u7D1B\u82AC\u8CC1\u96F0\uF967\u4F5B\u5F17\u5F7F\u62C2\u5D29\u670B\u68DA\u787C\u7E43\u9D6C\u4E15\u5099\u5315\u532A\u5351\u5983\u5A62\u5E87\u60B2\u618A\u6249\u6279\u6590\u6787\u69A7\u6BD4\u6BD6\u6BD7\u6BD8\u6CB8\uF968\u7435\u75FA\u7812\u7891\u79D5\u79D8\u7C83\u7DCB\u7FE1\u80A5"], + ["dea1", "\u813E\u81C2\u83F2\u871A\u88E8\u8AB9\u8B6C\u8CBB\u9119\u975E\u98DB\u9F3B\u56AC\u5B2A\u5F6C\u658C\u6AB3\u6BAF\u6D5C\u6FF1\u7015\u725D\u73AD\u8CA7\u8CD3\u983B\u6191\u6C37\u8058\u9A01\u4E4D\u4E8B\u4E9B\u4ED5\u4F3A\u4F3C\u4F7F\u4FDF\u50FF\u53F2\u53F8\u5506\u55E3\u56DB\u58EB\u5962\u5A11\u5BEB\u5BFA\u5C04\u5DF3\u5E2B\u5F99\u601D\u6368\u659C\u65AF\u67F6\u67FB\u68AD\u6B7B\u6C99\u6CD7\u6E23\u7009\u7345\u7802\u793E\u7940\u7960\u79C1\u7BE9\u7D17\u7D72\u8086\u820D\u838E\u84D1\u86C7\u88DF\u8A50\u8A5E\u8B1D\u8CDC\u8D66\u8FAD\u90AA\u98FC\u99DF\u9E9D\u524A\uF969\u6714\uF96A"], + ["dfa1", "\u5098\u522A\u5C71\u6563\u6C55\u73CA\u7523\u759D\u7B97\u849C\u9178\u9730\u4E77\u6492\u6BBA\u715E\u85A9\u4E09\uF96B\u6749\u68EE\u6E17\u829F\u8518\u886B\u63F7\u6F81\u9212\u98AF\u4E0A\u50B7\u50CF\u511F\u5546\u55AA\u5617\u5B40\u5C19\u5CE0\u5E38\u5E8A\u5EA0\u5EC2\u60F3\u6851\u6A61\u6E58\u723D\u7240\u72C0\u76F8\u7965\u7BB1\u7FD4\u88F3\u89F4\u8A73\u8C61\u8CDE\u971C\u585E\u74BD\u8CFD\u55C7\uF96C\u7A61\u7D22\u8272\u7272\u751F\u7525\uF96D\u7B19\u5885\u58FB\u5DBC\u5E8F\u5EB6\u5F90\u6055\u6292\u637F\u654D\u6691\u66D9\u66F8\u6816\u68F2\u7280\u745E\u7B6E\u7D6E\u7DD6\u7F72"], + ["e0a1", "\u80E5\u8212\u85AF\u897F\u8A93\u901D\u92E4\u9ECD\u9F20\u5915\u596D\u5E2D\u60DC\u6614\u6673\u6790\u6C50\u6DC5\u6F5F\u77F3\u78A9\u84C6\u91CB\u932B\u4ED9\u50CA\u5148\u5584\u5B0B\u5BA3\u6247\u657E\u65CB\u6E32\u717D\u7401\u7444\u7487\u74BF\u766C\u79AA\u7DDA\u7E55\u7FA8\u817A\u81B3\u8239\u861A\u87EC\u8A75\u8DE3\u9078\u9291\u9425\u994D\u9BAE\u5368\u5C51\u6954\u6CC4\u6D29\u6E2B\u820C\u859B\u893B\u8A2D\u8AAA\u96EA\u9F67\u5261\u66B9\u6BB2\u7E96\u87FE\u8D0D\u9583\u965D\u651D\u6D89\u71EE\uF96E\u57CE\u59D3\u5BAC\u6027\u60FA\u6210\u661F\u665F\u7329\u73F9\u76DB\u7701\u7B6C"], + ["e1a1", "\u8056\u8072\u8165\u8AA0\u9192\u4E16\u52E2\u6B72\u6D17\u7A05\u7B39\u7D30\uF96F\u8CB0\u53EC\u562F\u5851\u5BB5\u5C0F\u5C11\u5DE2\u6240\u6383\u6414\u662D\u68B3\u6CBC\u6D88\u6EAF\u701F\u70A4\u71D2\u7526\u758F\u758E\u7619\u7B11\u7BE0\u7C2B\u7D20\u7D39\u852C\u856D\u8607\u8A34\u900D\u9061\u90B5\u92B7\u97F6\u9A37\u4FD7\u5C6C\u675F\u6D91\u7C9F\u7E8C\u8B16\u8D16\u901F\u5B6B\u5DFD\u640D\u84C0\u905C\u98E1\u7387\u5B8B\u609A\u677E\u6DDE\u8A1F\u8AA6\u9001\u980C\u5237\uF970\u7051\u788E\u9396\u8870\u91D7\u4FEE\u53D7\u55FD\u56DA\u5782\u58FD\u5AC2\u5B88\u5CAB\u5CC0\u5E25\u6101"], + ["e2a1", "\u620D\u624B\u6388\u641C\u6536\u6578\u6A39\u6B8A\u6C34\u6D19\u6F31\u71E7\u72E9\u7378\u7407\u74B2\u7626\u7761\u79C0\u7A57\u7AEA\u7CB9\u7D8F\u7DAC\u7E61\u7F9E\u8129\u8331\u8490\u84DA\u85EA\u8896\u8AB0\u8B90\u8F38\u9042\u9083\u916C\u9296\u92B9\u968B\u96A7\u96A8\u96D6\u9700\u9808\u9996\u9AD3\u9B1A\u53D4\u587E\u5919\u5B70\u5BBF\u6DD1\u6F5A\u719F\u7421\u74B9\u8085\u83FD\u5DE1\u5F87\u5FAA\u6042\u65EC\u6812\u696F\u6A53\u6B89\u6D35\u6DF3\u73E3\u76FE\u77AC\u7B4D\u7D14\u8123\u821C\u8340\u84F4\u8563\u8A62\u8AC4\u9187\u931E\u9806\u99B4\u620C\u8853\u8FF0\u9265\u5D07\u5D27"], + ["e3a1", "\u5D69\u745F\u819D\u8768\u6FD5\u62FE\u7FD2\u8936\u8972\u4E1E\u4E58\u50E7\u52DD\u5347\u627F\u6607\u7E69\u8805\u965E\u4F8D\u5319\u5636\u59CB\u5AA4\u5C38\u5C4E\u5C4D\u5E02\u5F11\u6043\u65BD\u662F\u6642\u67BE\u67F4\u731C\u77E2\u793A\u7FC5\u8494\u84CD\u8996\u8A66\u8A69\u8AE1\u8C55\u8C7A\u57F4\u5BD4\u5F0F\u606F\u62ED\u690D\u6B96\u6E5C\u7184\u7BD2\u8755\u8B58\u8EFE\u98DF\u98FE\u4F38\u4F81\u4FE1\u547B\u5A20\u5BB8\u613C\u65B0\u6668\u71FC\u7533\u795E\u7D33\u814E\u81E3\u8398\u85AA\u85CE\u8703\u8A0A\u8EAB\u8F9B\uF971\u8FC5\u5931\u5BA4\u5BE6\u6089\u5BE9\u5C0B\u5FC3\u6C81"], + ["e4a1", "\uF972\u6DF1\u700B\u751A\u82AF\u8AF6\u4EC0\u5341\uF973\u96D9\u6C0F\u4E9E\u4FC4\u5152\u555E\u5A25\u5CE8\u6211\u7259\u82BD\u83AA\u86FE\u8859\u8A1D\u963F\u96C5\u9913\u9D09\u9D5D\u580A\u5CB3\u5DBD\u5E44\u60E1\u6115\u63E1\u6A02\u6E25\u9102\u9354\u984E\u9C10\u9F77\u5B89\u5CB8\u6309\u664F\u6848\u773C\u96C1\u978D\u9854\u9B9F\u65A1\u8B01\u8ECB\u95BC\u5535\u5CA9\u5DD6\u5EB5\u6697\u764C\u83F4\u95C7\u58D3\u62BC\u72CE\u9D28\u4EF0\u592E\u600F\u663B\u6B83\u79E7\u9D26\u5393\u54C0\u57C3\u5D16\u611B\u66D6\u6DAF\u788D\u827E\u9698\u9744\u5384\u627C\u6396\u6DB2\u7E0A\u814B\u984D"], + ["e5a1", "\u6AFB\u7F4C\u9DAF\u9E1A\u4E5F\u503B\u51B6\u591C\u60F9\u63F6\u6930\u723A\u8036\uF974\u91CE\u5F31\uF975\uF976\u7D04\u82E5\u846F\u84BB\u85E5\u8E8D\uF977\u4F6F\uF978\uF979\u58E4\u5B43\u6059\u63DA\u6518\u656D\u6698\uF97A\u694A\u6A23\u6D0B\u7001\u716C\u75D2\u760D\u79B3\u7A70\uF97B\u7F8A\uF97C\u8944\uF97D\u8B93\u91C0\u967D\uF97E\u990A\u5704\u5FA1\u65BC\u6F01\u7600\u79A6\u8A9E\u99AD\u9B5A\u9F6C\u5104\u61B6\u6291\u6A8D\u81C6\u5043\u5830\u5F66\u7109\u8A00\u8AFA\u5B7C\u8616\u4FFA\u513C\u56B4\u5944\u63A9\u6DF9\u5DAA\u696D\u5186\u4E88\u4F59\uF97F\uF980\uF981\u5982\uF982"], + ["e6a1", "\uF983\u6B5F\u6C5D\uF984\u74B5\u7916\uF985\u8207\u8245\u8339\u8F3F\u8F5D\uF986\u9918\uF987\uF988\uF989\u4EA6\uF98A\u57DF\u5F79\u6613\uF98B\uF98C\u75AB\u7E79\u8B6F\uF98D\u9006\u9A5B\u56A5\u5827\u59F8\u5A1F\u5BB4\uF98E\u5EF6\uF98F\uF990\u6350\u633B\uF991\u693D\u6C87\u6CBF\u6D8E\u6D93\u6DF5\u6F14\uF992\u70DF\u7136\u7159\uF993\u71C3\u71D5\uF994\u784F\u786F\uF995\u7B75\u7DE3\uF996\u7E2F\uF997\u884D\u8EDF\uF998\uF999\uF99A\u925B\uF99B\u9CF6\uF99C\uF99D\uF99E\u6085\u6D85\uF99F\u71B1\uF9A0\uF9A1\u95B1\u53AD\uF9A2\uF9A3\uF9A4\u67D3\uF9A5\u708E\u7130\u7430\u8276\u82D2"], + ["e7a1", "\uF9A6\u95BB\u9AE5\u9E7D\u66C4\uF9A7\u71C1\u8449\uF9A8\uF9A9\u584B\uF9AA\uF9AB\u5DB8\u5F71\uF9AC\u6620\u668E\u6979\u69AE\u6C38\u6CF3\u6E36\u6F41\u6FDA\u701B\u702F\u7150\u71DF\u7370\uF9AD\u745B\uF9AE\u74D4\u76C8\u7A4E\u7E93\uF9AF\uF9B0\u82F1\u8A60\u8FCE\uF9B1\u9348\uF9B2\u9719\uF9B3\uF9B4\u4E42\u502A\uF9B5\u5208\u53E1\u66F3\u6C6D\u6FCA\u730A\u777F\u7A62\u82AE\u85DD\u8602\uF9B6\u88D4\u8A63\u8B7D\u8C6B\uF9B7\u92B3\uF9B8\u9713\u9810\u4E94\u4F0D\u4FC9\u50B2\u5348\u543E\u5433\u55DA\u5862\u58BA\u5967\u5A1B\u5BE4\u609F\uF9B9\u61CA\u6556\u65FF\u6664\u68A7\u6C5A\u6FB3"], + ["e8a1", "\u70CF\u71AC\u7352\u7B7D\u8708\u8AA4\u9C32\u9F07\u5C4B\u6C83\u7344\u7389\u923A\u6EAB\u7465\u761F\u7A69\u7E15\u860A\u5140\u58C5\u64C1\u74EE\u7515\u7670\u7FC1\u9095\u96CD\u9954\u6E26\u74E6\u7AA9\u7AAA\u81E5\u86D9\u8778\u8A1B\u5A49\u5B8C\u5B9B\u68A1\u6900\u6D63\u73A9\u7413\u742C\u7897\u7DE9\u7FEB\u8118\u8155\u839E\u8C4C\u962E\u9811\u66F0\u5F80\u65FA\u6789\u6C6A\u738B\u502D\u5A03\u6B6A\u77EE\u5916\u5D6C\u5DCD\u7325\u754F\uF9BA\uF9BB\u50E5\u51F9\u582F\u592D\u5996\u59DA\u5BE5\uF9BC\uF9BD\u5DA2\u62D7\u6416\u6493\u64FE\uF9BE\u66DC\uF9BF\u6A48\uF9C0\u71FF\u7464\uF9C1"], + ["e9a1", "\u7A88\u7AAF\u7E47\u7E5E\u8000\u8170\uF9C2\u87EF\u8981\u8B20\u9059\uF9C3\u9080\u9952\u617E\u6B32\u6D74\u7E1F\u8925\u8FB1\u4FD1\u50AD\u5197\u52C7\u57C7\u5889\u5BB9\u5EB8\u6142\u6995\u6D8C\u6E67\u6EB6\u7194\u7462\u7528\u752C\u8073\u8338\u84C9\u8E0A\u9394\u93DE\uF9C4\u4E8E\u4F51\u5076\u512A\u53C8\u53CB\u53F3\u5B87\u5BD3\u5C24\u611A\u6182\u65F4\u725B\u7397\u7440\u76C2\u7950\u7991\u79B9\u7D06\u7FBD\u828B\u85D5\u865E\u8FC2\u9047\u90F5\u91EA\u9685\u96E8\u96E9\u52D6\u5F67\u65ED\u6631\u682F\u715C\u7A36\u90C1\u980A\u4E91\uF9C5\u6A52\u6B9E\u6F90\u7189\u8018\u82B8\u8553"], + ["eaa1", "\u904B\u9695\u96F2\u97FB\u851A\u9B31\u4E90\u718A\u96C4\u5143\u539F\u54E1\u5713\u5712\u57A3\u5A9B\u5AC4\u5BC3\u6028\u613F\u63F4\u6C85\u6D39\u6E72\u6E90\u7230\u733F\u7457\u82D1\u8881\u8F45\u9060\uF9C6\u9662\u9858\u9D1B\u6708\u8D8A\u925E\u4F4D\u5049\u50DE\u5371\u570D\u59D4\u5A01\u5C09\u6170\u6690\u6E2D\u7232\u744B\u7DEF\u80C3\u840E\u8466\u853F\u875F\u885B\u8918\u8B02\u9055\u97CB\u9B4F\u4E73\u4F91\u5112\u516A\uF9C7\u552F\u55A9\u5B7A\u5BA5\u5E7C\u5E7D\u5EBE\u60A0\u60DF\u6108\u6109\u63C4\u6538\u6709\uF9C8\u67D4\u67DA\uF9C9\u6961\u6962\u6CB9\u6D27\uF9CA\u6E38\uF9CB"], + ["eba1", "\u6FE1\u7336\u7337\uF9CC\u745C\u7531\uF9CD\u7652\uF9CE\uF9CF\u7DAD\u81FE\u8438\u88D5\u8A98\u8ADB\u8AED\u8E30\u8E42\u904A\u903E\u907A\u9149\u91C9\u936E\uF9D0\uF9D1\u5809\uF9D2\u6BD3\u8089\u80B2\uF9D3\uF9D4\u5141\u596B\u5C39\uF9D5\uF9D6\u6F64\u73A7\u80E4\u8D07\uF9D7\u9217\u958F\uF9D8\uF9D9\uF9DA\uF9DB\u807F\u620E\u701C\u7D68\u878D\uF9DC\u57A0\u6069\u6147\u6BB7\u8ABE\u9280\u96B1\u4E59\u541F\u6DEB\u852D\u9670\u97F3\u98EE\u63D6\u6CE3\u9091\u51DD\u61C9\u81BA\u9DF9\u4F9D\u501A\u5100\u5B9C\u610F\u61FF\u64EC\u6905\u6BC5\u7591\u77E3\u7FA9\u8264\u858F\u87FB\u8863\u8ABC"], + ["eca1", "\u8B70\u91AB\u4E8C\u4EE5\u4F0A\uF9DD\uF9DE\u5937\u59E8\uF9DF\u5DF2\u5F1B\u5F5B\u6021\uF9E0\uF9E1\uF9E2\uF9E3\u723E\u73E5\uF9E4\u7570\u75CD\uF9E5\u79FB\uF9E6\u800C\u8033\u8084\u82E1\u8351\uF9E7\uF9E8\u8CBD\u8CB3\u9087\uF9E9\uF9EA\u98F4\u990C\uF9EB\uF9EC\u7037\u76CA\u7FCA\u7FCC\u7FFC\u8B1A\u4EBA\u4EC1\u5203\u5370\uF9ED\u54BD\u56E0\u59FB\u5BC5\u5F15\u5FCD\u6E6E\uF9EE\uF9EF\u7D6A\u8335\uF9F0\u8693\u8A8D\uF9F1\u976D\u9777\uF9F2\uF9F3\u4E00\u4F5A\u4F7E\u58F9\u65E5\u6EA2\u9038\u93B0\u99B9\u4EFB\u58EC\u598A\u59D9\u6041\uF9F4\uF9F5\u7A14\uF9F6\u834F\u8CC3\u5165\u5344"], + ["eda1", "\uF9F7\uF9F8\uF9F9\u4ECD\u5269\u5B55\u82BF\u4ED4\u523A\u54A8\u59C9\u59FF\u5B50\u5B57\u5B5C\u6063\u6148\u6ECB\u7099\u716E\u7386\u74F7\u75B5\u78C1\u7D2B\u8005\u81EA\u8328\u8517\u85C9\u8AEE\u8CC7\u96CC\u4F5C\u52FA\u56BC\u65AB\u6628\u707C\u70B8\u7235\u7DBD\u828D\u914C\u96C0\u9D72\u5B71\u68E7\u6B98\u6F7A\u76DE\u5C91\u66AB\u6F5B\u7BB4\u7C2A\u8836\u96DC\u4E08\u4ED7\u5320\u5834\u58BB\u58EF\u596C\u5C07\u5E33\u5E84\u5F35\u638C\u66B2\u6756\u6A1F\u6AA3\u6B0C\u6F3F\u7246\uF9FA\u7350\u748B\u7AE0\u7CA7\u8178\u81DF\u81E7\u838A\u846C\u8523\u8594\u85CF\u88DD\u8D13\u91AC\u9577"], + ["eea1", "\u969C\u518D\u54C9\u5728\u5BB0\u624D\u6750\u683D\u6893\u6E3D\u6ED3\u707D\u7E21\u88C1\u8CA1\u8F09\u9F4B\u9F4E\u722D\u7B8F\u8ACD\u931A\u4F47\u4F4E\u5132\u5480\u59D0\u5E95\u62B5\u6775\u696E\u6A17\u6CAE\u6E1A\u72D9\u732A\u75BD\u7BB8\u7D35\u82E7\u83F9\u8457\u85F7\u8A5B\u8CAF\u8E87\u9019\u90B8\u96CE\u9F5F\u52E3\u540A\u5AE1\u5BC2\u6458\u6575\u6EF4\u72C4\uF9FB\u7684\u7A4D\u7B1B\u7C4D\u7E3E\u7FDF\u837B\u8B2B\u8CCA\u8D64\u8DE1\u8E5F\u8FEA\u8FF9\u9069\u93D1\u4F43\u4F7A\u50B3\u5168\u5178\u524D\u526A\u5861\u587C\u5960\u5C08\u5C55\u5EDB\u609B\u6230\u6813\u6BBF\u6C08\u6FB1"], + ["efa1", "\u714E\u7420\u7530\u7538\u7551\u7672\u7B4C\u7B8B\u7BAD\u7BC6\u7E8F\u8A6E\u8F3E\u8F49\u923F\u9293\u9322\u942B\u96FB\u985A\u986B\u991E\u5207\u622A\u6298\u6D59\u7664\u7ACA\u7BC0\u7D76\u5360\u5CBE\u5E97\u6F38\u70B9\u7C98\u9711\u9B8E\u9EDE\u63A5\u647A\u8776\u4E01\u4E95\u4EAD\u505C\u5075\u5448\u59C3\u5B9A\u5E40\u5EAD\u5EF7\u5F81\u60C5\u633A\u653F\u6574\u65CC\u6676\u6678\u67FE\u6968\u6A89\u6B63\u6C40\u6DC0\u6DE8\u6E1F\u6E5E\u701E\u70A1\u738E\u73FD\u753A\u775B\u7887\u798E\u7A0B\u7A7D\u7CBE\u7D8E\u8247\u8A02\u8AEA\u8C9E\u912D\u914A\u91D8\u9266\u92CC\u9320\u9706\u9756"], + ["f0a1", "\u975C\u9802\u9F0E\u5236\u5291\u557C\u5824\u5E1D\u5F1F\u608C\u63D0\u68AF\u6FDF\u796D\u7B2C\u81CD\u85BA\u88FD\u8AF8\u8E44\u918D\u9664\u969B\u973D\u984C\u9F4A\u4FCE\u5146\u51CB\u52A9\u5632\u5F14\u5F6B\u63AA\u64CD\u65E9\u6641\u66FA\u66F9\u671D\u689D\u68D7\u69FD\u6F15\u6F6E\u7167\u71E5\u722A\u74AA\u773A\u7956\u795A\u79DF\u7A20\u7A95\u7C97\u7CDF\u7D44\u7E70\u8087\u85FB\u86A4\u8A54\u8ABF\u8D99\u8E81\u9020\u906D\u91E3\u963B\u96D5\u9CE5\u65CF\u7C07\u8DB3\u93C3\u5B58\u5C0A\u5352\u62D9\u731D\u5027\u5B97\u5F9E\u60B0\u616B\u68D5\u6DD9\u742E\u7A2E\u7D42\u7D9C\u7E31\u816B"], + ["f1a1", "\u8E2A\u8E35\u937E\u9418\u4F50\u5750\u5DE6\u5EA7\u632B\u7F6A\u4E3B\u4F4F\u4F8F\u505A\u59DD\u80C4\u546A\u5468\u55FE\u594F\u5B99\u5DDE\u5EDA\u665D\u6731\u67F1\u682A\u6CE8\u6D32\u6E4A\u6F8D\u70B7\u73E0\u7587\u7C4C\u7D02\u7D2C\u7DA2\u821F\u86DB\u8A3B\u8A85\u8D70\u8E8A\u8F33\u9031\u914E\u9152\u9444\u99D0\u7AF9\u7CA5\u4FCA\u5101\u51C6\u57C8\u5BEF\u5CFB\u6659\u6A3D\u6D5A\u6E96\u6FEC\u710C\u756F\u7AE3\u8822\u9021\u9075\u96CB\u99FF\u8301\u4E2D\u4EF2\u8846\u91CD\u537D\u6ADB\u696B\u6C41\u847A\u589E\u618E\u66FE\u62EF\u70DD\u7511\u75C7\u7E52\u84B8\u8B49\u8D08\u4E4B\u53EA"], + ["f2a1", "\u54AB\u5730\u5740\u5FD7\u6301\u6307\u646F\u652F\u65E8\u667A\u679D\u67B3\u6B62\u6C60\u6C9A\u6F2C\u77E5\u7825\u7949\u7957\u7D19\u80A2\u8102\u81F3\u829D\u82B7\u8718\u8A8C\uF9FC\u8D04\u8DBE\u9072\u76F4\u7A19\u7A37\u7E54\u8077\u5507\u55D4\u5875\u632F\u6422\u6649\u664B\u686D\u699B\u6B84\u6D25\u6EB1\u73CD\u7468\u74A1\u755B\u75B9\u76E1\u771E\u778B\u79E6\u7E09\u7E1D\u81FB\u852F\u8897\u8A3A\u8CD1\u8EEB\u8FB0\u9032\u93AD\u9663\u9673\u9707\u4F84\u53F1\u59EA\u5AC9\u5E19\u684E\u74C6\u75BE\u79E9\u7A92\u81A3\u86ED\u8CEA\u8DCC\u8FED\u659F\u6715\uF9FD\u57F7\u6F57\u7DDD\u8F2F"], + ["f3a1", "\u93F6\u96C6\u5FB5\u61F2\u6F84\u4E14\u4F98\u501F\u53C9\u55DF\u5D6F\u5DEE\u6B21\u6B64\u78CB\u7B9A\uF9FE\u8E49\u8ECA\u906E\u6349\u643E\u7740\u7A84\u932F\u947F\u9F6A\u64B0\u6FAF\u71E6\u74A8\u74DA\u7AC4\u7C12\u7E82\u7CB2\u7E98\u8B9A\u8D0A\u947D\u9910\u994C\u5239\u5BDF\u64E6\u672D\u7D2E\u50ED\u53C3\u5879\u6158\u6159\u61FA\u65AC\u7AD9\u8B92\u8B96\u5009\u5021\u5275\u5531\u5A3C\u5EE0\u5F70\u6134\u655E\u660C\u6636\u66A2\u69CD\u6EC4\u6F32\u7316\u7621\u7A93\u8139\u8259\u83D6\u84BC\u50B5\u57F0\u5BC0\u5BE8\u5F69\u63A1\u7826\u7DB5\u83DC\u8521\u91C7\u91F5\u518A\u67F5\u7B56"], + ["f4a1", "\u8CAC\u51C4\u59BB\u60BD\u8655\u501C\uF9FF\u5254\u5C3A\u617D\u621A\u62D3\u64F2\u65A5\u6ECC\u7620\u810A\u8E60\u965F\u96BB\u4EDF\u5343\u5598\u5929\u5DDD\u64C5\u6CC9\u6DFA\u7394\u7A7F\u821B\u85A6\u8CE4\u8E10\u9077\u91E7\u95E1\u9621\u97C6\u51F8\u54F2\u5586\u5FB9\u64A4\u6F88\u7DB4\u8F1F\u8F4D\u9435\u50C9\u5C16\u6CBE\u6DFB\u751B\u77BB\u7C3D\u7C64\u8A79\u8AC2\u581E\u59BE\u5E16\u6377\u7252\u758A\u776B\u8ADC\u8CBC\u8F12\u5EF3\u6674\u6DF8\u807D\u83C1\u8ACB\u9751\u9BD6\uFA00\u5243\u66FF\u6D95\u6EEF\u7DE0\u8AE6\u902E\u905E\u9AD4\u521D\u527F\u54E8\u6194\u6284\u62DB\u68A2"], + ["f5a1", "\u6912\u695A\u6A35\u7092\u7126\u785D\u7901\u790E\u79D2\u7A0D\u8096\u8278\u82D5\u8349\u8549\u8C82\u8D85\u9162\u918B\u91AE\u4FC3\u56D1\u71ED\u77D7\u8700\u89F8\u5BF8\u5FD6\u6751\u90A8\u53E2\u585A\u5BF5\u60A4\u6181\u6460\u7E3D\u8070\u8525\u9283\u64AE\u50AC\u5D14\u6700\u589C\u62BD\u63A8\u690E\u6978\u6A1E\u6E6B\u76BA\u79CB\u82BB\u8429\u8ACF\u8DA8\u8FFD\u9112\u914B\u919C\u9310\u9318\u939A\u96DB\u9A36\u9C0D\u4E11\u755C\u795D\u7AFA\u7B51\u7BC9\u7E2E\u84C4\u8E59\u8E74\u8EF8\u9010\u6625\u693F\u7443\u51FA\u672E\u9EDC\u5145\u5FE0\u6C96\u87F2\u885D\u8877\u60B4\u81B5\u8403"], + ["f6a1", "\u8D05\u53D6\u5439\u5634\u5A36\u5C31\u708A\u7FE0\u805A\u8106\u81ED\u8DA3\u9189\u9A5F\u9DF2\u5074\u4EC4\u53A0\u60FB\u6E2C\u5C64\u4F88\u5024\u55E4\u5CD9\u5E5F\u6065\u6894\u6CBB\u6DC4\u71BE\u75D4\u75F4\u7661\u7A1A\u7A49\u7DC7\u7DFB\u7F6E\u81F4\u86A9\u8F1C\u96C9\u99B3\u9F52\u5247\u52C5\u98ED\u89AA\u4E03\u67D2\u6F06\u4FB5\u5BE2\u6795\u6C88\u6D78\u741B\u7827\u91DD\u937C\u87C4\u79E4\u7A31\u5FEB\u4ED6\u54A4\u553E\u58AE\u59A5\u60F0\u6253\u62D6\u6736\u6955\u8235\u9640\u99B1\u99DD\u502C\u5353\u5544\u577C\uFA01\u6258\uFA02\u64E2\u666B\u67DD\u6FC1\u6FEF\u7422\u7438\u8A17"], + ["f7a1", "\u9438\u5451\u5606\u5766\u5F48\u619A\u6B4E\u7058\u70AD\u7DBB\u8A95\u596A\u812B\u63A2\u7708\u803D\u8CAA\u5854\u642D\u69BB\u5B95\u5E11\u6E6F\uFA03\u8569\u514C\u53F0\u592A\u6020\u614B\u6B86\u6C70\u6CF0\u7B1E\u80CE\u82D4\u8DC6\u90B0\u98B1\uFA04\u64C7\u6FA4\u6491\u6504\u514E\u5410\u571F\u8A0E\u615F\u6876\uFA05\u75DB\u7B52\u7D71\u901A\u5806\u69CC\u817F\u892A\u9000\u9839\u5078\u5957\u59AC\u6295\u900F\u9B2A\u615D\u7279\u95D6\u5761\u5A46\u5DF4\u628A\u64AD\u64FA\u6777\u6CE2\u6D3E\u722C\u7436\u7834\u7F77\u82AD\u8DDB\u9817\u5224\u5742\u677F\u7248\u74E3\u8CA9\u8FA6\u9211"], + ["f8a1", "\u962A\u516B\u53ED\u634C\u4F69\u5504\u6096\u6557\u6C9B\u6D7F\u724C\u72FD\u7A17\u8987\u8C9D\u5F6D\u6F8E\u70F9\u81A8\u610E\u4FBF\u504F\u6241\u7247\u7BC7\u7DE8\u7FE9\u904D\u97AD\u9A19\u8CB6\u576A\u5E73\u67B0\u840D\u8A55\u5420\u5B16\u5E63\u5EE2\u5F0A\u6583\u80BA\u853D\u9589\u965B\u4F48\u5305\u530D\u530F\u5486\u54FA\u5703\u5E03\u6016\u629B\u62B1\u6355\uFA06\u6CE1\u6D66\u75B1\u7832\u80DE\u812F\u82DE\u8461\u84B2\u888D\u8912\u900B\u92EA\u98FD\u9B91\u5E45\u66B4\u66DD\u7011\u7206\uFA07\u4FF5\u527D\u5F6A\u6153\u6753\u6A19\u6F02\u74E2\u7968\u8868\u8C79\u98C7\u98C4\u9A43"], + ["f9a1", "\u54C1\u7A1F\u6953\u8AF7\u8C4A\u98A8\u99AE\u5F7C\u62AB\u75B2\u76AE\u88AB\u907F\u9642\u5339\u5F3C\u5FC5\u6CCC\u73CC\u7562\u758B\u7B46\u82FE\u999D\u4E4F\u903C\u4E0B\u4F55\u53A6\u590F\u5EC8\u6630\u6CB3\u7455\u8377\u8766\u8CC0\u9050\u971E\u9C15\u58D1\u5B78\u8650\u8B14\u9DB4\u5BD2\u6068\u608D\u65F1\u6C57\u6F22\u6FA3\u701A\u7F55\u7FF0\u9591\u9592\u9650\u97D3\u5272\u8F44\u51FD\u542B\u54B8\u5563\u558A\u6ABB\u6DB5\u7DD8\u8266\u929C\u9677\u9E79\u5408\u54C8\u76D2\u86E4\u95A4\u95D4\u965C\u4EA2\u4F09\u59EE\u5AE6\u5DF7\u6052\u6297\u676D\u6841\u6C86\u6E2F\u7F38\u809B\u822A"], + ["faa1", "\uFA08\uFA09\u9805\u4EA5\u5055\u54B3\u5793\u595A\u5B69\u5BB3\u61C8\u6977\u6D77\u7023\u87F9\u89E3\u8A72\u8AE7\u9082\u99ED\u9AB8\u52BE\u6838\u5016\u5E78\u674F\u8347\u884C\u4EAB\u5411\u56AE\u73E6\u9115\u97FF\u9909\u9957\u9999\u5653\u589F\u865B\u8A31\u61B2\u6AF6\u737B\u8ED2\u6B47\u96AA\u9A57\u5955\u7200\u8D6B\u9769\u4FD4\u5CF4\u5F26\u61F8\u665B\u6CEB\u70AB\u7384\u73B9\u73FE\u7729\u774D\u7D43\u7D62\u7E23\u8237\u8852\uFA0A\u8CE2\u9249\u986F\u5B51\u7A74\u8840\u9801\u5ACC\u4FE0\u5354\u593E\u5CFD\u633E\u6D79\u72F9\u8105\u8107\u83A2\u92CF\u9830\u4EA8\u5144\u5211\u578B"], + ["fba1", "\u5F62\u6CC2\u6ECE\u7005\u7050\u70AF\u7192\u73E9\u7469\u834A\u87A2\u8861\u9008\u90A2\u93A3\u99A8\u516E\u5F57\u60E0\u6167\u66B3\u8559\u8E4A\u91AF\u978B\u4E4E\u4E92\u547C\u58D5\u58FA\u597D\u5CB5\u5F27\u6236\u6248\u660A\u6667\u6BEB\u6D69\u6DCF\u6E56\u6EF8\u6F94\u6FE0\u6FE9\u705D\u72D0\u7425\u745A\u74E0\u7693\u795C\u7CCA\u7E1E\u80E1\u82A6\u846B\u84BF\u864E\u865F\u8774\u8B77\u8C6A\u93AC\u9800\u9865\u60D1\u6216\u9177\u5A5A\u660F\u6DF7\u6E3E\u743F\u9B42\u5FFD\u60DA\u7B0F\u54C4\u5F18\u6C5E\u6CD3\u6D2A\u70D8\u7D05\u8679\u8A0C\u9D3B\u5316\u548C\u5B05\u6A3A\u706B\u7575"], + ["fca1", "\u798D\u79BE\u82B1\u83EF\u8A71\u8B41\u8CA8\u9774\uFA0B\u64F4\u652B\u78BA\u78BB\u7A6B\u4E38\u559A\u5950\u5BA6\u5E7B\u60A3\u63DB\u6B61\u6665\u6853\u6E19\u7165\u74B0\u7D08\u9084\u9A69\u9C25\u6D3B\u6ED1\u733E\u8C41\u95CA\u51F0\u5E4C\u5FA8\u604D\u60F6\u6130\u614C\u6643\u6644\u69A5\u6CC1\u6E5F\u6EC9\u6F62\u714C\u749C\u7687\u7BC1\u7C27\u8352\u8757\u9051\u968D\u9EC3\u532F\u56DE\u5EFB\u5F8A\u6062\u6094\u61F7\u6666\u6703\u6A9C\u6DEE\u6FAE\u7070\u736A\u7E6A\u81BE\u8334\u86D4\u8AA8\u8CC4\u5283\u7372\u5B96\u6A6B\u9404\u54EE\u5686\u5B5D\u6548\u6585\u66C9\u689F\u6D8D\u6DC6"], + ["fda1", "\u723B\u80B4\u9175\u9A4D\u4FAF\u5019\u539A\u540E\u543C\u5589\u55C5\u5E3F\u5F8C\u673D\u7166\u73DD\u9005\u52DB\u52F3\u5864\u58CE\u7104\u718F\u71FB\u85B0\u8A13\u6688\u85A8\u55A7\u6684\u714A\u8431\u5349\u5599\u6BC1\u5F59\u5FBD\u63EE\u6689\u7147\u8AF1\u8F1D\u9EBE\u4F11\u643A\u70CB\u7566\u8667\u6064\u8B4E\u9DF8\u5147\u51F6\u5308\u6D36\u80F8\u9ED1\u6615\u6B23\u7098\u75D5\u5403\u5C79\u7D07\u8A16\u6B20\u6B3D\u6B46\u5438\u6070\u6D3D\u7FD5\u8208\u50D6\u51DE\u559C\u566B\u56CD\u59EC\u5B09\u5E0C\u6199\u6198\u6231\u665E\u66E6\u7199\u71B9\u71BA\u72A7\u79A7\u7A00\u7FB2\u8A70"] + ]; + } +}); + +// node_modules/iconv-lite/encodings/tables/cp950.json +var require_cp950 = __commonJS({ + "node_modules/iconv-lite/encodings/tables/cp950.json"(exports2, module2) { + module2.exports = [ + ["0", "\0", 127], + ["a140", "\u3000\uFF0C\u3001\u3002\uFF0E\u2027\uFF1B\uFF1A\uFF1F\uFF01\uFE30\u2026\u2025\uFE50\uFE51\uFE52\xB7\uFE54\uFE55\uFE56\uFE57\uFF5C\u2013\uFE31\u2014\uFE33\u2574\uFE34\uFE4F\uFF08\uFF09\uFE35\uFE36\uFF5B\uFF5D\uFE37\uFE38\u3014\u3015\uFE39\uFE3A\u3010\u3011\uFE3B\uFE3C\u300A\u300B\uFE3D\uFE3E\u3008\u3009\uFE3F\uFE40\u300C\u300D\uFE41\uFE42\u300E\u300F\uFE43\uFE44\uFE59\uFE5A"], + ["a1a1", "\uFE5B\uFE5C\uFE5D\uFE5E\u2018\u2019\u201C\u201D\u301D\u301E\u2035\u2032\uFF03\uFF06\uFF0A\u203B\xA7\u3003\u25CB\u25CF\u25B3\u25B2\u25CE\u2606\u2605\u25C7\u25C6\u25A1\u25A0\u25BD\u25BC\u32A3\u2105\xAF\uFFE3\uFF3F\u02CD\uFE49\uFE4A\uFE4D\uFE4E\uFE4B\uFE4C\uFE5F\uFE60\uFE61\uFF0B\uFF0D\xD7\xF7\xB1\u221A\uFF1C\uFF1E\uFF1D\u2266\u2267\u2260\u221E\u2252\u2261\uFE62", 4, "\uFF5E\u2229\u222A\u22A5\u2220\u221F\u22BF\u33D2\u33D1\u222B\u222E\u2235\u2234\u2640\u2642\u2295\u2299\u2191\u2193\u2190\u2192\u2196\u2197\u2199\u2198\u2225\u2223\uFF0F"], + ["a240", "\uFF3C\u2215\uFE68\uFF04\uFFE5\u3012\uFFE0\uFFE1\uFF05\uFF20\u2103\u2109\uFE69\uFE6A\uFE6B\u33D5\u339C\u339D\u339E\u33CE\u33A1\u338E\u338F\u33C4\xB0\u5159\u515B\u515E\u515D\u5161\u5163\u55E7\u74E9\u7CCE\u2581", 7, "\u258F\u258E\u258D\u258C\u258B\u258A\u2589\u253C\u2534\u252C\u2524\u251C\u2594\u2500\u2502\u2595\u250C\u2510\u2514\u2518\u256D"], + ["a2a1", "\u256E\u2570\u256F\u2550\u255E\u256A\u2561\u25E2\u25E3\u25E5\u25E4\u2571\u2572\u2573\uFF10", 9, "\u2160", 9, "\u3021", 8, "\u5341\u5344\u5345\uFF21", 25, "\uFF41", 21], + ["a340", "\uFF57\uFF58\uFF59\uFF5A\u0391", 16, "\u03A3", 6, "\u03B1", 16, "\u03C3", 6, "\u3105", 10], + ["a3a1", "\u3110", 25, "\u02D9\u02C9\u02CA\u02C7\u02CB"], + ["a3e1", "\u20AC"], + ["a440", "\u4E00\u4E59\u4E01\u4E03\u4E43\u4E5D\u4E86\u4E8C\u4EBA\u513F\u5165\u516B\u51E0\u5200\u5201\u529B\u5315\u5341\u535C\u53C8\u4E09\u4E0B\u4E08\u4E0A\u4E2B\u4E38\u51E1\u4E45\u4E48\u4E5F\u4E5E\u4E8E\u4EA1\u5140\u5203\u52FA\u5343\u53C9\u53E3\u571F\u58EB\u5915\u5927\u5973\u5B50\u5B51\u5B53\u5BF8\u5C0F\u5C22\u5C38\u5C71\u5DDD\u5DE5\u5DF1\u5DF2\u5DF3\u5DFE\u5E72\u5EFE\u5F0B\u5F13\u624D"], + ["a4a1", "\u4E11\u4E10\u4E0D\u4E2D\u4E30\u4E39\u4E4B\u5C39\u4E88\u4E91\u4E95\u4E92\u4E94\u4EA2\u4EC1\u4EC0\u4EC3\u4EC6\u4EC7\u4ECD\u4ECA\u4ECB\u4EC4\u5143\u5141\u5167\u516D\u516E\u516C\u5197\u51F6\u5206\u5207\u5208\u52FB\u52FE\u52FF\u5316\u5339\u5348\u5347\u5345\u535E\u5384\u53CB\u53CA\u53CD\u58EC\u5929\u592B\u592A\u592D\u5B54\u5C11\u5C24\u5C3A\u5C6F\u5DF4\u5E7B\u5EFF\u5F14\u5F15\u5FC3\u6208\u6236\u624B\u624E\u652F\u6587\u6597\u65A4\u65B9\u65E5\u66F0\u6708\u6728\u6B20\u6B62\u6B79\u6BCB\u6BD4\u6BDB\u6C0F\u6C34\u706B\u722A\u7236\u723B\u7247\u7259\u725B\u72AC\u738B\u4E19"], + ["a540", "\u4E16\u4E15\u4E14\u4E18\u4E3B\u4E4D\u4E4F\u4E4E\u4EE5\u4ED8\u4ED4\u4ED5\u4ED6\u4ED7\u4EE3\u4EE4\u4ED9\u4EDE\u5145\u5144\u5189\u518A\u51AC\u51F9\u51FA\u51F8\u520A\u52A0\u529F\u5305\u5306\u5317\u531D\u4EDF\u534A\u5349\u5361\u5360\u536F\u536E\u53BB\u53EF\u53E4\u53F3\u53EC\u53EE\u53E9\u53E8\u53FC\u53F8\u53F5\u53EB\u53E6\u53EA\u53F2\u53F1\u53F0\u53E5\u53ED\u53FB\u56DB\u56DA\u5916"], + ["a5a1", "\u592E\u5931\u5974\u5976\u5B55\u5B83\u5C3C\u5DE8\u5DE7\u5DE6\u5E02\u5E03\u5E73\u5E7C\u5F01\u5F18\u5F17\u5FC5\u620A\u6253\u6254\u6252\u6251\u65A5\u65E6\u672E\u672C\u672A\u672B\u672D\u6B63\u6BCD\u6C11\u6C10\u6C38\u6C41\u6C40\u6C3E\u72AF\u7384\u7389\u74DC\u74E6\u7518\u751F\u7528\u7529\u7530\u7531\u7532\u7533\u758B\u767D\u76AE\u76BF\u76EE\u77DB\u77E2\u77F3\u793A\u79BE\u7A74\u7ACB\u4E1E\u4E1F\u4E52\u4E53\u4E69\u4E99\u4EA4\u4EA6\u4EA5\u4EFF\u4F09\u4F19\u4F0A\u4F15\u4F0D\u4F10\u4F11\u4F0F\u4EF2\u4EF6\u4EFB\u4EF0\u4EF3\u4EFD\u4F01\u4F0B\u5149\u5147\u5146\u5148\u5168"], + ["a640", "\u5171\u518D\u51B0\u5217\u5211\u5212\u520E\u5216\u52A3\u5308\u5321\u5320\u5370\u5371\u5409\u540F\u540C\u540A\u5410\u5401\u540B\u5404\u5411\u540D\u5408\u5403\u540E\u5406\u5412\u56E0\u56DE\u56DD\u5733\u5730\u5728\u572D\u572C\u572F\u5729\u5919\u591A\u5937\u5938\u5984\u5978\u5983\u597D\u5979\u5982\u5981\u5B57\u5B58\u5B87\u5B88\u5B85\u5B89\u5BFA\u5C16\u5C79\u5DDE\u5E06\u5E76\u5E74"], + ["a6a1", "\u5F0F\u5F1B\u5FD9\u5FD6\u620E\u620C\u620D\u6210\u6263\u625B\u6258\u6536\u65E9\u65E8\u65EC\u65ED\u66F2\u66F3\u6709\u673D\u6734\u6731\u6735\u6B21\u6B64\u6B7B\u6C16\u6C5D\u6C57\u6C59\u6C5F\u6C60\u6C50\u6C55\u6C61\u6C5B\u6C4D\u6C4E\u7070\u725F\u725D\u767E\u7AF9\u7C73\u7CF8\u7F36\u7F8A\u7FBD\u8001\u8003\u800C\u8012\u8033\u807F\u8089\u808B\u808C\u81E3\u81EA\u81F3\u81FC\u820C\u821B\u821F\u826E\u8272\u827E\u866B\u8840\u884C\u8863\u897F\u9621\u4E32\u4EA8\u4F4D\u4F4F\u4F47\u4F57\u4F5E\u4F34\u4F5B\u4F55\u4F30\u4F50\u4F51\u4F3D\u4F3A\u4F38\u4F43\u4F54\u4F3C\u4F46\u4F63"], + ["a740", "\u4F5C\u4F60\u4F2F\u4F4E\u4F36\u4F59\u4F5D\u4F48\u4F5A\u514C\u514B\u514D\u5175\u51B6\u51B7\u5225\u5224\u5229\u522A\u5228\u52AB\u52A9\u52AA\u52AC\u5323\u5373\u5375\u541D\u542D\u541E\u543E\u5426\u544E\u5427\u5446\u5443\u5433\u5448\u5442\u541B\u5429\u544A\u5439\u543B\u5438\u542E\u5435\u5436\u5420\u543C\u5440\u5431\u542B\u541F\u542C\u56EA\u56F0\u56E4\u56EB\u574A\u5751\u5740\u574D"], + ["a7a1", "\u5747\u574E\u573E\u5750\u574F\u573B\u58EF\u593E\u599D\u5992\u59A8\u599E\u59A3\u5999\u5996\u598D\u59A4\u5993\u598A\u59A5\u5B5D\u5B5C\u5B5A\u5B5B\u5B8C\u5B8B\u5B8F\u5C2C\u5C40\u5C41\u5C3F\u5C3E\u5C90\u5C91\u5C94\u5C8C\u5DEB\u5E0C\u5E8F\u5E87\u5E8A\u5EF7\u5F04\u5F1F\u5F64\u5F62\u5F77\u5F79\u5FD8\u5FCC\u5FD7\u5FCD\u5FF1\u5FEB\u5FF8\u5FEA\u6212\u6211\u6284\u6297\u6296\u6280\u6276\u6289\u626D\u628A\u627C\u627E\u6279\u6273\u6292\u626F\u6298\u626E\u6295\u6293\u6291\u6286\u6539\u653B\u6538\u65F1\u66F4\u675F\u674E\u674F\u6750\u6751\u675C\u6756\u675E\u6749\u6746\u6760"], + ["a840", "\u6753\u6757\u6B65\u6BCF\u6C42\u6C5E\u6C99\u6C81\u6C88\u6C89\u6C85\u6C9B\u6C6A\u6C7A\u6C90\u6C70\u6C8C\u6C68\u6C96\u6C92\u6C7D\u6C83\u6C72\u6C7E\u6C74\u6C86\u6C76\u6C8D\u6C94\u6C98\u6C82\u7076\u707C\u707D\u7078\u7262\u7261\u7260\u72C4\u72C2\u7396\u752C\u752B\u7537\u7538\u7682\u76EF\u77E3\u79C1\u79C0\u79BF\u7A76\u7CFB\u7F55\u8096\u8093\u809D\u8098\u809B\u809A\u80B2\u826F\u8292"], + ["a8a1", "\u828B\u828D\u898B\u89D2\u8A00\u8C37\u8C46\u8C55\u8C9D\u8D64\u8D70\u8DB3\u8EAB\u8ECA\u8F9B\u8FB0\u8FC2\u8FC6\u8FC5\u8FC4\u5DE1\u9091\u90A2\u90AA\u90A6\u90A3\u9149\u91C6\u91CC\u9632\u962E\u9631\u962A\u962C\u4E26\u4E56\u4E73\u4E8B\u4E9B\u4E9E\u4EAB\u4EAC\u4F6F\u4F9D\u4F8D\u4F73\u4F7F\u4F6C\u4F9B\u4F8B\u4F86\u4F83\u4F70\u4F75\u4F88\u4F69\u4F7B\u4F96\u4F7E\u4F8F\u4F91\u4F7A\u5154\u5152\u5155\u5169\u5177\u5176\u5178\u51BD\u51FD\u523B\u5238\u5237\u523A\u5230\u522E\u5236\u5241\u52BE\u52BB\u5352\u5354\u5353\u5351\u5366\u5377\u5378\u5379\u53D6\u53D4\u53D7\u5473\u5475"], + ["a940", "\u5496\u5478\u5495\u5480\u547B\u5477\u5484\u5492\u5486\u547C\u5490\u5471\u5476\u548C\u549A\u5462\u5468\u548B\u547D\u548E\u56FA\u5783\u5777\u576A\u5769\u5761\u5766\u5764\u577C\u591C\u5949\u5947\u5948\u5944\u5954\u59BE\u59BB\u59D4\u59B9\u59AE\u59D1\u59C6\u59D0\u59CD\u59CB\u59D3\u59CA\u59AF\u59B3\u59D2\u59C5\u5B5F\u5B64\u5B63\u5B97\u5B9A\u5B98\u5B9C\u5B99\u5B9B\u5C1A\u5C48\u5C45"], + ["a9a1", "\u5C46\u5CB7\u5CA1\u5CB8\u5CA9\u5CAB\u5CB1\u5CB3\u5E18\u5E1A\u5E16\u5E15\u5E1B\u5E11\u5E78\u5E9A\u5E97\u5E9C\u5E95\u5E96\u5EF6\u5F26\u5F27\u5F29\u5F80\u5F81\u5F7F\u5F7C\u5FDD\u5FE0\u5FFD\u5FF5\u5FFF\u600F\u6014\u602F\u6035\u6016\u602A\u6015\u6021\u6027\u6029\u602B\u601B\u6216\u6215\u623F\u623E\u6240\u627F\u62C9\u62CC\u62C4\u62BF\u62C2\u62B9\u62D2\u62DB\u62AB\u62D3\u62D4\u62CB\u62C8\u62A8\u62BD\u62BC\u62D0\u62D9\u62C7\u62CD\u62B5\u62DA\u62B1\u62D8\u62D6\u62D7\u62C6\u62AC\u62CE\u653E\u65A7\u65BC\u65FA\u6614\u6613\u660C\u6606\u6602\u660E\u6600\u660F\u6615\u660A"], + ["aa40", "\u6607\u670D\u670B\u676D\u678B\u6795\u6771\u679C\u6773\u6777\u6787\u679D\u6797\u676F\u6770\u677F\u6789\u677E\u6790\u6775\u679A\u6793\u677C\u676A\u6772\u6B23\u6B66\u6B67\u6B7F\u6C13\u6C1B\u6CE3\u6CE8\u6CF3\u6CB1\u6CCC\u6CE5\u6CB3\u6CBD\u6CBE\u6CBC\u6CE2\u6CAB\u6CD5\u6CD3\u6CB8\u6CC4\u6CB9\u6CC1\u6CAE\u6CD7\u6CC5\u6CF1\u6CBF\u6CBB\u6CE1\u6CDB\u6CCA\u6CAC\u6CEF\u6CDC\u6CD6\u6CE0"], + ["aaa1", "\u7095\u708E\u7092\u708A\u7099\u722C\u722D\u7238\u7248\u7267\u7269\u72C0\u72CE\u72D9\u72D7\u72D0\u73A9\u73A8\u739F\u73AB\u73A5\u753D\u759D\u7599\u759A\u7684\u76C2\u76F2\u76F4\u77E5\u77FD\u793E\u7940\u7941\u79C9\u79C8\u7A7A\u7A79\u7AFA\u7CFE\u7F54\u7F8C\u7F8B\u8005\u80BA\u80A5\u80A2\u80B1\u80A1\u80AB\u80A9\u80B4\u80AA\u80AF\u81E5\u81FE\u820D\u82B3\u829D\u8299\u82AD\u82BD\u829F\u82B9\u82B1\u82AC\u82A5\u82AF\u82B8\u82A3\u82B0\u82BE\u82B7\u864E\u8671\u521D\u8868\u8ECB\u8FCE\u8FD4\u8FD1\u90B5\u90B8\u90B1\u90B6\u91C7\u91D1\u9577\u9580\u961C\u9640\u963F\u963B\u9644"], + ["ab40", "\u9642\u96B9\u96E8\u9752\u975E\u4E9F\u4EAD\u4EAE\u4FE1\u4FB5\u4FAF\u4FBF\u4FE0\u4FD1\u4FCF\u4FDD\u4FC3\u4FB6\u4FD8\u4FDF\u4FCA\u4FD7\u4FAE\u4FD0\u4FC4\u4FC2\u4FDA\u4FCE\u4FDE\u4FB7\u5157\u5192\u5191\u51A0\u524E\u5243\u524A\u524D\u524C\u524B\u5247\u52C7\u52C9\u52C3\u52C1\u530D\u5357\u537B\u539A\u53DB\u54AC\u54C0\u54A8\u54CE\u54C9\u54B8\u54A6\u54B3\u54C7\u54C2\u54BD\u54AA\u54C1"], + ["aba1", "\u54C4\u54C8\u54AF\u54AB\u54B1\u54BB\u54A9\u54A7\u54BF\u56FF\u5782\u578B\u57A0\u57A3\u57A2\u57CE\u57AE\u5793\u5955\u5951\u594F\u594E\u5950\u59DC\u59D8\u59FF\u59E3\u59E8\u5A03\u59E5\u59EA\u59DA\u59E6\u5A01\u59FB\u5B69\u5BA3\u5BA6\u5BA4\u5BA2\u5BA5\u5C01\u5C4E\u5C4F\u5C4D\u5C4B\u5CD9\u5CD2\u5DF7\u5E1D\u5E25\u5E1F\u5E7D\u5EA0\u5EA6\u5EFA\u5F08\u5F2D\u5F65\u5F88\u5F85\u5F8A\u5F8B\u5F87\u5F8C\u5F89\u6012\u601D\u6020\u6025\u600E\u6028\u604D\u6070\u6068\u6062\u6046\u6043\u606C\u606B\u606A\u6064\u6241\u62DC\u6316\u6309\u62FC\u62ED\u6301\u62EE\u62FD\u6307\u62F1\u62F7"], + ["ac40", "\u62EF\u62EC\u62FE\u62F4\u6311\u6302\u653F\u6545\u65AB\u65BD\u65E2\u6625\u662D\u6620\u6627\u662F\u661F\u6628\u6631\u6624\u66F7\u67FF\u67D3\u67F1\u67D4\u67D0\u67EC\u67B6\u67AF\u67F5\u67E9\u67EF\u67C4\u67D1\u67B4\u67DA\u67E5\u67B8\u67CF\u67DE\u67F3\u67B0\u67D9\u67E2\u67DD\u67D2\u6B6A\u6B83\u6B86\u6BB5\u6BD2\u6BD7\u6C1F\u6CC9\u6D0B\u6D32\u6D2A\u6D41\u6D25\u6D0C\u6D31\u6D1E\u6D17"], + ["aca1", "\u6D3B\u6D3D\u6D3E\u6D36\u6D1B\u6CF5\u6D39\u6D27\u6D38\u6D29\u6D2E\u6D35\u6D0E\u6D2B\u70AB\u70BA\u70B3\u70AC\u70AF\u70AD\u70B8\u70AE\u70A4\u7230\u7272\u726F\u7274\u72E9\u72E0\u72E1\u73B7\u73CA\u73BB\u73B2\u73CD\u73C0\u73B3\u751A\u752D\u754F\u754C\u754E\u754B\u75AB\u75A4\u75A5\u75A2\u75A3\u7678\u7686\u7687\u7688\u76C8\u76C6\u76C3\u76C5\u7701\u76F9\u76F8\u7709\u770B\u76FE\u76FC\u7707\u77DC\u7802\u7814\u780C\u780D\u7946\u7949\u7948\u7947\u79B9\u79BA\u79D1\u79D2\u79CB\u7A7F\u7A81\u7AFF\u7AFD\u7C7D\u7D02\u7D05\u7D00\u7D09\u7D07\u7D04\u7D06\u7F38\u7F8E\u7FBF\u8004"], + ["ad40", "\u8010\u800D\u8011\u8036\u80D6\u80E5\u80DA\u80C3\u80C4\u80CC\u80E1\u80DB\u80CE\u80DE\u80E4\u80DD\u81F4\u8222\u82E7\u8303\u8305\u82E3\u82DB\u82E6\u8304\u82E5\u8302\u8309\u82D2\u82D7\u82F1\u8301\u82DC\u82D4\u82D1\u82DE\u82D3\u82DF\u82EF\u8306\u8650\u8679\u867B\u867A\u884D\u886B\u8981\u89D4\u8A08\u8A02\u8A03\u8C9E\u8CA0\u8D74\u8D73\u8DB4\u8ECD\u8ECC\u8FF0\u8FE6\u8FE2\u8FEA\u8FE5"], + ["ada1", "\u8FED\u8FEB\u8FE4\u8FE8\u90CA\u90CE\u90C1\u90C3\u914B\u914A\u91CD\u9582\u9650\u964B\u964C\u964D\u9762\u9769\u97CB\u97ED\u97F3\u9801\u98A8\u98DB\u98DF\u9996\u9999\u4E58\u4EB3\u500C\u500D\u5023\u4FEF\u5026\u5025\u4FF8\u5029\u5016\u5006\u503C\u501F\u501A\u5012\u5011\u4FFA\u5000\u5014\u5028\u4FF1\u5021\u500B\u5019\u5018\u4FF3\u4FEE\u502D\u502A\u4FFE\u502B\u5009\u517C\u51A4\u51A5\u51A2\u51CD\u51CC\u51C6\u51CB\u5256\u525C\u5254\u525B\u525D\u532A\u537F\u539F\u539D\u53DF\u54E8\u5510\u5501\u5537\u54FC\u54E5\u54F2\u5506\u54FA\u5514\u54E9\u54ED\u54E1\u5509\u54EE\u54EA"], + ["ae40", "\u54E6\u5527\u5507\u54FD\u550F\u5703\u5704\u57C2\u57D4\u57CB\u57C3\u5809\u590F\u5957\u5958\u595A\u5A11\u5A18\u5A1C\u5A1F\u5A1B\u5A13\u59EC\u5A20\u5A23\u5A29\u5A25\u5A0C\u5A09\u5B6B\u5C58\u5BB0\u5BB3\u5BB6\u5BB4\u5BAE\u5BB5\u5BB9\u5BB8\u5C04\u5C51\u5C55\u5C50\u5CED\u5CFD\u5CFB\u5CEA\u5CE8\u5CF0\u5CF6\u5D01\u5CF4\u5DEE\u5E2D\u5E2B\u5EAB\u5EAD\u5EA7\u5F31\u5F92\u5F91\u5F90\u6059"], + ["aea1", "\u6063\u6065\u6050\u6055\u606D\u6069\u606F\u6084\u609F\u609A\u608D\u6094\u608C\u6085\u6096\u6247\u62F3\u6308\u62FF\u634E\u633E\u632F\u6355\u6342\u6346\u634F\u6349\u633A\u6350\u633D\u632A\u632B\u6328\u634D\u634C\u6548\u6549\u6599\u65C1\u65C5\u6642\u6649\u664F\u6643\u6652\u664C\u6645\u6641\u66F8\u6714\u6715\u6717\u6821\u6838\u6848\u6846\u6853\u6839\u6842\u6854\u6829\u68B3\u6817\u684C\u6851\u683D\u67F4\u6850\u6840\u683C\u6843\u682A\u6845\u6813\u6818\u6841\u6B8A\u6B89\u6BB7\u6C23\u6C27\u6C28\u6C26\u6C24\u6CF0\u6D6A\u6D95\u6D88\u6D87\u6D66\u6D78\u6D77\u6D59\u6D93"], + ["af40", "\u6D6C\u6D89\u6D6E\u6D5A\u6D74\u6D69\u6D8C\u6D8A\u6D79\u6D85\u6D65\u6D94\u70CA\u70D8\u70E4\u70D9\u70C8\u70CF\u7239\u7279\u72FC\u72F9\u72FD\u72F8\u72F7\u7386\u73ED\u7409\u73EE\u73E0\u73EA\u73DE\u7554\u755D\u755C\u755A\u7559\u75BE\u75C5\u75C7\u75B2\u75B3\u75BD\u75BC\u75B9\u75C2\u75B8\u768B\u76B0\u76CA\u76CD\u76CE\u7729\u771F\u7720\u7728\u77E9\u7830\u7827\u7838\u781D\u7834\u7837"], + ["afa1", "\u7825\u782D\u7820\u781F\u7832\u7955\u7950\u7960\u795F\u7956\u795E\u795D\u7957\u795A\u79E4\u79E3\u79E7\u79DF\u79E6\u79E9\u79D8\u7A84\u7A88\u7AD9\u7B06\u7B11\u7C89\u7D21\u7D17\u7D0B\u7D0A\u7D20\u7D22\u7D14\u7D10\u7D15\u7D1A\u7D1C\u7D0D\u7D19\u7D1B\u7F3A\u7F5F\u7F94\u7FC5\u7FC1\u8006\u8018\u8015\u8019\u8017\u803D\u803F\u80F1\u8102\u80F0\u8105\u80ED\u80F4\u8106\u80F8\u80F3\u8108\u80FD\u810A\u80FC\u80EF\u81ED\u81EC\u8200\u8210\u822A\u822B\u8228\u822C\u82BB\u832B\u8352\u8354\u834A\u8338\u8350\u8349\u8335\u8334\u834F\u8332\u8339\u8336\u8317\u8340\u8331\u8328\u8343"], + ["b040", "\u8654\u868A\u86AA\u8693\u86A4\u86A9\u868C\u86A3\u869C\u8870\u8877\u8881\u8882\u887D\u8879\u8A18\u8A10\u8A0E\u8A0C\u8A15\u8A0A\u8A17\u8A13\u8A16\u8A0F\u8A11\u8C48\u8C7A\u8C79\u8CA1\u8CA2\u8D77\u8EAC\u8ED2\u8ED4\u8ECF\u8FB1\u9001\u9006\u8FF7\u9000\u8FFA\u8FF4\u9003\u8FFD\u9005\u8FF8\u9095\u90E1\u90DD\u90E2\u9152\u914D\u914C\u91D8\u91DD\u91D7\u91DC\u91D9\u9583\u9662\u9663\u9661"], + ["b0a1", "\u965B\u965D\u9664\u9658\u965E\u96BB\u98E2\u99AC\u9AA8\u9AD8\u9B25\u9B32\u9B3C\u4E7E\u507A\u507D\u505C\u5047\u5043\u504C\u505A\u5049\u5065\u5076\u504E\u5055\u5075\u5074\u5077\u504F\u500F\u506F\u506D\u515C\u5195\u51F0\u526A\u526F\u52D2\u52D9\u52D8\u52D5\u5310\u530F\u5319\u533F\u5340\u533E\u53C3\u66FC\u5546\u556A\u5566\u5544\u555E\u5561\u5543\u554A\u5531\u5556\u554F\u5555\u552F\u5564\u5538\u552E\u555C\u552C\u5563\u5533\u5541\u5557\u5708\u570B\u5709\u57DF\u5805\u580A\u5806\u57E0\u57E4\u57FA\u5802\u5835\u57F7\u57F9\u5920\u5962\u5A36\u5A41\u5A49\u5A66\u5A6A\u5A40"], + ["b140", "\u5A3C\u5A62\u5A5A\u5A46\u5A4A\u5B70\u5BC7\u5BC5\u5BC4\u5BC2\u5BBF\u5BC6\u5C09\u5C08\u5C07\u5C60\u5C5C\u5C5D\u5D07\u5D06\u5D0E\u5D1B\u5D16\u5D22\u5D11\u5D29\u5D14\u5D19\u5D24\u5D27\u5D17\u5DE2\u5E38\u5E36\u5E33\u5E37\u5EB7\u5EB8\u5EB6\u5EB5\u5EBE\u5F35\u5F37\u5F57\u5F6C\u5F69\u5F6B\u5F97\u5F99\u5F9E\u5F98\u5FA1\u5FA0\u5F9C\u607F\u60A3\u6089\u60A0\u60A8\u60CB\u60B4\u60E6\u60BD"], + ["b1a1", "\u60C5\u60BB\u60B5\u60DC\u60BC\u60D8\u60D5\u60C6\u60DF\u60B8\u60DA\u60C7\u621A\u621B\u6248\u63A0\u63A7\u6372\u6396\u63A2\u63A5\u6377\u6367\u6398\u63AA\u6371\u63A9\u6389\u6383\u639B\u636B\u63A8\u6384\u6388\u6399\u63A1\u63AC\u6392\u638F\u6380\u637B\u6369\u6368\u637A\u655D\u6556\u6551\u6559\u6557\u555F\u654F\u6558\u6555\u6554\u659C\u659B\u65AC\u65CF\u65CB\u65CC\u65CE\u665D\u665A\u6664\u6668\u6666\u665E\u66F9\u52D7\u671B\u6881\u68AF\u68A2\u6893\u68B5\u687F\u6876\u68B1\u68A7\u6897\u68B0\u6883\u68C4\u68AD\u6886\u6885\u6894\u689D\u68A8\u689F\u68A1\u6882\u6B32\u6BBA"], + ["b240", "\u6BEB\u6BEC\u6C2B\u6D8E\u6DBC\u6DF3\u6DD9\u6DB2\u6DE1\u6DCC\u6DE4\u6DFB\u6DFA\u6E05\u6DC7\u6DCB\u6DAF\u6DD1\u6DAE\u6DDE\u6DF9\u6DB8\u6DF7\u6DF5\u6DC5\u6DD2\u6E1A\u6DB5\u6DDA\u6DEB\u6DD8\u6DEA\u6DF1\u6DEE\u6DE8\u6DC6\u6DC4\u6DAA\u6DEC\u6DBF\u6DE6\u70F9\u7109\u710A\u70FD\u70EF\u723D\u727D\u7281\u731C\u731B\u7316\u7313\u7319\u7387\u7405\u740A\u7403\u7406\u73FE\u740D\u74E0\u74F6"], + ["b2a1", "\u74F7\u751C\u7522\u7565\u7566\u7562\u7570\u758F\u75D4\u75D5\u75B5\u75CA\u75CD\u768E\u76D4\u76D2\u76DB\u7737\u773E\u773C\u7736\u7738\u773A\u786B\u7843\u784E\u7965\u7968\u796D\u79FB\u7A92\u7A95\u7B20\u7B28\u7B1B\u7B2C\u7B26\u7B19\u7B1E\u7B2E\u7C92\u7C97\u7C95\u7D46\u7D43\u7D71\u7D2E\u7D39\u7D3C\u7D40\u7D30\u7D33\u7D44\u7D2F\u7D42\u7D32\u7D31\u7F3D\u7F9E\u7F9A\u7FCC\u7FCE\u7FD2\u801C\u804A\u8046\u812F\u8116\u8123\u812B\u8129\u8130\u8124\u8202\u8235\u8237\u8236\u8239\u838E\u839E\u8398\u8378\u83A2\u8396\u83BD\u83AB\u8392\u838A\u8393\u8389\u83A0\u8377\u837B\u837C"], + ["b340", "\u8386\u83A7\u8655\u5F6A\u86C7\u86C0\u86B6\u86C4\u86B5\u86C6\u86CB\u86B1\u86AF\u86C9\u8853\u889E\u8888\u88AB\u8892\u8896\u888D\u888B\u8993\u898F\u8A2A\u8A1D\u8A23\u8A25\u8A31\u8A2D\u8A1F\u8A1B\u8A22\u8C49\u8C5A\u8CA9\u8CAC\u8CAB\u8CA8\u8CAA\u8CA7\u8D67\u8D66\u8DBE\u8DBA\u8EDB\u8EDF\u9019\u900D\u901A\u9017\u9023\u901F\u901D\u9010\u9015\u901E\u9020\u900F\u9022\u9016\u901B\u9014"], + ["b3a1", "\u90E8\u90ED\u90FD\u9157\u91CE\u91F5\u91E6\u91E3\u91E7\u91ED\u91E9\u9589\u966A\u9675\u9673\u9678\u9670\u9674\u9676\u9677\u966C\u96C0\u96EA\u96E9\u7AE0\u7ADF\u9802\u9803\u9B5A\u9CE5\u9E75\u9E7F\u9EA5\u9EBB\u50A2\u508D\u5085\u5099\u5091\u5080\u5096\u5098\u509A\u6700\u51F1\u5272\u5274\u5275\u5269\u52DE\u52DD\u52DB\u535A\u53A5\u557B\u5580\u55A7\u557C\u558A\u559D\u5598\u5582\u559C\u55AA\u5594\u5587\u558B\u5583\u55B3\u55AE\u559F\u553E\u55B2\u559A\u55BB\u55AC\u55B1\u557E\u5589\u55AB\u5599\u570D\u582F\u582A\u5834\u5824\u5830\u5831\u5821\u581D\u5820\u58F9\u58FA\u5960"], + ["b440", "\u5A77\u5A9A\u5A7F\u5A92\u5A9B\u5AA7\u5B73\u5B71\u5BD2\u5BCC\u5BD3\u5BD0\u5C0A\u5C0B\u5C31\u5D4C\u5D50\u5D34\u5D47\u5DFD\u5E45\u5E3D\u5E40\u5E43\u5E7E\u5ECA\u5EC1\u5EC2\u5EC4\u5F3C\u5F6D\u5FA9\u5FAA\u5FA8\u60D1\u60E1\u60B2\u60B6\u60E0\u611C\u6123\u60FA\u6115\u60F0\u60FB\u60F4\u6168\u60F1\u610E\u60F6\u6109\u6100\u6112\u621F\u6249\u63A3\u638C\u63CF\u63C0\u63E9\u63C9\u63C6\u63CD"], + ["b4a1", "\u63D2\u63E3\u63D0\u63E1\u63D6\u63ED\u63EE\u6376\u63F4\u63EA\u63DB\u6452\u63DA\u63F9\u655E\u6566\u6562\u6563\u6591\u6590\u65AF\u666E\u6670\u6674\u6676\u666F\u6691\u667A\u667E\u6677\u66FE\u66FF\u671F\u671D\u68FA\u68D5\u68E0\u68D8\u68D7\u6905\u68DF\u68F5\u68EE\u68E7\u68F9\u68D2\u68F2\u68E3\u68CB\u68CD\u690D\u6912\u690E\u68C9\u68DA\u696E\u68FB\u6B3E\u6B3A\u6B3D\u6B98\u6B96\u6BBC\u6BEF\u6C2E\u6C2F\u6C2C\u6E2F\u6E38\u6E54\u6E21\u6E32\u6E67\u6E4A\u6E20\u6E25\u6E23\u6E1B\u6E5B\u6E58\u6E24\u6E56\u6E6E\u6E2D\u6E26\u6E6F\u6E34\u6E4D\u6E3A\u6E2C\u6E43\u6E1D\u6E3E\u6ECB"], + ["b540", "\u6E89\u6E19\u6E4E\u6E63\u6E44\u6E72\u6E69\u6E5F\u7119\u711A\u7126\u7130\u7121\u7136\u716E\u711C\u724C\u7284\u7280\u7336\u7325\u7334\u7329\u743A\u742A\u7433\u7422\u7425\u7435\u7436\u7434\u742F\u741B\u7426\u7428\u7525\u7526\u756B\u756A\u75E2\u75DB\u75E3\u75D9\u75D8\u75DE\u75E0\u767B\u767C\u7696\u7693\u76B4\u76DC\u774F\u77ED\u785D\u786C\u786F\u7A0D\u7A08\u7A0B\u7A05\u7A00\u7A98"], + ["b5a1", "\u7A97\u7A96\u7AE5\u7AE3\u7B49\u7B56\u7B46\u7B50\u7B52\u7B54\u7B4D\u7B4B\u7B4F\u7B51\u7C9F\u7CA5\u7D5E\u7D50\u7D68\u7D55\u7D2B\u7D6E\u7D72\u7D61\u7D66\u7D62\u7D70\u7D73\u5584\u7FD4\u7FD5\u800B\u8052\u8085\u8155\u8154\u814B\u8151\u814E\u8139\u8146\u813E\u814C\u8153\u8174\u8212\u821C\u83E9\u8403\u83F8\u840D\u83E0\u83C5\u840B\u83C1\u83EF\u83F1\u83F4\u8457\u840A\u83F0\u840C\u83CC\u83FD\u83F2\u83CA\u8438\u840E\u8404\u83DC\u8407\u83D4\u83DF\u865B\u86DF\u86D9\u86ED\u86D4\u86DB\u86E4\u86D0\u86DE\u8857\u88C1\u88C2\u88B1\u8983\u8996\u8A3B\u8A60\u8A55\u8A5E\u8A3C\u8A41"], + ["b640", "\u8A54\u8A5B\u8A50\u8A46\u8A34\u8A3A\u8A36\u8A56\u8C61\u8C82\u8CAF\u8CBC\u8CB3\u8CBD\u8CC1\u8CBB\u8CC0\u8CB4\u8CB7\u8CB6\u8CBF\u8CB8\u8D8A\u8D85\u8D81\u8DCE\u8DDD\u8DCB\u8DDA\u8DD1\u8DCC\u8DDB\u8DC6\u8EFB\u8EF8\u8EFC\u8F9C\u902E\u9035\u9031\u9038\u9032\u9036\u9102\u90F5\u9109\u90FE\u9163\u9165\u91CF\u9214\u9215\u9223\u9209\u921E\u920D\u9210\u9207\u9211\u9594\u958F\u958B\u9591"], + ["b6a1", "\u9593\u9592\u958E\u968A\u968E\u968B\u967D\u9685\u9686\u968D\u9672\u9684\u96C1\u96C5\u96C4\u96C6\u96C7\u96EF\u96F2\u97CC\u9805\u9806\u9808\u98E7\u98EA\u98EF\u98E9\u98F2\u98ED\u99AE\u99AD\u9EC3\u9ECD\u9ED1\u4E82\u50AD\u50B5\u50B2\u50B3\u50C5\u50BE\u50AC\u50B7\u50BB\u50AF\u50C7\u527F\u5277\u527D\u52DF\u52E6\u52E4\u52E2\u52E3\u532F\u55DF\u55E8\u55D3\u55E6\u55CE\u55DC\u55C7\u55D1\u55E3\u55E4\u55EF\u55DA\u55E1\u55C5\u55C6\u55E5\u55C9\u5712\u5713\u585E\u5851\u5858\u5857\u585A\u5854\u586B\u584C\u586D\u584A\u5862\u5852\u584B\u5967\u5AC1\u5AC9\u5ACC\u5ABE\u5ABD\u5ABC"], + ["b740", "\u5AB3\u5AC2\u5AB2\u5D69\u5D6F\u5E4C\u5E79\u5EC9\u5EC8\u5F12\u5F59\u5FAC\u5FAE\u611A\u610F\u6148\u611F\u60F3\u611B\u60F9\u6101\u6108\u614E\u614C\u6144\u614D\u613E\u6134\u6127\u610D\u6106\u6137\u6221\u6222\u6413\u643E\u641E\u642A\u642D\u643D\u642C\u640F\u641C\u6414\u640D\u6436\u6416\u6417\u6406\u656C\u659F\u65B0\u6697\u6689\u6687\u6688\u6696\u6684\u6698\u668D\u6703\u6994\u696D"], + ["b7a1", "\u695A\u6977\u6960\u6954\u6975\u6930\u6982\u694A\u6968\u696B\u695E\u6953\u6979\u6986\u695D\u6963\u695B\u6B47\u6B72\u6BC0\u6BBF\u6BD3\u6BFD\u6EA2\u6EAF\u6ED3\u6EB6\u6EC2\u6E90\u6E9D\u6EC7\u6EC5\u6EA5\u6E98\u6EBC\u6EBA\u6EAB\u6ED1\u6E96\u6E9C\u6EC4\u6ED4\u6EAA\u6EA7\u6EB4\u714E\u7159\u7169\u7164\u7149\u7167\u715C\u716C\u7166\u714C\u7165\u715E\u7146\u7168\u7156\u723A\u7252\u7337\u7345\u733F\u733E\u746F\u745A\u7455\u745F\u745E\u7441\u743F\u7459\u745B\u745C\u7576\u7578\u7600\u75F0\u7601\u75F2\u75F1\u75FA\u75FF\u75F4\u75F3\u76DE\u76DF\u775B\u776B\u7766\u775E\u7763"], + ["b840", "\u7779\u776A\u776C\u775C\u7765\u7768\u7762\u77EE\u788E\u78B0\u7897\u7898\u788C\u7889\u787C\u7891\u7893\u787F\u797A\u797F\u7981\u842C\u79BD\u7A1C\u7A1A\u7A20\u7A14\u7A1F\u7A1E\u7A9F\u7AA0\u7B77\u7BC0\u7B60\u7B6E\u7B67\u7CB1\u7CB3\u7CB5\u7D93\u7D79\u7D91\u7D81\u7D8F\u7D5B\u7F6E\u7F69\u7F6A\u7F72\u7FA9\u7FA8\u7FA4\u8056\u8058\u8086\u8084\u8171\u8170\u8178\u8165\u816E\u8173\u816B"], + ["b8a1", "\u8179\u817A\u8166\u8205\u8247\u8482\u8477\u843D\u8431\u8475\u8466\u846B\u8449\u846C\u845B\u843C\u8435\u8461\u8463\u8469\u846D\u8446\u865E\u865C\u865F\u86F9\u8713\u8708\u8707\u8700\u86FE\u86FB\u8702\u8703\u8706\u870A\u8859\u88DF\u88D4\u88D9\u88DC\u88D8\u88DD\u88E1\u88CA\u88D5\u88D2\u899C\u89E3\u8A6B\u8A72\u8A73\u8A66\u8A69\u8A70\u8A87\u8A7C\u8A63\u8AA0\u8A71\u8A85\u8A6D\u8A62\u8A6E\u8A6C\u8A79\u8A7B\u8A3E\u8A68\u8C62\u8C8A\u8C89\u8CCA\u8CC7\u8CC8\u8CC4\u8CB2\u8CC3\u8CC2\u8CC5\u8DE1\u8DDF\u8DE8\u8DEF\u8DF3\u8DFA\u8DEA\u8DE4\u8DE6\u8EB2\u8F03\u8F09\u8EFE\u8F0A"], + ["b940", "\u8F9F\u8FB2\u904B\u904A\u9053\u9042\u9054\u903C\u9055\u9050\u9047\u904F\u904E\u904D\u9051\u903E\u9041\u9112\u9117\u916C\u916A\u9169\u91C9\u9237\u9257\u9238\u923D\u9240\u923E\u925B\u924B\u9264\u9251\u9234\u9249\u924D\u9245\u9239\u923F\u925A\u9598\u9698\u9694\u9695\u96CD\u96CB\u96C9\u96CA\u96F7\u96FB\u96F9\u96F6\u9756\u9774\u9776\u9810\u9811\u9813\u980A\u9812\u980C\u98FC\u98F4"], + ["b9a1", "\u98FD\u98FE\u99B3\u99B1\u99B4\u9AE1\u9CE9\u9E82\u9F0E\u9F13\u9F20\u50E7\u50EE\u50E5\u50D6\u50ED\u50DA\u50D5\u50CF\u50D1\u50F1\u50CE\u50E9\u5162\u51F3\u5283\u5282\u5331\u53AD\u55FE\u5600\u561B\u5617\u55FD\u5614\u5606\u5609\u560D\u560E\u55F7\u5616\u561F\u5608\u5610\u55F6\u5718\u5716\u5875\u587E\u5883\u5893\u588A\u5879\u5885\u587D\u58FD\u5925\u5922\u5924\u596A\u5969\u5AE1\u5AE6\u5AE9\u5AD7\u5AD6\u5AD8\u5AE3\u5B75\u5BDE\u5BE7\u5BE1\u5BE5\u5BE6\u5BE8\u5BE2\u5BE4\u5BDF\u5C0D\u5C62\u5D84\u5D87\u5E5B\u5E63\u5E55\u5E57\u5E54\u5ED3\u5ED6\u5F0A\u5F46\u5F70\u5FB9\u6147"], + ["ba40", "\u613F\u614B\u6177\u6162\u6163\u615F\u615A\u6158\u6175\u622A\u6487\u6458\u6454\u64A4\u6478\u645F\u647A\u6451\u6467\u6434\u646D\u647B\u6572\u65A1\u65D7\u65D6\u66A2\u66A8\u669D\u699C\u69A8\u6995\u69C1\u69AE\u69D3\u69CB\u699B\u69B7\u69BB\u69AB\u69B4\u69D0\u69CD\u69AD\u69CC\u69A6\u69C3\u69A3\u6B49\u6B4C\u6C33\u6F33\u6F14\u6EFE\u6F13\u6EF4\u6F29\u6F3E\u6F20\u6F2C\u6F0F\u6F02\u6F22"], + ["baa1", "\u6EFF\u6EEF\u6F06\u6F31\u6F38\u6F32\u6F23\u6F15\u6F2B\u6F2F\u6F88\u6F2A\u6EEC\u6F01\u6EF2\u6ECC\u6EF7\u7194\u7199\u717D\u718A\u7184\u7192\u723E\u7292\u7296\u7344\u7350\u7464\u7463\u746A\u7470\u746D\u7504\u7591\u7627\u760D\u760B\u7609\u7613\u76E1\u76E3\u7784\u777D\u777F\u7761\u78C1\u789F\u78A7\u78B3\u78A9\u78A3\u798E\u798F\u798D\u7A2E\u7A31\u7AAA\u7AA9\u7AED\u7AEF\u7BA1\u7B95\u7B8B\u7B75\u7B97\u7B9D\u7B94\u7B8F\u7BB8\u7B87\u7B84\u7CB9\u7CBD\u7CBE\u7DBB\u7DB0\u7D9C\u7DBD\u7DBE\u7DA0\u7DCA\u7DB4\u7DB2\u7DB1\u7DBA\u7DA2\u7DBF\u7DB5\u7DB8\u7DAD\u7DD2\u7DC7\u7DAC"], + ["bb40", "\u7F70\u7FE0\u7FE1\u7FDF\u805E\u805A\u8087\u8150\u8180\u818F\u8188\u818A\u817F\u8182\u81E7\u81FA\u8207\u8214\u821E\u824B\u84C9\u84BF\u84C6\u84C4\u8499\u849E\u84B2\u849C\u84CB\u84B8\u84C0\u84D3\u8490\u84BC\u84D1\u84CA\u873F\u871C\u873B\u8722\u8725\u8734\u8718\u8755\u8737\u8729\u88F3\u8902\u88F4\u88F9\u88F8\u88FD\u88E8\u891A\u88EF\u8AA6\u8A8C\u8A9E\u8AA3\u8A8D\u8AA1\u8A93\u8AA4"], + ["bba1", "\u8AAA\u8AA5\u8AA8\u8A98\u8A91\u8A9A\u8AA7\u8C6A\u8C8D\u8C8C\u8CD3\u8CD1\u8CD2\u8D6B\u8D99\u8D95\u8DFC\u8F14\u8F12\u8F15\u8F13\u8FA3\u9060\u9058\u905C\u9063\u9059\u905E\u9062\u905D\u905B\u9119\u9118\u911E\u9175\u9178\u9177\u9174\u9278\u9280\u9285\u9298\u9296\u927B\u9293\u929C\u92A8\u927C\u9291\u95A1\u95A8\u95A9\u95A3\u95A5\u95A4\u9699\u969C\u969B\u96CC\u96D2\u9700\u977C\u9785\u97F6\u9817\u9818\u98AF\u98B1\u9903\u9905\u990C\u9909\u99C1\u9AAF\u9AB0\u9AE6\u9B41\u9B42\u9CF4\u9CF6\u9CF3\u9EBC\u9F3B\u9F4A\u5104\u5100\u50FB\u50F5\u50F9\u5102\u5108\u5109\u5105\u51DC"], + ["bc40", "\u5287\u5288\u5289\u528D\u528A\u52F0\u53B2\u562E\u563B\u5639\u5632\u563F\u5634\u5629\u5653\u564E\u5657\u5674\u5636\u562F\u5630\u5880\u589F\u589E\u58B3\u589C\u58AE\u58A9\u58A6\u596D\u5B09\u5AFB\u5B0B\u5AF5\u5B0C\u5B08\u5BEE\u5BEC\u5BE9\u5BEB\u5C64\u5C65\u5D9D\u5D94\u5E62\u5E5F\u5E61\u5EE2\u5EDA\u5EDF\u5EDD\u5EE3\u5EE0\u5F48\u5F71\u5FB7\u5FB5\u6176\u6167\u616E\u615D\u6155\u6182"], + ["bca1", "\u617C\u6170\u616B\u617E\u61A7\u6190\u61AB\u618E\u61AC\u619A\u61A4\u6194\u61AE\u622E\u6469\u646F\u6479\u649E\u64B2\u6488\u6490\u64B0\u64A5\u6493\u6495\u64A9\u6492\u64AE\u64AD\u64AB\u649A\u64AC\u6499\u64A2\u64B3\u6575\u6577\u6578\u66AE\u66AB\u66B4\u66B1\u6A23\u6A1F\u69E8\u6A01\u6A1E\u6A19\u69FD\u6A21\u6A13\u6A0A\u69F3\u6A02\u6A05\u69ED\u6A11\u6B50\u6B4E\u6BA4\u6BC5\u6BC6\u6F3F\u6F7C\u6F84\u6F51\u6F66\u6F54\u6F86\u6F6D\u6F5B\u6F78\u6F6E\u6F8E\u6F7A\u6F70\u6F64\u6F97\u6F58\u6ED5\u6F6F\u6F60\u6F5F\u719F\u71AC\u71B1\u71A8\u7256\u729B\u734E\u7357\u7469\u748B\u7483"], + ["bd40", "\u747E\u7480\u757F\u7620\u7629\u761F\u7624\u7626\u7621\u7622\u769A\u76BA\u76E4\u778E\u7787\u778C\u7791\u778B\u78CB\u78C5\u78BA\u78CA\u78BE\u78D5\u78BC\u78D0\u7A3F\u7A3C\u7A40\u7A3D\u7A37\u7A3B\u7AAF\u7AAE\u7BAD\u7BB1\u7BC4\u7BB4\u7BC6\u7BC7\u7BC1\u7BA0\u7BCC\u7CCA\u7DE0\u7DF4\u7DEF\u7DFB\u7DD8\u7DEC\u7DDD\u7DE8\u7DE3\u7DDA\u7DDE\u7DE9\u7D9E\u7DD9\u7DF2\u7DF9\u7F75\u7F77\u7FAF"], + ["bda1", "\u7FE9\u8026\u819B\u819C\u819D\u81A0\u819A\u8198\u8517\u853D\u851A\u84EE\u852C\u852D\u8513\u8511\u8523\u8521\u8514\u84EC\u8525\u84FF\u8506\u8782\u8774\u8776\u8760\u8766\u8778\u8768\u8759\u8757\u874C\u8753\u885B\u885D\u8910\u8907\u8912\u8913\u8915\u890A\u8ABC\u8AD2\u8AC7\u8AC4\u8A95\u8ACB\u8AF8\u8AB2\u8AC9\u8AC2\u8ABF\u8AB0\u8AD6\u8ACD\u8AB6\u8AB9\u8ADB\u8C4C\u8C4E\u8C6C\u8CE0\u8CDE\u8CE6\u8CE4\u8CEC\u8CED\u8CE2\u8CE3\u8CDC\u8CEA\u8CE1\u8D6D\u8D9F\u8DA3\u8E2B\u8E10\u8E1D\u8E22\u8E0F\u8E29\u8E1F\u8E21\u8E1E\u8EBA\u8F1D\u8F1B\u8F1F\u8F29\u8F26\u8F2A\u8F1C\u8F1E"], + ["be40", "\u8F25\u9069\u906E\u9068\u906D\u9077\u9130\u912D\u9127\u9131\u9187\u9189\u918B\u9183\u92C5\u92BB\u92B7\u92EA\u92AC\u92E4\u92C1\u92B3\u92BC\u92D2\u92C7\u92F0\u92B2\u95AD\u95B1\u9704\u9706\u9707\u9709\u9760\u978D\u978B\u978F\u9821\u982B\u981C\u98B3\u990A\u9913\u9912\u9918\u99DD\u99D0\u99DF\u99DB\u99D1\u99D5\u99D2\u99D9\u9AB7\u9AEE\u9AEF\u9B27\u9B45\u9B44\u9B77\u9B6F\u9D06\u9D09"], + ["bea1", "\u9D03\u9EA9\u9EBE\u9ECE\u58A8\u9F52\u5112\u5118\u5114\u5110\u5115\u5180\u51AA\u51DD\u5291\u5293\u52F3\u5659\u566B\u5679\u5669\u5664\u5678\u566A\u5668\u5665\u5671\u566F\u566C\u5662\u5676\u58C1\u58BE\u58C7\u58C5\u596E\u5B1D\u5B34\u5B78\u5BF0\u5C0E\u5F4A\u61B2\u6191\u61A9\u618A\u61CD\u61B6\u61BE\u61CA\u61C8\u6230\u64C5\u64C1\u64CB\u64BB\u64BC\u64DA\u64C4\u64C7\u64C2\u64CD\u64BF\u64D2\u64D4\u64BE\u6574\u66C6\u66C9\u66B9\u66C4\u66C7\u66B8\u6A3D\u6A38\u6A3A\u6A59\u6A6B\u6A58\u6A39\u6A44\u6A62\u6A61\u6A4B\u6A47\u6A35\u6A5F\u6A48\u6B59\u6B77\u6C05\u6FC2\u6FB1\u6FA1"], + ["bf40", "\u6FC3\u6FA4\u6FC1\u6FA7\u6FB3\u6FC0\u6FB9\u6FB6\u6FA6\u6FA0\u6FB4\u71BE\u71C9\u71D0\u71D2\u71C8\u71D5\u71B9\u71CE\u71D9\u71DC\u71C3\u71C4\u7368\u749C\u74A3\u7498\u749F\u749E\u74E2\u750C\u750D\u7634\u7638\u763A\u76E7\u76E5\u77A0\u779E\u779F\u77A5\u78E8\u78DA\u78EC\u78E7\u79A6\u7A4D\u7A4E\u7A46\u7A4C\u7A4B\u7ABA\u7BD9\u7C11\u7BC9\u7BE4\u7BDB\u7BE1\u7BE9\u7BE6\u7CD5\u7CD6\u7E0A"], + ["bfa1", "\u7E11\u7E08\u7E1B\u7E23\u7E1E\u7E1D\u7E09\u7E10\u7F79\u7FB2\u7FF0\u7FF1\u7FEE\u8028\u81B3\u81A9\u81A8\u81FB\u8208\u8258\u8259\u854A\u8559\u8548\u8568\u8569\u8543\u8549\u856D\u856A\u855E\u8783\u879F\u879E\u87A2\u878D\u8861\u892A\u8932\u8925\u892B\u8921\u89AA\u89A6\u8AE6\u8AFA\u8AEB\u8AF1\u8B00\u8ADC\u8AE7\u8AEE\u8AFE\u8B01\u8B02\u8AF7\u8AED\u8AF3\u8AF6\u8AFC\u8C6B\u8C6D\u8C93\u8CF4\u8E44\u8E31\u8E34\u8E42\u8E39\u8E35\u8F3B\u8F2F\u8F38\u8F33\u8FA8\u8FA6\u9075\u9074\u9078\u9072\u907C\u907A\u9134\u9192\u9320\u9336\u92F8\u9333\u932F\u9322\u92FC\u932B\u9304\u931A"], + ["c040", "\u9310\u9326\u9321\u9315\u932E\u9319\u95BB\u96A7\u96A8\u96AA\u96D5\u970E\u9711\u9716\u970D\u9713\u970F\u975B\u975C\u9766\u9798\u9830\u9838\u983B\u9837\u982D\u9839\u9824\u9910\u9928\u991E\u991B\u9921\u991A\u99ED\u99E2\u99F1\u9AB8\u9ABC\u9AFB\u9AED\u9B28\u9B91\u9D15\u9D23\u9D26\u9D28\u9D12\u9D1B\u9ED8\u9ED4\u9F8D\u9F9C\u512A\u511F\u5121\u5132\u52F5\u568E\u5680\u5690\u5685\u5687"], + ["c0a1", "\u568F\u58D5\u58D3\u58D1\u58CE\u5B30\u5B2A\u5B24\u5B7A\u5C37\u5C68\u5DBC\u5DBA\u5DBD\u5DB8\u5E6B\u5F4C\u5FBD\u61C9\u61C2\u61C7\u61E6\u61CB\u6232\u6234\u64CE\u64CA\u64D8\u64E0\u64F0\u64E6\u64EC\u64F1\u64E2\u64ED\u6582\u6583\u66D9\u66D6\u6A80\u6A94\u6A84\u6AA2\u6A9C\u6ADB\u6AA3\u6A7E\u6A97\u6A90\u6AA0\u6B5C\u6BAE\u6BDA\u6C08\u6FD8\u6FF1\u6FDF\u6FE0\u6FDB\u6FE4\u6FEB\u6FEF\u6F80\u6FEC\u6FE1\u6FE9\u6FD5\u6FEE\u6FF0\u71E7\u71DF\u71EE\u71E6\u71E5\u71ED\u71EC\u71F4\u71E0\u7235\u7246\u7370\u7372\u74A9\u74B0\u74A6\u74A8\u7646\u7642\u764C\u76EA\u77B3\u77AA\u77B0\u77AC"], + ["c140", "\u77A7\u77AD\u77EF\u78F7\u78FA\u78F4\u78EF\u7901\u79A7\u79AA\u7A57\u7ABF\u7C07\u7C0D\u7BFE\u7BF7\u7C0C\u7BE0\u7CE0\u7CDC\u7CDE\u7CE2\u7CDF\u7CD9\u7CDD\u7E2E\u7E3E\u7E46\u7E37\u7E32\u7E43\u7E2B\u7E3D\u7E31\u7E45\u7E41\u7E34\u7E39\u7E48\u7E35\u7E3F\u7E2F\u7F44\u7FF3\u7FFC\u8071\u8072\u8070\u806F\u8073\u81C6\u81C3\u81BA\u81C2\u81C0\u81BF\u81BD\u81C9\u81BE\u81E8\u8209\u8271\u85AA"], + ["c1a1", "\u8584\u857E\u859C\u8591\u8594\u85AF\u859B\u8587\u85A8\u858A\u8667\u87C0\u87D1\u87B3\u87D2\u87C6\u87AB\u87BB\u87BA\u87C8\u87CB\u893B\u8936\u8944\u8938\u893D\u89AC\u8B0E\u8B17\u8B19\u8B1B\u8B0A\u8B20\u8B1D\u8B04\u8B10\u8C41\u8C3F\u8C73\u8CFA\u8CFD\u8CFC\u8CF8\u8CFB\u8DA8\u8E49\u8E4B\u8E48\u8E4A\u8F44\u8F3E\u8F42\u8F45\u8F3F\u907F\u907D\u9084\u9081\u9082\u9080\u9139\u91A3\u919E\u919C\u934D\u9382\u9328\u9375\u934A\u9365\u934B\u9318\u937E\u936C\u935B\u9370\u935A\u9354\u95CA\u95CB\u95CC\u95C8\u95C6\u96B1\u96B8\u96D6\u971C\u971E\u97A0\u97D3\u9846\u98B6\u9935\u9A01"], + ["c240", "\u99FF\u9BAE\u9BAB\u9BAA\u9BAD\u9D3B\u9D3F\u9E8B\u9ECF\u9EDE\u9EDC\u9EDD\u9EDB\u9F3E\u9F4B\u53E2\u5695\u56AE\u58D9\u58D8\u5B38\u5F5D\u61E3\u6233\u64F4\u64F2\u64FE\u6506\u64FA\u64FB\u64F7\u65B7\u66DC\u6726\u6AB3\u6AAC\u6AC3\u6ABB\u6AB8\u6AC2\u6AAE\u6AAF\u6B5F\u6B78\u6BAF\u7009\u700B\u6FFE\u7006\u6FFA\u7011\u700F\u71FB\u71FC\u71FE\u71F8\u7377\u7375\u74A7\u74BF\u7515\u7656\u7658"], + ["c2a1", "\u7652\u77BD\u77BF\u77BB\u77BC\u790E\u79AE\u7A61\u7A62\u7A60\u7AC4\u7AC5\u7C2B\u7C27\u7C2A\u7C1E\u7C23\u7C21\u7CE7\u7E54\u7E55\u7E5E\u7E5A\u7E61\u7E52\u7E59\u7F48\u7FF9\u7FFB\u8077\u8076\u81CD\u81CF\u820A\u85CF\u85A9\u85CD\u85D0\u85C9\u85B0\u85BA\u85B9\u85A6\u87EF\u87EC\u87F2\u87E0\u8986\u89B2\u89F4\u8B28\u8B39\u8B2C\u8B2B\u8C50\u8D05\u8E59\u8E63\u8E66\u8E64\u8E5F\u8E55\u8EC0\u8F49\u8F4D\u9087\u9083\u9088\u91AB\u91AC\u91D0\u9394\u938A\u9396\u93A2\u93B3\u93AE\u93AC\u93B0\u9398\u939A\u9397\u95D4\u95D6\u95D0\u95D5\u96E2\u96DC\u96D9\u96DB\u96DE\u9724\u97A3\u97A6"], + ["c340", "\u97AD\u97F9\u984D\u984F\u984C\u984E\u9853\u98BA\u993E\u993F\u993D\u992E\u99A5\u9A0E\u9AC1\u9B03\u9B06\u9B4F\u9B4E\u9B4D\u9BCA\u9BC9\u9BFD\u9BC8\u9BC0\u9D51\u9D5D\u9D60\u9EE0\u9F15\u9F2C\u5133\u56A5\u58DE\u58DF\u58E2\u5BF5\u9F90\u5EEC\u61F2\u61F7\u61F6\u61F5\u6500\u650F\u66E0\u66DD\u6AE5\u6ADD\u6ADA\u6AD3\u701B\u701F\u7028\u701A\u701D\u7015\u7018\u7206\u720D\u7258\u72A2\u7378"], + ["c3a1", "\u737A\u74BD\u74CA\u74E3\u7587\u7586\u765F\u7661\u77C7\u7919\u79B1\u7A6B\u7A69\u7C3E\u7C3F\u7C38\u7C3D\u7C37\u7C40\u7E6B\u7E6D\u7E79\u7E69\u7E6A\u7F85\u7E73\u7FB6\u7FB9\u7FB8\u81D8\u85E9\u85DD\u85EA\u85D5\u85E4\u85E5\u85F7\u87FB\u8805\u880D\u87F9\u87FE\u8960\u895F\u8956\u895E\u8B41\u8B5C\u8B58\u8B49\u8B5A\u8B4E\u8B4F\u8B46\u8B59\u8D08\u8D0A\u8E7C\u8E72\u8E87\u8E76\u8E6C\u8E7A\u8E74\u8F54\u8F4E\u8FAD\u908A\u908B\u91B1\u91AE\u93E1\u93D1\u93DF\u93C3\u93C8\u93DC\u93DD\u93D6\u93E2\u93CD\u93D8\u93E4\u93D7\u93E8\u95DC\u96B4\u96E3\u972A\u9727\u9761\u97DC\u97FB\u985E"], + ["c440", "\u9858\u985B\u98BC\u9945\u9949\u9A16\u9A19\u9B0D\u9BE8\u9BE7\u9BD6\u9BDB\u9D89\u9D61\u9D72\u9D6A\u9D6C\u9E92\u9E97\u9E93\u9EB4\u52F8\u56A8\u56B7\u56B6\u56B4\u56BC\u58E4\u5B40\u5B43\u5B7D\u5BF6\u5DC9\u61F8\u61FA\u6518\u6514\u6519\u66E6\u6727\u6AEC\u703E\u7030\u7032\u7210\u737B\u74CF\u7662\u7665\u7926\u792A\u792C\u792B\u7AC7\u7AF6\u7C4C\u7C43\u7C4D\u7CEF\u7CF0\u8FAE\u7E7D\u7E7C"], + ["c4a1", "\u7E82\u7F4C\u8000\u81DA\u8266\u85FB\u85F9\u8611\u85FA\u8606\u860B\u8607\u860A\u8814\u8815\u8964\u89BA\u89F8\u8B70\u8B6C\u8B66\u8B6F\u8B5F\u8B6B\u8D0F\u8D0D\u8E89\u8E81\u8E85\u8E82\u91B4\u91CB\u9418\u9403\u93FD\u95E1\u9730\u98C4\u9952\u9951\u99A8\u9A2B\u9A30\u9A37\u9A35\u9C13\u9C0D\u9E79\u9EB5\u9EE8\u9F2F\u9F5F\u9F63\u9F61\u5137\u5138\u56C1\u56C0\u56C2\u5914\u5C6C\u5DCD\u61FC\u61FE\u651D\u651C\u6595\u66E9\u6AFB\u6B04\u6AFA\u6BB2\u704C\u721B\u72A7\u74D6\u74D4\u7669\u77D3\u7C50\u7E8F\u7E8C\u7FBC\u8617\u862D\u861A\u8823\u8822\u8821\u881F\u896A\u896C\u89BD\u8B74"], + ["c540", "\u8B77\u8B7D\u8D13\u8E8A\u8E8D\u8E8B\u8F5F\u8FAF\u91BA\u942E\u9433\u9435\u943A\u9438\u9432\u942B\u95E2\u9738\u9739\u9732\u97FF\u9867\u9865\u9957\u9A45\u9A43\u9A40\u9A3E\u9ACF\u9B54\u9B51\u9C2D\u9C25\u9DAF\u9DB4\u9DC2\u9DB8\u9E9D\u9EEF\u9F19\u9F5C\u9F66\u9F67\u513C\u513B\u56C8\u56CA\u56C9\u5B7F\u5DD4\u5DD2\u5F4E\u61FF\u6524\u6B0A\u6B61\u7051\u7058\u7380\u74E4\u758A\u766E\u766C"], + ["c5a1", "\u79B3\u7C60\u7C5F\u807E\u807D\u81DF\u8972\u896F\u89FC\u8B80\u8D16\u8D17\u8E91\u8E93\u8F61\u9148\u9444\u9451\u9452\u973D\u973E\u97C3\u97C1\u986B\u9955\u9A55\u9A4D\u9AD2\u9B1A\u9C49\u9C31\u9C3E\u9C3B\u9DD3\u9DD7\u9F34\u9F6C\u9F6A\u9F94\u56CC\u5DD6\u6200\u6523\u652B\u652A\u66EC\u6B10\u74DA\u7ACA\u7C64\u7C63\u7C65\u7E93\u7E96\u7E94\u81E2\u8638\u863F\u8831\u8B8A\u9090\u908F\u9463\u9460\u9464\u9768\u986F\u995C\u9A5A\u9A5B\u9A57\u9AD3\u9AD4\u9AD1\u9C54\u9C57\u9C56\u9DE5\u9E9F\u9EF4\u56D1\u58E9\u652C\u705E\u7671\u7672\u77D7\u7F50\u7F88\u8836\u8839\u8862\u8B93\u8B92"], + ["c640", "\u8B96\u8277\u8D1B\u91C0\u946A\u9742\u9748\u9744\u97C6\u9870\u9A5F\u9B22\u9B58\u9C5F\u9DF9\u9DFA\u9E7C\u9E7D\u9F07\u9F77\u9F72\u5EF3\u6B16\u7063\u7C6C\u7C6E\u883B\u89C0\u8EA1\u91C1\u9472\u9470\u9871\u995E\u9AD6\u9B23\u9ECC\u7064\u77DA\u8B9A\u9477\u97C9\u9A62\u9A65\u7E9C\u8B9C\u8EAA\u91C5\u947D\u947E\u947C\u9C77\u9C78\u9EF7\u8C54\u947F\u9E1A\u7228\u9A6A\u9B31\u9E1B\u9E1E\u7C72"], + ["c940", "\u4E42\u4E5C\u51F5\u531A\u5382\u4E07\u4E0C\u4E47\u4E8D\u56D7\uFA0C\u5C6E\u5F73\u4E0F\u5187\u4E0E\u4E2E\u4E93\u4EC2\u4EC9\u4EC8\u5198\u52FC\u536C\u53B9\u5720\u5903\u592C\u5C10\u5DFF\u65E1\u6BB3\u6BCC\u6C14\u723F\u4E31\u4E3C\u4EE8\u4EDC\u4EE9\u4EE1\u4EDD\u4EDA\u520C\u531C\u534C\u5722\u5723\u5917\u592F\u5B81\u5B84\u5C12\u5C3B\u5C74\u5C73\u5E04\u5E80\u5E82\u5FC9\u6209\u6250\u6C15"], + ["c9a1", "\u6C36\u6C43\u6C3F\u6C3B\u72AE\u72B0\u738A\u79B8\u808A\u961E\u4F0E\u4F18\u4F2C\u4EF5\u4F14\u4EF1\u4F00\u4EF7\u4F08\u4F1D\u4F02\u4F05\u4F22\u4F13\u4F04\u4EF4\u4F12\u51B1\u5213\u5209\u5210\u52A6\u5322\u531F\u534D\u538A\u5407\u56E1\u56DF\u572E\u572A\u5734\u593C\u5980\u597C\u5985\u597B\u597E\u5977\u597F\u5B56\u5C15\u5C25\u5C7C\u5C7A\u5C7B\u5C7E\u5DDF\u5E75\u5E84\u5F02\u5F1A\u5F74\u5FD5\u5FD4\u5FCF\u625C\u625E\u6264\u6261\u6266\u6262\u6259\u6260\u625A\u6265\u65EF\u65EE\u673E\u6739\u6738\u673B\u673A\u673F\u673C\u6733\u6C18\u6C46\u6C52\u6C5C\u6C4F\u6C4A\u6C54\u6C4B"], + ["ca40", "\u6C4C\u7071\u725E\u72B4\u72B5\u738E\u752A\u767F\u7A75\u7F51\u8278\u827C\u8280\u827D\u827F\u864D\u897E\u9099\u9097\u9098\u909B\u9094\u9622\u9624\u9620\u9623\u4F56\u4F3B\u4F62\u4F49\u4F53\u4F64\u4F3E\u4F67\u4F52\u4F5F\u4F41\u4F58\u4F2D\u4F33\u4F3F\u4F61\u518F\u51B9\u521C\u521E\u5221\u52AD\u52AE\u5309\u5363\u5372\u538E\u538F\u5430\u5437\u542A\u5454\u5445\u5419\u541C\u5425\u5418"], + ["caa1", "\u543D\u544F\u5441\u5428\u5424\u5447\u56EE\u56E7\u56E5\u5741\u5745\u574C\u5749\u574B\u5752\u5906\u5940\u59A6\u5998\u59A0\u5997\u598E\u59A2\u5990\u598F\u59A7\u59A1\u5B8E\u5B92\u5C28\u5C2A\u5C8D\u5C8F\u5C88\u5C8B\u5C89\u5C92\u5C8A\u5C86\u5C93\u5C95\u5DE0\u5E0A\u5E0E\u5E8B\u5E89\u5E8C\u5E88\u5E8D\u5F05\u5F1D\u5F78\u5F76\u5FD2\u5FD1\u5FD0\u5FED\u5FE8\u5FEE\u5FF3\u5FE1\u5FE4\u5FE3\u5FFA\u5FEF\u5FF7\u5FFB\u6000\u5FF4\u623A\u6283\u628C\u628E\u628F\u6294\u6287\u6271\u627B\u627A\u6270\u6281\u6288\u6277\u627D\u6272\u6274\u6537\u65F0\u65F4\u65F3\u65F2\u65F5\u6745\u6747"], + ["cb40", "\u6759\u6755\u674C\u6748\u675D\u674D\u675A\u674B\u6BD0\u6C19\u6C1A\u6C78\u6C67\u6C6B\u6C84\u6C8B\u6C8F\u6C71\u6C6F\u6C69\u6C9A\u6C6D\u6C87\u6C95\u6C9C\u6C66\u6C73\u6C65\u6C7B\u6C8E\u7074\u707A\u7263\u72BF\u72BD\u72C3\u72C6\u72C1\u72BA\u72C5\u7395\u7397\u7393\u7394\u7392\u753A\u7539\u7594\u7595\u7681\u793D\u8034\u8095\u8099\u8090\u8092\u809C\u8290\u828F\u8285\u828E\u8291\u8293"], + ["cba1", "\u828A\u8283\u8284\u8C78\u8FC9\u8FBF\u909F\u90A1\u90A5\u909E\u90A7\u90A0\u9630\u9628\u962F\u962D\u4E33\u4F98\u4F7C\u4F85\u4F7D\u4F80\u4F87\u4F76\u4F74\u4F89\u4F84\u4F77\u4F4C\u4F97\u4F6A\u4F9A\u4F79\u4F81\u4F78\u4F90\u4F9C\u4F94\u4F9E\u4F92\u4F82\u4F95\u4F6B\u4F6E\u519E\u51BC\u51BE\u5235\u5232\u5233\u5246\u5231\u52BC\u530A\u530B\u533C\u5392\u5394\u5487\u547F\u5481\u5491\u5482\u5488\u546B\u547A\u547E\u5465\u546C\u5474\u5466\u548D\u546F\u5461\u5460\u5498\u5463\u5467\u5464\u56F7\u56F9\u576F\u5772\u576D\u576B\u5771\u5770\u5776\u5780\u5775\u577B\u5773\u5774\u5762"], + ["cc40", "\u5768\u577D\u590C\u5945\u59B5\u59BA\u59CF\u59CE\u59B2\u59CC\u59C1\u59B6\u59BC\u59C3\u59D6\u59B1\u59BD\u59C0\u59C8\u59B4\u59C7\u5B62\u5B65\u5B93\u5B95\u5C44\u5C47\u5CAE\u5CA4\u5CA0\u5CB5\u5CAF\u5CA8\u5CAC\u5C9F\u5CA3\u5CAD\u5CA2\u5CAA\u5CA7\u5C9D\u5CA5\u5CB6\u5CB0\u5CA6\u5E17\u5E14\u5E19\u5F28\u5F22\u5F23\u5F24\u5F54\u5F82\u5F7E\u5F7D\u5FDE\u5FE5\u602D\u6026\u6019\u6032\u600B"], + ["cca1", "\u6034\u600A\u6017\u6033\u601A\u601E\u602C\u6022\u600D\u6010\u602E\u6013\u6011\u600C\u6009\u601C\u6214\u623D\u62AD\u62B4\u62D1\u62BE\u62AA\u62B6\u62CA\u62AE\u62B3\u62AF\u62BB\u62A9\u62B0\u62B8\u653D\u65A8\u65BB\u6609\u65FC\u6604\u6612\u6608\u65FB\u6603\u660B\u660D\u6605\u65FD\u6611\u6610\u66F6\u670A\u6785\u676C\u678E\u6792\u6776\u677B\u6798\u6786\u6784\u6774\u678D\u678C\u677A\u679F\u6791\u6799\u6783\u677D\u6781\u6778\u6779\u6794\u6B25\u6B80\u6B7E\u6BDE\u6C1D\u6C93\u6CEC\u6CEB\u6CEE\u6CD9\u6CB6\u6CD4\u6CAD\u6CE7\u6CB7\u6CD0\u6CC2\u6CBA\u6CC3\u6CC6\u6CED\u6CF2"], + ["cd40", "\u6CD2\u6CDD\u6CB4\u6C8A\u6C9D\u6C80\u6CDE\u6CC0\u6D30\u6CCD\u6CC7\u6CB0\u6CF9\u6CCF\u6CE9\u6CD1\u7094\u7098\u7085\u7093\u7086\u7084\u7091\u7096\u7082\u709A\u7083\u726A\u72D6\u72CB\u72D8\u72C9\u72DC\u72D2\u72D4\u72DA\u72CC\u72D1\u73A4\u73A1\u73AD\u73A6\u73A2\u73A0\u73AC\u739D\u74DD\u74E8\u753F\u7540\u753E\u758C\u7598\u76AF\u76F3\u76F1\u76F0\u76F5\u77F8\u77FC\u77F9\u77FB\u77FA"], + ["cda1", "\u77F7\u7942\u793F\u79C5\u7A78\u7A7B\u7AFB\u7C75\u7CFD\u8035\u808F\u80AE\u80A3\u80B8\u80B5\u80AD\u8220\u82A0\u82C0\u82AB\u829A\u8298\u829B\u82B5\u82A7\u82AE\u82BC\u829E\u82BA\u82B4\u82A8\u82A1\u82A9\u82C2\u82A4\u82C3\u82B6\u82A2\u8670\u866F\u866D\u866E\u8C56\u8FD2\u8FCB\u8FD3\u8FCD\u8FD6\u8FD5\u8FD7\u90B2\u90B4\u90AF\u90B3\u90B0\u9639\u963D\u963C\u963A\u9643\u4FCD\u4FC5\u4FD3\u4FB2\u4FC9\u4FCB\u4FC1\u4FD4\u4FDC\u4FD9\u4FBB\u4FB3\u4FDB\u4FC7\u4FD6\u4FBA\u4FC0\u4FB9\u4FEC\u5244\u5249\u52C0\u52C2\u533D\u537C\u5397\u5396\u5399\u5398\u54BA\u54A1\u54AD\u54A5\u54CF"], + ["ce40", "\u54C3\u830D\u54B7\u54AE\u54D6\u54B6\u54C5\u54C6\u54A0\u5470\u54BC\u54A2\u54BE\u5472\u54DE\u54B0\u57B5\u579E\u579F\u57A4\u578C\u5797\u579D\u579B\u5794\u5798\u578F\u5799\u57A5\u579A\u5795\u58F4\u590D\u5953\u59E1\u59DE\u59EE\u5A00\u59F1\u59DD\u59FA\u59FD\u59FC\u59F6\u59E4\u59F2\u59F7\u59DB\u59E9\u59F3\u59F5\u59E0\u59FE\u59F4\u59ED\u5BA8\u5C4C\u5CD0\u5CD8\u5CCC\u5CD7\u5CCB\u5CDB"], + ["cea1", "\u5CDE\u5CDA\u5CC9\u5CC7\u5CCA\u5CD6\u5CD3\u5CD4\u5CCF\u5CC8\u5CC6\u5CCE\u5CDF\u5CF8\u5DF9\u5E21\u5E22\u5E23\u5E20\u5E24\u5EB0\u5EA4\u5EA2\u5E9B\u5EA3\u5EA5\u5F07\u5F2E\u5F56\u5F86\u6037\u6039\u6054\u6072\u605E\u6045\u6053\u6047\u6049\u605B\u604C\u6040\u6042\u605F\u6024\u6044\u6058\u6066\u606E\u6242\u6243\u62CF\u630D\u630B\u62F5\u630E\u6303\u62EB\u62F9\u630F\u630C\u62F8\u62F6\u6300\u6313\u6314\u62FA\u6315\u62FB\u62F0\u6541\u6543\u65AA\u65BF\u6636\u6621\u6632\u6635\u661C\u6626\u6622\u6633\u662B\u663A\u661D\u6634\u6639\u662E\u670F\u6710\u67C1\u67F2\u67C8\u67BA"], + ["cf40", "\u67DC\u67BB\u67F8\u67D8\u67C0\u67B7\u67C5\u67EB\u67E4\u67DF\u67B5\u67CD\u67B3\u67F7\u67F6\u67EE\u67E3\u67C2\u67B9\u67CE\u67E7\u67F0\u67B2\u67FC\u67C6\u67ED\u67CC\u67AE\u67E6\u67DB\u67FA\u67C9\u67CA\u67C3\u67EA\u67CB\u6B28\u6B82\u6B84\u6BB6\u6BD6\u6BD8\u6BE0\u6C20\u6C21\u6D28\u6D34\u6D2D\u6D1F\u6D3C\u6D3F\u6D12\u6D0A\u6CDA\u6D33\u6D04\u6D19\u6D3A\u6D1A\u6D11\u6D00\u6D1D\u6D42"], + ["cfa1", "\u6D01\u6D18\u6D37\u6D03\u6D0F\u6D40\u6D07\u6D20\u6D2C\u6D08\u6D22\u6D09\u6D10\u70B7\u709F\u70BE\u70B1\u70B0\u70A1\u70B4\u70B5\u70A9\u7241\u7249\u724A\u726C\u7270\u7273\u726E\u72CA\u72E4\u72E8\u72EB\u72DF\u72EA\u72E6\u72E3\u7385\u73CC\u73C2\u73C8\u73C5\u73B9\u73B6\u73B5\u73B4\u73EB\u73BF\u73C7\u73BE\u73C3\u73C6\u73B8\u73CB\u74EC\u74EE\u752E\u7547\u7548\u75A7\u75AA\u7679\u76C4\u7708\u7703\u7704\u7705\u770A\u76F7\u76FB\u76FA\u77E7\u77E8\u7806\u7811\u7812\u7805\u7810\u780F\u780E\u7809\u7803\u7813\u794A\u794C\u794B\u7945\u7944\u79D5\u79CD\u79CF\u79D6\u79CE\u7A80"], + ["d040", "\u7A7E\u7AD1\u7B00\u7B01\u7C7A\u7C78\u7C79\u7C7F\u7C80\u7C81\u7D03\u7D08\u7D01\u7F58\u7F91\u7F8D\u7FBE\u8007\u800E\u800F\u8014\u8037\u80D8\u80C7\u80E0\u80D1\u80C8\u80C2\u80D0\u80C5\u80E3\u80D9\u80DC\u80CA\u80D5\u80C9\u80CF\u80D7\u80E6\u80CD\u81FF\u8221\u8294\u82D9\u82FE\u82F9\u8307\u82E8\u8300\u82D5\u833A\u82EB\u82D6\u82F4\u82EC\u82E1\u82F2\u82F5\u830C\u82FB\u82F6\u82F0\u82EA"], + ["d0a1", "\u82E4\u82E0\u82FA\u82F3\u82ED\u8677\u8674\u867C\u8673\u8841\u884E\u8867\u886A\u8869\u89D3\u8A04\u8A07\u8D72\u8FE3\u8FE1\u8FEE\u8FE0\u90F1\u90BD\u90BF\u90D5\u90C5\u90BE\u90C7\u90CB\u90C8\u91D4\u91D3\u9654\u964F\u9651\u9653\u964A\u964E\u501E\u5005\u5007\u5013\u5022\u5030\u501B\u4FF5\u4FF4\u5033\u5037\u502C\u4FF6\u4FF7\u5017\u501C\u5020\u5027\u5035\u502F\u5031\u500E\u515A\u5194\u5193\u51CA\u51C4\u51C5\u51C8\u51CE\u5261\u525A\u5252\u525E\u525F\u5255\u5262\u52CD\u530E\u539E\u5526\u54E2\u5517\u5512\u54E7\u54F3\u54E4\u551A\u54FF\u5504\u5508\u54EB\u5511\u5505\u54F1"], + ["d140", "\u550A\u54FB\u54F7\u54F8\u54E0\u550E\u5503\u550B\u5701\u5702\u57CC\u5832\u57D5\u57D2\u57BA\u57C6\u57BD\u57BC\u57B8\u57B6\u57BF\u57C7\u57D0\u57B9\u57C1\u590E\u594A\u5A19\u5A16\u5A2D\u5A2E\u5A15\u5A0F\u5A17\u5A0A\u5A1E\u5A33\u5B6C\u5BA7\u5BAD\u5BAC\u5C03\u5C56\u5C54\u5CEC\u5CFF\u5CEE\u5CF1\u5CF7\u5D00\u5CF9\u5E29\u5E28\u5EA8\u5EAE\u5EAA\u5EAC\u5F33\u5F30\u5F67\u605D\u605A\u6067"], + ["d1a1", "\u6041\u60A2\u6088\u6080\u6092\u6081\u609D\u6083\u6095\u609B\u6097\u6087\u609C\u608E\u6219\u6246\u62F2\u6310\u6356\u632C\u6344\u6345\u6336\u6343\u63E4\u6339\u634B\u634A\u633C\u6329\u6341\u6334\u6358\u6354\u6359\u632D\u6347\u6333\u635A\u6351\u6338\u6357\u6340\u6348\u654A\u6546\u65C6\u65C3\u65C4\u65C2\u664A\u665F\u6647\u6651\u6712\u6713\u681F\u681A\u6849\u6832\u6833\u683B\u684B\u684F\u6816\u6831\u681C\u6835\u682B\u682D\u682F\u684E\u6844\u6834\u681D\u6812\u6814\u6826\u6828\u682E\u684D\u683A\u6825\u6820\u6B2C\u6B2F\u6B2D\u6B31\u6B34\u6B6D\u8082\u6B88\u6BE6\u6BE4"], + ["d240", "\u6BE8\u6BE3\u6BE2\u6BE7\u6C25\u6D7A\u6D63\u6D64\u6D76\u6D0D\u6D61\u6D92\u6D58\u6D62\u6D6D\u6D6F\u6D91\u6D8D\u6DEF\u6D7F\u6D86\u6D5E\u6D67\u6D60\u6D97\u6D70\u6D7C\u6D5F\u6D82\u6D98\u6D2F\u6D68\u6D8B\u6D7E\u6D80\u6D84\u6D16\u6D83\u6D7B\u6D7D\u6D75\u6D90\u70DC\u70D3\u70D1\u70DD\u70CB\u7F39\u70E2\u70D7\u70D2\u70DE\u70E0\u70D4\u70CD\u70C5\u70C6\u70C7\u70DA\u70CE\u70E1\u7242\u7278"], + ["d2a1", "\u7277\u7276\u7300\u72FA\u72F4\u72FE\u72F6\u72F3\u72FB\u7301\u73D3\u73D9\u73E5\u73D6\u73BC\u73E7\u73E3\u73E9\u73DC\u73D2\u73DB\u73D4\u73DD\u73DA\u73D7\u73D8\u73E8\u74DE\u74DF\u74F4\u74F5\u7521\u755B\u755F\u75B0\u75C1\u75BB\u75C4\u75C0\u75BF\u75B6\u75BA\u768A\u76C9\u771D\u771B\u7710\u7713\u7712\u7723\u7711\u7715\u7719\u771A\u7722\u7727\u7823\u782C\u7822\u7835\u782F\u7828\u782E\u782B\u7821\u7829\u7833\u782A\u7831\u7954\u795B\u794F\u795C\u7953\u7952\u7951\u79EB\u79EC\u79E0\u79EE\u79ED\u79EA\u79DC\u79DE\u79DD\u7A86\u7A89\u7A85\u7A8B\u7A8C\u7A8A\u7A87\u7AD8\u7B10"], + ["d340", "\u7B04\u7B13\u7B05\u7B0F\u7B08\u7B0A\u7B0E\u7B09\u7B12\u7C84\u7C91\u7C8A\u7C8C\u7C88\u7C8D\u7C85\u7D1E\u7D1D\u7D11\u7D0E\u7D18\u7D16\u7D13\u7D1F\u7D12\u7D0F\u7D0C\u7F5C\u7F61\u7F5E\u7F60\u7F5D\u7F5B\u7F96\u7F92\u7FC3\u7FC2\u7FC0\u8016\u803E\u8039\u80FA\u80F2\u80F9\u80F5\u8101\u80FB\u8100\u8201\u822F\u8225\u8333\u832D\u8344\u8319\u8351\u8325\u8356\u833F\u8341\u8326\u831C\u8322"], + ["d3a1", "\u8342\u834E\u831B\u832A\u8308\u833C\u834D\u8316\u8324\u8320\u8337\u832F\u8329\u8347\u8345\u834C\u8353\u831E\u832C\u834B\u8327\u8348\u8653\u8652\u86A2\u86A8\u8696\u868D\u8691\u869E\u8687\u8697\u8686\u868B\u869A\u8685\u86A5\u8699\u86A1\u86A7\u8695\u8698\u868E\u869D\u8690\u8694\u8843\u8844\u886D\u8875\u8876\u8872\u8880\u8871\u887F\u886F\u8883\u887E\u8874\u887C\u8A12\u8C47\u8C57\u8C7B\u8CA4\u8CA3\u8D76\u8D78\u8DB5\u8DB7\u8DB6\u8ED1\u8ED3\u8FFE\u8FF5\u9002\u8FFF\u8FFB\u9004\u8FFC\u8FF6\u90D6\u90E0\u90D9\u90DA\u90E3\u90DF\u90E5\u90D8\u90DB\u90D7\u90DC\u90E4\u9150"], + ["d440", "\u914E\u914F\u91D5\u91E2\u91DA\u965C\u965F\u96BC\u98E3\u9ADF\u9B2F\u4E7F\u5070\u506A\u5061\u505E\u5060\u5053\u504B\u505D\u5072\u5048\u504D\u5041\u505B\u504A\u5062\u5015\u5045\u505F\u5069\u506B\u5063\u5064\u5046\u5040\u506E\u5073\u5057\u5051\u51D0\u526B\u526D\u526C\u526E\u52D6\u52D3\u532D\u539C\u5575\u5576\u553C\u554D\u5550\u5534\u552A\u5551\u5562\u5536\u5535\u5530\u5552\u5545"], + ["d4a1", "\u550C\u5532\u5565\u554E\u5539\u5548\u552D\u553B\u5540\u554B\u570A\u5707\u57FB\u5814\u57E2\u57F6\u57DC\u57F4\u5800\u57ED\u57FD\u5808\u57F8\u580B\u57F3\u57CF\u5807\u57EE\u57E3\u57F2\u57E5\u57EC\u57E1\u580E\u57FC\u5810\u57E7\u5801\u580C\u57F1\u57E9\u57F0\u580D\u5804\u595C\u5A60\u5A58\u5A55\u5A67\u5A5E\u5A38\u5A35\u5A6D\u5A50\u5A5F\u5A65\u5A6C\u5A53\u5A64\u5A57\u5A43\u5A5D\u5A52\u5A44\u5A5B\u5A48\u5A8E\u5A3E\u5A4D\u5A39\u5A4C\u5A70\u5A69\u5A47\u5A51\u5A56\u5A42\u5A5C\u5B72\u5B6E\u5BC1\u5BC0\u5C59\u5D1E\u5D0B\u5D1D\u5D1A\u5D20\u5D0C\u5D28\u5D0D\u5D26\u5D25\u5D0F"], + ["d540", "\u5D30\u5D12\u5D23\u5D1F\u5D2E\u5E3E\u5E34\u5EB1\u5EB4\u5EB9\u5EB2\u5EB3\u5F36\u5F38\u5F9B\u5F96\u5F9F\u608A\u6090\u6086\u60BE\u60B0\u60BA\u60D3\u60D4\u60CF\u60E4\u60D9\u60DD\u60C8\u60B1\u60DB\u60B7\u60CA\u60BF\u60C3\u60CD\u60C0\u6332\u6365\u638A\u6382\u637D\u63BD\u639E\u63AD\u639D\u6397\u63AB\u638E\u636F\u6387\u6390\u636E\u63AF\u6375\u639C\u636D\u63AE\u637C\u63A4\u633B\u639F"], + ["d5a1", "\u6378\u6385\u6381\u6391\u638D\u6370\u6553\u65CD\u6665\u6661\u665B\u6659\u665C\u6662\u6718\u6879\u6887\u6890\u689C\u686D\u686E\u68AE\u68AB\u6956\u686F\u68A3\u68AC\u68A9\u6875\u6874\u68B2\u688F\u6877\u6892\u687C\u686B\u6872\u68AA\u6880\u6871\u687E\u689B\u6896\u688B\u68A0\u6889\u68A4\u6878\u687B\u6891\u688C\u688A\u687D\u6B36\u6B33\u6B37\u6B38\u6B91\u6B8F\u6B8D\u6B8E\u6B8C\u6C2A\u6DC0\u6DAB\u6DB4\u6DB3\u6E74\u6DAC\u6DE9\u6DE2\u6DB7\u6DF6\u6DD4\u6E00\u6DC8\u6DE0\u6DDF\u6DD6\u6DBE\u6DE5\u6DDC\u6DDD\u6DDB\u6DF4\u6DCA\u6DBD\u6DED\u6DF0\u6DBA\u6DD5\u6DC2\u6DCF\u6DC9"], + ["d640", "\u6DD0\u6DF2\u6DD3\u6DFD\u6DD7\u6DCD\u6DE3\u6DBB\u70FA\u710D\u70F7\u7117\u70F4\u710C\u70F0\u7104\u70F3\u7110\u70FC\u70FF\u7106\u7113\u7100\u70F8\u70F6\u710B\u7102\u710E\u727E\u727B\u727C\u727F\u731D\u7317\u7307\u7311\u7318\u730A\u7308\u72FF\u730F\u731E\u7388\u73F6\u73F8\u73F5\u7404\u7401\u73FD\u7407\u7400\u73FA\u73FC\u73FF\u740C\u740B\u73F4\u7408\u7564\u7563\u75CE\u75D2\u75CF"], + ["d6a1", "\u75CB\u75CC\u75D1\u75D0\u768F\u7689\u76D3\u7739\u772F\u772D\u7731\u7732\u7734\u7733\u773D\u7725\u773B\u7735\u7848\u7852\u7849\u784D\u784A\u784C\u7826\u7845\u7850\u7964\u7967\u7969\u796A\u7963\u796B\u7961\u79BB\u79FA\u79F8\u79F6\u79F7\u7A8F\u7A94\u7A90\u7B35\u7B47\u7B34\u7B25\u7B30\u7B22\u7B24\u7B33\u7B18\u7B2A\u7B1D\u7B31\u7B2B\u7B2D\u7B2F\u7B32\u7B38\u7B1A\u7B23\u7C94\u7C98\u7C96\u7CA3\u7D35\u7D3D\u7D38\u7D36\u7D3A\u7D45\u7D2C\u7D29\u7D41\u7D47\u7D3E\u7D3F\u7D4A\u7D3B\u7D28\u7F63\u7F95\u7F9C\u7F9D\u7F9B\u7FCA\u7FCB\u7FCD\u7FD0\u7FD1\u7FC7\u7FCF\u7FC9\u801F"], + ["d740", "\u801E\u801B\u8047\u8043\u8048\u8118\u8125\u8119\u811B\u812D\u811F\u812C\u811E\u8121\u8115\u8127\u811D\u8122\u8211\u8238\u8233\u823A\u8234\u8232\u8274\u8390\u83A3\u83A8\u838D\u837A\u8373\u83A4\u8374\u838F\u8381\u8395\u8399\u8375\u8394\u83A9\u837D\u8383\u838C\u839D\u839B\u83AA\u838B\u837E\u83A5\u83AF\u8388\u8397\u83B0\u837F\u83A6\u8387\u83AE\u8376\u839A\u8659\u8656\u86BF\u86B7"], + ["d7a1", "\u86C2\u86C1\u86C5\u86BA\u86B0\u86C8\u86B9\u86B3\u86B8\u86CC\u86B4\u86BB\u86BC\u86C3\u86BD\u86BE\u8852\u8889\u8895\u88A8\u88A2\u88AA\u889A\u8891\u88A1\u889F\u8898\u88A7\u8899\u889B\u8897\u88A4\u88AC\u888C\u8893\u888E\u8982\u89D6\u89D9\u89D5\u8A30\u8A27\u8A2C\u8A1E\u8C39\u8C3B\u8C5C\u8C5D\u8C7D\u8CA5\u8D7D\u8D7B\u8D79\u8DBC\u8DC2\u8DB9\u8DBF\u8DC1\u8ED8\u8EDE\u8EDD\u8EDC\u8ED7\u8EE0\u8EE1\u9024\u900B\u9011\u901C\u900C\u9021\u90EF\u90EA\u90F0\u90F4\u90F2\u90F3\u90D4\u90EB\u90EC\u90E9\u9156\u9158\u915A\u9153\u9155\u91EC\u91F4\u91F1\u91F3\u91F8\u91E4\u91F9\u91EA"], + ["d840", "\u91EB\u91F7\u91E8\u91EE\u957A\u9586\u9588\u967C\u966D\u966B\u9671\u966F\u96BF\u976A\u9804\u98E5\u9997\u509B\u5095\u5094\u509E\u508B\u50A3\u5083\u508C\u508E\u509D\u5068\u509C\u5092\u5082\u5087\u515F\u51D4\u5312\u5311\u53A4\u53A7\u5591\u55A8\u55A5\u55AD\u5577\u5645\u55A2\u5593\u5588\u558F\u55B5\u5581\u55A3\u5592\u55A4\u557D\u558C\u55A6\u557F\u5595\u55A1\u558E\u570C\u5829\u5837"], + ["d8a1", "\u5819\u581E\u5827\u5823\u5828\u57F5\u5848\u5825\u581C\u581B\u5833\u583F\u5836\u582E\u5839\u5838\u582D\u582C\u583B\u5961\u5AAF\u5A94\u5A9F\u5A7A\u5AA2\u5A9E\u5A78\u5AA6\u5A7C\u5AA5\u5AAC\u5A95\u5AAE\u5A37\u5A84\u5A8A\u5A97\u5A83\u5A8B\u5AA9\u5A7B\u5A7D\u5A8C\u5A9C\u5A8F\u5A93\u5A9D\u5BEA\u5BCD\u5BCB\u5BD4\u5BD1\u5BCA\u5BCE\u5C0C\u5C30\u5D37\u5D43\u5D6B\u5D41\u5D4B\u5D3F\u5D35\u5D51\u5D4E\u5D55\u5D33\u5D3A\u5D52\u5D3D\u5D31\u5D59\u5D42\u5D39\u5D49\u5D38\u5D3C\u5D32\u5D36\u5D40\u5D45\u5E44\u5E41\u5F58\u5FA6\u5FA5\u5FAB\u60C9\u60B9\u60CC\u60E2\u60CE\u60C4\u6114"], + ["d940", "\u60F2\u610A\u6116\u6105\u60F5\u6113\u60F8\u60FC\u60FE\u60C1\u6103\u6118\u611D\u6110\u60FF\u6104\u610B\u624A\u6394\u63B1\u63B0\u63CE\u63E5\u63E8\u63EF\u63C3\u649D\u63F3\u63CA\u63E0\u63F6\u63D5\u63F2\u63F5\u6461\u63DF\u63BE\u63DD\u63DC\u63C4\u63D8\u63D3\u63C2\u63C7\u63CC\u63CB\u63C8\u63F0\u63D7\u63D9\u6532\u6567\u656A\u6564\u655C\u6568\u6565\u658C\u659D\u659E\u65AE\u65D0\u65D2"], + ["d9a1", "\u667C\u666C\u667B\u6680\u6671\u6679\u666A\u6672\u6701\u690C\u68D3\u6904\u68DC\u692A\u68EC\u68EA\u68F1\u690F\u68D6\u68F7\u68EB\u68E4\u68F6\u6913\u6910\u68F3\u68E1\u6907\u68CC\u6908\u6970\u68B4\u6911\u68EF\u68C6\u6914\u68F8\u68D0\u68FD\u68FC\u68E8\u690B\u690A\u6917\u68CE\u68C8\u68DD\u68DE\u68E6\u68F4\u68D1\u6906\u68D4\u68E9\u6915\u6925\u68C7\u6B39\u6B3B\u6B3F\u6B3C\u6B94\u6B97\u6B99\u6B95\u6BBD\u6BF0\u6BF2\u6BF3\u6C30\u6DFC\u6E46\u6E47\u6E1F\u6E49\u6E88\u6E3C\u6E3D\u6E45\u6E62\u6E2B\u6E3F\u6E41\u6E5D\u6E73\u6E1C\u6E33\u6E4B\u6E40\u6E51\u6E3B\u6E03\u6E2E\u6E5E"], + ["da40", "\u6E68\u6E5C\u6E61\u6E31\u6E28\u6E60\u6E71\u6E6B\u6E39\u6E22\u6E30\u6E53\u6E65\u6E27\u6E78\u6E64\u6E77\u6E55\u6E79\u6E52\u6E66\u6E35\u6E36\u6E5A\u7120\u711E\u712F\u70FB\u712E\u7131\u7123\u7125\u7122\u7132\u711F\u7128\u713A\u711B\u724B\u725A\u7288\u7289\u7286\u7285\u728B\u7312\u730B\u7330\u7322\u7331\u7333\u7327\u7332\u732D\u7326\u7323\u7335\u730C\u742E\u742C\u7430\u742B\u7416"], + ["daa1", "\u741A\u7421\u742D\u7431\u7424\u7423\u741D\u7429\u7420\u7432\u74FB\u752F\u756F\u756C\u75E7\u75DA\u75E1\u75E6\u75DD\u75DF\u75E4\u75D7\u7695\u7692\u76DA\u7746\u7747\u7744\u774D\u7745\u774A\u774E\u774B\u774C\u77DE\u77EC\u7860\u7864\u7865\u785C\u786D\u7871\u786A\u786E\u7870\u7869\u7868\u785E\u7862\u7974\u7973\u7972\u7970\u7A02\u7A0A\u7A03\u7A0C\u7A04\u7A99\u7AE6\u7AE4\u7B4A\u7B3B\u7B44\u7B48\u7B4C\u7B4E\u7B40\u7B58\u7B45\u7CA2\u7C9E\u7CA8\u7CA1\u7D58\u7D6F\u7D63\u7D53\u7D56\u7D67\u7D6A\u7D4F\u7D6D\u7D5C\u7D6B\u7D52\u7D54\u7D69\u7D51\u7D5F\u7D4E\u7F3E\u7F3F\u7F65"], + ["db40", "\u7F66\u7FA2\u7FA0\u7FA1\u7FD7\u8051\u804F\u8050\u80FE\u80D4\u8143\u814A\u8152\u814F\u8147\u813D\u814D\u813A\u81E6\u81EE\u81F7\u81F8\u81F9\u8204\u823C\u823D\u823F\u8275\u833B\u83CF\u83F9\u8423\u83C0\u83E8\u8412\u83E7\u83E4\u83FC\u83F6\u8410\u83C6\u83C8\u83EB\u83E3\u83BF\u8401\u83DD\u83E5\u83D8\u83FF\u83E1\u83CB\u83CE\u83D6\u83F5\u83C9\u8409\u840F\u83DE\u8411\u8406\u83C2\u83F3"], + ["dba1", "\u83D5\u83FA\u83C7\u83D1\u83EA\u8413\u83C3\u83EC\u83EE\u83C4\u83FB\u83D7\u83E2\u841B\u83DB\u83FE\u86D8\u86E2\u86E6\u86D3\u86E3\u86DA\u86EA\u86DD\u86EB\u86DC\u86EC\u86E9\u86D7\u86E8\u86D1\u8848\u8856\u8855\u88BA\u88D7\u88B9\u88B8\u88C0\u88BE\u88B6\u88BC\u88B7\u88BD\u88B2\u8901\u88C9\u8995\u8998\u8997\u89DD\u89DA\u89DB\u8A4E\u8A4D\u8A39\u8A59\u8A40\u8A57\u8A58\u8A44\u8A45\u8A52\u8A48\u8A51\u8A4A\u8A4C\u8A4F\u8C5F\u8C81\u8C80\u8CBA\u8CBE\u8CB0\u8CB9\u8CB5\u8D84\u8D80\u8D89\u8DD8\u8DD3\u8DCD\u8DC7\u8DD6\u8DDC\u8DCF\u8DD5\u8DD9\u8DC8\u8DD7\u8DC5\u8EEF\u8EF7\u8EFA"], + ["dc40", "\u8EF9\u8EE6\u8EEE\u8EE5\u8EF5\u8EE7\u8EE8\u8EF6\u8EEB\u8EF1\u8EEC\u8EF4\u8EE9\u902D\u9034\u902F\u9106\u912C\u9104\u90FF\u90FC\u9108\u90F9\u90FB\u9101\u9100\u9107\u9105\u9103\u9161\u9164\u915F\u9162\u9160\u9201\u920A\u9225\u9203\u921A\u9226\u920F\u920C\u9200\u9212\u91FF\u91FD\u9206\u9204\u9227\u9202\u921C\u9224\u9219\u9217\u9205\u9216\u957B\u958D\u958C\u9590\u9687\u967E\u9688"], + ["dca1", "\u9689\u9683\u9680\u96C2\u96C8\u96C3\u96F1\u96F0\u976C\u9770\u976E\u9807\u98A9\u98EB\u9CE6\u9EF9\u4E83\u4E84\u4EB6\u50BD\u50BF\u50C6\u50AE\u50C4\u50CA\u50B4\u50C8\u50C2\u50B0\u50C1\u50BA\u50B1\u50CB\u50C9\u50B6\u50B8\u51D7\u527A\u5278\u527B\u527C\u55C3\u55DB\u55CC\u55D0\u55CB\u55CA\u55DD\u55C0\u55D4\u55C4\u55E9\u55BF\u55D2\u558D\u55CF\u55D5\u55E2\u55D6\u55C8\u55F2\u55CD\u55D9\u55C2\u5714\u5853\u5868\u5864\u584F\u584D\u5849\u586F\u5855\u584E\u585D\u5859\u5865\u585B\u583D\u5863\u5871\u58FC\u5AC7\u5AC4\u5ACB\u5ABA\u5AB8\u5AB1\u5AB5\u5AB0\u5ABF\u5AC8\u5ABB\u5AC6"], + ["dd40", "\u5AB7\u5AC0\u5ACA\u5AB4\u5AB6\u5ACD\u5AB9\u5A90\u5BD6\u5BD8\u5BD9\u5C1F\u5C33\u5D71\u5D63\u5D4A\u5D65\u5D72\u5D6C\u5D5E\u5D68\u5D67\u5D62\u5DF0\u5E4F\u5E4E\u5E4A\u5E4D\u5E4B\u5EC5\u5ECC\u5EC6\u5ECB\u5EC7\u5F40\u5FAF\u5FAD\u60F7\u6149\u614A\u612B\u6145\u6136\u6132\u612E\u6146\u612F\u614F\u6129\u6140\u6220\u9168\u6223\u6225\u6224\u63C5\u63F1\u63EB\u6410\u6412\u6409\u6420\u6424"], + ["dda1", "\u6433\u6443\u641F\u6415\u6418\u6439\u6437\u6422\u6423\u640C\u6426\u6430\u6428\u6441\u6435\u642F\u640A\u641A\u6440\u6425\u6427\u640B\u63E7\u641B\u642E\u6421\u640E\u656F\u6592\u65D3\u6686\u668C\u6695\u6690\u668B\u668A\u6699\u6694\u6678\u6720\u6966\u695F\u6938\u694E\u6962\u6971\u693F\u6945\u696A\u6939\u6942\u6957\u6959\u697A\u6948\u6949\u6935\u696C\u6933\u693D\u6965\u68F0\u6978\u6934\u6969\u6940\u696F\u6944\u6976\u6958\u6941\u6974\u694C\u693B\u694B\u6937\u695C\u694F\u6951\u6932\u6952\u692F\u697B\u693C\u6B46\u6B45\u6B43\u6B42\u6B48\u6B41\u6B9B\uFA0D\u6BFB\u6BFC"], + ["de40", "\u6BF9\u6BF7\u6BF8\u6E9B\u6ED6\u6EC8\u6E8F\u6EC0\u6E9F\u6E93\u6E94\u6EA0\u6EB1\u6EB9\u6EC6\u6ED2\u6EBD\u6EC1\u6E9E\u6EC9\u6EB7\u6EB0\u6ECD\u6EA6\u6ECF\u6EB2\u6EBE\u6EC3\u6EDC\u6ED8\u6E99\u6E92\u6E8E\u6E8D\u6EA4\u6EA1\u6EBF\u6EB3\u6ED0\u6ECA\u6E97\u6EAE\u6EA3\u7147\u7154\u7152\u7163\u7160\u7141\u715D\u7162\u7172\u7178\u716A\u7161\u7142\u7158\u7143\u714B\u7170\u715F\u7150\u7153"], + ["dea1", "\u7144\u714D\u715A\u724F\u728D\u728C\u7291\u7290\u728E\u733C\u7342\u733B\u733A\u7340\u734A\u7349\u7444\u744A\u744B\u7452\u7451\u7457\u7440\u744F\u7450\u744E\u7442\u7446\u744D\u7454\u74E1\u74FF\u74FE\u74FD\u751D\u7579\u7577\u6983\u75EF\u760F\u7603\u75F7\u75FE\u75FC\u75F9\u75F8\u7610\u75FB\u75F6\u75ED\u75F5\u75FD\u7699\u76B5\u76DD\u7755\u775F\u7760\u7752\u7756\u775A\u7769\u7767\u7754\u7759\u776D\u77E0\u7887\u789A\u7894\u788F\u7884\u7895\u7885\u7886\u78A1\u7883\u7879\u7899\u7880\u7896\u787B\u797C\u7982\u797D\u7979\u7A11\u7A18\u7A19\u7A12\u7A17\u7A15\u7A22\u7A13"], + ["df40", "\u7A1B\u7A10\u7AA3\u7AA2\u7A9E\u7AEB\u7B66\u7B64\u7B6D\u7B74\u7B69\u7B72\u7B65\u7B73\u7B71\u7B70\u7B61\u7B78\u7B76\u7B63\u7CB2\u7CB4\u7CAF\u7D88\u7D86\u7D80\u7D8D\u7D7F\u7D85\u7D7A\u7D8E\u7D7B\u7D83\u7D7C\u7D8C\u7D94\u7D84\u7D7D\u7D92\u7F6D\u7F6B\u7F67\u7F68\u7F6C\u7FA6\u7FA5\u7FA7\u7FDB\u7FDC\u8021\u8164\u8160\u8177\u815C\u8169\u815B\u8162\u8172\u6721\u815E\u8176\u8167\u816F"], + ["dfa1", "\u8144\u8161\u821D\u8249\u8244\u8240\u8242\u8245\u84F1\u843F\u8456\u8476\u8479\u848F\u848D\u8465\u8451\u8440\u8486\u8467\u8430\u844D\u847D\u845A\u8459\u8474\u8473\u845D\u8507\u845E\u8437\u843A\u8434\u847A\u8443\u8478\u8432\u8445\u8429\u83D9\u844B\u842F\u8442\u842D\u845F\u8470\u8439\u844E\u844C\u8452\u846F\u84C5\u848E\u843B\u8447\u8436\u8433\u8468\u847E\u8444\u842B\u8460\u8454\u846E\u8450\u870B\u8704\u86F7\u870C\u86FA\u86D6\u86F5\u874D\u86F8\u870E\u8709\u8701\u86F6\u870D\u8705\u88D6\u88CB\u88CD\u88CE\u88DE\u88DB\u88DA\u88CC\u88D0\u8985\u899B\u89DF\u89E5\u89E4"], + ["e040", "\u89E1\u89E0\u89E2\u89DC\u89E6\u8A76\u8A86\u8A7F\u8A61\u8A3F\u8A77\u8A82\u8A84\u8A75\u8A83\u8A81\u8A74\u8A7A\u8C3C\u8C4B\u8C4A\u8C65\u8C64\u8C66\u8C86\u8C84\u8C85\u8CCC\u8D68\u8D69\u8D91\u8D8C\u8D8E\u8D8F\u8D8D\u8D93\u8D94\u8D90\u8D92\u8DF0\u8DE0\u8DEC\u8DF1\u8DEE\u8DD0\u8DE9\u8DE3\u8DE2\u8DE7\u8DF2\u8DEB\u8DF4\u8F06\u8EFF\u8F01\u8F00\u8F05\u8F07\u8F08\u8F02\u8F0B\u9052\u903F"], + ["e0a1", "\u9044\u9049\u903D\u9110\u910D\u910F\u9111\u9116\u9114\u910B\u910E\u916E\u916F\u9248\u9252\u9230\u923A\u9266\u9233\u9265\u925E\u9283\u922E\u924A\u9246\u926D\u926C\u924F\u9260\u9267\u926F\u9236\u9261\u9270\u9231\u9254\u9263\u9250\u9272\u924E\u9253\u924C\u9256\u9232\u959F\u959C\u959E\u959B\u9692\u9693\u9691\u9697\u96CE\u96FA\u96FD\u96F8\u96F5\u9773\u9777\u9778\u9772\u980F\u980D\u980E\u98AC\u98F6\u98F9\u99AF\u99B2\u99B0\u99B5\u9AAD\u9AAB\u9B5B\u9CEA\u9CED\u9CE7\u9E80\u9EFD\u50E6\u50D4\u50D7\u50E8\u50F3\u50DB\u50EA\u50DD\u50E4\u50D3\u50EC\u50F0\u50EF\u50E3\u50E0"], + ["e140", "\u51D8\u5280\u5281\u52E9\u52EB\u5330\u53AC\u5627\u5615\u560C\u5612\u55FC\u560F\u561C\u5601\u5613\u5602\u55FA\u561D\u5604\u55FF\u55F9\u5889\u587C\u5890\u5898\u5886\u5881\u587F\u5874\u588B\u587A\u5887\u5891\u588E\u5876\u5882\u5888\u587B\u5894\u588F\u58FE\u596B\u5ADC\u5AEE\u5AE5\u5AD5\u5AEA\u5ADA\u5AED\u5AEB\u5AF3\u5AE2\u5AE0\u5ADB\u5AEC\u5ADE\u5ADD\u5AD9\u5AE8\u5ADF\u5B77\u5BE0"], + ["e1a1", "\u5BE3\u5C63\u5D82\u5D80\u5D7D\u5D86\u5D7A\u5D81\u5D77\u5D8A\u5D89\u5D88\u5D7E\u5D7C\u5D8D\u5D79\u5D7F\u5E58\u5E59\u5E53\u5ED8\u5ED1\u5ED7\u5ECE\u5EDC\u5ED5\u5ED9\u5ED2\u5ED4\u5F44\u5F43\u5F6F\u5FB6\u612C\u6128\u6141\u615E\u6171\u6173\u6152\u6153\u6172\u616C\u6180\u6174\u6154\u617A\u615B\u6165\u613B\u616A\u6161\u6156\u6229\u6227\u622B\u642B\u644D\u645B\u645D\u6474\u6476\u6472\u6473\u647D\u6475\u6466\u64A6\u644E\u6482\u645E\u645C\u644B\u6453\u6460\u6450\u647F\u643F\u646C\u646B\u6459\u6465\u6477\u6573\u65A0\u66A1\u66A0\u669F\u6705\u6704\u6722\u69B1\u69B6\u69C9"], + ["e240", "\u69A0\u69CE\u6996\u69B0\u69AC\u69BC\u6991\u6999\u698E\u69A7\u698D\u69A9\u69BE\u69AF\u69BF\u69C4\u69BD\u69A4\u69D4\u69B9\u69CA\u699A\u69CF\u69B3\u6993\u69AA\u69A1\u699E\u69D9\u6997\u6990\u69C2\u69B5\u69A5\u69C6\u6B4A\u6B4D\u6B4B\u6B9E\u6B9F\u6BA0\u6BC3\u6BC4\u6BFE\u6ECE\u6EF5\u6EF1\u6F03\u6F25\u6EF8\u6F37\u6EFB\u6F2E\u6F09\u6F4E\u6F19\u6F1A\u6F27\u6F18\u6F3B\u6F12\u6EED\u6F0A"], + ["e2a1", "\u6F36\u6F73\u6EF9\u6EEE\u6F2D\u6F40\u6F30\u6F3C\u6F35\u6EEB\u6F07\u6F0E\u6F43\u6F05\u6EFD\u6EF6\u6F39\u6F1C\u6EFC\u6F3A\u6F1F\u6F0D\u6F1E\u6F08\u6F21\u7187\u7190\u7189\u7180\u7185\u7182\u718F\u717B\u7186\u7181\u7197\u7244\u7253\u7297\u7295\u7293\u7343\u734D\u7351\u734C\u7462\u7473\u7471\u7475\u7472\u7467\u746E\u7500\u7502\u7503\u757D\u7590\u7616\u7608\u760C\u7615\u7611\u760A\u7614\u76B8\u7781\u777C\u7785\u7782\u776E\u7780\u776F\u777E\u7783\u78B2\u78AA\u78B4\u78AD\u78A8\u787E\u78AB\u789E\u78A5\u78A0\u78AC\u78A2\u78A4\u7998\u798A\u798B\u7996\u7995\u7994\u7993"], + ["e340", "\u7997\u7988\u7992\u7990\u7A2B\u7A4A\u7A30\u7A2F\u7A28\u7A26\u7AA8\u7AAB\u7AAC\u7AEE\u7B88\u7B9C\u7B8A\u7B91\u7B90\u7B96\u7B8D\u7B8C\u7B9B\u7B8E\u7B85\u7B98\u5284\u7B99\u7BA4\u7B82\u7CBB\u7CBF\u7CBC\u7CBA\u7DA7\u7DB7\u7DC2\u7DA3\u7DAA\u7DC1\u7DC0\u7DC5\u7D9D\u7DCE\u7DC4\u7DC6\u7DCB\u7DCC\u7DAF\u7DB9\u7D96\u7DBC\u7D9F\u7DA6\u7DAE\u7DA9\u7DA1\u7DC9\u7F73\u7FE2\u7FE3\u7FE5\u7FDE"], + ["e3a1", "\u8024\u805D\u805C\u8189\u8186\u8183\u8187\u818D\u818C\u818B\u8215\u8497\u84A4\u84A1\u849F\u84BA\u84CE\u84C2\u84AC\u84AE\u84AB\u84B9\u84B4\u84C1\u84CD\u84AA\u849A\u84B1\u84D0\u849D\u84A7\u84BB\u84A2\u8494\u84C7\u84CC\u849B\u84A9\u84AF\u84A8\u84D6\u8498\u84B6\u84CF\u84A0\u84D7\u84D4\u84D2\u84DB\u84B0\u8491\u8661\u8733\u8723\u8728\u876B\u8740\u872E\u871E\u8721\u8719\u871B\u8743\u872C\u8741\u873E\u8746\u8720\u8732\u872A\u872D\u873C\u8712\u873A\u8731\u8735\u8742\u8726\u8727\u8738\u8724\u871A\u8730\u8711\u88F7\u88E7\u88F1\u88F2\u88FA\u88FE\u88EE\u88FC\u88F6\u88FB"], + ["e440", "\u88F0\u88EC\u88EB\u899D\u89A1\u899F\u899E\u89E9\u89EB\u89E8\u8AAB\u8A99\u8A8B\u8A92\u8A8F\u8A96\u8C3D\u8C68\u8C69\u8CD5\u8CCF\u8CD7\u8D96\u8E09\u8E02\u8DFF\u8E0D\u8DFD\u8E0A\u8E03\u8E07\u8E06\u8E05\u8DFE\u8E00\u8E04\u8F10\u8F11\u8F0E\u8F0D\u9123\u911C\u9120\u9122\u911F\u911D\u911A\u9124\u9121\u911B\u917A\u9172\u9179\u9173\u92A5\u92A4\u9276\u929B\u927A\u92A0\u9294\u92AA\u928D"], + ["e4a1", "\u92A6\u929A\u92AB\u9279\u9297\u927F\u92A3\u92EE\u928E\u9282\u9295\u92A2\u927D\u9288\u92A1\u928A\u9286\u928C\u9299\u92A7\u927E\u9287\u92A9\u929D\u928B\u922D\u969E\u96A1\u96FF\u9758\u977D\u977A\u977E\u9783\u9780\u9782\u977B\u9784\u9781\u977F\u97CE\u97CD\u9816\u98AD\u98AE\u9902\u9900\u9907\u999D\u999C\u99C3\u99B9\u99BB\u99BA\u99C2\u99BD\u99C7\u9AB1\u9AE3\u9AE7\u9B3E\u9B3F\u9B60\u9B61\u9B5F\u9CF1\u9CF2\u9CF5\u9EA7\u50FF\u5103\u5130\u50F8\u5106\u5107\u50F6\u50FE\u510B\u510C\u50FD\u510A\u528B\u528C\u52F1\u52EF\u5648\u5642\u564C\u5635\u5641\u564A\u5649\u5646\u5658"], + ["e540", "\u565A\u5640\u5633\u563D\u562C\u563E\u5638\u562A\u563A\u571A\u58AB\u589D\u58B1\u58A0\u58A3\u58AF\u58AC\u58A5\u58A1\u58FF\u5AFF\u5AF4\u5AFD\u5AF7\u5AF6\u5B03\u5AF8\u5B02\u5AF9\u5B01\u5B07\u5B05\u5B0F\u5C67\u5D99\u5D97\u5D9F\u5D92\u5DA2\u5D93\u5D95\u5DA0\u5D9C\u5DA1\u5D9A\u5D9E\u5E69\u5E5D\u5E60\u5E5C\u7DF3\u5EDB\u5EDE\u5EE1\u5F49\u5FB2\u618B\u6183\u6179\u61B1\u61B0\u61A2\u6189"], + ["e5a1", "\u619B\u6193\u61AF\u61AD\u619F\u6192\u61AA\u61A1\u618D\u6166\u61B3\u622D\u646E\u6470\u6496\u64A0\u6485\u6497\u649C\u648F\u648B\u648A\u648C\u64A3\u649F\u6468\u64B1\u6498\u6576\u657A\u6579\u657B\u65B2\u65B3\u66B5\u66B0\u66A9\u66B2\u66B7\u66AA\u66AF\u6A00\u6A06\u6A17\u69E5\u69F8\u6A15\u69F1\u69E4\u6A20\u69FF\u69EC\u69E2\u6A1B\u6A1D\u69FE\u6A27\u69F2\u69EE\u6A14\u69F7\u69E7\u6A40\u6A08\u69E6\u69FB\u6A0D\u69FC\u69EB\u6A09\u6A04\u6A18\u6A25\u6A0F\u69F6\u6A26\u6A07\u69F4\u6A16\u6B51\u6BA5\u6BA3\u6BA2\u6BA6\u6C01\u6C00\u6BFF\u6C02\u6F41\u6F26\u6F7E\u6F87\u6FC6\u6F92"], + ["e640", "\u6F8D\u6F89\u6F8C\u6F62\u6F4F\u6F85\u6F5A\u6F96\u6F76\u6F6C\u6F82\u6F55\u6F72\u6F52\u6F50\u6F57\u6F94\u6F93\u6F5D\u6F00\u6F61\u6F6B\u6F7D\u6F67\u6F90\u6F53\u6F8B\u6F69\u6F7F\u6F95\u6F63\u6F77\u6F6A\u6F7B\u71B2\u71AF\u719B\u71B0\u71A0\u719A\u71A9\u71B5\u719D\u71A5\u719E\u71A4\u71A1\u71AA\u719C\u71A7\u71B3\u7298\u729A\u7358\u7352\u735E\u735F\u7360\u735D\u735B\u7361\u735A\u7359"], + ["e6a1", "\u7362\u7487\u7489\u748A\u7486\u7481\u747D\u7485\u7488\u747C\u7479\u7508\u7507\u757E\u7625\u761E\u7619\u761D\u761C\u7623\u761A\u7628\u761B\u769C\u769D\u769E\u769B\u778D\u778F\u7789\u7788\u78CD\u78BB\u78CF\u78CC\u78D1\u78CE\u78D4\u78C8\u78C3\u78C4\u78C9\u799A\u79A1\u79A0\u799C\u79A2\u799B\u6B76\u7A39\u7AB2\u7AB4\u7AB3\u7BB7\u7BCB\u7BBE\u7BAC\u7BCE\u7BAF\u7BB9\u7BCA\u7BB5\u7CC5\u7CC8\u7CCC\u7CCB\u7DF7\u7DDB\u7DEA\u7DE7\u7DD7\u7DE1\u7E03\u7DFA\u7DE6\u7DF6\u7DF1\u7DF0\u7DEE\u7DDF\u7F76\u7FAC\u7FB0\u7FAD\u7FED\u7FEB\u7FEA\u7FEC\u7FE6\u7FE8\u8064\u8067\u81A3\u819F"], + ["e740", "\u819E\u8195\u81A2\u8199\u8197\u8216\u824F\u8253\u8252\u8250\u824E\u8251\u8524\u853B\u850F\u8500\u8529\u850E\u8509\u850D\u851F\u850A\u8527\u851C\u84FB\u852B\u84FA\u8508\u850C\u84F4\u852A\u84F2\u8515\u84F7\u84EB\u84F3\u84FC\u8512\u84EA\u84E9\u8516\u84FE\u8528\u851D\u852E\u8502\u84FD\u851E\u84F6\u8531\u8526\u84E7\u84E8\u84F0\u84EF\u84F9\u8518\u8520\u8530\u850B\u8519\u852F\u8662"], + ["e7a1", "\u8756\u8763\u8764\u8777\u87E1\u8773\u8758\u8754\u875B\u8752\u8761\u875A\u8751\u875E\u876D\u876A\u8750\u874E\u875F\u875D\u876F\u876C\u877A\u876E\u875C\u8765\u874F\u877B\u8775\u8762\u8767\u8769\u885A\u8905\u890C\u8914\u890B\u8917\u8918\u8919\u8906\u8916\u8911\u890E\u8909\u89A2\u89A4\u89A3\u89ED\u89F0\u89EC\u8ACF\u8AC6\u8AB8\u8AD3\u8AD1\u8AD4\u8AD5\u8ABB\u8AD7\u8ABE\u8AC0\u8AC5\u8AD8\u8AC3\u8ABA\u8ABD\u8AD9\u8C3E\u8C4D\u8C8F\u8CE5\u8CDF\u8CD9\u8CE8\u8CDA\u8CDD\u8CE7\u8DA0\u8D9C\u8DA1\u8D9B\u8E20\u8E23\u8E25\u8E24\u8E2E\u8E15\u8E1B\u8E16\u8E11\u8E19\u8E26\u8E27"], + ["e840", "\u8E14\u8E12\u8E18\u8E13\u8E1C\u8E17\u8E1A\u8F2C\u8F24\u8F18\u8F1A\u8F20\u8F23\u8F16\u8F17\u9073\u9070\u906F\u9067\u906B\u912F\u912B\u9129\u912A\u9132\u9126\u912E\u9185\u9186\u918A\u9181\u9182\u9184\u9180\u92D0\u92C3\u92C4\u92C0\u92D9\u92B6\u92CF\u92F1\u92DF\u92D8\u92E9\u92D7\u92DD\u92CC\u92EF\u92C2\u92E8\u92CA\u92C8\u92CE\u92E6\u92CD\u92D5\u92C9\u92E0\u92DE\u92E7\u92D1\u92D3"], + ["e8a1", "\u92B5\u92E1\u92C6\u92B4\u957C\u95AC\u95AB\u95AE\u95B0\u96A4\u96A2\u96D3\u9705\u9708\u9702\u975A\u978A\u978E\u9788\u97D0\u97CF\u981E\u981D\u9826\u9829\u9828\u9820\u981B\u9827\u98B2\u9908\u98FA\u9911\u9914\u9916\u9917\u9915\u99DC\u99CD\u99CF\u99D3\u99D4\u99CE\u99C9\u99D6\u99D8\u99CB\u99D7\u99CC\u9AB3\u9AEC\u9AEB\u9AF3\u9AF2\u9AF1\u9B46\u9B43\u9B67\u9B74\u9B71\u9B66\u9B76\u9B75\u9B70\u9B68\u9B64\u9B6C\u9CFC\u9CFA\u9CFD\u9CFF\u9CF7\u9D07\u9D00\u9CF9\u9CFB\u9D08\u9D05\u9D04\u9E83\u9ED3\u9F0F\u9F10\u511C\u5113\u5117\u511A\u5111\u51DE\u5334\u53E1\u5670\u5660\u566E"], + ["e940", "\u5673\u5666\u5663\u566D\u5672\u565E\u5677\u571C\u571B\u58C8\u58BD\u58C9\u58BF\u58BA\u58C2\u58BC\u58C6\u5B17\u5B19\u5B1B\u5B21\u5B14\u5B13\u5B10\u5B16\u5B28\u5B1A\u5B20\u5B1E\u5BEF\u5DAC\u5DB1\u5DA9\u5DA7\u5DB5\u5DB0\u5DAE\u5DAA\u5DA8\u5DB2\u5DAD\u5DAF\u5DB4\u5E67\u5E68\u5E66\u5E6F\u5EE9\u5EE7\u5EE6\u5EE8\u5EE5\u5F4B\u5FBC\u619D\u61A8\u6196\u61C5\u61B4\u61C6\u61C1\u61CC\u61BA"], + ["e9a1", "\u61BF\u61B8\u618C\u64D7\u64D6\u64D0\u64CF\u64C9\u64BD\u6489\u64C3\u64DB\u64F3\u64D9\u6533\u657F\u657C\u65A2\u66C8\u66BE\u66C0\u66CA\u66CB\u66CF\u66BD\u66BB\u66BA\u66CC\u6723\u6A34\u6A66\u6A49\u6A67\u6A32\u6A68\u6A3E\u6A5D\u6A6D\u6A76\u6A5B\u6A51\u6A28\u6A5A\u6A3B\u6A3F\u6A41\u6A6A\u6A64\u6A50\u6A4F\u6A54\u6A6F\u6A69\u6A60\u6A3C\u6A5E\u6A56\u6A55\u6A4D\u6A4E\u6A46\u6B55\u6B54\u6B56\u6BA7\u6BAA\u6BAB\u6BC8\u6BC7\u6C04\u6C03\u6C06\u6FAD\u6FCB\u6FA3\u6FC7\u6FBC\u6FCE\u6FC8\u6F5E\u6FC4\u6FBD\u6F9E\u6FCA\u6FA8\u7004\u6FA5\u6FAE\u6FBA\u6FAC\u6FAA\u6FCF\u6FBF\u6FB8"], + ["ea40", "\u6FA2\u6FC9\u6FAB\u6FCD\u6FAF\u6FB2\u6FB0\u71C5\u71C2\u71BF\u71B8\u71D6\u71C0\u71C1\u71CB\u71D4\u71CA\u71C7\u71CF\u71BD\u71D8\u71BC\u71C6\u71DA\u71DB\u729D\u729E\u7369\u7366\u7367\u736C\u7365\u736B\u736A\u747F\u749A\u74A0\u7494\u7492\u7495\u74A1\u750B\u7580\u762F\u762D\u7631\u763D\u7633\u763C\u7635\u7632\u7630\u76BB\u76E6\u779A\u779D\u77A1\u779C\u779B\u77A2\u77A3\u7795\u7799"], + ["eaa1", "\u7797\u78DD\u78E9\u78E5\u78EA\u78DE\u78E3\u78DB\u78E1\u78E2\u78ED\u78DF\u78E0\u79A4\u7A44\u7A48\u7A47\u7AB6\u7AB8\u7AB5\u7AB1\u7AB7\u7BDE\u7BE3\u7BE7\u7BDD\u7BD5\u7BE5\u7BDA\u7BE8\u7BF9\u7BD4\u7BEA\u7BE2\u7BDC\u7BEB\u7BD8\u7BDF\u7CD2\u7CD4\u7CD7\u7CD0\u7CD1\u7E12\u7E21\u7E17\u7E0C\u7E1F\u7E20\u7E13\u7E0E\u7E1C\u7E15\u7E1A\u7E22\u7E0B\u7E0F\u7E16\u7E0D\u7E14\u7E25\u7E24\u7F43\u7F7B\u7F7C\u7F7A\u7FB1\u7FEF\u802A\u8029\u806C\u81B1\u81A6\u81AE\u81B9\u81B5\u81AB\u81B0\u81AC\u81B4\u81B2\u81B7\u81A7\u81F2\u8255\u8256\u8257\u8556\u8545\u856B\u854D\u8553\u8561\u8558"], + ["eb40", "\u8540\u8546\u8564\u8541\u8562\u8544\u8551\u8547\u8563\u853E\u855B\u8571\u854E\u856E\u8575\u8555\u8567\u8560\u858C\u8566\u855D\u8554\u8565\u856C\u8663\u8665\u8664\u879B\u878F\u8797\u8793\u8792\u8788\u8781\u8796\u8798\u8779\u8787\u87A3\u8785\u8790\u8791\u879D\u8784\u8794\u879C\u879A\u8789\u891E\u8926\u8930\u892D\u892E\u8927\u8931\u8922\u8929\u8923\u892F\u892C\u891F\u89F1\u8AE0"], + ["eba1", "\u8AE2\u8AF2\u8AF4\u8AF5\u8ADD\u8B14\u8AE4\u8ADF\u8AF0\u8AC8\u8ADE\u8AE1\u8AE8\u8AFF\u8AEF\u8AFB\u8C91\u8C92\u8C90\u8CF5\u8CEE\u8CF1\u8CF0\u8CF3\u8D6C\u8D6E\u8DA5\u8DA7\u8E33\u8E3E\u8E38\u8E40\u8E45\u8E36\u8E3C\u8E3D\u8E41\u8E30\u8E3F\u8EBD\u8F36\u8F2E\u8F35\u8F32\u8F39\u8F37\u8F34\u9076\u9079\u907B\u9086\u90FA\u9133\u9135\u9136\u9193\u9190\u9191\u918D\u918F\u9327\u931E\u9308\u931F\u9306\u930F\u937A\u9338\u933C\u931B\u9323\u9312\u9301\u9346\u932D\u930E\u930D\u92CB\u931D\u92FA\u9325\u9313\u92F9\u92F7\u9334\u9302\u9324\u92FF\u9329\u9339\u9335\u932A\u9314\u930C"], + ["ec40", "\u930B\u92FE\u9309\u9300\u92FB\u9316\u95BC\u95CD\u95BE\u95B9\u95BA\u95B6\u95BF\u95B5\u95BD\u96A9\u96D4\u970B\u9712\u9710\u9799\u9797\u9794\u97F0\u97F8\u9835\u982F\u9832\u9924\u991F\u9927\u9929\u999E\u99EE\u99EC\u99E5\u99E4\u99F0\u99E3\u99EA\u99E9\u99E7\u9AB9\u9ABF\u9AB4\u9ABB\u9AF6\u9AFA\u9AF9\u9AF7\u9B33\u9B80\u9B85\u9B87\u9B7C\u9B7E\u9B7B\u9B82\u9B93\u9B92\u9B90\u9B7A\u9B95"], + ["eca1", "\u9B7D\u9B88\u9D25\u9D17\u9D20\u9D1E\u9D14\u9D29\u9D1D\u9D18\u9D22\u9D10\u9D19\u9D1F\u9E88\u9E86\u9E87\u9EAE\u9EAD\u9ED5\u9ED6\u9EFA\u9F12\u9F3D\u5126\u5125\u5122\u5124\u5120\u5129\u52F4\u5693\u568C\u568D\u5686\u5684\u5683\u567E\u5682\u567F\u5681\u58D6\u58D4\u58CF\u58D2\u5B2D\u5B25\u5B32\u5B23\u5B2C\u5B27\u5B26\u5B2F\u5B2E\u5B7B\u5BF1\u5BF2\u5DB7\u5E6C\u5E6A\u5FBE\u5FBB\u61C3\u61B5\u61BC\u61E7\u61E0\u61E5\u61E4\u61E8\u61DE\u64EF\u64E9\u64E3\u64EB\u64E4\u64E8\u6581\u6580\u65B6\u65DA\u66D2\u6A8D\u6A96\u6A81\u6AA5\u6A89\u6A9F\u6A9B\u6AA1\u6A9E\u6A87\u6A93\u6A8E"], + ["ed40", "\u6A95\u6A83\u6AA8\u6AA4\u6A91\u6A7F\u6AA6\u6A9A\u6A85\u6A8C\u6A92\u6B5B\u6BAD\u6C09\u6FCC\u6FA9\u6FF4\u6FD4\u6FE3\u6FDC\u6FED\u6FE7\u6FE6\u6FDE\u6FF2\u6FDD\u6FE2\u6FE8\u71E1\u71F1\u71E8\u71F2\u71E4\u71F0\u71E2\u7373\u736E\u736F\u7497\u74B2\u74AB\u7490\u74AA\u74AD\u74B1\u74A5\u74AF\u7510\u7511\u7512\u750F\u7584\u7643\u7648\u7649\u7647\u76A4\u76E9\u77B5\u77AB\u77B2\u77B7\u77B6"], + ["eda1", "\u77B4\u77B1\u77A8\u77F0\u78F3\u78FD\u7902\u78FB\u78FC\u78F2\u7905\u78F9\u78FE\u7904\u79AB\u79A8\u7A5C\u7A5B\u7A56\u7A58\u7A54\u7A5A\u7ABE\u7AC0\u7AC1\u7C05\u7C0F\u7BF2\u7C00\u7BFF\u7BFB\u7C0E\u7BF4\u7C0B\u7BF3\u7C02\u7C09\u7C03\u7C01\u7BF8\u7BFD\u7C06\u7BF0\u7BF1\u7C10\u7C0A\u7CE8\u7E2D\u7E3C\u7E42\u7E33\u9848\u7E38\u7E2A\u7E49\u7E40\u7E47\u7E29\u7E4C\u7E30\u7E3B\u7E36\u7E44\u7E3A\u7F45\u7F7F\u7F7E\u7F7D\u7FF4\u7FF2\u802C\u81BB\u81C4\u81CC\u81CA\u81C5\u81C7\u81BC\u81E9\u825B\u825A\u825C\u8583\u8580\u858F\u85A7\u8595\u85A0\u858B\u85A3\u857B\u85A4\u859A\u859E"], + ["ee40", "\u8577\u857C\u8589\u85A1\u857A\u8578\u8557\u858E\u8596\u8586\u858D\u8599\u859D\u8581\u85A2\u8582\u8588\u8585\u8579\u8576\u8598\u8590\u859F\u8668\u87BE\u87AA\u87AD\u87C5\u87B0\u87AC\u87B9\u87B5\u87BC\u87AE\u87C9\u87C3\u87C2\u87CC\u87B7\u87AF\u87C4\u87CA\u87B4\u87B6\u87BF\u87B8\u87BD\u87DE\u87B2\u8935\u8933\u893C\u893E\u8941\u8952\u8937\u8942\u89AD\u89AF\u89AE\u89F2\u89F3\u8B1E"], + ["eea1", "\u8B18\u8B16\u8B11\u8B05\u8B0B\u8B22\u8B0F\u8B12\u8B15\u8B07\u8B0D\u8B08\u8B06\u8B1C\u8B13\u8B1A\u8C4F\u8C70\u8C72\u8C71\u8C6F\u8C95\u8C94\u8CF9\u8D6F\u8E4E\u8E4D\u8E53\u8E50\u8E4C\u8E47\u8F43\u8F40\u9085\u907E\u9138\u919A\u91A2\u919B\u9199\u919F\u91A1\u919D\u91A0\u93A1\u9383\u93AF\u9364\u9356\u9347\u937C\u9358\u935C\u9376\u9349\u9350\u9351\u9360\u936D\u938F\u934C\u936A\u9379\u9357\u9355\u9352\u934F\u9371\u9377\u937B\u9361\u935E\u9363\u9367\u9380\u934E\u9359\u95C7\u95C0\u95C9\u95C3\u95C5\u95B7\u96AE\u96B0\u96AC\u9720\u971F\u9718\u971D\u9719\u979A\u97A1\u979C"], + ["ef40", "\u979E\u979D\u97D5\u97D4\u97F1\u9841\u9844\u984A\u9849\u9845\u9843\u9925\u992B\u992C\u992A\u9933\u9932\u992F\u992D\u9931\u9930\u9998\u99A3\u99A1\u9A02\u99FA\u99F4\u99F7\u99F9\u99F8\u99F6\u99FB\u99FD\u99FE\u99FC\u9A03\u9ABE\u9AFE\u9AFD\u9B01\u9AFC\u9B48\u9B9A\u9BA8\u9B9E\u9B9B\u9BA6\u9BA1\u9BA5\u9BA4\u9B86\u9BA2\u9BA0\u9BAF\u9D33\u9D41\u9D67\u9D36\u9D2E\u9D2F\u9D31\u9D38\u9D30"], + ["efa1", "\u9D45\u9D42\u9D43\u9D3E\u9D37\u9D40\u9D3D\u7FF5\u9D2D\u9E8A\u9E89\u9E8D\u9EB0\u9EC8\u9EDA\u9EFB\u9EFF\u9F24\u9F23\u9F22\u9F54\u9FA0\u5131\u512D\u512E\u5698\u569C\u5697\u569A\u569D\u5699\u5970\u5B3C\u5C69\u5C6A\u5DC0\u5E6D\u5E6E\u61D8\u61DF\u61ED\u61EE\u61F1\u61EA\u61F0\u61EB\u61D6\u61E9\u64FF\u6504\u64FD\u64F8\u6501\u6503\u64FC\u6594\u65DB\u66DA\u66DB\u66D8\u6AC5\u6AB9\u6ABD\u6AE1\u6AC6\u6ABA\u6AB6\u6AB7\u6AC7\u6AB4\u6AAD\u6B5E\u6BC9\u6C0B\u7007\u700C\u700D\u7001\u7005\u7014\u700E\u6FFF\u7000\u6FFB\u7026\u6FFC\u6FF7\u700A\u7201\u71FF\u71F9\u7203\u71FD\u7376"], + ["f040", "\u74B8\u74C0\u74B5\u74C1\u74BE\u74B6\u74BB\u74C2\u7514\u7513\u765C\u7664\u7659\u7650\u7653\u7657\u765A\u76A6\u76BD\u76EC\u77C2\u77BA\u78FF\u790C\u7913\u7914\u7909\u7910\u7912\u7911\u79AD\u79AC\u7A5F\u7C1C\u7C29\u7C19\u7C20\u7C1F\u7C2D\u7C1D\u7C26\u7C28\u7C22\u7C25\u7C30\u7E5C\u7E50\u7E56\u7E63\u7E58\u7E62\u7E5F\u7E51\u7E60\u7E57\u7E53\u7FB5\u7FB3\u7FF7\u7FF8\u8075\u81D1\u81D2"], + ["f0a1", "\u81D0\u825F\u825E\u85B4\u85C6\u85C0\u85C3\u85C2\u85B3\u85B5\u85BD\u85C7\u85C4\u85BF\u85CB\u85CE\u85C8\u85C5\u85B1\u85B6\u85D2\u8624\u85B8\u85B7\u85BE\u8669\u87E7\u87E6\u87E2\u87DB\u87EB\u87EA\u87E5\u87DF\u87F3\u87E4\u87D4\u87DC\u87D3\u87ED\u87D8\u87E3\u87A4\u87D7\u87D9\u8801\u87F4\u87E8\u87DD\u8953\u894B\u894F\u894C\u8946\u8950\u8951\u8949\u8B2A\u8B27\u8B23\u8B33\u8B30\u8B35\u8B47\u8B2F\u8B3C\u8B3E\u8B31\u8B25\u8B37\u8B26\u8B36\u8B2E\u8B24\u8B3B\u8B3D\u8B3A\u8C42\u8C75\u8C99\u8C98\u8C97\u8CFE\u8D04\u8D02\u8D00\u8E5C\u8E62\u8E60\u8E57\u8E56\u8E5E\u8E65\u8E67"], + ["f140", "\u8E5B\u8E5A\u8E61\u8E5D\u8E69\u8E54\u8F46\u8F47\u8F48\u8F4B\u9128\u913A\u913B\u913E\u91A8\u91A5\u91A7\u91AF\u91AA\u93B5\u938C\u9392\u93B7\u939B\u939D\u9389\u93A7\u938E\u93AA\u939E\u93A6\u9395\u9388\u9399\u939F\u938D\u93B1\u9391\u93B2\u93A4\u93A8\u93B4\u93A3\u93A5\u95D2\u95D3\u95D1\u96B3\u96D7\u96DA\u5DC2\u96DF\u96D8\u96DD\u9723\u9722\u9725\u97AC\u97AE\u97A8\u97AB\u97A4\u97AA"], + ["f1a1", "\u97A2\u97A5\u97D7\u97D9\u97D6\u97D8\u97FA\u9850\u9851\u9852\u98B8\u9941\u993C\u993A\u9A0F\u9A0B\u9A09\u9A0D\u9A04\u9A11\u9A0A\u9A05\u9A07\u9A06\u9AC0\u9ADC\u9B08\u9B04\u9B05\u9B29\u9B35\u9B4A\u9B4C\u9B4B\u9BC7\u9BC6\u9BC3\u9BBF\u9BC1\u9BB5\u9BB8\u9BD3\u9BB6\u9BC4\u9BB9\u9BBD\u9D5C\u9D53\u9D4F\u9D4A\u9D5B\u9D4B\u9D59\u9D56\u9D4C\u9D57\u9D52\u9D54\u9D5F\u9D58\u9D5A\u9E8E\u9E8C\u9EDF\u9F01\u9F00\u9F16\u9F25\u9F2B\u9F2A\u9F29\u9F28\u9F4C\u9F55\u5134\u5135\u5296\u52F7\u53B4\u56AB\u56AD\u56A6\u56A7\u56AA\u56AC\u58DA\u58DD\u58DB\u5912\u5B3D\u5B3E\u5B3F\u5DC3\u5E70"], + ["f240", "\u5FBF\u61FB\u6507\u6510\u650D\u6509\u650C\u650E\u6584\u65DE\u65DD\u66DE\u6AE7\u6AE0\u6ACC\u6AD1\u6AD9\u6ACB\u6ADF\u6ADC\u6AD0\u6AEB\u6ACF\u6ACD\u6ADE\u6B60\u6BB0\u6C0C\u7019\u7027\u7020\u7016\u702B\u7021\u7022\u7023\u7029\u7017\u7024\u701C\u702A\u720C\u720A\u7207\u7202\u7205\u72A5\u72A6\u72A4\u72A3\u72A1\u74CB\u74C5\u74B7\u74C3\u7516\u7660\u77C9\u77CA\u77C4\u77F1\u791D\u791B"], + ["f2a1", "\u7921\u791C\u7917\u791E\u79B0\u7A67\u7A68\u7C33\u7C3C\u7C39\u7C2C\u7C3B\u7CEC\u7CEA\u7E76\u7E75\u7E78\u7E70\u7E77\u7E6F\u7E7A\u7E72\u7E74\u7E68\u7F4B\u7F4A\u7F83\u7F86\u7FB7\u7FFD\u7FFE\u8078\u81D7\u81D5\u8264\u8261\u8263\u85EB\u85F1\u85ED\u85D9\u85E1\u85E8\u85DA\u85D7\u85EC\u85F2\u85F8\u85D8\u85DF\u85E3\u85DC\u85D1\u85F0\u85E6\u85EF\u85DE\u85E2\u8800\u87FA\u8803\u87F6\u87F7\u8809\u880C\u880B\u8806\u87FC\u8808\u87FF\u880A\u8802\u8962\u895A\u895B\u8957\u8961\u895C\u8958\u895D\u8959\u8988\u89B7\u89B6\u89F6\u8B50\u8B48\u8B4A\u8B40\u8B53\u8B56\u8B54\u8B4B\u8B55"], + ["f340", "\u8B51\u8B42\u8B52\u8B57\u8C43\u8C77\u8C76\u8C9A\u8D06\u8D07\u8D09\u8DAC\u8DAA\u8DAD\u8DAB\u8E6D\u8E78\u8E73\u8E6A\u8E6F\u8E7B\u8EC2\u8F52\u8F51\u8F4F\u8F50\u8F53\u8FB4\u9140\u913F\u91B0\u91AD\u93DE\u93C7\u93CF\u93C2\u93DA\u93D0\u93F9\u93EC\u93CC\u93D9\u93A9\u93E6\u93CA\u93D4\u93EE\u93E3\u93D5\u93C4\u93CE\u93C0\u93D2\u93E7\u957D\u95DA\u95DB\u96E1\u9729\u972B\u972C\u9728\u9726"], + ["f3a1", "\u97B3\u97B7\u97B6\u97DD\u97DE\u97DF\u985C\u9859\u985D\u9857\u98BF\u98BD\u98BB\u98BE\u9948\u9947\u9943\u99A6\u99A7\u9A1A\u9A15\u9A25\u9A1D\u9A24\u9A1B\u9A22\u9A20\u9A27\u9A23\u9A1E\u9A1C\u9A14\u9AC2\u9B0B\u9B0A\u9B0E\u9B0C\u9B37\u9BEA\u9BEB\u9BE0\u9BDE\u9BE4\u9BE6\u9BE2\u9BF0\u9BD4\u9BD7\u9BEC\u9BDC\u9BD9\u9BE5\u9BD5\u9BE1\u9BDA\u9D77\u9D81\u9D8A\u9D84\u9D88\u9D71\u9D80\u9D78\u9D86\u9D8B\u9D8C\u9D7D\u9D6B\u9D74\u9D75\u9D70\u9D69\u9D85\u9D73\u9D7B\u9D82\u9D6F\u9D79\u9D7F\u9D87\u9D68\u9E94\u9E91\u9EC0\u9EFC\u9F2D\u9F40\u9F41\u9F4D\u9F56\u9F57\u9F58\u5337\u56B2"], + ["f440", "\u56B5\u56B3\u58E3\u5B45\u5DC6\u5DC7\u5EEE\u5EEF\u5FC0\u5FC1\u61F9\u6517\u6516\u6515\u6513\u65DF\u66E8\u66E3\u66E4\u6AF3\u6AF0\u6AEA\u6AE8\u6AF9\u6AF1\u6AEE\u6AEF\u703C\u7035\u702F\u7037\u7034\u7031\u7042\u7038\u703F\u703A\u7039\u7040\u703B\u7033\u7041\u7213\u7214\u72A8\u737D\u737C\u74BA\u76AB\u76AA\u76BE\u76ED\u77CC\u77CE\u77CF\u77CD\u77F2\u7925\u7923\u7927\u7928\u7924\u7929"], + ["f4a1", "\u79B2\u7A6E\u7A6C\u7A6D\u7AF7\u7C49\u7C48\u7C4A\u7C47\u7C45\u7CEE\u7E7B\u7E7E\u7E81\u7E80\u7FBA\u7FFF\u8079\u81DB\u81D9\u820B\u8268\u8269\u8622\u85FF\u8601\u85FE\u861B\u8600\u85F6\u8604\u8609\u8605\u860C\u85FD\u8819\u8810\u8811\u8817\u8813\u8816\u8963\u8966\u89B9\u89F7\u8B60\u8B6A\u8B5D\u8B68\u8B63\u8B65\u8B67\u8B6D\u8DAE\u8E86\u8E88\u8E84\u8F59\u8F56\u8F57\u8F55\u8F58\u8F5A\u908D\u9143\u9141\u91B7\u91B5\u91B2\u91B3\u940B\u9413\u93FB\u9420\u940F\u9414\u93FE\u9415\u9410\u9428\u9419\u940D\u93F5\u9400\u93F7\u9407\u940E\u9416\u9412\u93FA\u9409\u93F8\u940A\u93FF"], + ["f540", "\u93FC\u940C\u93F6\u9411\u9406\u95DE\u95E0\u95DF\u972E\u972F\u97B9\u97BB\u97FD\u97FE\u9860\u9862\u9863\u985F\u98C1\u98C2\u9950\u994E\u9959\u994C\u994B\u9953\u9A32\u9A34\u9A31\u9A2C\u9A2A\u9A36\u9A29\u9A2E\u9A38\u9A2D\u9AC7\u9ACA\u9AC6\u9B10\u9B12\u9B11\u9C0B\u9C08\u9BF7\u9C05\u9C12\u9BF8\u9C40\u9C07\u9C0E\u9C06\u9C17\u9C14\u9C09\u9D9F\u9D99\u9DA4\u9D9D\u9D92\u9D98\u9D90\u9D9B"], + ["f5a1", "\u9DA0\u9D94\u9D9C\u9DAA\u9D97\u9DA1\u9D9A\u9DA2\u9DA8\u9D9E\u9DA3\u9DBF\u9DA9\u9D96\u9DA6\u9DA7\u9E99\u9E9B\u9E9A\u9EE5\u9EE4\u9EE7\u9EE6\u9F30\u9F2E\u9F5B\u9F60\u9F5E\u9F5D\u9F59\u9F91\u513A\u5139\u5298\u5297\u56C3\u56BD\u56BE\u5B48\u5B47\u5DCB\u5DCF\u5EF1\u61FD\u651B\u6B02\u6AFC\u6B03\u6AF8\u6B00\u7043\u7044\u704A\u7048\u7049\u7045\u7046\u721D\u721A\u7219\u737E\u7517\u766A\u77D0\u792D\u7931\u792F\u7C54\u7C53\u7CF2\u7E8A\u7E87\u7E88\u7E8B\u7E86\u7E8D\u7F4D\u7FBB\u8030\u81DD\u8618\u862A\u8626\u861F\u8623\u861C\u8619\u8627\u862E\u8621\u8620\u8629\u861E\u8625"], + ["f640", "\u8829\u881D\u881B\u8820\u8824\u881C\u882B\u884A\u896D\u8969\u896E\u896B\u89FA\u8B79\u8B78\u8B45\u8B7A\u8B7B\u8D10\u8D14\u8DAF\u8E8E\u8E8C\u8F5E\u8F5B\u8F5D\u9146\u9144\u9145\u91B9\u943F\u943B\u9436\u9429\u943D\u943C\u9430\u9439\u942A\u9437\u942C\u9440\u9431\u95E5\u95E4\u95E3\u9735\u973A\u97BF\u97E1\u9864\u98C9\u98C6\u98C0\u9958\u9956\u9A39\u9A3D\u9A46\u9A44\u9A42\u9A41\u9A3A"], + ["f6a1", "\u9A3F\u9ACD\u9B15\u9B17\u9B18\u9B16\u9B3A\u9B52\u9C2B\u9C1D\u9C1C\u9C2C\u9C23\u9C28\u9C29\u9C24\u9C21\u9DB7\u9DB6\u9DBC\u9DC1\u9DC7\u9DCA\u9DCF\u9DBE\u9DC5\u9DC3\u9DBB\u9DB5\u9DCE\u9DB9\u9DBA\u9DAC\u9DC8\u9DB1\u9DAD\u9DCC\u9DB3\u9DCD\u9DB2\u9E7A\u9E9C\u9EEB\u9EEE\u9EED\u9F1B\u9F18\u9F1A\u9F31\u9F4E\u9F65\u9F64\u9F92\u4EB9\u56C6\u56C5\u56CB\u5971\u5B4B\u5B4C\u5DD5\u5DD1\u5EF2\u6521\u6520\u6526\u6522\u6B0B\u6B08\u6B09\u6C0D\u7055\u7056\u7057\u7052\u721E\u721F\u72A9\u737F\u74D8\u74D5\u74D9\u74D7\u766D\u76AD\u7935\u79B4\u7A70\u7A71\u7C57\u7C5C\u7C59\u7C5B\u7C5A"], + ["f740", "\u7CF4\u7CF1\u7E91\u7F4F\u7F87\u81DE\u826B\u8634\u8635\u8633\u862C\u8632\u8636\u882C\u8828\u8826\u882A\u8825\u8971\u89BF\u89BE\u89FB\u8B7E\u8B84\u8B82\u8B86\u8B85\u8B7F\u8D15\u8E95\u8E94\u8E9A\u8E92\u8E90\u8E96\u8E97\u8F60\u8F62\u9147\u944C\u9450\u944A\u944B\u944F\u9447\u9445\u9448\u9449\u9446\u973F\u97E3\u986A\u9869\u98CB\u9954\u995B\u9A4E\u9A53\u9A54\u9A4C\u9A4F\u9A48\u9A4A"], + ["f7a1", "\u9A49\u9A52\u9A50\u9AD0\u9B19\u9B2B\u9B3B\u9B56\u9B55\u9C46\u9C48\u9C3F\u9C44\u9C39\u9C33\u9C41\u9C3C\u9C37\u9C34\u9C32\u9C3D\u9C36\u9DDB\u9DD2\u9DDE\u9DDA\u9DCB\u9DD0\u9DDC\u9DD1\u9DDF\u9DE9\u9DD9\u9DD8\u9DD6\u9DF5\u9DD5\u9DDD\u9EB6\u9EF0\u9F35\u9F33\u9F32\u9F42\u9F6B\u9F95\u9FA2\u513D\u5299\u58E8\u58E7\u5972\u5B4D\u5DD8\u882F\u5F4F\u6201\u6203\u6204\u6529\u6525\u6596\u66EB\u6B11\u6B12\u6B0F\u6BCA\u705B\u705A\u7222\u7382\u7381\u7383\u7670\u77D4\u7C67\u7C66\u7E95\u826C\u863A\u8640\u8639\u863C\u8631\u863B\u863E\u8830\u8832\u882E\u8833\u8976\u8974\u8973\u89FE"], + ["f840", "\u8B8C\u8B8E\u8B8B\u8B88\u8C45\u8D19\u8E98\u8F64\u8F63\u91BC\u9462\u9455\u945D\u9457\u945E\u97C4\u97C5\u9800\u9A56\u9A59\u9B1E\u9B1F\u9B20\u9C52\u9C58\u9C50\u9C4A\u9C4D\u9C4B\u9C55\u9C59\u9C4C\u9C4E\u9DFB\u9DF7\u9DEF\u9DE3\u9DEB\u9DF8\u9DE4\u9DF6\u9DE1\u9DEE\u9DE6\u9DF2\u9DF0\u9DE2\u9DEC\u9DF4\u9DF3\u9DE8\u9DED\u9EC2\u9ED0\u9EF2\u9EF3\u9F06\u9F1C\u9F38\u9F37\u9F36\u9F43\u9F4F"], + ["f8a1", "\u9F71\u9F70\u9F6E\u9F6F\u56D3\u56CD\u5B4E\u5C6D\u652D\u66ED\u66EE\u6B13\u705F\u7061\u705D\u7060\u7223\u74DB\u74E5\u77D5\u7938\u79B7\u79B6\u7C6A\u7E97\u7F89\u826D\u8643\u8838\u8837\u8835\u884B\u8B94\u8B95\u8E9E\u8E9F\u8EA0\u8E9D\u91BE\u91BD\u91C2\u946B\u9468\u9469\u96E5\u9746\u9743\u9747\u97C7\u97E5\u9A5E\u9AD5\u9B59\u9C63\u9C67\u9C66\u9C62\u9C5E\u9C60\u9E02\u9DFE\u9E07\u9E03\u9E06\u9E05\u9E00\u9E01\u9E09\u9DFF\u9DFD\u9E04\u9EA0\u9F1E\u9F46\u9F74\u9F75\u9F76\u56D4\u652E\u65B8\u6B18\u6B19\u6B17\u6B1A\u7062\u7226\u72AA\u77D8\u77D9\u7939\u7C69\u7C6B\u7CF6\u7E9A"], + ["f940", "\u7E98\u7E9B\u7E99\u81E0\u81E1\u8646\u8647\u8648\u8979\u897A\u897C\u897B\u89FF\u8B98\u8B99\u8EA5\u8EA4\u8EA3\u946E\u946D\u946F\u9471\u9473\u9749\u9872\u995F\u9C68\u9C6E\u9C6D\u9E0B\u9E0D\u9E10\u9E0F\u9E12\u9E11\u9EA1\u9EF5\u9F09\u9F47\u9F78\u9F7B\u9F7A\u9F79\u571E\u7066\u7C6F\u883C\u8DB2\u8EA6\u91C3\u9474\u9478\u9476\u9475\u9A60\u9C74\u9C73\u9C71\u9C75\u9E14\u9E13\u9EF6\u9F0A"], + ["f9a1", "\u9FA4\u7068\u7065\u7CF7\u866A\u883E\u883D\u883F\u8B9E\u8C9C\u8EA9\u8EC9\u974B\u9873\u9874\u98CC\u9961\u99AB\u9A64\u9A66\u9A67\u9B24\u9E15\u9E17\u9F48\u6207\u6B1E\u7227\u864C\u8EA8\u9482\u9480\u9481\u9A69\u9A68\u9B2E\u9E19\u7229\u864B\u8B9F\u9483\u9C79\u9EB7\u7675\u9A6B\u9C7A\u9E1D\u7069\u706A\u9EA4\u9F7E\u9F49\u9F98\u7881\u92B9\u88CF\u58BB\u6052\u7CA7\u5AFA\u2554\u2566\u2557\u2560\u256C\u2563\u255A\u2569\u255D\u2552\u2564\u2555\u255E\u256A\u2561\u2558\u2567\u255B\u2553\u2565\u2556\u255F\u256B\u2562\u2559\u2568\u255C\u2551\u2550\u256D\u256E\u2570\u256F\u2593"] + ]; + } +}); + +// node_modules/iconv-lite/encodings/tables/big5-added.json +var require_big5_added = __commonJS({ + "node_modules/iconv-lite/encodings/tables/big5-added.json"(exports2, module2) { + module2.exports = [ + ["8740", "\u43F0\u4C32\u4603\u45A6\u4578\u{27267}\u4D77\u45B3\u{27CB1}\u4CE2\u{27CC5}\u3B95\u4736\u4744\u4C47\u4C40\u{242BF}\u{23617}\u{27352}\u{26E8B}\u{270D2}\u4C57\u{2A351}\u474F\u45DA\u4C85\u{27C6C}\u4D07\u4AA4\u46A1\u{26B23}\u7225\u{25A54}\u{21A63}\u{23E06}\u{23F61}\u664D\u56FB"], + ["8767", "\u7D95\u591D\u{28BB9}\u3DF4\u9734\u{27BEF}\u5BDB\u{21D5E}\u5AA4\u3625\u{29EB0}\u5AD1\u5BB7\u5CFC\u676E\u8593\u{29945}\u7461\u749D\u3875\u{21D53}\u{2369E}\u{26021}\u3EEC"], + ["87a1", "\u{258DE}\u3AF5\u7AFC\u9F97\u{24161}\u{2890D}\u{231EA}\u{20A8A}\u{2325E}\u430A\u8484\u9F96\u942F\u4930\u8613\u5896\u974A\u9218\u79D0\u7A32\u6660\u6A29\u889D\u744C\u7BC5\u6782\u7A2C\u524F\u9046\u34E6\u73C4\u{25DB9}\u74C6\u9FC7\u57B3\u492F\u544C\u4131\u{2368E}\u5818\u7A72\u{27B65}\u8B8F\u46AE\u{26E88}\u4181\u{25D99}\u7BAE\u{224BC}\u9FC8\u{224C1}\u{224C9}\u{224CC}\u9FC9\u8504\u{235BB}\u40B4\u9FCA\u44E1\u{2ADFF}\u62C1\u706E\u9FCB"], + ["8840", "\u31C0", 4, "\u{2010C}\u31C5\u{200D1}\u{200CD}\u31C6\u31C7\u{200CB}\u{21FE8}\u31C8\u{200CA}\u31C9\u31CA\u31CB\u31CC\u{2010E}\u31CD\u31CE\u0100\xC1\u01CD\xC0\u0112\xC9\u011A\xC8\u014C\xD3\u01D1\xD2\u0FFF\xCA\u0304\u1EBE\u0FFF\xCA\u030C\u1EC0\xCA\u0101\xE1\u01CE\xE0\u0251\u0113\xE9\u011B\xE8\u012B\xED\u01D0\xEC\u014D\xF3\u01D2\xF2\u016B\xFA\u01D4\xF9\u01D6\u01D8\u01DA"], + ["88a1", "\u01DC\xFC\u0FFF\xEA\u0304\u1EBF\u0FFF\xEA\u030C\u1EC1\xEA\u0261\u23DA\u23DB"], + ["8940", "\u{2A3A9}\u{21145}"], + ["8943", "\u650A"], + ["8946", "\u4E3D\u6EDD\u9D4E\u91DF"], + ["894c", "\u{27735}\u6491\u4F1A\u4F28\u4FA8\u5156\u5174\u519C\u51E4\u52A1\u52A8\u533B\u534E\u53D1\u53D8\u56E2\u58F0\u5904\u5907\u5932\u5934\u5B66\u5B9E\u5B9F\u5C9A\u5E86\u603B\u6589\u67FE\u6804\u6865\u6D4E\u70BC\u7535\u7EA4\u7EAC\u7EBA\u7EC7\u7ECF\u7EDF\u7F06\u7F37\u827A\u82CF\u836F\u89C6\u8BBE\u8BE2\u8F66\u8F67\u8F6E"], + ["89a1", "\u7411\u7CFC\u7DCD\u6946\u7AC9\u5227"], + ["89ab", "\u918C\u78B8\u915E\u80BC"], + ["89b0", "\u8D0B\u80F6\u{209E7}"], + ["89b5", "\u809F\u9EC7\u4CCD\u9DC9\u9E0C\u4C3E\u{29DF6}\u{2700E}\u9E0A\u{2A133}\u35C1"], + ["89c1", "\u6E9A\u823E\u7519"], + ["89c5", "\u4911\u9A6C\u9A8F\u9F99\u7987\u{2846C}\u{21DCA}\u{205D0}\u{22AE6}\u4E24\u4E81\u4E80\u4E87\u4EBF\u4EEB\u4F37\u344C\u4FBD\u3E48\u5003\u5088\u347D\u3493\u34A5\u5186\u5905\u51DB\u51FC\u5205\u4E89\u5279\u5290\u5327\u35C7\u53A9\u3551\u53B0\u3553\u53C2\u5423\u356D\u3572\u3681\u5493\u54A3\u54B4\u54B9\u54D0\u54EF\u5518\u5523\u5528\u3598\u553F\u35A5\u35BF\u55D7\u35C5"], + ["8a40", "\u{27D84}\u5525"], + ["8a43", "\u{20C42}\u{20D15}\u{2512B}\u5590\u{22CC6}\u39EC\u{20341}\u8E46\u{24DB8}\u{294E5}\u4053\u{280BE}\u777A\u{22C38}\u3A34\u47D5\u{2815D}\u{269F2}\u{24DEA}\u64DD\u{20D7C}\u{20FB4}\u{20CD5}\u{210F4}\u648D\u8E7E\u{20E96}\u{20C0B}\u{20F64}\u{22CA9}\u{28256}\u{244D3}"], + ["8a64", "\u{20D46}\u{29A4D}\u{280E9}\u47F4\u{24EA7}\u{22CC2}\u9AB2\u3A67\u{295F4}\u3FED\u3506\u{252C7}\u{297D4}\u{278C8}\u{22D44}\u9D6E\u9815"], + ["8a76", "\u43D9\u{260A5}\u64B4\u54E3\u{22D4C}\u{22BCA}\u{21077}\u39FB\u{2106F}"], + ["8aa1", "\u{266DA}\u{26716}\u{279A0}\u64EA\u{25052}\u{20C43}\u8E68\u{221A1}\u{28B4C}\u{20731}"], + ["8aac", "\u480B\u{201A9}\u3FFA\u5873\u{22D8D}"], + ["8ab2", "\u{245C8}\u{204FC}\u{26097}\u{20F4C}\u{20D96}\u5579\u40BB\u43BA"], + ["8abb", "\u4AB4\u{22A66}\u{2109D}\u81AA\u98F5\u{20D9C}\u6379\u39FE\u{22775}\u8DC0\u56A1\u647C\u3E43"], + ["8ac9", "\u{2A601}\u{20E09}\u{22ACF}\u{22CC9}"], + ["8ace", "\u{210C8}\u{239C2}\u3992\u3A06\u{2829B}\u3578\u{25E49}\u{220C7}\u5652\u{20F31}\u{22CB2}\u{29720}\u34BC\u6C3D\u{24E3B}"], + ["8adf", "\u{27574}\u{22E8B}\u{22208}\u{2A65B}\u{28CCD}\u{20E7A}\u{20C34}\u{2681C}\u7F93\u{210CF}\u{22803}\u{22939}\u35FB\u{251E3}\u{20E8C}\u{20F8D}\u{20EAA}\u3F93\u{20F30}\u{20D47}\u{2114F}\u{20E4C}"], + ["8af6", "\u{20EAB}\u{20BA9}\u{20D48}\u{210C0}\u{2113D}\u3FF9\u{22696}\u6432\u{20FAD}"], + ["8b40", "\u{233F4}\u{27639}\u{22BCE}\u{20D7E}\u{20D7F}\u{22C51}\u{22C55}\u3A18\u{20E98}\u{210C7}\u{20F2E}\u{2A632}\u{26B50}\u{28CD2}\u{28D99}\u{28CCA}\u95AA\u54CC\u82C4\u55B9"], + ["8b55", "\u{29EC3}\u9C26\u9AB6\u{2775E}\u{22DEE}\u7140\u816D\u80EC\u5C1C\u{26572}\u8134\u3797\u535F\u{280BD}\u91B6\u{20EFA}\u{20E0F}\u{20E77}\u{20EFB}\u35DD\u{24DEB}\u3609\u{20CD6}\u56AF\u{227B5}\u{210C9}\u{20E10}\u{20E78}\u{21078}\u{21148}\u{28207}\u{21455}\u{20E79}\u{24E50}\u{22DA4}\u5A54\u{2101D}\u{2101E}\u{210F5}\u{210F6}\u579C\u{20E11}"], + ["8ba1", "\u{27694}\u{282CD}\u{20FB5}\u{20E7B}\u{2517E}\u3703\u{20FB6}\u{21180}\u{252D8}\u{2A2BD}\u{249DA}\u{2183A}\u{24177}\u{2827C}\u5899\u5268\u361A\u{2573D}\u7BB2\u5B68\u4800\u4B2C\u9F27\u49E7\u9C1F\u9B8D\u{25B74}\u{2313D}\u55FB\u35F2\u5689\u4E28\u5902\u{21BC1}\u{2F878}\u9751\u{20086}\u4E5B\u4EBB\u353E\u5C23\u5F51\u5FC4\u38FA\u624C\u6535\u6B7A\u6C35\u6C3A\u706C\u722B\u4E2C\u72AD\u{248E9}\u7F52\u793B\u7CF9\u7F53\u{2626A}\u34C1"], + ["8bde", "\u{2634B}\u8002\u8080\u{26612}\u{26951}\u535D\u8864\u89C1\u{278B2}\u8BA0\u8D1D\u9485\u9578\u957F\u95E8\u{28E0F}\u97E6\u9875\u98CE\u98DE\u9963\u{29810}\u9C7C\u9E1F\u9EC4\u6B6F\uF907\u4E37\u{20087}\u961D\u6237\u94A2"], + ["8c40", "\u503B\u6DFE\u{29C73}\u9FA6\u3DC9\u888F\u{2414E}\u7077\u5CF5\u4B20\u{251CD}\u3559\u{25D30}\u6122\u{28A32}\u8FA7\u91F6\u7191\u6719\u73BA\u{23281}\u{2A107}\u3C8B\u{21980}\u4B10\u78E4\u7402\u51AE\u{2870F}\u4009\u6A63\u{2A2BA}\u4223\u860F\u{20A6F}\u7A2A\u{29947}\u{28AEA}\u9755\u704D\u5324\u{2207E}\u93F4\u76D9\u{289E3}\u9FA7\u77DD\u4EA3\u4FF0\u50BC\u4E2F\u4F17\u9FA8\u5434\u7D8B\u5892\u58D0\u{21DB6}\u5E92\u5E99\u5FC2\u{22712}\u658B"], + ["8ca1", "\u{233F9}\u6919\u6A43\u{23C63}\u6CFF"], + ["8ca7", "\u7200\u{24505}\u738C\u3EDB\u{24A13}\u5B15\u74B9\u8B83\u{25CA4}\u{25695}\u7A93\u7BEC\u7CC3\u7E6C\u82F8\u8597\u9FA9\u8890\u9FAA\u8EB9\u9FAB\u8FCF\u855F\u99E0\u9221\u9FAC\u{28DB9}\u{2143F}\u4071\u42A2\u5A1A"], + ["8cc9", "\u9868\u676B\u4276\u573D"], + ["8cce", "\u85D6\u{2497B}\u82BF\u{2710D}\u4C81\u{26D74}\u5D7B\u{26B15}\u{26FBE}\u9FAD\u9FAE\u5B96\u9FAF\u66E7\u7E5B\u6E57\u79CA\u3D88\u44C3\u{23256}\u{22796}\u439A\u4536"], + ["8ce6", "\u5CD5\u{23B1A}\u8AF9\u5C78\u3D12\u{23551}\u5D78\u9FB2\u7157\u4558\u{240EC}\u{21E23}\u4C77\u3978\u344A\u{201A4}\u{26C41}\u8ACC\u4FB4\u{20239}\u59BF\u816C\u9856\u{298FA}\u5F3B"], + ["8d40", "\u{20B9F}"], + ["8d42", "\u{221C1}\u{2896D}\u4102\u46BB\u{29079}\u3F07\u9FB3\u{2A1B5}\u40F8\u37D6\u46F7\u{26C46}\u417C\u{286B2}\u{273FF}\u456D\u38D4\u{2549A}\u4561\u451B\u4D89\u4C7B\u4D76\u45EA\u3FC8\u{24B0F}\u3661\u44DE\u44BD\u41ED\u5D3E\u5D48\u5D56\u3DFC\u380F\u5DA4\u5DB9\u3820\u3838\u5E42\u5EBD\u5F25\u5F83\u3908\u3914\u393F\u394D\u60D7\u613D\u5CE5\u3989\u61B7\u61B9\u61CF\u39B8\u622C\u6290\u62E5\u6318\u39F8\u56B1"], + ["8da1", "\u3A03\u63E2\u63FB\u6407\u645A\u3A4B\u64C0\u5D15\u5621\u9F9F\u3A97\u6586\u3ABD\u65FF\u6653\u3AF2\u6692\u3B22\u6716\u3B42\u67A4\u6800\u3B58\u684A\u6884\u3B72\u3B71\u3B7B\u6909\u6943\u725C\u6964\u699F\u6985\u3BBC\u69D6\u3BDD\u6A65\u6A74\u6A71\u6A82\u3BEC\u6A99\u3BF2\u6AAB\u6AB5\u6AD4\u6AF6\u6B81\u6BC1\u6BEA\u6C75\u6CAA\u3CCB\u6D02\u6D06\u6D26\u6D81\u3CEF\u6DA4\u6DB1\u6E15\u6E18\u6E29\u6E86\u{289C0}\u6EBB\u6EE2\u6EDA\u9F7F\u6EE8\u6EE9\u6F24\u6F34\u3D46\u{23F41}\u6F81\u6FBE\u3D6A\u3D75\u71B7\u5C99\u3D8A\u702C\u3D91\u7050\u7054\u706F\u707F\u7089\u{20325}\u43C1\u35F1\u{20ED8}"], + ["8e40", "\u{23ED7}\u57BE\u{26ED3}\u713E\u{257E0}\u364E\u69A2\u{28BE9}\u5B74\u7A49\u{258E1}\u{294D9}\u7A65\u7A7D\u{259AC}\u7ABB\u7AB0\u7AC2\u7AC3\u71D1\u{2648D}\u41CA\u7ADA\u7ADD\u7AEA\u41EF\u54B2\u{25C01}\u7B0B\u7B55\u7B29\u{2530E}\u{25CFE}\u7BA2\u7B6F\u839C\u{25BB4}\u{26C7F}\u7BD0\u8421\u7B92\u7BB8\u{25D20}\u3DAD\u{25C65}\u8492\u7BFA\u7C06\u7C35\u{25CC1}\u7C44\u7C83\u{24882}\u7CA6\u667D\u{24578}\u7CC9\u7CC7\u7CE6\u7C74\u7CF3\u7CF5\u7CCE"], + ["8ea1", "\u7E67\u451D\u{26E44}\u7D5D\u{26ED6}\u748D\u7D89\u7DAB\u7135\u7DB3\u7DD2\u{24057}\u{26029}\u7DE4\u3D13\u7DF5\u{217F9}\u7DE5\u{2836D}\u7E1D\u{26121}\u{2615A}\u7E6E\u7E92\u432B\u946C\u7E27\u7F40\u7F41\u7F47\u7936\u{262D0}\u99E1\u7F97\u{26351}\u7FA3\u{21661}\u{20068}\u455C\u{23766}\u4503\u{2833A}\u7FFA\u{26489}\u8005\u8008\u801D\u8028\u802F\u{2A087}\u{26CC3}\u803B\u803C\u8061\u{22714}\u4989\u{26626}\u{23DE3}\u{266E8}\u6725\u80A7\u{28A48}\u8107\u811A\u58B0\u{226F6}\u6C7F\u{26498}\u{24FB8}\u64E7\u{2148A}\u8218\u{2185E}\u6A53\u{24A65}\u{24A95}\u447A\u8229\u{20B0D}\u{26A52}\u{23D7E}\u4FF9\u{214FD}\u84E2\u8362\u{26B0A}\u{249A7}\u{23530}\u{21773}\u{23DF8}\u82AA\u691B\u{2F994}\u41DB"], + ["8f40", "\u854B\u82D0\u831A\u{20E16}\u{217B4}\u36C1\u{2317D}\u{2355A}\u827B\u82E2\u8318\u{23E8B}\u{26DA3}\u{26B05}\u{26B97}\u{235CE}\u3DBF\u831D\u55EC\u8385\u450B\u{26DA5}\u83AC\u83C1\u83D3\u347E\u{26ED4}\u6A57\u855A\u3496\u{26E42}\u{22EEF}\u8458\u{25BE4}\u8471\u3DD3\u44E4\u6AA7\u844A\u{23CB5}\u7958\u84A8\u{26B96}\u{26E77}\u{26E43}\u84DE\u840F\u8391\u44A0\u8493\u84E4\u{25C91}\u4240\u{25CC0}\u4543\u8534\u5AF2\u{26E99}\u4527\u8573\u4516\u67BF\u8616"], + ["8fa1", "\u{28625}\u{2863B}\u85C1\u{27088}\u8602\u{21582}\u{270CD}\u{2F9B2}\u456A\u8628\u3648\u{218A2}\u53F7\u{2739A}\u867E\u8771\u{2A0F8}\u87EE\u{22C27}\u87B1\u87DA\u880F\u5661\u866C\u6856\u460F\u8845\u8846\u{275E0}\u{23DB9}\u{275E4}\u885E\u889C\u465B\u88B4\u88B5\u63C1\u88C5\u7777\u{2770F}\u8987\u898A\u89A6\u89A9\u89A7\u89BC\u{28A25}\u89E7\u{27924}\u{27ABD}\u8A9C\u7793\u91FE\u8A90\u{27A59}\u7AE9\u{27B3A}\u{23F8F}\u4713\u{27B38}\u717C\u8B0C\u8B1F\u{25430}\u{25565}\u8B3F\u8B4C\u8B4D\u8AA9\u{24A7A}\u8B90\u8B9B\u8AAF\u{216DF}\u4615\u884F\u8C9B\u{27D54}\u{27D8F}\u{2F9D4}\u3725\u{27D53}\u8CD6\u{27D98}\u{27DBD}\u8D12\u8D03\u{21910}\u8CDB\u705C\u8D11\u{24CC9}\u3ED0\u8D77"], + ["9040", "\u8DA9\u{28002}\u{21014}\u{2498A}\u3B7C\u{281BC}\u{2710C}\u7AE7\u8EAD\u8EB6\u8EC3\u92D4\u8F19\u8F2D\u{28365}\u{28412}\u8FA5\u9303\u{2A29F}\u{20A50}\u8FB3\u492A\u{289DE}\u{2853D}\u{23DBB}\u5EF8\u{23262}\u8FF9\u{2A014}\u{286BC}\u{28501}\u{22325}\u3980\u{26ED7}\u9037\u{2853C}\u{27ABE}\u9061\u{2856C}\u{2860B}\u90A8\u{28713}\u90C4\u{286E6}\u90AE\u90FD\u9167\u3AF0\u91A9\u91C4\u7CAC\u{28933}\u{21E89}\u920E\u6C9F\u9241\u9262\u{255B9}\u92B9\u{28AC6}\u{23C9B}\u{28B0C}\u{255DB}"], + ["90a1", "\u{20D31}\u932C\u936B\u{28AE1}\u{28BEB}\u708F\u5AC3\u{28AE2}\u{28AE5}\u4965\u9244\u{28BEC}\u{28C39}\u{28BFF}\u9373\u945B\u8EBC\u9585\u95A6\u9426\u95A0\u6FF6\u42B9\u{2267A}\u{286D8}\u{2127C}\u{23E2E}\u49DF\u6C1C\u967B\u9696\u416C\u96A3\u{26ED5}\u61DA\u96B6\u78F5\u{28AE0}\u96BD\u53CC\u49A1\u{26CB8}\u{20274}\u{26410}\u{290AF}\u{290E5}\u{24AD1}\u{21915}\u{2330A}\u9731\u8642\u9736\u4A0F\u453D\u4585\u{24AE9}\u7075\u5B41\u971B\u975C\u{291D5}\u9757\u5B4A\u{291EB}\u975F\u9425\u50D0\u{230B7}\u{230BC}\u9789\u979F\u97B1\u97BE\u97C0\u97D2\u97E0\u{2546C}\u97EE\u741C\u{29433}\u97FF\u97F5\u{2941D}\u{2797A}\u4AD1\u9834\u9833\u984B\u9866\u3B0E\u{27175}\u3D51\u{20630}\u{2415C}"], + ["9140", "\u{25706}\u98CA\u98B7\u98C8\u98C7\u4AFF\u{26D27}\u{216D3}\u55B0\u98E1\u98E6\u98EC\u9378\u9939\u{24A29}\u4B72\u{29857}\u{29905}\u99F5\u9A0C\u9A3B\u9A10\u9A58\u{25725}\u36C4\u{290B1}\u{29BD5}\u9AE0\u9AE2\u{29B05}\u9AF4\u4C0E\u9B14\u9B2D\u{28600}\u5034\u9B34\u{269A8}\u38C3\u{2307D}\u9B50\u9B40\u{29D3E}\u5A45\u{21863}\u9B8E\u{2424B}\u9C02\u9BFF\u9C0C\u{29E68}\u9DD4\u{29FB7}\u{2A192}\u{2A1AB}\u{2A0E1}\u{2A123}\u{2A1DF}\u9D7E\u9D83\u{2A134}\u9E0E\u6888"], + ["91a1", "\u9DC4\u{2215B}\u{2A193}\u{2A220}\u{2193B}\u{2A233}\u9D39\u{2A0B9}\u{2A2B4}\u9E90\u9E95\u9E9E\u9EA2\u4D34\u9EAA\u9EAF\u{24364}\u9EC1\u3B60\u39E5\u3D1D\u4F32\u37BE\u{28C2B}\u9F02\u9F08\u4B96\u9424\u{26DA2}\u9F17\u9F16\u9F39\u569F\u568A\u9F45\u99B8\u{2908B}\u97F2\u847F\u9F62\u9F69\u7ADC\u9F8E\u7216\u4BBE\u{24975}\u{249BB}\u7177\u{249F8}\u{24348}\u{24A51}\u739E\u{28BDA}\u{218FA}\u799F\u{2897E}\u{28E36}\u9369\u93F3\u{28A44}\u92EC\u9381\u93CB\u{2896C}\u{244B9}\u7217\u3EEB\u7772\u7A43\u70D0\u{24473}\u{243F8}\u717E\u{217EF}\u70A3\u{218BE}\u{23599}\u3EC7\u{21885}\u{2542F}\u{217F8}\u3722\u{216FB}\u{21839}\u36E1\u{21774}\u{218D1}\u{25F4B}\u3723\u{216C0}\u575B\u{24A25}\u{213FE}\u{212A8}"], + ["9240", "\u{213C6}\u{214B6}\u8503\u{236A6}\u8503\u8455\u{24994}\u{27165}\u{23E31}\u{2555C}\u{23EFB}\u{27052}\u44F4\u{236EE}\u{2999D}\u{26F26}\u67F9\u3733\u3C15\u3DE7\u586C\u{21922}\u6810\u4057\u{2373F}\u{240E1}\u{2408B}\u{2410F}\u{26C21}\u54CB\u569E\u{266B1}\u5692\u{20FDF}\u{20BA8}\u{20E0D}\u93C6\u{28B13}\u939C\u4EF8\u512B\u3819\u{24436}\u4EBC\u{20465}\u{2037F}\u4F4B\u4F8A\u{25651}\u5A68\u{201AB}\u{203CB}\u3999\u{2030A}\u{20414}\u3435\u4F29\u{202C0}\u{28EB3}\u{20275}\u8ADA\u{2020C}\u4E98"], + ["92a1", "\u50CD\u510D\u4FA2\u4F03\u{24A0E}\u{23E8A}\u4F42\u502E\u506C\u5081\u4FCC\u4FE5\u5058\u50FC\u5159\u515B\u515D\u515E\u6E76\u{23595}\u{23E39}\u{23EBF}\u6D72\u{21884}\u{23E89}\u51A8\u51C3\u{205E0}\u44DD\u{204A3}\u{20492}\u{20491}\u8D7A\u{28A9C}\u{2070E}\u5259\u52A4\u{20873}\u52E1\u936E\u467A\u718C\u{2438C}\u{20C20}\u{249AC}\u{210E4}\u69D1\u{20E1D}\u7479\u3EDE\u7499\u7414\u7456\u7398\u4B8E\u{24ABC}\u{2408D}\u53D0\u3584\u720F\u{240C9}\u55B4\u{20345}\u54CD\u{20BC6}\u571D\u925D\u96F4\u9366\u57DD\u578D\u577F\u363E\u58CB\u5A99\u{28A46}\u{216FA}\u{2176F}\u{21710}\u5A2C\u59B8\u928F\u5A7E\u5ACF\u5A12\u{25946}\u{219F3}\u{21861}\u{24295}\u36F5\u6D05\u7443\u5A21\u{25E83}"], + ["9340", "\u5A81\u{28BD7}\u{20413}\u93E0\u748C\u{21303}\u7105\u4972\u9408\u{289FB}\u93BD\u37A0\u5C1E\u5C9E\u5E5E\u5E48\u{21996}\u{2197C}\u{23AEE}\u5ECD\u5B4F\u{21903}\u{21904}\u3701\u{218A0}\u36DD\u{216FE}\u36D3\u812A\u{28A47}\u{21DBA}\u{23472}\u{289A8}\u5F0C\u5F0E\u{21927}\u{217AB}\u5A6B\u{2173B}\u5B44\u8614\u{275FD}\u8860\u607E\u{22860}\u{2262B}\u5FDB\u3EB8\u{225AF}\u{225BE}\u{29088}\u{26F73}\u61C0\u{2003E}\u{20046}\u{2261B}\u6199\u6198\u6075\u{22C9B}\u{22D07}\u{246D4}\u{2914D}"], + ["93a1", "\u6471\u{24665}\u{22B6A}\u3A29\u{22B22}\u{23450}\u{298EA}\u{22E78}\u6337\u{2A45B}\u64B6\u6331\u63D1\u{249E3}\u{22D67}\u62A4\u{22CA1}\u643B\u656B\u6972\u3BF4\u{2308E}\u{232AD}\u{24989}\u{232AB}\u550D\u{232E0}\u{218D9}\u{2943F}\u66CE\u{23289}\u{231B3}\u3AE0\u4190\u{25584}\u{28B22}\u{2558F}\u{216FC}\u{2555B}\u{25425}\u78EE\u{23103}\u{2182A}\u{23234}\u3464\u{2320F}\u{23182}\u{242C9}\u668E\u{26D24}\u666B\u4B93\u6630\u{27870}\u{21DEB}\u6663\u{232D2}\u{232E1}\u661E\u{25872}\u38D1\u{2383A}\u{237BC}\u3B99\u{237A2}\u{233FE}\u74D0\u3B96\u678F\u{2462A}\u68B6\u681E\u3BC4\u6ABE\u3863\u{237D5}\u{24487}\u6A33\u6A52\u6AC9\u6B05\u{21912}\u6511\u6898\u6A4C\u3BD7\u6A7A\u6B57\u{23FC0}\u{23C9A}\u93A0\u92F2\u{28BEA}\u{28ACB}"], + ["9440", "\u9289\u{2801E}\u{289DC}\u9467\u6DA5\u6F0B\u{249EC}\u6D67\u{23F7F}\u3D8F\u6E04\u{2403C}\u5A3D\u6E0A\u5847\u6D24\u7842\u713B\u{2431A}\u{24276}\u70F1\u7250\u7287\u7294\u{2478F}\u{24725}\u5179\u{24AA4}\u{205EB}\u747A\u{23EF8}\u{2365F}\u{24A4A}\u{24917}\u{25FE1}\u3F06\u3EB1\u{24ADF}\u{28C23}\u{23F35}\u60A7\u3EF3\u74CC\u743C\u9387\u7437\u449F\u{26DEA}\u4551\u7583\u3F63\u{24CD9}\u{24D06}\u3F58\u7555\u7673\u{2A5C6}\u3B19\u7468\u{28ACC}\u{249AB}\u{2498E}\u3AFB"], + ["94a1", "\u3DCD\u{24A4E}\u3EFF\u{249C5}\u{248F3}\u91FA\u5732\u9342\u{28AE3}\u{21864}\u50DF\u{25221}\u{251E7}\u7778\u{23232}\u770E\u770F\u777B\u{24697}\u{23781}\u3A5E\u{248F0}\u7438\u749B\u3EBF\u{24ABA}\u{24AC7}\u40C8\u{24A96}\u{261AE}\u9307\u{25581}\u781E\u788D\u7888\u78D2\u73D0\u7959\u{27741}\u{256E3}\u410E\u799B\u8496\u79A5\u6A2D\u{23EFA}\u7A3A\u79F4\u416E\u{216E6}\u4132\u9235\u79F1\u{20D4C}\u{2498C}\u{20299}\u{23DBA}\u{2176E}\u3597\u556B\u3570\u36AA\u{201D4}\u{20C0D}\u7AE2\u5A59\u{226F5}\u{25AAF}\u{25A9C}\u5A0D\u{2025B}\u78F0\u5A2A\u{25BC6}\u7AFE\u41F9\u7C5D\u7C6D\u4211\u{25BB3}\u{25EBC}\u{25EA6}\u7CCD\u{249F9}\u{217B0}\u7C8E\u7C7C\u7CAE\u6AB2\u7DDC\u7E07\u7DD3\u7F4E\u{26261}"], + ["9540", "\u{2615C}\u{27B48}\u7D97\u{25E82}\u426A\u{26B75}\u{20916}\u67D6\u{2004E}\u{235CF}\u57C4\u{26412}\u{263F8}\u{24962}\u7FDD\u7B27\u{2082C}\u{25AE9}\u{25D43}\u7B0C\u{25E0E}\u99E6\u8645\u9A63\u6A1C\u{2343F}\u39E2\u{249F7}\u{265AD}\u9A1F\u{265A0}\u8480\u{27127}\u{26CD1}\u44EA\u8137\u4402\u80C6\u8109\u8142\u{267B4}\u98C3\u{26A42}\u8262\u8265\u{26A51}\u8453\u{26DA7}\u8610\u{2721B}\u5A86\u417F\u{21840}\u5B2B\u{218A1}\u5AE4\u{218D8}\u86A0\u{2F9BC}\u{23D8F}\u882D\u{27422}\u5A02"], + ["95a1", "\u886E\u4F45\u8887\u88BF\u88E6\u8965\u894D\u{25683}\u8954\u{27785}\u{27784}\u{28BF5}\u{28BD9}\u{28B9C}\u{289F9}\u3EAD\u84A3\u46F5\u46CF\u37F2\u8A3D\u8A1C\u{29448}\u5F4D\u922B\u{24284}\u65D4\u7129\u70C4\u{21845}\u9D6D\u8C9F\u8CE9\u{27DDC}\u599A\u77C3\u59F0\u436E\u36D4\u8E2A\u8EA7\u{24C09}\u8F30\u8F4A\u42F4\u6C58\u6FBB\u{22321}\u489B\u6F79\u6E8B\u{217DA}\u9BE9\u36B5\u{2492F}\u90BB\u9097\u5571\u4906\u91BB\u9404\u{28A4B}\u4062\u{28AFC}\u9427\u{28C1D}\u{28C3B}\u84E5\u8A2B\u9599\u95A7\u9597\u9596\u{28D34}\u7445\u3EC2\u{248FF}\u{24A42}\u{243EA}\u3EE7\u{23225}\u968F\u{28EE7}\u{28E66}\u{28E65}\u3ECC\u{249ED}\u{24A78}\u{23FEE}\u7412\u746B\u3EFC\u9741\u{290B0}"], + ["9640", "\u6847\u4A1D\u{29093}\u{257DF}\u975D\u9368\u{28989}\u{28C26}\u{28B2F}\u{263BE}\u92BA\u5B11\u8B69\u493C\u73F9\u{2421B}\u979B\u9771\u9938\u{20F26}\u5DC1\u{28BC5}\u{24AB2}\u981F\u{294DA}\u92F6\u{295D7}\u91E5\u44C0\u{28B50}\u{24A67}\u{28B64}\u98DC\u{28A45}\u3F00\u922A\u4925\u8414\u993B\u994D\u{27B06}\u3DFD\u999B\u4B6F\u99AA\u9A5C\u{28B65}\u{258C8}\u6A8F\u9A21\u5AFE\u9A2F\u{298F1}\u4B90\u{29948}\u99BC\u4BBD\u4B97\u937D\u5872\u{21302}\u5822\u{249B8}"], + ["96a1", "\u{214E8}\u7844\u{2271F}\u{23DB8}\u68C5\u3D7D\u9458\u3927\u6150\u{22781}\u{2296B}\u6107\u9C4F\u9C53\u9C7B\u9C35\u9C10\u9B7F\u9BCF\u{29E2D}\u9B9F\u{2A1F5}\u{2A0FE}\u9D21\u4CAE\u{24104}\u9E18\u4CB0\u9D0C\u{2A1B4}\u{2A0ED}\u{2A0F3}\u{2992F}\u9DA5\u84BD\u{26E12}\u{26FDF}\u{26B82}\u85FC\u4533\u{26DA4}\u{26E84}\u{26DF0}\u8420\u85EE\u{26E00}\u{237D7}\u{26064}\u79E2\u{2359C}\u{23640}\u492D\u{249DE}\u3D62\u93DB\u92BE\u9348\u{202BF}\u78B9\u9277\u944D\u4FE4\u3440\u9064\u{2555D}\u783D\u7854\u78B6\u784B\u{21757}\u{231C9}\u{24941}\u369A\u4F72\u6FDA\u6FD9\u701E\u701E\u5414\u{241B5}\u57BB\u58F3\u578A\u9D16\u57D7\u7134\u34AF\u{241AC}\u71EB\u{26C40}\u{24F97}\u5B28\u{217B5}\u{28A49}"], + ["9740", "\u610C\u5ACE\u5A0B\u42BC\u{24488}\u372C\u4B7B\u{289FC}\u93BB\u93B8\u{218D6}\u{20F1D}\u8472\u{26CC0}\u{21413}\u{242FA}\u{22C26}\u{243C1}\u5994\u{23DB7}\u{26741}\u7DA8\u{2615B}\u{260A4}\u{249B9}\u{2498B}\u{289FA}\u92E5\u73E2\u3EE9\u74B4\u{28B63}\u{2189F}\u3EE1\u{24AB3}\u6AD8\u73F3\u73FB\u3ED6\u{24A3E}\u{24A94}\u{217D9}\u{24A66}\u{203A7}\u{21424}\u{249E5}\u7448\u{24916}\u70A5\u{24976}\u9284\u73E6\u935F\u{204FE}\u9331\u{28ACE}\u{28A16}\u9386\u{28BE7}\u{255D5}\u4935\u{28A82}\u716B"], + ["97a1", "\u{24943}\u{20CFF}\u56A4\u{2061A}\u{20BEB}\u{20CB8}\u5502\u79C4\u{217FA}\u7DFE\u{216C2}\u{24A50}\u{21852}\u452E\u9401\u370A\u{28AC0}\u{249AD}\u59B0\u{218BF}\u{21883}\u{27484}\u5AA1\u36E2\u{23D5B}\u36B0\u925F\u5A79\u{28A81}\u{21862}\u9374\u3CCD\u{20AB4}\u4A96\u398A\u50F4\u3D69\u3D4C\u{2139C}\u7175\u42FB\u{28218}\u6E0F\u{290E4}\u44EB\u6D57\u{27E4F}\u7067\u6CAF\u3CD6\u{23FED}\u{23E2D}\u6E02\u6F0C\u3D6F\u{203F5}\u7551\u36BC\u34C8\u4680\u3EDA\u4871\u59C4\u926E\u493E\u8F41\u{28C1C}\u{26BC0}\u5812\u57C8\u36D6\u{21452}\u70FE\u{24362}\u{24A71}\u{22FE3}\u{212B0}\u{223BD}\u68B9\u6967\u{21398}\u{234E5}\u{27BF4}\u{236DF}\u{28A83}\u{237D6}\u{233FA}\u{24C9F}\u6A1A\u{236AD}\u{26CB7}\u843E\u44DF\u44CE"], + ["9840", "\u{26D26}\u{26D51}\u{26C82}\u{26FDE}\u6F17\u{27109}\u833D\u{2173A}\u83ED\u{26C80}\u{27053}\u{217DB}\u5989\u5A82\u{217B3}\u5A61\u5A71\u{21905}\u{241FC}\u372D\u59EF\u{2173C}\u36C7\u718E\u9390\u669A\u{242A5}\u5A6E\u5A2B\u{24293}\u6A2B\u{23EF9}\u{27736}\u{2445B}\u{242CA}\u711D\u{24259}\u{289E1}\u4FB0\u{26D28}\u5CC2\u{244CE}\u{27E4D}\u{243BD}\u6A0C\u{24256}\u{21304}\u70A6\u7133\u{243E9}\u3DA5\u6CDF\u{2F825}\u{24A4F}\u7E65\u59EB\u5D2F\u3DF3\u5F5C\u{24A5D}\u{217DF}\u7DA4\u8426"], + ["98a1", "\u5485\u{23AFA}\u{23300}\u{20214}\u577E\u{208D5}\u{20619}\u3FE5\u{21F9E}\u{2A2B6}\u7003\u{2915B}\u5D70\u738F\u7CD3\u{28A59}\u{29420}\u4FC8\u7FE7\u72CD\u7310\u{27AF4}\u7338\u7339\u{256F6}\u7341\u7348\u3EA9\u{27B18}\u906C\u71F5\u{248F2}\u73E1\u81F6\u3ECA\u770C\u3ED1\u6CA2\u56FD\u7419\u741E\u741F\u3EE2\u3EF0\u3EF4\u3EFA\u74D3\u3F0E\u3F53\u7542\u756D\u7572\u758D\u3F7C\u75C8\u75DC\u3FC0\u764D\u3FD7\u7674\u3FDC\u767A\u{24F5C}\u7188\u5623\u8980\u5869\u401D\u7743\u4039\u6761\u4045\u35DB\u7798\u406A\u406F\u5C5E\u77BE\u77CB\u58F2\u7818\u70B9\u781C\u40A8\u7839\u7847\u7851\u7866\u8448\u{25535}\u7933\u6803\u7932\u4103"], + ["9940", "\u4109\u7991\u7999\u8FBB\u7A06\u8FBC\u4167\u7A91\u41B2\u7ABC\u8279\u41C4\u7ACF\u7ADB\u41CF\u4E21\u7B62\u7B6C\u7B7B\u7C12\u7C1B\u4260\u427A\u7C7B\u7C9C\u428C\u7CB8\u4294\u7CED\u8F93\u70C0\u{20CCF}\u7DCF\u7DD4\u7DD0\u7DFD\u7FAE\u7FB4\u729F\u4397\u8020\u8025\u7B39\u802E\u8031\u8054\u3DCC\u57B4\u70A0\u80B7\u80E9\u43ED\u810C\u732A\u810E\u8112\u7560\u8114\u4401\u3B39\u8156\u8159\u815A"], + ["99a1", "\u4413\u583A\u817C\u8184\u4425\u8193\u442D\u81A5\u57EF\u81C1\u81E4\u8254\u448F\u82A6\u8276\u82CA\u82D8\u82FF\u44B0\u8357\u9669\u698A\u8405\u70F5\u8464\u60E3\u8488\u4504\u84BE\u84E1\u84F8\u8510\u8538\u8552\u453B\u856F\u8570\u85E0\u4577\u8672\u8692\u86B2\u86EF\u9645\u878B\u4606\u4617\u88AE\u88FF\u8924\u8947\u8991\u{27967}\u8A29\u8A38\u8A94\u8AB4\u8C51\u8CD4\u8CF2\u8D1C\u4798\u585F\u8DC3\u47ED\u4EEE\u8E3A\u55D8\u5754\u8E71\u55F5\u8EB0\u4837\u8ECE\u8EE2\u8EE4\u8EED\u8EF2\u8FB7\u8FC1\u8FCA\u8FCC\u9033\u99C4\u48AD\u98E0\u9213\u491E\u9228\u9258\u926B\u92B1\u92AE\u92BF"], + ["9a40", "\u92E3\u92EB\u92F3\u92F4\u92FD\u9343\u9384\u93AD\u4945\u4951\u9EBF\u9417\u5301\u941D\u942D\u943E\u496A\u9454\u9479\u952D\u95A2\u49A7\u95F4\u9633\u49E5\u67A0\u4A24\u9740\u4A35\u97B2\u97C2\u5654\u4AE4\u60E8\u98B9\u4B19\u98F1\u5844\u990E\u9919\u51B4\u991C\u9937\u9942\u995D\u9962\u4B70\u99C5\u4B9D\u9A3C\u9B0F\u7A83\u9B69\u9B81\u9BDD\u9BF1\u9BF4\u4C6D\u9C20\u376F\u{21BC2}\u9D49\u9C3A"], + ["9aa1", "\u9EFE\u5650\u9D93\u9DBD\u9DC0\u9DFC\u94F6\u8FB6\u9E7B\u9EAC\u9EB1\u9EBD\u9EC6\u94DC\u9EE2\u9EF1\u9EF8\u7AC8\u9F44\u{20094}\u{202B7}\u{203A0}\u691A\u94C3\u59AC\u{204D7}\u5840\u94C1\u37B9\u{205D5}\u{20615}\u{20676}\u{216BA}\u5757\u7173\u{20AC2}\u{20ACD}\u{20BBF}\u546A\u{2F83B}\u{20BCB}\u549E\u{20BFB}\u{20C3B}\u{20C53}\u{20C65}\u{20C7C}\u60E7\u{20C8D}\u567A\u{20CB5}\u{20CDD}\u{20CED}\u{20D6F}\u{20DB2}\u{20DC8}\u6955\u9C2F\u87A5\u{20E04}\u{20E0E}\u{20ED7}\u{20F90}\u{20F2D}\u{20E73}\u5C20\u{20FBC}\u5E0B\u{2105C}\u{2104F}\u{21076}\u671E\u{2107B}\u{21088}\u{21096}\u3647\u{210BF}\u{210D3}\u{2112F}\u{2113B}\u5364\u84AD\u{212E3}\u{21375}\u{21336}\u8B81\u{21577}\u{21619}\u{217C3}\u{217C7}\u4E78\u70BB\u{2182D}\u{2196A}"], + ["9b40", "\u{21A2D}\u{21A45}\u{21C2A}\u{21C70}\u{21CAC}\u{21EC8}\u62C3\u{21ED5}\u{21F15}\u7198\u6855\u{22045}\u69E9\u36C8\u{2227C}\u{223D7}\u{223FA}\u{2272A}\u{22871}\u{2294F}\u82FD\u{22967}\u{22993}\u{22AD5}\u89A5\u{22AE8}\u8FA0\u{22B0E}\u97B8\u{22B3F}\u9847\u9ABD\u{22C4C}"], + ["9b62", "\u{22C88}\u{22CB7}\u{25BE8}\u{22D08}\u{22D12}\u{22DB7}\u{22D95}\u{22E42}\u{22F74}\u{22FCC}\u{23033}\u{23066}\u{2331F}\u{233DE}\u5FB1\u6648\u66BF\u{27A79}\u{23567}\u{235F3}\u7201\u{249BA}\u77D7\u{2361A}\u{23716}\u7E87\u{20346}\u58B5\u670E"], + ["9ba1", "\u6918\u{23AA7}\u{27657}\u{25FE2}\u{23E11}\u{23EB9}\u{275FE}\u{2209A}\u48D0\u4AB8\u{24119}\u{28A9A}\u{242EE}\u{2430D}\u{2403B}\u{24334}\u{24396}\u{24A45}\u{205CA}\u51D2\u{20611}\u599F\u{21EA8}\u3BBE\u{23CFF}\u{24404}\u{244D6}\u5788\u{24674}\u399B\u{2472F}\u{285E8}\u{299C9}\u3762\u{221C3}\u8B5E\u{28B4E}\u99D6\u{24812}\u{248FB}\u{24A15}\u7209\u{24AC0}\u{20C78}\u5965\u{24EA5}\u{24F86}\u{20779}\u8EDA\u{2502C}\u528F\u573F\u7171\u{25299}\u{25419}\u{23F4A}\u{24AA7}\u55BC\u{25446}\u{2546E}\u{26B52}\u91D4\u3473\u{2553F}\u{27632}\u{2555E}\u4718\u{25562}\u{25566}\u{257C7}\u{2493F}\u{2585D}\u5066\u34FB\u{233CC}\u60DE\u{25903}\u477C\u{28948}\u{25AAE}\u{25B89}\u{25C06}\u{21D90}\u57A1\u7151\u6FB6\u{26102}\u{27C12}\u9056\u{261B2}\u{24F9A}\u8B62\u{26402}\u{2644A}"], + ["9c40", "\u5D5B\u{26BF7}\u8F36\u{26484}\u{2191C}\u8AEA\u{249F6}\u{26488}\u{23FEF}\u{26512}\u4BC0\u{265BF}\u{266B5}\u{2271B}\u9465\u{257E1}\u6195\u5A27\u{2F8CD}\u4FBB\u56B9\u{24521}\u{266FC}\u4E6A\u{24934}\u9656\u6D8F\u{26CBD}\u3618\u8977\u{26799}\u{2686E}\u{26411}\u{2685E}\u71DF\u{268C7}\u7B42\u{290C0}\u{20A11}\u{26926}\u9104\u{26939}\u7A45\u9DF0\u{269FA}\u9A26\u{26A2D}\u365F\u{26469}\u{20021}\u7983\u{26A34}\u{26B5B}\u5D2C\u{23519}\u83CF\u{26B9D}\u46D0\u{26CA4}\u753B\u8865\u{26DAE}\u58B6"], + ["9ca1", "\u371C\u{2258D}\u{2704B}\u{271CD}\u3C54\u{27280}\u{27285}\u9281\u{2217A}\u{2728B}\u9330\u{272E6}\u{249D0}\u6C39\u949F\u{27450}\u{20EF8}\u8827\u88F5\u{22926}\u{28473}\u{217B1}\u6EB8\u{24A2A}\u{21820}\u39A4\u36B9\u5C10\u79E3\u453F\u66B6\u{29CAD}\u{298A4}\u8943\u{277CC}\u{27858}\u56D6\u40DF\u{2160A}\u39A1\u{2372F}\u{280E8}\u{213C5}\u71AD\u8366\u{279DD}\u{291A8}\u5A67\u4CB7\u{270AF}\u{289AB}\u{279FD}\u{27A0A}\u{27B0B}\u{27D66}\u{2417A}\u7B43\u797E\u{28009}\u6FB5\u{2A2DF}\u6A03\u{28318}\u53A2\u{26E07}\u93BF\u6836\u975D\u{2816F}\u{28023}\u{269B5}\u{213ED}\u{2322F}\u{28048}\u5D85\u{28C30}\u{28083}\u5715\u9823\u{28949}\u5DAB\u{24988}\u65BE\u69D5\u53D2\u{24AA5}\u{23F81}\u3C11\u6736\u{28090}\u{280F4}\u{2812E}\u{21FA1}\u{2814F}"], + ["9d40", "\u{28189}\u{281AF}\u{2821A}\u{28306}\u{2832F}\u{2838A}\u35CA\u{28468}\u{286AA}\u48FA\u63E6\u{28956}\u7808\u9255\u{289B8}\u43F2\u{289E7}\u43DF\u{289E8}\u{28B46}\u{28BD4}\u59F8\u{28C09}\u8F0B\u{28FC5}\u{290EC}\u7B51\u{29110}\u{2913C}\u3DF7\u{2915E}\u{24ACA}\u8FD0\u728F\u568B\u{294E7}\u{295E9}\u{295B0}\u{295B8}\u{29732}\u{298D1}\u{29949}\u{2996A}\u{299C3}\u{29A28}\u{29B0E}\u{29D5A}\u{29D9B}\u7E9F\u{29EF8}\u{29F23}\u4CA4\u9547\u{2A293}\u71A2\u{2A2FF}\u4D91\u9012\u{2A5CB}\u4D9C\u{20C9C}\u8FBE\u55C1"], + ["9da1", "\u8FBA\u{224B0}\u8FB9\u{24A93}\u4509\u7E7F\u6F56\u6AB1\u4EEA\u34E4\u{28B2C}\u{2789D}\u373A\u8E80\u{217F5}\u{28024}\u{28B6C}\u{28B99}\u{27A3E}\u{266AF}\u3DEB\u{27655}\u{23CB7}\u{25635}\u{25956}\u4E9A\u{25E81}\u{26258}\u56BF\u{20E6D}\u8E0E\u5B6D\u{23E88}\u{24C9E}\u63DE\u62D0\u{217F6}\u{2187B}\u6530\u562D\u{25C4A}\u541A\u{25311}\u3DC6\u{29D98}\u4C7D\u5622\u561E\u7F49\u{25ED8}\u5975\u{23D40}\u8770\u4E1C\u{20FEA}\u{20D49}\u{236BA}\u8117\u9D5E\u8D18\u763B\u9C45\u764E\u77B9\u9345\u5432\u8148\u82F7\u5625\u8132\u8418\u80BD\u55EA\u7962\u5643\u5416\u{20E9D}\u35CE\u5605\u55F1\u66F1\u{282E2}\u362D\u7534\u55F0\u55BA\u5497\u5572\u{20C41}\u{20C96}\u5ED0\u{25148}\u{20E76}\u{22C62}"], + ["9e40", "\u{20EA2}\u9EAB\u7D5A\u55DE\u{21075}\u629D\u976D\u5494\u8CCD\u71F6\u9176\u63FC\u63B9\u63FE\u5569\u{22B43}\u9C72\u{22EB3}\u519A\u34DF\u{20DA7}\u51A7\u544D\u551E\u5513\u7666\u8E2D\u{2688A}\u75B1\u80B6\u8804\u8786\u88C7\u81B6\u841C\u{210C1}\u44EC\u7304\u{24706}\u5B90\u830B\u{26893}\u567B\u{226F4}\u{27D2F}\u{241A3}\u{27D73}\u{26ED0}\u{272B6}\u9170\u{211D9}\u9208\u{23CFC}\u{2A6A9}\u{20EAC}\u{20EF9}\u7266\u{21CA2}\u474E\u{24FC2}\u{27FF9}\u{20FEB}\u40FA"], + ["9ea1", "\u9C5D\u651F\u{22DA0}\u48F3\u{247E0}\u{29D7C}\u{20FEC}\u{20E0A}\u6062\u{275A3}\u{20FED}"], + ["9ead", "\u{26048}\u{21187}\u71A3\u7E8E\u9D50\u4E1A\u4E04\u3577\u5B0D\u6CB2\u5367\u36AC\u39DC\u537D\u36A5\u{24618}\u589A\u{24B6E}\u822D\u544B\u57AA\u{25A95}\u{20979}"], + ["9ec5", "\u3A52\u{22465}\u7374\u{29EAC}\u4D09\u9BED\u{23CFE}\u{29F30}\u4C5B\u{24FA9}\u{2959E}\u{29FDE}\u845C\u{23DB6}\u{272B2}\u{267B3}\u{23720}\u632E\u7D25\u{23EF7}\u{23E2C}\u3A2A\u9008\u52CC\u3E74\u367A\u45E9\u{2048E}\u7640\u5AF0\u{20EB6}\u787A\u{27F2E}\u58A7\u40BF\u567C\u9B8B\u5D74\u7654\u{2A434}\u9E85\u4CE1\u75F9\u37FB\u6119\u{230DA}\u{243F2}"], + ["9ef5", "\u565D\u{212A9}\u57A7\u{24963}\u{29E06}\u5234\u{270AE}\u35AD\u6C4A\u9D7C"], + ["9f40", "\u7C56\u9B39\u57DE\u{2176C}\u5C53\u64D3\u{294D0}\u{26335}\u{27164}\u86AD\u{20D28}\u{26D22}\u{24AE2}\u{20D71}"], + ["9f4f", "\u51FE\u{21F0F}\u5D8E\u9703\u{21DD1}\u9E81\u904C\u7B1F\u9B02\u5CD1\u7BA3\u6268\u6335\u9AFF\u7BCF\u9B2A\u7C7E\u9B2E\u7C42\u7C86\u9C15\u7BFC\u9B09\u9F17\u9C1B\u{2493E}\u9F5A\u5573\u5BC3\u4FFD\u9E98\u4FF2\u5260\u3E06\u52D1\u5767\u5056\u59B7\u5E12\u97C8\u9DAB\u8F5C\u5469\u97B4\u9940\u97BA\u532C\u6130"], + ["9fa1", "\u692C\u53DA\u9C0A\u9D02\u4C3B\u9641\u6980\u50A6\u7546\u{2176D}\u99DA\u5273"], + ["9fae", "\u9159\u9681\u915C"], + ["9fb2", "\u9151\u{28E97}\u637F\u{26D23}\u6ACA\u5611\u918E\u757A\u6285\u{203FC}\u734F\u7C70\u{25C21}\u{23CFD}"], + ["9fc1", "\u{24919}\u76D6\u9B9D\u4E2A\u{20CD4}\u83BE\u8842"], + ["9fc9", "\u5C4A\u69C0\u50ED\u577A\u521F\u5DF5\u4ECE\u6C31\u{201F2}\u4F39\u549C\u54DA\u529A\u8D82\u35FE\u5F0C\u35F3"], + ["9fdb", "\u6B52\u917C\u9FA5\u9B97\u982E\u98B4\u9ABA\u9EA8\u9E84\u717A\u7B14"], + ["9fe7", "\u6BFA\u8818\u7F78"], + ["9feb", "\u5620\u{2A64A}\u8E77\u9F53"], + ["9ff0", "\u8DD4\u8E4F\u9E1C\u8E01\u6282\u{2837D}\u8E28\u8E75\u7AD3\u{24A77}\u7A3E\u78D8\u6CEA\u8A67\u7607"], + ["a040", "\u{28A5A}\u9F26\u6CCE\u87D6\u75C3\u{2A2B2}\u7853\u{2F840}\u8D0C\u72E2\u7371\u8B2D\u7302\u74F1\u8CEB\u{24ABB}\u862F\u5FBA\u88A0\u44B7"], + ["a055", "\u{2183B}\u{26E05}"], + ["a058", "\u8A7E\u{2251B}"], + ["a05b", "\u60FD\u7667\u9AD7\u9D44\u936E\u9B8F\u87F5"], + ["a063", "\u880F\u8CF7\u732C\u9721\u9BB0\u35D6\u72B2\u4C07\u7C51\u994A\u{26159}\u6159\u4C04\u9E96\u617D"], + ["a073", "\u575F\u616F\u62A6\u6239\u62CE\u3A5C\u61E2\u53AA\u{233F5}\u6364\u6802\u35D2"], + ["a0a1", "\u5D57\u{28BC2}\u8FDA\u{28E39}"], + ["a0a6", "\u50D9\u{21D46}\u7906\u5332\u9638\u{20F3B}\u4065"], + ["a0ae", "\u77FE"], + ["a0b0", "\u7CC2\u{25F1A}\u7CDA\u7A2D\u8066\u8063\u7D4D\u7505\u74F2\u8994\u821A\u670C\u8062\u{27486}\u805B\u74F0\u8103\u7724\u8989\u{267CC}\u7553\u{26ED1}\u87A9\u87CE\u81C8\u878C\u8A49\u8CAD\u8B43\u772B\u74F8\u84DA\u3635\u69B2\u8DA6"], + ["a0d4", "\u89A9\u7468\u6DB9\u87C1\u{24011}\u74E7\u3DDB\u7176\u60A4\u619C\u3CD1\u7162\u6077"], + ["a0e2", "\u7F71\u{28B2D}\u7250\u60E9\u4B7E\u5220\u3C18\u{23CC7}\u{25ED7}\u{27656}\u{25531}\u{21944}\u{212FE}\u{29903}\u{26DDC}\u{270AD}\u5CC1\u{261AD}\u{28A0F}\u{23677}\u{200EE}\u{26846}\u{24F0E}\u4562\u5B1F\u{2634C}\u9F50\u9EA6\u{2626B}"], + ["a3c0", "\u2400", 31, "\u2421"], + ["c6a1", "\u2460", 9, "\u2474", 9, "\u2170", 9, "\u4E36\u4E3F\u4E85\u4EA0\u5182\u5196\u51AB\u52F9\u5338\u5369\u53B6\u590A\u5B80\u5DDB\u2F33\u5E7F\u5EF4\u5F50\u5F61\u6534\u65E0\u7592\u7676\u8FB5\u96B6\xA8\u02C6\u30FD\u30FE\u309D\u309E\u3003\u4EDD\u3005\u3006\u3007\u30FC\uFF3B\uFF3D\u273D\u3041", 23], + ["c740", "\u3059", 58, "\u30A1\u30A2\u30A3\u30A4"], + ["c7a1", "\u30A5", 81, "\u0410", 5, "\u0401\u0416", 4], + ["c840", "\u041B", 26, "\u0451\u0436", 25, "\u21E7\u21B8\u21B9\u31CF\u{200CC}\u4E5A\u{2008A}\u5202\u4491"], + ["c8a1", "\u9FB0\u5188\u9FB1\u{27607}"], + ["c8cd", "\uFFE2\uFFE4\uFF07\uFF02\u3231\u2116\u2121\u309B\u309C\u2E80\u2E84\u2E86\u2E87\u2E88\u2E8A\u2E8C\u2E8D\u2E95\u2E9C\u2E9D\u2EA5\u2EA7\u2EAA\u2EAC\u2EAE\u2EB6\u2EBC\u2EBE\u2EC6\u2ECA\u2ECC\u2ECD\u2ECF\u2ED6\u2ED7\u2EDE\u2EE3"], + ["c8f5", "\u0283\u0250\u025B\u0254\u0275\u0153\xF8\u014B\u028A\u026A"], + ["f9fe", "\uFFED"], + ["fa40", "\u{20547}\u92DB\u{205DF}\u{23FC5}\u854C\u42B5\u73EF\u51B5\u3649\u{24942}\u{289E4}\u9344\u{219DB}\u82EE\u{23CC8}\u783C\u6744\u62DF\u{24933}\u{289AA}\u{202A0}\u{26BB3}\u{21305}\u4FAB\u{224ED}\u5008\u{26D29}\u{27A84}\u{23600}\u{24AB1}\u{22513}\u5029\u{2037E}\u5FA4\u{20380}\u{20347}\u6EDB\u{2041F}\u507D\u5101\u347A\u510E\u986C\u3743\u8416\u{249A4}\u{20487}\u5160\u{233B4}\u516A\u{20BFF}\u{220FC}\u{202E5}\u{22530}\u{2058E}\u{23233}\u{21983}\u5B82\u877D\u{205B3}\u{23C99}\u51B2\u51B8"], + ["faa1", "\u9D34\u51C9\u51CF\u51D1\u3CDC\u51D3\u{24AA6}\u51B3\u51E2\u5342\u51ED\u83CD\u693E\u{2372D}\u5F7B\u520B\u5226\u523C\u52B5\u5257\u5294\u52B9\u52C5\u7C15\u8542\u52E0\u860D\u{26B13}\u5305\u{28ADE}\u5549\u6ED9\u{23F80}\u{20954}\u{23FEC}\u5333\u5344\u{20BE2}\u6CCB\u{21726}\u681B\u73D5\u604A\u3EAA\u38CC\u{216E8}\u71DD\u44A2\u536D\u5374\u{286AB}\u537E\u537F\u{21596}\u{21613}\u77E6\u5393\u{28A9B}\u53A0\u53AB\u53AE\u73A7\u{25772}\u3F59\u739C\u53C1\u53C5\u6C49\u4E49\u57FE\u53D9\u3AAB\u{20B8F}\u53E0\u{23FEB}\u{22DA3}\u53F6\u{20C77}\u5413\u7079\u552B\u6657\u6D5B\u546D\u{26B53}\u{20D74}\u555D\u548F\u54A4\u47A6\u{2170D}\u{20EDD}\u3DB4\u{20D4D}"], + ["fb40", "\u{289BC}\u{22698}\u5547\u4CED\u542F\u7417\u5586\u55A9\u5605\u{218D7}\u{2403A}\u4552\u{24435}\u66B3\u{210B4}\u5637\u66CD\u{2328A}\u66A4\u66AD\u564D\u564F\u78F1\u56F1\u9787\u53FE\u5700\u56EF\u56ED\u{28B66}\u3623\u{2124F}\u5746\u{241A5}\u6C6E\u708B\u5742\u36B1\u{26C7E}\u57E6\u{21416}\u5803\u{21454}\u{24363}\u5826\u{24BF5}\u585C\u58AA\u3561\u58E0\u58DC\u{2123C}\u58FB\u5BFF\u5743\u{2A150}\u{24278}\u93D3\u35A1\u591F\u68A6\u36C3\u6E59"], + ["fba1", "\u{2163E}\u5A24\u5553\u{21692}\u8505\u59C9\u{20D4E}\u{26C81}\u{26D2A}\u{217DC}\u59D9\u{217FB}\u{217B2}\u{26DA6}\u6D71\u{21828}\u{216D5}\u59F9\u{26E45}\u5AAB\u5A63\u36E6\u{249A9}\u5A77\u3708\u5A96\u7465\u5AD3\u{26FA1}\u{22554}\u3D85\u{21911}\u3732\u{216B8}\u5E83\u52D0\u5B76\u6588\u5B7C\u{27A0E}\u4004\u485D\u{20204}\u5BD5\u6160\u{21A34}\u{259CC}\u{205A5}\u5BF3\u5B9D\u4D10\u5C05\u{21B44}\u5C13\u73CE\u5C14\u{21CA5}\u{26B28}\u5C49\u48DD\u5C85\u5CE9\u5CEF\u5D8B\u{21DF9}\u{21E37}\u5D10\u5D18\u5D46\u{21EA4}\u5CBA\u5DD7\u82FC\u382D\u{24901}\u{22049}\u{22173}\u8287\u3836\u3BC2\u5E2E\u6A8A\u5E75\u5E7A\u{244BC}\u{20CD3}\u53A6\u4EB7\u5ED0\u53A8\u{21771}\u5E09\u5EF4\u{28482}"], + ["fc40", "\u5EF9\u5EFB\u38A0\u5EFC\u683E\u941B\u5F0D\u{201C1}\u{2F894}\u3ADE\u48AE\u{2133A}\u5F3A\u{26888}\u{223D0}\u5F58\u{22471}\u5F63\u97BD\u{26E6E}\u5F72\u9340\u{28A36}\u5FA7\u5DB6\u3D5F\u{25250}\u{21F6A}\u{270F8}\u{22668}\u91D6\u{2029E}\u{28A29}\u6031\u6685\u{21877}\u3963\u3DC7\u3639\u5790\u{227B4}\u7971\u3E40\u609E\u60A4\u60B3\u{24982}\u{2498F}\u{27A53}\u74A4\u50E1\u5AA0\u6164\u8424\u6142\u{2F8A6}\u{26ED2}\u6181\u51F4\u{20656}\u6187\u5BAA\u{23FB7}"], + ["fca1", "\u{2285F}\u61D3\u{28B9D}\u{2995D}\u61D0\u3932\u{22980}\u{228C1}\u6023\u615C\u651E\u638B\u{20118}\u62C5\u{21770}\u62D5\u{22E0D}\u636C\u{249DF}\u3A17\u6438\u63F8\u{2138E}\u{217FC}\u6490\u6F8A\u{22E36}\u9814\u{2408C}\u{2571D}\u64E1\u64E5\u947B\u3A66\u643A\u3A57\u654D\u6F16\u{24A28}\u{24A23}\u6585\u656D\u655F\u{2307E}\u65B5\u{24940}\u4B37\u65D1\u40D8\u{21829}\u65E0\u65E3\u5FDF\u{23400}\u6618\u{231F7}\u{231F8}\u6644\u{231A4}\u{231A5}\u664B\u{20E75}\u6667\u{251E6}\u6673\u6674\u{21E3D}\u{23231}\u{285F4}\u{231C8}\u{25313}\u77C5\u{228F7}\u99A4\u6702\u{2439C}\u{24A21}\u3B2B\u69FA\u{237C2}\u675E\u6767\u6762\u{241CD}\u{290ED}\u67D7\u44E9\u6822\u6E50\u923C\u6801\u{233E6}\u{26DA0}\u685D"], + ["fd40", "\u{2346F}\u69E1\u6A0B\u{28ADF}\u6973\u68C3\u{235CD}\u6901\u6900\u3D32\u3A01\u{2363C}\u3B80\u67AC\u6961\u{28A4A}\u42FC\u6936\u6998\u3BA1\u{203C9}\u8363\u5090\u69F9\u{23659}\u{2212A}\u6A45\u{23703}\u6A9D\u3BF3\u67B1\u6AC8\u{2919C}\u3C0D\u6B1D\u{20923}\u60DE\u6B35\u6B74\u{227CD}\u6EB5\u{23ADB}\u{203B5}\u{21958}\u3740\u5421\u{23B5A}\u6BE1\u{23EFC}\u6BDC\u6C37\u{2248B}\u{248F1}\u{26B51}\u6C5A\u8226\u6C79\u{23DBC}\u44C5\u{23DBD}\u{241A4}\u{2490C}\u{24900}"], + ["fda1", "\u{23CC9}\u36E5\u3CEB\u{20D32}\u9B83\u{231F9}\u{22491}\u7F8F\u6837\u{26D25}\u{26DA1}\u{26DEB}\u6D96\u6D5C\u6E7C\u6F04\u{2497F}\u{24085}\u{26E72}\u8533\u{26F74}\u51C7\u6C9C\u6E1D\u842E\u{28B21}\u6E2F\u{23E2F}\u7453\u{23F82}\u79CC\u6E4F\u5A91\u{2304B}\u6FF8\u370D\u6F9D\u{23E30}\u6EFA\u{21497}\u{2403D}\u4555\u93F0\u6F44\u6F5C\u3D4E\u6F74\u{29170}\u3D3B\u6F9F\u{24144}\u6FD3\u{24091}\u{24155}\u{24039}\u{23FF0}\u{23FB4}\u{2413F}\u51DF\u{24156}\u{24157}\u{24140}\u{261DD}\u704B\u707E\u70A7\u7081\u70CC\u70D5\u70D6\u70DF\u4104\u3DE8\u71B4\u7196\u{24277}\u712B\u7145\u5A88\u714A\u716E\u5C9C\u{24365}\u714F\u9362\u{242C1}\u712C\u{2445A}\u{24A27}\u{24A22}\u71BA\u{28BE8}\u70BD\u720E"], + ["fe40", "\u9442\u7215\u5911\u9443\u7224\u9341\u{25605}\u722E\u7240\u{24974}\u68BD\u7255\u7257\u3E55\u{23044}\u680D\u6F3D\u7282\u732A\u732B\u{24823}\u{2882B}\u48ED\u{28804}\u7328\u732E\u73CF\u73AA\u{20C3A}\u{26A2E}\u73C9\u7449\u{241E2}\u{216E7}\u{24A24}\u6623\u36C5\u{249B7}\u{2498D}\u{249FB}\u73F7\u7415\u6903\u{24A26}\u7439\u{205C3}\u3ED7\u745C\u{228AD}\u7460\u{28EB2}\u7447\u73E4\u7476\u83B9\u746C\u3730\u7474\u93F1\u6A2C\u7482\u4953\u{24A8C}"], + ["fea1", "\u{2415F}\u{24A79}\u{28B8F}\u5B46\u{28C03}\u{2189E}\u74C8\u{21988}\u750E\u74E9\u751E\u{28ED9}\u{21A4B}\u5BD7\u{28EAC}\u9385\u754D\u754A\u7567\u756E\u{24F82}\u3F04\u{24D13}\u758E\u745D\u759E\u75B4\u7602\u762C\u7651\u764F\u766F\u7676\u{263F5}\u7690\u81EF\u37F8\u{26911}\u{2690E}\u76A1\u76A5\u76B7\u76CC\u{26F9F}\u8462\u{2509D}\u{2517D}\u{21E1C}\u771E\u7726\u7740\u64AF\u{25220}\u7758\u{232AC}\u77AF\u{28964}\u{28968}\u{216C1}\u77F4\u7809\u{21376}\u{24A12}\u68CA\u78AF\u78C7\u78D3\u96A5\u792E\u{255E0}\u78D7\u7934\u78B1\u{2760C}\u8FB8\u8884\u{28B2B}\u{26083}\u{2261C}\u7986\u8900\u6902\u7980\u{25857}\u799D\u{27B39}\u793C\u79A9\u6E2A\u{27126}\u3EA8\u79C6\u{2910D}\u79D4"] + ]; + } +}); + +// node_modules/iconv-lite/encodings/dbcs-data.js +var require_dbcs_data = __commonJS({ + "node_modules/iconv-lite/encodings/dbcs-data.js"(exports2, module2) { + "use strict"; + module2.exports = { + // == Japanese/ShiftJIS ==================================================== + // All japanese encodings are based on JIS X set of standards: + // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. + // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. + // Has several variations in 1978, 1983, 1990 and 1997. + // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. + // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. + // 2 planes, first is superset of 0208, second - revised 0212. + // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) + // Byte encodings are: + // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte + // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. + // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. + // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. + // 0x00-0x7F - lower part of 0201 + // 0x8E, 0xA1-0xDF - upper part of 0201 + // (0xA1-0xFE)x2 - 0208 plane (94x94). + // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). + // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. + // Used as-is in ISO2022 family. + // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, + // 0201-1976 Roman, 0208-1978, 0208-1983. + // * ISO2022-JP-1: Adds esc seq for 0212-1990. + // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. + // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. + // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. + // + // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. + // + // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html + "shiftjis": { + type: "_dbcs", + table: function() { + return require_shiftjis(); + }, + encodeAdd: { "\xA5": 92, "\u203E": 126 }, + encodeSkipVals: [{ from: 60736, to: 63808 }] + }, + "csshiftjis": "shiftjis", + "mskanji": "shiftjis", + "sjis": "shiftjis", + "windows31j": "shiftjis", + "ms31j": "shiftjis", + "xsjis": "shiftjis", + "windows932": "shiftjis", + "ms932": "shiftjis", + "932": "shiftjis", + "cp932": "shiftjis", + "eucjp": { + type: "_dbcs", + table: function() { + return require_eucjp(); + }, + encodeAdd: { "\xA5": 92, "\u203E": 126 } + }, + // TODO: KDDI extension to Shift_JIS + // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. + // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. + // == Chinese/GBK ========================================================== + // http://en.wikipedia.org/wiki/GBK + // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder + // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 + "gb2312": "cp936", + "gb231280": "cp936", + "gb23121980": "cp936", + "csgb2312": "cp936", + "csiso58gb231280": "cp936", + "euccn": "cp936", + // Microsoft's CP936 is a subset and approximation of GBK. + "windows936": "cp936", + "ms936": "cp936", + "936": "cp936", + "cp936": { + type: "_dbcs", + table: function() { + return require_cp936(); + } + }, + // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. + "gbk": { + type: "_dbcs", + table: function() { + return require_cp936().concat(require_gbk_added()); + } + }, + "xgbk": "gbk", + "isoir58": "gbk", + // GB18030 is an algorithmic extension of GBK. + // Main source: https://www.w3.org/TR/encoding/#gbk-encoder + // http://icu-project.org/docs/papers/gb18030.html + // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml + // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 + "gb18030": { + type: "_dbcs", + table: function() { + return require_cp936().concat(require_gbk_added()); + }, + gb18030: function() { + return require_gb18030_ranges(); + }, + encodeSkipVals: [128], + encodeAdd: { "\u20AC": 41699 } + }, + "chinese": "gb18030", + // == Korean =============================================================== + // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. + "windows949": "cp949", + "ms949": "cp949", + "949": "cp949", + "cp949": { + type: "_dbcs", + table: function() { + return require_cp949(); + } + }, + "cseuckr": "cp949", + "csksc56011987": "cp949", + "euckr": "cp949", + "isoir149": "cp949", + "korean": "cp949", + "ksc56011987": "cp949", + "ksc56011989": "cp949", + "ksc5601": "cp949", + // == Big5/Taiwan/Hong Kong ================================================ + // There are lots of tables for Big5 and cp950. Please see the following links for history: + // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html + // Variations, in roughly number of defined chars: + // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT + // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ + // * Big5-2003 (Taiwan standard) almost superset of cp950. + // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. + // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. + // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. + // Plus, it has 4 combining sequences. + // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 + // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. + // Implementations are not consistent within browsers; sometimes labeled as just big5. + // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. + // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 + // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. + // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt + // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt + // + // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder + // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. + "windows950": "cp950", + "ms950": "cp950", + "950": "cp950", + "cp950": { + type: "_dbcs", + table: function() { + return require_cp950(); + } + }, + // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. + "big5": "big5hkscs", + "big5hkscs": { + type: "_dbcs", + table: function() { + return require_cp950().concat(require_big5_added()); + }, + encodeSkipVals: [41676] + }, + "cnbig5": "big5hkscs", + "csbig5": "big5hkscs", + "xxbig5": "big5hkscs" + }; + } +}); + +// node_modules/iconv-lite/encodings/index.js +var require_encodings = __commonJS({ + "node_modules/iconv-lite/encodings/index.js"(exports2, module2) { + "use strict"; + var modules = [ + require_internal(), + require_utf16(), + require_utf7(), + require_sbcs_codec(), + require_sbcs_data(), + require_sbcs_data_generated(), + require_dbcs_codec(), + require_dbcs_data() + ]; + for (i4 = 0; i4 < modules.length; i4++) { + module2 = modules[i4]; + for (enc in module2) + if (Object.prototype.hasOwnProperty.call(module2, enc)) + exports2[enc] = module2[enc]; + } + var module2; + var enc; + var i4; + } +}); + +// node_modules/iconv-lite/lib/streams.js +var require_streams = __commonJS({ + "node_modules/iconv-lite/lib/streams.js"(exports2, module2) { + "use strict"; + var Buffer2 = require("buffer").Buffer; + var Transform = require("stream").Transform; + module2.exports = function(iconv) { + iconv.encodeStream = function encodeStream(encoding, options) { + return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); + }; + iconv.decodeStream = function decodeStream(encoding, options) { + return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); + }; + iconv.supportsStreams = true; + iconv.IconvLiteEncoderStream = IconvLiteEncoderStream; + iconv.IconvLiteDecoderStream = IconvLiteDecoderStream; + iconv._collect = IconvLiteDecoderStream.prototype.collect; + }; + function IconvLiteEncoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.decodeStrings = false; + Transform.call(this, options); + } + IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } + }); + IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { + if (typeof chunk != "string") + return done(new Error("Iconv encoding stream needs strings as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res); + done(); + } catch (e4) { + done(e4); + } + }; + IconvLiteEncoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res); + done(); + } catch (e4) { + done(e4); + } + }; + IconvLiteEncoderStream.prototype.collect = function(cb) { + var chunks = []; + this.on("error", cb); + this.on("data", function(chunk) { + chunks.push(chunk); + }); + this.on("end", function() { + cb(null, Buffer2.concat(chunks)); + }); + return this; + }; + function IconvLiteDecoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.encoding = this.encoding = "utf8"; + Transform.call(this, options); + } + IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } + }); + IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { + if (!Buffer2.isBuffer(chunk)) + return done(new Error("Iconv decoding stream needs buffers as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res, this.encoding); + done(); + } catch (e4) { + done(e4); + } + }; + IconvLiteDecoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res, this.encoding); + done(); + } catch (e4) { + done(e4); + } + }; + IconvLiteDecoderStream.prototype.collect = function(cb) { + var res = ""; + this.on("error", cb); + this.on("data", function(chunk) { + res += chunk; + }); + this.on("end", function() { + cb(null, res); + }); + return this; + }; + } +}); + +// node_modules/iconv-lite/lib/extend-node.js +var require_extend_node = __commonJS({ + "node_modules/iconv-lite/lib/extend-node.js"(exports2, module2) { + "use strict"; + var Buffer2 = require("buffer").Buffer; + module2.exports = function(iconv) { + var original = void 0; + iconv.supportsNodeEncodingsExtension = !(Buffer2.from || new Buffer2(0) instanceof Uint8Array); + iconv.extendNodeEncodings = function extendNodeEncodings() { + if (original) return; + original = {}; + if (!iconv.supportsNodeEncodingsExtension) { + console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node"); + console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility"); + return; + } + var nodeNativeEncodings = { + "hex": true, + "utf8": true, + "utf-8": true, + "ascii": true, + "binary": true, + "base64": true, + "ucs2": true, + "ucs-2": true, + "utf16le": true, + "utf-16le": true + }; + Buffer2.isNativeEncoding = function(enc) { + return enc && nodeNativeEncodings[enc.toLowerCase()]; + }; + var SlowBuffer = require("buffer").SlowBuffer; + original.SlowBufferToString = SlowBuffer.prototype.toString; + SlowBuffer.prototype.toString = function(encoding, start, end) { + encoding = String(encoding || "utf8").toLowerCase(); + if (Buffer2.isNativeEncoding(encoding)) + return original.SlowBufferToString.call(this, encoding, start, end); + if (typeof start == "undefined") start = 0; + if (typeof end == "undefined") end = this.length; + return iconv.decode(this.slice(start, end), encoding); + }; + original.SlowBufferWrite = SlowBuffer.prototype.write; + SlowBuffer.prototype.write = function(string, offset, length, encoding) { + if (isFinite(offset)) { + if (!isFinite(length)) { + encoding = length; + length = void 0; + } + } else { + var swap = encoding; + encoding = offset; + offset = length; + length = swap; + } + offset = +offset || 0; + var remaining = this.length - offset; + if (!length) { + length = remaining; + } else { + length = +length; + if (length > remaining) { + length = remaining; + } + } + encoding = String(encoding || "utf8").toLowerCase(); + if (Buffer2.isNativeEncoding(encoding)) + return original.SlowBufferWrite.call(this, string, offset, length, encoding); + if (string.length > 0 && (length < 0 || offset < 0)) + throw new RangeError("attempt to write beyond buffer bounds"); + var buf = iconv.encode(string, encoding); + if (buf.length < length) length = buf.length; + buf.copy(this, offset, 0, length); + return length; + }; + original.BufferIsEncoding = Buffer2.isEncoding; + Buffer2.isEncoding = function(encoding) { + return Buffer2.isNativeEncoding(encoding) || iconv.encodingExists(encoding); + }; + original.BufferByteLength = Buffer2.byteLength; + Buffer2.byteLength = SlowBuffer.byteLength = function(str, encoding) { + encoding = String(encoding || "utf8").toLowerCase(); + if (Buffer2.isNativeEncoding(encoding)) + return original.BufferByteLength.call(this, str, encoding); + return iconv.encode(str, encoding).length; + }; + original.BufferToString = Buffer2.prototype.toString; + Buffer2.prototype.toString = function(encoding, start, end) { + encoding = String(encoding || "utf8").toLowerCase(); + if (Buffer2.isNativeEncoding(encoding)) + return original.BufferToString.call(this, encoding, start, end); + if (typeof start == "undefined") start = 0; + if (typeof end == "undefined") end = this.length; + return iconv.decode(this.slice(start, end), encoding); + }; + original.BufferWrite = Buffer2.prototype.write; + Buffer2.prototype.write = function(string, offset, length, encoding) { + var _offset2 = offset, _length = length, _encoding = encoding; + if (isFinite(offset)) { + if (!isFinite(length)) { + encoding = length; + length = void 0; + } + } else { + var swap = encoding; + encoding = offset; + offset = length; + length = swap; + } + encoding = String(encoding || "utf8").toLowerCase(); + if (Buffer2.isNativeEncoding(encoding)) + return original.BufferWrite.call(this, string, _offset2, _length, _encoding); + offset = +offset || 0; + var remaining = this.length - offset; + if (!length) { + length = remaining; + } else { + length = +length; + if (length > remaining) { + length = remaining; + } + } + if (string.length > 0 && (length < 0 || offset < 0)) + throw new RangeError("attempt to write beyond buffer bounds"); + var buf = iconv.encode(string, encoding); + if (buf.length < length) length = buf.length; + buf.copy(this, offset, 0, length); + return length; + }; + if (iconv.supportsStreams) { + var Readable = require("stream").Readable; + original.ReadableSetEncoding = Readable.prototype.setEncoding; + Readable.prototype.setEncoding = function setEncoding(enc, options) { + this._readableState.decoder = iconv.getDecoder(enc, options); + this._readableState.encoding = enc; + }; + Readable.prototype.collect = iconv._collect; + } + }; + iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() { + if (!iconv.supportsNodeEncodingsExtension) + return; + if (!original) + throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called."); + delete Buffer2.isNativeEncoding; + var SlowBuffer = require("buffer").SlowBuffer; + SlowBuffer.prototype.toString = original.SlowBufferToString; + SlowBuffer.prototype.write = original.SlowBufferWrite; + Buffer2.isEncoding = original.BufferIsEncoding; + Buffer2.byteLength = original.BufferByteLength; + Buffer2.prototype.toString = original.BufferToString; + Buffer2.prototype.write = original.BufferWrite; + if (iconv.supportsStreams) { + var Readable = require("stream").Readable; + Readable.prototype.setEncoding = original.ReadableSetEncoding; + delete Readable.prototype.collect; + } + original = void 0; + }; + }; + } +}); + +// node_modules/iconv-lite/lib/index.js +var require_lib = __commonJS({ + "node_modules/iconv-lite/lib/index.js"(exports2, module2) { + "use strict"; + var Buffer2 = require_safer().Buffer; + var bomHandling = require_bom_handling(); + var iconv = module2.exports; + iconv.encodings = null; + iconv.defaultCharUnicode = "\uFFFD"; + iconv.defaultCharSingleByte = "?"; + iconv.encode = function encode2(str, encoding, options) { + str = "" + (str || ""); + var encoder = iconv.getEncoder(encoding, options); + var res = encoder.write(str); + var trail = encoder.end(); + return trail && trail.length > 0 ? Buffer2.concat([res, trail]) : res; + }; + iconv.decode = function decode2(buf, encoding, options) { + if (typeof buf === "string") { + if (!iconv.skipDecodeWarning) { + console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding"); + iconv.skipDecodeWarning = true; + } + buf = Buffer2.from("" + (buf || ""), "binary"); + } + var decoder = iconv.getDecoder(encoding, options); + var res = decoder.write(buf); + var trail = decoder.end(); + return trail ? res + trail : res; + }; + iconv.encodingExists = function encodingExists(enc) { + try { + iconv.getCodec(enc); + return true; + } catch (e4) { + return false; + } + }; + iconv.toEncoding = iconv.encode; + iconv.fromEncoding = iconv.decode; + iconv._codecDataCache = {}; + iconv.getCodec = function getCodec(encoding) { + if (!iconv.encodings) + iconv.encodings = require_encodings(); + var enc = iconv._canonicalizeEncoding(encoding); + var codecOptions = {}; + while (true) { + var codec = iconv._codecDataCache[enc]; + if (codec) + return codec; + var codecDef = iconv.encodings[enc]; + switch (typeof codecDef) { + case "string": + enc = codecDef; + break; + case "object": + for (var key in codecDef) + codecOptions[key] = codecDef[key]; + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + enc = codecDef.type; + break; + case "function": + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + codec = new codecDef(codecOptions, iconv); + iconv._codecDataCache[codecOptions.encodingName] = codec; + return codec; + default: + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')"); + } + } + }; + iconv._canonicalizeEncoding = function(encoding) { + return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); + }; + iconv.getEncoder = function getEncoder(encoding, options) { + var codec = iconv.getCodec(encoding), encoder = new codec.encoder(options, codec); + if (codec.bomAware && options && options.addBOM) + encoder = new bomHandling.PrependBOM(encoder, options); + return encoder; + }; + iconv.getDecoder = function getDecoder(encoding, options) { + var codec = iconv.getCodec(encoding), decoder = new codec.decoder(options, codec); + if (codec.bomAware && !(options && options.stripBOM === false)) + decoder = new bomHandling.StripBOM(decoder, options); + return decoder; + }; + var nodeVer = typeof process !== "undefined" && process.versions && process.versions.node; + if (nodeVer) { + nodeVerArr = nodeVer.split(".").map(Number); + if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) { + require_streams()(iconv); + } + require_extend_node()(iconv); + } + var nodeVerArr; + if (false) { + console.error("iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); + } + } +}); + +// node_modules/unpipe/index.js +var require_unpipe = __commonJS({ + "node_modules/unpipe/index.js"(exports2, module2) { + "use strict"; + module2.exports = unpipe; + function hasPipeDataListeners(stream) { + var listeners = stream.listeners("data"); + for (var i4 = 0; i4 < listeners.length; i4++) { + if (listeners[i4].name === "ondata") { + return true; + } + } + return false; + } + function unpipe(stream) { + if (!stream) { + throw new TypeError("argument stream is required"); + } + if (typeof stream.unpipe === "function") { + stream.unpipe(); + return; + } + if (!hasPipeDataListeners(stream)) { + return; + } + var listener; + var listeners = stream.listeners("close"); + for (var i4 = 0; i4 < listeners.length; i4++) { + listener = listeners[i4]; + if (listener.name !== "cleanup" && listener.name !== "onclose") { + continue; + } + listener.call(stream); + } + } + } +}); + +// node_modules/raw-body/index.js +var require_raw_body = __commonJS({ + "node_modules/raw-body/index.js"(exports2, module2) { + "use strict"; + var bytes = require_bytes(); + var createError2 = require_http_errors(); + var iconv = require_lib(); + var unpipe = require_unpipe(); + module2.exports = getRawBody; + var ICONV_ENCODING_MESSAGE_REGEXP = /^Encoding not recognized: /; + function getDecoder(encoding) { + if (!encoding) return null; + try { + return iconv.getDecoder(encoding); + } catch (e4) { + if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e4.message)) throw e4; + throw createError2(415, "specified encoding unsupported", { + encoding, + type: "encoding.unsupported" + }); + } + } + function getRawBody(stream, options, callback) { + var done = callback; + var opts = options || {}; + if (options === true || typeof options === "string") { + opts = { + encoding: options + }; + } + if (typeof options === "function") { + done = options; + opts = {}; + } + if (done !== void 0 && typeof done !== "function") { + throw new TypeError("argument callback must be a function"); + } + if (!done && !global.Promise) { + throw new TypeError("argument callback is required"); + } + var encoding = opts.encoding !== true ? opts.encoding : "utf-8"; + var limit = bytes.parse(opts.limit); + var length = opts.length != null && !isNaN(opts.length) ? parseInt(opts.length, 10) : null; + if (done) { + return readStream(stream, encoding, length, limit, done); + } + return new Promise(function executor(resolve, reject) { + readStream(stream, encoding, length, limit, function onRead(err, buf) { + if (err) return reject(err); + resolve(buf); + }); + }); + } + function halt(stream) { + unpipe(stream); + if (typeof stream.pause === "function") { + stream.pause(); + } + } + function readStream(stream, encoding, length, limit, callback) { + var complete = false; + var sync = true; + if (limit !== null && length !== null && length > limit) { + return done(createError2(413, "request entity too large", { + expected: length, + length, + limit, + type: "entity.too.large" + })); + } + var state2 = stream._readableState; + if (stream._decoder || state2 && (state2.encoding || state2.decoder)) { + return done(createError2(500, "stream encoding should not be set", { + type: "stream.encoding.set" + })); + } + var received = 0; + var decoder; + try { + decoder = getDecoder(encoding); + } catch (err) { + return done(err); + } + var buffer = decoder ? "" : []; + stream.on("aborted", onAborted); + stream.on("close", cleanup); + stream.on("data", onData); + stream.on("end", onEnd); + stream.on("error", onEnd); + sync = false; + function done() { + var args2 = new Array(arguments.length); + for (var i4 = 0; i4 < args2.length; i4++) { + args2[i4] = arguments[i4]; + } + complete = true; + if (sync) { + process.nextTick(invokeCallback); + } else { + invokeCallback(); + } + function invokeCallback() { + cleanup(); + if (args2[0]) { + halt(stream); + } + callback.apply(null, args2); + } + } + function onAborted() { + if (complete) return; + done(createError2(400, "request aborted", { + code: "ECONNABORTED", + expected: length, + length, + received, + type: "request.aborted" + })); + } + function onData(chunk) { + if (complete) return; + received += chunk.length; + if (limit !== null && received > limit) { + done(createError2(413, "request entity too large", { + limit, + received, + type: "entity.too.large" + })); + } else if (decoder) { + buffer += decoder.write(chunk); + } else { + buffer.push(chunk); + } + } + function onEnd(err) { + if (complete) return; + if (err) return done(err); + if (length !== null && received !== length) { + done(createError2(400, "request size did not match content length", { + expected: length, + length, + received, + type: "request.size.invalid" + })); + } else { + var string = decoder ? buffer + (decoder.end() || "") : Buffer.concat(buffer); + done(null, string); + } + } + function cleanup() { + buffer = null; + stream.removeListener("aborted", onAborted); + stream.removeListener("data", onData); + stream.removeListener("end", onEnd); + stream.removeListener("error", onEnd); + stream.removeListener("close", cleanup); + } + } + } +}); + +// node_modules/ee-first/index.js +var require_ee_first = __commonJS({ + "node_modules/ee-first/index.js"(exports2, module2) { + "use strict"; + module2.exports = first; + function first(stuff, done) { + if (!Array.isArray(stuff)) + throw new TypeError("arg must be an array of [ee, events...] arrays"); + var cleanups = []; + for (var i4 = 0; i4 < stuff.length; i4++) { + var arr = stuff[i4]; + if (!Array.isArray(arr) || arr.length < 2) + throw new TypeError("each array member must be [ee, events...]"); + var ee = arr[0]; + for (var j4 = 1; j4 < arr.length; j4++) { + var event = arr[j4]; + var fn2 = listener(event, callback); + ee.on(event, fn2); + cleanups.push({ + ee, + event, + fn: fn2 + }); + } + } + function callback() { + cleanup(); + done.apply(null, arguments); + } + function cleanup() { + var x4; + for (var i5 = 0; i5 < cleanups.length; i5++) { + x4 = cleanups[i5]; + x4.ee.removeListener(x4.event, x4.fn); + } + } + function thunk(fn3) { + done = fn3; + } + thunk.cancel = cleanup; + return thunk; + } + function listener(event, done) { + return function onevent(arg1) { + var args2 = new Array(arguments.length); + var ee = this; + var err = event === "error" ? arg1 : null; + for (var i4 = 0; i4 < args2.length; i4++) { + args2[i4] = arguments[i4]; + } + done(err, ee, event, args2); + }; + } + } +}); + +// node_modules/on-finished/index.js +var require_on_finished = __commonJS({ + "node_modules/on-finished/index.js"(exports2, module2) { + "use strict"; + module2.exports = onFinished; + module2.exports.isFinished = isFinished; + var first = require_ee_first(); + var defer = typeof setImmediate === "function" ? setImmediate : function(fn2) { + process.nextTick(fn2.bind.apply(fn2, arguments)); + }; + function onFinished(msg, listener) { + if (isFinished(msg) !== false) { + defer(listener, null, msg); + return msg; + } + attachListener(msg, listener); + return msg; + } + function isFinished(msg) { + var socket = msg.socket; + if (typeof msg.finished === "boolean") { + return Boolean(msg.finished || socket && !socket.writable); + } + if (typeof msg.complete === "boolean") { + return Boolean(msg.upgrade || !socket || !socket.readable || msg.complete && !msg.readable); + } + return void 0; + } + function attachFinishedListener(msg, callback) { + var eeMsg; + var eeSocket; + var finished = false; + function onFinish(error2) { + eeMsg.cancel(); + eeSocket.cancel(); + finished = true; + callback(error2); + } + eeMsg = eeSocket = first([[msg, "end", "finish"]], onFinish); + function onSocket(socket) { + msg.removeListener("socket", onSocket); + if (finished) return; + if (eeMsg !== eeSocket) return; + eeSocket = first([[socket, "error", "close"]], onFinish); + } + if (msg.socket) { + onSocket(msg.socket); + return; + } + msg.on("socket", onSocket); + if (msg.socket === void 0) { + patchAssignSocket(msg, onSocket); + } + } + function attachListener(msg, listener) { + var attached = msg.__onFinished; + if (!attached || !attached.queue) { + attached = msg.__onFinished = createListener(msg); + attachFinishedListener(msg, attached); + } + attached.queue.push(listener); + } + function createListener(msg) { + function listener(err) { + if (msg.__onFinished === listener) msg.__onFinished = null; + if (!listener.queue) return; + var queue = listener.queue; + listener.queue = null; + for (var i4 = 0; i4 < queue.length; i4++) { + queue[i4](err, msg); + } + } + listener.queue = []; + return listener; + } + function patchAssignSocket(res, callback) { + var assignSocket = res.assignSocket; + if (typeof assignSocket !== "function") return; + res.assignSocket = function _assignSocket(socket) { + assignSocket.call(this, socket); + callback(socket); + }; + } + } +}); + +// node_modules/body-parser/lib/read.js +var require_read = __commonJS({ + "node_modules/body-parser/lib/read.js"(exports2, module2) { + "use strict"; + var createError2 = require_http_errors(); + var getBody = require_raw_body(); + var iconv = require_lib(); + var onFinished = require_on_finished(); + var zlib = require("zlib"); + module2.exports = read; + function read(req, res, next, parse, debug, options) { + var length; + var opts = options; + var stream; + req._body = true; + var encoding = opts.encoding !== null ? opts.encoding : null; + var verify = opts.verify; + try { + stream = contentstream(req, debug, opts.inflate); + length = stream.length; + stream.length = void 0; + } catch (err) { + return next(err); + } + opts.length = length; + opts.encoding = verify ? null : encoding; + if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) { + return next(createError2(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding.toLowerCase(), + type: "charset.unsupported" + })); + } + debug("read body"); + getBody(stream, opts, function(error2, body) { + if (error2) { + var _error; + if (error2.type === "encoding.unsupported") { + _error = createError2(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding.toLowerCase(), + type: "charset.unsupported" + }); + } else { + _error = createError2(400, error2); + } + stream.resume(); + onFinished(req, function onfinished() { + next(createError2(400, _error)); + }); + return; + } + if (verify) { + try { + debug("verify body"); + verify(req, res, body, encoding); + } catch (err) { + next(createError2(403, err, { + body, + type: err.type || "entity.verify.failed" + })); + return; + } + } + var str = body; + try { + debug("parse body"); + str = typeof body !== "string" && encoding !== null ? iconv.decode(body, encoding) : body; + req.body = parse(str); + } catch (err) { + next(createError2(400, err, { + body: str, + type: err.type || "entity.parse.failed" + })); + return; + } + next(); + }); + } + function contentstream(req, debug, inflate) { + var encoding = (req.headers["content-encoding"] || "identity").toLowerCase(); + var length = req.headers["content-length"]; + var stream; + debug('content-encoding "%s"', encoding); + if (inflate === false && encoding !== "identity") { + throw createError2(415, "content encoding unsupported", { + encoding, + type: "encoding.unsupported" + }); + } + switch (encoding) { + case "deflate": + stream = zlib.createInflate(); + debug("inflate body"); + req.pipe(stream); + break; + case "gzip": + stream = zlib.createGunzip(); + debug("gunzip body"); + req.pipe(stream); + break; + case "identity": + stream = req; + stream.length = length; + break; + default: + throw createError2(415, 'unsupported content encoding "' + encoding + '"', { + encoding, + type: "encoding.unsupported" + }); + } + return stream; + } + } +}); + +// node_modules/media-typer/index.js +var require_media_typer = __commonJS({ + "node_modules/media-typer/index.js"(exports2) { + var paramRegExp = /; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g; + var textRegExp = /^[\u0020-\u007e\u0080-\u00ff]+$/; + var tokenRegExp = /^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/; + var qescRegExp = /\\([\u0000-\u007f])/g; + var quoteRegExp = /([\\"])/g; + var subtypeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/; + var typeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/; + var typeRegExp = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/; + exports2.format = format2; + exports2.parse = parse; + function format2(obj) { + if (!obj || typeof obj !== "object") { + throw new TypeError("argument obj is required"); + } + var parameters = obj.parameters; + var subtype = obj.subtype; + var suffix = obj.suffix; + var type = obj.type; + if (!type || !typeNameRegExp.test(type)) { + throw new TypeError("invalid type"); + } + if (!subtype || !subtypeNameRegExp.test(subtype)) { + throw new TypeError("invalid subtype"); + } + var string = type + "/" + subtype; + if (suffix) { + if (!typeNameRegExp.test(suffix)) { + throw new TypeError("invalid suffix"); + } + string += "+" + suffix; + } + if (parameters && typeof parameters === "object") { + var param; + var params = Object.keys(parameters).sort(); + for (var i4 = 0; i4 < params.length; i4++) { + param = params[i4]; + if (!tokenRegExp.test(param)) { + throw new TypeError("invalid parameter name"); + } + string += "; " + param + "=" + qstring(parameters[param]); + } + } + return string; + } + function parse(string) { + if (!string) { + throw new TypeError("argument string is required"); + } + if (typeof string === "object") { + string = getcontenttype(string); + } + if (typeof string !== "string") { + throw new TypeError("argument string is required to be a string"); + } + var index = string.indexOf(";"); + var type = index !== -1 ? string.substr(0, index) : string; + var key; + var match; + var obj = splitType(type); + var params = {}; + var value; + paramRegExp.lastIndex = index; + while (match = paramRegExp.exec(string)) { + if (match.index !== index) { + throw new TypeError("invalid parameter format"); + } + index += match[0].length; + key = match[1].toLowerCase(); + value = match[2]; + if (value[0] === '"') { + value = value.substr(1, value.length - 2).replace(qescRegExp, "$1"); + } + params[key] = value; + } + if (index !== -1 && index !== string.length) { + throw new TypeError("invalid parameter format"); + } + obj.parameters = params; + return obj; + } + function getcontenttype(obj) { + if (typeof obj.getHeader === "function") { + return obj.getHeader("content-type"); + } + if (typeof obj.headers === "object") { + return obj.headers && obj.headers["content-type"]; + } + } + function qstring(val) { + var str = String(val); + if (tokenRegExp.test(str)) { + return str; + } + if (str.length > 0 && !textRegExp.test(str)) { + throw new TypeError("invalid parameter value"); + } + return '"' + str.replace(quoteRegExp, "\\$1") + '"'; + } + function splitType(string) { + var match = typeRegExp.exec(string.toLowerCase()); + if (!match) { + throw new TypeError("invalid media type"); + } + var type = match[1]; + var subtype = match[2]; + var suffix; + var index = subtype.lastIndexOf("+"); + if (index !== -1) { + suffix = subtype.substr(index + 1); + subtype = subtype.substr(0, index); + } + var obj = { + type, + subtype, + suffix + }; + return obj; + } + } +}); + +// node_modules/mime-db/db.json +var require_db = __commonJS({ + "node_modules/mime-db/db.json"(exports2, module2) { + module2.exports = { + "application/1d-interleaved-parityfec": { + source: "iana" + }, + "application/3gpdash-qoe-report+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/3gpp-ims+xml": { + source: "iana", + compressible: true + }, + "application/3gpphal+json": { + source: "iana", + compressible: true + }, + "application/3gpphalforms+json": { + source: "iana", + compressible: true + }, + "application/a2l": { + source: "iana" + }, + "application/ace+cbor": { + source: "iana" + }, + "application/activemessage": { + source: "iana" + }, + "application/activity+json": { + source: "iana", + compressible: true + }, + "application/alto-costmap+json": { + source: "iana", + compressible: true + }, + "application/alto-costmapfilter+json": { + source: "iana", + compressible: true + }, + "application/alto-directory+json": { + source: "iana", + compressible: true + }, + "application/alto-endpointcost+json": { + source: "iana", + compressible: true + }, + "application/alto-endpointcostparams+json": { + source: "iana", + compressible: true + }, + "application/alto-endpointprop+json": { + source: "iana", + compressible: true + }, + "application/alto-endpointpropparams+json": { + source: "iana", + compressible: true + }, + "application/alto-error+json": { + source: "iana", + compressible: true + }, + "application/alto-networkmap+json": { + source: "iana", + compressible: true + }, + "application/alto-networkmapfilter+json": { + source: "iana", + compressible: true + }, + "application/alto-updatestreamcontrol+json": { + source: "iana", + compressible: true + }, + "application/alto-updatestreamparams+json": { + source: "iana", + compressible: true + }, + "application/aml": { + source: "iana" + }, + "application/andrew-inset": { + source: "iana", + extensions: ["ez"] + }, + "application/applefile": { + source: "iana" + }, + "application/applixware": { + source: "apache", + extensions: ["aw"] + }, + "application/at+jwt": { + source: "iana" + }, + "application/atf": { + source: "iana" + }, + "application/atfx": { + source: "iana" + }, + "application/atom+xml": { + source: "iana", + compressible: true, + extensions: ["atom"] + }, + "application/atomcat+xml": { + source: "iana", + compressible: true, + extensions: ["atomcat"] + }, + "application/atomdeleted+xml": { + source: "iana", + compressible: true, + extensions: ["atomdeleted"] + }, + "application/atomicmail": { + source: "iana" + }, + "application/atomsvc+xml": { + source: "iana", + compressible: true, + extensions: ["atomsvc"] + }, + "application/atsc-dwd+xml": { + source: "iana", + compressible: true, + extensions: ["dwd"] + }, + "application/atsc-dynamic-event-message": { + source: "iana" + }, + "application/atsc-held+xml": { + source: "iana", + compressible: true, + extensions: ["held"] + }, + "application/atsc-rdt+json": { + source: "iana", + compressible: true + }, + "application/atsc-rsat+xml": { + source: "iana", + compressible: true, + extensions: ["rsat"] + }, + "application/atxml": { + source: "iana" + }, + "application/auth-policy+xml": { + source: "iana", + compressible: true + }, + "application/bacnet-xdd+zip": { + source: "iana", + compressible: false + }, + "application/batch-smtp": { + source: "iana" + }, + "application/bdoc": { + compressible: false, + extensions: ["bdoc"] + }, + "application/beep+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/calendar+json": { + source: "iana", + compressible: true + }, + "application/calendar+xml": { + source: "iana", + compressible: true, + extensions: ["xcs"] + }, + "application/call-completion": { + source: "iana" + }, + "application/cals-1840": { + source: "iana" + }, + "application/captive+json": { + source: "iana", + compressible: true + }, + "application/cbor": { + source: "iana" + }, + "application/cbor-seq": { + source: "iana" + }, + "application/cccex": { + source: "iana" + }, + "application/ccmp+xml": { + source: "iana", + compressible: true + }, + "application/ccxml+xml": { + source: "iana", + compressible: true, + extensions: ["ccxml"] + }, + "application/cdfx+xml": { + source: "iana", + compressible: true, + extensions: ["cdfx"] + }, + "application/cdmi-capability": { + source: "iana", + extensions: ["cdmia"] + }, + "application/cdmi-container": { + source: "iana", + extensions: ["cdmic"] + }, + "application/cdmi-domain": { + source: "iana", + extensions: ["cdmid"] + }, + "application/cdmi-object": { + source: "iana", + extensions: ["cdmio"] + }, + "application/cdmi-queue": { + source: "iana", + extensions: ["cdmiq"] + }, + "application/cdni": { + source: "iana" + }, + "application/cea": { + source: "iana" + }, + "application/cea-2018+xml": { + source: "iana", + compressible: true + }, + "application/cellml+xml": { + source: "iana", + compressible: true + }, + "application/cfw": { + source: "iana" + }, + "application/city+json": { + source: "iana", + compressible: true + }, + "application/clr": { + source: "iana" + }, + "application/clue+xml": { + source: "iana", + compressible: true + }, + "application/clue_info+xml": { + source: "iana", + compressible: true + }, + "application/cms": { + source: "iana" + }, + "application/cnrp+xml": { + source: "iana", + compressible: true + }, + "application/coap-group+json": { + source: "iana", + compressible: true + }, + "application/coap-payload": { + source: "iana" + }, + "application/commonground": { + source: "iana" + }, + "application/conference-info+xml": { + source: "iana", + compressible: true + }, + "application/cose": { + source: "iana" + }, + "application/cose-key": { + source: "iana" + }, + "application/cose-key-set": { + source: "iana" + }, + "application/cpl+xml": { + source: "iana", + compressible: true, + extensions: ["cpl"] + }, + "application/csrattrs": { + source: "iana" + }, + "application/csta+xml": { + source: "iana", + compressible: true + }, + "application/cstadata+xml": { + source: "iana", + compressible: true + }, + "application/csvm+json": { + source: "iana", + compressible: true + }, + "application/cu-seeme": { + source: "apache", + extensions: ["cu"] + }, + "application/cwt": { + source: "iana" + }, + "application/cybercash": { + source: "iana" + }, + "application/dart": { + compressible: true + }, + "application/dash+xml": { + source: "iana", + compressible: true, + extensions: ["mpd"] + }, + "application/dash-patch+xml": { + source: "iana", + compressible: true, + extensions: ["mpp"] + }, + "application/dashdelta": { + source: "iana" + }, + "application/davmount+xml": { + source: "iana", + compressible: true, + extensions: ["davmount"] + }, + "application/dca-rft": { + source: "iana" + }, + "application/dcd": { + source: "iana" + }, + "application/dec-dx": { + source: "iana" + }, + "application/dialog-info+xml": { + source: "iana", + compressible: true + }, + "application/dicom": { + source: "iana" + }, + "application/dicom+json": { + source: "iana", + compressible: true + }, + "application/dicom+xml": { + source: "iana", + compressible: true + }, + "application/dii": { + source: "iana" + }, + "application/dit": { + source: "iana" + }, + "application/dns": { + source: "iana" + }, + "application/dns+json": { + source: "iana", + compressible: true + }, + "application/dns-message": { + source: "iana" + }, + "application/docbook+xml": { + source: "apache", + compressible: true, + extensions: ["dbk"] + }, + "application/dots+cbor": { + source: "iana" + }, + "application/dskpp+xml": { + source: "iana", + compressible: true + }, + "application/dssc+der": { + source: "iana", + extensions: ["dssc"] + }, + "application/dssc+xml": { + source: "iana", + compressible: true, + extensions: ["xdssc"] + }, + "application/dvcs": { + source: "iana" + }, + "application/ecmascript": { + source: "iana", + compressible: true, + extensions: ["es", "ecma"] + }, + "application/edi-consent": { + source: "iana" + }, + "application/edi-x12": { + source: "iana", + compressible: false + }, + "application/edifact": { + source: "iana", + compressible: false + }, + "application/efi": { + source: "iana" + }, + "application/elm+json": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/elm+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.cap+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/emergencycalldata.comment+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.control+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.deviceinfo+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.ecall.msd": { + source: "iana" + }, + "application/emergencycalldata.providerinfo+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.serviceinfo+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.subscriberinfo+xml": { + source: "iana", + compressible: true + }, + "application/emergencycalldata.veds+xml": { + source: "iana", + compressible: true + }, + "application/emma+xml": { + source: "iana", + compressible: true, + extensions: ["emma"] + }, + "application/emotionml+xml": { + source: "iana", + compressible: true, + extensions: ["emotionml"] + }, + "application/encaprtp": { + source: "iana" + }, + "application/epp+xml": { + source: "iana", + compressible: true + }, + "application/epub+zip": { + source: "iana", + compressible: false, + extensions: ["epub"] + }, + "application/eshop": { + source: "iana" + }, + "application/exi": { + source: "iana", + extensions: ["exi"] + }, + "application/expect-ct-report+json": { + source: "iana", + compressible: true + }, + "application/express": { + source: "iana", + extensions: ["exp"] + }, + "application/fastinfoset": { + source: "iana" + }, + "application/fastsoap": { + source: "iana" + }, + "application/fdt+xml": { + source: "iana", + compressible: true, + extensions: ["fdt"] + }, + "application/fhir+json": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/fhir+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/fido.trusted-apps+json": { + compressible: true + }, + "application/fits": { + source: "iana" + }, + "application/flexfec": { + source: "iana" + }, + "application/font-sfnt": { + source: "iana" + }, + "application/font-tdpfr": { + source: "iana", + extensions: ["pfr"] + }, + "application/font-woff": { + source: "iana", + compressible: false + }, + "application/framework-attributes+xml": { + source: "iana", + compressible: true + }, + "application/geo+json": { + source: "iana", + compressible: true, + extensions: ["geojson"] + }, + "application/geo+json-seq": { + source: "iana" + }, + "application/geopackage+sqlite3": { + source: "iana" + }, + "application/geoxacml+xml": { + source: "iana", + compressible: true + }, + "application/gltf-buffer": { + source: "iana" + }, + "application/gml+xml": { + source: "iana", + compressible: true, + extensions: ["gml"] + }, + "application/gpx+xml": { + source: "apache", + compressible: true, + extensions: ["gpx"] + }, + "application/gxf": { + source: "apache", + extensions: ["gxf"] + }, + "application/gzip": { + source: "iana", + compressible: false, + extensions: ["gz"] + }, + "application/h224": { + source: "iana" + }, + "application/held+xml": { + source: "iana", + compressible: true + }, + "application/hjson": { + extensions: ["hjson"] + }, + "application/http": { + source: "iana" + }, + "application/hyperstudio": { + source: "iana", + extensions: ["stk"] + }, + "application/ibe-key-request+xml": { + source: "iana", + compressible: true + }, + "application/ibe-pkg-reply+xml": { + source: "iana", + compressible: true + }, + "application/ibe-pp-data": { + source: "iana" + }, + "application/iges": { + source: "iana" + }, + "application/im-iscomposing+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/index": { + source: "iana" + }, + "application/index.cmd": { + source: "iana" + }, + "application/index.obj": { + source: "iana" + }, + "application/index.response": { + source: "iana" + }, + "application/index.vnd": { + source: "iana" + }, + "application/inkml+xml": { + source: "iana", + compressible: true, + extensions: ["ink", "inkml"] + }, + "application/iotp": { + source: "iana" + }, + "application/ipfix": { + source: "iana", + extensions: ["ipfix"] + }, + "application/ipp": { + source: "iana" + }, + "application/isup": { + source: "iana" + }, + "application/its+xml": { + source: "iana", + compressible: true, + extensions: ["its"] + }, + "application/java-archive": { + source: "apache", + compressible: false, + extensions: ["jar", "war", "ear"] + }, + "application/java-serialized-object": { + source: "apache", + compressible: false, + extensions: ["ser"] + }, + "application/java-vm": { + source: "apache", + compressible: false, + extensions: ["class"] + }, + "application/javascript": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["js", "mjs"] + }, + "application/jf2feed+json": { + source: "iana", + compressible: true + }, + "application/jose": { + source: "iana" + }, + "application/jose+json": { + source: "iana", + compressible: true + }, + "application/jrd+json": { + source: "iana", + compressible: true + }, + "application/jscalendar+json": { + source: "iana", + compressible: true + }, + "application/json": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["json", "map"] + }, + "application/json-patch+json": { + source: "iana", + compressible: true + }, + "application/json-seq": { + source: "iana" + }, + "application/json5": { + extensions: ["json5"] + }, + "application/jsonml+json": { + source: "apache", + compressible: true, + extensions: ["jsonml"] + }, + "application/jwk+json": { + source: "iana", + compressible: true + }, + "application/jwk-set+json": { + source: "iana", + compressible: true + }, + "application/jwt": { + source: "iana" + }, + "application/kpml-request+xml": { + source: "iana", + compressible: true + }, + "application/kpml-response+xml": { + source: "iana", + compressible: true + }, + "application/ld+json": { + source: "iana", + compressible: true, + extensions: ["jsonld"] + }, + "application/lgr+xml": { + source: "iana", + compressible: true, + extensions: ["lgr"] + }, + "application/link-format": { + source: "iana" + }, + "application/load-control+xml": { + source: "iana", + compressible: true + }, + "application/lost+xml": { + source: "iana", + compressible: true, + extensions: ["lostxml"] + }, + "application/lostsync+xml": { + source: "iana", + compressible: true + }, + "application/lpf+zip": { + source: "iana", + compressible: false + }, + "application/lxf": { + source: "iana" + }, + "application/mac-binhex40": { + source: "iana", + extensions: ["hqx"] + }, + "application/mac-compactpro": { + source: "apache", + extensions: ["cpt"] + }, + "application/macwriteii": { + source: "iana" + }, + "application/mads+xml": { + source: "iana", + compressible: true, + extensions: ["mads"] + }, + "application/manifest+json": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["webmanifest"] + }, + "application/marc": { + source: "iana", + extensions: ["mrc"] + }, + "application/marcxml+xml": { + source: "iana", + compressible: true, + extensions: ["mrcx"] + }, + "application/mathematica": { + source: "iana", + extensions: ["ma", "nb", "mb"] + }, + "application/mathml+xml": { + source: "iana", + compressible: true, + extensions: ["mathml"] + }, + "application/mathml-content+xml": { + source: "iana", + compressible: true + }, + "application/mathml-presentation+xml": { + source: "iana", + compressible: true + }, + "application/mbms-associated-procedure-description+xml": { + source: "iana", + compressible: true + }, + "application/mbms-deregister+xml": { + source: "iana", + compressible: true + }, + "application/mbms-envelope+xml": { + source: "iana", + compressible: true + }, + "application/mbms-msk+xml": { + source: "iana", + compressible: true + }, + "application/mbms-msk-response+xml": { + source: "iana", + compressible: true + }, + "application/mbms-protection-description+xml": { + source: "iana", + compressible: true + }, + "application/mbms-reception-report+xml": { + source: "iana", + compressible: true + }, + "application/mbms-register+xml": { + source: "iana", + compressible: true + }, + "application/mbms-register-response+xml": { + source: "iana", + compressible: true + }, + "application/mbms-schedule+xml": { + source: "iana", + compressible: true + }, + "application/mbms-user-service-description+xml": { + source: "iana", + compressible: true + }, + "application/mbox": { + source: "iana", + extensions: ["mbox"] + }, + "application/media-policy-dataset+xml": { + source: "iana", + compressible: true, + extensions: ["mpf"] + }, + "application/media_control+xml": { + source: "iana", + compressible: true + }, + "application/mediaservercontrol+xml": { + source: "iana", + compressible: true, + extensions: ["mscml"] + }, + "application/merge-patch+json": { + source: "iana", + compressible: true + }, + "application/metalink+xml": { + source: "apache", + compressible: true, + extensions: ["metalink"] + }, + "application/metalink4+xml": { + source: "iana", + compressible: true, + extensions: ["meta4"] + }, + "application/mets+xml": { + source: "iana", + compressible: true, + extensions: ["mets"] + }, + "application/mf4": { + source: "iana" + }, + "application/mikey": { + source: "iana" + }, + "application/mipc": { + source: "iana" + }, + "application/missing-blocks+cbor-seq": { + source: "iana" + }, + "application/mmt-aei+xml": { + source: "iana", + compressible: true, + extensions: ["maei"] + }, + "application/mmt-usd+xml": { + source: "iana", + compressible: true, + extensions: ["musd"] + }, + "application/mods+xml": { + source: "iana", + compressible: true, + extensions: ["mods"] + }, + "application/moss-keys": { + source: "iana" + }, + "application/moss-signature": { + source: "iana" + }, + "application/mosskey-data": { + source: "iana" + }, + "application/mosskey-request": { + source: "iana" + }, + "application/mp21": { + source: "iana", + extensions: ["m21", "mp21"] + }, + "application/mp4": { + source: "iana", + extensions: ["mp4s", "m4p"] + }, + "application/mpeg4-generic": { + source: "iana" + }, + "application/mpeg4-iod": { + source: "iana" + }, + "application/mpeg4-iod-xmt": { + source: "iana" + }, + "application/mrb-consumer+xml": { + source: "iana", + compressible: true + }, + "application/mrb-publish+xml": { + source: "iana", + compressible: true + }, + "application/msc-ivr+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/msc-mixer+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/msword": { + source: "iana", + compressible: false, + extensions: ["doc", "dot"] + }, + "application/mud+json": { + source: "iana", + compressible: true + }, + "application/multipart-core": { + source: "iana" + }, + "application/mxf": { + source: "iana", + extensions: ["mxf"] + }, + "application/n-quads": { + source: "iana", + extensions: ["nq"] + }, + "application/n-triples": { + source: "iana", + extensions: ["nt"] + }, + "application/nasdata": { + source: "iana" + }, + "application/news-checkgroups": { + source: "iana", + charset: "US-ASCII" + }, + "application/news-groupinfo": { + source: "iana", + charset: "US-ASCII" + }, + "application/news-transmission": { + source: "iana" + }, + "application/nlsml+xml": { + source: "iana", + compressible: true + }, + "application/node": { + source: "iana", + extensions: ["cjs"] + }, + "application/nss": { + source: "iana" + }, + "application/oauth-authz-req+jwt": { + source: "iana" + }, + "application/oblivious-dns-message": { + source: "iana" + }, + "application/ocsp-request": { + source: "iana" + }, + "application/ocsp-response": { + source: "iana" + }, + "application/octet-stream": { + source: "iana", + compressible: false, + extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] + }, + "application/oda": { + source: "iana", + extensions: ["oda"] + }, + "application/odm+xml": { + source: "iana", + compressible: true + }, + "application/odx": { + source: "iana" + }, + "application/oebps-package+xml": { + source: "iana", + compressible: true, + extensions: ["opf"] + }, + "application/ogg": { + source: "iana", + compressible: false, + extensions: ["ogx"] + }, + "application/omdoc+xml": { + source: "apache", + compressible: true, + extensions: ["omdoc"] + }, + "application/onenote": { + source: "apache", + extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"] + }, + "application/opc-nodeset+xml": { + source: "iana", + compressible: true + }, + "application/oscore": { + source: "iana" + }, + "application/oxps": { + source: "iana", + extensions: ["oxps"] + }, + "application/p21": { + source: "iana" + }, + "application/p21+zip": { + source: "iana", + compressible: false + }, + "application/p2p-overlay+xml": { + source: "iana", + compressible: true, + extensions: ["relo"] + }, + "application/parityfec": { + source: "iana" + }, + "application/passport": { + source: "iana" + }, + "application/patch-ops-error+xml": { + source: "iana", + compressible: true, + extensions: ["xer"] + }, + "application/pdf": { + source: "iana", + compressible: false, + extensions: ["pdf"] + }, + "application/pdx": { + source: "iana" + }, + "application/pem-certificate-chain": { + source: "iana" + }, + "application/pgp-encrypted": { + source: "iana", + compressible: false, + extensions: ["pgp"] + }, + "application/pgp-keys": { + source: "iana", + extensions: ["asc"] + }, + "application/pgp-signature": { + source: "iana", + extensions: ["asc", "sig"] + }, + "application/pics-rules": { + source: "apache", + extensions: ["prf"] + }, + "application/pidf+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/pidf-diff+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/pkcs10": { + source: "iana", + extensions: ["p10"] + }, + "application/pkcs12": { + source: "iana" + }, + "application/pkcs7-mime": { + source: "iana", + extensions: ["p7m", "p7c"] + }, + "application/pkcs7-signature": { + source: "iana", + extensions: ["p7s"] + }, + "application/pkcs8": { + source: "iana", + extensions: ["p8"] + }, + "application/pkcs8-encrypted": { + source: "iana" + }, + "application/pkix-attr-cert": { + source: "iana", + extensions: ["ac"] + }, + "application/pkix-cert": { + source: "iana", + extensions: ["cer"] + }, + "application/pkix-crl": { + source: "iana", + extensions: ["crl"] + }, + "application/pkix-pkipath": { + source: "iana", + extensions: ["pkipath"] + }, + "application/pkixcmp": { + source: "iana", + extensions: ["pki"] + }, + "application/pls+xml": { + source: "iana", + compressible: true, + extensions: ["pls"] + }, + "application/poc-settings+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/postscript": { + source: "iana", + compressible: true, + extensions: ["ai", "eps", "ps"] + }, + "application/ppsp-tracker+json": { + source: "iana", + compressible: true + }, + "application/problem+json": { + source: "iana", + compressible: true + }, + "application/problem+xml": { + source: "iana", + compressible: true + }, + "application/provenance+xml": { + source: "iana", + compressible: true, + extensions: ["provx"] + }, + "application/prs.alvestrand.titrax-sheet": { + source: "iana" + }, + "application/prs.cww": { + source: "iana", + extensions: ["cww"] + }, + "application/prs.cyn": { + source: "iana", + charset: "7-BIT" + }, + "application/prs.hpub+zip": { + source: "iana", + compressible: false + }, + "application/prs.nprend": { + source: "iana" + }, + "application/prs.plucker": { + source: "iana" + }, + "application/prs.rdf-xml-crypt": { + source: "iana" + }, + "application/prs.xsf+xml": { + source: "iana", + compressible: true + }, + "application/pskc+xml": { + source: "iana", + compressible: true, + extensions: ["pskcxml"] + }, + "application/pvd+json": { + source: "iana", + compressible: true + }, + "application/qsig": { + source: "iana" + }, + "application/raml+yaml": { + compressible: true, + extensions: ["raml"] + }, + "application/raptorfec": { + source: "iana" + }, + "application/rdap+json": { + source: "iana", + compressible: true + }, + "application/rdf+xml": { + source: "iana", + compressible: true, + extensions: ["rdf", "owl"] + }, + "application/reginfo+xml": { + source: "iana", + compressible: true, + extensions: ["rif"] + }, + "application/relax-ng-compact-syntax": { + source: "iana", + extensions: ["rnc"] + }, + "application/remote-printing": { + source: "iana" + }, + "application/reputon+json": { + source: "iana", + compressible: true + }, + "application/resource-lists+xml": { + source: "iana", + compressible: true, + extensions: ["rl"] + }, + "application/resource-lists-diff+xml": { + source: "iana", + compressible: true, + extensions: ["rld"] + }, + "application/rfc+xml": { + source: "iana", + compressible: true + }, + "application/riscos": { + source: "iana" + }, + "application/rlmi+xml": { + source: "iana", + compressible: true + }, + "application/rls-services+xml": { + source: "iana", + compressible: true, + extensions: ["rs"] + }, + "application/route-apd+xml": { + source: "iana", + compressible: true, + extensions: ["rapd"] + }, + "application/route-s-tsid+xml": { + source: "iana", + compressible: true, + extensions: ["sls"] + }, + "application/route-usd+xml": { + source: "iana", + compressible: true, + extensions: ["rusd"] + }, + "application/rpki-ghostbusters": { + source: "iana", + extensions: ["gbr"] + }, + "application/rpki-manifest": { + source: "iana", + extensions: ["mft"] + }, + "application/rpki-publication": { + source: "iana" + }, + "application/rpki-roa": { + source: "iana", + extensions: ["roa"] + }, + "application/rpki-updown": { + source: "iana" + }, + "application/rsd+xml": { + source: "apache", + compressible: true, + extensions: ["rsd"] + }, + "application/rss+xml": { + source: "apache", + compressible: true, + extensions: ["rss"] + }, + "application/rtf": { + source: "iana", + compressible: true, + extensions: ["rtf"] + }, + "application/rtploopback": { + source: "iana" + }, + "application/rtx": { + source: "iana" + }, + "application/samlassertion+xml": { + source: "iana", + compressible: true + }, + "application/samlmetadata+xml": { + source: "iana", + compressible: true + }, + "application/sarif+json": { + source: "iana", + compressible: true + }, + "application/sarif-external-properties+json": { + source: "iana", + compressible: true + }, + "application/sbe": { + source: "iana" + }, + "application/sbml+xml": { + source: "iana", + compressible: true, + extensions: ["sbml"] + }, + "application/scaip+xml": { + source: "iana", + compressible: true + }, + "application/scim+json": { + source: "iana", + compressible: true + }, + "application/scvp-cv-request": { + source: "iana", + extensions: ["scq"] + }, + "application/scvp-cv-response": { + source: "iana", + extensions: ["scs"] + }, + "application/scvp-vp-request": { + source: "iana", + extensions: ["spq"] + }, + "application/scvp-vp-response": { + source: "iana", + extensions: ["spp"] + }, + "application/sdp": { + source: "iana", + extensions: ["sdp"] + }, + "application/secevent+jwt": { + source: "iana" + }, + "application/senml+cbor": { + source: "iana" + }, + "application/senml+json": { + source: "iana", + compressible: true + }, + "application/senml+xml": { + source: "iana", + compressible: true, + extensions: ["senmlx"] + }, + "application/senml-etch+cbor": { + source: "iana" + }, + "application/senml-etch+json": { + source: "iana", + compressible: true + }, + "application/senml-exi": { + source: "iana" + }, + "application/sensml+cbor": { + source: "iana" + }, + "application/sensml+json": { + source: "iana", + compressible: true + }, + "application/sensml+xml": { + source: "iana", + compressible: true, + extensions: ["sensmlx"] + }, + "application/sensml-exi": { + source: "iana" + }, + "application/sep+xml": { + source: "iana", + compressible: true + }, + "application/sep-exi": { + source: "iana" + }, + "application/session-info": { + source: "iana" + }, + "application/set-payment": { + source: "iana" + }, + "application/set-payment-initiation": { + source: "iana", + extensions: ["setpay"] + }, + "application/set-registration": { + source: "iana" + }, + "application/set-registration-initiation": { + source: "iana", + extensions: ["setreg"] + }, + "application/sgml": { + source: "iana" + }, + "application/sgml-open-catalog": { + source: "iana" + }, + "application/shf+xml": { + source: "iana", + compressible: true, + extensions: ["shf"] + }, + "application/sieve": { + source: "iana", + extensions: ["siv", "sieve"] + }, + "application/simple-filter+xml": { + source: "iana", + compressible: true + }, + "application/simple-message-summary": { + source: "iana" + }, + "application/simplesymbolcontainer": { + source: "iana" + }, + "application/sipc": { + source: "iana" + }, + "application/slate": { + source: "iana" + }, + "application/smil": { + source: "iana" + }, + "application/smil+xml": { + source: "iana", + compressible: true, + extensions: ["smi", "smil"] + }, + "application/smpte336m": { + source: "iana" + }, + "application/soap+fastinfoset": { + source: "iana" + }, + "application/soap+xml": { + source: "iana", + compressible: true + }, + "application/sparql-query": { + source: "iana", + extensions: ["rq"] + }, + "application/sparql-results+xml": { + source: "iana", + compressible: true, + extensions: ["srx"] + }, + "application/spdx+json": { + source: "iana", + compressible: true + }, + "application/spirits-event+xml": { + source: "iana", + compressible: true + }, + "application/sql": { + source: "iana" + }, + "application/srgs": { + source: "iana", + extensions: ["gram"] + }, + "application/srgs+xml": { + source: "iana", + compressible: true, + extensions: ["grxml"] + }, + "application/sru+xml": { + source: "iana", + compressible: true, + extensions: ["sru"] + }, + "application/ssdl+xml": { + source: "apache", + compressible: true, + extensions: ["ssdl"] + }, + "application/ssml+xml": { + source: "iana", + compressible: true, + extensions: ["ssml"] + }, + "application/stix+json": { + source: "iana", + compressible: true + }, + "application/swid+xml": { + source: "iana", + compressible: true, + extensions: ["swidtag"] + }, + "application/tamp-apex-update": { + source: "iana" + }, + "application/tamp-apex-update-confirm": { + source: "iana" + }, + "application/tamp-community-update": { + source: "iana" + }, + "application/tamp-community-update-confirm": { + source: "iana" + }, + "application/tamp-error": { + source: "iana" + }, + "application/tamp-sequence-adjust": { + source: "iana" + }, + "application/tamp-sequence-adjust-confirm": { + source: "iana" + }, + "application/tamp-status-query": { + source: "iana" + }, + "application/tamp-status-response": { + source: "iana" + }, + "application/tamp-update": { + source: "iana" + }, + "application/tamp-update-confirm": { + source: "iana" + }, + "application/tar": { + compressible: true + }, + "application/taxii+json": { + source: "iana", + compressible: true + }, + "application/td+json": { + source: "iana", + compressible: true + }, + "application/tei+xml": { + source: "iana", + compressible: true, + extensions: ["tei", "teicorpus"] + }, + "application/tetra_isi": { + source: "iana" + }, + "application/thraud+xml": { + source: "iana", + compressible: true, + extensions: ["tfi"] + }, + "application/timestamp-query": { + source: "iana" + }, + "application/timestamp-reply": { + source: "iana" + }, + "application/timestamped-data": { + source: "iana", + extensions: ["tsd"] + }, + "application/tlsrpt+gzip": { + source: "iana" + }, + "application/tlsrpt+json": { + source: "iana", + compressible: true + }, + "application/tnauthlist": { + source: "iana" + }, + "application/token-introspection+jwt": { + source: "iana" + }, + "application/toml": { + compressible: true, + extensions: ["toml"] + }, + "application/trickle-ice-sdpfrag": { + source: "iana" + }, + "application/trig": { + source: "iana", + extensions: ["trig"] + }, + "application/ttml+xml": { + source: "iana", + compressible: true, + extensions: ["ttml"] + }, + "application/tve-trigger": { + source: "iana" + }, + "application/tzif": { + source: "iana" + }, + "application/tzif-leap": { + source: "iana" + }, + "application/ubjson": { + compressible: false, + extensions: ["ubj"] + }, + "application/ulpfec": { + source: "iana" + }, + "application/urc-grpsheet+xml": { + source: "iana", + compressible: true + }, + "application/urc-ressheet+xml": { + source: "iana", + compressible: true, + extensions: ["rsheet"] + }, + "application/urc-targetdesc+xml": { + source: "iana", + compressible: true, + extensions: ["td"] + }, + "application/urc-uisocketdesc+xml": { + source: "iana", + compressible: true + }, + "application/vcard+json": { + source: "iana", + compressible: true + }, + "application/vcard+xml": { + source: "iana", + compressible: true + }, + "application/vemmi": { + source: "iana" + }, + "application/vividence.scriptfile": { + source: "apache" + }, + "application/vnd.1000minds.decision-model+xml": { + source: "iana", + compressible: true, + extensions: ["1km"] + }, + "application/vnd.3gpp-prose+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp-prose-pc3ch+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp-v2x-local-service-information": { + source: "iana" + }, + "application/vnd.3gpp.5gnas": { + source: "iana" + }, + "application/vnd.3gpp.access-transfer-events+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.bsf+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.gmop+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.gtpc": { + source: "iana" + }, + "application/vnd.3gpp.interworking-data": { + source: "iana" + }, + "application/vnd.3gpp.lpp": { + source: "iana" + }, + "application/vnd.3gpp.mc-signalling-ear": { + source: "iana" + }, + "application/vnd.3gpp.mcdata-affiliation-command+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcdata-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcdata-payload": { + source: "iana" + }, + "application/vnd.3gpp.mcdata-service-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcdata-signalling": { + source: "iana" + }, + "application/vnd.3gpp.mcdata-ue-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcdata-user-profile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-affiliation-command+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-floor-request+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-location-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-service-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-signed+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-ue-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-ue-init-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcptt-user-profile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-affiliation-command+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-affiliation-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-location-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-service-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-transmission-request+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-ue-config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mcvideo-user-profile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.mid-call+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.ngap": { + source: "iana" + }, + "application/vnd.3gpp.pfcp": { + source: "iana" + }, + "application/vnd.3gpp.pic-bw-large": { + source: "iana", + extensions: ["plb"] + }, + "application/vnd.3gpp.pic-bw-small": { + source: "iana", + extensions: ["psb"] + }, + "application/vnd.3gpp.pic-bw-var": { + source: "iana", + extensions: ["pvb"] + }, + "application/vnd.3gpp.s1ap": { + source: "iana" + }, + "application/vnd.3gpp.sms": { + source: "iana" + }, + "application/vnd.3gpp.sms+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.srvcc-ext+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.srvcc-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.state-and-event-info+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp.ussd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp2.bcmcsinfo+xml": { + source: "iana", + compressible: true + }, + "application/vnd.3gpp2.sms": { + source: "iana" + }, + "application/vnd.3gpp2.tcap": { + source: "iana", + extensions: ["tcap"] + }, + "application/vnd.3lightssoftware.imagescal": { + source: "iana" + }, + "application/vnd.3m.post-it-notes": { + source: "iana", + extensions: ["pwn"] + }, + "application/vnd.accpac.simply.aso": { + source: "iana", + extensions: ["aso"] + }, + "application/vnd.accpac.simply.imp": { + source: "iana", + extensions: ["imp"] + }, + "application/vnd.acucobol": { + source: "iana", + extensions: ["acu"] + }, + "application/vnd.acucorp": { + source: "iana", + extensions: ["atc", "acutc"] + }, + "application/vnd.adobe.air-application-installer-package+zip": { + source: "apache", + compressible: false, + extensions: ["air"] + }, + "application/vnd.adobe.flash.movie": { + source: "iana" + }, + "application/vnd.adobe.formscentral.fcdt": { + source: "iana", + extensions: ["fcdt"] + }, + "application/vnd.adobe.fxp": { + source: "iana", + extensions: ["fxp", "fxpl"] + }, + "application/vnd.adobe.partial-upload": { + source: "iana" + }, + "application/vnd.adobe.xdp+xml": { + source: "iana", + compressible: true, + extensions: ["xdp"] + }, + "application/vnd.adobe.xfdf": { + source: "iana", + extensions: ["xfdf"] + }, + "application/vnd.aether.imp": { + source: "iana" + }, + "application/vnd.afpc.afplinedata": { + source: "iana" + }, + "application/vnd.afpc.afplinedata-pagedef": { + source: "iana" + }, + "application/vnd.afpc.cmoca-cmresource": { + source: "iana" + }, + "application/vnd.afpc.foca-charset": { + source: "iana" + }, + "application/vnd.afpc.foca-codedfont": { + source: "iana" + }, + "application/vnd.afpc.foca-codepage": { + source: "iana" + }, + "application/vnd.afpc.modca": { + source: "iana" + }, + "application/vnd.afpc.modca-cmtable": { + source: "iana" + }, + "application/vnd.afpc.modca-formdef": { + source: "iana" + }, + "application/vnd.afpc.modca-mediummap": { + source: "iana" + }, + "application/vnd.afpc.modca-objectcontainer": { + source: "iana" + }, + "application/vnd.afpc.modca-overlay": { + source: "iana" + }, + "application/vnd.afpc.modca-pagesegment": { + source: "iana" + }, + "application/vnd.age": { + source: "iana", + extensions: ["age"] + }, + "application/vnd.ah-barcode": { + source: "iana" + }, + "application/vnd.ahead.space": { + source: "iana", + extensions: ["ahead"] + }, + "application/vnd.airzip.filesecure.azf": { + source: "iana", + extensions: ["azf"] + }, + "application/vnd.airzip.filesecure.azs": { + source: "iana", + extensions: ["azs"] + }, + "application/vnd.amadeus+json": { + source: "iana", + compressible: true + }, + "application/vnd.amazon.ebook": { + source: "apache", + extensions: ["azw"] + }, + "application/vnd.amazon.mobi8-ebook": { + source: "iana" + }, + "application/vnd.americandynamics.acc": { + source: "iana", + extensions: ["acc"] + }, + "application/vnd.amiga.ami": { + source: "iana", + extensions: ["ami"] + }, + "application/vnd.amundsen.maze+xml": { + source: "iana", + compressible: true + }, + "application/vnd.android.ota": { + source: "iana" + }, + "application/vnd.android.package-archive": { + source: "apache", + compressible: false, + extensions: ["apk"] + }, + "application/vnd.anki": { + source: "iana" + }, + "application/vnd.anser-web-certificate-issue-initiation": { + source: "iana", + extensions: ["cii"] + }, + "application/vnd.anser-web-funds-transfer-initiation": { + source: "apache", + extensions: ["fti"] + }, + "application/vnd.antix.game-component": { + source: "iana", + extensions: ["atx"] + }, + "application/vnd.apache.arrow.file": { + source: "iana" + }, + "application/vnd.apache.arrow.stream": { + source: "iana" + }, + "application/vnd.apache.thrift.binary": { + source: "iana" + }, + "application/vnd.apache.thrift.compact": { + source: "iana" + }, + "application/vnd.apache.thrift.json": { + source: "iana" + }, + "application/vnd.api+json": { + source: "iana", + compressible: true + }, + "application/vnd.aplextor.warrp+json": { + source: "iana", + compressible: true + }, + "application/vnd.apothekende.reservation+json": { + source: "iana", + compressible: true + }, + "application/vnd.apple.installer+xml": { + source: "iana", + compressible: true, + extensions: ["mpkg"] + }, + "application/vnd.apple.keynote": { + source: "iana", + extensions: ["key"] + }, + "application/vnd.apple.mpegurl": { + source: "iana", + extensions: ["m3u8"] + }, + "application/vnd.apple.numbers": { + source: "iana", + extensions: ["numbers"] + }, + "application/vnd.apple.pages": { + source: "iana", + extensions: ["pages"] + }, + "application/vnd.apple.pkpass": { + compressible: false, + extensions: ["pkpass"] + }, + "application/vnd.arastra.swi": { + source: "iana" + }, + "application/vnd.aristanetworks.swi": { + source: "iana", + extensions: ["swi"] + }, + "application/vnd.artisan+json": { + source: "iana", + compressible: true + }, + "application/vnd.artsquare": { + source: "iana" + }, + "application/vnd.astraea-software.iota": { + source: "iana", + extensions: ["iota"] + }, + "application/vnd.audiograph": { + source: "iana", + extensions: ["aep"] + }, + "application/vnd.autopackage": { + source: "iana" + }, + "application/vnd.avalon+json": { + source: "iana", + compressible: true + }, + "application/vnd.avistar+xml": { + source: "iana", + compressible: true + }, + "application/vnd.balsamiq.bmml+xml": { + source: "iana", + compressible: true, + extensions: ["bmml"] + }, + "application/vnd.balsamiq.bmpr": { + source: "iana" + }, + "application/vnd.banana-accounting": { + source: "iana" + }, + "application/vnd.bbf.usp.error": { + source: "iana" + }, + "application/vnd.bbf.usp.msg": { + source: "iana" + }, + "application/vnd.bbf.usp.msg+json": { + source: "iana", + compressible: true + }, + "application/vnd.bekitzur-stech+json": { + source: "iana", + compressible: true + }, + "application/vnd.bint.med-content": { + source: "iana" + }, + "application/vnd.biopax.rdf+xml": { + source: "iana", + compressible: true + }, + "application/vnd.blink-idb-value-wrapper": { + source: "iana" + }, + "application/vnd.blueice.multipass": { + source: "iana", + extensions: ["mpm"] + }, + "application/vnd.bluetooth.ep.oob": { + source: "iana" + }, + "application/vnd.bluetooth.le.oob": { + source: "iana" + }, + "application/vnd.bmi": { + source: "iana", + extensions: ["bmi"] + }, + "application/vnd.bpf": { + source: "iana" + }, + "application/vnd.bpf3": { + source: "iana" + }, + "application/vnd.businessobjects": { + source: "iana", + extensions: ["rep"] + }, + "application/vnd.byu.uapi+json": { + source: "iana", + compressible: true + }, + "application/vnd.cab-jscript": { + source: "iana" + }, + "application/vnd.canon-cpdl": { + source: "iana" + }, + "application/vnd.canon-lips": { + source: "iana" + }, + "application/vnd.capasystems-pg+json": { + source: "iana", + compressible: true + }, + "application/vnd.cendio.thinlinc.clientconf": { + source: "iana" + }, + "application/vnd.century-systems.tcp_stream": { + source: "iana" + }, + "application/vnd.chemdraw+xml": { + source: "iana", + compressible: true, + extensions: ["cdxml"] + }, + "application/vnd.chess-pgn": { + source: "iana" + }, + "application/vnd.chipnuts.karaoke-mmd": { + source: "iana", + extensions: ["mmd"] + }, + "application/vnd.ciedi": { + source: "iana" + }, + "application/vnd.cinderella": { + source: "iana", + extensions: ["cdy"] + }, + "application/vnd.cirpack.isdn-ext": { + source: "iana" + }, + "application/vnd.citationstyles.style+xml": { + source: "iana", + compressible: true, + extensions: ["csl"] + }, + "application/vnd.claymore": { + source: "iana", + extensions: ["cla"] + }, + "application/vnd.cloanto.rp9": { + source: "iana", + extensions: ["rp9"] + }, + "application/vnd.clonk.c4group": { + source: "iana", + extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] + }, + "application/vnd.cluetrust.cartomobile-config": { + source: "iana", + extensions: ["c11amc"] + }, + "application/vnd.cluetrust.cartomobile-config-pkg": { + source: "iana", + extensions: ["c11amz"] + }, + "application/vnd.coffeescript": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.document": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.document-template": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.presentation": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.presentation-template": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet": { + source: "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet-template": { + source: "iana" + }, + "application/vnd.collection+json": { + source: "iana", + compressible: true + }, + "application/vnd.collection.doc+json": { + source: "iana", + compressible: true + }, + "application/vnd.collection.next+json": { + source: "iana", + compressible: true + }, + "application/vnd.comicbook+zip": { + source: "iana", + compressible: false + }, + "application/vnd.comicbook-rar": { + source: "iana" + }, + "application/vnd.commerce-battelle": { + source: "iana" + }, + "application/vnd.commonspace": { + source: "iana", + extensions: ["csp"] + }, + "application/vnd.contact.cmsg": { + source: "iana", + extensions: ["cdbcmsg"] + }, + "application/vnd.coreos.ignition+json": { + source: "iana", + compressible: true + }, + "application/vnd.cosmocaller": { + source: "iana", + extensions: ["cmc"] + }, + "application/vnd.crick.clicker": { + source: "iana", + extensions: ["clkx"] + }, + "application/vnd.crick.clicker.keyboard": { + source: "iana", + extensions: ["clkk"] + }, + "application/vnd.crick.clicker.palette": { + source: "iana", + extensions: ["clkp"] + }, + "application/vnd.crick.clicker.template": { + source: "iana", + extensions: ["clkt"] + }, + "application/vnd.crick.clicker.wordbank": { + source: "iana", + extensions: ["clkw"] + }, + "application/vnd.criticaltools.wbs+xml": { + source: "iana", + compressible: true, + extensions: ["wbs"] + }, + "application/vnd.cryptii.pipe+json": { + source: "iana", + compressible: true + }, + "application/vnd.crypto-shade-file": { + source: "iana" + }, + "application/vnd.cryptomator.encrypted": { + source: "iana" + }, + "application/vnd.cryptomator.vault": { + source: "iana" + }, + "application/vnd.ctc-posml": { + source: "iana", + extensions: ["pml"] + }, + "application/vnd.ctct.ws+xml": { + source: "iana", + compressible: true + }, + "application/vnd.cups-pdf": { + source: "iana" + }, + "application/vnd.cups-postscript": { + source: "iana" + }, + "application/vnd.cups-ppd": { + source: "iana", + extensions: ["ppd"] + }, + "application/vnd.cups-raster": { + source: "iana" + }, + "application/vnd.cups-raw": { + source: "iana" + }, + "application/vnd.curl": { + source: "iana" + }, + "application/vnd.curl.car": { + source: "apache", + extensions: ["car"] + }, + "application/vnd.curl.pcurl": { + source: "apache", + extensions: ["pcurl"] + }, + "application/vnd.cyan.dean.root+xml": { + source: "iana", + compressible: true + }, + "application/vnd.cybank": { + source: "iana" + }, + "application/vnd.cyclonedx+json": { + source: "iana", + compressible: true + }, + "application/vnd.cyclonedx+xml": { + source: "iana", + compressible: true + }, + "application/vnd.d2l.coursepackage1p0+zip": { + source: "iana", + compressible: false + }, + "application/vnd.d3m-dataset": { + source: "iana" + }, + "application/vnd.d3m-problem": { + source: "iana" + }, + "application/vnd.dart": { + source: "iana", + compressible: true, + extensions: ["dart"] + }, + "application/vnd.data-vision.rdz": { + source: "iana", + extensions: ["rdz"] + }, + "application/vnd.datapackage+json": { + source: "iana", + compressible: true + }, + "application/vnd.dataresource+json": { + source: "iana", + compressible: true + }, + "application/vnd.dbf": { + source: "iana", + extensions: ["dbf"] + }, + "application/vnd.debian.binary-package": { + source: "iana" + }, + "application/vnd.dece.data": { + source: "iana", + extensions: ["uvf", "uvvf", "uvd", "uvvd"] + }, + "application/vnd.dece.ttml+xml": { + source: "iana", + compressible: true, + extensions: ["uvt", "uvvt"] + }, + "application/vnd.dece.unspecified": { + source: "iana", + extensions: ["uvx", "uvvx"] + }, + "application/vnd.dece.zip": { + source: "iana", + extensions: ["uvz", "uvvz"] + }, + "application/vnd.denovo.fcselayout-link": { + source: "iana", + extensions: ["fe_launch"] + }, + "application/vnd.desmume.movie": { + source: "iana" + }, + "application/vnd.dir-bi.plate-dl-nosuffix": { + source: "iana" + }, + "application/vnd.dm.delegation+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dna": { + source: "iana", + extensions: ["dna"] + }, + "application/vnd.document+json": { + source: "iana", + compressible: true + }, + "application/vnd.dolby.mlp": { + source: "apache", + extensions: ["mlp"] + }, + "application/vnd.dolby.mobile.1": { + source: "iana" + }, + "application/vnd.dolby.mobile.2": { + source: "iana" + }, + "application/vnd.doremir.scorecloud-binary-document": { + source: "iana" + }, + "application/vnd.dpgraph": { + source: "iana", + extensions: ["dpg"] + }, + "application/vnd.dreamfactory": { + source: "iana", + extensions: ["dfac"] + }, + "application/vnd.drive+json": { + source: "iana", + compressible: true + }, + "application/vnd.ds-keypoint": { + source: "apache", + extensions: ["kpxx"] + }, + "application/vnd.dtg.local": { + source: "iana" + }, + "application/vnd.dtg.local.flash": { + source: "iana" + }, + "application/vnd.dtg.local.html": { + source: "iana" + }, + "application/vnd.dvb.ait": { + source: "iana", + extensions: ["ait"] + }, + "application/vnd.dvb.dvbisl+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.dvbj": { + source: "iana" + }, + "application/vnd.dvb.esgcontainer": { + source: "iana" + }, + "application/vnd.dvb.ipdcdftnotifaccess": { + source: "iana" + }, + "application/vnd.dvb.ipdcesgaccess": { + source: "iana" + }, + "application/vnd.dvb.ipdcesgaccess2": { + source: "iana" + }, + "application/vnd.dvb.ipdcesgpdd": { + source: "iana" + }, + "application/vnd.dvb.ipdcroaming": { + source: "iana" + }, + "application/vnd.dvb.iptv.alfec-base": { + source: "iana" + }, + "application/vnd.dvb.iptv.alfec-enhancement": { + source: "iana" + }, + "application/vnd.dvb.notif-aggregate-root+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-container+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-generic+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-ia-msglist+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-ia-registration-request+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-ia-registration-response+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.notif-init+xml": { + source: "iana", + compressible: true + }, + "application/vnd.dvb.pfr": { + source: "iana" + }, + "application/vnd.dvb.service": { + source: "iana", + extensions: ["svc"] + }, + "application/vnd.dxr": { + source: "iana" + }, + "application/vnd.dynageo": { + source: "iana", + extensions: ["geo"] + }, + "application/vnd.dzr": { + source: "iana" + }, + "application/vnd.easykaraoke.cdgdownload": { + source: "iana" + }, + "application/vnd.ecdis-update": { + source: "iana" + }, + "application/vnd.ecip.rlp": { + source: "iana" + }, + "application/vnd.eclipse.ditto+json": { + source: "iana", + compressible: true + }, + "application/vnd.ecowin.chart": { + source: "iana", + extensions: ["mag"] + }, + "application/vnd.ecowin.filerequest": { + source: "iana" + }, + "application/vnd.ecowin.fileupdate": { + source: "iana" + }, + "application/vnd.ecowin.series": { + source: "iana" + }, + "application/vnd.ecowin.seriesrequest": { + source: "iana" + }, + "application/vnd.ecowin.seriesupdate": { + source: "iana" + }, + "application/vnd.efi.img": { + source: "iana" + }, + "application/vnd.efi.iso": { + source: "iana" + }, + "application/vnd.emclient.accessrequest+xml": { + source: "iana", + compressible: true + }, + "application/vnd.enliven": { + source: "iana", + extensions: ["nml"] + }, + "application/vnd.enphase.envoy": { + source: "iana" + }, + "application/vnd.eprints.data+xml": { + source: "iana", + compressible: true + }, + "application/vnd.epson.esf": { + source: "iana", + extensions: ["esf"] + }, + "application/vnd.epson.msf": { + source: "iana", + extensions: ["msf"] + }, + "application/vnd.epson.quickanime": { + source: "iana", + extensions: ["qam"] + }, + "application/vnd.epson.salt": { + source: "iana", + extensions: ["slt"] + }, + "application/vnd.epson.ssf": { + source: "iana", + extensions: ["ssf"] + }, + "application/vnd.ericsson.quickcall": { + source: "iana" + }, + "application/vnd.espass-espass+zip": { + source: "iana", + compressible: false + }, + "application/vnd.eszigno3+xml": { + source: "iana", + compressible: true, + extensions: ["es3", "et3"] + }, + "application/vnd.etsi.aoc+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.asic-e+zip": { + source: "iana", + compressible: false + }, + "application/vnd.etsi.asic-s+zip": { + source: "iana", + compressible: false + }, + "application/vnd.etsi.cug+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvcommand+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvdiscovery+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvprofile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvsad-bc+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvsad-cod+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvsad-npvr+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvservice+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvsync+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.iptvueprofile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.mcid+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.mheg5": { + source: "iana" + }, + "application/vnd.etsi.overload-control-policy-dataset+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.pstn+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.sci+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.simservs+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.timestamp-token": { + source: "iana" + }, + "application/vnd.etsi.tsl+xml": { + source: "iana", + compressible: true + }, + "application/vnd.etsi.tsl.der": { + source: "iana" + }, + "application/vnd.eu.kasparian.car+json": { + source: "iana", + compressible: true + }, + "application/vnd.eudora.data": { + source: "iana" + }, + "application/vnd.evolv.ecig.profile": { + source: "iana" + }, + "application/vnd.evolv.ecig.settings": { + source: "iana" + }, + "application/vnd.evolv.ecig.theme": { + source: "iana" + }, + "application/vnd.exstream-empower+zip": { + source: "iana", + compressible: false + }, + "application/vnd.exstream-package": { + source: "iana" + }, + "application/vnd.ezpix-album": { + source: "iana", + extensions: ["ez2"] + }, + "application/vnd.ezpix-package": { + source: "iana", + extensions: ["ez3"] + }, + "application/vnd.f-secure.mobile": { + source: "iana" + }, + "application/vnd.familysearch.gedcom+zip": { + source: "iana", + compressible: false + }, + "application/vnd.fastcopy-disk-image": { + source: "iana" + }, + "application/vnd.fdf": { + source: "iana", + extensions: ["fdf"] + }, + "application/vnd.fdsn.mseed": { + source: "iana", + extensions: ["mseed"] + }, + "application/vnd.fdsn.seed": { + source: "iana", + extensions: ["seed", "dataless"] + }, + "application/vnd.ffsns": { + source: "iana" + }, + "application/vnd.ficlab.flb+zip": { + source: "iana", + compressible: false + }, + "application/vnd.filmit.zfc": { + source: "iana" + }, + "application/vnd.fints": { + source: "iana" + }, + "application/vnd.firemonkeys.cloudcell": { + source: "iana" + }, + "application/vnd.flographit": { + source: "iana", + extensions: ["gph"] + }, + "application/vnd.fluxtime.clip": { + source: "iana", + extensions: ["ftc"] + }, + "application/vnd.font-fontforge-sfd": { + source: "iana" + }, + "application/vnd.framemaker": { + source: "iana", + extensions: ["fm", "frame", "maker", "book"] + }, + "application/vnd.frogans.fnc": { + source: "iana", + extensions: ["fnc"] + }, + "application/vnd.frogans.ltf": { + source: "iana", + extensions: ["ltf"] + }, + "application/vnd.fsc.weblaunch": { + source: "iana", + extensions: ["fsc"] + }, + "application/vnd.fujifilm.fb.docuworks": { + source: "iana" + }, + "application/vnd.fujifilm.fb.docuworks.binder": { + source: "iana" + }, + "application/vnd.fujifilm.fb.docuworks.container": { + source: "iana" + }, + "application/vnd.fujifilm.fb.jfi+xml": { + source: "iana", + compressible: true + }, + "application/vnd.fujitsu.oasys": { + source: "iana", + extensions: ["oas"] + }, + "application/vnd.fujitsu.oasys2": { + source: "iana", + extensions: ["oa2"] + }, + "application/vnd.fujitsu.oasys3": { + source: "iana", + extensions: ["oa3"] + }, + "application/vnd.fujitsu.oasysgp": { + source: "iana", + extensions: ["fg5"] + }, + "application/vnd.fujitsu.oasysprs": { + source: "iana", + extensions: ["bh2"] + }, + "application/vnd.fujixerox.art-ex": { + source: "iana" + }, + "application/vnd.fujixerox.art4": { + source: "iana" + }, + "application/vnd.fujixerox.ddd": { + source: "iana", + extensions: ["ddd"] + }, + "application/vnd.fujixerox.docuworks": { + source: "iana", + extensions: ["xdw"] + }, + "application/vnd.fujixerox.docuworks.binder": { + source: "iana", + extensions: ["xbd"] + }, + "application/vnd.fujixerox.docuworks.container": { + source: "iana" + }, + "application/vnd.fujixerox.hbpl": { + source: "iana" + }, + "application/vnd.fut-misnet": { + source: "iana" + }, + "application/vnd.futoin+cbor": { + source: "iana" + }, + "application/vnd.futoin+json": { + source: "iana", + compressible: true + }, + "application/vnd.fuzzysheet": { + source: "iana", + extensions: ["fzs"] + }, + "application/vnd.genomatix.tuxedo": { + source: "iana", + extensions: ["txd"] + }, + "application/vnd.gentics.grd+json": { + source: "iana", + compressible: true + }, + "application/vnd.geo+json": { + source: "iana", + compressible: true + }, + "application/vnd.geocube+xml": { + source: "iana", + compressible: true + }, + "application/vnd.geogebra.file": { + source: "iana", + extensions: ["ggb"] + }, + "application/vnd.geogebra.slides": { + source: "iana" + }, + "application/vnd.geogebra.tool": { + source: "iana", + extensions: ["ggt"] + }, + "application/vnd.geometry-explorer": { + source: "iana", + extensions: ["gex", "gre"] + }, + "application/vnd.geonext": { + source: "iana", + extensions: ["gxt"] + }, + "application/vnd.geoplan": { + source: "iana", + extensions: ["g2w"] + }, + "application/vnd.geospace": { + source: "iana", + extensions: ["g3w"] + }, + "application/vnd.gerber": { + source: "iana" + }, + "application/vnd.globalplatform.card-content-mgt": { + source: "iana" + }, + "application/vnd.globalplatform.card-content-mgt-response": { + source: "iana" + }, + "application/vnd.gmx": { + source: "iana", + extensions: ["gmx"] + }, + "application/vnd.google-apps.document": { + compressible: false, + extensions: ["gdoc"] + }, + "application/vnd.google-apps.presentation": { + compressible: false, + extensions: ["gslides"] + }, + "application/vnd.google-apps.spreadsheet": { + compressible: false, + extensions: ["gsheet"] + }, + "application/vnd.google-earth.kml+xml": { + source: "iana", + compressible: true, + extensions: ["kml"] + }, + "application/vnd.google-earth.kmz": { + source: "iana", + compressible: false, + extensions: ["kmz"] + }, + "application/vnd.gov.sk.e-form+xml": { + source: "iana", + compressible: true + }, + "application/vnd.gov.sk.e-form+zip": { + source: "iana", + compressible: false + }, + "application/vnd.gov.sk.xmldatacontainer+xml": { + source: "iana", + compressible: true + }, + "application/vnd.grafeq": { + source: "iana", + extensions: ["gqf", "gqs"] + }, + "application/vnd.gridmp": { + source: "iana" + }, + "application/vnd.groove-account": { + source: "iana", + extensions: ["gac"] + }, + "application/vnd.groove-help": { + source: "iana", + extensions: ["ghf"] + }, + "application/vnd.groove-identity-message": { + source: "iana", + extensions: ["gim"] + }, + "application/vnd.groove-injector": { + source: "iana", + extensions: ["grv"] + }, + "application/vnd.groove-tool-message": { + source: "iana", + extensions: ["gtm"] + }, + "application/vnd.groove-tool-template": { + source: "iana", + extensions: ["tpl"] + }, + "application/vnd.groove-vcard": { + source: "iana", + extensions: ["vcg"] + }, + "application/vnd.hal+json": { + source: "iana", + compressible: true + }, + "application/vnd.hal+xml": { + source: "iana", + compressible: true, + extensions: ["hal"] + }, + "application/vnd.handheld-entertainment+xml": { + source: "iana", + compressible: true, + extensions: ["zmm"] + }, + "application/vnd.hbci": { + source: "iana", + extensions: ["hbci"] + }, + "application/vnd.hc+json": { + source: "iana", + compressible: true + }, + "application/vnd.hcl-bireports": { + source: "iana" + }, + "application/vnd.hdt": { + source: "iana" + }, + "application/vnd.heroku+json": { + source: "iana", + compressible: true + }, + "application/vnd.hhe.lesson-player": { + source: "iana", + extensions: ["les"] + }, + "application/vnd.hl7cda+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.hl7v2+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.hp-hpgl": { + source: "iana", + extensions: ["hpgl"] + }, + "application/vnd.hp-hpid": { + source: "iana", + extensions: ["hpid"] + }, + "application/vnd.hp-hps": { + source: "iana", + extensions: ["hps"] + }, + "application/vnd.hp-jlyt": { + source: "iana", + extensions: ["jlt"] + }, + "application/vnd.hp-pcl": { + source: "iana", + extensions: ["pcl"] + }, + "application/vnd.hp-pclxl": { + source: "iana", + extensions: ["pclxl"] + }, + "application/vnd.httphone": { + source: "iana" + }, + "application/vnd.hydrostatix.sof-data": { + source: "iana", + extensions: ["sfd-hdstx"] + }, + "application/vnd.hyper+json": { + source: "iana", + compressible: true + }, + "application/vnd.hyper-item+json": { + source: "iana", + compressible: true + }, + "application/vnd.hyperdrive+json": { + source: "iana", + compressible: true + }, + "application/vnd.hzn-3d-crossword": { + source: "iana" + }, + "application/vnd.ibm.afplinedata": { + source: "iana" + }, + "application/vnd.ibm.electronic-media": { + source: "iana" + }, + "application/vnd.ibm.minipay": { + source: "iana", + extensions: ["mpy"] + }, + "application/vnd.ibm.modcap": { + source: "iana", + extensions: ["afp", "listafp", "list3820"] + }, + "application/vnd.ibm.rights-management": { + source: "iana", + extensions: ["irm"] + }, + "application/vnd.ibm.secure-container": { + source: "iana", + extensions: ["sc"] + }, + "application/vnd.iccprofile": { + source: "iana", + extensions: ["icc", "icm"] + }, + "application/vnd.ieee.1905": { + source: "iana" + }, + "application/vnd.igloader": { + source: "iana", + extensions: ["igl"] + }, + "application/vnd.imagemeter.folder+zip": { + source: "iana", + compressible: false + }, + "application/vnd.imagemeter.image+zip": { + source: "iana", + compressible: false + }, + "application/vnd.immervision-ivp": { + source: "iana", + extensions: ["ivp"] + }, + "application/vnd.immervision-ivu": { + source: "iana", + extensions: ["ivu"] + }, + "application/vnd.ims.imsccv1p1": { + source: "iana" + }, + "application/vnd.ims.imsccv1p2": { + source: "iana" + }, + "application/vnd.ims.imsccv1p3": { + source: "iana" + }, + "application/vnd.ims.lis.v2.result+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolconsumerprofile+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolproxy+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolproxy.id+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolsettings+json": { + source: "iana", + compressible: true + }, + "application/vnd.ims.lti.v2.toolsettings.simple+json": { + source: "iana", + compressible: true + }, + "application/vnd.informedcontrol.rms+xml": { + source: "iana", + compressible: true + }, + "application/vnd.informix-visionary": { + source: "iana" + }, + "application/vnd.infotech.project": { + source: "iana" + }, + "application/vnd.infotech.project+xml": { + source: "iana", + compressible: true + }, + "application/vnd.innopath.wamp.notification": { + source: "iana" + }, + "application/vnd.insors.igm": { + source: "iana", + extensions: ["igm"] + }, + "application/vnd.intercon.formnet": { + source: "iana", + extensions: ["xpw", "xpx"] + }, + "application/vnd.intergeo": { + source: "iana", + extensions: ["i2g"] + }, + "application/vnd.intertrust.digibox": { + source: "iana" + }, + "application/vnd.intertrust.nncp": { + source: "iana" + }, + "application/vnd.intu.qbo": { + source: "iana", + extensions: ["qbo"] + }, + "application/vnd.intu.qfx": { + source: "iana", + extensions: ["qfx"] + }, + "application/vnd.iptc.g2.catalogitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.conceptitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.knowledgeitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.newsitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.newsmessage+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.packageitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.iptc.g2.planningitem+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ipunplugged.rcprofile": { + source: "iana", + extensions: ["rcprofile"] + }, + "application/vnd.irepository.package+xml": { + source: "iana", + compressible: true, + extensions: ["irp"] + }, + "application/vnd.is-xpr": { + source: "iana", + extensions: ["xpr"] + }, + "application/vnd.isac.fcs": { + source: "iana", + extensions: ["fcs"] + }, + "application/vnd.iso11783-10+zip": { + source: "iana", + compressible: false + }, + "application/vnd.jam": { + source: "iana", + extensions: ["jam"] + }, + "application/vnd.japannet-directory-service": { + source: "iana" + }, + "application/vnd.japannet-jpnstore-wakeup": { + source: "iana" + }, + "application/vnd.japannet-payment-wakeup": { + source: "iana" + }, + "application/vnd.japannet-registration": { + source: "iana" + }, + "application/vnd.japannet-registration-wakeup": { + source: "iana" + }, + "application/vnd.japannet-setstore-wakeup": { + source: "iana" + }, + "application/vnd.japannet-verification": { + source: "iana" + }, + "application/vnd.japannet-verification-wakeup": { + source: "iana" + }, + "application/vnd.jcp.javame.midlet-rms": { + source: "iana", + extensions: ["rms"] + }, + "application/vnd.jisp": { + source: "iana", + extensions: ["jisp"] + }, + "application/vnd.joost.joda-archive": { + source: "iana", + extensions: ["joda"] + }, + "application/vnd.jsk.isdn-ngn": { + source: "iana" + }, + "application/vnd.kahootz": { + source: "iana", + extensions: ["ktz", "ktr"] + }, + "application/vnd.kde.karbon": { + source: "iana", + extensions: ["karbon"] + }, + "application/vnd.kde.kchart": { + source: "iana", + extensions: ["chrt"] + }, + "application/vnd.kde.kformula": { + source: "iana", + extensions: ["kfo"] + }, + "application/vnd.kde.kivio": { + source: "iana", + extensions: ["flw"] + }, + "application/vnd.kde.kontour": { + source: "iana", + extensions: ["kon"] + }, + "application/vnd.kde.kpresenter": { + source: "iana", + extensions: ["kpr", "kpt"] + }, + "application/vnd.kde.kspread": { + source: "iana", + extensions: ["ksp"] + }, + "application/vnd.kde.kword": { + source: "iana", + extensions: ["kwd", "kwt"] + }, + "application/vnd.kenameaapp": { + source: "iana", + extensions: ["htke"] + }, + "application/vnd.kidspiration": { + source: "iana", + extensions: ["kia"] + }, + "application/vnd.kinar": { + source: "iana", + extensions: ["kne", "knp"] + }, + "application/vnd.koan": { + source: "iana", + extensions: ["skp", "skd", "skt", "skm"] + }, + "application/vnd.kodak-descriptor": { + source: "iana", + extensions: ["sse"] + }, + "application/vnd.las": { + source: "iana" + }, + "application/vnd.las.las+json": { + source: "iana", + compressible: true + }, + "application/vnd.las.las+xml": { + source: "iana", + compressible: true, + extensions: ["lasxml"] + }, + "application/vnd.laszip": { + source: "iana" + }, + "application/vnd.leap+json": { + source: "iana", + compressible: true + }, + "application/vnd.liberty-request+xml": { + source: "iana", + compressible: true + }, + "application/vnd.llamagraphics.life-balance.desktop": { + source: "iana", + extensions: ["lbd"] + }, + "application/vnd.llamagraphics.life-balance.exchange+xml": { + source: "iana", + compressible: true, + extensions: ["lbe"] + }, + "application/vnd.logipipe.circuit+zip": { + source: "iana", + compressible: false + }, + "application/vnd.loom": { + source: "iana" + }, + "application/vnd.lotus-1-2-3": { + source: "iana", + extensions: ["123"] + }, + "application/vnd.lotus-approach": { + source: "iana", + extensions: ["apr"] + }, + "application/vnd.lotus-freelance": { + source: "iana", + extensions: ["pre"] + }, + "application/vnd.lotus-notes": { + source: "iana", + extensions: ["nsf"] + }, + "application/vnd.lotus-organizer": { + source: "iana", + extensions: ["org"] + }, + "application/vnd.lotus-screencam": { + source: "iana", + extensions: ["scm"] + }, + "application/vnd.lotus-wordpro": { + source: "iana", + extensions: ["lwp"] + }, + "application/vnd.macports.portpkg": { + source: "iana", + extensions: ["portpkg"] + }, + "application/vnd.mapbox-vector-tile": { + source: "iana", + extensions: ["mvt"] + }, + "application/vnd.marlin.drm.actiontoken+xml": { + source: "iana", + compressible: true + }, + "application/vnd.marlin.drm.conftoken+xml": { + source: "iana", + compressible: true + }, + "application/vnd.marlin.drm.license+xml": { + source: "iana", + compressible: true + }, + "application/vnd.marlin.drm.mdcf": { + source: "iana" + }, + "application/vnd.mason+json": { + source: "iana", + compressible: true + }, + "application/vnd.maxar.archive.3tz+zip": { + source: "iana", + compressible: false + }, + "application/vnd.maxmind.maxmind-db": { + source: "iana" + }, + "application/vnd.mcd": { + source: "iana", + extensions: ["mcd"] + }, + "application/vnd.medcalcdata": { + source: "iana", + extensions: ["mc1"] + }, + "application/vnd.mediastation.cdkey": { + source: "iana", + extensions: ["cdkey"] + }, + "application/vnd.meridian-slingshot": { + source: "iana" + }, + "application/vnd.mfer": { + source: "iana", + extensions: ["mwf"] + }, + "application/vnd.mfmp": { + source: "iana", + extensions: ["mfm"] + }, + "application/vnd.micro+json": { + source: "iana", + compressible: true + }, + "application/vnd.micrografx.flo": { + source: "iana", + extensions: ["flo"] + }, + "application/vnd.micrografx.igx": { + source: "iana", + extensions: ["igx"] + }, + "application/vnd.microsoft.portable-executable": { + source: "iana" + }, + "application/vnd.microsoft.windows.thumbnail-cache": { + source: "iana" + }, + "application/vnd.miele+json": { + source: "iana", + compressible: true + }, + "application/vnd.mif": { + source: "iana", + extensions: ["mif"] + }, + "application/vnd.minisoft-hp3000-save": { + source: "iana" + }, + "application/vnd.mitsubishi.misty-guard.trustweb": { + source: "iana" + }, + "application/vnd.mobius.daf": { + source: "iana", + extensions: ["daf"] + }, + "application/vnd.mobius.dis": { + source: "iana", + extensions: ["dis"] + }, + "application/vnd.mobius.mbk": { + source: "iana", + extensions: ["mbk"] + }, + "application/vnd.mobius.mqy": { + source: "iana", + extensions: ["mqy"] + }, + "application/vnd.mobius.msl": { + source: "iana", + extensions: ["msl"] + }, + "application/vnd.mobius.plc": { + source: "iana", + extensions: ["plc"] + }, + "application/vnd.mobius.txf": { + source: "iana", + extensions: ["txf"] + }, + "application/vnd.mophun.application": { + source: "iana", + extensions: ["mpn"] + }, + "application/vnd.mophun.certificate": { + source: "iana", + extensions: ["mpc"] + }, + "application/vnd.motorola.flexsuite": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.adsi": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.fis": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.gotap": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.kmr": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.ttc": { + source: "iana" + }, + "application/vnd.motorola.flexsuite.wem": { + source: "iana" + }, + "application/vnd.motorola.iprm": { + source: "iana" + }, + "application/vnd.mozilla.xul+xml": { + source: "iana", + compressible: true, + extensions: ["xul"] + }, + "application/vnd.ms-3mfdocument": { + source: "iana" + }, + "application/vnd.ms-artgalry": { + source: "iana", + extensions: ["cil"] + }, + "application/vnd.ms-asf": { + source: "iana" + }, + "application/vnd.ms-cab-compressed": { + source: "iana", + extensions: ["cab"] + }, + "application/vnd.ms-color.iccprofile": { + source: "apache" + }, + "application/vnd.ms-excel": { + source: "iana", + compressible: false, + extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] + }, + "application/vnd.ms-excel.addin.macroenabled.12": { + source: "iana", + extensions: ["xlam"] + }, + "application/vnd.ms-excel.sheet.binary.macroenabled.12": { + source: "iana", + extensions: ["xlsb"] + }, + "application/vnd.ms-excel.sheet.macroenabled.12": { + source: "iana", + extensions: ["xlsm"] + }, + "application/vnd.ms-excel.template.macroenabled.12": { + source: "iana", + extensions: ["xltm"] + }, + "application/vnd.ms-fontobject": { + source: "iana", + compressible: true, + extensions: ["eot"] + }, + "application/vnd.ms-htmlhelp": { + source: "iana", + extensions: ["chm"] + }, + "application/vnd.ms-ims": { + source: "iana", + extensions: ["ims"] + }, + "application/vnd.ms-lrm": { + source: "iana", + extensions: ["lrm"] + }, + "application/vnd.ms-office.activex+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ms-officetheme": { + source: "iana", + extensions: ["thmx"] + }, + "application/vnd.ms-opentype": { + source: "apache", + compressible: true + }, + "application/vnd.ms-outlook": { + compressible: false, + extensions: ["msg"] + }, + "application/vnd.ms-package.obfuscated-opentype": { + source: "apache" + }, + "application/vnd.ms-pki.seccat": { + source: "apache", + extensions: ["cat"] + }, + "application/vnd.ms-pki.stl": { + source: "apache", + extensions: ["stl"] + }, + "application/vnd.ms-playready.initiator+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ms-powerpoint": { + source: "iana", + compressible: false, + extensions: ["ppt", "pps", "pot"] + }, + "application/vnd.ms-powerpoint.addin.macroenabled.12": { + source: "iana", + extensions: ["ppam"] + }, + "application/vnd.ms-powerpoint.presentation.macroenabled.12": { + source: "iana", + extensions: ["pptm"] + }, + "application/vnd.ms-powerpoint.slide.macroenabled.12": { + source: "iana", + extensions: ["sldm"] + }, + "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { + source: "iana", + extensions: ["ppsm"] + }, + "application/vnd.ms-powerpoint.template.macroenabled.12": { + source: "iana", + extensions: ["potm"] + }, + "application/vnd.ms-printdevicecapabilities+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ms-printing.printticket+xml": { + source: "apache", + compressible: true + }, + "application/vnd.ms-printschematicket+xml": { + source: "iana", + compressible: true + }, + "application/vnd.ms-project": { + source: "iana", + extensions: ["mpp", "mpt"] + }, + "application/vnd.ms-tnef": { + source: "iana" + }, + "application/vnd.ms-windows.devicepairing": { + source: "iana" + }, + "application/vnd.ms-windows.nwprinting.oob": { + source: "iana" + }, + "application/vnd.ms-windows.printerpairing": { + source: "iana" + }, + "application/vnd.ms-windows.wsd.oob": { + source: "iana" + }, + "application/vnd.ms-wmdrm.lic-chlg-req": { + source: "iana" + }, + "application/vnd.ms-wmdrm.lic-resp": { + source: "iana" + }, + "application/vnd.ms-wmdrm.meter-chlg-req": { + source: "iana" + }, + "application/vnd.ms-wmdrm.meter-resp": { + source: "iana" + }, + "application/vnd.ms-word.document.macroenabled.12": { + source: "iana", + extensions: ["docm"] + }, + "application/vnd.ms-word.template.macroenabled.12": { + source: "iana", + extensions: ["dotm"] + }, + "application/vnd.ms-works": { + source: "iana", + extensions: ["wps", "wks", "wcm", "wdb"] + }, + "application/vnd.ms-wpl": { + source: "iana", + extensions: ["wpl"] + }, + "application/vnd.ms-xpsdocument": { + source: "iana", + compressible: false, + extensions: ["xps"] + }, + "application/vnd.msa-disk-image": { + source: "iana" + }, + "application/vnd.mseq": { + source: "iana", + extensions: ["mseq"] + }, + "application/vnd.msign": { + source: "iana" + }, + "application/vnd.multiad.creator": { + source: "iana" + }, + "application/vnd.multiad.creator.cif": { + source: "iana" + }, + "application/vnd.music-niff": { + source: "iana" + }, + "application/vnd.musician": { + source: "iana", + extensions: ["mus"] + }, + "application/vnd.muvee.style": { + source: "iana", + extensions: ["msty"] + }, + "application/vnd.mynfc": { + source: "iana", + extensions: ["taglet"] + }, + "application/vnd.nacamar.ybrid+json": { + source: "iana", + compressible: true + }, + "application/vnd.ncd.control": { + source: "iana" + }, + "application/vnd.ncd.reference": { + source: "iana" + }, + "application/vnd.nearst.inv+json": { + source: "iana", + compressible: true + }, + "application/vnd.nebumind.line": { + source: "iana" + }, + "application/vnd.nervana": { + source: "iana" + }, + "application/vnd.netfpx": { + source: "iana" + }, + "application/vnd.neurolanguage.nlu": { + source: "iana", + extensions: ["nlu"] + }, + "application/vnd.nimn": { + source: "iana" + }, + "application/vnd.nintendo.nitro.rom": { + source: "iana" + }, + "application/vnd.nintendo.snes.rom": { + source: "iana" + }, + "application/vnd.nitf": { + source: "iana", + extensions: ["ntf", "nitf"] + }, + "application/vnd.noblenet-directory": { + source: "iana", + extensions: ["nnd"] + }, + "application/vnd.noblenet-sealer": { + source: "iana", + extensions: ["nns"] + }, + "application/vnd.noblenet-web": { + source: "iana", + extensions: ["nnw"] + }, + "application/vnd.nokia.catalogs": { + source: "iana" + }, + "application/vnd.nokia.conml+wbxml": { + source: "iana" + }, + "application/vnd.nokia.conml+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.iptv.config+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.isds-radio-presets": { + source: "iana" + }, + "application/vnd.nokia.landmark+wbxml": { + source: "iana" + }, + "application/vnd.nokia.landmark+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.landmarkcollection+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.n-gage.ac+xml": { + source: "iana", + compressible: true, + extensions: ["ac"] + }, + "application/vnd.nokia.n-gage.data": { + source: "iana", + extensions: ["ngdat"] + }, + "application/vnd.nokia.n-gage.symbian.install": { + source: "iana", + extensions: ["n-gage"] + }, + "application/vnd.nokia.ncd": { + source: "iana" + }, + "application/vnd.nokia.pcd+wbxml": { + source: "iana" + }, + "application/vnd.nokia.pcd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.nokia.radio-preset": { + source: "iana", + extensions: ["rpst"] + }, + "application/vnd.nokia.radio-presets": { + source: "iana", + extensions: ["rpss"] + }, + "application/vnd.novadigm.edm": { + source: "iana", + extensions: ["edm"] + }, + "application/vnd.novadigm.edx": { + source: "iana", + extensions: ["edx"] + }, + "application/vnd.novadigm.ext": { + source: "iana", + extensions: ["ext"] + }, + "application/vnd.ntt-local.content-share": { + source: "iana" + }, + "application/vnd.ntt-local.file-transfer": { + source: "iana" + }, + "application/vnd.ntt-local.ogw_remote-access": { + source: "iana" + }, + "application/vnd.ntt-local.sip-ta_remote": { + source: "iana" + }, + "application/vnd.ntt-local.sip-ta_tcp_stream": { + source: "iana" + }, + "application/vnd.oasis.opendocument.chart": { + source: "iana", + extensions: ["odc"] + }, + "application/vnd.oasis.opendocument.chart-template": { + source: "iana", + extensions: ["otc"] + }, + "application/vnd.oasis.opendocument.database": { + source: "iana", + extensions: ["odb"] + }, + "application/vnd.oasis.opendocument.formula": { + source: "iana", + extensions: ["odf"] + }, + "application/vnd.oasis.opendocument.formula-template": { + source: "iana", + extensions: ["odft"] + }, + "application/vnd.oasis.opendocument.graphics": { + source: "iana", + compressible: false, + extensions: ["odg"] + }, + "application/vnd.oasis.opendocument.graphics-template": { + source: "iana", + extensions: ["otg"] + }, + "application/vnd.oasis.opendocument.image": { + source: "iana", + extensions: ["odi"] + }, + "application/vnd.oasis.opendocument.image-template": { + source: "iana", + extensions: ["oti"] + }, + "application/vnd.oasis.opendocument.presentation": { + source: "iana", + compressible: false, + extensions: ["odp"] + }, + "application/vnd.oasis.opendocument.presentation-template": { + source: "iana", + extensions: ["otp"] + }, + "application/vnd.oasis.opendocument.spreadsheet": { + source: "iana", + compressible: false, + extensions: ["ods"] + }, + "application/vnd.oasis.opendocument.spreadsheet-template": { + source: "iana", + extensions: ["ots"] + }, + "application/vnd.oasis.opendocument.text": { + source: "iana", + compressible: false, + extensions: ["odt"] + }, + "application/vnd.oasis.opendocument.text-master": { + source: "iana", + extensions: ["odm"] + }, + "application/vnd.oasis.opendocument.text-template": { + source: "iana", + extensions: ["ott"] + }, + "application/vnd.oasis.opendocument.text-web": { + source: "iana", + extensions: ["oth"] + }, + "application/vnd.obn": { + source: "iana" + }, + "application/vnd.ocf+cbor": { + source: "iana" + }, + "application/vnd.oci.image.manifest.v1+json": { + source: "iana", + compressible: true + }, + "application/vnd.oftn.l10n+json": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.contentaccessdownload+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.contentaccessstreaming+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.cspg-hexbinary": { + source: "iana" + }, + "application/vnd.oipf.dae.svg+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.dae.xhtml+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.mippvcontrolmessage+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.pae.gem": { + source: "iana" + }, + "application/vnd.oipf.spdiscovery+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.spdlist+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.ueprofile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oipf.userprofile+xml": { + source: "iana", + compressible: true + }, + "application/vnd.olpc-sugar": { + source: "iana", + extensions: ["xo"] + }, + "application/vnd.oma-scws-config": { + source: "iana" + }, + "application/vnd.oma-scws-http-request": { + source: "iana" + }, + "application/vnd.oma-scws-http-response": { + source: "iana" + }, + "application/vnd.oma.bcast.associated-procedure-parameter+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.drm-trigger+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.imd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.ltkm": { + source: "iana" + }, + "application/vnd.oma.bcast.notification+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.provisioningtrigger": { + source: "iana" + }, + "application/vnd.oma.bcast.sgboot": { + source: "iana" + }, + "application/vnd.oma.bcast.sgdd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.sgdu": { + source: "iana" + }, + "application/vnd.oma.bcast.simple-symbol-container": { + source: "iana" + }, + "application/vnd.oma.bcast.smartcard-trigger+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.sprov+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.bcast.stkm": { + source: "iana" + }, + "application/vnd.oma.cab-address-book+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.cab-feature-handler+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.cab-pcc+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.cab-subs-invite+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.cab-user-prefs+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.dcd": { + source: "iana" + }, + "application/vnd.oma.dcdc": { + source: "iana" + }, + "application/vnd.oma.dd2+xml": { + source: "iana", + compressible: true, + extensions: ["dd2"] + }, + "application/vnd.oma.drm.risd+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.group-usage-list+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.lwm2m+cbor": { + source: "iana" + }, + "application/vnd.oma.lwm2m+json": { + source: "iana", + compressible: true + }, + "application/vnd.oma.lwm2m+tlv": { + source: "iana" + }, + "application/vnd.oma.pal+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.detailed-progress-report+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.final-report+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.groups+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.invocation-descriptor+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.poc.optimized-progress-report+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.push": { + source: "iana" + }, + "application/vnd.oma.scidm.messages+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oma.xcap-directory+xml": { + source: "iana", + compressible: true + }, + "application/vnd.omads-email+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.omads-file+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.omads-folder+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.omaloc-supl-init": { + source: "iana" + }, + "application/vnd.onepager": { + source: "iana" + }, + "application/vnd.onepagertamp": { + source: "iana" + }, + "application/vnd.onepagertamx": { + source: "iana" + }, + "application/vnd.onepagertat": { + source: "iana" + }, + "application/vnd.onepagertatp": { + source: "iana" + }, + "application/vnd.onepagertatx": { + source: "iana" + }, + "application/vnd.openblox.game+xml": { + source: "iana", + compressible: true, + extensions: ["obgx"] + }, + "application/vnd.openblox.game-binary": { + source: "iana" + }, + "application/vnd.openeye.oeb": { + source: "iana" + }, + "application/vnd.openofficeorg.extension": { + source: "apache", + extensions: ["oxt"] + }, + "application/vnd.openstreetmap.data+xml": { + source: "iana", + compressible: true, + extensions: ["osm"] + }, + "application/vnd.opentimestamps.ots": { + source: "iana" + }, + "application/vnd.openxmlformats-officedocument.custom-properties+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawing+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.extended-properties+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation": { + source: "iana", + compressible: false, + extensions: ["pptx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide": { + source: "iana", + extensions: ["sldx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { + source: "iana", + extensions: ["ppsx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.template": { + source: "iana", + extensions: ["potx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { + source: "iana", + compressible: false, + extensions: ["xlsx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { + source: "iana", + extensions: ["xltx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.theme+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.themeoverride+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.vmldrawing": { + source: "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { + source: "iana", + compressible: false, + extensions: ["docx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { + source: "iana", + extensions: ["dotx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-package.core-properties+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { + source: "iana", + compressible: true + }, + "application/vnd.openxmlformats-package.relationships+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oracle.resource+json": { + source: "iana", + compressible: true + }, + "application/vnd.orange.indata": { + source: "iana" + }, + "application/vnd.osa.netdeploy": { + source: "iana" + }, + "application/vnd.osgeo.mapguide.package": { + source: "iana", + extensions: ["mgp"] + }, + "application/vnd.osgi.bundle": { + source: "iana" + }, + "application/vnd.osgi.dp": { + source: "iana", + extensions: ["dp"] + }, + "application/vnd.osgi.subsystem": { + source: "iana", + extensions: ["esa"] + }, + "application/vnd.otps.ct-kip+xml": { + source: "iana", + compressible: true + }, + "application/vnd.oxli.countgraph": { + source: "iana" + }, + "application/vnd.pagerduty+json": { + source: "iana", + compressible: true + }, + "application/vnd.palm": { + source: "iana", + extensions: ["pdb", "pqa", "oprc"] + }, + "application/vnd.panoply": { + source: "iana" + }, + "application/vnd.paos.xml": { + source: "iana" + }, + "application/vnd.patentdive": { + source: "iana" + }, + "application/vnd.patientecommsdoc": { + source: "iana" + }, + "application/vnd.pawaafile": { + source: "iana", + extensions: ["paw"] + }, + "application/vnd.pcos": { + source: "iana" + }, + "application/vnd.pg.format": { + source: "iana", + extensions: ["str"] + }, + "application/vnd.pg.osasli": { + source: "iana", + extensions: ["ei6"] + }, + "application/vnd.piaccess.application-licence": { + source: "iana" + }, + "application/vnd.picsel": { + source: "iana", + extensions: ["efif"] + }, + "application/vnd.pmi.widget": { + source: "iana", + extensions: ["wg"] + }, + "application/vnd.poc.group-advertisement+xml": { + source: "iana", + compressible: true + }, + "application/vnd.pocketlearn": { + source: "iana", + extensions: ["plf"] + }, + "application/vnd.powerbuilder6": { + source: "iana", + extensions: ["pbd"] + }, + "application/vnd.powerbuilder6-s": { + source: "iana" + }, + "application/vnd.powerbuilder7": { + source: "iana" + }, + "application/vnd.powerbuilder7-s": { + source: "iana" + }, + "application/vnd.powerbuilder75": { + source: "iana" + }, + "application/vnd.powerbuilder75-s": { + source: "iana" + }, + "application/vnd.preminet": { + source: "iana" + }, + "application/vnd.previewsystems.box": { + source: "iana", + extensions: ["box"] + }, + "application/vnd.proteus.magazine": { + source: "iana", + extensions: ["mgz"] + }, + "application/vnd.psfs": { + source: "iana" + }, + "application/vnd.publishare-delta-tree": { + source: "iana", + extensions: ["qps"] + }, + "application/vnd.pvi.ptid1": { + source: "iana", + extensions: ["ptid"] + }, + "application/vnd.pwg-multiplexed": { + source: "iana" + }, + "application/vnd.pwg-xhtml-print+xml": { + source: "iana", + compressible: true + }, + "application/vnd.qualcomm.brew-app-res": { + source: "iana" + }, + "application/vnd.quarantainenet": { + source: "iana" + }, + "application/vnd.quark.quarkxpress": { + source: "iana", + extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] + }, + "application/vnd.quobject-quoxdocument": { + source: "iana" + }, + "application/vnd.radisys.moml+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit-conf+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit-conn+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit-dialog+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-audit-stream+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-conf+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-base+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-fax-detect+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-group+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-speech+xml": { + source: "iana", + compressible: true + }, + "application/vnd.radisys.msml-dialog-transform+xml": { + source: "iana", + compressible: true + }, + "application/vnd.rainstor.data": { + source: "iana" + }, + "application/vnd.rapid": { + source: "iana" + }, + "application/vnd.rar": { + source: "iana", + extensions: ["rar"] + }, + "application/vnd.realvnc.bed": { + source: "iana", + extensions: ["bed"] + }, + "application/vnd.recordare.musicxml": { + source: "iana", + extensions: ["mxl"] + }, + "application/vnd.recordare.musicxml+xml": { + source: "iana", + compressible: true, + extensions: ["musicxml"] + }, + "application/vnd.renlearn.rlprint": { + source: "iana" + }, + "application/vnd.resilient.logic": { + source: "iana" + }, + "application/vnd.restful+json": { + source: "iana", + compressible: true + }, + "application/vnd.rig.cryptonote": { + source: "iana", + extensions: ["cryptonote"] + }, + "application/vnd.rim.cod": { + source: "apache", + extensions: ["cod"] + }, + "application/vnd.rn-realmedia": { + source: "apache", + extensions: ["rm"] + }, + "application/vnd.rn-realmedia-vbr": { + source: "apache", + extensions: ["rmvb"] + }, + "application/vnd.route66.link66+xml": { + source: "iana", + compressible: true, + extensions: ["link66"] + }, + "application/vnd.rs-274x": { + source: "iana" + }, + "application/vnd.ruckus.download": { + source: "iana" + }, + "application/vnd.s3sms": { + source: "iana" + }, + "application/vnd.sailingtracker.track": { + source: "iana", + extensions: ["st"] + }, + "application/vnd.sar": { + source: "iana" + }, + "application/vnd.sbm.cid": { + source: "iana" + }, + "application/vnd.sbm.mid2": { + source: "iana" + }, + "application/vnd.scribus": { + source: "iana" + }, + "application/vnd.sealed.3df": { + source: "iana" + }, + "application/vnd.sealed.csf": { + source: "iana" + }, + "application/vnd.sealed.doc": { + source: "iana" + }, + "application/vnd.sealed.eml": { + source: "iana" + }, + "application/vnd.sealed.mht": { + source: "iana" + }, + "application/vnd.sealed.net": { + source: "iana" + }, + "application/vnd.sealed.ppt": { + source: "iana" + }, + "application/vnd.sealed.tiff": { + source: "iana" + }, + "application/vnd.sealed.xls": { + source: "iana" + }, + "application/vnd.sealedmedia.softseal.html": { + source: "iana" + }, + "application/vnd.sealedmedia.softseal.pdf": { + source: "iana" + }, + "application/vnd.seemail": { + source: "iana", + extensions: ["see"] + }, + "application/vnd.seis+json": { + source: "iana", + compressible: true + }, + "application/vnd.sema": { + source: "iana", + extensions: ["sema"] + }, + "application/vnd.semd": { + source: "iana", + extensions: ["semd"] + }, + "application/vnd.semf": { + source: "iana", + extensions: ["semf"] + }, + "application/vnd.shade-save-file": { + source: "iana" + }, + "application/vnd.shana.informed.formdata": { + source: "iana", + extensions: ["ifm"] + }, + "application/vnd.shana.informed.formtemplate": { + source: "iana", + extensions: ["itp"] + }, + "application/vnd.shana.informed.interchange": { + source: "iana", + extensions: ["iif"] + }, + "application/vnd.shana.informed.package": { + source: "iana", + extensions: ["ipk"] + }, + "application/vnd.shootproof+json": { + source: "iana", + compressible: true + }, + "application/vnd.shopkick+json": { + source: "iana", + compressible: true + }, + "application/vnd.shp": { + source: "iana" + }, + "application/vnd.shx": { + source: "iana" + }, + "application/vnd.sigrok.session": { + source: "iana" + }, + "application/vnd.simtech-mindmapper": { + source: "iana", + extensions: ["twd", "twds"] + }, + "application/vnd.siren+json": { + source: "iana", + compressible: true + }, + "application/vnd.smaf": { + source: "iana", + extensions: ["mmf"] + }, + "application/vnd.smart.notebook": { + source: "iana" + }, + "application/vnd.smart.teacher": { + source: "iana", + extensions: ["teacher"] + }, + "application/vnd.snesdev-page-table": { + source: "iana" + }, + "application/vnd.software602.filler.form+xml": { + source: "iana", + compressible: true, + extensions: ["fo"] + }, + "application/vnd.software602.filler.form-xml-zip": { + source: "iana" + }, + "application/vnd.solent.sdkm+xml": { + source: "iana", + compressible: true, + extensions: ["sdkm", "sdkd"] + }, + "application/vnd.spotfire.dxp": { + source: "iana", + extensions: ["dxp"] + }, + "application/vnd.spotfire.sfs": { + source: "iana", + extensions: ["sfs"] + }, + "application/vnd.sqlite3": { + source: "iana" + }, + "application/vnd.sss-cod": { + source: "iana" + }, + "application/vnd.sss-dtf": { + source: "iana" + }, + "application/vnd.sss-ntf": { + source: "iana" + }, + "application/vnd.stardivision.calc": { + source: "apache", + extensions: ["sdc"] + }, + "application/vnd.stardivision.draw": { + source: "apache", + extensions: ["sda"] + }, + "application/vnd.stardivision.impress": { + source: "apache", + extensions: ["sdd"] + }, + "application/vnd.stardivision.math": { + source: "apache", + extensions: ["smf"] + }, + "application/vnd.stardivision.writer": { + source: "apache", + extensions: ["sdw", "vor"] + }, + "application/vnd.stardivision.writer-global": { + source: "apache", + extensions: ["sgl"] + }, + "application/vnd.stepmania.package": { + source: "iana", + extensions: ["smzip"] + }, + "application/vnd.stepmania.stepchart": { + source: "iana", + extensions: ["sm"] + }, + "application/vnd.street-stream": { + source: "iana" + }, + "application/vnd.sun.wadl+xml": { + source: "iana", + compressible: true, + extensions: ["wadl"] + }, + "application/vnd.sun.xml.calc": { + source: "apache", + extensions: ["sxc"] + }, + "application/vnd.sun.xml.calc.template": { + source: "apache", + extensions: ["stc"] + }, + "application/vnd.sun.xml.draw": { + source: "apache", + extensions: ["sxd"] + }, + "application/vnd.sun.xml.draw.template": { + source: "apache", + extensions: ["std"] + }, + "application/vnd.sun.xml.impress": { + source: "apache", + extensions: ["sxi"] + }, + "application/vnd.sun.xml.impress.template": { + source: "apache", + extensions: ["sti"] + }, + "application/vnd.sun.xml.math": { + source: "apache", + extensions: ["sxm"] + }, + "application/vnd.sun.xml.writer": { + source: "apache", + extensions: ["sxw"] + }, + "application/vnd.sun.xml.writer.global": { + source: "apache", + extensions: ["sxg"] + }, + "application/vnd.sun.xml.writer.template": { + source: "apache", + extensions: ["stw"] + }, + "application/vnd.sus-calendar": { + source: "iana", + extensions: ["sus", "susp"] + }, + "application/vnd.svd": { + source: "iana", + extensions: ["svd"] + }, + "application/vnd.swiftview-ics": { + source: "iana" + }, + "application/vnd.sycle+xml": { + source: "iana", + compressible: true + }, + "application/vnd.syft+json": { + source: "iana", + compressible: true + }, + "application/vnd.symbian.install": { + source: "apache", + extensions: ["sis", "sisx"] + }, + "application/vnd.syncml+xml": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["xsm"] + }, + "application/vnd.syncml.dm+wbxml": { + source: "iana", + charset: "UTF-8", + extensions: ["bdm"] + }, + "application/vnd.syncml.dm+xml": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["xdm"] + }, + "application/vnd.syncml.dm.notification": { + source: "iana" + }, + "application/vnd.syncml.dmddf+wbxml": { + source: "iana" + }, + "application/vnd.syncml.dmddf+xml": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["ddf"] + }, + "application/vnd.syncml.dmtnds+wbxml": { + source: "iana" + }, + "application/vnd.syncml.dmtnds+xml": { + source: "iana", + charset: "UTF-8", + compressible: true + }, + "application/vnd.syncml.ds.notification": { + source: "iana" + }, + "application/vnd.tableschema+json": { + source: "iana", + compressible: true + }, + "application/vnd.tao.intent-module-archive": { + source: "iana", + extensions: ["tao"] + }, + "application/vnd.tcpdump.pcap": { + source: "iana", + extensions: ["pcap", "cap", "dmp"] + }, + "application/vnd.think-cell.ppttc+json": { + source: "iana", + compressible: true + }, + "application/vnd.tmd.mediaflex.api+xml": { + source: "iana", + compressible: true + }, + "application/vnd.tml": { + source: "iana" + }, + "application/vnd.tmobile-livetv": { + source: "iana", + extensions: ["tmo"] + }, + "application/vnd.tri.onesource": { + source: "iana" + }, + "application/vnd.trid.tpt": { + source: "iana", + extensions: ["tpt"] + }, + "application/vnd.triscape.mxs": { + source: "iana", + extensions: ["mxs"] + }, + "application/vnd.trueapp": { + source: "iana", + extensions: ["tra"] + }, + "application/vnd.truedoc": { + source: "iana" + }, + "application/vnd.ubisoft.webplayer": { + source: "iana" + }, + "application/vnd.ufdl": { + source: "iana", + extensions: ["ufd", "ufdl"] + }, + "application/vnd.uiq.theme": { + source: "iana", + extensions: ["utz"] + }, + "application/vnd.umajin": { + source: "iana", + extensions: ["umj"] + }, + "application/vnd.unity": { + source: "iana", + extensions: ["unityweb"] + }, + "application/vnd.uoml+xml": { + source: "iana", + compressible: true, + extensions: ["uoml"] + }, + "application/vnd.uplanet.alert": { + source: "iana" + }, + "application/vnd.uplanet.alert-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.bearer-choice": { + source: "iana" + }, + "application/vnd.uplanet.bearer-choice-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.cacheop": { + source: "iana" + }, + "application/vnd.uplanet.cacheop-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.channel": { + source: "iana" + }, + "application/vnd.uplanet.channel-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.list": { + source: "iana" + }, + "application/vnd.uplanet.list-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.listcmd": { + source: "iana" + }, + "application/vnd.uplanet.listcmd-wbxml": { + source: "iana" + }, + "application/vnd.uplanet.signal": { + source: "iana" + }, + "application/vnd.uri-map": { + source: "iana" + }, + "application/vnd.valve.source.material": { + source: "iana" + }, + "application/vnd.vcx": { + source: "iana", + extensions: ["vcx"] + }, + "application/vnd.vd-study": { + source: "iana" + }, + "application/vnd.vectorworks": { + source: "iana" + }, + "application/vnd.vel+json": { + source: "iana", + compressible: true + }, + "application/vnd.verimatrix.vcas": { + source: "iana" + }, + "application/vnd.veritone.aion+json": { + source: "iana", + compressible: true + }, + "application/vnd.veryant.thin": { + source: "iana" + }, + "application/vnd.ves.encrypted": { + source: "iana" + }, + "application/vnd.vidsoft.vidconference": { + source: "iana" + }, + "application/vnd.visio": { + source: "iana", + extensions: ["vsd", "vst", "vss", "vsw"] + }, + "application/vnd.visionary": { + source: "iana", + extensions: ["vis"] + }, + "application/vnd.vividence.scriptfile": { + source: "iana" + }, + "application/vnd.vsf": { + source: "iana", + extensions: ["vsf"] + }, + "application/vnd.wap.sic": { + source: "iana" + }, + "application/vnd.wap.slc": { + source: "iana" + }, + "application/vnd.wap.wbxml": { + source: "iana", + charset: "UTF-8", + extensions: ["wbxml"] + }, + "application/vnd.wap.wmlc": { + source: "iana", + extensions: ["wmlc"] + }, + "application/vnd.wap.wmlscriptc": { + source: "iana", + extensions: ["wmlsc"] + }, + "application/vnd.webturbo": { + source: "iana", + extensions: ["wtb"] + }, + "application/vnd.wfa.dpp": { + source: "iana" + }, + "application/vnd.wfa.p2p": { + source: "iana" + }, + "application/vnd.wfa.wsc": { + source: "iana" + }, + "application/vnd.windows.devicepairing": { + source: "iana" + }, + "application/vnd.wmc": { + source: "iana" + }, + "application/vnd.wmf.bootstrap": { + source: "iana" + }, + "application/vnd.wolfram.mathematica": { + source: "iana" + }, + "application/vnd.wolfram.mathematica.package": { + source: "iana" + }, + "application/vnd.wolfram.player": { + source: "iana", + extensions: ["nbp"] + }, + "application/vnd.wordperfect": { + source: "iana", + extensions: ["wpd"] + }, + "application/vnd.wqd": { + source: "iana", + extensions: ["wqd"] + }, + "application/vnd.wrq-hp3000-labelled": { + source: "iana" + }, + "application/vnd.wt.stf": { + source: "iana", + extensions: ["stf"] + }, + "application/vnd.wv.csp+wbxml": { + source: "iana" + }, + "application/vnd.wv.csp+xml": { + source: "iana", + compressible: true + }, + "application/vnd.wv.ssp+xml": { + source: "iana", + compressible: true + }, + "application/vnd.xacml+json": { + source: "iana", + compressible: true + }, + "application/vnd.xara": { + source: "iana", + extensions: ["xar"] + }, + "application/vnd.xfdl": { + source: "iana", + extensions: ["xfdl"] + }, + "application/vnd.xfdl.webform": { + source: "iana" + }, + "application/vnd.xmi+xml": { + source: "iana", + compressible: true + }, + "application/vnd.xmpie.cpkg": { + source: "iana" + }, + "application/vnd.xmpie.dpkg": { + source: "iana" + }, + "application/vnd.xmpie.plan": { + source: "iana" + }, + "application/vnd.xmpie.ppkg": { + source: "iana" + }, + "application/vnd.xmpie.xlim": { + source: "iana" + }, + "application/vnd.yamaha.hv-dic": { + source: "iana", + extensions: ["hvd"] + }, + "application/vnd.yamaha.hv-script": { + source: "iana", + extensions: ["hvs"] + }, + "application/vnd.yamaha.hv-voice": { + source: "iana", + extensions: ["hvp"] + }, + "application/vnd.yamaha.openscoreformat": { + source: "iana", + extensions: ["osf"] + }, + "application/vnd.yamaha.openscoreformat.osfpvg+xml": { + source: "iana", + compressible: true, + extensions: ["osfpvg"] + }, + "application/vnd.yamaha.remote-setup": { + source: "iana" + }, + "application/vnd.yamaha.smaf-audio": { + source: "iana", + extensions: ["saf"] + }, + "application/vnd.yamaha.smaf-phrase": { + source: "iana", + extensions: ["spf"] + }, + "application/vnd.yamaha.through-ngn": { + source: "iana" + }, + "application/vnd.yamaha.tunnel-udpencap": { + source: "iana" + }, + "application/vnd.yaoweme": { + source: "iana" + }, + "application/vnd.yellowriver-custom-menu": { + source: "iana", + extensions: ["cmp"] + }, + "application/vnd.youtube.yt": { + source: "iana" + }, + "application/vnd.zul": { + source: "iana", + extensions: ["zir", "zirz"] + }, + "application/vnd.zzazz.deck+xml": { + source: "iana", + compressible: true, + extensions: ["zaz"] + }, + "application/voicexml+xml": { + source: "iana", + compressible: true, + extensions: ["vxml"] + }, + "application/voucher-cms+json": { + source: "iana", + compressible: true + }, + "application/vq-rtcpxr": { + source: "iana" + }, + "application/wasm": { + source: "iana", + compressible: true, + extensions: ["wasm"] + }, + "application/watcherinfo+xml": { + source: "iana", + compressible: true, + extensions: ["wif"] + }, + "application/webpush-options+json": { + source: "iana", + compressible: true + }, + "application/whoispp-query": { + source: "iana" + }, + "application/whoispp-response": { + source: "iana" + }, + "application/widget": { + source: "iana", + extensions: ["wgt"] + }, + "application/winhlp": { + source: "apache", + extensions: ["hlp"] + }, + "application/wita": { + source: "iana" + }, + "application/wordperfect5.1": { + source: "iana" + }, + "application/wsdl+xml": { + source: "iana", + compressible: true, + extensions: ["wsdl"] + }, + "application/wspolicy+xml": { + source: "iana", + compressible: true, + extensions: ["wspolicy"] + }, + "application/x-7z-compressed": { + source: "apache", + compressible: false, + extensions: ["7z"] + }, + "application/x-abiword": { + source: "apache", + extensions: ["abw"] + }, + "application/x-ace-compressed": { + source: "apache", + extensions: ["ace"] + }, + "application/x-amf": { + source: "apache" + }, + "application/x-apple-diskimage": { + source: "apache", + extensions: ["dmg"] + }, + "application/x-arj": { + compressible: false, + extensions: ["arj"] + }, + "application/x-authorware-bin": { + source: "apache", + extensions: ["aab", "x32", "u32", "vox"] + }, + "application/x-authorware-map": { + source: "apache", + extensions: ["aam"] + }, + "application/x-authorware-seg": { + source: "apache", + extensions: ["aas"] + }, + "application/x-bcpio": { + source: "apache", + extensions: ["bcpio"] + }, + "application/x-bdoc": { + compressible: false, + extensions: ["bdoc"] + }, + "application/x-bittorrent": { + source: "apache", + extensions: ["torrent"] + }, + "application/x-blorb": { + source: "apache", + extensions: ["blb", "blorb"] + }, + "application/x-bzip": { + source: "apache", + compressible: false, + extensions: ["bz"] + }, + "application/x-bzip2": { + source: "apache", + compressible: false, + extensions: ["bz2", "boz"] + }, + "application/x-cbr": { + source: "apache", + extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] + }, + "application/x-cdlink": { + source: "apache", + extensions: ["vcd"] + }, + "application/x-cfs-compressed": { + source: "apache", + extensions: ["cfs"] + }, + "application/x-chat": { + source: "apache", + extensions: ["chat"] + }, + "application/x-chess-pgn": { + source: "apache", + extensions: ["pgn"] + }, + "application/x-chrome-extension": { + extensions: ["crx"] + }, + "application/x-cocoa": { + source: "nginx", + extensions: ["cco"] + }, + "application/x-compress": { + source: "apache" + }, + "application/x-conference": { + source: "apache", + extensions: ["nsc"] + }, + "application/x-cpio": { + source: "apache", + extensions: ["cpio"] + }, + "application/x-csh": { + source: "apache", + extensions: ["csh"] + }, + "application/x-deb": { + compressible: false + }, + "application/x-debian-package": { + source: "apache", + extensions: ["deb", "udeb"] + }, + "application/x-dgc-compressed": { + source: "apache", + extensions: ["dgc"] + }, + "application/x-director": { + source: "apache", + extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] + }, + "application/x-doom": { + source: "apache", + extensions: ["wad"] + }, + "application/x-dtbncx+xml": { + source: "apache", + compressible: true, + extensions: ["ncx"] + }, + "application/x-dtbook+xml": { + source: "apache", + compressible: true, + extensions: ["dtb"] + }, + "application/x-dtbresource+xml": { + source: "apache", + compressible: true, + extensions: ["res"] + }, + "application/x-dvi": { + source: "apache", + compressible: false, + extensions: ["dvi"] + }, + "application/x-envoy": { + source: "apache", + extensions: ["evy"] + }, + "application/x-eva": { + source: "apache", + extensions: ["eva"] + }, + "application/x-font-bdf": { + source: "apache", + extensions: ["bdf"] + }, + "application/x-font-dos": { + source: "apache" + }, + "application/x-font-framemaker": { + source: "apache" + }, + "application/x-font-ghostscript": { + source: "apache", + extensions: ["gsf"] + }, + "application/x-font-libgrx": { + source: "apache" + }, + "application/x-font-linux-psf": { + source: "apache", + extensions: ["psf"] + }, + "application/x-font-pcf": { + source: "apache", + extensions: ["pcf"] + }, + "application/x-font-snf": { + source: "apache", + extensions: ["snf"] + }, + "application/x-font-speedo": { + source: "apache" + }, + "application/x-font-sunos-news": { + source: "apache" + }, + "application/x-font-type1": { + source: "apache", + extensions: ["pfa", "pfb", "pfm", "afm"] + }, + "application/x-font-vfont": { + source: "apache" + }, + "application/x-freearc": { + source: "apache", + extensions: ["arc"] + }, + "application/x-futuresplash": { + source: "apache", + extensions: ["spl"] + }, + "application/x-gca-compressed": { + source: "apache", + extensions: ["gca"] + }, + "application/x-glulx": { + source: "apache", + extensions: ["ulx"] + }, + "application/x-gnumeric": { + source: "apache", + extensions: ["gnumeric"] + }, + "application/x-gramps-xml": { + source: "apache", + extensions: ["gramps"] + }, + "application/x-gtar": { + source: "apache", + extensions: ["gtar"] + }, + "application/x-gzip": { + source: "apache" + }, + "application/x-hdf": { + source: "apache", + extensions: ["hdf"] + }, + "application/x-httpd-php": { + compressible: true, + extensions: ["php"] + }, + "application/x-install-instructions": { + source: "apache", + extensions: ["install"] + }, + "application/x-iso9660-image": { + source: "apache", + extensions: ["iso"] + }, + "application/x-iwork-keynote-sffkey": { + extensions: ["key"] + }, + "application/x-iwork-numbers-sffnumbers": { + extensions: ["numbers"] + }, + "application/x-iwork-pages-sffpages": { + extensions: ["pages"] + }, + "application/x-java-archive-diff": { + source: "nginx", + extensions: ["jardiff"] + }, + "application/x-java-jnlp-file": { + source: "apache", + compressible: false, + extensions: ["jnlp"] + }, + "application/x-javascript": { + compressible: true + }, + "application/x-keepass2": { + extensions: ["kdbx"] + }, + "application/x-latex": { + source: "apache", + compressible: false, + extensions: ["latex"] + }, + "application/x-lua-bytecode": { + extensions: ["luac"] + }, + "application/x-lzh-compressed": { + source: "apache", + extensions: ["lzh", "lha"] + }, + "application/x-makeself": { + source: "nginx", + extensions: ["run"] + }, + "application/x-mie": { + source: "apache", + extensions: ["mie"] + }, + "application/x-mobipocket-ebook": { + source: "apache", + extensions: ["prc", "mobi"] + }, + "application/x-mpegurl": { + compressible: false + }, + "application/x-ms-application": { + source: "apache", + extensions: ["application"] + }, + "application/x-ms-shortcut": { + source: "apache", + extensions: ["lnk"] + }, + "application/x-ms-wmd": { + source: "apache", + extensions: ["wmd"] + }, + "application/x-ms-wmz": { + source: "apache", + extensions: ["wmz"] + }, + "application/x-ms-xbap": { + source: "apache", + extensions: ["xbap"] + }, + "application/x-msaccess": { + source: "apache", + extensions: ["mdb"] + }, + "application/x-msbinder": { + source: "apache", + extensions: ["obd"] + }, + "application/x-mscardfile": { + source: "apache", + extensions: ["crd"] + }, + "application/x-msclip": { + source: "apache", + extensions: ["clp"] + }, + "application/x-msdos-program": { + extensions: ["exe"] + }, + "application/x-msdownload": { + source: "apache", + extensions: ["exe", "dll", "com", "bat", "msi"] + }, + "application/x-msmediaview": { + source: "apache", + extensions: ["mvb", "m13", "m14"] + }, + "application/x-msmetafile": { + source: "apache", + extensions: ["wmf", "wmz", "emf", "emz"] + }, + "application/x-msmoney": { + source: "apache", + extensions: ["mny"] + }, + "application/x-mspublisher": { + source: "apache", + extensions: ["pub"] + }, + "application/x-msschedule": { + source: "apache", + extensions: ["scd"] + }, + "application/x-msterminal": { + source: "apache", + extensions: ["trm"] + }, + "application/x-mswrite": { + source: "apache", + extensions: ["wri"] + }, + "application/x-netcdf": { + source: "apache", + extensions: ["nc", "cdf"] + }, + "application/x-ns-proxy-autoconfig": { + compressible: true, + extensions: ["pac"] + }, + "application/x-nzb": { + source: "apache", + extensions: ["nzb"] + }, + "application/x-perl": { + source: "nginx", + extensions: ["pl", "pm"] + }, + "application/x-pilot": { + source: "nginx", + extensions: ["prc", "pdb"] + }, + "application/x-pkcs12": { + source: "apache", + compressible: false, + extensions: ["p12", "pfx"] + }, + "application/x-pkcs7-certificates": { + source: "apache", + extensions: ["p7b", "spc"] + }, + "application/x-pkcs7-certreqresp": { + source: "apache", + extensions: ["p7r"] + }, + "application/x-pki-message": { + source: "iana" + }, + "application/x-rar-compressed": { + source: "apache", + compressible: false, + extensions: ["rar"] + }, + "application/x-redhat-package-manager": { + source: "nginx", + extensions: ["rpm"] + }, + "application/x-research-info-systems": { + source: "apache", + extensions: ["ris"] + }, + "application/x-sea": { + source: "nginx", + extensions: ["sea"] + }, + "application/x-sh": { + source: "apache", + compressible: true, + extensions: ["sh"] + }, + "application/x-shar": { + source: "apache", + extensions: ["shar"] + }, + "application/x-shockwave-flash": { + source: "apache", + compressible: false, + extensions: ["swf"] + }, + "application/x-silverlight-app": { + source: "apache", + extensions: ["xap"] + }, + "application/x-sql": { + source: "apache", + extensions: ["sql"] + }, + "application/x-stuffit": { + source: "apache", + compressible: false, + extensions: ["sit"] + }, + "application/x-stuffitx": { + source: "apache", + extensions: ["sitx"] + }, + "application/x-subrip": { + source: "apache", + extensions: ["srt"] + }, + "application/x-sv4cpio": { + source: "apache", + extensions: ["sv4cpio"] + }, + "application/x-sv4crc": { + source: "apache", + extensions: ["sv4crc"] + }, + "application/x-t3vm-image": { + source: "apache", + extensions: ["t3"] + }, + "application/x-tads": { + source: "apache", + extensions: ["gam"] + }, + "application/x-tar": { + source: "apache", + compressible: true, + extensions: ["tar"] + }, + "application/x-tcl": { + source: "apache", + extensions: ["tcl", "tk"] + }, + "application/x-tex": { + source: "apache", + extensions: ["tex"] + }, + "application/x-tex-tfm": { + source: "apache", + extensions: ["tfm"] + }, + "application/x-texinfo": { + source: "apache", + extensions: ["texinfo", "texi"] + }, + "application/x-tgif": { + source: "apache", + extensions: ["obj"] + }, + "application/x-ustar": { + source: "apache", + extensions: ["ustar"] + }, + "application/x-virtualbox-hdd": { + compressible: true, + extensions: ["hdd"] + }, + "application/x-virtualbox-ova": { + compressible: true, + extensions: ["ova"] + }, + "application/x-virtualbox-ovf": { + compressible: true, + extensions: ["ovf"] + }, + "application/x-virtualbox-vbox": { + compressible: true, + extensions: ["vbox"] + }, + "application/x-virtualbox-vbox-extpack": { + compressible: false, + extensions: ["vbox-extpack"] + }, + "application/x-virtualbox-vdi": { + compressible: true, + extensions: ["vdi"] + }, + "application/x-virtualbox-vhd": { + compressible: true, + extensions: ["vhd"] + }, + "application/x-virtualbox-vmdk": { + compressible: true, + extensions: ["vmdk"] + }, + "application/x-wais-source": { + source: "apache", + extensions: ["src"] + }, + "application/x-web-app-manifest+json": { + compressible: true, + extensions: ["webapp"] + }, + "application/x-www-form-urlencoded": { + source: "iana", + compressible: true + }, + "application/x-x509-ca-cert": { + source: "iana", + extensions: ["der", "crt", "pem"] + }, + "application/x-x509-ca-ra-cert": { + source: "iana" + }, + "application/x-x509-next-ca-cert": { + source: "iana" + }, + "application/x-xfig": { + source: "apache", + extensions: ["fig"] + }, + "application/x-xliff+xml": { + source: "apache", + compressible: true, + extensions: ["xlf"] + }, + "application/x-xpinstall": { + source: "apache", + compressible: false, + extensions: ["xpi"] + }, + "application/x-xz": { + source: "apache", + extensions: ["xz"] + }, + "application/x-zmachine": { + source: "apache", + extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] + }, + "application/x400-bp": { + source: "iana" + }, + "application/xacml+xml": { + source: "iana", + compressible: true + }, + "application/xaml+xml": { + source: "apache", + compressible: true, + extensions: ["xaml"] + }, + "application/xcap-att+xml": { + source: "iana", + compressible: true, + extensions: ["xav"] + }, + "application/xcap-caps+xml": { + source: "iana", + compressible: true, + extensions: ["xca"] + }, + "application/xcap-diff+xml": { + source: "iana", + compressible: true, + extensions: ["xdf"] + }, + "application/xcap-el+xml": { + source: "iana", + compressible: true, + extensions: ["xel"] + }, + "application/xcap-error+xml": { + source: "iana", + compressible: true + }, + "application/xcap-ns+xml": { + source: "iana", + compressible: true, + extensions: ["xns"] + }, + "application/xcon-conference-info+xml": { + source: "iana", + compressible: true + }, + "application/xcon-conference-info-diff+xml": { + source: "iana", + compressible: true + }, + "application/xenc+xml": { + source: "iana", + compressible: true, + extensions: ["xenc"] + }, + "application/xhtml+xml": { + source: "iana", + compressible: true, + extensions: ["xhtml", "xht"] + }, + "application/xhtml-voice+xml": { + source: "apache", + compressible: true + }, + "application/xliff+xml": { + source: "iana", + compressible: true, + extensions: ["xlf"] + }, + "application/xml": { + source: "iana", + compressible: true, + extensions: ["xml", "xsl", "xsd", "rng"] + }, + "application/xml-dtd": { + source: "iana", + compressible: true, + extensions: ["dtd"] + }, + "application/xml-external-parsed-entity": { + source: "iana" + }, + "application/xml-patch+xml": { + source: "iana", + compressible: true + }, + "application/xmpp+xml": { + source: "iana", + compressible: true + }, + "application/xop+xml": { + source: "iana", + compressible: true, + extensions: ["xop"] + }, + "application/xproc+xml": { + source: "apache", + compressible: true, + extensions: ["xpl"] + }, + "application/xslt+xml": { + source: "iana", + compressible: true, + extensions: ["xsl", "xslt"] + }, + "application/xspf+xml": { + source: "apache", + compressible: true, + extensions: ["xspf"] + }, + "application/xv+xml": { + source: "iana", + compressible: true, + extensions: ["mxml", "xhvml", "xvml", "xvm"] + }, + "application/yang": { + source: "iana", + extensions: ["yang"] + }, + "application/yang-data+json": { + source: "iana", + compressible: true + }, + "application/yang-data+xml": { + source: "iana", + compressible: true + }, + "application/yang-patch+json": { + source: "iana", + compressible: true + }, + "application/yang-patch+xml": { + source: "iana", + compressible: true + }, + "application/yin+xml": { + source: "iana", + compressible: true, + extensions: ["yin"] + }, + "application/zip": { + source: "iana", + compressible: false, + extensions: ["zip"] + }, + "application/zlib": { + source: "iana" + }, + "application/zstd": { + source: "iana" + }, + "audio/1d-interleaved-parityfec": { + source: "iana" + }, + "audio/32kadpcm": { + source: "iana" + }, + "audio/3gpp": { + source: "iana", + compressible: false, + extensions: ["3gpp"] + }, + "audio/3gpp2": { + source: "iana" + }, + "audio/aac": { + source: "iana" + }, + "audio/ac3": { + source: "iana" + }, + "audio/adpcm": { + source: "apache", + extensions: ["adp"] + }, + "audio/amr": { + source: "iana", + extensions: ["amr"] + }, + "audio/amr-wb": { + source: "iana" + }, + "audio/amr-wb+": { + source: "iana" + }, + "audio/aptx": { + source: "iana" + }, + "audio/asc": { + source: "iana" + }, + "audio/atrac-advanced-lossless": { + source: "iana" + }, + "audio/atrac-x": { + source: "iana" + }, + "audio/atrac3": { + source: "iana" + }, + "audio/basic": { + source: "iana", + compressible: false, + extensions: ["au", "snd"] + }, + "audio/bv16": { + source: "iana" + }, + "audio/bv32": { + source: "iana" + }, + "audio/clearmode": { + source: "iana" + }, + "audio/cn": { + source: "iana" + }, + "audio/dat12": { + source: "iana" + }, + "audio/dls": { + source: "iana" + }, + "audio/dsr-es201108": { + source: "iana" + }, + "audio/dsr-es202050": { + source: "iana" + }, + "audio/dsr-es202211": { + source: "iana" + }, + "audio/dsr-es202212": { + source: "iana" + }, + "audio/dv": { + source: "iana" + }, + "audio/dvi4": { + source: "iana" + }, + "audio/eac3": { + source: "iana" + }, + "audio/encaprtp": { + source: "iana" + }, + "audio/evrc": { + source: "iana" + }, + "audio/evrc-qcp": { + source: "iana" + }, + "audio/evrc0": { + source: "iana" + }, + "audio/evrc1": { + source: "iana" + }, + "audio/evrcb": { + source: "iana" + }, + "audio/evrcb0": { + source: "iana" + }, + "audio/evrcb1": { + source: "iana" + }, + "audio/evrcnw": { + source: "iana" + }, + "audio/evrcnw0": { + source: "iana" + }, + "audio/evrcnw1": { + source: "iana" + }, + "audio/evrcwb": { + source: "iana" + }, + "audio/evrcwb0": { + source: "iana" + }, + "audio/evrcwb1": { + source: "iana" + }, + "audio/evs": { + source: "iana" + }, + "audio/flexfec": { + source: "iana" + }, + "audio/fwdred": { + source: "iana" + }, + "audio/g711-0": { + source: "iana" + }, + "audio/g719": { + source: "iana" + }, + "audio/g722": { + source: "iana" + }, + "audio/g7221": { + source: "iana" + }, + "audio/g723": { + source: "iana" + }, + "audio/g726-16": { + source: "iana" + }, + "audio/g726-24": { + source: "iana" + }, + "audio/g726-32": { + source: "iana" + }, + "audio/g726-40": { + source: "iana" + }, + "audio/g728": { + source: "iana" + }, + "audio/g729": { + source: "iana" + }, + "audio/g7291": { + source: "iana" + }, + "audio/g729d": { + source: "iana" + }, + "audio/g729e": { + source: "iana" + }, + "audio/gsm": { + source: "iana" + }, + "audio/gsm-efr": { + source: "iana" + }, + "audio/gsm-hr-08": { + source: "iana" + }, + "audio/ilbc": { + source: "iana" + }, + "audio/ip-mr_v2.5": { + source: "iana" + }, + "audio/isac": { + source: "apache" + }, + "audio/l16": { + source: "iana" + }, + "audio/l20": { + source: "iana" + }, + "audio/l24": { + source: "iana", + compressible: false + }, + "audio/l8": { + source: "iana" + }, + "audio/lpc": { + source: "iana" + }, + "audio/melp": { + source: "iana" + }, + "audio/melp1200": { + source: "iana" + }, + "audio/melp2400": { + source: "iana" + }, + "audio/melp600": { + source: "iana" + }, + "audio/mhas": { + source: "iana" + }, + "audio/midi": { + source: "apache", + extensions: ["mid", "midi", "kar", "rmi"] + }, + "audio/mobile-xmf": { + source: "iana", + extensions: ["mxmf"] + }, + "audio/mp3": { + compressible: false, + extensions: ["mp3"] + }, + "audio/mp4": { + source: "iana", + compressible: false, + extensions: ["m4a", "mp4a"] + }, + "audio/mp4a-latm": { + source: "iana" + }, + "audio/mpa": { + source: "iana" + }, + "audio/mpa-robust": { + source: "iana" + }, + "audio/mpeg": { + source: "iana", + compressible: false, + extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] + }, + "audio/mpeg4-generic": { + source: "iana" + }, + "audio/musepack": { + source: "apache" + }, + "audio/ogg": { + source: "iana", + compressible: false, + extensions: ["oga", "ogg", "spx", "opus"] + }, + "audio/opus": { + source: "iana" + }, + "audio/parityfec": { + source: "iana" + }, + "audio/pcma": { + source: "iana" + }, + "audio/pcma-wb": { + source: "iana" + }, + "audio/pcmu": { + source: "iana" + }, + "audio/pcmu-wb": { + source: "iana" + }, + "audio/prs.sid": { + source: "iana" + }, + "audio/qcelp": { + source: "iana" + }, + "audio/raptorfec": { + source: "iana" + }, + "audio/red": { + source: "iana" + }, + "audio/rtp-enc-aescm128": { + source: "iana" + }, + "audio/rtp-midi": { + source: "iana" + }, + "audio/rtploopback": { + source: "iana" + }, + "audio/rtx": { + source: "iana" + }, + "audio/s3m": { + source: "apache", + extensions: ["s3m"] + }, + "audio/scip": { + source: "iana" + }, + "audio/silk": { + source: "apache", + extensions: ["sil"] + }, + "audio/smv": { + source: "iana" + }, + "audio/smv-qcp": { + source: "iana" + }, + "audio/smv0": { + source: "iana" + }, + "audio/sofa": { + source: "iana" + }, + "audio/sp-midi": { + source: "iana" + }, + "audio/speex": { + source: "iana" + }, + "audio/t140c": { + source: "iana" + }, + "audio/t38": { + source: "iana" + }, + "audio/telephone-event": { + source: "iana" + }, + "audio/tetra_acelp": { + source: "iana" + }, + "audio/tetra_acelp_bb": { + source: "iana" + }, + "audio/tone": { + source: "iana" + }, + "audio/tsvcis": { + source: "iana" + }, + "audio/uemclip": { + source: "iana" + }, + "audio/ulpfec": { + source: "iana" + }, + "audio/usac": { + source: "iana" + }, + "audio/vdvi": { + source: "iana" + }, + "audio/vmr-wb": { + source: "iana" + }, + "audio/vnd.3gpp.iufp": { + source: "iana" + }, + "audio/vnd.4sb": { + source: "iana" + }, + "audio/vnd.audiokoz": { + source: "iana" + }, + "audio/vnd.celp": { + source: "iana" + }, + "audio/vnd.cisco.nse": { + source: "iana" + }, + "audio/vnd.cmles.radio-events": { + source: "iana" + }, + "audio/vnd.cns.anp1": { + source: "iana" + }, + "audio/vnd.cns.inf1": { + source: "iana" + }, + "audio/vnd.dece.audio": { + source: "iana", + extensions: ["uva", "uvva"] + }, + "audio/vnd.digital-winds": { + source: "iana", + extensions: ["eol"] + }, + "audio/vnd.dlna.adts": { + source: "iana" + }, + "audio/vnd.dolby.heaac.1": { + source: "iana" + }, + "audio/vnd.dolby.heaac.2": { + source: "iana" + }, + "audio/vnd.dolby.mlp": { + source: "iana" + }, + "audio/vnd.dolby.mps": { + source: "iana" + }, + "audio/vnd.dolby.pl2": { + source: "iana" + }, + "audio/vnd.dolby.pl2x": { + source: "iana" + }, + "audio/vnd.dolby.pl2z": { + source: "iana" + }, + "audio/vnd.dolby.pulse.1": { + source: "iana" + }, + "audio/vnd.dra": { + source: "iana", + extensions: ["dra"] + }, + "audio/vnd.dts": { + source: "iana", + extensions: ["dts"] + }, + "audio/vnd.dts.hd": { + source: "iana", + extensions: ["dtshd"] + }, + "audio/vnd.dts.uhd": { + source: "iana" + }, + "audio/vnd.dvb.file": { + source: "iana" + }, + "audio/vnd.everad.plj": { + source: "iana" + }, + "audio/vnd.hns.audio": { + source: "iana" + }, + "audio/vnd.lucent.voice": { + source: "iana", + extensions: ["lvp"] + }, + "audio/vnd.ms-playready.media.pya": { + source: "iana", + extensions: ["pya"] + }, + "audio/vnd.nokia.mobile-xmf": { + source: "iana" + }, + "audio/vnd.nortel.vbk": { + source: "iana" + }, + "audio/vnd.nuera.ecelp4800": { + source: "iana", + extensions: ["ecelp4800"] + }, + "audio/vnd.nuera.ecelp7470": { + source: "iana", + extensions: ["ecelp7470"] + }, + "audio/vnd.nuera.ecelp9600": { + source: "iana", + extensions: ["ecelp9600"] + }, + "audio/vnd.octel.sbc": { + source: "iana" + }, + "audio/vnd.presonus.multitrack": { + source: "iana" + }, + "audio/vnd.qcelp": { + source: "iana" + }, + "audio/vnd.rhetorex.32kadpcm": { + source: "iana" + }, + "audio/vnd.rip": { + source: "iana", + extensions: ["rip"] + }, + "audio/vnd.rn-realaudio": { + compressible: false + }, + "audio/vnd.sealedmedia.softseal.mpeg": { + source: "iana" + }, + "audio/vnd.vmx.cvsd": { + source: "iana" + }, + "audio/vnd.wave": { + compressible: false + }, + "audio/vorbis": { + source: "iana", + compressible: false + }, + "audio/vorbis-config": { + source: "iana" + }, + "audio/wav": { + compressible: false, + extensions: ["wav"] + }, + "audio/wave": { + compressible: false, + extensions: ["wav"] + }, + "audio/webm": { + source: "apache", + compressible: false, + extensions: ["weba"] + }, + "audio/x-aac": { + source: "apache", + compressible: false, + extensions: ["aac"] + }, + "audio/x-aiff": { + source: "apache", + extensions: ["aif", "aiff", "aifc"] + }, + "audio/x-caf": { + source: "apache", + compressible: false, + extensions: ["caf"] + }, + "audio/x-flac": { + source: "apache", + extensions: ["flac"] + }, + "audio/x-m4a": { + source: "nginx", + extensions: ["m4a"] + }, + "audio/x-matroska": { + source: "apache", + extensions: ["mka"] + }, + "audio/x-mpegurl": { + source: "apache", + extensions: ["m3u"] + }, + "audio/x-ms-wax": { + source: "apache", + extensions: ["wax"] + }, + "audio/x-ms-wma": { + source: "apache", + extensions: ["wma"] + }, + "audio/x-pn-realaudio": { + source: "apache", + extensions: ["ram", "ra"] + }, + "audio/x-pn-realaudio-plugin": { + source: "apache", + extensions: ["rmp"] + }, + "audio/x-realaudio": { + source: "nginx", + extensions: ["ra"] + }, + "audio/x-tta": { + source: "apache" + }, + "audio/x-wav": { + source: "apache", + extensions: ["wav"] + }, + "audio/xm": { + source: "apache", + extensions: ["xm"] + }, + "chemical/x-cdx": { + source: "apache", + extensions: ["cdx"] + }, + "chemical/x-cif": { + source: "apache", + extensions: ["cif"] + }, + "chemical/x-cmdf": { + source: "apache", + extensions: ["cmdf"] + }, + "chemical/x-cml": { + source: "apache", + extensions: ["cml"] + }, + "chemical/x-csml": { + source: "apache", + extensions: ["csml"] + }, + "chemical/x-pdb": { + source: "apache" + }, + "chemical/x-xyz": { + source: "apache", + extensions: ["xyz"] + }, + "font/collection": { + source: "iana", + extensions: ["ttc"] + }, + "font/otf": { + source: "iana", + compressible: true, + extensions: ["otf"] + }, + "font/sfnt": { + source: "iana" + }, + "font/ttf": { + source: "iana", + compressible: true, + extensions: ["ttf"] + }, + "font/woff": { + source: "iana", + extensions: ["woff"] + }, + "font/woff2": { + source: "iana", + extensions: ["woff2"] + }, + "image/aces": { + source: "iana", + extensions: ["exr"] + }, + "image/apng": { + compressible: false, + extensions: ["apng"] + }, + "image/avci": { + source: "iana", + extensions: ["avci"] + }, + "image/avcs": { + source: "iana", + extensions: ["avcs"] + }, + "image/avif": { + source: "iana", + compressible: false, + extensions: ["avif"] + }, + "image/bmp": { + source: "iana", + compressible: true, + extensions: ["bmp"] + }, + "image/cgm": { + source: "iana", + extensions: ["cgm"] + }, + "image/dicom-rle": { + source: "iana", + extensions: ["drle"] + }, + "image/emf": { + source: "iana", + extensions: ["emf"] + }, + "image/fits": { + source: "iana", + extensions: ["fits"] + }, + "image/g3fax": { + source: "iana", + extensions: ["g3"] + }, + "image/gif": { + source: "iana", + compressible: false, + extensions: ["gif"] + }, + "image/heic": { + source: "iana", + extensions: ["heic"] + }, + "image/heic-sequence": { + source: "iana", + extensions: ["heics"] + }, + "image/heif": { + source: "iana", + extensions: ["heif"] + }, + "image/heif-sequence": { + source: "iana", + extensions: ["heifs"] + }, + "image/hej2k": { + source: "iana", + extensions: ["hej2"] + }, + "image/hsj2": { + source: "iana", + extensions: ["hsj2"] + }, + "image/ief": { + source: "iana", + extensions: ["ief"] + }, + "image/jls": { + source: "iana", + extensions: ["jls"] + }, + "image/jp2": { + source: "iana", + compressible: false, + extensions: ["jp2", "jpg2"] + }, + "image/jpeg": { + source: "iana", + compressible: false, + extensions: ["jpeg", "jpg", "jpe"] + }, + "image/jph": { + source: "iana", + extensions: ["jph"] + }, + "image/jphc": { + source: "iana", + extensions: ["jhc"] + }, + "image/jpm": { + source: "iana", + compressible: false, + extensions: ["jpm"] + }, + "image/jpx": { + source: "iana", + compressible: false, + extensions: ["jpx", "jpf"] + }, + "image/jxr": { + source: "iana", + extensions: ["jxr"] + }, + "image/jxra": { + source: "iana", + extensions: ["jxra"] + }, + "image/jxrs": { + source: "iana", + extensions: ["jxrs"] + }, + "image/jxs": { + source: "iana", + extensions: ["jxs"] + }, + "image/jxsc": { + source: "iana", + extensions: ["jxsc"] + }, + "image/jxsi": { + source: "iana", + extensions: ["jxsi"] + }, + "image/jxss": { + source: "iana", + extensions: ["jxss"] + }, + "image/ktx": { + source: "iana", + extensions: ["ktx"] + }, + "image/ktx2": { + source: "iana", + extensions: ["ktx2"] + }, + "image/naplps": { + source: "iana" + }, + "image/pjpeg": { + compressible: false + }, + "image/png": { + source: "iana", + compressible: false, + extensions: ["png"] + }, + "image/prs.btif": { + source: "iana", + extensions: ["btif"] + }, + "image/prs.pti": { + source: "iana", + extensions: ["pti"] + }, + "image/pwg-raster": { + source: "iana" + }, + "image/sgi": { + source: "apache", + extensions: ["sgi"] + }, + "image/svg+xml": { + source: "iana", + compressible: true, + extensions: ["svg", "svgz"] + }, + "image/t38": { + source: "iana", + extensions: ["t38"] + }, + "image/tiff": { + source: "iana", + compressible: false, + extensions: ["tif", "tiff"] + }, + "image/tiff-fx": { + source: "iana", + extensions: ["tfx"] + }, + "image/vnd.adobe.photoshop": { + source: "iana", + compressible: true, + extensions: ["psd"] + }, + "image/vnd.airzip.accelerator.azv": { + source: "iana", + extensions: ["azv"] + }, + "image/vnd.cns.inf2": { + source: "iana" + }, + "image/vnd.dece.graphic": { + source: "iana", + extensions: ["uvi", "uvvi", "uvg", "uvvg"] + }, + "image/vnd.djvu": { + source: "iana", + extensions: ["djvu", "djv"] + }, + "image/vnd.dvb.subtitle": { + source: "iana", + extensions: ["sub"] + }, + "image/vnd.dwg": { + source: "iana", + extensions: ["dwg"] + }, + "image/vnd.dxf": { + source: "iana", + extensions: ["dxf"] + }, + "image/vnd.fastbidsheet": { + source: "iana", + extensions: ["fbs"] + }, + "image/vnd.fpx": { + source: "iana", + extensions: ["fpx"] + }, + "image/vnd.fst": { + source: "iana", + extensions: ["fst"] + }, + "image/vnd.fujixerox.edmics-mmr": { + source: "iana", + extensions: ["mmr"] + }, + "image/vnd.fujixerox.edmics-rlc": { + source: "iana", + extensions: ["rlc"] + }, + "image/vnd.globalgraphics.pgb": { + source: "iana" + }, + "image/vnd.microsoft.icon": { + source: "iana", + compressible: true, + extensions: ["ico"] + }, + "image/vnd.mix": { + source: "iana" + }, + "image/vnd.mozilla.apng": { + source: "iana" + }, + "image/vnd.ms-dds": { + compressible: true, + extensions: ["dds"] + }, + "image/vnd.ms-modi": { + source: "iana", + extensions: ["mdi"] + }, + "image/vnd.ms-photo": { + source: "apache", + extensions: ["wdp"] + }, + "image/vnd.net-fpx": { + source: "iana", + extensions: ["npx"] + }, + "image/vnd.pco.b16": { + source: "iana", + extensions: ["b16"] + }, + "image/vnd.radiance": { + source: "iana" + }, + "image/vnd.sealed.png": { + source: "iana" + }, + "image/vnd.sealedmedia.softseal.gif": { + source: "iana" + }, + "image/vnd.sealedmedia.softseal.jpg": { + source: "iana" + }, + "image/vnd.svf": { + source: "iana" + }, + "image/vnd.tencent.tap": { + source: "iana", + extensions: ["tap"] + }, + "image/vnd.valve.source.texture": { + source: "iana", + extensions: ["vtf"] + }, + "image/vnd.wap.wbmp": { + source: "iana", + extensions: ["wbmp"] + }, + "image/vnd.xiff": { + source: "iana", + extensions: ["xif"] + }, + "image/vnd.zbrush.pcx": { + source: "iana", + extensions: ["pcx"] + }, + "image/webp": { + source: "apache", + extensions: ["webp"] + }, + "image/wmf": { + source: "iana", + extensions: ["wmf"] + }, + "image/x-3ds": { + source: "apache", + extensions: ["3ds"] + }, + "image/x-cmu-raster": { + source: "apache", + extensions: ["ras"] + }, + "image/x-cmx": { + source: "apache", + extensions: ["cmx"] + }, + "image/x-freehand": { + source: "apache", + extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] + }, + "image/x-icon": { + source: "apache", + compressible: true, + extensions: ["ico"] + }, + "image/x-jng": { + source: "nginx", + extensions: ["jng"] + }, + "image/x-mrsid-image": { + source: "apache", + extensions: ["sid"] + }, + "image/x-ms-bmp": { + source: "nginx", + compressible: true, + extensions: ["bmp"] + }, + "image/x-pcx": { + source: "apache", + extensions: ["pcx"] + }, + "image/x-pict": { + source: "apache", + extensions: ["pic", "pct"] + }, + "image/x-portable-anymap": { + source: "apache", + extensions: ["pnm"] + }, + "image/x-portable-bitmap": { + source: "apache", + extensions: ["pbm"] + }, + "image/x-portable-graymap": { + source: "apache", + extensions: ["pgm"] + }, + "image/x-portable-pixmap": { + source: "apache", + extensions: ["ppm"] + }, + "image/x-rgb": { + source: "apache", + extensions: ["rgb"] + }, + "image/x-tga": { + source: "apache", + extensions: ["tga"] + }, + "image/x-xbitmap": { + source: "apache", + extensions: ["xbm"] + }, + "image/x-xcf": { + compressible: false + }, + "image/x-xpixmap": { + source: "apache", + extensions: ["xpm"] + }, + "image/x-xwindowdump": { + source: "apache", + extensions: ["xwd"] + }, + "message/cpim": { + source: "iana" + }, + "message/delivery-status": { + source: "iana" + }, + "message/disposition-notification": { + source: "iana", + extensions: [ + "disposition-notification" + ] + }, + "message/external-body": { + source: "iana" + }, + "message/feedback-report": { + source: "iana" + }, + "message/global": { + source: "iana", + extensions: ["u8msg"] + }, + "message/global-delivery-status": { + source: "iana", + extensions: ["u8dsn"] + }, + "message/global-disposition-notification": { + source: "iana", + extensions: ["u8mdn"] + }, + "message/global-headers": { + source: "iana", + extensions: ["u8hdr"] + }, + "message/http": { + source: "iana", + compressible: false + }, + "message/imdn+xml": { + source: "iana", + compressible: true + }, + "message/news": { + source: "iana" + }, + "message/partial": { + source: "iana", + compressible: false + }, + "message/rfc822": { + source: "iana", + compressible: true, + extensions: ["eml", "mime"] + }, + "message/s-http": { + source: "iana" + }, + "message/sip": { + source: "iana" + }, + "message/sipfrag": { + source: "iana" + }, + "message/tracking-status": { + source: "iana" + }, + "message/vnd.si.simp": { + source: "iana" + }, + "message/vnd.wfa.wsc": { + source: "iana", + extensions: ["wsc"] + }, + "model/3mf": { + source: "iana", + extensions: ["3mf"] + }, + "model/e57": { + source: "iana" + }, + "model/gltf+json": { + source: "iana", + compressible: true, + extensions: ["gltf"] + }, + "model/gltf-binary": { + source: "iana", + compressible: true, + extensions: ["glb"] + }, + "model/iges": { + source: "iana", + compressible: false, + extensions: ["igs", "iges"] + }, + "model/mesh": { + source: "iana", + compressible: false, + extensions: ["msh", "mesh", "silo"] + }, + "model/mtl": { + source: "iana", + extensions: ["mtl"] + }, + "model/obj": { + source: "iana", + extensions: ["obj"] + }, + "model/step": { + source: "iana" + }, + "model/step+xml": { + source: "iana", + compressible: true, + extensions: ["stpx"] + }, + "model/step+zip": { + source: "iana", + compressible: false, + extensions: ["stpz"] + }, + "model/step-xml+zip": { + source: "iana", + compressible: false, + extensions: ["stpxz"] + }, + "model/stl": { + source: "iana", + extensions: ["stl"] + }, + "model/vnd.collada+xml": { + source: "iana", + compressible: true, + extensions: ["dae"] + }, + "model/vnd.dwf": { + source: "iana", + extensions: ["dwf"] + }, + "model/vnd.flatland.3dml": { + source: "iana" + }, + "model/vnd.gdl": { + source: "iana", + extensions: ["gdl"] + }, + "model/vnd.gs-gdl": { + source: "apache" + }, + "model/vnd.gs.gdl": { + source: "iana" + }, + "model/vnd.gtw": { + source: "iana", + extensions: ["gtw"] + }, + "model/vnd.moml+xml": { + source: "iana", + compressible: true + }, + "model/vnd.mts": { + source: "iana", + extensions: ["mts"] + }, + "model/vnd.opengex": { + source: "iana", + extensions: ["ogex"] + }, + "model/vnd.parasolid.transmit.binary": { + source: "iana", + extensions: ["x_b"] + }, + "model/vnd.parasolid.transmit.text": { + source: "iana", + extensions: ["x_t"] + }, + "model/vnd.pytha.pyox": { + source: "iana" + }, + "model/vnd.rosette.annotated-data-model": { + source: "iana" + }, + "model/vnd.sap.vds": { + source: "iana", + extensions: ["vds"] + }, + "model/vnd.usdz+zip": { + source: "iana", + compressible: false, + extensions: ["usdz"] + }, + "model/vnd.valve.source.compiled-map": { + source: "iana", + extensions: ["bsp"] + }, + "model/vnd.vtu": { + source: "iana", + extensions: ["vtu"] + }, + "model/vrml": { + source: "iana", + compressible: false, + extensions: ["wrl", "vrml"] + }, + "model/x3d+binary": { + source: "apache", + compressible: false, + extensions: ["x3db", "x3dbz"] + }, + "model/x3d+fastinfoset": { + source: "iana", + extensions: ["x3db"] + }, + "model/x3d+vrml": { + source: "apache", + compressible: false, + extensions: ["x3dv", "x3dvz"] + }, + "model/x3d+xml": { + source: "iana", + compressible: true, + extensions: ["x3d", "x3dz"] + }, + "model/x3d-vrml": { + source: "iana", + extensions: ["x3dv"] + }, + "multipart/alternative": { + source: "iana", + compressible: false + }, + "multipart/appledouble": { + source: "iana" + }, + "multipart/byteranges": { + source: "iana" + }, + "multipart/digest": { + source: "iana" + }, + "multipart/encrypted": { + source: "iana", + compressible: false + }, + "multipart/form-data": { + source: "iana", + compressible: false + }, + "multipart/header-set": { + source: "iana" + }, + "multipart/mixed": { + source: "iana" + }, + "multipart/multilingual": { + source: "iana" + }, + "multipart/parallel": { + source: "iana" + }, + "multipart/related": { + source: "iana", + compressible: false + }, + "multipart/report": { + source: "iana" + }, + "multipart/signed": { + source: "iana", + compressible: false + }, + "multipart/vnd.bint.med-plus": { + source: "iana" + }, + "multipart/voice-message": { + source: "iana" + }, + "multipart/x-mixed-replace": { + source: "iana" + }, + "text/1d-interleaved-parityfec": { + source: "iana" + }, + "text/cache-manifest": { + source: "iana", + compressible: true, + extensions: ["appcache", "manifest"] + }, + "text/calendar": { + source: "iana", + extensions: ["ics", "ifb"] + }, + "text/calender": { + compressible: true + }, + "text/cmd": { + compressible: true + }, + "text/coffeescript": { + extensions: ["coffee", "litcoffee"] + }, + "text/cql": { + source: "iana" + }, + "text/cql-expression": { + source: "iana" + }, + "text/cql-identifier": { + source: "iana" + }, + "text/css": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["css"] + }, + "text/csv": { + source: "iana", + compressible: true, + extensions: ["csv"] + }, + "text/csv-schema": { + source: "iana" + }, + "text/directory": { + source: "iana" + }, + "text/dns": { + source: "iana" + }, + "text/ecmascript": { + source: "iana" + }, + "text/encaprtp": { + source: "iana" + }, + "text/enriched": { + source: "iana" + }, + "text/fhirpath": { + source: "iana" + }, + "text/flexfec": { + source: "iana" + }, + "text/fwdred": { + source: "iana" + }, + "text/gff3": { + source: "iana" + }, + "text/grammar-ref-list": { + source: "iana" + }, + "text/html": { + source: "iana", + compressible: true, + extensions: ["html", "htm", "shtml"] + }, + "text/jade": { + extensions: ["jade"] + }, + "text/javascript": { + source: "iana", + compressible: true + }, + "text/jcr-cnd": { + source: "iana" + }, + "text/jsx": { + compressible: true, + extensions: ["jsx"] + }, + "text/less": { + compressible: true, + extensions: ["less"] + }, + "text/markdown": { + source: "iana", + compressible: true, + extensions: ["markdown", "md"] + }, + "text/mathml": { + source: "nginx", + extensions: ["mml"] + }, + "text/mdx": { + compressible: true, + extensions: ["mdx"] + }, + "text/mizar": { + source: "iana" + }, + "text/n3": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["n3"] + }, + "text/parameters": { + source: "iana", + charset: "UTF-8" + }, + "text/parityfec": { + source: "iana" + }, + "text/plain": { + source: "iana", + compressible: true, + extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] + }, + "text/provenance-notation": { + source: "iana", + charset: "UTF-8" + }, + "text/prs.fallenstein.rst": { + source: "iana" + }, + "text/prs.lines.tag": { + source: "iana", + extensions: ["dsc"] + }, + "text/prs.prop.logic": { + source: "iana" + }, + "text/raptorfec": { + source: "iana" + }, + "text/red": { + source: "iana" + }, + "text/rfc822-headers": { + source: "iana" + }, + "text/richtext": { + source: "iana", + compressible: true, + extensions: ["rtx"] + }, + "text/rtf": { + source: "iana", + compressible: true, + extensions: ["rtf"] + }, + "text/rtp-enc-aescm128": { + source: "iana" + }, + "text/rtploopback": { + source: "iana" + }, + "text/rtx": { + source: "iana" + }, + "text/sgml": { + source: "iana", + extensions: ["sgml", "sgm"] + }, + "text/shaclc": { + source: "iana" + }, + "text/shex": { + source: "iana", + extensions: ["shex"] + }, + "text/slim": { + extensions: ["slim", "slm"] + }, + "text/spdx": { + source: "iana", + extensions: ["spdx"] + }, + "text/strings": { + source: "iana" + }, + "text/stylus": { + extensions: ["stylus", "styl"] + }, + "text/t140": { + source: "iana" + }, + "text/tab-separated-values": { + source: "iana", + compressible: true, + extensions: ["tsv"] + }, + "text/troff": { + source: "iana", + extensions: ["t", "tr", "roff", "man", "me", "ms"] + }, + "text/turtle": { + source: "iana", + charset: "UTF-8", + extensions: ["ttl"] + }, + "text/ulpfec": { + source: "iana" + }, + "text/uri-list": { + source: "iana", + compressible: true, + extensions: ["uri", "uris", "urls"] + }, + "text/vcard": { + source: "iana", + compressible: true, + extensions: ["vcard"] + }, + "text/vnd.a": { + source: "iana" + }, + "text/vnd.abc": { + source: "iana" + }, + "text/vnd.ascii-art": { + source: "iana" + }, + "text/vnd.curl": { + source: "iana", + extensions: ["curl"] + }, + "text/vnd.curl.dcurl": { + source: "apache", + extensions: ["dcurl"] + }, + "text/vnd.curl.mcurl": { + source: "apache", + extensions: ["mcurl"] + }, + "text/vnd.curl.scurl": { + source: "apache", + extensions: ["scurl"] + }, + "text/vnd.debian.copyright": { + source: "iana", + charset: "UTF-8" + }, + "text/vnd.dmclientscript": { + source: "iana" + }, + "text/vnd.dvb.subtitle": { + source: "iana", + extensions: ["sub"] + }, + "text/vnd.esmertec.theme-descriptor": { + source: "iana", + charset: "UTF-8" + }, + "text/vnd.familysearch.gedcom": { + source: "iana", + extensions: ["ged"] + }, + "text/vnd.ficlab.flt": { + source: "iana" + }, + "text/vnd.fly": { + source: "iana", + extensions: ["fly"] + }, + "text/vnd.fmi.flexstor": { + source: "iana", + extensions: ["flx"] + }, + "text/vnd.gml": { + source: "iana" + }, + "text/vnd.graphviz": { + source: "iana", + extensions: ["gv"] + }, + "text/vnd.hans": { + source: "iana" + }, + "text/vnd.hgl": { + source: "iana" + }, + "text/vnd.in3d.3dml": { + source: "iana", + extensions: ["3dml"] + }, + "text/vnd.in3d.spot": { + source: "iana", + extensions: ["spot"] + }, + "text/vnd.iptc.newsml": { + source: "iana" + }, + "text/vnd.iptc.nitf": { + source: "iana" + }, + "text/vnd.latex-z": { + source: "iana" + }, + "text/vnd.motorola.reflex": { + source: "iana" + }, + "text/vnd.ms-mediapackage": { + source: "iana" + }, + "text/vnd.net2phone.commcenter.command": { + source: "iana" + }, + "text/vnd.radisys.msml-basic-layout": { + source: "iana" + }, + "text/vnd.senx.warpscript": { + source: "iana" + }, + "text/vnd.si.uricatalogue": { + source: "iana" + }, + "text/vnd.sosi": { + source: "iana" + }, + "text/vnd.sun.j2me.app-descriptor": { + source: "iana", + charset: "UTF-8", + extensions: ["jad"] + }, + "text/vnd.trolltech.linguist": { + source: "iana", + charset: "UTF-8" + }, + "text/vnd.wap.si": { + source: "iana" + }, + "text/vnd.wap.sl": { + source: "iana" + }, + "text/vnd.wap.wml": { + source: "iana", + extensions: ["wml"] + }, + "text/vnd.wap.wmlscript": { + source: "iana", + extensions: ["wmls"] + }, + "text/vtt": { + source: "iana", + charset: "UTF-8", + compressible: true, + extensions: ["vtt"] + }, + "text/x-asm": { + source: "apache", + extensions: ["s", "asm"] + }, + "text/x-c": { + source: "apache", + extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] + }, + "text/x-component": { + source: "nginx", + extensions: ["htc"] + }, + "text/x-fortran": { + source: "apache", + extensions: ["f", "for", "f77", "f90"] + }, + "text/x-gwt-rpc": { + compressible: true + }, + "text/x-handlebars-template": { + extensions: ["hbs"] + }, + "text/x-java-source": { + source: "apache", + extensions: ["java"] + }, + "text/x-jquery-tmpl": { + compressible: true + }, + "text/x-lua": { + extensions: ["lua"] + }, + "text/x-markdown": { + compressible: true, + extensions: ["mkd"] + }, + "text/x-nfo": { + source: "apache", + extensions: ["nfo"] + }, + "text/x-opml": { + source: "apache", + extensions: ["opml"] + }, + "text/x-org": { + compressible: true, + extensions: ["org"] + }, + "text/x-pascal": { + source: "apache", + extensions: ["p", "pas"] + }, + "text/x-processing": { + compressible: true, + extensions: ["pde"] + }, + "text/x-sass": { + extensions: ["sass"] + }, + "text/x-scss": { + extensions: ["scss"] + }, + "text/x-setext": { + source: "apache", + extensions: ["etx"] + }, + "text/x-sfv": { + source: "apache", + extensions: ["sfv"] + }, + "text/x-suse-ymp": { + compressible: true, + extensions: ["ymp"] + }, + "text/x-uuencode": { + source: "apache", + extensions: ["uu"] + }, + "text/x-vcalendar": { + source: "apache", + extensions: ["vcs"] + }, + "text/x-vcard": { + source: "apache", + extensions: ["vcf"] + }, + "text/xml": { + source: "iana", + compressible: true, + extensions: ["xml"] + }, + "text/xml-external-parsed-entity": { + source: "iana" + }, + "text/yaml": { + compressible: true, + extensions: ["yaml", "yml"] + }, + "video/1d-interleaved-parityfec": { + source: "iana" + }, + "video/3gpp": { + source: "iana", + extensions: ["3gp", "3gpp"] + }, + "video/3gpp-tt": { + source: "iana" + }, + "video/3gpp2": { + source: "iana", + extensions: ["3g2"] + }, + "video/av1": { + source: "iana" + }, + "video/bmpeg": { + source: "iana" + }, + "video/bt656": { + source: "iana" + }, + "video/celb": { + source: "iana" + }, + "video/dv": { + source: "iana" + }, + "video/encaprtp": { + source: "iana" + }, + "video/ffv1": { + source: "iana" + }, + "video/flexfec": { + source: "iana" + }, + "video/h261": { + source: "iana", + extensions: ["h261"] + }, + "video/h263": { + source: "iana", + extensions: ["h263"] + }, + "video/h263-1998": { + source: "iana" + }, + "video/h263-2000": { + source: "iana" + }, + "video/h264": { + source: "iana", + extensions: ["h264"] + }, + "video/h264-rcdo": { + source: "iana" + }, + "video/h264-svc": { + source: "iana" + }, + "video/h265": { + source: "iana" + }, + "video/iso.segment": { + source: "iana", + extensions: ["m4s"] + }, + "video/jpeg": { + source: "iana", + extensions: ["jpgv"] + }, + "video/jpeg2000": { + source: "iana" + }, + "video/jpm": { + source: "apache", + extensions: ["jpm", "jpgm"] + }, + "video/jxsv": { + source: "iana" + }, + "video/mj2": { + source: "iana", + extensions: ["mj2", "mjp2"] + }, + "video/mp1s": { + source: "iana" + }, + "video/mp2p": { + source: "iana" + }, + "video/mp2t": { + source: "iana", + extensions: ["ts"] + }, + "video/mp4": { + source: "iana", + compressible: false, + extensions: ["mp4", "mp4v", "mpg4"] + }, + "video/mp4v-es": { + source: "iana" + }, + "video/mpeg": { + source: "iana", + compressible: false, + extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] + }, + "video/mpeg4-generic": { + source: "iana" + }, + "video/mpv": { + source: "iana" + }, + "video/nv": { + source: "iana" + }, + "video/ogg": { + source: "iana", + compressible: false, + extensions: ["ogv"] + }, + "video/parityfec": { + source: "iana" + }, + "video/pointer": { + source: "iana" + }, + "video/quicktime": { + source: "iana", + compressible: false, + extensions: ["qt", "mov"] + }, + "video/raptorfec": { + source: "iana" + }, + "video/raw": { + source: "iana" + }, + "video/rtp-enc-aescm128": { + source: "iana" + }, + "video/rtploopback": { + source: "iana" + }, + "video/rtx": { + source: "iana" + }, + "video/scip": { + source: "iana" + }, + "video/smpte291": { + source: "iana" + }, + "video/smpte292m": { + source: "iana" + }, + "video/ulpfec": { + source: "iana" + }, + "video/vc1": { + source: "iana" + }, + "video/vc2": { + source: "iana" + }, + "video/vnd.cctv": { + source: "iana" + }, + "video/vnd.dece.hd": { + source: "iana", + extensions: ["uvh", "uvvh"] + }, + "video/vnd.dece.mobile": { + source: "iana", + extensions: ["uvm", "uvvm"] + }, + "video/vnd.dece.mp4": { + source: "iana" + }, + "video/vnd.dece.pd": { + source: "iana", + extensions: ["uvp", "uvvp"] + }, + "video/vnd.dece.sd": { + source: "iana", + extensions: ["uvs", "uvvs"] + }, + "video/vnd.dece.video": { + source: "iana", + extensions: ["uvv", "uvvv"] + }, + "video/vnd.directv.mpeg": { + source: "iana" + }, + "video/vnd.directv.mpeg-tts": { + source: "iana" + }, + "video/vnd.dlna.mpeg-tts": { + source: "iana" + }, + "video/vnd.dvb.file": { + source: "iana", + extensions: ["dvb"] + }, + "video/vnd.fvt": { + source: "iana", + extensions: ["fvt"] + }, + "video/vnd.hns.video": { + source: "iana" + }, + "video/vnd.iptvforum.1dparityfec-1010": { + source: "iana" + }, + "video/vnd.iptvforum.1dparityfec-2005": { + source: "iana" + }, + "video/vnd.iptvforum.2dparityfec-1010": { + source: "iana" + }, + "video/vnd.iptvforum.2dparityfec-2005": { + source: "iana" + }, + "video/vnd.iptvforum.ttsavc": { + source: "iana" + }, + "video/vnd.iptvforum.ttsmpeg2": { + source: "iana" + }, + "video/vnd.motorola.video": { + source: "iana" + }, + "video/vnd.motorola.videop": { + source: "iana" + }, + "video/vnd.mpegurl": { + source: "iana", + extensions: ["mxu", "m4u"] + }, + "video/vnd.ms-playready.media.pyv": { + source: "iana", + extensions: ["pyv"] + }, + "video/vnd.nokia.interleaved-multimedia": { + source: "iana" + }, + "video/vnd.nokia.mp4vr": { + source: "iana" + }, + "video/vnd.nokia.videovoip": { + source: "iana" + }, + "video/vnd.objectvideo": { + source: "iana" + }, + "video/vnd.radgamettools.bink": { + source: "iana" + }, + "video/vnd.radgamettools.smacker": { + source: "iana" + }, + "video/vnd.sealed.mpeg1": { + source: "iana" + }, + "video/vnd.sealed.mpeg4": { + source: "iana" + }, + "video/vnd.sealed.swf": { + source: "iana" + }, + "video/vnd.sealedmedia.softseal.mov": { + source: "iana" + }, + "video/vnd.uvvu.mp4": { + source: "iana", + extensions: ["uvu", "uvvu"] + }, + "video/vnd.vivo": { + source: "iana", + extensions: ["viv"] + }, + "video/vnd.youtube.yt": { + source: "iana" + }, + "video/vp8": { + source: "iana" + }, + "video/vp9": { + source: "iana" + }, + "video/webm": { + source: "apache", + compressible: false, + extensions: ["webm"] + }, + "video/x-f4v": { + source: "apache", + extensions: ["f4v"] + }, + "video/x-fli": { + source: "apache", + extensions: ["fli"] + }, + "video/x-flv": { + source: "apache", + compressible: false, + extensions: ["flv"] + }, + "video/x-m4v": { + source: "apache", + extensions: ["m4v"] + }, + "video/x-matroska": { + source: "apache", + compressible: false, + extensions: ["mkv", "mk3d", "mks"] + }, + "video/x-mng": { + source: "apache", + extensions: ["mng"] + }, + "video/x-ms-asf": { + source: "apache", + extensions: ["asf", "asx"] + }, + "video/x-ms-vob": { + source: "apache", + extensions: ["vob"] + }, + "video/x-ms-wm": { + source: "apache", + extensions: ["wm"] + }, + "video/x-ms-wmv": { + source: "apache", + compressible: false, + extensions: ["wmv"] + }, + "video/x-ms-wmx": { + source: "apache", + extensions: ["wmx"] + }, + "video/x-ms-wvx": { + source: "apache", + extensions: ["wvx"] + }, + "video/x-msvideo": { + source: "apache", + extensions: ["avi"] + }, + "video/x-sgi-movie": { + source: "apache", + extensions: ["movie"] + }, + "video/x-smv": { + source: "apache", + extensions: ["smv"] + }, + "x-conference/x-cooltalk": { + source: "apache", + extensions: ["ice"] + }, + "x-shader/x-fragment": { + compressible: true + }, + "x-shader/x-vertex": { + compressible: true + } + }; + } +}); + +// node_modules/mime-db/index.js +var require_mime_db = __commonJS({ + "node_modules/mime-db/index.js"(exports2, module2) { + module2.exports = require_db(); + } +}); + +// node_modules/mime-types/index.js +var require_mime_types = __commonJS({ + "node_modules/mime-types/index.js"(exports2) { + "use strict"; + var db = require_mime_db(); + var extname = require("path").extname; + var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/; + var TEXT_TYPE_REGEXP = /^text\//i; + exports2.charset = charset; + exports2.charsets = { lookup: charset }; + exports2.contentType = contentType; + exports2.extension = extension; + exports2.extensions = /* @__PURE__ */ Object.create(null); + exports2.lookup = lookup; + exports2.types = /* @__PURE__ */ Object.create(null); + populateMaps(exports2.extensions, exports2.types); + function charset(type) { + if (!type || typeof type !== "string") { + return false; + } + var match = EXTRACT_TYPE_REGEXP.exec(type); + var mime = match && db[match[1].toLowerCase()]; + if (mime && mime.charset) { + return mime.charset; + } + if (match && TEXT_TYPE_REGEXP.test(match[1])) { + return "UTF-8"; + } + return false; + } + function contentType(str) { + if (!str || typeof str !== "string") { + return false; + } + var mime = str.indexOf("/") === -1 ? exports2.lookup(str) : str; + if (!mime) { + return false; + } + if (mime.indexOf("charset") === -1) { + var charset2 = exports2.charset(mime); + if (charset2) mime += "; charset=" + charset2.toLowerCase(); + } + return mime; + } + function extension(type) { + if (!type || typeof type !== "string") { + return false; + } + var match = EXTRACT_TYPE_REGEXP.exec(type); + var exts = match && exports2.extensions[match[1].toLowerCase()]; + if (!exts || !exts.length) { + return false; + } + return exts[0]; + } + function lookup(path) { + if (!path || typeof path !== "string") { + return false; + } + var extension2 = extname("x." + path).toLowerCase().substr(1); + if (!extension2) { + return false; + } + return exports2.types[extension2] || false; + } + function populateMaps(extensions, types) { + var preference = ["nginx", "apache", void 0, "iana"]; + Object.keys(db).forEach(function forEachMimeType(type) { + var mime = db[type]; + var exts = mime.extensions; + if (!exts || !exts.length) { + return; + } + extensions[type] = exts; + for (var i4 = 0; i4 < exts.length; i4++) { + var extension2 = exts[i4]; + if (types[extension2]) { + var from = preference.indexOf(db[types[extension2]].source); + var to = preference.indexOf(mime.source); + if (types[extension2] !== "application/octet-stream" && (from > to || from === to && types[extension2].substr(0, 12) === "application/")) { + continue; + } + } + types[extension2] = type; + } + }); + } + } +}); + +// node_modules/type-is/index.js +var require_type_is = __commonJS({ + "node_modules/type-is/index.js"(exports2, module2) { + "use strict"; + var typer = require_media_typer(); + var mime = require_mime_types(); + module2.exports = typeofrequest; + module2.exports.is = typeis; + module2.exports.hasBody = hasbody; + module2.exports.normalize = normalize; + module2.exports.match = mimeMatch; + function typeis(value, types_) { + var i4; + var types = types_; + var val = tryNormalizeType(value); + if (!val) { + return false; + } + if (types && !Array.isArray(types)) { + types = new Array(arguments.length - 1); + for (i4 = 0; i4 < types.length; i4++) { + types[i4] = arguments[i4 + 1]; + } + } + if (!types || !types.length) { + return val; + } + var type; + for (i4 = 0; i4 < types.length; i4++) { + if (mimeMatch(normalize(type = types[i4]), val)) { + return type[0] === "+" || type.indexOf("*") !== -1 ? val : type; + } + } + return false; + } + function hasbody(req) { + return req.headers["transfer-encoding"] !== void 0 || !isNaN(req.headers["content-length"]); + } + function typeofrequest(req, types_) { + var types = types_; + if (!hasbody(req)) { + return null; + } + if (arguments.length > 2) { + types = new Array(arguments.length - 1); + for (var i4 = 0; i4 < types.length; i4++) { + types[i4] = arguments[i4 + 1]; + } + } + var value = req.headers["content-type"]; + return typeis(value, types); + } + function normalize(type) { + if (typeof type !== "string") { + return false; + } + switch (type) { + case "urlencoded": + return "application/x-www-form-urlencoded"; + case "multipart": + return "multipart/*"; + } + if (type[0] === "+") { + return "*/*" + type; + } + return type.indexOf("/") === -1 ? mime.lookup(type) : type; + } + function mimeMatch(expected, actual) { + if (expected === false) { + return false; + } + var actualParts = actual.split("/"); + var expectedParts = expected.split("/"); + if (actualParts.length !== 2 || expectedParts.length !== 2) { + return false; + } + if (expectedParts[0] !== "*" && expectedParts[0] !== actualParts[0]) { + return false; + } + if (expectedParts[1].substr(0, 2) === "*+") { + return expectedParts[1].length <= actualParts[1].length + 1 && expectedParts[1].substr(1) === actualParts[1].substr(1 - expectedParts[1].length); + } + if (expectedParts[1] !== "*" && expectedParts[1] !== actualParts[1]) { + return false; + } + return true; + } + function normalizeType(value) { + var type = typer.parse(value); + type.parameters = void 0; + return typer.format(type); + } + function tryNormalizeType(value) { + if (!value) { + return null; + } + try { + return normalizeType(value); + } catch (err) { + return null; + } + } + } +}); + +// node_modules/body-parser/lib/types/json.js +var require_json = __commonJS({ + "node_modules/body-parser/lib/types/json.js"(exports2, module2) { + "use strict"; + var bytes = require_bytes(); + var contentType = require_content_type(); + var createError2 = require_http_errors(); + var debug = require_src()("body-parser:json"); + var read = require_read(); + var typeis = require_type_is(); + module2.exports = json; + var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*(.)/; + function json(options) { + var opts = options || {}; + var limit = typeof opts.limit !== "number" ? bytes.parse(opts.limit || "100kb") : opts.limit; + var inflate = opts.inflate !== false; + var reviver = opts.reviver; + var strict = opts.strict !== false; + var type = opts.type || "application/json"; + var verify = opts.verify || false; + if (verify !== false && typeof verify !== "function") { + throw new TypeError("option verify must be function"); + } + var shouldParse = typeof type !== "function" ? typeChecker(type) : type; + function parse(body) { + if (body.length === 0) { + return {}; + } + if (strict) { + var first = firstchar(body); + if (first !== "{" && first !== "[") { + debug("strict violation"); + throw createStrictSyntaxError(body, first); + } + } + try { + debug("parse json"); + return JSON.parse(body, reviver); + } catch (e4) { + throw normalizeJsonSyntaxError(e4, { + message: e4.message, + stack: e4.stack + }); + } + } + return function jsonParser(req, res, next) { + if (req._body) { + debug("body already parsed"); + next(); + return; + } + req.body = req.body || {}; + if (!typeis.hasBody(req)) { + debug("skip empty body"); + next(); + return; + } + debug("content-type %j", req.headers["content-type"]); + if (!shouldParse(req)) { + debug("skip parsing"); + next(); + return; + } + var charset = getCharset(req) || "utf-8"; + if (charset.substr(0, 4) !== "utf-") { + debug("invalid charset"); + next(createError2(415, 'unsupported charset "' + charset.toUpperCase() + '"', { + charset, + type: "charset.unsupported" + })); + return; + } + read(req, res, next, parse, debug, { + encoding: charset, + inflate, + limit, + verify + }); + }; + } + function createStrictSyntaxError(str, char) { + var index = str.indexOf(char); + var partial = str.substring(0, index) + "#"; + try { + JSON.parse(partial); + throw new SyntaxError("strict violation"); + } catch (e4) { + return normalizeJsonSyntaxError(e4, { + message: e4.message.replace("#", char), + stack: e4.stack + }); + } + } + function firstchar(str) { + return FIRST_CHAR_REGEXP.exec(str)[1]; + } + function getCharset(req) { + try { + return (contentType.parse(req).parameters.charset || "").toLowerCase(); + } catch (e4) { + return void 0; + } + } + function normalizeJsonSyntaxError(error2, obj) { + var keys = Object.getOwnPropertyNames(error2); + for (var i4 = 0; i4 < keys.length; i4++) { + var key = keys[i4]; + if (key !== "stack" && key !== "message") { + delete error2[key]; + } + } + error2.stack = obj.stack.replace(error2.message, obj.message); + error2.message = obj.message; + return error2; + } + function typeChecker(type) { + return function checkType(req) { + return Boolean(typeis(req, type)); + }; + } + } +}); + +// node_modules/body-parser/lib/types/raw.js +var require_raw = __commonJS({ + "node_modules/body-parser/lib/types/raw.js"(exports2, module2) { + "use strict"; + var bytes = require_bytes(); + var debug = require_src()("body-parser:raw"); + var read = require_read(); + var typeis = require_type_is(); + module2.exports = raw; + function raw(options) { + var opts = options || {}; + var inflate = opts.inflate !== false; + var limit = typeof opts.limit !== "number" ? bytes.parse(opts.limit || "100kb") : opts.limit; + var type = opts.type || "application/octet-stream"; + var verify = opts.verify || false; + if (verify !== false && typeof verify !== "function") { + throw new TypeError("option verify must be function"); + } + var shouldParse = typeof type !== "function" ? typeChecker(type) : type; + function parse(buf) { + return buf; + } + return function rawParser(req, res, next) { + if (req._body) { + debug("body already parsed"); + next(); + return; + } + req.body = req.body || {}; + if (!typeis.hasBody(req)) { + debug("skip empty body"); + next(); + return; + } + debug("content-type %j", req.headers["content-type"]); + if (!shouldParse(req)) { + debug("skip parsing"); + next(); + return; + } + read(req, res, next, parse, debug, { + encoding: null, + inflate, + limit, + verify + }); + }; + } + function typeChecker(type) { + return function checkType(req) { + return Boolean(typeis(req, type)); + }; + } + } +}); + +// node_modules/body-parser/lib/types/text.js +var require_text = __commonJS({ + "node_modules/body-parser/lib/types/text.js"(exports2, module2) { + "use strict"; + var bytes = require_bytes(); + var contentType = require_content_type(); + var debug = require_src()("body-parser:text"); + var read = require_read(); + var typeis = require_type_is(); + module2.exports = text; + function text(options) { + var opts = options || {}; + var defaultCharset = opts.defaultCharset || "utf-8"; + var inflate = opts.inflate !== false; + var limit = typeof opts.limit !== "number" ? bytes.parse(opts.limit || "100kb") : opts.limit; + var type = opts.type || "text/plain"; + var verify = opts.verify || false; + if (verify !== false && typeof verify !== "function") { + throw new TypeError("option verify must be function"); + } + var shouldParse = typeof type !== "function" ? typeChecker(type) : type; + function parse(buf) { + return buf; + } + return function textParser(req, res, next) { + if (req._body) { + debug("body already parsed"); + next(); + return; + } + req.body = req.body || {}; + if (!typeis.hasBody(req)) { + debug("skip empty body"); + next(); + return; + } + debug("content-type %j", req.headers["content-type"]); + if (!shouldParse(req)) { + debug("skip parsing"); + next(); + return; + } + var charset = getCharset(req) || defaultCharset; + read(req, res, next, parse, debug, { + encoding: charset, + inflate, + limit, + verify + }); + }; + } + function getCharset(req) { + try { + return (contentType.parse(req).parameters.charset || "").toLowerCase(); + } catch (e4) { + return void 0; + } + } + function typeChecker(type) { + return function checkType(req) { + return Boolean(typeis(req, type)); + }; + } + } +}); + +// node_modules/qs/lib/utils.js +var require_utils = __commonJS({ + "node_modules/qs/lib/utils.js"(exports2, module2) { + "use strict"; + var has = Object.prototype.hasOwnProperty; + var hexTable = (function() { + var array = []; + for (var i4 = 0; i4 < 256; ++i4) { + array.push("%" + ((i4 < 16 ? "0" : "") + i4.toString(16)).toUpperCase()); + } + return array; + })(); + var compactQueue = function compactQueue2(queue) { + var obj; + while (queue.length) { + var item = queue.pop(); + obj = item.obj[item.prop]; + if (Array.isArray(obj)) { + var compacted = []; + for (var j4 = 0; j4 < obj.length; ++j4) { + if (typeof obj[j4] !== "undefined") { + compacted.push(obj[j4]); + } + } + item.obj[item.prop] = compacted; + } + } + return obj; + }; + var arrayToObject = function arrayToObject2(source, options) { + var obj = options && options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + for (var i4 = 0; i4 < source.length; ++i4) { + if (typeof source[i4] !== "undefined") { + obj[i4] = source[i4]; + } + } + return obj; + }; + var merge = function merge2(target, source, options) { + if (!source) { + return target; + } + if (typeof source !== "object") { + if (Array.isArray(target)) { + target.push(source); + } else if (typeof target === "object") { + if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { + target[source] = true; + } + } else { + return [target, source]; + } + return target; + } + if (typeof target !== "object") { + return [target].concat(source); + } + var mergeTarget = target; + if (Array.isArray(target) && !Array.isArray(source)) { + mergeTarget = arrayToObject(target, options); + } + if (Array.isArray(target) && Array.isArray(source)) { + source.forEach(function(item, i4) { + if (has.call(target, i4)) { + if (target[i4] && typeof target[i4] === "object") { + target[i4] = merge2(target[i4], item, options); + } else { + target.push(item); + } + } else { + target[i4] = item; + } + }); + return target; + } + return Object.keys(source).reduce(function(acc, key) { + var value = source[key]; + if (has.call(acc, key)) { + acc[key] = merge2(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); + }; + var assign = function assignSingleSource(target, source) { + return Object.keys(source).reduce(function(acc, key) { + acc[key] = source[key]; + return acc; + }, target); + }; + var decode2 = function(str) { + try { + return decodeURIComponent(str.replace(/\+/g, " ")); + } catch (e4) { + return str; + } + }; + var encode2 = function encode3(str) { + if (str.length === 0) { + return str; + } + var string = typeof str === "string" ? str : String(str); + var out = ""; + for (var i4 = 0; i4 < string.length; ++i4) { + var c4 = string.charCodeAt(i4); + if (c4 === 45 || c4 === 46 || c4 === 95 || c4 === 126 || c4 >= 48 && c4 <= 57 || c4 >= 65 && c4 <= 90 || c4 >= 97 && c4 <= 122) { + out += string.charAt(i4); + continue; + } + if (c4 < 128) { + out = out + hexTable[c4]; + continue; + } + if (c4 < 2048) { + out = out + (hexTable[192 | c4 >> 6] + hexTable[128 | c4 & 63]); + continue; + } + if (c4 < 55296 || c4 >= 57344) { + out = out + (hexTable[224 | c4 >> 12] + hexTable[128 | c4 >> 6 & 63] + hexTable[128 | c4 & 63]); + continue; + } + i4 += 1; + c4 = 65536 + ((c4 & 1023) << 10 | string.charCodeAt(i4) & 1023); + out += hexTable[240 | c4 >> 18] + hexTable[128 | c4 >> 12 & 63] + hexTable[128 | c4 >> 6 & 63] + hexTable[128 | c4 & 63]; + } + return out; + }; + var compact = function compact2(value) { + var queue = [{ obj: { o: value }, prop: "o" }]; + var refs = []; + for (var i4 = 0; i4 < queue.length; ++i4) { + var item = queue[i4]; + var obj = item.obj[item.prop]; + var keys = Object.keys(obj); + for (var j4 = 0; j4 < keys.length; ++j4) { + var key = keys[j4]; + var val = obj[key]; + if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) { + queue.push({ obj, prop: key }); + refs.push(val); + } + } + } + return compactQueue(queue); + }; + var isRegExp = function isRegExp2(obj) { + return Object.prototype.toString.call(obj) === "[object RegExp]"; + }; + var isBuffer = function isBuffer2(obj) { + if (obj === null || typeof obj === "undefined") { + return false; + } + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); + }; + module2.exports = { + arrayToObject, + assign, + compact, + decode: decode2, + encode: encode2, + isBuffer, + isRegExp, + merge + }; + } +}); + +// node_modules/qs/lib/formats.js +var require_formats = __commonJS({ + "node_modules/qs/lib/formats.js"(exports2, module2) { + "use strict"; + var replace = String.prototype.replace; + var percentTwenties = /%20/g; + module2.exports = { + "default": "RFC3986", + formatters: { + RFC1738: function(value) { + return replace.call(value, percentTwenties, "+"); + }, + RFC3986: function(value) { + return value; + } + }, + RFC1738: "RFC1738", + RFC3986: "RFC3986" + }; + } +}); + +// node_modules/qs/lib/stringify.js +var require_stringify = __commonJS({ + "node_modules/qs/lib/stringify.js"(exports2, module2) { + "use strict"; + var utils = require_utils(); + var formats = require_formats(); + var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + "[]"; + }, + indices: function indices(prefix, key) { + return prefix + "[" + key + "]"; + }, + repeat: function repeat(prefix) { + return prefix; + } + }; + var toISO = Date.prototype.toISOString; + var defaults = { + delimiter: "&", + encode: true, + encoder: utils.encode, + encodeValuesOnly: false, + serializeDate: function serializeDate(date2) { + return toISO.call(date2); + }, + skipNulls: false, + strictNullHandling: false + }; + var stringify = function stringify2(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter, encodeValuesOnly) { + var obj = object; + if (typeof filter === "function") { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix; + } + obj = ""; + } + if (typeof obj === "string" || typeof obj === "number" || typeof obj === "boolean" || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder); + return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults.encoder))]; + } + return [formatter(prefix) + "=" + formatter(String(obj))]; + } + var values = []; + if (typeof obj === "undefined") { + return values; + } + var objKeys; + if (Array.isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + for (var i4 = 0; i4 < objKeys.length; ++i4) { + var key = objKeys[i4]; + if (skipNulls && obj[key] === null) { + continue; + } + if (Array.isArray(obj)) { + values = values.concat(stringify2( + obj[key], + generateArrayPrefix(prefix, key), + generateArrayPrefix, + strictNullHandling, + skipNulls, + encoder, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly + )); + } else { + values = values.concat(stringify2( + obj[key], + prefix + (allowDots ? "." + key : "[" + key + "]"), + generateArrayPrefix, + strictNullHandling, + skipNulls, + encoder, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly + )); + } + } + return values; + }; + module2.exports = function(object, opts) { + var obj = object; + var options = opts ? utils.assign({}, opts) : {}; + if (options.encoder !== null && options.encoder !== void 0 && typeof options.encoder !== "function") { + throw new TypeError("Encoder has to be a function."); + } + var delimiter = typeof options.delimiter === "undefined" ? defaults.delimiter : options.delimiter; + var strictNullHandling = typeof options.strictNullHandling === "boolean" ? options.strictNullHandling : defaults.strictNullHandling; + var skipNulls = typeof options.skipNulls === "boolean" ? options.skipNulls : defaults.skipNulls; + var encode2 = typeof options.encode === "boolean" ? options.encode : defaults.encode; + var encoder = typeof options.encoder === "function" ? options.encoder : defaults.encoder; + var sort = typeof options.sort === "function" ? options.sort : null; + var allowDots = typeof options.allowDots === "undefined" ? false : options.allowDots; + var serializeDate = typeof options.serializeDate === "function" ? options.serializeDate : defaults.serializeDate; + var encodeValuesOnly = typeof options.encodeValuesOnly === "boolean" ? options.encodeValuesOnly : defaults.encodeValuesOnly; + if (typeof options.format === "undefined") { + options.format = formats["default"]; + } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { + throw new TypeError("Unknown format option provided."); + } + var formatter = formats.formatters[options.format]; + var objKeys; + var filter; + if (typeof options.filter === "function") { + filter = options.filter; + obj = filter("", obj); + } else if (Array.isArray(options.filter)) { + filter = options.filter; + objKeys = filter; + } + var keys = []; + if (typeof obj !== "object" || obj === null) { + return ""; + } + var arrayFormat; + if (options.arrayFormat in arrayPrefixGenerators) { + arrayFormat = options.arrayFormat; + } else if ("indices" in options) { + arrayFormat = options.indices ? "indices" : "repeat"; + } else { + arrayFormat = "indices"; + } + var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; + if (!objKeys) { + objKeys = Object.keys(obj); + } + if (sort) { + objKeys.sort(sort); + } + for (var i4 = 0; i4 < objKeys.length; ++i4) { + var key = objKeys[i4]; + if (skipNulls && obj[key] === null) { + continue; + } + keys = keys.concat(stringify( + obj[key], + key, + generateArrayPrefix, + strictNullHandling, + skipNulls, + encode2 ? encoder : null, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly + )); + } + var joined = keys.join(delimiter); + var prefix = options.addQueryPrefix === true ? "?" : ""; + return joined.length > 0 ? prefix + joined : ""; + }; + } +}); + +// node_modules/qs/lib/parse.js +var require_parse = __commonJS({ + "node_modules/qs/lib/parse.js"(exports2, module2) { + "use strict"; + var utils = require_utils(); + var has = Object.prototype.hasOwnProperty; + var defaults = { + allowDots: false, + allowPrototypes: false, + arrayLimit: 20, + decoder: utils.decode, + delimiter: "&", + depth: 5, + parameterLimit: 1e3, + plainObjects: false, + strictNullHandling: false + }; + var parseValues = function parseQueryStringValues(str, options) { + var obj = {}; + var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str; + var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit; + var parts = cleanStr.split(options.delimiter, limit); + for (var i4 = 0; i4 < parts.length; ++i4) { + var part = parts[i4]; + var bracketEqualsPos = part.indexOf("]="); + var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1; + var key, val; + if (pos === -1) { + key = options.decoder(part, defaults.decoder); + val = options.strictNullHandling ? null : ""; + } else { + key = options.decoder(part.slice(0, pos), defaults.decoder); + val = options.decoder(part.slice(pos + 1), defaults.decoder); + } + if (has.call(obj, key)) { + obj[key] = [].concat(obj[key]).concat(val); + } else { + obj[key] = val; + } + } + return obj; + }; + var parseObject = function(chain, val, options) { + var leaf = val; + for (var i4 = chain.length - 1; i4 >= 0; --i4) { + var obj; + var root = chain[i4]; + if (root === "[]") { + obj = []; + obj = obj.concat(leaf); + } else { + obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root; + var index = parseInt(cleanRoot, 10); + if (!isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit)) { + obj = []; + obj[index] = leaf; + } else { + obj[cleanRoot] = leaf; + } + } + leaf = obj; + } + return leaf; + }; + var parseKeys = function parseQueryStringKeys(givenKey, val, options) { + if (!givenKey) { + return; + } + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey; + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; + var segment = brackets.exec(key); + var parent = segment ? key.slice(0, segment.index) : key; + var keys = []; + if (parent) { + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } + } + keys.push(parent); + } + var i4 = 0; + while ((segment = child.exec(key)) !== null && i4 < options.depth) { + i4 += 1; + if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { + if (!options.allowPrototypes) { + return; + } + } + keys.push(segment[1]); + } + if (segment) { + keys.push("[" + key.slice(segment.index) + "]"); + } + return parseObject(keys, val, options); + }; + module2.exports = function(str, opts) { + var options = opts ? utils.assign({}, opts) : {}; + if (options.decoder !== null && options.decoder !== void 0 && typeof options.decoder !== "function") { + throw new TypeError("Decoder has to be a function."); + } + options.ignoreQueryPrefix = options.ignoreQueryPrefix === true; + options.delimiter = typeof options.delimiter === "string" || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; + options.depth = typeof options.depth === "number" ? options.depth : defaults.depth; + options.arrayLimit = typeof options.arrayLimit === "number" ? options.arrayLimit : defaults.arrayLimit; + options.parseArrays = options.parseArrays !== false; + options.decoder = typeof options.decoder === "function" ? options.decoder : defaults.decoder; + options.allowDots = typeof options.allowDots === "boolean" ? options.allowDots : defaults.allowDots; + options.plainObjects = typeof options.plainObjects === "boolean" ? options.plainObjects : defaults.plainObjects; + options.allowPrototypes = typeof options.allowPrototypes === "boolean" ? options.allowPrototypes : defaults.allowPrototypes; + options.parameterLimit = typeof options.parameterLimit === "number" ? options.parameterLimit : defaults.parameterLimit; + options.strictNullHandling = typeof options.strictNullHandling === "boolean" ? options.strictNullHandling : defaults.strictNullHandling; + if (str === "" || str === null || typeof str === "undefined") { + return options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + } + var tempObj = typeof str === "string" ? parseValues(str, options) : str; + var obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + var keys = Object.keys(tempObj); + for (var i4 = 0; i4 < keys.length; ++i4) { + var key = keys[i4]; + var newObj = parseKeys(key, tempObj[key], options); + obj = utils.merge(obj, newObj, options); + } + return utils.compact(obj); + }; + } +}); + +// node_modules/qs/lib/index.js +var require_lib2 = __commonJS({ + "node_modules/qs/lib/index.js"(exports2, module2) { + "use strict"; + var stringify = require_stringify(); + var parse = require_parse(); + var formats = require_formats(); + module2.exports = { + formats, + parse, + stringify + }; + } +}); + +// node_modules/body-parser/lib/types/urlencoded.js +var require_urlencoded = __commonJS({ + "node_modules/body-parser/lib/types/urlencoded.js"(exports2, module2) { + "use strict"; + var bytes = require_bytes(); + var contentType = require_content_type(); + var createError2 = require_http_errors(); + var debug = require_src()("body-parser:urlencoded"); + var deprecate2 = require_depd()("body-parser"); + var read = require_read(); + var typeis = require_type_is(); + module2.exports = urlencoded; + var parsers = /* @__PURE__ */ Object.create(null); + function urlencoded(options) { + var opts = options || {}; + if (opts.extended === void 0) { + deprecate2("undefined extended: provide extended option"); + } + var extended = opts.extended !== false; + var inflate = opts.inflate !== false; + var limit = typeof opts.limit !== "number" ? bytes.parse(opts.limit || "100kb") : opts.limit; + var type = opts.type || "application/x-www-form-urlencoded"; + var verify = opts.verify || false; + if (verify !== false && typeof verify !== "function") { + throw new TypeError("option verify must be function"); + } + var queryparse = extended ? extendedparser(opts) : simpleparser(opts); + var shouldParse = typeof type !== "function" ? typeChecker(type) : type; + function parse(body) { + return body.length ? queryparse(body) : {}; + } + return function urlencodedParser(req, res, next) { + if (req._body) { + debug("body already parsed"); + next(); + return; + } + req.body = req.body || {}; + if (!typeis.hasBody(req)) { + debug("skip empty body"); + next(); + return; + } + debug("content-type %j", req.headers["content-type"]); + if (!shouldParse(req)) { + debug("skip parsing"); + next(); + return; + } + var charset = getCharset(req) || "utf-8"; + if (charset !== "utf-8") { + debug("invalid charset"); + next(createError2(415, 'unsupported charset "' + charset.toUpperCase() + '"', { + charset, + type: "charset.unsupported" + })); + return; + } + read(req, res, next, parse, debug, { + debug, + encoding: charset, + inflate, + limit, + verify + }); + }; + } + function extendedparser(options) { + var parameterLimit = options.parameterLimit !== void 0 ? options.parameterLimit : 1e3; + var parse = parser("qs"); + if (isNaN(parameterLimit) || parameterLimit < 1) { + throw new TypeError("option parameterLimit must be a positive number"); + } + if (isFinite(parameterLimit)) { + parameterLimit = parameterLimit | 0; + } + return function queryparse(body) { + var paramCount = parameterCount(body, parameterLimit); + if (paramCount === void 0) { + debug("too many parameters"); + throw createError2(413, "too many parameters", { + type: "parameters.too.many" + }); + } + var arrayLimit = Math.max(100, paramCount); + debug("parse extended urlencoding"); + return parse(body, { + allowPrototypes: true, + arrayLimit, + depth: Infinity, + parameterLimit + }); + }; + } + function getCharset(req) { + try { + return (contentType.parse(req).parameters.charset || "").toLowerCase(); + } catch (e4) { + return void 0; + } + } + function parameterCount(body, limit) { + var count = 0; + var index = 0; + while ((index = body.indexOf("&", index)) !== -1) { + count++; + index++; + if (count === limit) { + return void 0; + } + } + return count; + } + function parser(name) { + var mod = parsers[name]; + if (mod !== void 0) { + return mod.parse; + } + switch (name) { + case "qs": + mod = require_lib2(); + break; + case "querystring": + mod = require("querystring"); + break; + } + parsers[name] = mod; + return mod.parse; + } + function simpleparser(options) { + var parameterLimit = options.parameterLimit !== void 0 ? options.parameterLimit : 1e3; + var parse = parser("querystring"); + if (isNaN(parameterLimit) || parameterLimit < 1) { + throw new TypeError("option parameterLimit must be a positive number"); + } + if (isFinite(parameterLimit)) { + parameterLimit = parameterLimit | 0; + } + return function queryparse(body) { + var paramCount = parameterCount(body, parameterLimit); + if (paramCount === void 0) { + debug("too many parameters"); + throw createError2(413, "too many parameters", { + type: "parameters.too.many" + }); + } + debug("parse urlencoding"); + return parse(body, void 0, void 0, { maxKeys: parameterLimit }); + }; + } + function typeChecker(type) { + return function checkType(req) { + return Boolean(typeis(req, type)); + }; + } + } +}); + +// node_modules/body-parser/index.js +var require_body_parser = __commonJS({ + "node_modules/body-parser/index.js"(exports2, module2) { + "use strict"; + var deprecate2 = require_depd()("body-parser"); + var parsers = /* @__PURE__ */ Object.create(null); + exports2 = module2.exports = deprecate2.function( + bodyParser, + "bodyParser: use individual json/urlencoded middlewares" + ); + Object.defineProperty(exports2, "json", { + configurable: true, + enumerable: true, + get: createParserGetter("json") + }); + Object.defineProperty(exports2, "raw", { + configurable: true, + enumerable: true, + get: createParserGetter("raw") + }); + Object.defineProperty(exports2, "text", { + configurable: true, + enumerable: true, + get: createParserGetter("text") + }); + Object.defineProperty(exports2, "urlencoded", { + configurable: true, + enumerable: true, + get: createParserGetter("urlencoded") + }); + function bodyParser(options) { + var opts = {}; + if (options) { + for (var prop in options) { + if (prop !== "type") { + opts[prop] = options[prop]; + } + } + } + var _urlencoded = exports2.urlencoded(opts); + var _json = exports2.json(opts); + return function bodyParser2(req, res, next) { + _json(req, res, function(err) { + if (err) return next(err); + _urlencoded(req, res, next); + }); + }; + } + function createParserGetter(name) { + return function get2() { + return loadParser(name); + }; + } + function loadParser(parserName) { + var parser = parsers[parserName]; + if (parser !== void 0) { + return parser; + } + switch (parserName) { + case "json": + parser = require_json(); + break; + case "raw": + parser = require_raw(); + break; + case "text": + parser = require_text(); + break; + case "urlencoded": + parser = require_urlencoded(); + break; + } + return parsers[parserName] = parser; + } + } +}); + +// node_modules/merge-descriptors/index.js +var require_merge_descriptors = __commonJS({ + "node_modules/merge-descriptors/index.js"(exports2, module2) { + "use strict"; + module2.exports = merge; + var hasOwnProperty = Object.prototype.hasOwnProperty; + function merge(dest, src, redefine) { + if (!dest) { + throw new TypeError("argument dest is required"); + } + if (!src) { + throw new TypeError("argument src is required"); + } + if (redefine === void 0) { + redefine = true; + } + Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName(name) { + if (!redefine && hasOwnProperty.call(dest, name)) { + return; + } + var descriptor = Object.getOwnPropertyDescriptor(src, name); + Object.defineProperty(dest, name, descriptor); + }); + return dest; + } + } +}); + +// node_modules/encodeurl/index.js +var require_encodeurl = __commonJS({ + "node_modules/encodeurl/index.js"(exports2, module2) { + "use strict"; + module2.exports = encodeUrl; + var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g; + var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g; + var UNMATCHED_SURROGATE_PAIR_REPLACE = "$1\uFFFD$2"; + function encodeUrl(url) { + return String(url).replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE).replace(ENCODE_CHARS_REGEXP, encodeURI); + } + } +}); + +// node_modules/escape-html/index.js +var require_escape_html = __commonJS({ + "node_modules/escape-html/index.js"(exports2, module2) { + "use strict"; + var matchHtmlRegExp = /["'&<>]/; + module2.exports = escapeHtml; + function escapeHtml(string) { + var str = "" + string; + var match = matchHtmlRegExp.exec(str); + if (!match) { + return str; + } + var escape; + var html = ""; + var index = 0; + var lastIndex = 0; + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: + escape = """; + break; + case 38: + escape = "&"; + break; + case 39: + escape = "'"; + break; + case 60: + escape = "<"; + break; + case 62: + escape = ">"; + break; + default: + continue; + } + if (lastIndex !== index) { + html += str.substring(lastIndex, index); + } + lastIndex = index + 1; + html += escape; + } + return lastIndex !== index ? html + str.substring(lastIndex, index) : html; + } + } +}); + +// node_modules/parseurl/index.js +var require_parseurl = __commonJS({ + "node_modules/parseurl/index.js"(exports2, module2) { + "use strict"; + var url = require("url"); + var parse = url.parse; + var Url = url.Url; + module2.exports = parseurl; + module2.exports.original = originalurl; + function parseurl(req) { + var url2 = req.url; + if (url2 === void 0) { + return void 0; + } + var parsed = req._parsedUrl; + if (fresh(url2, parsed)) { + return parsed; + } + parsed = fastparse(url2); + parsed._raw = url2; + return req._parsedUrl = parsed; + } + function originalurl(req) { + var url2 = req.originalUrl; + if (typeof url2 !== "string") { + return parseurl(req); + } + var parsed = req._parsedOriginalUrl; + if (fresh(url2, parsed)) { + return parsed; + } + parsed = fastparse(url2); + parsed._raw = url2; + return req._parsedOriginalUrl = parsed; + } + function fastparse(str) { + if (typeof str !== "string" || str.charCodeAt(0) !== 47) { + return parse(str); + } + var pathname = str; + var query = null; + var search = null; + for (var i4 = 1; i4 < str.length; i4++) { + switch (str.charCodeAt(i4)) { + case 63: + if (search === null) { + pathname = str.substring(0, i4); + query = str.substring(i4 + 1); + search = str.substring(i4); + } + break; + case 9: + /* \t */ + case 10: + /* \n */ + case 12: + /* \f */ + case 13: + /* \r */ + case 32: + /* */ + case 35: + /* # */ + case 160: + case 65279: + return parse(str); + } + } + var url2 = Url !== void 0 ? new Url() : {}; + url2.path = str; + url2.href = str; + url2.pathname = pathname; + if (search !== null) { + url2.query = query; + url2.search = search; + } + return url2; + } + function fresh(url2, parsedUrl) { + return typeof parsedUrl === "object" && parsedUrl !== null && (Url === void 0 || parsedUrl instanceof Url) && parsedUrl._raw === url2; + } + } +}); + +// node_modules/finalhandler/index.js +var require_finalhandler = __commonJS({ + "node_modules/finalhandler/index.js"(exports2, module2) { + "use strict"; + var debug = require_src()("finalhandler"); + var encodeUrl = require_encodeurl(); + var escapeHtml = require_escape_html(); + var onFinished = require_on_finished(); + var parseUrl4 = require_parseurl(); + var statuses = require_statuses(); + var unpipe = require_unpipe(); + var DOUBLE_SPACE_REGEXP = /\x20{2}/g; + var NEWLINE_REGEXP = /\n/g; + var defer = typeof setImmediate === "function" ? setImmediate : function(fn2) { + process.nextTick(fn2.bind.apply(fn2, arguments)); + }; + var isFinished = onFinished.isFinished; + function createHtmlDocument(message2) { + var body = escapeHtml(message2).replace(NEWLINE_REGEXP, "
").replace(DOUBLE_SPACE_REGEXP, "  "); + return '\n\n\n\nError\n\n\n
' + body + "
\n\n\n"; + } + module2.exports = finalhandler; + function finalhandler(req, res, options) { + var opts = options || {}; + var env = opts.env || process.env.NODE_ENV || "development"; + var onerror = opts.onerror; + return function(err) { + var headers; + var msg; + var status; + if (!err && headersSent(res)) { + debug("cannot 404 after headers sent"); + return; + } + if (err) { + status = getErrorStatusCode(err); + if (status === void 0) { + status = getResponseStatusCode(res); + } else { + headers = getErrorHeaders(err); + } + msg = getErrorMessage(err, status, env); + } else { + status = 404; + msg = "Cannot " + req.method + " " + encodeUrl(getResourceName(req)); + } + debug("default %s", status); + if (err && onerror) { + defer(onerror, err, req, res); + } + if (headersSent(res)) { + debug("cannot %d after headers sent", status); + req.socket.destroy(); + return; + } + send(req, res, status, headers, msg); + }; + } + function getErrorHeaders(err) { + if (!err.headers || typeof err.headers !== "object") { + return void 0; + } + var headers = /* @__PURE__ */ Object.create(null); + var keys = Object.keys(err.headers); + for (var i4 = 0; i4 < keys.length; i4++) { + var key = keys[i4]; + headers[key] = err.headers[key]; + } + return headers; + } + function getErrorMessage(err, status, env) { + var msg; + if (env !== "production") { + msg = err.stack; + if (!msg && typeof err.toString === "function") { + msg = err.toString(); + } + } + return msg || statuses[status]; + } + function getErrorStatusCode(err) { + if (typeof err.status === "number" && err.status >= 400 && err.status < 600) { + return err.status; + } + if (typeof err.statusCode === "number" && err.statusCode >= 400 && err.statusCode < 600) { + return err.statusCode; + } + return void 0; + } + function getResourceName(req) { + try { + return parseUrl4.original(req).pathname; + } catch (e4) { + return "resource"; + } + } + function getResponseStatusCode(res) { + var status = res.statusCode; + if (typeof status !== "number" || status < 400 || status > 599) { + status = 500; + } + return status; + } + function headersSent(res) { + return typeof res.headersSent !== "boolean" ? Boolean(res._header) : res.headersSent; + } + function send(req, res, status, headers, message2) { + function write() { + var body = createHtmlDocument(message2); + res.statusCode = status; + res.statusMessage = statuses[status]; + setHeaders(res, headers); + res.setHeader("Content-Security-Policy", "default-src 'self'"); + res.setHeader("X-Content-Type-Options", "nosniff"); + res.setHeader("Content-Type", "text/html; charset=utf-8"); + res.setHeader("Content-Length", Buffer.byteLength(body, "utf8")); + if (req.method === "HEAD") { + res.end(); + return; + } + res.end(body, "utf8"); + } + if (isFinished(req)) { + write(); + return; + } + unpipe(req); + onFinished(req, write); + req.resume(); + } + function setHeaders(res, headers) { + if (!headers) { + return; + } + var keys = Object.keys(headers); + for (var i4 = 0; i4 < keys.length; i4++) { + var key = keys[i4]; + res.setHeader(key, headers[key]); + } + } + } +}); + +// node_modules/array-flatten/array-flatten.js +var require_array_flatten = __commonJS({ + "node_modules/array-flatten/array-flatten.js"(exports2, module2) { + "use strict"; + module2.exports = arrayFlatten; + function flattenWithDepth(array, result, depth) { + for (var i4 = 0; i4 < array.length; i4++) { + var value = array[i4]; + if (depth > 0 && Array.isArray(value)) { + flattenWithDepth(value, result, depth - 1); + } else { + result.push(value); + } + } + return result; + } + function flattenForever(array, result) { + for (var i4 = 0; i4 < array.length; i4++) { + var value = array[i4]; + if (Array.isArray(value)) { + flattenForever(value, result); + } else { + result.push(value); + } + } + return result; + } + function arrayFlatten(array, depth) { + if (depth == null) { + return flattenForever(array, []); + } + return flattenWithDepth(array, [], depth); + } + } +}); + +// node_modules/path-to-regexp/index.js +var require_path_to_regexp = __commonJS({ + "node_modules/path-to-regexp/index.js"(exports2, module2) { + module2.exports = pathtoRegexp; + var MATCHING_GROUP_REGEXP = /\((?!\?)/g; + function pathtoRegexp(path, keys, options) { + options = options || {}; + keys = keys || []; + var strict = options.strict; + var end = options.end !== false; + var flags = options.sensitive ? "" : "i"; + var extraOffset = 0; + var keysOffset = keys.length; + var i4 = 0; + var name = 0; + var m4; + if (path instanceof RegExp) { + while (m4 = MATCHING_GROUP_REGEXP.exec(path.source)) { + keys.push({ + name: name++, + optional: false, + offset: m4.index + }); + } + return path; + } + if (Array.isArray(path)) { + path = path.map(function(value) { + return pathtoRegexp(value, keys, options).source; + }); + return new RegExp("(?:" + path.join("|") + ")", flags); + } + path = ("^" + path + (strict ? "" : path[path.length - 1] === "/" ? "?" : "/?")).replace(/\/\(/g, "/(?:").replace(/([\/\.])/g, "\\$1").replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g, function(match, slash, format2, key, capture, star, optional, offset) { + slash = slash || ""; + format2 = format2 || ""; + capture = capture || "([^\\/" + format2 + "]+?)"; + optional = optional || ""; + keys.push({ + name: key, + optional: !!optional, + offset: offset + extraOffset + }); + var result = "" + (optional ? "" : slash) + "(?:" + format2 + (optional ? slash : "") + capture + (star ? "((?:[\\/" + format2 + "].+?)?)" : "") + ")" + optional; + extraOffset += result.length - match.length; + return result; + }).replace(/\*/g, function(star, index2) { + var len = keys.length; + while (len-- > keysOffset && keys[len].offset > index2) { + keys[len].offset += 3; + } + return "(.*)"; + }); + while (m4 = MATCHING_GROUP_REGEXP.exec(path)) { + var escapeCount = 0; + var index = m4.index; + while (path.charAt(--index) === "\\") { + escapeCount++; + } + if (escapeCount % 2 === 1) { + continue; + } + if (keysOffset + i4 === keys.length || keys[keysOffset + i4].offset > m4.index) { + keys.splice(keysOffset + i4, 0, { + name: name++, + // Unnamed matching groups must be consistently linear. + optional: false, + offset: m4.index + }); + } + i4++; + } + path += end ? "$" : path[path.length - 1] === "/" ? "" : "(?=\\/|$)"; + return new RegExp(path, flags); + } + } +}); + +// node_modules/express/lib/router/layer.js +var require_layer = __commonJS({ + "node_modules/express/lib/router/layer.js"(exports2, module2) { + "use strict"; + var pathRegexp = require_path_to_regexp(); + var debug = require_src()("express:router:layer"); + var hasOwnProperty = Object.prototype.hasOwnProperty; + module2.exports = Layer; + function Layer(path, options, fn2) { + if (!(this instanceof Layer)) { + return new Layer(path, options, fn2); + } + debug("new %o", path); + var opts = options || {}; + this.handle = fn2; + this.name = fn2.name || ""; + this.params = void 0; + this.path = void 0; + this.regexp = pathRegexp(path, this.keys = [], opts); + this.regexp.fast_star = path === "*"; + this.regexp.fast_slash = path === "/" && opts.end === false; + } + Layer.prototype.handle_error = function handle_error(error2, req, res, next) { + var fn2 = this.handle; + if (fn2.length !== 4) { + return next(error2); + } + try { + fn2(error2, req, res, next); + } catch (err) { + next(err); + } + }; + Layer.prototype.handle_request = function handle(req, res, next) { + var fn2 = this.handle; + if (fn2.length > 3) { + return next(); + } + try { + fn2(req, res, next); + } catch (err) { + next(err); + } + }; + Layer.prototype.match = function match(path) { + var match2; + if (path != null) { + if (this.regexp.fast_slash) { + this.params = {}; + this.path = ""; + return true; + } + if (this.regexp.fast_star) { + this.params = { "0": decode_param(path) }; + this.path = path; + return true; + } + match2 = this.regexp.exec(path); + } + if (!match2) { + this.params = void 0; + this.path = void 0; + return false; + } + this.params = {}; + this.path = match2[0]; + var keys = this.keys; + var params = this.params; + for (var i4 = 1; i4 < match2.length; i4++) { + var key = keys[i4 - 1]; + var prop = key.name; + var val = decode_param(match2[i4]); + if (val !== void 0 || !hasOwnProperty.call(params, prop)) { + params[prop] = val; + } + } + return true; + }; + function decode_param(val) { + if (typeof val !== "string" || val.length === 0) { + return val; + } + try { + return decodeURIComponent(val); + } catch (err) { + if (err instanceof URIError) { + err.message = "Failed to decode param '" + val + "'"; + err.status = err.statusCode = 400; + } + throw err; + } + } + } +}); + +// node_modules/methods/index.js +var require_methods = __commonJS({ + "node_modules/methods/index.js"(exports2, module2) { + "use strict"; + var http = require("http"); + module2.exports = getCurrentNodeMethods() || getBasicNodeMethods(); + function getCurrentNodeMethods() { + return http.METHODS && http.METHODS.map(function lowerCaseMethod(method) { + return method.toLowerCase(); + }); + } + function getBasicNodeMethods() { + return [ + "get", + "post", + "put", + "head", + "delete", + "options", + "trace", + "copy", + "lock", + "mkcol", + "move", + "purge", + "propfind", + "proppatch", + "unlock", + "report", + "mkactivity", + "checkout", + "merge", + "m-search", + "notify", + "subscribe", + "unsubscribe", + "patch", + "search", + "connect" + ]; + } + } +}); + +// node_modules/express/lib/router/route.js +var require_route = __commonJS({ + "node_modules/express/lib/router/route.js"(exports2, module2) { + "use strict"; + var debug = require_src()("express:router:route"); + var flatten = require_array_flatten(); + var Layer = require_layer(); + var methods = require_methods(); + var slice = Array.prototype.slice; + var toString = Object.prototype.toString; + module2.exports = Route; + function Route(path) { + this.path = path; + this.stack = []; + debug("new %o", path); + this.methods = {}; + } + Route.prototype._handles_method = function _handles_method(method) { + if (this.methods._all) { + return true; + } + var name = method.toLowerCase(); + if (name === "head" && !this.methods["head"]) { + name = "get"; + } + return Boolean(this.methods[name]); + }; + Route.prototype._options = function _options() { + var methods2 = Object.keys(this.methods); + if (this.methods.get && !this.methods.head) { + methods2.push("head"); + } + for (var i4 = 0; i4 < methods2.length; i4++) { + methods2[i4] = methods2[i4].toUpperCase(); + } + return methods2; + }; + Route.prototype.dispatch = function dispatch(req, res, done) { + var idx = 0; + var stack2 = this.stack; + if (stack2.length === 0) { + return done(); + } + var method = req.method.toLowerCase(); + if (method === "head" && !this.methods["head"]) { + method = "get"; + } + req.route = this; + next(); + function next(err) { + if (err && err === "route") { + return done(); + } + if (err && err === "router") { + return done(err); + } + var layer = stack2[idx++]; + if (!layer) { + return done(err); + } + if (layer.method && layer.method !== method) { + return next(err); + } + if (err) { + layer.handle_error(err, req, res, next); + } else { + layer.handle_request(req, res, next); + } + } + }; + Route.prototype.all = function all() { + var handles = flatten(slice.call(arguments)); + for (var i4 = 0; i4 < handles.length; i4++) { + var handle = handles[i4]; + if (typeof handle !== "function") { + var type = toString.call(handle); + var msg = "Route.all() requires a callback function but got a " + type; + throw new TypeError(msg); + } + var layer = Layer("/", {}, handle); + layer.method = void 0; + this.methods._all = true; + this.stack.push(layer); + } + return this; + }; + methods.forEach(function(method) { + Route.prototype[method] = function() { + var handles = flatten(slice.call(arguments)); + for (var i4 = 0; i4 < handles.length; i4++) { + var handle = handles[i4]; + if (typeof handle !== "function") { + var type = toString.call(handle); + var msg = "Route." + method + "() requires a callback function but got a " + type; + throw new Error(msg); + } + debug("%s %o", method, this.path); + var layer = Layer("/", {}, handle); + layer.method = method; + this.methods[method] = true; + this.stack.push(layer); + } + return this; + }; + }); + } +}); + +// node_modules/utils-merge/index.js +var require_utils_merge = __commonJS({ + "node_modules/utils-merge/index.js"(exports2, module2) { + exports2 = module2.exports = function(a4, b4) { + if (a4 && b4) { + for (var key in b4) { + a4[key] = b4[key]; + } + } + return a4; + }; + } +}); + +// node_modules/express/lib/router/index.js +var require_router = __commonJS({ + "node_modules/express/lib/router/index.js"(exports2, module2) { + "use strict"; + var Route = require_route(); + var Layer = require_layer(); + var methods = require_methods(); + var mixin = require_utils_merge(); + var debug = require_src()("express:router"); + var deprecate2 = require_depd()("express"); + var flatten = require_array_flatten(); + var parseUrl4 = require_parseurl(); + var setPrototypeOf = require_setprototypeof(); + var objectRegExp = /^\[object (\S+)\]$/; + var slice = Array.prototype.slice; + var toString = Object.prototype.toString; + var proto = module2.exports = function(options) { + var opts = options || {}; + function router(req, res, next) { + router.handle(req, res, next); + } + setPrototypeOf(router, proto); + router.params = {}; + router._params = []; + router.caseSensitive = opts.caseSensitive; + router.mergeParams = opts.mergeParams; + router.strict = opts.strict; + router.stack = []; + return router; + }; + proto.param = function param(name, fn2) { + if (typeof name === "function") { + deprecate2("router.param(fn): Refactor to use path params"); + this._params.push(name); + return; + } + var params = this._params; + var len = params.length; + var ret; + if (name[0] === ":") { + deprecate2("router.param(" + JSON.stringify(name) + ", fn): Use router.param(" + JSON.stringify(name.substr(1)) + ", fn) instead"); + name = name.substr(1); + } + for (var i4 = 0; i4 < len; ++i4) { + if (ret = params[i4](name, fn2)) { + fn2 = ret; + } + } + if ("function" !== typeof fn2) { + throw new Error("invalid param() call for " + name + ", got " + fn2); + } + (this.params[name] = this.params[name] || []).push(fn2); + return this; + }; + proto.handle = function handle(req, res, out) { + var self2 = this; + debug("dispatching %s %s", req.method, req.url); + var idx = 0; + var protohost = getProtohost(req.url) || ""; + var removed = ""; + var slashAdded = false; + var paramcalled = {}; + var options = []; + var stack2 = self2.stack; + var parentParams = req.params; + var parentUrl = req.baseUrl || ""; + var done = restore(out, req, "baseUrl", "next", "params"); + req.next = next; + if (req.method === "OPTIONS") { + done = wrap(done, function(old, err) { + if (err || options.length === 0) return old(err); + sendOptionsResponse(res, options, old); + }); + } + req.baseUrl = parentUrl; + req.originalUrl = req.originalUrl || req.url; + next(); + function next(err) { + var layerError = err === "route" ? null : err; + if (slashAdded) { + req.url = req.url.substr(1); + slashAdded = false; + } + if (removed.length !== 0) { + req.baseUrl = parentUrl; + req.url = protohost + removed + req.url.substr(protohost.length); + removed = ""; + } + if (layerError === "router") { + setImmediate(done, null); + return; + } + if (idx >= stack2.length) { + setImmediate(done, layerError); + return; + } + var path = getPathname(req); + if (path == null) { + return done(layerError); + } + var layer; + var match; + var route; + while (match !== true && idx < stack2.length) { + layer = stack2[idx++]; + match = matchLayer(layer, path); + route = layer.route; + if (typeof match !== "boolean") { + layerError = layerError || match; + } + if (match !== true) { + continue; + } + if (!route) { + continue; + } + if (layerError) { + match = false; + continue; + } + var method = req.method; + var has_method = route._handles_method(method); + if (!has_method && method === "OPTIONS") { + appendMethods(options, route._options()); + } + if (!has_method && method !== "HEAD") { + match = false; + continue; + } + } + if (match !== true) { + return done(layerError); + } + if (route) { + req.route = route; + } + req.params = self2.mergeParams ? mergeParams(layer.params, parentParams) : layer.params; + var layerPath = layer.path; + self2.process_params(layer, paramcalled, req, res, function(err2) { + if (err2) { + return next(layerError || err2); + } + if (route) { + return layer.handle_request(req, res, next); + } + trim_prefix(layer, layerError, layerPath, path); + }); + } + function trim_prefix(layer, layerError, layerPath, path) { + if (layerPath.length !== 0) { + var c4 = path[layerPath.length]; + if (c4 && c4 !== "/" && c4 !== ".") return next(layerError); + debug("trim prefix (%s) from url %s", layerPath, req.url); + removed = layerPath; + req.url = protohost + req.url.substr(protohost.length + removed.length); + if (!protohost && req.url[0] !== "/") { + req.url = "/" + req.url; + slashAdded = true; + } + req.baseUrl = parentUrl + (removed[removed.length - 1] === "/" ? removed.substring(0, removed.length - 1) : removed); + } + debug("%s %s : %s", layer.name, layerPath, req.originalUrl); + if (layerError) { + layer.handle_error(layerError, req, res, next); + } else { + layer.handle_request(req, res, next); + } + } + }; + proto.process_params = function process_params(layer, called, req, res, done) { + var params = this.params; + var keys = layer.keys; + if (!keys || keys.length === 0) { + return done(); + } + var i4 = 0; + var name; + var paramIndex = 0; + var key; + var paramVal; + var paramCallbacks; + var paramCalled; + function param(err) { + if (err) { + return done(err); + } + if (i4 >= keys.length) { + return done(); + } + paramIndex = 0; + key = keys[i4++]; + name = key.name; + paramVal = req.params[name]; + paramCallbacks = params[name]; + paramCalled = called[name]; + if (paramVal === void 0 || !paramCallbacks) { + return param(); + } + if (paramCalled && (paramCalled.match === paramVal || paramCalled.error && paramCalled.error !== "route")) { + req.params[name] = paramCalled.value; + return param(paramCalled.error); + } + called[name] = paramCalled = { + error: null, + match: paramVal, + value: paramVal + }; + paramCallback(); + } + function paramCallback(err) { + var fn2 = paramCallbacks[paramIndex++]; + paramCalled.value = req.params[key.name]; + if (err) { + paramCalled.error = err; + param(err); + return; + } + if (!fn2) return param(); + try { + fn2(req, res, paramCallback, paramVal, key.name); + } catch (e4) { + paramCallback(e4); + } + } + param(); + }; + proto.use = function use(fn2) { + var offset = 0; + var path = "/"; + if (typeof fn2 !== "function") { + var arg = fn2; + while (Array.isArray(arg) && arg.length !== 0) { + arg = arg[0]; + } + if (typeof arg !== "function") { + offset = 1; + path = fn2; + } + } + var callbacks = flatten(slice.call(arguments, offset)); + if (callbacks.length === 0) { + throw new TypeError("Router.use() requires a middleware function"); + } + for (var i4 = 0; i4 < callbacks.length; i4++) { + var fn2 = callbacks[i4]; + if (typeof fn2 !== "function") { + throw new TypeError("Router.use() requires a middleware function but got a " + gettype(fn2)); + } + debug("use %o %s", path, fn2.name || ""); + var layer = new Layer(path, { + sensitive: this.caseSensitive, + strict: false, + end: false + }, fn2); + layer.route = void 0; + this.stack.push(layer); + } + return this; + }; + proto.route = function route(path) { + var route2 = new Route(path); + var layer = new Layer(path, { + sensitive: this.caseSensitive, + strict: this.strict, + end: true + }, route2.dispatch.bind(route2)); + layer.route = route2; + this.stack.push(layer); + return route2; + }; + methods.concat("all").forEach(function(method) { + proto[method] = function(path) { + var route = this.route(path); + route[method].apply(route, slice.call(arguments, 1)); + return this; + }; + }); + function appendMethods(list2, addition) { + for (var i4 = 0; i4 < addition.length; i4++) { + var method = addition[i4]; + if (list2.indexOf(method) === -1) { + list2.push(method); + } + } + } + function getPathname(req) { + try { + return parseUrl4(req).pathname; + } catch (err) { + return void 0; + } + } + function getProtohost(url) { + if (typeof url !== "string" || url.length === 0 || url[0] === "/") { + return void 0; + } + var searchIndex = url.indexOf("?"); + var pathLength = searchIndex !== -1 ? searchIndex : url.length; + var fqdnIndex = url.substr(0, pathLength).indexOf("://"); + return fqdnIndex !== -1 ? url.substr(0, url.indexOf("/", 3 + fqdnIndex)) : void 0; + } + function gettype(obj) { + var type = typeof obj; + if (type !== "object") { + return type; + } + return toString.call(obj).replace(objectRegExp, "$1"); + } + function matchLayer(layer, path) { + try { + return layer.match(path); + } catch (err) { + return err; + } + } + function mergeParams(params, parent) { + if (typeof parent !== "object" || !parent) { + return params; + } + var obj = mixin({}, parent); + if (!(0 in params) || !(0 in parent)) { + return mixin(obj, params); + } + var i4 = 0; + var o4 = 0; + while (i4 in params) { + i4++; + } + while (o4 in parent) { + o4++; + } + for (i4--; i4 >= 0; i4--) { + params[i4 + o4] = params[i4]; + if (i4 < o4) { + delete params[i4]; + } + } + return mixin(obj, params); + } + function restore(fn2, obj) { + var props = new Array(arguments.length - 2); + var vals = new Array(arguments.length - 2); + for (var i4 = 0; i4 < props.length; i4++) { + props[i4] = arguments[i4 + 2]; + vals[i4] = obj[props[i4]]; + } + return function() { + for (var i5 = 0; i5 < props.length; i5++) { + obj[props[i5]] = vals[i5]; + } + return fn2.apply(this, arguments); + }; + } + function sendOptionsResponse(res, options, next) { + try { + var body = options.join(","); + res.set("Allow", body); + res.send(body); + } catch (err) { + next(err); + } + } + function wrap(old, fn2) { + return function proxy() { + var args2 = new Array(arguments.length + 1); + args2[0] = old; + for (var i4 = 0, len = arguments.length; i4 < len; i4++) { + args2[i4 + 1] = arguments[i4]; + } + fn2.apply(this, args2); + }; + } + } +}); + +// node_modules/express/lib/middleware/init.js +var require_init = __commonJS({ + "node_modules/express/lib/middleware/init.js"(exports2) { + "use strict"; + var setPrototypeOf = require_setprototypeof(); + exports2.init = function(app2) { + return function expressInit(req, res, next) { + if (app2.enabled("x-powered-by")) res.setHeader("X-Powered-By", "Express"); + req.res = res; + res.req = req; + req.next = next; + setPrototypeOf(req, app2.request); + setPrototypeOf(res, app2.response); + res.locals = res.locals || /* @__PURE__ */ Object.create(null); + next(); + }; + }; + } +}); + +// node_modules/express/lib/middleware/query.js +var require_query = __commonJS({ + "node_modules/express/lib/middleware/query.js"(exports2, module2) { + "use strict"; + var merge = require_utils_merge(); + var parseUrl4 = require_parseurl(); + var qs = require_lib2(); + module2.exports = function query(options) { + var opts = merge({}, options); + var queryparse = qs.parse; + if (typeof options === "function") { + queryparse = options; + opts = void 0; + } + if (opts !== void 0 && opts.allowPrototypes === void 0) { + opts.allowPrototypes = true; + } + return function query2(req, res, next) { + if (!req.query) { + var val = parseUrl4(req).query; + req.query = queryparse(val, opts); + } + next(); + }; + }; + } +}); + +// node_modules/express/lib/view.js +var require_view = __commonJS({ + "node_modules/express/lib/view.js"(exports2, module2) { + "use strict"; + var debug = require_src()("express:view"); + var path = require("path"); + var fs = require("fs"); + var dirname = path.dirname; + var basename = path.basename; + var extname = path.extname; + var join = path.join; + var resolve = path.resolve; + module2.exports = View; + function View(name, options) { + var opts = options || {}; + this.defaultEngine = opts.defaultEngine; + this.ext = extname(name); + this.name = name; + this.root = opts.root; + if (!this.ext && !this.defaultEngine) { + throw new Error("No default engine was specified and no extension was provided."); + } + var fileName = name; + if (!this.ext) { + this.ext = this.defaultEngine[0] !== "." ? "." + this.defaultEngine : this.defaultEngine; + fileName += this.ext; + } + if (!opts.engines[this.ext]) { + var mod = this.ext.substr(1); + debug('require "%s"', mod); + var fn2 = require(mod).__express; + if (typeof fn2 !== "function") { + throw new Error('Module "' + mod + '" does not provide a view engine.'); + } + opts.engines[this.ext] = fn2; + } + this.engine = opts.engines[this.ext]; + this.path = this.lookup(fileName); + } + View.prototype.lookup = function lookup(name) { + var path2; + var roots = [].concat(this.root); + debug('lookup "%s"', name); + for (var i4 = 0; i4 < roots.length && !path2; i4++) { + var root = roots[i4]; + var loc = resolve(root, name); + var dir = dirname(loc); + var file = basename(loc); + path2 = this.resolve(dir, file); + } + return path2; + }; + View.prototype.render = function render(options, callback) { + debug('render "%s"', this.path); + this.engine(this.path, options, callback); + }; + View.prototype.resolve = function resolve2(dir, file) { + var ext = this.ext; + var path2 = join(dir, file); + var stat = tryStat(path2); + if (stat && stat.isFile()) { + return path2; + } + path2 = join(dir, basename(file, ext), "index" + ext); + stat = tryStat(path2); + if (stat && stat.isFile()) { + return path2; + } + }; + function tryStat(path2) { + debug('stat "%s"', path2); + try { + return fs.statSync(path2); + } catch (e4) { + return void 0; + } + } + } +}); + +// node_modules/safe-buffer/index.js +var require_safe_buffer = __commonJS({ + "node_modules/safe-buffer/index.js"(exports2, module2) { + var buffer = require("buffer"); + var Buffer2 = buffer.Buffer; + function copyProps(src, dst) { + for (var key in src) { + dst[key] = src[key]; + } + } + if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) { + module2.exports = buffer; + } else { + copyProps(buffer, exports2); + exports2.Buffer = SafeBuffer; + } + function SafeBuffer(arg, encodingOrOffset, length) { + return Buffer2(arg, encodingOrOffset, length); + } + copyProps(Buffer2, SafeBuffer); + SafeBuffer.from = function(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + throw new TypeError("Argument must not be a number"); + } + return Buffer2(arg, encodingOrOffset, length); + }; + SafeBuffer.alloc = function(size, fill, encoding) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + var buf = Buffer2(size); + if (fill !== void 0) { + if (typeof encoding === "string") { + buf.fill(fill, encoding); + } else { + buf.fill(fill); + } + } else { + buf.fill(0); + } + return buf; + }; + SafeBuffer.allocUnsafe = function(size) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + return Buffer2(size); + }; + SafeBuffer.allocUnsafeSlow = function(size) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + return buffer.SlowBuffer(size); + }; + } +}); + +// node_modules/content-disposition/index.js +var require_content_disposition = __commonJS({ + "node_modules/content-disposition/index.js"(exports2, module2) { + "use strict"; + module2.exports = contentDisposition; + module2.exports.parse = parse; + var basename = require("path").basename; + var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g; + var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/; + var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g; + var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g; + var QESC_REGEXP = /\\([\u0000-\u007f])/g; + var QUOTE_REGEXP = /([\\"])/g; + var PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g; + var TEXT_REGEXP = /^[\x20-\x7e\x80-\xff]+$/; + var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/; + var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/; + var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/; + function contentDisposition(filename, options) { + var opts = options || {}; + var type = opts.type || "attachment"; + var params = createparams(filename, opts.fallback); + return format2(new ContentDisposition(type, params)); + } + function createparams(filename, fallback) { + if (filename === void 0) { + return; + } + var params = {}; + if (typeof filename !== "string") { + throw new TypeError("filename must be a string"); + } + if (fallback === void 0) { + fallback = true; + } + if (typeof fallback !== "string" && typeof fallback !== "boolean") { + throw new TypeError("fallback must be a string or boolean"); + } + if (typeof fallback === "string" && NON_LATIN1_REGEXP.test(fallback)) { + throw new TypeError("fallback must be ISO-8859-1 string"); + } + var name = basename(filename); + var isQuotedString = TEXT_REGEXP.test(name); + var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name) : basename(fallback); + var hasFallback = typeof fallbackName === "string" && fallbackName !== name; + if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) { + params["filename*"] = name; + } + if (isQuotedString || hasFallback) { + params.filename = hasFallback ? fallbackName : name; + } + return params; + } + function format2(obj) { + var parameters = obj.parameters; + var type = obj.type; + if (!type || typeof type !== "string" || !TOKEN_REGEXP.test(type)) { + throw new TypeError("invalid type"); + } + var string = String(type).toLowerCase(); + if (parameters && typeof parameters === "object") { + var param; + var params = Object.keys(parameters).sort(); + for (var i4 = 0; i4 < params.length; i4++) { + param = params[i4]; + var val = param.substr(-1) === "*" ? ustring(parameters[param]) : qstring(parameters[param]); + string += "; " + param + "=" + val; + } + } + return string; + } + function decodefield(str) { + var match = EXT_VALUE_REGEXP.exec(str); + if (!match) { + throw new TypeError("invalid extended field value"); + } + var charset = match[1].toLowerCase(); + var encoded = match[2]; + var value; + var binary = encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode); + switch (charset) { + case "iso-8859-1": + value = getlatin1(binary); + break; + case "utf-8": + value = new Buffer(binary, "binary").toString("utf8"); + break; + default: + throw new TypeError("unsupported charset in extended field"); + } + return value; + } + function getlatin1(val) { + return String(val).replace(NON_LATIN1_REGEXP, "?"); + } + function parse(string) { + if (!string || typeof string !== "string") { + throw new TypeError("argument string is required"); + } + var match = DISPOSITION_TYPE_REGEXP.exec(string); + if (!match) { + throw new TypeError("invalid type format"); + } + var index = match[0].length; + var type = match[1].toLowerCase(); + var key; + var names = []; + var params = {}; + var value; + index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ";" ? index - 1 : index; + while (match = PARAM_REGEXP.exec(string)) { + if (match.index !== index) { + throw new TypeError("invalid parameter format"); + } + index += match[0].length; + key = match[1].toLowerCase(); + value = match[2]; + if (names.indexOf(key) !== -1) { + throw new TypeError("invalid duplicate parameter"); + } + names.push(key); + if (key.indexOf("*") + 1 === key.length) { + key = key.slice(0, -1); + value = decodefield(value); + params[key] = value; + continue; + } + if (typeof params[key] === "string") { + continue; + } + if (value[0] === '"') { + value = value.substr(1, value.length - 2).replace(QESC_REGEXP, "$1"); + } + params[key] = value; + } + if (index !== -1 && index !== string.length) { + throw new TypeError("invalid parameter format"); + } + return new ContentDisposition(type, params); + } + function pdecode(str, hex) { + return String.fromCharCode(parseInt(hex, 16)); + } + function pencode(char) { + var hex = String(char).charCodeAt(0).toString(16).toUpperCase(); + return hex.length === 1 ? "%0" + hex : "%" + hex; + } + function qstring(val) { + var str = String(val); + return '"' + str.replace(QUOTE_REGEXP, "\\$1") + '"'; + } + function ustring(val) { + var str = String(val); + var encoded = encodeURIComponent(str).replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode); + return "UTF-8''" + encoded; + } + function ContentDisposition(type, parameters) { + this.type = type; + this.parameters = parameters; + } + } +}); + +// node_modules/destroy/index.js +var require_destroy = __commonJS({ + "node_modules/destroy/index.js"(exports2, module2) { + "use strict"; + var ReadStream = require("fs").ReadStream; + var Stream = require("stream"); + module2.exports = destroy; + function destroy(stream) { + if (stream instanceof ReadStream) { + return destroyReadStream(stream); + } + if (!(stream instanceof Stream)) { + return stream; + } + if (typeof stream.destroy === "function") { + stream.destroy(); + } + return stream; + } + function destroyReadStream(stream) { + stream.destroy(); + if (typeof stream.close === "function") { + stream.on("open", onOpenClose); + } + return stream; + } + function onOpenClose() { + if (typeof this.fd === "number") { + this.close(); + } + } + } +}); + +// node_modules/etag/index.js +var require_etag = __commonJS({ + "node_modules/etag/index.js"(exports2, module2) { + "use strict"; + module2.exports = etag; + var crypto2 = require("crypto"); + var Stats = require("fs").Stats; + var toString = Object.prototype.toString; + function entitytag(entity) { + if (entity.length === 0) { + return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"'; + } + var hash = crypto2.createHash("sha1").update(entity, "utf8").digest("base64").substring(0, 27); + var len = typeof entity === "string" ? Buffer.byteLength(entity, "utf8") : entity.length; + return '"' + len.toString(16) + "-" + hash + '"'; + } + function etag(entity, options) { + if (entity == null) { + throw new TypeError("argument entity is required"); + } + var isStats = isstats(entity); + var weak = options && typeof options.weak === "boolean" ? options.weak : isStats; + if (!isStats && typeof entity !== "string" && !Buffer.isBuffer(entity)) { + throw new TypeError("argument entity must be string, Buffer, or fs.Stats"); + } + var tag2 = isStats ? stattag(entity) : entitytag(entity); + return weak ? "W/" + tag2 : tag2; + } + function isstats(obj) { + if (typeof Stats === "function" && obj instanceof Stats) { + return true; + } + return obj && typeof obj === "object" && "ctime" in obj && toString.call(obj.ctime) === "[object Date]" && "mtime" in obj && toString.call(obj.mtime) === "[object Date]" && "ino" in obj && typeof obj.ino === "number" && "size" in obj && typeof obj.size === "number"; + } + function stattag(stat) { + var mtime = stat.mtime.getTime().toString(16); + var size = stat.size.toString(16); + return '"' + size + "-" + mtime + '"'; + } + } +}); + +// node_modules/fresh/index.js +var require_fresh = __commonJS({ + "node_modules/fresh/index.js"(exports2, module2) { + "use strict"; + var CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\s*?no-cache\s*?(?:,|$)/; + module2.exports = fresh; + function fresh(reqHeaders, resHeaders) { + var modifiedSince = reqHeaders["if-modified-since"]; + var noneMatch = reqHeaders["if-none-match"]; + if (!modifiedSince && !noneMatch) { + return false; + } + var cacheControl = reqHeaders["cache-control"]; + if (cacheControl && CACHE_CONTROL_NO_CACHE_REGEXP.test(cacheControl)) { + return false; + } + if (noneMatch && noneMatch !== "*") { + var etag = resHeaders["etag"]; + if (!etag) { + return false; + } + var etagStale = true; + var matches = parseTokenList(noneMatch); + for (var i4 = 0; i4 < matches.length; i4++) { + var match = matches[i4]; + if (match === etag || match === "W/" + etag || "W/" + match === etag) { + etagStale = false; + break; + } + } + if (etagStale) { + return false; + } + } + if (modifiedSince) { + var lastModified = resHeaders["last-modified"]; + var modifiedStale = !lastModified || !(parseHttpDate(lastModified) <= parseHttpDate(modifiedSince)); + if (modifiedStale) { + return false; + } + } + return true; + } + function parseHttpDate(date2) { + var timestamp = date2 && Date.parse(date2); + return typeof timestamp === "number" ? timestamp : NaN; + } + function parseTokenList(str) { + var end = 0; + var list2 = []; + var start = 0; + for (var i4 = 0, len = str.length; i4 < len; i4++) { + switch (str.charCodeAt(i4)) { + case 32: + if (start === end) { + start = end = i4 + 1; + } + break; + case 44: + list2.push(str.substring(start, end)); + start = end = i4 + 1; + break; + default: + end = i4 + 1; + break; + } + } + list2.push(str.substring(start, end)); + return list2; + } + } +}); + +// node_modules/mime/types.json +var require_types = __commonJS({ + "node_modules/mime/types.json"(exports2, module2) { + module2.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomsvc+xml": ["atomsvc"], "application/bdoc": ["bdoc"], "application/ccxml+xml": ["ccxml"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["ecma"], "application/emma+xml": ["emma"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/font-tdpfr": ["pfr"], "application/font-woff": ["woff"], "application/font-woff2": ["woff2"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/prs.cww": ["cww"], "application/pskc+xml": ["pskcxml"], "application/rdf+xml": ["rdf"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/voicexml+xml": ["vxml"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-otf": ["otf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-ttf": ["ttf", "ttc"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["iso"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["exe"], "application/x-msdownload": ["exe", "dll", "com", "bat", "msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["wmf", "wmz", "emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["prc", "pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "application/xaml+xml": ["xaml"], "application/xcap-diff+xml": ["xdf"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["3gpp"], "audio/adpcm": ["adp"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mp3": ["mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/wav": ["wav"], "audio/wave": ["wav"], "audio/webm": ["weba"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["ra"], "audio/x-wav": ["wav"], "audio/xm": ["xm"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "font/otf": ["otf"], "image/apng": ["apng"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/ief": ["ief"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/ktx": ["ktx"], "image/png": ["png"], "image/prs.btif": ["btif"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/tiff": ["tiff", "tif"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/webp": ["webp"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["bmp"], "image/x-pcx": ["pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/rfc822": ["eml", "mime"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.vtu": ["vtu"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["x3db", "x3dbz"], "model/x3d+vrml": ["x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/hjson": ["hjson"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/prs.lines.tag": ["dsc"], "text/richtext": ["rtx"], "text/rtf": ["rtf"], "text/sgml": ["sgml", "sgm"], "text/slim": ["slim", "slm"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/vtt": ["vtt"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "text/xml": ["xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/jpeg": ["jpgv"], "video/jpm": ["jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/webm": ["webm"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] }; + } +}); + +// node_modules/mime/mime.js +var require_mime = __commonJS({ + "node_modules/mime/mime.js"(exports2, module2) { + var path = require("path"); + var fs = require("fs"); + function Mime() { + this.types = /* @__PURE__ */ Object.create(null); + this.extensions = /* @__PURE__ */ Object.create(null); + } + Mime.prototype.define = function(map2) { + for (var type in map2) { + var exts = map2[type]; + for (var i4 = 0; i4 < exts.length; i4++) { + if (process.env.DEBUG_MIME && this.types[exts[i4]]) { + console.warn((this._loading || "define()").replace(/.*\//, ""), 'changes "' + exts[i4] + '" extension type from ' + this.types[exts[i4]] + " to " + type); + } + this.types[exts[i4]] = type; + } + if (!this.extensions[type]) { + this.extensions[type] = exts[0]; + } + } + }; + Mime.prototype.load = function(file) { + this._loading = file; + var map2 = {}, content = fs.readFileSync(file, "ascii"), lines = content.split(/[\r\n]+/); + lines.forEach(function(line) { + var fields = line.replace(/\s*#.*|^\s*|\s*$/g, "").split(/\s+/); + map2[fields.shift()] = fields; + }); + this.define(map2); + this._loading = null; + }; + Mime.prototype.lookup = function(path2, fallback) { + var ext = path2.replace(/^.*[\.\/\\]/, "").toLowerCase(); + return this.types[ext] || fallback || this.default_type; + }; + Mime.prototype.extension = function(mimeType) { + var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); + return this.extensions[type]; + }; + var mime = new Mime(); + mime.define(require_types()); + mime.default_type = mime.lookup("bin"); + mime.Mime = Mime; + mime.charsets = { + lookup: function(mimeType, fallback) { + return /^text\/|^application\/(javascript|json)/.test(mimeType) ? "UTF-8" : fallback; + } + }; + module2.exports = mime; + } +}); + +// node_modules/range-parser/index.js +var require_range_parser = __commonJS({ + "node_modules/range-parser/index.js"(exports2, module2) { + "use strict"; + module2.exports = rangeParser; + function rangeParser(size, str, options) { + if (typeof str !== "string") { + throw new TypeError("argument str must be a string"); + } + var index = str.indexOf("="); + if (index === -1) { + return -2; + } + var arr = str.slice(index + 1).split(","); + var ranges = []; + ranges.type = str.slice(0, index); + for (var i4 = 0; i4 < arr.length; i4++) { + var range2 = arr[i4].split("-"); + var start = parseInt(range2[0], 10); + var end = parseInt(range2[1], 10); + if (isNaN(start)) { + start = size - end; + end = size - 1; + } else if (isNaN(end)) { + end = size - 1; + } + if (end > size - 1) { + end = size - 1; + } + if (isNaN(start) || isNaN(end) || start > end || start < 0) { + continue; + } + ranges.push({ + start, + end + }); + } + if (ranges.length < 1) { + return -1; + } + return options && options.combine ? combineRanges(ranges) : ranges; + } + function combineRanges(ranges) { + var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart); + for (var j4 = 0, i4 = 1; i4 < ordered.length; i4++) { + var range2 = ordered[i4]; + var current = ordered[j4]; + if (range2.start > current.end + 1) { + ordered[++j4] = range2; + } else if (range2.end > current.end) { + current.end = range2.end; + current.index = Math.min(current.index, range2.index); + } + } + ordered.length = j4 + 1; + var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex); + combined.type = ranges.type; + return combined; + } + function mapWithIndex(range2, index) { + return { + start: range2.start, + end: range2.end, + index + }; + } + function mapWithoutIndex(range2) { + return { + start: range2.start, + end: range2.end + }; + } + function sortByRangeIndex(a4, b4) { + return a4.index - b4.index; + } + function sortByRangeStart(a4, b4) { + return a4.start - b4.start; + } + } +}); + +// node_modules/send/index.js +var require_send = __commonJS({ + "node_modules/send/index.js"(exports2, module2) { + "use strict"; + var createError2 = require_http_errors(); + var debug = require_src()("send"); + var deprecate2 = require_depd()("send"); + var destroy = require_destroy(); + var encodeUrl = require_encodeurl(); + var escapeHtml = require_escape_html(); + var etag = require_etag(); + var fresh = require_fresh(); + var fs = require("fs"); + var mime = require_mime(); + var ms = require_ms(); + var onFinished = require_on_finished(); + var parseRange = require_range_parser(); + var path = require("path"); + var statuses = require_statuses(); + var Stream = require("stream"); + var util = require("util"); + var extname = path.extname; + var join = path.join; + var normalize = path.normalize; + var resolve = path.resolve; + var sep = path.sep; + var BYTES_RANGE_REGEXP = /^ *bytes=/; + var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3; + var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/; + module2.exports = send; + module2.exports.mime = mime; + function send(req, path2, options) { + return new SendStream(req, path2, options); + } + function SendStream(req, path2, options) { + Stream.call(this); + var opts = options || {}; + this.options = opts; + this.path = path2; + this.req = req; + this._acceptRanges = opts.acceptRanges !== void 0 ? Boolean(opts.acceptRanges) : true; + this._cacheControl = opts.cacheControl !== void 0 ? Boolean(opts.cacheControl) : true; + this._etag = opts.etag !== void 0 ? Boolean(opts.etag) : true; + this._dotfiles = opts.dotfiles !== void 0 ? opts.dotfiles : "ignore"; + if (this._dotfiles !== "ignore" && this._dotfiles !== "allow" && this._dotfiles !== "deny") { + throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"'); + } + this._hidden = Boolean(opts.hidden); + if (opts.hidden !== void 0) { + deprecate2("hidden: use dotfiles: '" + (this._hidden ? "allow" : "ignore") + "' instead"); + } + if (opts.dotfiles === void 0) { + this._dotfiles = void 0; + } + this._extensions = opts.extensions !== void 0 ? normalizeList(opts.extensions, "extensions option") : []; + this._immutable = opts.immutable !== void 0 ? Boolean(opts.immutable) : false; + this._index = opts.index !== void 0 ? normalizeList(opts.index, "index option") : ["index.html"]; + this._lastModified = opts.lastModified !== void 0 ? Boolean(opts.lastModified) : true; + this._maxage = opts.maxAge || opts.maxage; + this._maxage = typeof this._maxage === "string" ? ms(this._maxage) : Number(this._maxage); + this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0; + this._root = opts.root ? resolve(opts.root) : null; + if (!this._root && opts.from) { + this.from(opts.from); + } + } + util.inherits(SendStream, Stream); + SendStream.prototype.etag = deprecate2.function(function etag2(val) { + this._etag = Boolean(val); + debug("etag %s", this._etag); + return this; + }, "send.etag: pass etag as option"); + SendStream.prototype.hidden = deprecate2.function(function hidden(val) { + this._hidden = Boolean(val); + this._dotfiles = void 0; + debug("hidden %s", this._hidden); + return this; + }, "send.hidden: use dotfiles option"); + SendStream.prototype.index = deprecate2.function(function index(paths) { + var index2 = !paths ? [] : normalizeList(paths, "paths argument"); + debug("index %o", paths); + this._index = index2; + return this; + }, "send.index: pass index as option"); + SendStream.prototype.root = function root(path2) { + this._root = resolve(String(path2)); + debug("root %s", this._root); + return this; + }; + SendStream.prototype.from = deprecate2.function( + SendStream.prototype.root, + "send.from: pass root as option" + ); + SendStream.prototype.root = deprecate2.function( + SendStream.prototype.root, + "send.root: pass root as option" + ); + SendStream.prototype.maxage = deprecate2.function(function maxage(maxAge) { + this._maxage = typeof maxAge === "string" ? ms(maxAge) : Number(maxAge); + this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0; + debug("max-age %d", this._maxage); + return this; + }, "send.maxage: pass maxAge as option"); + SendStream.prototype.error = function error2(status, err) { + if (hasListeners(this, "error")) { + return this.emit("error", createError2(status, err, { + expose: false + })); + } + var res = this.res; + var msg = statuses[status] || String(status); + var doc = createHtmlDocument("Error", escapeHtml(msg)); + clearHeaders(res); + if (err && err.headers) { + setHeaders(res, err.headers); + } + res.statusCode = status; + res.setHeader("Content-Type", "text/html; charset=UTF-8"); + res.setHeader("Content-Length", Buffer.byteLength(doc)); + res.setHeader("Content-Security-Policy", "default-src 'self'"); + res.setHeader("X-Content-Type-Options", "nosniff"); + res.end(doc); + }; + SendStream.prototype.hasTrailingSlash = function hasTrailingSlash() { + return this.path[this.path.length - 1] === "/"; + }; + SendStream.prototype.isConditionalGET = function isConditionalGET() { + return this.req.headers["if-match"] || this.req.headers["if-unmodified-since"] || this.req.headers["if-none-match"] || this.req.headers["if-modified-since"]; + }; + SendStream.prototype.isPreconditionFailure = function isPreconditionFailure() { + var req = this.req; + var res = this.res; + var match = req.headers["if-match"]; + if (match) { + var etag2 = res.getHeader("ETag"); + return !etag2 || match !== "*" && parseTokenList(match).every(function(match2) { + return match2 !== etag2 && match2 !== "W/" + etag2 && "W/" + match2 !== etag2; + }); + } + var unmodifiedSince = parseHttpDate(req.headers["if-unmodified-since"]); + if (!isNaN(unmodifiedSince)) { + var lastModified = parseHttpDate(res.getHeader("Last-Modified")); + return isNaN(lastModified) || lastModified > unmodifiedSince; + } + return false; + }; + SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields() { + var res = this.res; + var headers = getHeaderNames(res); + for (var i4 = 0; i4 < headers.length; i4++) { + var header = headers[i4]; + if (header.substr(0, 8) === "content-" && header !== "content-location") { + res.removeHeader(header); + } + } + }; + SendStream.prototype.notModified = function notModified() { + var res = this.res; + debug("not modified"); + this.removeContentHeaderFields(); + res.statusCode = 304; + res.end(); + }; + SendStream.prototype.headersAlreadySent = function headersAlreadySent() { + var err = new Error("Can't set headers after they are sent."); + debug("headers already sent"); + this.error(500, err); + }; + SendStream.prototype.isCachable = function isCachable() { + var statusCode = this.res.statusCode; + return statusCode >= 200 && statusCode < 300 || statusCode === 304; + }; + SendStream.prototype.onStatError = function onStatError(error2) { + switch (error2.code) { + case "ENAMETOOLONG": + case "ENOENT": + case "ENOTDIR": + this.error(404, error2); + break; + default: + this.error(500, error2); + break; + } + }; + SendStream.prototype.isFresh = function isFresh() { + return fresh(this.req.headers, { + "etag": this.res.getHeader("ETag"), + "last-modified": this.res.getHeader("Last-Modified") + }); + }; + SendStream.prototype.isRangeFresh = function isRangeFresh() { + var ifRange = this.req.headers["if-range"]; + if (!ifRange) { + return true; + } + if (ifRange.indexOf('"') !== -1) { + var etag2 = this.res.getHeader("ETag"); + return Boolean(etag2 && ifRange.indexOf(etag2) !== -1); + } + var lastModified = this.res.getHeader("Last-Modified"); + return parseHttpDate(lastModified) <= parseHttpDate(ifRange); + }; + SendStream.prototype.redirect = function redirect(path2) { + var res = this.res; + if (hasListeners(this, "directory")) { + this.emit("directory", res, path2); + return; + } + if (this.hasTrailingSlash()) { + this.error(403); + return; + } + var loc = encodeUrl(collapseLeadingSlashes(this.path + "/")); + var doc = createHtmlDocument("Redirecting", 'Redirecting to ' + escapeHtml(loc) + ""); + res.statusCode = 301; + res.setHeader("Content-Type", "text/html; charset=UTF-8"); + res.setHeader("Content-Length", Buffer.byteLength(doc)); + res.setHeader("Content-Security-Policy", "default-src 'self'"); + res.setHeader("X-Content-Type-Options", "nosniff"); + res.setHeader("Location", loc); + res.end(doc); + }; + SendStream.prototype.pipe = function pipe(res) { + var root = this._root; + this.res = res; + var path2 = decode2(this.path); + if (path2 === -1) { + this.error(400); + return res; + } + if (~path2.indexOf("\0")) { + this.error(400); + return res; + } + var parts; + if (root !== null) { + if (path2) { + path2 = normalize("." + sep + path2); + } + if (UP_PATH_REGEXP.test(path2)) { + debug('malicious path "%s"', path2); + this.error(403); + return res; + } + parts = path2.split(sep); + path2 = normalize(join(root, path2)); + root = normalize(root + sep); + } else { + if (UP_PATH_REGEXP.test(path2)) { + debug('malicious path "%s"', path2); + this.error(403); + return res; + } + parts = normalize(path2).split(sep); + path2 = resolve(path2); + } + if (containsDotFile(parts)) { + var access = this._dotfiles; + if (access === void 0) { + access = parts[parts.length - 1][0] === "." ? this._hidden ? "allow" : "ignore" : "allow"; + } + debug('%s dotfile "%s"', access, path2); + switch (access) { + case "allow": + break; + case "deny": + this.error(403); + return res; + case "ignore": + default: + this.error(404); + return res; + } + } + if (this._index.length && this.hasTrailingSlash()) { + this.sendIndex(path2); + return res; + } + this.sendFile(path2); + return res; + }; + SendStream.prototype.send = function send2(path2, stat) { + var len = stat.size; + var options = this.options; + var opts = {}; + var res = this.res; + var req = this.req; + var ranges = req.headers.range; + var offset = options.start || 0; + if (headersSent(res)) { + this.headersAlreadySent(); + return; + } + debug('pipe "%s"', path2); + this.setHeader(path2, stat); + this.type(path2); + if (this.isConditionalGET()) { + if (this.isPreconditionFailure()) { + this.error(412); + return; + } + if (this.isCachable() && this.isFresh()) { + this.notModified(); + return; + } + } + len = Math.max(0, len - offset); + if (options.end !== void 0) { + var bytes = options.end - offset + 1; + if (len > bytes) len = bytes; + } + if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) { + ranges = parseRange(len, ranges, { + combine: true + }); + if (!this.isRangeFresh()) { + debug("range stale"); + ranges = -2; + } + if (ranges === -1) { + debug("range unsatisfiable"); + res.setHeader("Content-Range", contentRange("bytes", len)); + return this.error(416, { + headers: { "Content-Range": res.getHeader("Content-Range") } + }); + } + if (ranges !== -2 && ranges.length === 1) { + debug("range %j", ranges); + res.statusCode = 206; + res.setHeader("Content-Range", contentRange("bytes", len, ranges[0])); + offset += ranges[0].start; + len = ranges[0].end - ranges[0].start + 1; + } + } + for (var prop in options) { + opts[prop] = options[prop]; + } + opts.start = offset; + opts.end = Math.max(offset, offset + len - 1); + res.setHeader("Content-Length", len); + if (req.method === "HEAD") { + res.end(); + return; + } + this.stream(path2, opts); + }; + SendStream.prototype.sendFile = function sendFile(path2) { + var i4 = 0; + var self2 = this; + debug('stat "%s"', path2); + fs.stat(path2, function onstat(err, stat) { + if (err && err.code === "ENOENT" && !extname(path2) && path2[path2.length - 1] !== sep) { + return next(err); + } + if (err) return self2.onStatError(err); + if (stat.isDirectory()) return self2.redirect(path2); + self2.emit("file", path2, stat); + self2.send(path2, stat); + }); + function next(err) { + if (self2._extensions.length <= i4) { + return err ? self2.onStatError(err) : self2.error(404); + } + var p4 = path2 + "." + self2._extensions[i4++]; + debug('stat "%s"', p4); + fs.stat(p4, function(err2, stat) { + if (err2) return next(err2); + if (stat.isDirectory()) return next(); + self2.emit("file", p4, stat); + self2.send(p4, stat); + }); + } + }; + SendStream.prototype.sendIndex = function sendIndex(path2) { + var i4 = -1; + var self2 = this; + function next(err) { + if (++i4 >= self2._index.length) { + if (err) return self2.onStatError(err); + return self2.error(404); + } + var p4 = join(path2, self2._index[i4]); + debug('stat "%s"', p4); + fs.stat(p4, function(err2, stat) { + if (err2) return next(err2); + if (stat.isDirectory()) return next(); + self2.emit("file", p4, stat); + self2.send(p4, stat); + }); + } + next(); + }; + SendStream.prototype.stream = function stream(path2, options) { + var finished = false; + var self2 = this; + var res = this.res; + var stream2 = fs.createReadStream(path2, options); + this.emit("stream", stream2); + stream2.pipe(res); + onFinished(res, function onfinished() { + finished = true; + destroy(stream2); + }); + stream2.on("error", function onerror(err) { + if (finished) return; + finished = true; + destroy(stream2); + self2.onStatError(err); + }); + stream2.on("end", function onend() { + self2.emit("end"); + }); + }; + SendStream.prototype.type = function type(path2) { + var res = this.res; + if (res.getHeader("Content-Type")) return; + var type2 = mime.lookup(path2); + if (!type2) { + debug("no content-type"); + return; + } + var charset = mime.charsets.lookup(type2); + debug("content-type %s", type2); + res.setHeader("Content-Type", type2 + (charset ? "; charset=" + charset : "")); + }; + SendStream.prototype.setHeader = function setHeader(path2, stat) { + var res = this.res; + this.emit("headers", res, path2, stat); + if (this._acceptRanges && !res.getHeader("Accept-Ranges")) { + debug("accept ranges"); + res.setHeader("Accept-Ranges", "bytes"); + } + if (this._cacheControl && !res.getHeader("Cache-Control")) { + var cacheControl = "public, max-age=" + Math.floor(this._maxage / 1e3); + if (this._immutable) { + cacheControl += ", immutable"; + } + debug("cache-control %s", cacheControl); + res.setHeader("Cache-Control", cacheControl); + } + if (this._lastModified && !res.getHeader("Last-Modified")) { + var modified = stat.mtime.toUTCString(); + debug("modified %s", modified); + res.setHeader("Last-Modified", modified); + } + if (this._etag && !res.getHeader("ETag")) { + var val = etag(stat); + debug("etag %s", val); + res.setHeader("ETag", val); + } + }; + function clearHeaders(res) { + var headers = getHeaderNames(res); + for (var i4 = 0; i4 < headers.length; i4++) { + res.removeHeader(headers[i4]); + } + } + function collapseLeadingSlashes(str) { + for (var i4 = 0; i4 < str.length; i4++) { + if (str[i4] !== "/") { + break; + } + } + return i4 > 1 ? "/" + str.substr(i4) : str; + } + function containsDotFile(parts) { + for (var i4 = 0; i4 < parts.length; i4++) { + var part = parts[i4]; + if (part.length > 1 && part[0] === ".") { + return true; + } + } + return false; + } + function contentRange(type, size, range2) { + return type + " " + (range2 ? range2.start + "-" + range2.end : "*") + "/" + size; + } + function createHtmlDocument(title, body) { + return '\n\n\n\n' + title + "\n\n\n
" + body + "
\n\n\n"; + } + function decode2(path2) { + try { + return decodeURIComponent(path2); + } catch (err) { + return -1; + } + } + function getHeaderNames(res) { + return typeof res.getHeaderNames !== "function" ? Object.keys(res._headers || {}) : res.getHeaderNames(); + } + function hasListeners(emitter, type) { + var count = typeof emitter.listenerCount !== "function" ? emitter.listeners(type).length : emitter.listenerCount(type); + return count > 0; + } + function headersSent(res) { + return typeof res.headersSent !== "boolean" ? Boolean(res._header) : res.headersSent; + } + function normalizeList(val, name) { + var list2 = [].concat(val || []); + for (var i4 = 0; i4 < list2.length; i4++) { + if (typeof list2[i4] !== "string") { + throw new TypeError(name + " must be array of strings or false"); + } + } + return list2; + } + function parseHttpDate(date2) { + var timestamp = date2 && Date.parse(date2); + return typeof timestamp === "number" ? timestamp : NaN; + } + function parseTokenList(str) { + var end = 0; + var list2 = []; + var start = 0; + for (var i4 = 0, len = str.length; i4 < len; i4++) { + switch (str.charCodeAt(i4)) { + case 32: + if (start === end) { + start = end = i4 + 1; + } + break; + case 44: + list2.push(str.substring(start, end)); + start = end = i4 + 1; + break; + default: + end = i4 + 1; + break; + } + } + list2.push(str.substring(start, end)); + return list2; + } + function setHeaders(res, headers) { + var keys = Object.keys(headers); + for (var i4 = 0; i4 < keys.length; i4++) { + var key = keys[i4]; + res.setHeader(key, headers[key]); + } + } + } +}); + +// node_modules/forwarded/index.js +var require_forwarded = __commonJS({ + "node_modules/forwarded/index.js"(exports2, module2) { + "use strict"; + module2.exports = forwarded; + function forwarded(req) { + if (!req) { + throw new TypeError("argument req is required"); + } + var proxyAddrs = parse(req.headers["x-forwarded-for"] || ""); + var socketAddr = getSocketAddr(req); + var addrs = [socketAddr].concat(proxyAddrs); + return addrs; + } + function getSocketAddr(req) { + return req.socket ? req.socket.remoteAddress : req.connection.remoteAddress; + } + function parse(header) { + var end = header.length; + var list2 = []; + var start = header.length; + for (var i4 = header.length - 1; i4 >= 0; i4--) { + switch (header.charCodeAt(i4)) { + case 32: + if (start === end) { + start = end = i4; + } + break; + case 44: + if (start !== end) { + list2.push(header.substring(start, end)); + } + start = end = i4; + break; + default: + start = i4; + break; + } + } + if (start !== end) { + list2.push(header.substring(start, end)); + } + return list2; + } + } +}); + +// node_modules/ipaddr.js/lib/ipaddr.js +var require_ipaddr = __commonJS({ + "node_modules/ipaddr.js/lib/ipaddr.js"(exports2, module2) { + (function() { + var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root, zoneIndex; + ipaddr = {}; + root = this; + if (typeof module2 !== "undefined" && module2 !== null && module2.exports) { + module2.exports = ipaddr; + } else { + root["ipaddr"] = ipaddr; + } + matchCIDR = function(first, second, partSize, cidrBits) { + var part, shift; + if (first.length !== second.length) { + throw new Error("ipaddr: cannot match CIDR for objects with different lengths"); + } + part = 0; + while (cidrBits > 0) { + shift = partSize - cidrBits; + if (shift < 0) { + shift = 0; + } + if (first[part] >> shift !== second[part] >> shift) { + return false; + } + cidrBits -= partSize; + part += 1; + } + return true; + }; + ipaddr.subnetMatch = function(address, rangeList, defaultName) { + var k4, len, rangeName, rangeSubnets, subnet; + if (defaultName == null) { + defaultName = "unicast"; + } + for (rangeName in rangeList) { + rangeSubnets = rangeList[rangeName]; + if (rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)) { + rangeSubnets = [rangeSubnets]; + } + for (k4 = 0, len = rangeSubnets.length; k4 < len; k4++) { + subnet = rangeSubnets[k4]; + if (address.kind() === subnet[0].kind()) { + if (address.match.apply(address, subnet)) { + return rangeName; + } + } + } + } + return defaultName; + }; + ipaddr.IPv4 = (function() { + function IPv4(octets) { + var k4, len, octet; + if (octets.length !== 4) { + throw new Error("ipaddr: ipv4 octet count should be 4"); + } + for (k4 = 0, len = octets.length; k4 < len; k4++) { + octet = octets[k4]; + if (!(0 <= octet && octet <= 255)) { + throw new Error("ipaddr: ipv4 octet should fit in 8 bits"); + } + } + this.octets = octets; + } + IPv4.prototype.kind = function() { + return "ipv4"; + }; + IPv4.prototype.toString = function() { + return this.octets.join("."); + }; + IPv4.prototype.toNormalizedString = function() { + return this.toString(); + }; + IPv4.prototype.toByteArray = function() { + return this.octets.slice(0); + }; + IPv4.prototype.match = function(other, cidrRange) { + var ref; + if (cidrRange === void 0) { + ref = other, other = ref[0], cidrRange = ref[1]; + } + if (other.kind() !== "ipv4") { + throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one"); + } + return matchCIDR(this.octets, other.octets, 8, cidrRange); + }; + IPv4.prototype.SpecialRanges = { + unspecified: [[new IPv4([0, 0, 0, 0]), 8]], + broadcast: [[new IPv4([255, 255, 255, 255]), 32]], + multicast: [[new IPv4([224, 0, 0, 0]), 4]], + linkLocal: [[new IPv4([169, 254, 0, 0]), 16]], + loopback: [[new IPv4([127, 0, 0, 0]), 8]], + carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]], + "private": [[new IPv4([10, 0, 0, 0]), 8], [new IPv4([172, 16, 0, 0]), 12], [new IPv4([192, 168, 0, 0]), 16]], + reserved: [[new IPv4([192, 0, 0, 0]), 24], [new IPv4([192, 0, 2, 0]), 24], [new IPv4([192, 88, 99, 0]), 24], [new IPv4([198, 51, 100, 0]), 24], [new IPv4([203, 0, 113, 0]), 24], [new IPv4([240, 0, 0, 0]), 4]] + }; + IPv4.prototype.range = function() { + return ipaddr.subnetMatch(this, this.SpecialRanges); + }; + IPv4.prototype.toIPv4MappedAddress = function() { + return ipaddr.IPv6.parse("::ffff:" + this.toString()); + }; + IPv4.prototype.prefixLengthFromSubnetMask = function() { + var cidr, i4, k4, octet, stop, zeros, zerotable; + zerotable = { + 0: 8, + 128: 7, + 192: 6, + 224: 5, + 240: 4, + 248: 3, + 252: 2, + 254: 1, + 255: 0 + }; + cidr = 0; + stop = false; + for (i4 = k4 = 3; k4 >= 0; i4 = k4 += -1) { + octet = this.octets[i4]; + if (octet in zerotable) { + zeros = zerotable[octet]; + if (stop && zeros !== 0) { + return null; + } + if (zeros !== 8) { + stop = true; + } + cidr += zeros; + } else { + return null; + } + } + return 32 - cidr; + }; + return IPv4; + })(); + ipv4Part = "(0?\\d+|0x[a-f0-9]+)"; + ipv4Regexes = { + fourOctet: new RegExp("^" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$", "i"), + longValue: new RegExp("^" + ipv4Part + "$", "i") + }; + ipaddr.IPv4.parser = function(string) { + var match, parseIntAuto, part, shift, value; + parseIntAuto = function(string2) { + if (string2[0] === "0" && string2[1] !== "x") { + return parseInt(string2, 8); + } else { + return parseInt(string2); + } + }; + if (match = string.match(ipv4Regexes.fourOctet)) { + return (function() { + var k4, len, ref, results; + ref = match.slice(1, 6); + results = []; + for (k4 = 0, len = ref.length; k4 < len; k4++) { + part = ref[k4]; + results.push(parseIntAuto(part)); + } + return results; + })(); + } else if (match = string.match(ipv4Regexes.longValue)) { + value = parseIntAuto(match[1]); + if (value > 4294967295 || value < 0) { + throw new Error("ipaddr: address outside defined range"); + } + return (function() { + var k4, results; + results = []; + for (shift = k4 = 0; k4 <= 24; shift = k4 += 8) { + results.push(value >> shift & 255); + } + return results; + })().reverse(); + } else { + return null; + } + }; + ipaddr.IPv6 = (function() { + function IPv6(parts, zoneId) { + var i4, k4, l4, len, part, ref; + if (parts.length === 16) { + this.parts = []; + for (i4 = k4 = 0; k4 <= 14; i4 = k4 += 2) { + this.parts.push(parts[i4] << 8 | parts[i4 + 1]); + } + } else if (parts.length === 8) { + this.parts = parts; + } else { + throw new Error("ipaddr: ipv6 part count should be 8 or 16"); + } + ref = this.parts; + for (l4 = 0, len = ref.length; l4 < len; l4++) { + part = ref[l4]; + if (!(0 <= part && part <= 65535)) { + throw new Error("ipaddr: ipv6 part should fit in 16 bits"); + } + } + if (zoneId) { + this.zoneId = zoneId; + } + } + IPv6.prototype.kind = function() { + return "ipv6"; + }; + IPv6.prototype.toString = function() { + return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, "::"); + }; + IPv6.prototype.toRFC5952String = function() { + var bestMatchIndex, bestMatchLength, match, regex, string; + regex = /((^|:)(0(:|$)){2,})/g; + string = this.toNormalizedString(); + bestMatchIndex = 0; + bestMatchLength = -1; + while (match = regex.exec(string)) { + if (match[0].length > bestMatchLength) { + bestMatchIndex = match.index; + bestMatchLength = match[0].length; + } + } + if (bestMatchLength < 0) { + return string; + } + return string.substring(0, bestMatchIndex) + "::" + string.substring(bestMatchIndex + bestMatchLength); + }; + IPv6.prototype.toByteArray = function() { + var bytes, k4, len, part, ref; + bytes = []; + ref = this.parts; + for (k4 = 0, len = ref.length; k4 < len; k4++) { + part = ref[k4]; + bytes.push(part >> 8); + bytes.push(part & 255); + } + return bytes; + }; + IPv6.prototype.toNormalizedString = function() { + var addr, part, suffix; + addr = (function() { + var k4, len, ref, results; + ref = this.parts; + results = []; + for (k4 = 0, len = ref.length; k4 < len; k4++) { + part = ref[k4]; + results.push(part.toString(16)); + } + return results; + }).call(this).join(":"); + suffix = ""; + if (this.zoneId) { + suffix = "%" + this.zoneId; + } + return addr + suffix; + }; + IPv6.prototype.toFixedLengthString = function() { + var addr, part, suffix; + addr = (function() { + var k4, len, ref, results; + ref = this.parts; + results = []; + for (k4 = 0, len = ref.length; k4 < len; k4++) { + part = ref[k4]; + results.push(part.toString(16).padStart(4, "0")); + } + return results; + }).call(this).join(":"); + suffix = ""; + if (this.zoneId) { + suffix = "%" + this.zoneId; + } + return addr + suffix; + }; + IPv6.prototype.match = function(other, cidrRange) { + var ref; + if (cidrRange === void 0) { + ref = other, other = ref[0], cidrRange = ref[1]; + } + if (other.kind() !== "ipv6") { + throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one"); + } + return matchCIDR(this.parts, other.parts, 16, cidrRange); + }; + IPv6.prototype.SpecialRanges = { + unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128], + linkLocal: [new IPv6([65152, 0, 0, 0, 0, 0, 0, 0]), 10], + multicast: [new IPv6([65280, 0, 0, 0, 0, 0, 0, 0]), 8], + loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128], + uniqueLocal: [new IPv6([64512, 0, 0, 0, 0, 0, 0, 0]), 7], + ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 65535, 0, 0]), 96], + rfc6145: [new IPv6([0, 0, 0, 0, 65535, 0, 0, 0]), 96], + rfc6052: [new IPv6([100, 65435, 0, 0, 0, 0, 0, 0]), 96], + "6to4": [new IPv6([8194, 0, 0, 0, 0, 0, 0, 0]), 16], + teredo: [new IPv6([8193, 0, 0, 0, 0, 0, 0, 0]), 32], + reserved: [[new IPv6([8193, 3512, 0, 0, 0, 0, 0, 0]), 32]] + }; + IPv6.prototype.range = function() { + return ipaddr.subnetMatch(this, this.SpecialRanges); + }; + IPv6.prototype.isIPv4MappedAddress = function() { + return this.range() === "ipv4Mapped"; + }; + IPv6.prototype.toIPv4Address = function() { + var high, low, ref; + if (!this.isIPv4MappedAddress()) { + throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4"); + } + ref = this.parts.slice(-2), high = ref[0], low = ref[1]; + return new ipaddr.IPv4([high >> 8, high & 255, low >> 8, low & 255]); + }; + IPv6.prototype.prefixLengthFromSubnetMask = function() { + var cidr, i4, k4, part, stop, zeros, zerotable; + zerotable = { + 0: 16, + 32768: 15, + 49152: 14, + 57344: 13, + 61440: 12, + 63488: 11, + 64512: 10, + 65024: 9, + 65280: 8, + 65408: 7, + 65472: 6, + 65504: 5, + 65520: 4, + 65528: 3, + 65532: 2, + 65534: 1, + 65535: 0 + }; + cidr = 0; + stop = false; + for (i4 = k4 = 7; k4 >= 0; i4 = k4 += -1) { + part = this.parts[i4]; + if (part in zerotable) { + zeros = zerotable[part]; + if (stop && zeros !== 0) { + return null; + } + if (zeros !== 16) { + stop = true; + } + cidr += zeros; + } else { + return null; + } + } + return 128 - cidr; + }; + return IPv6; + })(); + ipv6Part = "(?:[0-9a-f]+::?)+"; + zoneIndex = "%[0-9a-z]{1,}"; + ipv6Regexes = { + zoneIndex: new RegExp(zoneIndex, "i"), + "native": new RegExp("^(::)?(" + ipv6Part + ")?([0-9a-f]+)?(::)?(" + zoneIndex + ")?$", "i"), + transitional: new RegExp("^((?:" + ipv6Part + ")|(?:::)(?:" + ipv6Part + ")?)" + (ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part) + ("(" + zoneIndex + ")?$"), "i") + }; + expandIPv6 = function(string, parts) { + var colonCount, lastColon, part, replacement, replacementCount, zoneId; + if (string.indexOf("::") !== string.lastIndexOf("::")) { + return null; + } + zoneId = (string.match(ipv6Regexes["zoneIndex"]) || [])[0]; + if (zoneId) { + zoneId = zoneId.substring(1); + string = string.replace(/%.+$/, ""); + } + colonCount = 0; + lastColon = -1; + while ((lastColon = string.indexOf(":", lastColon + 1)) >= 0) { + colonCount++; + } + if (string.substr(0, 2) === "::") { + colonCount--; + } + if (string.substr(-2, 2) === "::") { + colonCount--; + } + if (colonCount > parts) { + return null; + } + replacementCount = parts - colonCount; + replacement = ":"; + while (replacementCount--) { + replacement += "0:"; + } + string = string.replace("::", replacement); + if (string[0] === ":") { + string = string.slice(1); + } + if (string[string.length - 1] === ":") { + string = string.slice(0, -1); + } + parts = (function() { + var k4, len, ref, results; + ref = string.split(":"); + results = []; + for (k4 = 0, len = ref.length; k4 < len; k4++) { + part = ref[k4]; + results.push(parseInt(part, 16)); + } + return results; + })(); + return { + parts, + zoneId + }; + }; + ipaddr.IPv6.parser = function(string) { + var addr, k4, len, match, octet, octets, zoneId; + if (ipv6Regexes["native"].test(string)) { + return expandIPv6(string, 8); + } else if (match = string.match(ipv6Regexes["transitional"])) { + zoneId = match[6] || ""; + addr = expandIPv6(match[1].slice(0, -1) + zoneId, 6); + if (addr.parts) { + octets = [parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5])]; + for (k4 = 0, len = octets.length; k4 < len; k4++) { + octet = octets[k4]; + if (!(0 <= octet && octet <= 255)) { + return null; + } + } + addr.parts.push(octets[0] << 8 | octets[1]); + addr.parts.push(octets[2] << 8 | octets[3]); + return { + parts: addr.parts, + zoneId: addr.zoneId + }; + } + } + return null; + }; + ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = function(string) { + return this.parser(string) !== null; + }; + ipaddr.IPv4.isValid = function(string) { + var e4; + try { + new this(this.parser(string)); + return true; + } catch (error1) { + e4 = error1; + return false; + } + }; + ipaddr.IPv4.isValidFourPartDecimal = function(string) { + if (ipaddr.IPv4.isValid(string) && string.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)) { + return true; + } else { + return false; + } + }; + ipaddr.IPv6.isValid = function(string) { + var addr, e4; + if (typeof string === "string" && string.indexOf(":") === -1) { + return false; + } + try { + addr = this.parser(string); + new this(addr.parts, addr.zoneId); + return true; + } catch (error1) { + e4 = error1; + return false; + } + }; + ipaddr.IPv4.parse = function(string) { + var parts; + parts = this.parser(string); + if (parts === null) { + throw new Error("ipaddr: string is not formatted like ip address"); + } + return new this(parts); + }; + ipaddr.IPv6.parse = function(string) { + var addr; + addr = this.parser(string); + if (addr.parts === null) { + throw new Error("ipaddr: string is not formatted like ip address"); + } + return new this(addr.parts, addr.zoneId); + }; + ipaddr.IPv4.parseCIDR = function(string) { + var maskLength, match, parsed; + if (match = string.match(/^(.+)\/(\d+)$/)) { + maskLength = parseInt(match[2]); + if (maskLength >= 0 && maskLength <= 32) { + parsed = [this.parse(match[1]), maskLength]; + Object.defineProperty(parsed, "toString", { + value: function() { + return this.join("/"); + } + }); + return parsed; + } + } + throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range"); + }; + ipaddr.IPv4.subnetMaskFromPrefixLength = function(prefix) { + var filledOctetCount, j4, octets; + prefix = parseInt(prefix); + if (prefix < 0 || prefix > 32) { + throw new Error("ipaddr: invalid IPv4 prefix length"); + } + octets = [0, 0, 0, 0]; + j4 = 0; + filledOctetCount = Math.floor(prefix / 8); + while (j4 < filledOctetCount) { + octets[j4] = 255; + j4++; + } + if (filledOctetCount < 4) { + octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - prefix % 8; + } + return new this(octets); + }; + ipaddr.IPv4.broadcastAddressFromCIDR = function(string) { + var cidr, error2, i4, ipInterfaceOctets, octets, subnetMaskOctets; + try { + cidr = this.parseCIDR(string); + ipInterfaceOctets = cidr[0].toByteArray(); + subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); + octets = []; + i4 = 0; + while (i4 < 4) { + octets.push(parseInt(ipInterfaceOctets[i4], 10) | parseInt(subnetMaskOctets[i4], 10) ^ 255); + i4++; + } + return new this(octets); + } catch (error1) { + error2 = error1; + throw new Error("ipaddr: the address does not have IPv4 CIDR format"); + } + }; + ipaddr.IPv4.networkAddressFromCIDR = function(string) { + var cidr, error2, i4, ipInterfaceOctets, octets, subnetMaskOctets; + try { + cidr = this.parseCIDR(string); + ipInterfaceOctets = cidr[0].toByteArray(); + subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); + octets = []; + i4 = 0; + while (i4 < 4) { + octets.push(parseInt(ipInterfaceOctets[i4], 10) & parseInt(subnetMaskOctets[i4], 10)); + i4++; + } + return new this(octets); + } catch (error1) { + error2 = error1; + throw new Error("ipaddr: the address does not have IPv4 CIDR format"); + } + }; + ipaddr.IPv6.parseCIDR = function(string) { + var maskLength, match, parsed; + if (match = string.match(/^(.+)\/(\d+)$/)) { + maskLength = parseInt(match[2]); + if (maskLength >= 0 && maskLength <= 128) { + parsed = [this.parse(match[1]), maskLength]; + Object.defineProperty(parsed, "toString", { + value: function() { + return this.join("/"); + } + }); + return parsed; + } + } + throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range"); + }; + ipaddr.isValid = function(string) { + return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string); + }; + ipaddr.parse = function(string) { + if (ipaddr.IPv6.isValid(string)) { + return ipaddr.IPv6.parse(string); + } else if (ipaddr.IPv4.isValid(string)) { + return ipaddr.IPv4.parse(string); + } else { + throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format"); + } + }; + ipaddr.parseCIDR = function(string) { + var e4; + try { + return ipaddr.IPv6.parseCIDR(string); + } catch (error1) { + e4 = error1; + try { + return ipaddr.IPv4.parseCIDR(string); + } catch (error12) { + e4 = error12; + throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format"); + } + } + }; + ipaddr.fromByteArray = function(bytes) { + var length; + length = bytes.length; + if (length === 4) { + return new ipaddr.IPv4(bytes); + } else if (length === 16) { + return new ipaddr.IPv6(bytes); + } else { + throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address"); + } + }; + ipaddr.process = function(string) { + var addr; + addr = this.parse(string); + if (addr.kind() === "ipv6" && addr.isIPv4MappedAddress()) { + return addr.toIPv4Address(); + } else { + return addr; + } + }; + }).call(exports2); + } +}); + +// node_modules/proxy-addr/index.js +var require_proxy_addr = __commonJS({ + "node_modules/proxy-addr/index.js"(exports2, module2) { + "use strict"; + module2.exports = proxyaddr; + module2.exports.all = alladdrs; + module2.exports.compile = compile; + var forwarded = require_forwarded(); + var ipaddr = require_ipaddr(); + var DIGIT_REGEXP = /^[0-9]+$/; + var isip = ipaddr.isValid; + var parseip = ipaddr.parse; + var IP_RANGES = { + linklocal: ["169.254.0.0/16", "fe80::/10"], + loopback: ["127.0.0.1/8", "::1/128"], + uniquelocal: ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "fc00::/7"] + }; + function alladdrs(req, trust) { + var addrs = forwarded(req); + if (!trust) { + return addrs; + } + if (typeof trust !== "function") { + trust = compile(trust); + } + for (var i4 = 0; i4 < addrs.length - 1; i4++) { + if (trust(addrs[i4], i4)) continue; + addrs.length = i4 + 1; + } + return addrs; + } + function compile(val) { + if (!val) { + throw new TypeError("argument is required"); + } + var trust; + if (typeof val === "string") { + trust = [val]; + } else if (Array.isArray(val)) { + trust = val.slice(); + } else { + throw new TypeError("unsupported trust argument"); + } + for (var i4 = 0; i4 < trust.length; i4++) { + val = trust[i4]; + if (!Object.prototype.hasOwnProperty.call(IP_RANGES, val)) { + continue; + } + val = IP_RANGES[val]; + trust.splice.apply(trust, [i4, 1].concat(val)); + i4 += val.length - 1; + } + return compileTrust(compileRangeSubnets(trust)); + } + function compileRangeSubnets(arr) { + var rangeSubnets = new Array(arr.length); + for (var i4 = 0; i4 < arr.length; i4++) { + rangeSubnets[i4] = parseipNotation(arr[i4]); + } + return rangeSubnets; + } + function compileTrust(rangeSubnets) { + var len = rangeSubnets.length; + return len === 0 ? trustNone : len === 1 ? trustSingle(rangeSubnets[0]) : trustMulti(rangeSubnets); + } + function parseipNotation(note) { + var pos = note.lastIndexOf("/"); + var str = pos !== -1 ? note.substring(0, pos) : note; + if (!isip(str)) { + throw new TypeError("invalid IP address: " + str); + } + var ip = parseip(str); + if (pos === -1 && ip.kind() === "ipv6" && ip.isIPv4MappedAddress()) { + ip = ip.toIPv4Address(); + } + var max = ip.kind() === "ipv6" ? 128 : 32; + var range2 = pos !== -1 ? note.substring(pos + 1, note.length) : null; + if (range2 === null) { + range2 = max; + } else if (DIGIT_REGEXP.test(range2)) { + range2 = parseInt(range2, 10); + } else if (ip.kind() === "ipv4" && isip(range2)) { + range2 = parseNetmask(range2); + } else { + range2 = null; + } + if (range2 <= 0 || range2 > max) { + throw new TypeError("invalid range on address: " + note); + } + return [ip, range2]; + } + function parseNetmask(netmask) { + var ip = parseip(netmask); + var kind = ip.kind(); + return kind === "ipv4" ? ip.prefixLengthFromSubnetMask() : null; + } + function proxyaddr(req, trust) { + if (!req) { + throw new TypeError("req argument is required"); + } + if (!trust) { + throw new TypeError("trust argument is required"); + } + var addrs = alladdrs(req, trust); + var addr = addrs[addrs.length - 1]; + return addr; + } + function trustNone() { + return false; + } + function trustMulti(subnets) { + return function trust(addr) { + if (!isip(addr)) return false; + var ip = parseip(addr); + var ipconv; + var kind = ip.kind(); + for (var i4 = 0; i4 < subnets.length; i4++) { + var subnet = subnets[i4]; + var subnetip = subnet[0]; + var subnetkind = subnetip.kind(); + var subnetrange = subnet[1]; + var trusted = ip; + if (kind !== subnetkind) { + if (subnetkind === "ipv4" && !ip.isIPv4MappedAddress()) { + continue; + } + if (!ipconv) { + ipconv = subnetkind === "ipv4" ? ip.toIPv4Address() : ip.toIPv4MappedAddress(); + } + trusted = ipconv; + } + if (trusted.match(subnetip, subnetrange)) { + return true; + } + } + return false; + }; + } + function trustSingle(subnet) { + var subnetip = subnet[0]; + var subnetkind = subnetip.kind(); + var subnetisipv4 = subnetkind === "ipv4"; + var subnetrange = subnet[1]; + return function trust(addr) { + if (!isip(addr)) return false; + var ip = parseip(addr); + var kind = ip.kind(); + if (kind !== subnetkind) { + if (subnetisipv4 && !ip.isIPv4MappedAddress()) { + return false; + } + ip = subnetisipv4 ? ip.toIPv4Address() : ip.toIPv4MappedAddress(); + } + return ip.match(subnetip, subnetrange); + }; + } + } +}); + +// node_modules/express/lib/utils.js +var require_utils2 = __commonJS({ + "node_modules/express/lib/utils.js"(exports2) { + "use strict"; + var Buffer2 = require_safe_buffer().Buffer; + var contentDisposition = require_content_disposition(); + var contentType = require_content_type(); + var deprecate2 = require_depd()("express"); + var flatten = require_array_flatten(); + var mime = require_send().mime; + var etag = require_etag(); + var proxyaddr = require_proxy_addr(); + var qs = require_lib2(); + var querystring = require("querystring"); + exports2.etag = createETagGenerator({ weak: false }); + exports2.wetag = createETagGenerator({ weak: true }); + exports2.isAbsolute = function(path) { + if ("/" === path[0]) return true; + if (":" === path[1] && ("\\" === path[2] || "/" === path[2])) return true; + if ("\\\\" === path.substring(0, 2)) return true; + }; + exports2.flatten = deprecate2.function( + flatten, + "utils.flatten: use array-flatten npm module instead" + ); + exports2.normalizeType = function(type) { + return ~type.indexOf("/") ? acceptParams(type) : { value: mime.lookup(type), params: {} }; + }; + exports2.normalizeTypes = function(types) { + var ret = []; + for (var i4 = 0; i4 < types.length; ++i4) { + ret.push(exports2.normalizeType(types[i4])); + } + return ret; + }; + exports2.contentDisposition = deprecate2.function( + contentDisposition, + "utils.contentDisposition: use content-disposition npm module instead" + ); + function acceptParams(str, index) { + var parts = str.split(/ *; */); + var ret = { value: parts[0], quality: 1, params: {}, originalIndex: index }; + for (var i4 = 1; i4 < parts.length; ++i4) { + var pms = parts[i4].split(/ *= */); + if ("q" === pms[0]) { + ret.quality = parseFloat(pms[1]); + } else { + ret.params[pms[0]] = pms[1]; + } + } + return ret; + } + exports2.compileETag = function(val) { + var fn2; + if (typeof val === "function") { + return val; + } + switch (val) { + case true: + fn2 = exports2.wetag; + break; + case false: + break; + case "strong": + fn2 = exports2.etag; + break; + case "weak": + fn2 = exports2.wetag; + break; + default: + throw new TypeError("unknown value for etag function: " + val); + } + return fn2; + }; + exports2.compileQueryParser = function compileQueryParser(val) { + var fn2; + if (typeof val === "function") { + return val; + } + switch (val) { + case true: + fn2 = querystring.parse; + break; + case false: + fn2 = newObject; + break; + case "extended": + fn2 = parseExtendedQueryString; + break; + case "simple": + fn2 = querystring.parse; + break; + default: + throw new TypeError("unknown value for query parser function: " + val); + } + return fn2; + }; + exports2.compileTrust = function(val) { + if (typeof val === "function") return val; + if (val === true) { + return function() { + return true; + }; + } + if (typeof val === "number") { + return function(a4, i4) { + return i4 < val; + }; + } + if (typeof val === "string") { + val = val.split(/ *, */); + } + return proxyaddr.compile(val || []); + }; + exports2.setCharset = function setCharset(type, charset) { + if (!type || !charset) { + return type; + } + var parsed = contentType.parse(type); + parsed.parameters.charset = charset; + return contentType.format(parsed); + }; + function createETagGenerator(options) { + return function generateETag(body, encoding) { + var buf = !Buffer2.isBuffer(body) ? Buffer2.from(body, encoding) : body; + return etag(buf, options); + }; + } + function parseExtendedQueryString(str) { + return qs.parse(str, { + allowPrototypes: true + }); + } + function newObject() { + return {}; + } + } +}); + +// node_modules/express/lib/application.js +var require_application = __commonJS({ + "node_modules/express/lib/application.js"(exports2, module2) { + "use strict"; + var finalhandler = require_finalhandler(); + var Router = require_router(); + var methods = require_methods(); + var middleware = require_init(); + var query = require_query(); + var debug = require_src()("express:application"); + var View = require_view(); + var http = require("http"); + var compileETag = require_utils2().compileETag; + var compileQueryParser = require_utils2().compileQueryParser; + var compileTrust = require_utils2().compileTrust; + var deprecate2 = require_depd()("express"); + var flatten = require_array_flatten(); + var merge = require_utils_merge(); + var resolve = require("path").resolve; + var setPrototypeOf = require_setprototypeof(); + var slice = Array.prototype.slice; + var app2 = exports2 = module2.exports = {}; + var trustProxyDefaultSymbol = "@@symbol:trust_proxy_default"; + app2.init = function init() { + this.cache = {}; + this.engines = {}; + this.settings = {}; + this.defaultConfiguration(); + }; + app2.defaultConfiguration = function defaultConfiguration() { + var env = process.env.NODE_ENV || "development"; + this.enable("x-powered-by"); + this.set("etag", "weak"); + this.set("env", env); + this.set("query parser", "extended"); + this.set("subdomain offset", 2); + this.set("trust proxy", false); + Object.defineProperty(this.settings, trustProxyDefaultSymbol, { + configurable: true, + value: true + }); + debug("booting in %s mode", env); + this.on("mount", function onmount(parent) { + if (this.settings[trustProxyDefaultSymbol] === true && typeof parent.settings["trust proxy fn"] === "function") { + delete this.settings["trust proxy"]; + delete this.settings["trust proxy fn"]; + } + setPrototypeOf(this.request, parent.request); + setPrototypeOf(this.response, parent.response); + setPrototypeOf(this.engines, parent.engines); + setPrototypeOf(this.settings, parent.settings); + }); + this.locals = /* @__PURE__ */ Object.create(null); + this.mountpath = "/"; + this.locals.settings = this.settings; + this.set("view", View); + this.set("views", resolve("views")); + this.set("jsonp callback name", "callback"); + if (env === "production") { + this.enable("view cache"); + } + Object.defineProperty(this, "router", { + get: function() { + throw new Error("'app.router' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app."); + } + }); + }; + app2.lazyrouter = function lazyrouter() { + if (!this._router) { + this._router = new Router({ + caseSensitive: this.enabled("case sensitive routing"), + strict: this.enabled("strict routing") + }); + this._router.use(query(this.get("query parser fn"))); + this._router.use(middleware.init(this)); + } + }; + app2.handle = function handle(req, res, callback) { + var router = this._router; + var done = callback || finalhandler(req, res, { + env: this.get("env"), + onerror: logerror.bind(this) + }); + if (!router) { + debug("no routes defined on app"); + done(); + return; + } + router.handle(req, res, done); + }; + app2.use = function use(fn2) { + var offset = 0; + var path = "/"; + if (typeof fn2 !== "function") { + var arg = fn2; + while (Array.isArray(arg) && arg.length !== 0) { + arg = arg[0]; + } + if (typeof arg !== "function") { + offset = 1; + path = fn2; + } + } + var fns = flatten(slice.call(arguments, offset)); + if (fns.length === 0) { + throw new TypeError("app.use() requires a middleware function"); + } + this.lazyrouter(); + var router = this._router; + fns.forEach(function(fn3) { + if (!fn3 || !fn3.handle || !fn3.set) { + return router.use(path, fn3); + } + debug(".use app under %s", path); + fn3.mountpath = path; + fn3.parent = this; + router.use(path, function mounted_app(req, res, next) { + var orig = req.app; + fn3.handle(req, res, function(err) { + setPrototypeOf(req, orig.request); + setPrototypeOf(res, orig.response); + next(err); + }); + }); + fn3.emit("mount", this); + }, this); + return this; + }; + app2.route = function route(path) { + this.lazyrouter(); + return this._router.route(path); + }; + app2.engine = function engine(ext, fn2) { + if (typeof fn2 !== "function") { + throw new Error("callback function required"); + } + var extension = ext[0] !== "." ? "." + ext : ext; + this.engines[extension] = fn2; + return this; + }; + app2.param = function param(name, fn2) { + this.lazyrouter(); + if (Array.isArray(name)) { + for (var i4 = 0; i4 < name.length; i4++) { + this.param(name[i4], fn2); + } + return this; + } + this._router.param(name, fn2); + return this; + }; + app2.set = function set(setting, val) { + if (arguments.length === 1) { + return this.settings[setting]; + } + debug('set "%s" to %o', setting, val); + this.settings[setting] = val; + switch (setting) { + case "etag": + this.set("etag fn", compileETag(val)); + break; + case "query parser": + this.set("query parser fn", compileQueryParser(val)); + break; + case "trust proxy": + this.set("trust proxy fn", compileTrust(val)); + Object.defineProperty(this.settings, trustProxyDefaultSymbol, { + configurable: true, + value: false + }); + break; + } + return this; + }; + app2.path = function path() { + return this.parent ? this.parent.path() + this.mountpath : ""; + }; + app2.enabled = function enabled(setting) { + return Boolean(this.set(setting)); + }; + app2.disabled = function disabled(setting) { + return !this.set(setting); + }; + app2.enable = function enable(setting) { + return this.set(setting, true); + }; + app2.disable = function disable(setting) { + return this.set(setting, false); + }; + methods.forEach(function(method) { + app2[method] = function(path) { + if (method === "get" && arguments.length === 1) { + return this.set(path); + } + this.lazyrouter(); + var route = this._router.route(path); + route[method].apply(route, slice.call(arguments, 1)); + return this; + }; + }); + app2.all = function all(path) { + this.lazyrouter(); + var route = this._router.route(path); + var args2 = slice.call(arguments, 1); + for (var i4 = 0; i4 < methods.length; i4++) { + route[methods[i4]].apply(route, args2); + } + return this; + }; + app2.del = deprecate2.function(app2.delete, "app.del: Use app.delete instead"); + app2.render = function render(name, options, callback) { + var cache4 = this.cache; + var done = callback; + var engines = this.engines; + var opts = options; + var renderOptions = {}; + var view; + if (typeof options === "function") { + done = options; + opts = {}; + } + merge(renderOptions, this.locals); + if (opts._locals) { + merge(renderOptions, opts._locals); + } + merge(renderOptions, opts); + if (renderOptions.cache == null) { + renderOptions.cache = this.enabled("view cache"); + } + if (renderOptions.cache) { + view = cache4[name]; + } + if (!view) { + var View2 = this.get("view"); + view = new View2(name, { + defaultEngine: this.get("view engine"), + root: this.get("views"), + engines + }); + if (!view.path) { + var dirs = Array.isArray(view.root) && view.root.length > 1 ? 'directories "' + view.root.slice(0, -1).join('", "') + '" or "' + view.root[view.root.length - 1] + '"' : 'directory "' + view.root + '"'; + var err = new Error('Failed to lookup view "' + name + '" in views ' + dirs); + err.view = view; + return done(err); + } + if (renderOptions.cache) { + cache4[name] = view; + } + } + tryRender(view, renderOptions, done); + }; + app2.listen = function listen() { + var server = http.createServer(this); + return server.listen.apply(server, arguments); + }; + function logerror(err) { + if (this.get("env") !== "test") console.error(err.stack || err.toString()); + } + function tryRender(view, options, callback) { + try { + view.render(options, callback); + } catch (err) { + callback(err); + } + } + } +}); + +// node_modules/negotiator/lib/charset.js +var require_charset = __commonJS({ + "node_modules/negotiator/lib/charset.js"(exports2, module2) { + "use strict"; + module2.exports = preferredCharsets; + module2.exports.preferredCharsets = preferredCharsets; + var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; + function parseAcceptCharset(accept) { + var accepts = accept.split(","); + for (var i4 = 0, j4 = 0; i4 < accepts.length; i4++) { + var charset = parseCharset(accepts[i4].trim(), i4); + if (charset) { + accepts[j4++] = charset; + } + } + accepts.length = j4; + return accepts; + } + function parseCharset(str, i4) { + var match = simpleCharsetRegExp.exec(str); + if (!match) return null; + var charset = match[1]; + var q4 = 1; + if (match[2]) { + var params = match[2].split(";"); + for (var j4 = 0; j4 < params.length; j4++) { + var p4 = params[j4].trim().split("="); + if (p4[0] === "q") { + q4 = parseFloat(p4[1]); + break; + } + } + } + return { + charset, + q: q4, + i: i4 + }; + } + function getCharsetPriority(charset, accepted, index) { + var priority = { o: -1, q: 0, s: 0 }; + for (var i4 = 0; i4 < accepted.length; i4++) { + var spec = specify(charset, accepted[i4], index); + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + return priority; + } + function specify(charset, spec, index) { + var s4 = 0; + if (spec.charset.toLowerCase() === charset.toLowerCase()) { + s4 |= 1; + } else if (spec.charset !== "*") { + return null; + } + return { + i: index, + o: spec.i, + q: spec.q, + s: s4 + }; + } + function preferredCharsets(accept, provided) { + var accepts = parseAcceptCharset(accept === void 0 ? "*" : accept || ""); + if (!provided) { + return accepts.filter(isQuality).sort(compareSpecs).map(getFullCharset); + } + var priorities = provided.map(function getPriority(type, index) { + return getCharsetPriority(type, accepts, index); + }); + return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) { + return provided[priorities.indexOf(priority)]; + }); + } + function compareSpecs(a4, b4) { + return b4.q - a4.q || b4.s - a4.s || a4.o - b4.o || a4.i - b4.i || 0; + } + function getFullCharset(spec) { + return spec.charset; + } + function isQuality(spec) { + return spec.q > 0; + } + } +}); + +// node_modules/negotiator/lib/encoding.js +var require_encoding = __commonJS({ + "node_modules/negotiator/lib/encoding.js"(exports2, module2) { + "use strict"; + module2.exports = preferredEncodings; + module2.exports.preferredEncodings = preferredEncodings; + var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; + function parseAcceptEncoding(accept) { + var accepts = accept.split(","); + var hasIdentity = false; + var minQuality = 1; + for (var i4 = 0, j4 = 0; i4 < accepts.length; i4++) { + var encoding = parseEncoding(accepts[i4].trim(), i4); + if (encoding) { + accepts[j4++] = encoding; + hasIdentity = hasIdentity || specify("identity", encoding); + minQuality = Math.min(minQuality, encoding.q || 1); + } + } + if (!hasIdentity) { + accepts[j4++] = { + encoding: "identity", + q: minQuality, + i: i4 + }; + } + accepts.length = j4; + return accepts; + } + function parseEncoding(str, i4) { + var match = simpleEncodingRegExp.exec(str); + if (!match) return null; + var encoding = match[1]; + var q4 = 1; + if (match[2]) { + var params = match[2].split(";"); + for (var j4 = 0; j4 < params.length; j4++) { + var p4 = params[j4].trim().split("="); + if (p4[0] === "q") { + q4 = parseFloat(p4[1]); + break; + } + } + } + return { + encoding, + q: q4, + i: i4 + }; + } + function getEncodingPriority(encoding, accepted, index) { + var priority = { o: -1, q: 0, s: 0 }; + for (var i4 = 0; i4 < accepted.length; i4++) { + var spec = specify(encoding, accepted[i4], index); + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + return priority; + } + function specify(encoding, spec, index) { + var s4 = 0; + if (spec.encoding.toLowerCase() === encoding.toLowerCase()) { + s4 |= 1; + } else if (spec.encoding !== "*") { + return null; + } + return { + i: index, + o: spec.i, + q: spec.q, + s: s4 + }; + } + function preferredEncodings(accept, provided) { + var accepts = parseAcceptEncoding(accept || ""); + if (!provided) { + return accepts.filter(isQuality).sort(compareSpecs).map(getFullEncoding); + } + var priorities = provided.map(function getPriority(type, index) { + return getEncodingPriority(type, accepts, index); + }); + return priorities.filter(isQuality).sort(compareSpecs).map(function getEncoding(priority) { + return provided[priorities.indexOf(priority)]; + }); + } + function compareSpecs(a4, b4) { + return b4.q - a4.q || b4.s - a4.s || a4.o - b4.o || a4.i - b4.i || 0; + } + function getFullEncoding(spec) { + return spec.encoding; + } + function isQuality(spec) { + return spec.q > 0; + } + } +}); + +// node_modules/negotiator/lib/language.js +var require_language = __commonJS({ + "node_modules/negotiator/lib/language.js"(exports2, module2) { + "use strict"; + module2.exports = preferredLanguages; + module2.exports.preferredLanguages = preferredLanguages; + var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/; + function parseAcceptLanguage(accept) { + var accepts = accept.split(","); + for (var i4 = 0, j4 = 0; i4 < accepts.length; i4++) { + var language = parseLanguage(accepts[i4].trim(), i4); + if (language) { + accepts[j4++] = language; + } + } + accepts.length = j4; + return accepts; + } + function parseLanguage(str, i4) { + var match = simpleLanguageRegExp.exec(str); + if (!match) return null; + var prefix = match[1]; + var suffix = match[2]; + var full = prefix; + if (suffix) full += "-" + suffix; + var q4 = 1; + if (match[3]) { + var params = match[3].split(";"); + for (var j4 = 0; j4 < params.length; j4++) { + var p4 = params[j4].split("="); + if (p4[0] === "q") q4 = parseFloat(p4[1]); + } + } + return { + prefix, + suffix, + q: q4, + i: i4, + full + }; + } + function getLanguagePriority(language, accepted, index) { + var priority = { o: -1, q: 0, s: 0 }; + for (var i4 = 0; i4 < accepted.length; i4++) { + var spec = specify(language, accepted[i4], index); + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + return priority; + } + function specify(language, spec, index) { + var p4 = parseLanguage(language); + if (!p4) return null; + var s4 = 0; + if (spec.full.toLowerCase() === p4.full.toLowerCase()) { + s4 |= 4; + } else if (spec.prefix.toLowerCase() === p4.full.toLowerCase()) { + s4 |= 2; + } else if (spec.full.toLowerCase() === p4.prefix.toLowerCase()) { + s4 |= 1; + } else if (spec.full !== "*") { + return null; + } + return { + i: index, + o: spec.i, + q: spec.q, + s: s4 + }; + } + function preferredLanguages(accept, provided) { + var accepts = parseAcceptLanguage(accept === void 0 ? "*" : accept || ""); + if (!provided) { + return accepts.filter(isQuality).sort(compareSpecs).map(getFullLanguage); + } + var priorities = provided.map(function getPriority(type, index) { + return getLanguagePriority(type, accepts, index); + }); + return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) { + return provided[priorities.indexOf(priority)]; + }); + } + function compareSpecs(a4, b4) { + return b4.q - a4.q || b4.s - a4.s || a4.o - b4.o || a4.i - b4.i || 0; + } + function getFullLanguage(spec) { + return spec.full; + } + function isQuality(spec) { + return spec.q > 0; + } + } +}); + +// node_modules/negotiator/lib/mediaType.js +var require_mediaType = __commonJS({ + "node_modules/negotiator/lib/mediaType.js"(exports2, module2) { + "use strict"; + module2.exports = preferredMediaTypes; + module2.exports.preferredMediaTypes = preferredMediaTypes; + var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/; + function parseAccept(accept) { + var accepts = splitMediaTypes(accept); + for (var i4 = 0, j4 = 0; i4 < accepts.length; i4++) { + var mediaType = parseMediaType(accepts[i4].trim(), i4); + if (mediaType) { + accepts[j4++] = mediaType; + } + } + accepts.length = j4; + return accepts; + } + function parseMediaType(str, i4) { + var match = simpleMediaTypeRegExp.exec(str); + if (!match) return null; + var params = /* @__PURE__ */ Object.create(null); + var q4 = 1; + var subtype = match[2]; + var type = match[1]; + if (match[3]) { + var kvps = splitParameters(match[3]).map(splitKeyValuePair); + for (var j4 = 0; j4 < kvps.length; j4++) { + var pair = kvps[j4]; + var key = pair[0].toLowerCase(); + var val = pair[1]; + var value = val && val[0] === '"' && val[val.length - 1] === '"' ? val.substr(1, val.length - 2) : val; + if (key === "q") { + q4 = parseFloat(value); + break; + } + params[key] = value; + } + } + return { + type, + subtype, + params, + q: q4, + i: i4 + }; + } + function getMediaTypePriority(type, accepted, index) { + var priority = { o: -1, q: 0, s: 0 }; + for (var i4 = 0; i4 < accepted.length; i4++) { + var spec = specify(type, accepted[i4], index); + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + return priority; + } + function specify(type, spec, index) { + var p4 = parseMediaType(type); + var s4 = 0; + if (!p4) { + return null; + } + if (spec.type.toLowerCase() == p4.type.toLowerCase()) { + s4 |= 4; + } else if (spec.type != "*") { + return null; + } + if (spec.subtype.toLowerCase() == p4.subtype.toLowerCase()) { + s4 |= 2; + } else if (spec.subtype != "*") { + return null; + } + var keys = Object.keys(spec.params); + if (keys.length > 0) { + if (keys.every(function(k4) { + return spec.params[k4] == "*" || (spec.params[k4] || "").toLowerCase() == (p4.params[k4] || "").toLowerCase(); + })) { + s4 |= 1; + } else { + return null; + } + } + return { + i: index, + o: spec.i, + q: spec.q, + s: s4 + }; + } + function preferredMediaTypes(accept, provided) { + var accepts = parseAccept(accept === void 0 ? "*/*" : accept || ""); + if (!provided) { + return accepts.filter(isQuality).sort(compareSpecs).map(getFullType); + } + var priorities = provided.map(function getPriority(type, index) { + return getMediaTypePriority(type, accepts, index); + }); + return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) { + return provided[priorities.indexOf(priority)]; + }); + } + function compareSpecs(a4, b4) { + return b4.q - a4.q || b4.s - a4.s || a4.o - b4.o || a4.i - b4.i || 0; + } + function getFullType(spec) { + return spec.type + "/" + spec.subtype; + } + function isQuality(spec) { + return spec.q > 0; + } + function quoteCount(string) { + var count = 0; + var index = 0; + while ((index = string.indexOf('"', index)) !== -1) { + count++; + index++; + } + return count; + } + function splitKeyValuePair(str) { + var index = str.indexOf("="); + var key; + var val; + if (index === -1) { + key = str; + } else { + key = str.substr(0, index); + val = str.substr(index + 1); + } + return [key, val]; + } + function splitMediaTypes(accept) { + var accepts = accept.split(","); + for (var i4 = 1, j4 = 0; i4 < accepts.length; i4++) { + if (quoteCount(accepts[j4]) % 2 == 0) { + accepts[++j4] = accepts[i4]; + } else { + accepts[j4] += "," + accepts[i4]; + } + } + accepts.length = j4 + 1; + return accepts; + } + function splitParameters(str) { + var parameters = str.split(";"); + for (var i4 = 1, j4 = 0; i4 < parameters.length; i4++) { + if (quoteCount(parameters[j4]) % 2 == 0) { + parameters[++j4] = parameters[i4]; + } else { + parameters[j4] += ";" + parameters[i4]; + } + } + parameters.length = j4 + 1; + for (var i4 = 0; i4 < parameters.length; i4++) { + parameters[i4] = parameters[i4].trim(); + } + return parameters; + } + } +}); + +// node_modules/negotiator/index.js +var require_negotiator = __commonJS({ + "node_modules/negotiator/index.js"(exports2, module2) { + "use strict"; + var preferredCharsets = require_charset(); + var preferredEncodings = require_encoding(); + var preferredLanguages = require_language(); + var preferredMediaTypes = require_mediaType(); + module2.exports = Negotiator; + module2.exports.Negotiator = Negotiator; + function Negotiator(request) { + if (!(this instanceof Negotiator)) { + return new Negotiator(request); + } + this.request = request; + } + Negotiator.prototype.charset = function charset(available) { + var set = this.charsets(available); + return set && set[0]; + }; + Negotiator.prototype.charsets = function charsets(available) { + return preferredCharsets(this.request.headers["accept-charset"], available); + }; + Negotiator.prototype.encoding = function encoding(available) { + var set = this.encodings(available); + return set && set[0]; + }; + Negotiator.prototype.encodings = function encodings(available) { + return preferredEncodings(this.request.headers["accept-encoding"], available); + }; + Negotiator.prototype.language = function language(available) { + var set = this.languages(available); + return set && set[0]; + }; + Negotiator.prototype.languages = function languages(available) { + return preferredLanguages(this.request.headers["accept-language"], available); + }; + Negotiator.prototype.mediaType = function mediaType(available) { + var set = this.mediaTypes(available); + return set && set[0]; + }; + Negotiator.prototype.mediaTypes = function mediaTypes(available) { + return preferredMediaTypes(this.request.headers.accept, available); + }; + Negotiator.prototype.preferredCharset = Negotiator.prototype.charset; + Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets; + Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding; + Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings; + Negotiator.prototype.preferredLanguage = Negotiator.prototype.language; + Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; + Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; + Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; + } +}); + +// node_modules/accepts/index.js +var require_accepts = __commonJS({ + "node_modules/accepts/index.js"(exports2, module2) { + "use strict"; + var Negotiator = require_negotiator(); + var mime = require_mime_types(); + module2.exports = Accepts; + function Accepts(req) { + if (!(this instanceof Accepts)) { + return new Accepts(req); + } + this.headers = req.headers; + this.negotiator = new Negotiator(req); + } + Accepts.prototype.type = Accepts.prototype.types = function(types_) { + var types = types_; + if (types && !Array.isArray(types)) { + types = new Array(arguments.length); + for (var i4 = 0; i4 < types.length; i4++) { + types[i4] = arguments[i4]; + } + } + if (!types || types.length === 0) { + return this.negotiator.mediaTypes(); + } + if (!this.headers.accept) { + return types[0]; + } + var mimes = types.map(extToMime); + var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)); + var first = accepts[0]; + return first ? types[mimes.indexOf(first)] : false; + }; + Accepts.prototype.encoding = Accepts.prototype.encodings = function(encodings_) { + var encodings = encodings_; + if (encodings && !Array.isArray(encodings)) { + encodings = new Array(arguments.length); + for (var i4 = 0; i4 < encodings.length; i4++) { + encodings[i4] = arguments[i4]; + } + } + if (!encodings || encodings.length === 0) { + return this.negotiator.encodings(); + } + return this.negotiator.encodings(encodings)[0] || false; + }; + Accepts.prototype.charset = Accepts.prototype.charsets = function(charsets_) { + var charsets = charsets_; + if (charsets && !Array.isArray(charsets)) { + charsets = new Array(arguments.length); + for (var i4 = 0; i4 < charsets.length; i4++) { + charsets[i4] = arguments[i4]; + } + } + if (!charsets || charsets.length === 0) { + return this.negotiator.charsets(); + } + return this.negotiator.charsets(charsets)[0] || false; + }; + Accepts.prototype.lang = Accepts.prototype.langs = Accepts.prototype.language = Accepts.prototype.languages = function(languages_) { + var languages = languages_; + if (languages && !Array.isArray(languages)) { + languages = new Array(arguments.length); + for (var i4 = 0; i4 < languages.length; i4++) { + languages[i4] = arguments[i4]; + } + } + if (!languages || languages.length === 0) { + return this.negotiator.languages(); + } + return this.negotiator.languages(languages)[0] || false; + }; + function extToMime(type) { + return type.indexOf("/") === -1 ? mime.lookup(type) : type; + } + function validMime(type) { + return typeof type === "string"; + } + } +}); + +// node_modules/express/lib/request.js +var require_request = __commonJS({ + "node_modules/express/lib/request.js"(exports2, module2) { + "use strict"; + var accepts = require_accepts(); + var deprecate2 = require_depd()("express"); + var isIP = require("net").isIP; + var typeis = require_type_is(); + var http = require("http"); + var fresh = require_fresh(); + var parseRange = require_range_parser(); + var parse = require_parseurl(); + var proxyaddr = require_proxy_addr(); + var req = Object.create(http.IncomingMessage.prototype); + module2.exports = req; + req.get = req.header = function header(name) { + if (!name) { + throw new TypeError("name argument is required to req.get"); + } + if (typeof name !== "string") { + throw new TypeError("name must be a string to req.get"); + } + var lc = name.toLowerCase(); + switch (lc) { + case "referer": + case "referrer": + return this.headers.referrer || this.headers.referer; + default: + return this.headers[lc]; + } + }; + req.accepts = function() { + var accept = accepts(this); + return accept.types.apply(accept, arguments); + }; + req.acceptsEncodings = function() { + var accept = accepts(this); + return accept.encodings.apply(accept, arguments); + }; + req.acceptsEncoding = deprecate2.function( + req.acceptsEncodings, + "req.acceptsEncoding: Use acceptsEncodings instead" + ); + req.acceptsCharsets = function() { + var accept = accepts(this); + return accept.charsets.apply(accept, arguments); + }; + req.acceptsCharset = deprecate2.function( + req.acceptsCharsets, + "req.acceptsCharset: Use acceptsCharsets instead" + ); + req.acceptsLanguages = function() { + var accept = accepts(this); + return accept.languages.apply(accept, arguments); + }; + req.acceptsLanguage = deprecate2.function( + req.acceptsLanguages, + "req.acceptsLanguage: Use acceptsLanguages instead" + ); + req.range = function range2(size, options) { + var range3 = this.get("Range"); + if (!range3) return; + return parseRange(size, range3, options); + }; + req.param = function param(name, defaultValue) { + var params = this.params || {}; + var body = this.body || {}; + var query = this.query || {}; + var args2 = arguments.length === 1 ? "name" : "name, default"; + deprecate2("req.param(" + args2 + "): Use req.params, req.body, or req.query instead"); + if (null != params[name] && params.hasOwnProperty(name)) return params[name]; + if (null != body[name]) return body[name]; + if (null != query[name]) return query[name]; + return defaultValue; + }; + req.is = function is(types) { + var arr = types; + if (!Array.isArray(types)) { + arr = new Array(arguments.length); + for (var i4 = 0; i4 < arr.length; i4++) { + arr[i4] = arguments[i4]; + } + } + return typeis(this, arr); + }; + defineGetter(req, "protocol", function protocol() { + var proto = this.connection.encrypted ? "https" : "http"; + var trust = this.app.get("trust proxy fn"); + if (!trust(this.connection.remoteAddress, 0)) { + return proto; + } + var header = this.get("X-Forwarded-Proto") || proto; + var index = header.indexOf(","); + return index !== -1 ? header.substring(0, index).trim() : header.trim(); + }); + defineGetter(req, "secure", function secure() { + return this.protocol === "https"; + }); + defineGetter(req, "ip", function ip() { + var trust = this.app.get("trust proxy fn"); + return proxyaddr(this, trust); + }); + defineGetter(req, "ips", function ips() { + var trust = this.app.get("trust proxy fn"); + var addrs = proxyaddr.all(this, trust); + addrs.reverse().pop(); + return addrs; + }); + defineGetter(req, "subdomains", function subdomains() { + var hostname = this.hostname; + if (!hostname) return []; + var offset = this.app.get("subdomain offset"); + var subdomains2 = !isIP(hostname) ? hostname.split(".").reverse() : [hostname]; + return subdomains2.slice(offset); + }); + defineGetter(req, "path", function path() { + return parse(this).pathname; + }); + defineGetter(req, "hostname", function hostname() { + var trust = this.app.get("trust proxy fn"); + var host = this.get("X-Forwarded-Host"); + if (!host || !trust(this.connection.remoteAddress, 0)) { + host = this.get("Host"); + } + if (!host) return; + var offset = host[0] === "[" ? host.indexOf("]") + 1 : 0; + var index = host.indexOf(":", offset); + return index !== -1 ? host.substring(0, index) : host; + }); + defineGetter(req, "host", deprecate2.function(function host() { + return this.hostname; + }, "req.host: Use req.hostname instead")); + defineGetter(req, "fresh", function() { + var method = this.method; + var res = this.res; + var status = res.statusCode; + if ("GET" !== method && "HEAD" !== method) return false; + if (status >= 200 && status < 300 || 304 === status) { + return fresh(this.headers, { + "etag": res.get("ETag"), + "last-modified": res.get("Last-Modified") + }); + } + return false; + }); + defineGetter(req, "stale", function stale() { + return !this.fresh; + }); + defineGetter(req, "xhr", function xhr() { + var val = this.get("X-Requested-With") || ""; + return val.toLowerCase() === "xmlhttprequest"; + }); + function defineGetter(obj, name, getter) { + Object.defineProperty(obj, name, { + configurable: true, + enumerable: true, + get: getter + }); + } + } +}); + +// node_modules/cookie-signature/index.js +var require_cookie_signature = __commonJS({ + "node_modules/cookie-signature/index.js"(exports2) { + var crypto2 = require("crypto"); + exports2.sign = function(val, secret) { + if ("string" != typeof val) throw new TypeError("Cookie value must be provided as a string."); + if ("string" != typeof secret) throw new TypeError("Secret string must be provided."); + return val + "." + crypto2.createHmac("sha256", secret).update(val).digest("base64").replace(/\=+$/, ""); + }; + exports2.unsign = function(val, secret) { + if ("string" != typeof val) throw new TypeError("Signed cookie string must be provided."); + if ("string" != typeof secret) throw new TypeError("Secret string must be provided."); + var str = val.slice(0, val.lastIndexOf(".")), mac = exports2.sign(str, secret); + return sha1(mac) == sha1(val) ? str : false; + }; + function sha1(str) { + return crypto2.createHash("sha1").update(str).digest("hex"); + } + } +}); + +// node_modules/express/node_modules/cookie/index.js +var require_cookie = __commonJS({ + "node_modules/express/node_modules/cookie/index.js"(exports2) { + "use strict"; + exports2.parse = parse; + exports2.serialize = serialize; + var decode2 = decodeURIComponent; + var encode2 = encodeURIComponent; + var pairSplitRegExp = /; */; + var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; + function parse(str, options) { + if (typeof str !== "string") { + throw new TypeError("argument str must be a string"); + } + var obj = {}; + var opt = options || {}; + var pairs = str.split(pairSplitRegExp); + var dec = opt.decode || decode2; + for (var i4 = 0; i4 < pairs.length; i4++) { + var pair = pairs[i4]; + var eq_idx = pair.indexOf("="); + if (eq_idx < 0) { + continue; + } + var key = pair.substr(0, eq_idx).trim(); + var val = pair.substr(++eq_idx, pair.length).trim(); + if ('"' == val[0]) { + val = val.slice(1, -1); + } + if (void 0 == obj[key]) { + obj[key] = tryDecode(val, dec); + } + } + return obj; + } + function serialize(name, val, options) { + var opt = options || {}; + var enc = opt.encode || encode2; + if (typeof enc !== "function") { + throw new TypeError("option encode is invalid"); + } + if (!fieldContentRegExp.test(name)) { + throw new TypeError("argument name is invalid"); + } + var value = enc(val); + if (value && !fieldContentRegExp.test(value)) { + throw new TypeError("argument val is invalid"); + } + var str = name + "=" + value; + if (null != opt.maxAge) { + var maxAge = opt.maxAge - 0; + if (isNaN(maxAge)) throw new Error("maxAge should be a Number"); + str += "; Max-Age=" + Math.floor(maxAge); + } + if (opt.domain) { + if (!fieldContentRegExp.test(opt.domain)) { + throw new TypeError("option domain is invalid"); + } + str += "; Domain=" + opt.domain; + } + if (opt.path) { + if (!fieldContentRegExp.test(opt.path)) { + throw new TypeError("option path is invalid"); + } + str += "; Path=" + opt.path; + } + if (opt.expires) { + if (typeof opt.expires.toUTCString !== "function") { + throw new TypeError("option expires is invalid"); + } + str += "; Expires=" + opt.expires.toUTCString(); + } + if (opt.httpOnly) { + str += "; HttpOnly"; + } + if (opt.secure) { + str += "; Secure"; + } + if (opt.sameSite) { + var sameSite = typeof opt.sameSite === "string" ? opt.sameSite.toLowerCase() : opt.sameSite; + switch (sameSite) { + case true: + str += "; SameSite=Strict"; + break; + case "lax": + str += "; SameSite=Lax"; + break; + case "strict": + str += "; SameSite=Strict"; + break; + default: + throw new TypeError("option sameSite is invalid"); + } + } + return str; + } + function tryDecode(str, decode3) { + try { + return decode3(str); + } catch (e4) { + return str; + } + } + } +}); + +// node_modules/vary/index.js +var require_vary = __commonJS({ + "node_modules/vary/index.js"(exports2, module2) { + "use strict"; + module2.exports = vary; + module2.exports.append = append; + var FIELD_NAME_REGEXP = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; + function append(header, field) { + if (typeof header !== "string") { + throw new TypeError("header argument is required"); + } + if (!field) { + throw new TypeError("field argument is required"); + } + var fields = !Array.isArray(field) ? parse(String(field)) : field; + for (var j4 = 0; j4 < fields.length; j4++) { + if (!FIELD_NAME_REGEXP.test(fields[j4])) { + throw new TypeError("field argument contains an invalid header name"); + } + } + if (header === "*") { + return header; + } + var val = header; + var vals = parse(header.toLowerCase()); + if (fields.indexOf("*") !== -1 || vals.indexOf("*") !== -1) { + return "*"; + } + for (var i4 = 0; i4 < fields.length; i4++) { + var fld = fields[i4].toLowerCase(); + if (vals.indexOf(fld) === -1) { + vals.push(fld); + val = val ? val + ", " + fields[i4] : fields[i4]; + } + } + return val; + } + function parse(header) { + var end = 0; + var list2 = []; + var start = 0; + for (var i4 = 0, len = header.length; i4 < len; i4++) { + switch (header.charCodeAt(i4)) { + case 32: + if (start === end) { + start = end = i4 + 1; + } + break; + case 44: + list2.push(header.substring(start, end)); + start = end = i4 + 1; + break; + default: + end = i4 + 1; + break; + } + } + list2.push(header.substring(start, end)); + return list2; + } + function vary(res, field) { + if (!res || !res.getHeader || !res.setHeader) { + throw new TypeError("res argument is required"); + } + var val = res.getHeader("Vary") || ""; + var header = Array.isArray(val) ? val.join(", ") : String(val); + if (val = append(header, field)) { + res.setHeader("Vary", val); + } + } + } +}); + +// node_modules/express/lib/response.js +var require_response = __commonJS({ + "node_modules/express/lib/response.js"(exports2, module2) { + "use strict"; + var Buffer2 = require_safe_buffer().Buffer; + var contentDisposition = require_content_disposition(); + var deprecate2 = require_depd()("express"); + var encodeUrl = require_encodeurl(); + var escapeHtml = require_escape_html(); + var http = require("http"); + var isAbsolute = require_utils2().isAbsolute; + var onFinished = require_on_finished(); + var path = require("path"); + var statuses = require_statuses(); + var merge = require_utils_merge(); + var sign = require_cookie_signature().sign; + var normalizeType = require_utils2().normalizeType; + var normalizeTypes = require_utils2().normalizeTypes; + var setCharset = require_utils2().setCharset; + var cookie = require_cookie(); + var send = require_send(); + var extname = path.extname; + var mime = send.mime; + var resolve = path.resolve; + var vary = require_vary(); + var res = Object.create(http.ServerResponse.prototype); + module2.exports = res; + var charsetRegExp = /;\s*charset\s*=/; + res.status = function status(code) { + this.statusCode = code; + return this; + }; + res.links = function(links) { + var link = this.get("Link") || ""; + if (link) link += ", "; + return this.set("Link", link + Object.keys(links).map(function(rel) { + return "<" + links[rel] + '>; rel="' + rel + '"'; + }).join(", ")); + }; + res.send = function send2(body) { + var chunk = body; + var encoding; + var req = this.req; + var type; + var app2 = this.app; + if (arguments.length === 2) { + if (typeof arguments[0] !== "number" && typeof arguments[1] === "number") { + deprecate2("res.send(body, status): Use res.status(status).send(body) instead"); + this.statusCode = arguments[1]; + } else { + deprecate2("res.send(status, body): Use res.status(status).send(body) instead"); + this.statusCode = arguments[0]; + chunk = arguments[1]; + } + } + if (typeof chunk === "number" && arguments.length === 1) { + if (!this.get("Content-Type")) { + this.type("txt"); + } + deprecate2("res.send(status): Use res.sendStatus(status) instead"); + this.statusCode = chunk; + chunk = statuses[chunk]; + } + switch (typeof chunk) { + // string defaulting to html + case "string": + if (!this.get("Content-Type")) { + this.type("html"); + } + break; + case "boolean": + case "number": + case "object": + if (chunk === null) { + chunk = ""; + } else if (Buffer2.isBuffer(chunk)) { + if (!this.get("Content-Type")) { + this.type("bin"); + } + } else { + return this.json(chunk); + } + break; + } + if (typeof chunk === "string") { + encoding = "utf8"; + type = this.get("Content-Type"); + if (typeof type === "string") { + this.set("Content-Type", setCharset(type, "utf-8")); + } + } + var etagFn = app2.get("etag fn"); + var generateETag = !this.get("ETag") && typeof etagFn === "function"; + var len; + if (chunk !== void 0) { + if (Buffer2.isBuffer(chunk)) { + len = chunk.length; + } else if (!generateETag && chunk.length < 1e3) { + len = Buffer2.byteLength(chunk, encoding); + } else { + chunk = Buffer2.from(chunk, encoding); + encoding = void 0; + len = chunk.length; + } + this.set("Content-Length", len); + } + var etag; + if (generateETag && len !== void 0) { + if (etag = etagFn(chunk, encoding)) { + this.set("ETag", etag); + } + } + if (req.fresh) this.statusCode = 304; + if (204 === this.statusCode || 304 === this.statusCode) { + this.removeHeader("Content-Type"); + this.removeHeader("Content-Length"); + this.removeHeader("Transfer-Encoding"); + chunk = ""; + } + if (req.method === "HEAD") { + this.end(); + } else { + this.end(chunk, encoding); + } + return this; + }; + res.json = function json(obj) { + var val = obj; + if (arguments.length === 2) { + if (typeof arguments[1] === "number") { + deprecate2("res.json(obj, status): Use res.status(status).json(obj) instead"); + this.statusCode = arguments[1]; + } else { + deprecate2("res.json(status, obj): Use res.status(status).json(obj) instead"); + this.statusCode = arguments[0]; + val = arguments[1]; + } + } + var app2 = this.app; + var escape = app2.get("json escape"); + var replacer = app2.get("json replacer"); + var spaces = app2.get("json spaces"); + var body = stringify(val, replacer, spaces, escape); + if (!this.get("Content-Type")) { + this.set("Content-Type", "application/json"); + } + return this.send(body); + }; + res.jsonp = function jsonp(obj) { + var val = obj; + if (arguments.length === 2) { + if (typeof arguments[1] === "number") { + deprecate2("res.jsonp(obj, status): Use res.status(status).json(obj) instead"); + this.statusCode = arguments[1]; + } else { + deprecate2("res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead"); + this.statusCode = arguments[0]; + val = arguments[1]; + } + } + var app2 = this.app; + var escape = app2.get("json escape"); + var replacer = app2.get("json replacer"); + var spaces = app2.get("json spaces"); + var body = stringify(val, replacer, spaces, escape); + var callback = this.req.query[app2.get("jsonp callback name")]; + if (!this.get("Content-Type")) { + this.set("X-Content-Type-Options", "nosniff"); + this.set("Content-Type", "application/json"); + } + if (Array.isArray(callback)) { + callback = callback[0]; + } + if (typeof callback === "string" && callback.length !== 0) { + this.set("X-Content-Type-Options", "nosniff"); + this.set("Content-Type", "text/javascript"); + callback = callback.replace(/[^\[\]\w$.]/g, ""); + body = body.replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); + body = "/**/ typeof " + callback + " === 'function' && " + callback + "(" + body + ");"; + } + return this.send(body); + }; + res.sendStatus = function sendStatus(statusCode) { + var body = statuses[statusCode] || String(statusCode); + this.statusCode = statusCode; + this.type("txt"); + return this.send(body); + }; + res.sendFile = function sendFile(path2, options, callback) { + var done = callback; + var req = this.req; + var res2 = this; + var next = req.next; + var opts = options || {}; + if (!path2) { + throw new TypeError("path argument is required to res.sendFile"); + } + if (typeof options === "function") { + done = options; + opts = {}; + } + if (!opts.root && !isAbsolute(path2)) { + throw new TypeError("path must be absolute or specify root to res.sendFile"); + } + var pathname = encodeURI(path2); + var file = send(req, pathname, opts); + sendfile(res2, file, opts, function(err) { + if (done) return done(err); + if (err && err.code === "EISDIR") return next(); + if (err && err.code !== "ECONNABORTED" && err.syscall !== "write") { + next(err); + } + }); + }; + res.sendfile = function(path2, options, callback) { + var done = callback; + var req = this.req; + var res2 = this; + var next = req.next; + var opts = options || {}; + if (typeof options === "function") { + done = options; + opts = {}; + } + var file = send(req, path2, opts); + sendfile(res2, file, opts, function(err) { + if (done) return done(err); + if (err && err.code === "EISDIR") return next(); + if (err && err.code !== "ECONNABORTED" && err.syscall !== "write") { + next(err); + } + }); + }; + res.sendfile = deprecate2.function( + res.sendfile, + "res.sendfile: Use res.sendFile instead" + ); + res.download = function download(path2, filename, options, callback) { + var done = callback; + var name = filename; + var opts = options || null; + if (typeof filename === "function") { + done = filename; + name = null; + opts = null; + } else if (typeof options === "function") { + done = options; + opts = null; + } + var headers = { + "Content-Disposition": contentDisposition(name || path2) + }; + if (opts && opts.headers) { + var keys = Object.keys(opts.headers); + for (var i4 = 0; i4 < keys.length; i4++) { + var key = keys[i4]; + if (key.toLowerCase() !== "content-disposition") { + headers[key] = opts.headers[key]; + } + } + } + opts = Object.create(opts); + opts.headers = headers; + var fullPath = resolve(path2); + return this.sendFile(fullPath, opts, done); + }; + res.contentType = res.type = function contentType(type) { + var ct = type.indexOf("/") === -1 ? mime.lookup(type) : type; + return this.set("Content-Type", ct); + }; + res.format = function(obj) { + var req = this.req; + var next = req.next; + var fn2 = obj.default; + if (fn2) delete obj.default; + var keys = Object.keys(obj); + var key = keys.length > 0 ? req.accepts(keys) : false; + this.vary("Accept"); + if (key) { + this.set("Content-Type", normalizeType(key).value); + obj[key](req, this, next); + } else if (fn2) { + fn2(); + } else { + var err = new Error("Not Acceptable"); + err.status = err.statusCode = 406; + err.types = normalizeTypes(keys).map(function(o4) { + return o4.value; + }); + next(err); + } + return this; + }; + res.attachment = function attachment(filename) { + if (filename) { + this.type(extname(filename)); + } + this.set("Content-Disposition", contentDisposition(filename)); + return this; + }; + res.append = function append(field, val) { + var prev = this.get(field); + var value = val; + if (prev) { + value = Array.isArray(prev) ? prev.concat(val) : Array.isArray(val) ? [prev].concat(val) : [prev, val]; + } + return this.set(field, value); + }; + res.set = res.header = function header(field, val) { + if (arguments.length === 2) { + var value = Array.isArray(val) ? val.map(String) : String(val); + if (field.toLowerCase() === "content-type") { + if (Array.isArray(value)) { + throw new TypeError("Content-Type cannot be set to an Array"); + } + if (!charsetRegExp.test(value)) { + var charset = mime.charsets.lookup(value.split(";")[0]); + if (charset) value += "; charset=" + charset.toLowerCase(); + } + } + this.setHeader(field, value); + } else { + for (var key in field) { + this.set(key, field[key]); + } + } + return this; + }; + res.get = function(field) { + return this.getHeader(field); + }; + res.clearCookie = function clearCookie(name, options) { + var opts = merge({ expires: /* @__PURE__ */ new Date(1), path: "/" }, options); + return this.cookie(name, "", opts); + }; + res.cookie = function(name, value, options) { + var opts = merge({}, options); + var secret = this.req.secret; + var signed = opts.signed; + if (signed && !secret) { + throw new Error('cookieParser("secret") required for signed cookies'); + } + var val = typeof value === "object" ? "j:" + JSON.stringify(value) : String(value); + if (signed) { + val = "s:" + sign(val, secret); + } + if ("maxAge" in opts) { + opts.expires = new Date(Date.now() + opts.maxAge); + opts.maxAge /= 1e3; + } + if (opts.path == null) { + opts.path = "/"; + } + this.append("Set-Cookie", cookie.serialize(name, String(val), opts)); + return this; + }; + res.location = function location(url) { + var loc = url; + if (url === "back") { + loc = this.req.get("Referrer") || "/"; + } + return this.set("Location", encodeUrl(loc)); + }; + res.redirect = function redirect(url) { + var address = url; + var body; + var status = 302; + if (arguments.length === 2) { + if (typeof arguments[0] === "number") { + status = arguments[0]; + address = arguments[1]; + } else { + deprecate2("res.redirect(url, status): Use res.redirect(status, url) instead"); + status = arguments[1]; + } + } + address = this.location(address).get("Location"); + this.format({ + text: function() { + body = statuses[status] + ". Redirecting to " + address; + }, + html: function() { + var u4 = escapeHtml(address); + body = "

" + statuses[status] + '. Redirecting to ' + u4 + "

"; + }, + default: function() { + body = ""; + } + }); + this.statusCode = status; + this.set("Content-Length", Buffer2.byteLength(body)); + if (this.req.method === "HEAD") { + this.end(); + } else { + this.end(body); + } + }; + res.vary = function(field) { + if (!field || Array.isArray(field) && !field.length) { + deprecate2("res.vary(): Provide a field name"); + return this; + } + vary(this, field); + return this; + }; + res.render = function render(view, options, callback) { + var app2 = this.req.app; + var done = callback; + var opts = options || {}; + var req = this.req; + var self2 = this; + if (typeof options === "function") { + done = options; + opts = {}; + } + opts._locals = self2.locals; + done = done || function(err, str) { + if (err) return req.next(err); + self2.send(str); + }; + app2.render(view, opts, done); + }; + function sendfile(res2, file, options, callback) { + var done = false; + var streaming; + function onaborted() { + if (done) return; + done = true; + var err = new Error("Request aborted"); + err.code = "ECONNABORTED"; + callback(err); + } + function ondirectory() { + if (done) return; + done = true; + var err = new Error("EISDIR, read"); + err.code = "EISDIR"; + callback(err); + } + function onerror(err) { + if (done) return; + done = true; + callback(err); + } + function onend() { + if (done) return; + done = true; + callback(); + } + function onfile() { + streaming = false; + } + function onfinish(err) { + if (err && err.code === "ECONNRESET") return onaborted(); + if (err) return onerror(err); + if (done) return; + setImmediate(function() { + if (streaming !== false && !done) { + onaborted(); + return; + } + if (done) return; + done = true; + callback(); + }); + } + function onstream() { + streaming = true; + } + file.on("directory", ondirectory); + file.on("end", onend); + file.on("error", onerror); + file.on("file", onfile); + file.on("stream", onstream); + onFinished(res2, onfinish); + if (options.headers) { + file.on("headers", function headers(res3) { + var obj = options.headers; + var keys = Object.keys(obj); + for (var i4 = 0; i4 < keys.length; i4++) { + var k4 = keys[i4]; + res3.setHeader(k4, obj[k4]); + } + }); + } + file.pipe(res2); + } + function stringify(value, replacer, spaces, escape) { + var json = replacer || spaces ? JSON.stringify(value, replacer, spaces) : JSON.stringify(value); + if (escape) { + json = json.replace(/[<>&]/g, function(c4) { + switch (c4.charCodeAt(0)) { + case 60: + return "\\u003c"; + case 62: + return "\\u003e"; + case 38: + return "\\u0026"; + default: + return c4; + } + }); + } + return json; + } + } +}); + +// node_modules/serve-static/index.js +var require_serve_static = __commonJS({ + "node_modules/serve-static/index.js"(exports2, module2) { + "use strict"; + var encodeUrl = require_encodeurl(); + var escapeHtml = require_escape_html(); + var parseUrl4 = require_parseurl(); + var resolve = require("path").resolve; + var send = require_send(); + var url = require("url"); + module2.exports = serveStatic; + module2.exports.mime = send.mime; + function serveStatic(root, options) { + if (!root) { + throw new TypeError("root path required"); + } + if (typeof root !== "string") { + throw new TypeError("root path must be a string"); + } + var opts = Object.create(options || null); + var fallthrough = opts.fallthrough !== false; + var redirect = opts.redirect !== false; + var setHeaders = opts.setHeaders; + if (setHeaders && typeof setHeaders !== "function") { + throw new TypeError("option setHeaders must be function"); + } + opts.maxage = opts.maxage || opts.maxAge || 0; + opts.root = resolve(root); + var onDirectory = redirect ? createRedirectDirectoryListener() : createNotFoundDirectoryListener(); + return function serveStatic2(req, res, next) { + if (req.method !== "GET" && req.method !== "HEAD") { + if (fallthrough) { + return next(); + } + res.statusCode = 405; + res.setHeader("Allow", "GET, HEAD"); + res.setHeader("Content-Length", "0"); + res.end(); + return; + } + var forwardError = !fallthrough; + var originalUrl = parseUrl4.original(req); + var path = parseUrl4(req).pathname; + if (path === "/" && originalUrl.pathname.substr(-1) !== "/") { + path = ""; + } + var stream = send(req, path, opts); + stream.on("directory", onDirectory); + if (setHeaders) { + stream.on("headers", setHeaders); + } + if (fallthrough) { + stream.on("file", function onFile() { + forwardError = true; + }); + } + stream.on("error", function error2(err) { + if (forwardError || !(err.statusCode < 500)) { + next(err); + return; + } + next(); + }); + stream.pipe(res); + }; + } + function collapseLeadingSlashes(str) { + for (var i4 = 0; i4 < str.length; i4++) { + if (str.charCodeAt(i4) !== 47) { + break; + } + } + return i4 > 1 ? "/" + str.substr(i4) : str; + } + function createHtmlDocument(title, body) { + return '\n\n\n\n' + title + "\n\n\n
" + body + "
\n\n\n"; + } + function createNotFoundDirectoryListener() { + return function notFound() { + this.error(404); + }; + } + function createRedirectDirectoryListener() { + return function redirect(res) { + if (this.hasTrailingSlash()) { + this.error(404); + return; + } + var originalUrl = parseUrl4.original(this.req); + originalUrl.path = null; + originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + "/"); + var loc = encodeUrl(url.format(originalUrl)); + var doc = createHtmlDocument("Redirecting", 'Redirecting to ' + escapeHtml(loc) + ""); + res.statusCode = 301; + res.setHeader("Content-Type", "text/html; charset=UTF-8"); + res.setHeader("Content-Length", Buffer.byteLength(doc)); + res.setHeader("Content-Security-Policy", "default-src 'self'"); + res.setHeader("X-Content-Type-Options", "nosniff"); + res.setHeader("Location", loc); + res.end(doc); + }; + } + } +}); + +// node_modules/express/lib/express.js +var require_express = __commonJS({ + "node_modules/express/lib/express.js"(exports2, module2) { + "use strict"; + var bodyParser = require_body_parser(); + var EventEmitter = require("events").EventEmitter; + var mixin = require_merge_descriptors(); + var proto = require_application(); + var Route = require_route(); + var Router = require_router(); + var req = require_request(); + var res = require_response(); + exports2 = module2.exports = createApplication; + function createApplication() { + var app2 = function(req2, res2, next) { + app2.handle(req2, res2, next); + }; + mixin(app2, EventEmitter.prototype, false); + mixin(app2, proto, false); + app2.request = Object.create(req, { + app: { configurable: true, enumerable: true, writable: true, value: app2 } + }); + app2.response = Object.create(res, { + app: { configurable: true, enumerable: true, writable: true, value: app2 } + }); + app2.init(); + return app2; + } + exports2.application = proto; + exports2.request = req; + exports2.response = res; + exports2.Route = Route; + exports2.Router = Router; + exports2.json = bodyParser.json; + exports2.query = require_query(); + exports2.static = require_serve_static(); + exports2.urlencoded = bodyParser.urlencoded; + var removedMiddlewares = [ + "bodyParser", + "compress", + "cookieSession", + "session", + "logger", + "cookieParser", + "favicon", + "responseTime", + "errorHandler", + "timeout", + "methodOverride", + "vhost", + "csrf", + "directory", + "limit", + "multipart", + "staticCache" + ]; + removedMiddlewares.forEach(function(name) { + Object.defineProperty(exports2, name, { + get: function() { + throw new Error("Most middleware (like " + name + ") is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware."); + }, + configurable: true + }); + }); + } +}); + +// node_modules/express/index.js +var require_express2 = __commonJS({ + "node_modules/express/index.js"(exports2, module2) { + "use strict"; + module2.exports = require_express(); + } +}); + +// node_modules/cookie/index.js +var require_cookie2 = __commonJS({ + "node_modules/cookie/index.js"(exports2) { + "use strict"; + exports2.parse = parse; + exports2.serialize = serialize; + var __toString = Object.prototype.toString; + var __hasOwnProperty = Object.prototype.hasOwnProperty; + var cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; + var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/; + var domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i; + var pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/; + function parse(str, opt) { + if (typeof str !== "string") { + throw new TypeError("argument str must be a string"); + } + var obj = {}; + var len = str.length; + if (len < 2) return obj; + var dec = opt && opt.decode || decode2; + var index = 0; + var eqIdx = 0; + var endIdx = 0; + do { + eqIdx = str.indexOf("=", index); + if (eqIdx === -1) break; + endIdx = str.indexOf(";", index); + if (endIdx === -1) { + endIdx = len; + } else if (eqIdx > endIdx) { + index = str.lastIndexOf(";", eqIdx - 1) + 1; + continue; + } + var keyStartIdx = startIndex(str, index, eqIdx); + var keyEndIdx = endIndex(str, eqIdx, keyStartIdx); + var key = str.slice(keyStartIdx, keyEndIdx); + if (!__hasOwnProperty.call(obj, key)) { + var valStartIdx = startIndex(str, eqIdx + 1, endIdx); + var valEndIdx = endIndex(str, endIdx, valStartIdx); + if (str.charCodeAt(valStartIdx) === 34 && str.charCodeAt(valEndIdx - 1) === 34) { + valStartIdx++; + valEndIdx--; + } + var val = str.slice(valStartIdx, valEndIdx); + obj[key] = tryDecode(val, dec); + } + index = endIdx + 1; + } while (index < len); + return obj; + } + function startIndex(str, index, max) { + do { + var code = str.charCodeAt(index); + if (code !== 32 && code !== 9) return index; + } while (++index < max); + return max; + } + function endIndex(str, index, min) { + while (index > min) { + var code = str.charCodeAt(--index); + if (code !== 32 && code !== 9) return index + 1; + } + return min; + } + function serialize(name, val, opt) { + var enc = opt && opt.encode || encodeURIComponent; + if (typeof enc !== "function") { + throw new TypeError("option encode is invalid"); + } + if (!cookieNameRegExp.test(name)) { + throw new TypeError("argument name is invalid"); + } + var value = enc(val); + if (!cookieValueRegExp.test(value)) { + throw new TypeError("argument val is invalid"); + } + var str = name + "=" + value; + if (!opt) return str; + if (null != opt.maxAge) { + var maxAge = Math.floor(opt.maxAge); + if (!isFinite(maxAge)) { + throw new TypeError("option maxAge is invalid"); + } + str += "; Max-Age=" + maxAge; + } + if (opt.domain) { + if (!domainValueRegExp.test(opt.domain)) { + throw new TypeError("option domain is invalid"); + } + str += "; Domain=" + opt.domain; + } + if (opt.path) { + if (!pathValueRegExp.test(opt.path)) { + throw new TypeError("option path is invalid"); + } + str += "; Path=" + opt.path; + } + if (opt.expires) { + var expires = opt.expires; + if (!isDate(expires) || isNaN(expires.valueOf())) { + throw new TypeError("option expires is invalid"); + } + str += "; Expires=" + expires.toUTCString(); + } + if (opt.httpOnly) { + str += "; HttpOnly"; + } + if (opt.secure) { + str += "; Secure"; + } + if (opt.partitioned) { + str += "; Partitioned"; + } + if (opt.priority) { + var priority = typeof opt.priority === "string" ? opt.priority.toLowerCase() : opt.priority; + switch (priority) { + case "low": + str += "; Priority=Low"; + break; + case "medium": + str += "; Priority=Medium"; + break; + case "high": + str += "; Priority=High"; + break; + default: + throw new TypeError("option priority is invalid"); + } + } + if (opt.sameSite) { + var sameSite = typeof opt.sameSite === "string" ? opt.sameSite.toLowerCase() : opt.sameSite; + switch (sameSite) { + case true: + str += "; SameSite=Strict"; + break; + case "lax": + str += "; SameSite=Lax"; + break; + case "strict": + str += "; SameSite=Strict"; + break; + case "none": + str += "; SameSite=None"; + break; + default: + throw new TypeError("option sameSite is invalid"); + } + } + return str; + } + function decode2(str) { + return str.indexOf("%") !== -1 ? decodeURIComponent(str) : str; + } + function isDate(val) { + return __toString.call(val) === "[object Date]"; + } + function tryDecode(str, decode3) { + try { + return decode3(str); + } catch (e4) { + return str; + } + } + } +}); + +// node_modules/cookie-parser/index.js +var require_cookie_parser = __commonJS({ + "node_modules/cookie-parser/index.js"(exports2, module2) { + "use strict"; + var cookie = require_cookie2(); + var signature = require_cookie_signature(); + module2.exports = cookieParser2; + module2.exports.JSONCookie = JSONCookie; + module2.exports.JSONCookies = JSONCookies; + module2.exports.signedCookie = signedCookie; + module2.exports.signedCookies = signedCookies; + function cookieParser2(secret, options) { + var secrets = !secret || Array.isArray(secret) ? secret || [] : [secret]; + return function cookieParser3(req, res, next) { + if (req.cookies) { + return next(); + } + var cookies = req.headers.cookie; + req.secret = secrets[0]; + req.cookies = /* @__PURE__ */ Object.create(null); + req.signedCookies = /* @__PURE__ */ Object.create(null); + if (!cookies) { + return next(); + } + req.cookies = cookie.parse(cookies, options); + if (secrets.length !== 0) { + req.signedCookies = signedCookies(req.cookies, secrets); + req.signedCookies = JSONCookies(req.signedCookies); + } + req.cookies = JSONCookies(req.cookies); + next(); + }; + } + function JSONCookie(str) { + if (typeof str !== "string" || str.substr(0, 2) !== "j:") { + return void 0; + } + try { + return JSON.parse(str.slice(2)); + } catch (err) { + return void 0; + } + } + function JSONCookies(obj) { + var cookies = Object.keys(obj); + var key; + var val; + for (var i4 = 0; i4 < cookies.length; i4++) { + key = cookies[i4]; + val = JSONCookie(obj[key]); + if (val) { + obj[key] = val; + } + } + return obj; + } + function signedCookie(str, secret) { + if (typeof str !== "string") { + return void 0; + } + if (str.substr(0, 2) !== "s:") { + return str; + } + var secrets = !secret || Array.isArray(secret) ? secret || [] : [secret]; + for (var i4 = 0; i4 < secrets.length; i4++) { + var val = signature.unsign(str.slice(2), secrets[i4]); + if (val !== false) { + return val; + } + } + return false; + } + function signedCookies(obj, secret) { + var cookies = Object.keys(obj); + var dec; + var key; + var ret = /* @__PURE__ */ Object.create(null); + var val; + for (var i4 = 0; i4 < cookies.length; i4++) { + key = cookies[i4]; + val = obj[key]; + dec = signedCookie(val, secret); + if (val !== dec) { + ret[key] = dec; + delete obj[key]; + } + } + return ret; + } + } +}); + +// node_modules/basic-auth/index.js +var require_basic_auth = __commonJS({ + "node_modules/basic-auth/index.js"(exports2, module2) { + "use strict"; + var Buffer2 = require_safe_buffer().Buffer; + module2.exports = auth; + module2.exports.parse = parse; + var CREDENTIALS_REGEXP = /^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9._~+/-]+=*) *$/; + var USER_PASS_REGEXP = /^([^:]*):(.*)$/; + function auth(req) { + if (!req) { + throw new TypeError("argument req is required"); + } + if (typeof req !== "object") { + throw new TypeError("argument req is required to be an object"); + } + var header = getAuthorization(req); + return parse(header); + } + function decodeBase64(str) { + return Buffer2.from(str, "base64").toString(); + } + function getAuthorization(req) { + if (!req.headers || typeof req.headers !== "object") { + throw new TypeError("argument req is required to have headers property"); + } + return req.headers.authorization; + } + function parse(string) { + if (typeof string !== "string") { + return void 0; + } + var match = CREDENTIALS_REGEXP.exec(string); + if (!match) { + return void 0; + } + var userPass = USER_PASS_REGEXP.exec(decodeBase64(match[1])); + if (!userPass) { + return void 0; + } + return new Credentials(userPass[1], userPass[2]); + } + function Credentials(name, pass) { + this.name = name; + this.pass = pass; + } + } +}); + +// node_modules/on-headers/index.js +var require_on_headers = __commonJS({ + "node_modules/on-headers/index.js"(exports2, module2) { + "use strict"; + module2.exports = onHeaders; + function createWriteHead(prevWriteHead, listener) { + var fired = false; + return function writeHead(statusCode) { + var args2 = setWriteHeadHeaders.apply(this, arguments); + if (!fired) { + fired = true; + listener.call(this); + if (typeof args2[0] === "number" && this.statusCode !== args2[0]) { + args2[0] = this.statusCode; + args2.length = 1; + } + } + return prevWriteHead.apply(this, args2); + }; + } + function onHeaders(res, listener) { + if (!res) { + throw new TypeError("argument res is required"); + } + if (typeof listener !== "function") { + throw new TypeError("argument listener must be a function"); + } + res.writeHead = createWriteHead(res.writeHead, listener); + } + function setHeadersFromArray(res, headers) { + for (var i4 = 0; i4 < headers.length; i4++) { + res.setHeader(headers[i4][0], headers[i4][1]); + } + } + function setHeadersFromObject(res, headers) { + var keys = Object.keys(headers); + for (var i4 = 0; i4 < keys.length; i4++) { + var k4 = keys[i4]; + if (k4) res.setHeader(k4, headers[k4]); + } + } + function setWriteHeadHeaders(statusCode) { + var length = arguments.length; + var headerIndex = length > 1 && typeof arguments[1] === "string" ? 2 : 1; + var headers = length >= headerIndex + 1 ? arguments[headerIndex] : void 0; + this.statusCode = statusCode; + if (Array.isArray(headers)) { + setHeadersFromArray(this, headers); + } else if (headers) { + setHeadersFromObject(this, headers); + } + var args2 = new Array(Math.min(length, headerIndex)); + for (var i4 = 0; i4 < args2.length; i4++) { + args2[i4] = arguments[i4]; + } + return args2; + } + } +}); + +// node_modules/morgan/index.js +var require_morgan = __commonJS({ + "node_modules/morgan/index.js"(exports2, module2) { + "use strict"; + module2.exports = morgan; + module2.exports.compile = compile; + module2.exports.format = format2; + module2.exports.token = token; + var auth = require_basic_auth(); + var debug = require_src()("morgan"); + var deprecate2 = require_depd()("morgan"); + var onFinished = require_on_finished(); + var onHeaders = require_on_headers(); + var CLF_MONTH = [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ]; + var DEFAULT_BUFFER_DURATION = 1e3; + function morgan(format3, options) { + var fmt = format3; + var opts = options || {}; + if (format3 && typeof format3 === "object") { + opts = format3; + fmt = opts.format || "default"; + deprecate2("morgan(options): use morgan(" + (typeof fmt === "string" ? JSON.stringify(fmt) : "format") + ", options) instead"); + } + if (fmt === void 0) { + deprecate2("undefined format: specify a format"); + } + var immediate = opts.immediate; + var skip = opts.skip || false; + var formatLine = typeof fmt !== "function" ? getFormatFunction(fmt) : fmt; + var buffer = opts.buffer; + var stream = opts.stream || process.stdout; + if (buffer) { + deprecate2("buffer option"); + var interval = typeof buffer !== "number" ? DEFAULT_BUFFER_DURATION : buffer; + stream = createBufferStream(stream, interval); + } + return function logger3(req, res, next) { + req._startAt = void 0; + req._startTime = void 0; + req._remoteAddress = getip(req); + res._startAt = void 0; + res._startTime = void 0; + recordStartTime.call(req); + function logRequest() { + if (skip !== false && skip(req, res)) { + debug("skip request"); + return; + } + var line = formatLine(morgan, req, res); + if (line == null) { + debug("skip line"); + return; + } + debug("log request"); + stream.write(line + "\n"); + } + ; + if (immediate) { + logRequest(); + } else { + onHeaders(res, recordStartTime); + onFinished(res, logRequest); + } + next(); + }; + } + morgan.format("combined", ':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'); + morgan.format("common", ':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length]'); + morgan.format("default", ':remote-addr - :remote-user [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'); + deprecate2.property(morgan, "default", "default format: use combined format"); + morgan.format("short", ":remote-addr :remote-user :method :url HTTP/:http-version :status :res[content-length] - :response-time ms"); + morgan.format("tiny", ":method :url :status :res[content-length] - :response-time ms"); + morgan.format("dev", function developmentFormatLine(tokens, req, res) { + var status = headersSent(res) ? res.statusCode : void 0; + var color = status >= 500 ? 31 : status >= 400 ? 33 : status >= 300 ? 36 : status >= 200 ? 32 : 0; + var fn2 = developmentFormatLine[color]; + if (!fn2) { + fn2 = developmentFormatLine[color] = compile("\x1B[0m:method :url \x1B[" + color + "m:status \x1B[0m:response-time ms - :res[content-length]\x1B[0m"); + } + return fn2(tokens, req, res); + }); + morgan.token("url", function getUrlToken(req) { + return req.originalUrl || req.url; + }); + morgan.token("method", function getMethodToken(req) { + return req.method; + }); + morgan.token("response-time", function getResponseTimeToken(req, res, digits) { + if (!req._startAt || !res._startAt) { + return; + } + var ms = (res._startAt[0] - req._startAt[0]) * 1e3 + (res._startAt[1] - req._startAt[1]) * 1e-6; + return ms.toFixed(digits === void 0 ? 3 : digits); + }); + morgan.token("date", function getDateToken(req, res, format3) { + var date2 = /* @__PURE__ */ new Date(); + switch (format3 || "web") { + case "clf": + return clfdate(date2); + case "iso": + return date2.toISOString(); + case "web": + return date2.toUTCString(); + } + }); + morgan.token("status", function getStatusToken(req, res) { + return headersSent(res) ? String(res.statusCode) : void 0; + }); + morgan.token("referrer", function getReferrerToken(req) { + return req.headers["referer"] || req.headers["referrer"]; + }); + morgan.token("remote-addr", getip); + morgan.token("remote-user", function getRemoteUserToken(req) { + var credentials = auth(req); + return credentials ? credentials.name : void 0; + }); + morgan.token("http-version", function getHttpVersionToken(req) { + return req.httpVersionMajor + "." + req.httpVersionMinor; + }); + morgan.token("user-agent", function getUserAgentToken(req) { + return req.headers["user-agent"]; + }); + morgan.token("req", function getRequestToken(req, res, field) { + var header = req.headers[field.toLowerCase()]; + return Array.isArray(header) ? header.join(", ") : header; + }); + morgan.token("res", function getResponseHeader(req, res, field) { + if (!headersSent(res)) { + return void 0; + } + var header = res.getHeader(field); + return Array.isArray(header) ? header.join(", ") : header; + }); + function clfdate(dateTime) { + var date2 = dateTime.getUTCDate(); + var hour = dateTime.getUTCHours(); + var mins = dateTime.getUTCMinutes(); + var secs = dateTime.getUTCSeconds(); + var year2 = dateTime.getUTCFullYear(); + var month = CLF_MONTH[dateTime.getUTCMonth()]; + return pad2(date2) + "/" + month + "/" + year2 + ":" + pad2(hour) + ":" + pad2(mins) + ":" + pad2(secs) + " +0000"; + } + function compile(format3) { + if (typeof format3 !== "string") { + throw new TypeError("argument format must be a string"); + } + var fmt = String(JSON.stringify(format3)); + var js = ' "use strict"\n return ' + fmt.replace(/:([-\w]{2,})(?:\[([^\]]+)\])?/g, function(_, name, arg) { + var tokenArguments = "req, res"; + var tokenFunction = "tokens[" + String(JSON.stringify(name)) + "]"; + if (arg !== void 0) { + tokenArguments += ", " + String(JSON.stringify(arg)); + } + return '" +\n (' + tokenFunction + "(" + tokenArguments + ') || "-") + "'; + }); + return new Function("tokens, req, res", js); + } + function createBufferStream(stream, interval) { + var buf = []; + var timer = null; + function flush() { + timer = null; + stream.write(buf.join("")); + buf.length = 0; + } + function write(str) { + if (timer === null) { + timer = setTimeout(flush, interval); + } + buf.push(str); + } + return { write }; + } + function format2(name, fmt) { + morgan[name] = fmt; + return this; + } + function getFormatFunction(name) { + var fmt = morgan[name] || name || morgan.default; + return typeof fmt !== "function" ? compile(fmt) : fmt; + } + function getip(req) { + return req.ip || req._remoteAddress || req.connection && req.connection.remoteAddress || void 0; + } + function headersSent(res) { + return typeof res.headersSent !== "boolean" ? Boolean(res._header) : res.headersSent; + } + function pad2(num) { + var str = String(num); + return (str.length === 1 ? "0" : "") + str; + } + function recordStartTime() { + this._startAt = process.hrtime(); + this._startTime = /* @__PURE__ */ new Date(); + } + function token(name, fn2) { + morgan[name] = fn2; + return this; + } + } +}); + +// node_modules/object-assign/index.js +var require_object_assign = __commonJS({ + "node_modules/object-assign/index.js"(exports2, module2) { + "use strict"; + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + function toObject(val) { + if (val === null || val === void 0) { + throw new TypeError("Object.assign cannot be called with null or undefined"); + } + return Object(val); + } + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + var test1 = new String("abc"); + test1[5] = "de"; + if (Object.getOwnPropertyNames(test1)[0] === "5") { + return false; + } + var test2 = {}; + for (var i4 = 0; i4 < 10; i4++) { + test2["_" + String.fromCharCode(i4)] = i4; + } + var order2 = Object.getOwnPropertyNames(test2).map(function(n4) { + return test2[n4]; + }); + if (order2.join("") !== "0123456789") { + return false; + } + var test3 = {}; + "abcdefghijklmnopqrst".split("").forEach(function(letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { + return false; + } + return true; + } catch (err) { + return false; + } + } + module2.exports = shouldUseNative() ? Object.assign : function(target, source) { + var from; + var to = toObject(target); + var symbols; + for (var s4 = 1; s4 < arguments.length; s4++) { + from = Object(arguments[s4]); + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i4 = 0; i4 < symbols.length; i4++) { + if (propIsEnumerable.call(from, symbols[i4])) { + to[symbols[i4]] = from[symbols[i4]]; + } + } + } + } + return to; + }; + } +}); + +// node_modules/cors/lib/index.js +var require_lib3 = __commonJS({ + "node_modules/cors/lib/index.js"(exports2, module2) { + (function() { + "use strict"; + var assign = require_object_assign(); + var vary = require_vary(); + var defaults = { + origin: "*", + methods: "GET,HEAD,PUT,PATCH,POST,DELETE", + preflightContinue: false, + optionsSuccessStatus: 204 + }; + function isString(s4) { + return typeof s4 === "string" || s4 instanceof String; + } + function isOriginAllowed(origin, allowedOrigin) { + if (Array.isArray(allowedOrigin)) { + for (var i4 = 0; i4 < allowedOrigin.length; ++i4) { + if (isOriginAllowed(origin, allowedOrigin[i4])) { + return true; + } + } + return false; + } else if (isString(allowedOrigin)) { + return origin === allowedOrigin; + } else if (allowedOrigin instanceof RegExp) { + return allowedOrigin.test(origin); + } else { + return !!allowedOrigin; + } + } + function configureOrigin(options, req) { + var requestOrigin = req.headers.origin, headers = [], isAllowed; + if (!options.origin || options.origin === "*") { + headers.push([{ + key: "Access-Control-Allow-Origin", + value: "*" + }]); + } else if (isString(options.origin)) { + headers.push([{ + key: "Access-Control-Allow-Origin", + value: options.origin + }]); + headers.push([{ + key: "Vary", + value: "Origin" + }]); + } else { + isAllowed = isOriginAllowed(requestOrigin, options.origin); + headers.push([{ + key: "Access-Control-Allow-Origin", + value: isAllowed ? requestOrigin : false + }]); + headers.push([{ + key: "Vary", + value: "Origin" + }]); + } + return headers; + } + function configureMethods(options) { + var methods = options.methods; + if (methods.join) { + methods = options.methods.join(","); + } + return { + key: "Access-Control-Allow-Methods", + value: methods + }; + } + function configureCredentials(options) { + if (options.credentials === true) { + return { + key: "Access-Control-Allow-Credentials", + value: "true" + }; + } + return null; + } + function configureAllowedHeaders(options, req) { + var allowedHeaders = options.allowedHeaders || options.headers; + var headers = []; + if (!allowedHeaders) { + allowedHeaders = req.headers["access-control-request-headers"]; + headers.push([{ + key: "Vary", + value: "Access-Control-Request-Headers" + }]); + } else if (allowedHeaders.join) { + allowedHeaders = allowedHeaders.join(","); + } + if (allowedHeaders && allowedHeaders.length) { + headers.push([{ + key: "Access-Control-Allow-Headers", + value: allowedHeaders + }]); + } + return headers; + } + function configureExposedHeaders(options) { + var headers = options.exposedHeaders; + if (!headers) { + return null; + } else if (headers.join) { + headers = headers.join(","); + } + if (headers && headers.length) { + return { + key: "Access-Control-Expose-Headers", + value: headers + }; + } + return null; + } + function configureMaxAge(options) { + var maxAge = (typeof options.maxAge === "number" || options.maxAge) && options.maxAge.toString(); + if (maxAge && maxAge.length) { + return { + key: "Access-Control-Max-Age", + value: maxAge + }; + } + return null; + } + function applyHeaders(headers, res) { + for (var i4 = 0, n4 = headers.length; i4 < n4; i4++) { + var header = headers[i4]; + if (header) { + if (Array.isArray(header)) { + applyHeaders(header, res); + } else if (header.key === "Vary" && header.value) { + vary(res, header.value); + } else if (header.value) { + res.setHeader(header.key, header.value); + } + } + } + } + function cors2(options, req, res, next) { + var headers = [], method = req.method && req.method.toUpperCase && req.method.toUpperCase(); + if (method === "OPTIONS") { + headers.push(configureOrigin(options, req)); + headers.push(configureCredentials(options, req)); + headers.push(configureMethods(options, req)); + headers.push(configureAllowedHeaders(options, req)); + headers.push(configureMaxAge(options, req)); + headers.push(configureExposedHeaders(options, req)); + applyHeaders(headers, res); + if (options.preflightContinue) { + next(); + } else { + res.statusCode = options.optionsSuccessStatus; + res.setHeader("Content-Length", "0"); + res.end(); + } + } else { + headers.push(configureOrigin(options, req)); + headers.push(configureCredentials(options, req)); + headers.push(configureExposedHeaders(options, req)); + applyHeaders(headers, res); + next(); + } + } + function middlewareWrapper(o4) { + var optionsCallback = null; + if (typeof o4 === "function") { + optionsCallback = o4; + } else { + optionsCallback = function(req, cb) { + cb(null, o4); + }; + } + return function corsMiddleware2(req, res, next) { + optionsCallback(req, function(err, options) { + if (err) { + next(err); + } else { + var corsOptions = assign({}, defaults, options); + var originCallback = null; + if (corsOptions.origin && typeof corsOptions.origin === "function") { + originCallback = corsOptions.origin; + } else if (corsOptions.origin) { + originCallback = function(origin, cb) { + cb(null, corsOptions.origin); + }; + } + if (originCallback) { + originCallback(req.headers.origin, function(err2, origin) { + if (err2 || !origin) { + next(err2); + } else { + corsOptions.origin = origin; + cors2(corsOptions, req, res, next); + } + }); + } else { + next(); + } + } + }); + }; + } + module2.exports = middlewareWrapper; + })(); + } +}); + +// node_modules/bson/lib/bson.cjs +var require_bson = __commonJS({ + "node_modules/bson/lib/bson.cjs"(exports2) { + "use strict"; + var TypedArrayPrototypeGetSymbolToStringTag = (() => { + const g4 = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag).get; + return (value) => g4.call(value); + })(); + function isUint8Array(value) { + return TypedArrayPrototypeGetSymbolToStringTag(value) === "Uint8Array"; + } + function isAnyArrayBuffer(value) { + return typeof value === "object" && value != null && Symbol.toStringTag in value && (value[Symbol.toStringTag] === "ArrayBuffer" || value[Symbol.toStringTag] === "SharedArrayBuffer"); + } + function isRegExp(regexp2) { + return regexp2 instanceof RegExp || Object.prototype.toString.call(regexp2) === "[object RegExp]"; + } + function isMap(value) { + return typeof value === "object" && value != null && Symbol.toStringTag in value && value[Symbol.toStringTag] === "Map"; + } + function isDate(date2) { + return date2 instanceof Date || Object.prototype.toString.call(date2) === "[object Date]"; + } + function defaultInspect(x4, _options) { + return JSON.stringify(x4, (k4, v4) => { + if (typeof v4 === "bigint") { + return { $numberLong: `${v4}` }; + } else if (isMap(v4)) { + return Object.fromEntries(v4); + } + return v4; + }); + } + function getStylizeFunction(options) { + const stylizeExists = options != null && typeof options === "object" && "stylize" in options && typeof options.stylize === "function"; + if (stylizeExists) { + return options.stylize; + } + } + var BSON_MAJOR_VERSION = 6; + var BSON_VERSION_SYMBOL = /* @__PURE__ */ Symbol.for("@@mdb.bson.version"); + var BSON_INT32_MAX = 2147483647; + var BSON_INT32_MIN = -2147483648; + var BSON_INT64_MAX = Math.pow(2, 63) - 1; + var BSON_INT64_MIN = -Math.pow(2, 63); + var JS_INT_MAX = Math.pow(2, 53); + var JS_INT_MIN = -Math.pow(2, 53); + var BSON_DATA_NUMBER = 1; + var BSON_DATA_STRING = 2; + var BSON_DATA_OBJECT = 3; + var BSON_DATA_ARRAY = 4; + var BSON_DATA_BINARY = 5; + var BSON_DATA_UNDEFINED = 6; + var BSON_DATA_OID = 7; + var BSON_DATA_BOOLEAN = 8; + var BSON_DATA_DATE = 9; + var BSON_DATA_NULL = 10; + var BSON_DATA_REGEXP = 11; + var BSON_DATA_DBPOINTER = 12; + var BSON_DATA_CODE = 13; + var BSON_DATA_SYMBOL = 14; + var BSON_DATA_CODE_W_SCOPE = 15; + var BSON_DATA_INT = 16; + var BSON_DATA_TIMESTAMP = 17; + var BSON_DATA_LONG = 18; + var BSON_DATA_DECIMAL128 = 19; + var BSON_DATA_MIN_KEY = 255; + var BSON_DATA_MAX_KEY = 127; + var BSON_BINARY_SUBTYPE_DEFAULT = 0; + var BSON_BINARY_SUBTYPE_UUID_NEW = 4; + var BSONType = Object.freeze({ + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: -1, + maxKey: 127 + }); + var BSONError = class extends Error { + get bsonError() { + return true; + } + get name() { + return "BSONError"; + } + constructor(message2, options) { + super(message2, options); + } + static isBSONError(value) { + return value != null && typeof value === "object" && "bsonError" in value && value.bsonError === true && "name" in value && "message" in value && "stack" in value; + } + }; + var BSONVersionError = class extends BSONError { + get name() { + return "BSONVersionError"; + } + constructor() { + super(`Unsupported BSON version, bson types must be from bson ${BSON_MAJOR_VERSION}.x.x`); + } + }; + var BSONRuntimeError = class extends BSONError { + get name() { + return "BSONRuntimeError"; + } + constructor(message2) { + super(message2); + } + }; + var BSONOffsetError = class extends BSONError { + get name() { + return "BSONOffsetError"; + } + constructor(message2, offset, options) { + super(`${message2}. offset: ${offset}`, options); + this.offset = offset; + } + }; + var TextDecoderFatal; + var TextDecoderNonFatal; + function parseUtf8(buffer2, start, end, fatal) { + if (fatal) { + TextDecoderFatal ??= new TextDecoder("utf8", { fatal: true }); + try { + return TextDecoderFatal.decode(buffer2.subarray(start, end)); + } catch (cause) { + throw new BSONError("Invalid UTF-8 string in BSON document", { cause }); + } + } + TextDecoderNonFatal ??= new TextDecoder("utf8", { fatal: false }); + return TextDecoderNonFatal.decode(buffer2.subarray(start, end)); + } + function tryReadBasicLatin(uint8array, start, end) { + if (uint8array.length === 0) { + return ""; + } + const stringByteLength = end - start; + if (stringByteLength === 0) { + return ""; + } + if (stringByteLength > 20) { + return null; + } + if (stringByteLength === 1 && uint8array[start] < 128) { + return String.fromCharCode(uint8array[start]); + } + if (stringByteLength === 2 && uint8array[start] < 128 && uint8array[start + 1] < 128) { + return String.fromCharCode(uint8array[start]) + String.fromCharCode(uint8array[start + 1]); + } + if (stringByteLength === 3 && uint8array[start] < 128 && uint8array[start + 1] < 128 && uint8array[start + 2] < 128) { + return String.fromCharCode(uint8array[start]) + String.fromCharCode(uint8array[start + 1]) + String.fromCharCode(uint8array[start + 2]); + } + const latinBytes = []; + for (let i4 = start; i4 < end; i4++) { + const byte = uint8array[i4]; + if (byte > 127) { + return null; + } + latinBytes.push(byte); + } + return String.fromCharCode(...latinBytes); + } + function tryWriteBasicLatin(destination, source, offset) { + if (source.length === 0) + return 0; + if (source.length > 25) + return null; + if (destination.length - offset < source.length) + return null; + for (let charOffset = 0, destinationOffset = offset; charOffset < source.length; charOffset++, destinationOffset++) { + const char = source.charCodeAt(charOffset); + if (char > 127) + return null; + destination[destinationOffset] = char; + } + return source.length; + } + function nodejsMathRandomBytes(byteLength) { + return nodeJsByteUtils.fromNumberArray(Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256))); + } + var nodejsRandomBytes = (() => { + try { + return require("crypto").randomBytes; + } catch { + return nodejsMathRandomBytes; + } + })(); + var nodeJsByteUtils = { + toLocalBufferType(potentialBuffer) { + if (Buffer.isBuffer(potentialBuffer)) { + return potentialBuffer; + } + if (ArrayBuffer.isView(potentialBuffer)) { + return Buffer.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + const stringTag = potentialBuffer?.[Symbol.toStringTag] ?? Object.prototype.toString.call(potentialBuffer); + if (stringTag === "ArrayBuffer" || stringTag === "SharedArrayBuffer" || stringTag === "[object ArrayBuffer]" || stringTag === "[object SharedArrayBuffer]") { + return Buffer.from(potentialBuffer); + } + throw new BSONError(`Cannot create Buffer from the passed potentialBuffer.`); + }, + allocate(size) { + return Buffer.alloc(size); + }, + allocateUnsafe(size) { + return Buffer.allocUnsafe(size); + }, + equals(a4, b4) { + return nodeJsByteUtils.toLocalBufferType(a4).equals(b4); + }, + fromNumberArray(array) { + return Buffer.from(array); + }, + fromBase64(base64) { + return Buffer.from(base64, "base64"); + }, + toBase64(buffer2) { + return nodeJsByteUtils.toLocalBufferType(buffer2).toString("base64"); + }, + fromISO88591(codePoints) { + return Buffer.from(codePoints, "binary"); + }, + toISO88591(buffer2) { + return nodeJsByteUtils.toLocalBufferType(buffer2).toString("binary"); + }, + fromHex(hex) { + return Buffer.from(hex, "hex"); + }, + toHex(buffer2) { + return nodeJsByteUtils.toLocalBufferType(buffer2).toString("hex"); + }, + toUTF8(buffer2, start, end, fatal) { + const basicLatin = end - start <= 20 ? tryReadBasicLatin(buffer2, start, end) : null; + if (basicLatin != null) { + return basicLatin; + } + const string = nodeJsByteUtils.toLocalBufferType(buffer2).toString("utf8", start, end); + if (fatal) { + for (let i4 = 0; i4 < string.length; i4++) { + if (string.charCodeAt(i4) === 65533) { + parseUtf8(buffer2, start, end, true); + break; + } + } + } + return string; + }, + utf8ByteLength(input) { + return Buffer.byteLength(input, "utf8"); + }, + encodeUTF8Into(buffer2, source, byteOffset) { + const latinBytesWritten = tryWriteBasicLatin(buffer2, source, byteOffset); + if (latinBytesWritten != null) { + return latinBytesWritten; + } + return nodeJsByteUtils.toLocalBufferType(buffer2).write(source, byteOffset, void 0, "utf8"); + }, + randomBytes: nodejsRandomBytes, + swap32(buffer2) { + return nodeJsByteUtils.toLocalBufferType(buffer2).swap32(); + } + }; + function isReactNative() { + const { navigator: navigator2 } = globalThis; + return typeof navigator2 === "object" && navigator2.product === "ReactNative"; + } + function webMathRandomBytes(byteLength) { + if (byteLength < 0) { + throw new RangeError(`The argument 'byteLength' is invalid. Received ${byteLength}`); + } + return webByteUtils.fromNumberArray(Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256))); + } + var webRandomBytes = (() => { + const { crypto: crypto2 } = globalThis; + if (crypto2 != null && typeof crypto2.getRandomValues === "function") { + return (byteLength) => { + return crypto2.getRandomValues(webByteUtils.allocate(byteLength)); + }; + } else { + if (isReactNative()) { + const { console: console2 } = globalThis; + console2?.warn?.("BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values."); + } + return webMathRandomBytes; + } + })(); + var HEX_DIGIT = /(\d|[a-f])/i; + var webByteUtils = { + toLocalBufferType(potentialUint8array) { + const stringTag = potentialUint8array?.[Symbol.toStringTag] ?? Object.prototype.toString.call(potentialUint8array); + if (stringTag === "Uint8Array") { + return potentialUint8array; + } + if (ArrayBuffer.isView(potentialUint8array)) { + return new Uint8Array(potentialUint8array.buffer.slice(potentialUint8array.byteOffset, potentialUint8array.byteOffset + potentialUint8array.byteLength)); + } + if (stringTag === "ArrayBuffer" || stringTag === "SharedArrayBuffer" || stringTag === "[object ArrayBuffer]" || stringTag === "[object SharedArrayBuffer]") { + return new Uint8Array(potentialUint8array); + } + throw new BSONError(`Cannot make a Uint8Array from passed potentialBuffer.`); + }, + allocate(size) { + if (typeof size !== "number") { + throw new TypeError(`The "size" argument must be of type number. Received ${String(size)}`); + } + return new Uint8Array(size); + }, + allocateUnsafe(size) { + return webByteUtils.allocate(size); + }, + equals(a4, b4) { + if (a4.byteLength !== b4.byteLength) { + return false; + } + for (let i4 = 0; i4 < a4.byteLength; i4++) { + if (a4[i4] !== b4[i4]) { + return false; + } + } + return true; + }, + fromNumberArray(array) { + return Uint8Array.from(array); + }, + fromBase64(base64) { + return Uint8Array.from(atob(base64), (c4) => c4.charCodeAt(0)); + }, + toBase64(uint8array) { + return btoa(webByteUtils.toISO88591(uint8array)); + }, + fromISO88591(codePoints) { + return Uint8Array.from(codePoints, (c4) => c4.charCodeAt(0) & 255); + }, + toISO88591(uint8array) { + return Array.from(Uint16Array.from(uint8array), (b4) => String.fromCharCode(b4)).join(""); + }, + fromHex(hex) { + const evenLengthHex = hex.length % 2 === 0 ? hex : hex.slice(0, hex.length - 1); + const buffer2 = []; + for (let i4 = 0; i4 < evenLengthHex.length; i4 += 2) { + const firstDigit = evenLengthHex[i4]; + const secondDigit = evenLengthHex[i4 + 1]; + if (!HEX_DIGIT.test(firstDigit)) { + break; + } + if (!HEX_DIGIT.test(secondDigit)) { + break; + } + const hexDigit = Number.parseInt(`${firstDigit}${secondDigit}`, 16); + buffer2.push(hexDigit); + } + return Uint8Array.from(buffer2); + }, + toHex(uint8array) { + return Array.from(uint8array, (byte) => byte.toString(16).padStart(2, "0")).join(""); + }, + toUTF8(uint8array, start, end, fatal) { + const basicLatin = end - start <= 20 ? tryReadBasicLatin(uint8array, start, end) : null; + if (basicLatin != null) { + return basicLatin; + } + return parseUtf8(uint8array, start, end, fatal); + }, + utf8ByteLength(input) { + return new TextEncoder().encode(input).byteLength; + }, + encodeUTF8Into(uint8array, source, byteOffset) { + const bytes = new TextEncoder().encode(source); + uint8array.set(bytes, byteOffset); + return bytes.byteLength; + }, + randomBytes: webRandomBytes, + swap32(buffer2) { + if (buffer2.length % 4 !== 0) { + throw new RangeError("Buffer size must be a multiple of 32-bits"); + } + for (let i4 = 0; i4 < buffer2.length; i4 += 4) { + const byte0 = buffer2[i4]; + const byte1 = buffer2[i4 + 1]; + const byte2 = buffer2[i4 + 2]; + const byte3 = buffer2[i4 + 3]; + buffer2[i4] = byte3; + buffer2[i4 + 1] = byte2; + buffer2[i4 + 2] = byte1; + buffer2[i4 + 3] = byte0; + } + return buffer2; + } + }; + var hasGlobalBuffer = typeof Buffer === "function" && Buffer.prototype?._isBuffer !== true; + var ByteUtils = hasGlobalBuffer ? nodeJsByteUtils : webByteUtils; + var BSONValue = class { + get [BSON_VERSION_SYMBOL]() { + return BSON_MAJOR_VERSION; + } + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")](depth, options, inspect) { + return this.inspect(depth, options, inspect); + } + }; + var FLOAT = new Float64Array(1); + var FLOAT_BYTES = new Uint8Array(FLOAT.buffer, 0, 8); + FLOAT[0] = -1; + var isBigEndian = FLOAT_BYTES[7] === 0; + var NumberUtils = { + isBigEndian, + getNonnegativeInt32LE(source, offset) { + if (source[offset + 3] > 127) { + throw new RangeError(`Size cannot be negative at offset: ${offset}`); + } + return source[offset] | source[offset + 1] << 8 | source[offset + 2] << 16 | source[offset + 3] << 24; + }, + getInt32LE(source, offset) { + return source[offset] | source[offset + 1] << 8 | source[offset + 2] << 16 | source[offset + 3] << 24; + }, + getUint32LE(source, offset) { + return source[offset] + source[offset + 1] * 256 + source[offset + 2] * 65536 + source[offset + 3] * 16777216; + }, + getUint32BE(source, offset) { + return source[offset + 3] + source[offset + 2] * 256 + source[offset + 1] * 65536 + source[offset] * 16777216; + }, + getBigInt64LE(source, offset) { + const hi = BigInt(source[offset + 4] + source[offset + 5] * 256 + source[offset + 6] * 65536 + (source[offset + 7] << 24)); + const lo = BigInt(source[offset] + source[offset + 1] * 256 + source[offset + 2] * 65536 + source[offset + 3] * 16777216); + return (hi << BigInt(32)) + lo; + }, + getFloat64LE: isBigEndian ? (source, offset) => { + FLOAT_BYTES[7] = source[offset]; + FLOAT_BYTES[6] = source[offset + 1]; + FLOAT_BYTES[5] = source[offset + 2]; + FLOAT_BYTES[4] = source[offset + 3]; + FLOAT_BYTES[3] = source[offset + 4]; + FLOAT_BYTES[2] = source[offset + 5]; + FLOAT_BYTES[1] = source[offset + 6]; + FLOAT_BYTES[0] = source[offset + 7]; + return FLOAT[0]; + } : (source, offset) => { + FLOAT_BYTES[0] = source[offset]; + FLOAT_BYTES[1] = source[offset + 1]; + FLOAT_BYTES[2] = source[offset + 2]; + FLOAT_BYTES[3] = source[offset + 3]; + FLOAT_BYTES[4] = source[offset + 4]; + FLOAT_BYTES[5] = source[offset + 5]; + FLOAT_BYTES[6] = source[offset + 6]; + FLOAT_BYTES[7] = source[offset + 7]; + return FLOAT[0]; + }, + setInt32BE(destination, offset, value) { + destination[offset + 3] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset] = value; + return 4; + }, + setInt32LE(destination, offset, value) { + destination[offset] = value; + value >>>= 8; + destination[offset + 1] = value; + value >>>= 8; + destination[offset + 2] = value; + value >>>= 8; + destination[offset + 3] = value; + return 4; + }, + setBigInt64LE(destination, offset, value) { + const mask32bits = BigInt(4294967295); + let lo = Number(value & mask32bits); + destination[offset] = lo; + lo >>= 8; + destination[offset + 1] = lo; + lo >>= 8; + destination[offset + 2] = lo; + lo >>= 8; + destination[offset + 3] = lo; + let hi = Number(value >> BigInt(32) & mask32bits); + destination[offset + 4] = hi; + hi >>= 8; + destination[offset + 5] = hi; + hi >>= 8; + destination[offset + 6] = hi; + hi >>= 8; + destination[offset + 7] = hi; + return 8; + }, + setFloat64LE: isBigEndian ? (destination, offset, value) => { + FLOAT[0] = value; + destination[offset] = FLOAT_BYTES[7]; + destination[offset + 1] = FLOAT_BYTES[6]; + destination[offset + 2] = FLOAT_BYTES[5]; + destination[offset + 3] = FLOAT_BYTES[4]; + destination[offset + 4] = FLOAT_BYTES[3]; + destination[offset + 5] = FLOAT_BYTES[2]; + destination[offset + 6] = FLOAT_BYTES[1]; + destination[offset + 7] = FLOAT_BYTES[0]; + return 8; + } : (destination, offset, value) => { + FLOAT[0] = value; + destination[offset] = FLOAT_BYTES[0]; + destination[offset + 1] = FLOAT_BYTES[1]; + destination[offset + 2] = FLOAT_BYTES[2]; + destination[offset + 3] = FLOAT_BYTES[3]; + destination[offset + 4] = FLOAT_BYTES[4]; + destination[offset + 5] = FLOAT_BYTES[5]; + destination[offset + 6] = FLOAT_BYTES[6]; + destination[offset + 7] = FLOAT_BYTES[7]; + return 8; + } + }; + var Binary = class _Binary extends BSONValue { + get _bsontype() { + return "Binary"; + } + constructor(buffer2, subType) { + super(); + if (!(buffer2 == null) && typeof buffer2 === "string" && !ArrayBuffer.isView(buffer2) && !isAnyArrayBuffer(buffer2) && !Array.isArray(buffer2)) { + throw new BSONError("Binary can only be constructed from Uint8Array or number[]"); + } + this.sub_type = subType ?? _Binary.BSON_BINARY_SUBTYPE_DEFAULT; + if (buffer2 == null) { + this.buffer = ByteUtils.allocate(_Binary.BUFFER_SIZE); + this.position = 0; + } else { + this.buffer = Array.isArray(buffer2) ? ByteUtils.fromNumberArray(buffer2) : ByteUtils.toLocalBufferType(buffer2); + this.position = this.buffer.byteLength; + } + } + put(byteValue) { + if (typeof byteValue === "string" && byteValue.length !== 1) { + throw new BSONError("only accepts single character String"); + } else if (typeof byteValue !== "number" && byteValue.length !== 1) + throw new BSONError("only accepts single character Uint8Array or Array"); + let decodedByte; + if (typeof byteValue === "string") { + decodedByte = byteValue.charCodeAt(0); + } else if (typeof byteValue === "number") { + decodedByte = byteValue; + } else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONError("only accepts number in a valid unsigned byte range 0-255"); + } + if (this.buffer.byteLength > this.position) { + this.buffer[this.position++] = decodedByte; + } else { + const newSpace = ByteUtils.allocate(_Binary.BUFFER_SIZE + this.buffer.length); + newSpace.set(this.buffer, 0); + this.buffer = newSpace; + this.buffer[this.position++] = decodedByte; + } + } + write(sequence, offset) { + offset = typeof offset === "number" ? offset : this.position; + if (this.buffer.byteLength < offset + sequence.length) { + const newSpace = ByteUtils.allocate(this.buffer.byteLength + sequence.length); + newSpace.set(this.buffer, 0); + this.buffer = newSpace; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ByteUtils.toLocalBufferType(sequence), offset); + this.position = offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } else if (typeof sequence === "string") { + throw new BSONError("input cannot be string"); + } + } + read(position, length) { + length = length && length > 0 ? length : this.position; + const end = position + length; + return this.buffer.subarray(position, end > this.position ? this.position : end); + } + value() { + return this.buffer.length === this.position ? this.buffer : this.buffer.subarray(0, this.position); + } + length() { + return this.position; + } + toJSON() { + return ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + } + toString(encoding) { + if (encoding === "hex") + return ByteUtils.toHex(this.buffer.subarray(0, this.position)); + if (encoding === "base64") + return ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + if (encoding === "utf8" || encoding === "utf-8") + return ByteUtils.toUTF8(this.buffer, 0, this.position, false); + return ByteUtils.toUTF8(this.buffer, 0, this.position, false); + } + toExtendedJSON(options) { + options = options || {}; + if (this.sub_type === _Binary.SUBTYPE_VECTOR) { + validateBinaryVector(this); + } + const base64String = ByteUtils.toBase64(this.buffer); + const subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? "0" + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? "0" + subType : subType + } + }; + } + toUUID() { + if (this.sub_type === _Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.subarray(0, this.position)); + } + throw new BSONError(`Binary sub_type "${this.sub_type}" is not supported for converting to UUID. Only "${_Binary.SUBTYPE_UUID}" is currently supported.`); + } + static createFromHexString(hex, subType) { + return new _Binary(ByteUtils.fromHex(hex), subType); + } + static createFromBase64(base64, subType) { + return new _Binary(ByteUtils.fromBase64(base64), subType); + } + static fromExtendedJSON(doc, options) { + options = options || {}; + let data2; + let type; + if ("$binary" in doc) { + if (options.legacy && typeof doc.$binary === "string" && "$type" in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data2 = ByteUtils.fromBase64(doc.$binary); + } else { + if (typeof doc.$binary !== "string") { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data2 = ByteUtils.fromBase64(doc.$binary.base64); + } + } + } else if ("$uuid" in doc) { + type = 4; + data2 = UUID.bytesFromString(doc.$uuid); + } + if (!data2) { + throw new BSONError(`Unexpected Binary Extended JSON format ${JSON.stringify(doc)}`); + } + return type === BSON_BINARY_SUBTYPE_UUID_NEW ? new UUID(data2) : new _Binary(data2, type); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const base64 = ByteUtils.toBase64(this.buffer.subarray(0, this.position)); + const base64Arg = inspect(base64, options); + const subTypeArg = inspect(this.sub_type, options); + return `Binary.createFromBase64(${base64Arg}, ${subTypeArg})`; + } + toInt8Array() { + if (this.sub_type !== _Binary.SUBTYPE_VECTOR) { + throw new BSONError("Binary sub_type is not Vector"); + } + if (this.buffer[0] !== _Binary.VECTOR_TYPE.Int8) { + throw new BSONError("Binary datatype field is not Int8"); + } + validateBinaryVector(this); + return new Int8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + } + toFloat32Array() { + if (this.sub_type !== _Binary.SUBTYPE_VECTOR) { + throw new BSONError("Binary sub_type is not Vector"); + } + if (this.buffer[0] !== _Binary.VECTOR_TYPE.Float32) { + throw new BSONError("Binary datatype field is not Float32"); + } + validateBinaryVector(this); + const floatBytes = new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + if (NumberUtils.isBigEndian) + ByteUtils.swap32(floatBytes); + return new Float32Array(floatBytes.buffer); + } + toPackedBits() { + if (this.sub_type !== _Binary.SUBTYPE_VECTOR) { + throw new BSONError("Binary sub_type is not Vector"); + } + if (this.buffer[0] !== _Binary.VECTOR_TYPE.PackedBit) { + throw new BSONError("Binary datatype field is not packed bit"); + } + validateBinaryVector(this); + return new Uint8Array(this.buffer.buffer.slice(this.buffer.byteOffset + 2, this.buffer.byteOffset + this.position)); + } + toBits() { + if (this.sub_type !== _Binary.SUBTYPE_VECTOR) { + throw new BSONError("Binary sub_type is not Vector"); + } + if (this.buffer[0] !== _Binary.VECTOR_TYPE.PackedBit) { + throw new BSONError("Binary datatype field is not packed bit"); + } + validateBinaryVector(this); + const byteCount = this.length() - 2; + const bitCount = byteCount * 8 - this.buffer[1]; + const bits = new Int8Array(bitCount); + for (let bitOffset = 0; bitOffset < bits.length; bitOffset++) { + const byteOffset = bitOffset / 8 | 0; + const byte = this.buffer[byteOffset + 2]; + const shift = 7 - bitOffset % 8; + const bit = byte >> shift & 1; + bits[bitOffset] = bit; + } + return bits; + } + static fromInt8Array(array) { + const buffer2 = ByteUtils.allocate(array.byteLength + 2); + buffer2[0] = _Binary.VECTOR_TYPE.Int8; + buffer2[1] = 0; + const intBytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + buffer2.set(intBytes, 2); + const bin = new this(buffer2, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromFloat32Array(array) { + const binaryBytes = ByteUtils.allocate(array.byteLength + 2); + binaryBytes[0] = _Binary.VECTOR_TYPE.Float32; + binaryBytes[1] = 0; + const floatBytes = new Uint8Array(array.buffer, array.byteOffset, array.byteLength); + binaryBytes.set(floatBytes, 2); + if (NumberUtils.isBigEndian) + ByteUtils.swap32(new Uint8Array(binaryBytes.buffer, 2)); + const bin = new this(binaryBytes, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromPackedBits(array, padding = 0) { + const buffer2 = ByteUtils.allocate(array.byteLength + 2); + buffer2[0] = _Binary.VECTOR_TYPE.PackedBit; + buffer2[1] = padding; + buffer2.set(array, 2); + const bin = new this(buffer2, this.SUBTYPE_VECTOR); + validateBinaryVector(bin); + return bin; + } + static fromBits(bits) { + const byteLength = bits.length + 7 >>> 3; + const bytes = new Uint8Array(byteLength + 2); + bytes[0] = _Binary.VECTOR_TYPE.PackedBit; + const remainder = bits.length % 8; + bytes[1] = remainder === 0 ? 0 : 8 - remainder; + for (let bitOffset = 0; bitOffset < bits.length; bitOffset++) { + const byteOffset = bitOffset >>> 3; + const bit = bits[bitOffset]; + if (bit !== 0 && bit !== 1) { + throw new BSONError(`Invalid bit value at ${bitOffset}: must be 0 or 1, found ${bits[bitOffset]}`); + } + if (bit === 0) + continue; + const shift = 7 - bitOffset % 8; + bytes[byteOffset + 2] |= bit << shift; + } + return new this(bytes, _Binary.SUBTYPE_VECTOR); + } + }; + Binary.BSON_BINARY_SUBTYPE_DEFAULT = 0; + Binary.BUFFER_SIZE = 256; + Binary.SUBTYPE_DEFAULT = 0; + Binary.SUBTYPE_FUNCTION = 1; + Binary.SUBTYPE_BYTE_ARRAY = 2; + Binary.SUBTYPE_UUID_OLD = 3; + Binary.SUBTYPE_UUID = 4; + Binary.SUBTYPE_MD5 = 5; + Binary.SUBTYPE_ENCRYPTED = 6; + Binary.SUBTYPE_COLUMN = 7; + Binary.SUBTYPE_SENSITIVE = 8; + Binary.SUBTYPE_VECTOR = 9; + Binary.SUBTYPE_USER_DEFINED = 128; + Binary.VECTOR_TYPE = Object.freeze({ + Int8: 3, + Float32: 39, + PackedBit: 16 + }); + function validateBinaryVector(vector) { + if (vector.sub_type !== Binary.SUBTYPE_VECTOR) + return; + const size = vector.position; + const datatype = vector.buffer[0]; + const padding = vector.buffer[1]; + if ((datatype === Binary.VECTOR_TYPE.Float32 || datatype === Binary.VECTOR_TYPE.Int8) && padding !== 0) { + throw new BSONError("Invalid Vector: padding must be zero for int8 and float32 vectors"); + } + if (datatype === Binary.VECTOR_TYPE.Float32) { + if (size !== 0 && size - 2 !== 0 && (size - 2) % 4 !== 0) { + throw new BSONError("Invalid Vector: Float32 vector must contain a multiple of 4 bytes"); + } + } + if (datatype === Binary.VECTOR_TYPE.PackedBit && padding !== 0 && size === 2) { + throw new BSONError("Invalid Vector: padding must be zero for packed bit vectors that are empty"); + } + if (datatype === Binary.VECTOR_TYPE.PackedBit && padding > 7) { + throw new BSONError(`Invalid Vector: padding must be a value between 0 and 7. found: ${padding}`); + } + } + var UUID_BYTE_LENGTH = 16; + var UUID_WITHOUT_DASHES = /^[0-9A-F]{32}$/i; + var UUID_WITH_DASHES = /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i; + var UUID = class _UUID extends Binary { + constructor(input) { + let bytes; + if (input == null) { + bytes = _UUID.generate(); + } else if (input instanceof _UUID) { + bytes = ByteUtils.toLocalBufferType(new Uint8Array(input.buffer)); + } else if (ArrayBuffer.isView(input) && input.byteLength === UUID_BYTE_LENGTH) { + bytes = ByteUtils.toLocalBufferType(input); + } else if (typeof input === "string") { + bytes = _UUID.bytesFromString(input); + } else { + throw new BSONError("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."); + } + super(bytes, BSON_BINARY_SUBTYPE_UUID_NEW); + } + get id() { + return this.buffer; + } + set id(value) { + this.buffer = value; + } + toHexString(includeDashes = true) { + if (includeDashes) { + return [ + ByteUtils.toHex(this.buffer.subarray(0, 4)), + ByteUtils.toHex(this.buffer.subarray(4, 6)), + ByteUtils.toHex(this.buffer.subarray(6, 8)), + ByteUtils.toHex(this.buffer.subarray(8, 10)), + ByteUtils.toHex(this.buffer.subarray(10, 16)) + ].join("-"); + } + return ByteUtils.toHex(this.buffer); + } + toString(encoding) { + if (encoding === "hex") + return ByteUtils.toHex(this.id); + if (encoding === "base64") + return ByteUtils.toBase64(this.id); + return this.toHexString(); + } + toJSON() { + return this.toHexString(); + } + equals(otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof _UUID) { + return ByteUtils.equals(otherId.id, this.id); + } + try { + return ByteUtils.equals(new _UUID(otherId).id, this.id); + } catch { + return false; + } + } + toBinary() { + return new Binary(this.id, Binary.SUBTYPE_UUID); + } + static generate() { + const bytes = ByteUtils.randomBytes(UUID_BYTE_LENGTH); + bytes[6] = bytes[6] & 15 | 64; + bytes[8] = bytes[8] & 63 | 128; + return bytes; + } + static isValid(input) { + if (!input) { + return false; + } + if (typeof input === "string") { + return _UUID.isValidUUIDString(input); + } + if (isUint8Array(input)) { + return input.byteLength === UUID_BYTE_LENGTH; + } + return input._bsontype === "Binary" && input.sub_type === this.SUBTYPE_UUID && input.buffer.byteLength === 16; + } + static createFromHexString(hexString) { + const buffer2 = _UUID.bytesFromString(hexString); + return new _UUID(buffer2); + } + static createFromBase64(base64) { + return new _UUID(ByteUtils.fromBase64(base64)); + } + static bytesFromString(representation) { + if (!_UUID.isValidUUIDString(representation)) { + throw new BSONError("UUID string representation must be 32 hex digits or canonical hyphenated representation"); + } + return ByteUtils.fromHex(representation.replace(/-/g, "")); + } + static isValidUUIDString(representation) { + return UUID_WITHOUT_DASHES.test(representation) || UUID_WITH_DASHES.test(representation); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new UUID(${inspect(this.toHexString(), options)})`; + } + }; + var Code = class _Code extends BSONValue { + get _bsontype() { + return "Code"; + } + constructor(code, scope) { + super(); + this.code = code.toString(); + this.scope = scope ?? null; + } + toJSON() { + if (this.scope != null) { + return { code: this.code, scope: this.scope }; + } + return { code: this.code }; + } + toExtendedJSON() { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + } + static fromExtendedJSON(doc) { + return new _Code(doc.$code, doc.$scope); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + let parametersString = inspect(this.code, options); + const multiLineFn = parametersString.includes("\n"); + if (this.scope != null) { + parametersString += `,${multiLineFn ? "\n" : " "}${inspect(this.scope, options)}`; + } + const endingNewline = multiLineFn && this.scope === null; + return `new Code(${multiLineFn ? "\n" : ""}${parametersString}${endingNewline ? "\n" : ""})`; + } + }; + function isDBRefLike(value) { + return value != null && typeof value === "object" && "$id" in value && value.$id != null && "$ref" in value && typeof value.$ref === "string" && (!("$db" in value) || "$db" in value && typeof value.$db === "string"); + } + var DBRef = class _DBRef extends BSONValue { + get _bsontype() { + return "DBRef"; + } + constructor(collection, oid, db, fields) { + super(); + const parts = collection.split("."); + if (parts.length === 2) { + db = parts.shift(); + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + get namespace() { + return this.collection; + } + set namespace(value) { + this.collection = value; + } + toJSON() { + const o4 = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o4.$db = this.db; + return o4; + } + toExtendedJSON(options) { + options = options || {}; + let o4 = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o4; + } + if (this.db) + o4.$db = this.db; + o4 = Object.assign(o4, this.fields); + return o4; + } + static fromExtendedJSON(doc) { + const copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new _DBRef(doc.$ref, doc.$id, doc.$db, copy); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const args2 = [ + inspect(this.namespace, options), + inspect(this.oid, options), + ...this.db ? [inspect(this.db, options)] : [], + ...Object.keys(this.fields).length > 0 ? [inspect(this.fields, options)] : [] + ]; + args2[1] = inspect === defaultInspect ? `new ObjectId(${args2[1]})` : args2[1]; + return `new DBRef(${args2.join(", ")})`; + } + }; + function removeLeadingZerosAndExplicitPlus(str) { + if (str === "") { + return str; + } + let startIndex = 0; + const isNegative = str[startIndex] === "-"; + const isExplicitlyPositive = str[startIndex] === "+"; + if (isExplicitlyPositive || isNegative) { + startIndex += 1; + } + let foundInsignificantZero = false; + for (; startIndex < str.length && str[startIndex] === "0"; ++startIndex) { + foundInsignificantZero = true; + } + if (!foundInsignificantZero) { + return isExplicitlyPositive ? str.slice(1) : str; + } + return `${isNegative ? "-" : ""}${str.length === startIndex ? "0" : str.slice(startIndex)}`; + } + function validateStringCharacters(str, radix) { + radix = radix ?? 10; + const validCharacters = "0123456789abcdefghijklmnopqrstuvwxyz".slice(0, radix); + const regex = new RegExp(`[^-+${validCharacters}]`, "i"); + return regex.test(str) ? false : str; + } + var wasm = void 0; + try { + wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; + } catch { + } + var TWO_PWR_16_DBL = 1 << 16; + var TWO_PWR_24_DBL = 1 << 24; + var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + var INT_CACHE = {}; + var UINT_CACHE = {}; + var MAX_INT64_STRING_LENGTH = 20; + var DECIMAL_REG_EX = /^(\+?0|(\+|-)?[1-9][0-9]*)$/; + var Long = class _Long extends BSONValue { + get _bsontype() { + return "Long"; + } + get __isLong__() { + return true; + } + constructor(lowOrValue = 0, highOrUnsigned, unsigned) { + super(); + const unsignedBool = typeof highOrUnsigned === "boolean" ? highOrUnsigned : Boolean(unsigned); + const high = typeof highOrUnsigned === "number" ? highOrUnsigned : 0; + const res = typeof lowOrValue === "string" ? _Long.fromString(lowOrValue, unsignedBool) : typeof lowOrValue === "bigint" ? _Long.fromBigInt(lowOrValue, unsignedBool) : { low: lowOrValue | 0, high: high | 0, unsigned: unsignedBool }; + this.low = res.low; + this.high = res.high; + this.unsigned = res.unsigned; + } + static fromBits(lowBits, highBits, unsigned) { + return new _Long(lowBits, highBits, unsigned); + } + static fromInt(value, unsigned) { + let obj, cachedObj, cache4; + if (unsigned) { + value >>>= 0; + if (cache4 = 0 <= value && value < 256) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = _Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache4) + UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if (cache4 = -128 <= value && value < 128) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = _Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache4) + INT_CACHE[value] = obj; + return obj; + } + } + static fromNumber(value, unsigned) { + if (isNaN(value)) + return unsigned ? _Long.UZERO : _Long.ZERO; + if (unsigned) { + if (value < 0) + return _Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return _Long.MAX_UNSIGNED_VALUE; + } else { + if (value <= -9223372036854776e3) + return _Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return _Long.MAX_VALUE; + } + if (value < 0) + return _Long.fromNumber(-value, unsigned).neg(); + return _Long.fromBits(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned); + } + static fromBigInt(value, unsigned) { + const FROM_BIGINT_BIT_MASK = BigInt(4294967295); + const FROM_BIGINT_BIT_SHIFT = BigInt(32); + return new _Long(Number(value & FROM_BIGINT_BIT_MASK), Number(value >> FROM_BIGINT_BIT_SHIFT & FROM_BIGINT_BIT_MASK), unsigned); + } + static _fromString(str, unsigned, radix) { + if (str.length === 0) + throw new BSONError("empty string"); + if (radix < 2 || 36 < radix) + throw new BSONError("radix"); + let p4; + if ((p4 = str.indexOf("-")) > 0) + throw new BSONError("interior hyphen"); + else if (p4 === 0) { + return _Long._fromString(str.substring(1), unsigned, radix).neg(); + } + const radixToPower = _Long.fromNumber(Math.pow(radix, 8)); + let result = _Long.ZERO; + for (let i4 = 0; i4 < str.length; i4 += 8) { + const size = Math.min(8, str.length - i4), value = parseInt(str.substring(i4, i4 + size), radix); + if (size < 8) { + const power = _Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(_Long.fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(_Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + static fromStringStrict(str, unsignedOrRadix, radix) { + let unsigned = false; + if (typeof unsignedOrRadix === "number") { + radix = unsignedOrRadix, unsignedOrRadix = false; + } else { + unsigned = !!unsignedOrRadix; + } + radix ??= 10; + if (str.trim() !== str) { + throw new BSONError(`Input: '${str}' contains leading and/or trailing whitespace`); + } + if (!validateStringCharacters(str, radix)) { + throw new BSONError(`Input: '${str}' contains invalid characters for radix: ${radix}`); + } + const cleanedStr = removeLeadingZerosAndExplicitPlus(str); + const result = _Long._fromString(cleanedStr, unsigned, radix); + if (result.toString(radix).toLowerCase() !== cleanedStr.toLowerCase()) { + throw new BSONError(`Input: ${str} is not representable as ${result.unsigned ? "an unsigned" : "a signed"} 64-bit Long ${radix != null ? `with radix: ${radix}` : ""}`); + } + return result; + } + static fromString(str, unsignedOrRadix, radix) { + let unsigned = false; + if (typeof unsignedOrRadix === "number") { + radix = unsignedOrRadix, unsignedOrRadix = false; + } else { + unsigned = !!unsignedOrRadix; + } + radix ??= 10; + if (str === "NaN" && radix < 24) { + return _Long.ZERO; + } else if ((str === "Infinity" || str === "+Infinity" || str === "-Infinity") && radix < 35) { + return _Long.ZERO; + } + return _Long._fromString(str, unsigned, radix); + } + static fromBytes(bytes, unsigned, le) { + return le ? _Long.fromBytesLE(bytes, unsigned) : _Long.fromBytesBE(bytes, unsigned); + } + static fromBytesLE(bytes, unsigned) { + return new _Long(bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, unsigned); + } + static fromBytesBE(bytes, unsigned) { + return new _Long(bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], unsigned); + } + static isLong(value) { + return value != null && typeof value === "object" && "__isLong__" in value && value.__isLong__ === true; + } + static fromValue(val, unsigned) { + if (typeof val === "number") + return _Long.fromNumber(val, unsigned); + if (typeof val === "string") + return _Long.fromString(val, unsigned); + return _Long.fromBits(val.low, val.high, typeof unsigned === "boolean" ? unsigned : val.unsigned); + } + add(addend) { + if (!_Long.isLong(addend)) + addend = _Long.fromValue(addend); + const a48 = this.high >>> 16; + const a32 = this.high & 65535; + const a16 = this.low >>> 16; + const a00 = this.low & 65535; + const b48 = addend.high >>> 16; + const b32 = addend.high & 65535; + const b16 = addend.low >>> 16; + const b00 = addend.low & 65535; + let c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 65535; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 65535; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 65535; + c48 += a48 + b48; + c48 &= 65535; + return _Long.fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); + } + and(other) { + if (!_Long.isLong(other)) + other = _Long.fromValue(other); + return _Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + } + compare(other) { + if (!_Long.isLong(other)) + other = _Long.fromValue(other); + if (this.eq(other)) + return 0; + const thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1; + } + comp(other) { + return this.compare(other); + } + divide(divisor) { + if (!_Long.isLong(divisor)) + divisor = _Long.fromValue(divisor); + if (divisor.isZero()) + throw new BSONError("division by zero"); + if (wasm) { + if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) { + return this; + } + const low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return _Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? _Long.UZERO : _Long.ZERO; + let approx, rem, res; + if (!this.unsigned) { + if (this.eq(_Long.MIN_VALUE)) { + if (divisor.eq(_Long.ONE) || divisor.eq(_Long.NEG_ONE)) + return _Long.MIN_VALUE; + else if (divisor.eq(_Long.MIN_VALUE)) + return _Long.ONE; + else { + const halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(_Long.ZERO)) { + return divisor.isNegative() ? _Long.ONE : _Long.NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(_Long.MIN_VALUE)) + return this.unsigned ? _Long.UZERO : _Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = _Long.ZERO; + } else { + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return _Long.UZERO; + if (divisor.gt(this.shru(1))) + return _Long.UONE; + res = _Long.UZERO; + } + rem = this; + while (rem.gte(divisor)) { + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + const log2 = Math.ceil(Math.log(approx) / Math.LN2); + const delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + let approxRes = _Long.fromNumber(approx); + let approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = _Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + if (approxRes.isZero()) + approxRes = _Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + } + div(divisor) { + return this.divide(divisor); + } + equals(other) { + if (!_Long.isLong(other)) + other = _Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + } + eq(other) { + return this.equals(other); + } + getHighBits() { + return this.high; + } + getHighBitsUnsigned() { + return this.high >>> 0; + } + getLowBits() { + return this.low; + } + getLowBitsUnsigned() { + return this.low >>> 0; + } + getNumBitsAbs() { + if (this.isNegative()) { + return this.eq(_Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + const val = this.high !== 0 ? this.high : this.low; + let bit; + for (bit = 31; bit > 0; bit--) + if ((val & 1 << bit) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + } + greaterThan(other) { + return this.comp(other) > 0; + } + gt(other) { + return this.greaterThan(other); + } + greaterThanOrEqual(other) { + return this.comp(other) >= 0; + } + gte(other) { + return this.greaterThanOrEqual(other); + } + ge(other) { + return this.greaterThanOrEqual(other); + } + isEven() { + return (this.low & 1) === 0; + } + isNegative() { + return !this.unsigned && this.high < 0; + } + isOdd() { + return (this.low & 1) === 1; + } + isPositive() { + return this.unsigned || this.high >= 0; + } + isZero() { + return this.high === 0 && this.low === 0; + } + lessThan(other) { + return this.comp(other) < 0; + } + lt(other) { + return this.lessThan(other); + } + lessThanOrEqual(other) { + return this.comp(other) <= 0; + } + lte(other) { + return this.lessThanOrEqual(other); + } + modulo(divisor) { + if (!_Long.isLong(divisor)) + divisor = _Long.fromValue(divisor); + if (wasm) { + const low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return _Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + } + mod(divisor) { + return this.modulo(divisor); + } + rem(divisor) { + return this.modulo(divisor); + } + multiply(multiplier) { + if (this.isZero()) + return _Long.ZERO; + if (!_Long.isLong(multiplier)) + multiplier = _Long.fromValue(multiplier); + if (wasm) { + const low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return _Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return _Long.ZERO; + if (this.eq(_Long.MIN_VALUE)) + return multiplier.isOdd() ? _Long.MIN_VALUE : _Long.ZERO; + if (multiplier.eq(_Long.MIN_VALUE)) + return this.isOdd() ? _Long.MIN_VALUE : _Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + if (this.lt(_Long.TWO_PWR_24) && multiplier.lt(_Long.TWO_PWR_24)) + return _Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + const a48 = this.high >>> 16; + const a32 = this.high & 65535; + const a16 = this.low >>> 16; + const a00 = this.low & 65535; + const b48 = multiplier.high >>> 16; + const b32 = multiplier.high & 65535; + const b16 = multiplier.low >>> 16; + const b00 = multiplier.low & 65535; + let c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 65535; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 65535; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 65535; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 65535; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 65535; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 65535; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 65535; + return _Long.fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); + } + mul(multiplier) { + return this.multiply(multiplier); + } + negate() { + if (!this.unsigned && this.eq(_Long.MIN_VALUE)) + return _Long.MIN_VALUE; + return this.not().add(_Long.ONE); + } + neg() { + return this.negate(); + } + not() { + return _Long.fromBits(~this.low, ~this.high, this.unsigned); + } + notEquals(other) { + return !this.equals(other); + } + neq(other) { + return this.notEquals(other); + } + ne(other) { + return this.notEquals(other); + } + or(other) { + if (!_Long.isLong(other)) + other = _Long.fromValue(other); + return _Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + } + shiftLeft(numBits) { + if (_Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return _Long.fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned); + else + return _Long.fromBits(0, this.low << numBits - 32, this.unsigned); + } + shl(numBits) { + return this.shiftLeft(numBits); + } + shiftRight(numBits) { + if (_Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return _Long.fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned); + else + return _Long.fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned); + } + shr(numBits) { + return this.shiftRight(numBits); + } + shiftRightUnsigned(numBits) { + if (_Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + const high = this.high; + if (numBits < 32) { + const low = this.low; + return _Long.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits, this.unsigned); + } else if (numBits === 32) + return _Long.fromBits(high, 0, this.unsigned); + else + return _Long.fromBits(high >>> numBits - 32, 0, this.unsigned); + } + } + shr_u(numBits) { + return this.shiftRightUnsigned(numBits); + } + shru(numBits) { + return this.shiftRightUnsigned(numBits); + } + subtract(subtrahend) { + if (!_Long.isLong(subtrahend)) + subtrahend = _Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + } + sub(subtrahend) { + return this.subtract(subtrahend); + } + toInt() { + return this.unsigned ? this.low >>> 0 : this.low; + } + toNumber() { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + } + toBigInt() { + return BigInt(this.toString()); + } + toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); + } + toBytesLE() { + const hi = this.high, lo = this.low; + return [ + lo & 255, + lo >>> 8 & 255, + lo >>> 16 & 255, + lo >>> 24, + hi & 255, + hi >>> 8 & 255, + hi >>> 16 & 255, + hi >>> 24 + ]; + } + toBytesBE() { + const hi = this.high, lo = this.low; + return [ + hi >>> 24, + hi >>> 16 & 255, + hi >>> 8 & 255, + hi & 255, + lo >>> 24, + lo >>> 16 & 255, + lo >>> 8 & 255, + lo & 255 + ]; + } + toSigned() { + if (!this.unsigned) + return this; + return _Long.fromBits(this.low, this.high, false); + } + toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw new BSONError("radix"); + if (this.isZero()) + return "0"; + if (this.isNegative()) { + if (this.eq(_Long.MIN_VALUE)) { + const radixLong = _Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } else + return "-" + this.neg().toString(radix); + } + const radixToPower = _Long.fromNumber(Math.pow(radix, 6), this.unsigned); + let rem = this; + let result = ""; + while (true) { + const remDiv = rem.div(radixToPower); + const intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + let digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } else { + while (digits.length < 6) + digits = "0" + digits; + result = "" + digits + result; + } + } + } + toUnsigned() { + if (this.unsigned) + return this; + return _Long.fromBits(this.low, this.high, true); + } + xor(other) { + if (!_Long.isLong(other)) + other = _Long.fromValue(other); + return _Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + } + eqz() { + return this.isZero(); + } + le(other) { + return this.lessThanOrEqual(other); + } + toExtendedJSON(options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + } + static fromExtendedJSON(doc, options) { + const { useBigInt64 = false, relaxed = true } = { ...options }; + if (doc.$numberLong.length > MAX_INT64_STRING_LENGTH) { + throw new BSONError("$numberLong string is too long"); + } + if (!DECIMAL_REG_EX.test(doc.$numberLong)) { + throw new BSONError(`$numberLong string "${doc.$numberLong}" is in an invalid format`); + } + if (useBigInt64) { + const bigIntResult = BigInt(doc.$numberLong); + return BigInt.asIntN(64, bigIntResult); + } + const longResult = _Long.fromString(doc.$numberLong); + if (relaxed) { + return longResult.toNumber(); + } + return longResult; + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const longVal = inspect(this.toString(), options); + const unsignedVal = this.unsigned ? `, ${inspect(this.unsigned, options)}` : ""; + return `new Long(${longVal}${unsignedVal})`; + } + }; + Long.TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + Long.MAX_UNSIGNED_VALUE = Long.fromBits(4294967295 | 0, 4294967295 | 0, true); + Long.ZERO = Long.fromInt(0); + Long.UZERO = Long.fromInt(0, true); + Long.ONE = Long.fromInt(1); + Long.UONE = Long.fromInt(1, true); + Long.NEG_ONE = Long.fromInt(-1); + Long.MAX_VALUE = Long.fromBits(4294967295 | 0, 2147483647 | 0, false); + Long.MIN_VALUE = Long.fromBits(0, 2147483648 | 0, false); + var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; + var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; + var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; + var EXPONENT_MAX = 6111; + var EXPONENT_MIN = -6176; + var EXPONENT_BIAS = 6176; + var MAX_DIGITS = 34; + var NAN_BUFFER = ByteUtils.fromNumberArray([ + 124, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ].reverse()); + var INF_NEGATIVE_BUFFER = ByteUtils.fromNumberArray([ + 248, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ].reverse()); + var INF_POSITIVE_BUFFER = ByteUtils.fromNumberArray([ + 120, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ].reverse()); + var EXPONENT_REGEX = /^([-+])?(\d+)?$/; + var COMBINATION_MASK = 31; + var EXPONENT_MASK = 16383; + var COMBINATION_INFINITY = 30; + var COMBINATION_NAN = 31; + function isDigit(value) { + return !isNaN(parseInt(value, 10)); + } + function divideu128(value) { + const DIVISOR = Long.fromNumber(1e3 * 1e3 * 1e3); + let _rem = Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (let i4 = 0; i4 <= 3; i4++) { + _rem = _rem.shiftLeft(32); + _rem = _rem.add(new Long(value.parts[i4], 0)); + value.parts[i4] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; + } + function multiply64x2(left, right) { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + const leftHigh = left.shiftRightUnsigned(32); + const leftLow = new Long(left.getLowBits(), 0); + const rightHigh = right.shiftRightUnsigned(32); + const rightLow = new Long(right.getLowBits(), 0); + let productHigh = leftHigh.multiply(rightHigh); + let productMid = leftHigh.multiply(rightLow); + const productMid2 = leftLow.multiply(rightHigh); + let productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0).add(productMid2).add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + return { high: productHigh, low: productLow }; + } + function lessThan(left, right) { + const uhleft = left.high >>> 0; + const uhright = right.high >>> 0; + if (uhleft < uhright) { + return true; + } else if (uhleft === uhright) { + const ulleft = left.low >>> 0; + const ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; + } + function invalidErr(string, message2) { + throw new BSONError(`"${string}" is not a valid Decimal128 string - ${message2}`); + } + var Decimal128 = class _Decimal128 extends BSONValue { + get _bsontype() { + return "Decimal128"; + } + constructor(bytes) { + super(); + if (typeof bytes === "string") { + this.bytes = _Decimal128.fromString(bytes).bytes; + } else if (bytes instanceof Uint8Array || isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONError("Decimal128 must take a Buffer of 16 bytes"); + } + this.bytes = bytes; + } else { + throw new BSONError("Decimal128 must take a Buffer or string"); + } + } + static fromString(representation) { + return _Decimal128._fromString(representation, { allowRounding: false }); + } + static fromStringWithRounding(representation) { + return _Decimal128._fromString(representation, { allowRounding: true }); + } + static _fromString(representation, options) { + let isNegative = false; + let sawSign = false; + let sawRadix = false; + let foundNonZero = false; + let significantDigits = 0; + let nDigitsRead = 0; + let nDigits = 0; + let radixPosition = 0; + let firstNonZero = 0; + const digits = [0]; + let nDigitsStored = 0; + let digitsInsert = 0; + let lastDigit = 0; + let exponent = 0; + let significandHigh = new Long(0, 0); + let significandLow = new Long(0, 0); + let biasedExponent = 0; + let index = 0; + if (representation.length >= 7e3) { + throw new BSONError("" + representation + " not a valid Decimal128 string"); + } + const stringMatch = representation.match(PARSE_STRING_REGEXP); + const infMatch = representation.match(PARSE_INF_REGEXP); + const nanMatch = representation.match(PARSE_NAN_REGEXP); + if (!stringMatch && !infMatch && !nanMatch || representation.length === 0) { + throw new BSONError("" + representation + " not a valid Decimal128 string"); + } + if (stringMatch) { + const unsignedNumber = stringMatch[2]; + const e4 = stringMatch[4]; + const expSign = stringMatch[5]; + const expNumber = stringMatch[6]; + if (e4 && expNumber === void 0) + invalidErr(representation, "missing exponent power"); + if (e4 && unsignedNumber === void 0) + invalidErr(representation, "missing exponent base"); + if (e4 === void 0 && (expSign || expNumber)) { + invalidErr(representation, "missing e before exponent"); + } + } + if (representation[index] === "+" || representation[index] === "-") { + sawSign = true; + isNegative = representation[index++] === "-"; + } + if (!isDigit(representation[index]) && representation[index] !== ".") { + if (representation[index] === "i" || representation[index] === "I") { + return new _Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER); + } else if (representation[index] === "N") { + return new _Decimal128(NAN_BUFFER); + } + } + while (isDigit(representation[index]) || representation[index] === ".") { + if (representation[index] === ".") { + if (sawRadix) + invalidErr(representation, "contains multiple periods"); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < MAX_DIGITS) { + if (representation[index] !== "0" || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new BSONError("" + representation + " not a valid Decimal128 string"); + if (representation[index] === "e" || representation[index] === "E") { + const match = representation.substr(++index).match(EXPONENT_REGEX); + if (!match || !match[2]) + return new _Decimal128(NAN_BUFFER); + exponent = parseInt(match[0], 10); + index = index + match[0].length; + } + if (representation[index]) + return new _Decimal128(NAN_BUFFER); + if (!nDigitsStored) { + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (representation[firstNonZero + significantDigits - 1 + Number(sawSign) + Number(sawRadix)] === "0") { + significantDigits = significantDigits - 1; + } + } + } + if (exponent <= radixPosition && radixPosition > exponent + (1 << 14)) { + exponent = EXPONENT_MIN; + } else { + exponent = exponent - radixPosition; + } + while (exponent > EXPONENT_MAX) { + lastDigit = lastDigit + 1; + if (lastDigit >= MAX_DIGITS) { + if (significantDigits === 0) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, "overflow"); + } + exponent = exponent - 1; + } + if (options.allowRounding) { + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + nDigits = nDigits - 1; + } else { + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } else { + const digitsString = digits.join(""); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, "overflow"); + } + } + if (lastDigit + 1 < significantDigits) { + let endOfString = nDigitsRead; + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + if (sawSign) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + let roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (let i4 = firstNonZero + lastDigit + 2; i4 < endOfString; i4++) { + if (parseInt(representation[i4], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + let dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } else { + return new _Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER); + } + } + } else { + break; + } + } + } + } + } else { + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + if (lastDigit === 0) { + if (significantDigits === 0) { + exponent = EXPONENT_MIN; + break; + } + invalidErr(representation, "exponent underflow"); + } + if (nDigitsStored < nDigits) { + if (representation[nDigits - 1 + Number(sawSign) + Number(sawRadix)] !== "0" && significantDigits !== 0) { + invalidErr(representation, "inexact rounding"); + } + nDigits = nDigits - 1; + } else { + if (digits[lastDigit] !== 0) { + invalidErr(representation, "inexact rounding"); + } + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } else { + invalidErr(representation, "overflow"); + } + } + if (lastDigit + 1 < significantDigits) { + if (sawRadix) { + firstNonZero = firstNonZero + 1; + } + if (sawSign) { + firstNonZero = firstNonZero + 1; + } + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + if (roundDigit !== 0) { + invalidErr(representation, "inexact rounding"); + } + } + } + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } else if (lastDigit < 17) { + let dIdx = 0; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } else { + let dIdx = 0; + significandHigh = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + significandLow = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + const significand = multiply64x2(significandHigh, Long.fromString("100000000000000000")); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + biasedExponent = exponent + EXPONENT_BIAS; + const dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { + dec.high = dec.high.or(Long.fromNumber(3).shiftLeft(61)); + dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(16383).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(140737488355327))); + } else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 16383).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(562949953421311))); + } + dec.low = significand.low; + if (isNegative) { + dec.high = dec.high.or(Long.fromString("9223372036854775808")); + } + const buffer2 = ByteUtils.allocateUnsafe(16); + index = 0; + buffer2[index++] = dec.low.low & 255; + buffer2[index++] = dec.low.low >> 8 & 255; + buffer2[index++] = dec.low.low >> 16 & 255; + buffer2[index++] = dec.low.low >> 24 & 255; + buffer2[index++] = dec.low.high & 255; + buffer2[index++] = dec.low.high >> 8 & 255; + buffer2[index++] = dec.low.high >> 16 & 255; + buffer2[index++] = dec.low.high >> 24 & 255; + buffer2[index++] = dec.high.low & 255; + buffer2[index++] = dec.high.low >> 8 & 255; + buffer2[index++] = dec.high.low >> 16 & 255; + buffer2[index++] = dec.high.low >> 24 & 255; + buffer2[index++] = dec.high.high & 255; + buffer2[index++] = dec.high.high >> 8 & 255; + buffer2[index++] = dec.high.high >> 16 & 255; + buffer2[index++] = dec.high.high >> 24 & 255; + return new _Decimal128(buffer2); + } + toString() { + let biased_exponent; + let significand_digits = 0; + const significand = new Array(36); + for (let i4 = 0; i4 < significand.length; i4++) + significand[i4] = 0; + let index = 0; + let is_zero = false; + let significand_msb; + let significand128 = { parts: [0, 0, 0, 0] }; + let j4, k4; + const string = []; + index = 0; + const buffer2 = this.bytes; + const low = buffer2[index++] | buffer2[index++] << 8 | buffer2[index++] << 16 | buffer2[index++] << 24; + const midl = buffer2[index++] | buffer2[index++] << 8 | buffer2[index++] << 16 | buffer2[index++] << 24; + const midh = buffer2[index++] | buffer2[index++] << 8 | buffer2[index++] << 16 | buffer2[index++] << 24; + const high = buffer2[index++] | buffer2[index++] << 8 | buffer2[index++] << 16 | buffer2[index++] << 24; + index = 0; + const dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + if (dec.high.lessThan(Long.ZERO)) { + string.push("-"); + } + const combination = high >> 26 & COMBINATION_MASK; + if (combination >> 3 === 3) { + if (combination === COMBINATION_INFINITY) { + return string.join("") + "Infinity"; + } else if (combination === COMBINATION_NAN) { + return "NaN"; + } else { + biased_exponent = high >> 15 & EXPONENT_MASK; + significand_msb = 8 + (high >> 14 & 1); + } + } else { + significand_msb = high >> 14 & 7; + biased_exponent = high >> 17 & EXPONENT_MASK; + } + const exponent = biased_exponent - EXPONENT_BIAS; + significand128.parts[0] = (high & 16383) + ((significand_msb & 15) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && significand128.parts[1] === 0 && significand128.parts[2] === 0 && significand128.parts[3] === 0) { + is_zero = true; + } else { + for (k4 = 3; k4 >= 0; k4--) { + let least_digits = 0; + const result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + if (!least_digits) + continue; + for (j4 = 8; j4 >= 0; j4--) { + significand[k4 * 9 + j4] = least_digits % 10; + least_digits = Math.floor(least_digits / 10); + } + } + } + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + const scientific_exponent = significand_digits - 1 + exponent; + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + if (significand_digits > 34) { + string.push(`${0}`); + if (exponent > 0) + string.push(`E+${exponent}`); + else if (exponent < 0) + string.push(`E${exponent}`); + return string.join(""); + } + string.push(`${significand[index++]}`); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push("."); + } + for (let i4 = 0; i4 < significand_digits; i4++) { + string.push(`${significand[index++]}`); + } + string.push("E"); + if (scientific_exponent > 0) { + string.push(`+${scientific_exponent}`); + } else { + string.push(`${scientific_exponent}`); + } + } else { + if (exponent >= 0) { + for (let i4 = 0; i4 < significand_digits; i4++) { + string.push(`${significand[index++]}`); + } + } else { + let radix_position = significand_digits + exponent; + if (radix_position > 0) { + for (let i4 = 0; i4 < radix_position; i4++) { + string.push(`${significand[index++]}`); + } + } else { + string.push("0"); + } + string.push("."); + while (radix_position++ < 0) { + string.push("0"); + } + for (let i4 = 0; i4 < significand_digits - Math.max(radix_position - 1, 0); i4++) { + string.push(`${significand[index++]}`); + } + } + } + return string.join(""); + } + toJSON() { + return { $numberDecimal: this.toString() }; + } + toExtendedJSON() { + return { $numberDecimal: this.toString() }; + } + static fromExtendedJSON(doc) { + return _Decimal128.fromString(doc.$numberDecimal); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const d128string = inspect(this.toString(), options); + return `new Decimal128(${d128string})`; + } + }; + var Double = class _Double extends BSONValue { + get _bsontype() { + return "Double"; + } + constructor(value) { + super(); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + static fromString(value) { + const coercedValue = Number(value); + if (value === "NaN") + return new _Double(NaN); + if (value === "Infinity") + return new _Double(Infinity); + if (value === "-Infinity") + return new _Double(-Infinity); + if (!Number.isFinite(coercedValue)) { + throw new BSONError(`Input: ${value} is not representable as a Double`); + } + if (value.trim() !== value) { + throw new BSONError(`Input: '${value}' contains whitespace`); + } + if (value === "") { + throw new BSONError(`Input is an empty string`); + } + if (/[^-0-9.+eE]/.test(value)) { + throw new BSONError(`Input: '${value}' is not in decimal or exponential notation`); + } + return new _Double(coercedValue); + } + valueOf() { + return this.value; + } + toJSON() { + return this.value; + } + toString(radix) { + return this.value.toString(radix); + } + toExtendedJSON(options) { + if (options && (options.legacy || options.relaxed && isFinite(this.value))) { + return this.value; + } + if (Object.is(Math.sign(this.value), -0)) { + return { $numberDouble: "-0.0" }; + } + return { + $numberDouble: Number.isInteger(this.value) ? this.value.toFixed(1) : this.value.toString() + }; + } + static fromExtendedJSON(doc, options) { + const doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new _Double(doubleValue); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new Double(${inspect(this.value, options)})`; + } + }; + var Int32 = class _Int32 extends BSONValue { + get _bsontype() { + return "Int32"; + } + constructor(value) { + super(); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + static fromString(value) { + const cleanedValue = removeLeadingZerosAndExplicitPlus(value); + const coercedValue = Number(value); + if (BSON_INT32_MAX < coercedValue) { + throw new BSONError(`Input: '${value}' is larger than the maximum value for Int32`); + } else if (BSON_INT32_MIN > coercedValue) { + throw new BSONError(`Input: '${value}' is smaller than the minimum value for Int32`); + } else if (!Number.isSafeInteger(coercedValue)) { + throw new BSONError(`Input: '${value}' is not a safe integer`); + } else if (coercedValue.toString() !== cleanedValue) { + throw new BSONError(`Input: '${value}' is not a valid Int32 string`); + } + return new _Int32(coercedValue); + } + valueOf() { + return this.value; + } + toString(radix) { + return this.value.toString(radix); + } + toJSON() { + return this.value; + } + toExtendedJSON(options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + } + static fromExtendedJSON(doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new _Int32(doc.$numberInt); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new Int32(${inspect(this.value, options)})`; + } + }; + var MaxKey = class _MaxKey extends BSONValue { + get _bsontype() { + return "MaxKey"; + } + toExtendedJSON() { + return { $maxKey: 1 }; + } + static fromExtendedJSON() { + return new _MaxKey(); + } + inspect() { + return "new MaxKey()"; + } + }; + var MinKey = class _MinKey extends BSONValue { + get _bsontype() { + return "MinKey"; + } + toExtendedJSON() { + return { $minKey: 1 }; + } + static fromExtendedJSON() { + return new _MinKey(); + } + inspect() { + return "new MinKey()"; + } + }; + var PROCESS_UNIQUE = null; + var __idCache = /* @__PURE__ */ new WeakMap(); + var ObjectId2 = class _ObjectId extends BSONValue { + get _bsontype() { + return "ObjectId"; + } + constructor(inputId) { + super(); + let workingId; + if (typeof inputId === "object" && inputId && "id" in inputId) { + if (typeof inputId.id !== "string" && !ArrayBuffer.isView(inputId.id)) { + throw new BSONError("Argument passed in must have an id that is of type string or Buffer"); + } + if ("toHexString" in inputId && typeof inputId.toHexString === "function") { + workingId = ByteUtils.fromHex(inputId.toHexString()); + } else { + workingId = inputId.id; + } + } else { + workingId = inputId; + } + if (workingId == null || typeof workingId === "number") { + this.buffer = _ObjectId.generate(typeof workingId === "number" ? workingId : void 0); + } else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + this.buffer = ByteUtils.toLocalBufferType(workingId); + } else if (typeof workingId === "string") { + if (_ObjectId.validateHexString(workingId)) { + this.buffer = ByteUtils.fromHex(workingId); + if (_ObjectId.cacheHexString) { + __idCache.set(this, workingId); + } + } else { + throw new BSONError("input must be a 24 character hex string, 12 byte Uint8Array, or an integer"); + } + } else { + throw new BSONError("Argument passed in does not match the accepted types"); + } + } + get id() { + return this.buffer; + } + set id(value) { + this.buffer = value; + if (_ObjectId.cacheHexString) { + __idCache.set(this, ByteUtils.toHex(value)); + } + } + static validateHexString(string) { + if (string?.length !== 24) + return false; + for (let i4 = 0; i4 < 24; i4++) { + const char = string.charCodeAt(i4); + if (char >= 48 && char <= 57 || char >= 97 && char <= 102 || char >= 65 && char <= 70) { + continue; + } + return false; + } + return true; + } + toHexString() { + if (_ObjectId.cacheHexString) { + const __id = __idCache.get(this); + if (__id) + return __id; + } + const hexString = ByteUtils.toHex(this.id); + if (_ObjectId.cacheHexString) { + __idCache.set(this, hexString); + } + return hexString; + } + static getInc() { + return _ObjectId.index = (_ObjectId.index + 1) % 16777215; + } + static generate(time2) { + if ("number" !== typeof time2) { + time2 = Math.floor(Date.now() / 1e3); + } + const inc = _ObjectId.getInc(); + const buffer2 = ByteUtils.allocateUnsafe(12); + NumberUtils.setInt32BE(buffer2, 0, time2); + if (PROCESS_UNIQUE === null) { + PROCESS_UNIQUE = ByteUtils.randomBytes(5); + } + buffer2[4] = PROCESS_UNIQUE[0]; + buffer2[5] = PROCESS_UNIQUE[1]; + buffer2[6] = PROCESS_UNIQUE[2]; + buffer2[7] = PROCESS_UNIQUE[3]; + buffer2[8] = PROCESS_UNIQUE[4]; + buffer2[11] = inc & 255; + buffer2[10] = inc >> 8 & 255; + buffer2[9] = inc >> 16 & 255; + return buffer2; + } + toString(encoding) { + if (encoding === "base64") + return ByteUtils.toBase64(this.id); + if (encoding === "hex") + return this.toHexString(); + return this.toHexString(); + } + toJSON() { + return this.toHexString(); + } + static is(variable) { + return variable != null && typeof variable === "object" && "_bsontype" in variable && variable._bsontype === "ObjectId"; + } + equals(otherId) { + if (otherId === void 0 || otherId === null) { + return false; + } + if (_ObjectId.is(otherId)) { + return this.buffer[11] === otherId.buffer[11] && ByteUtils.equals(this.buffer, otherId.buffer); + } + if (typeof otherId === "string") { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === "object" && typeof otherId.toHexString === "function") { + const otherIdString = otherId.toHexString(); + const thisIdString = this.toHexString(); + return typeof otherIdString === "string" && otherIdString.toLowerCase() === thisIdString; + } + return false; + } + getTimestamp() { + const timestamp = /* @__PURE__ */ new Date(); + const time2 = NumberUtils.getUint32BE(this.buffer, 0); + timestamp.setTime(Math.floor(time2) * 1e3); + return timestamp; + } + static createPk() { + return new _ObjectId(); + } + serializeInto(uint8array, index) { + uint8array[index] = this.buffer[0]; + uint8array[index + 1] = this.buffer[1]; + uint8array[index + 2] = this.buffer[2]; + uint8array[index + 3] = this.buffer[3]; + uint8array[index + 4] = this.buffer[4]; + uint8array[index + 5] = this.buffer[5]; + uint8array[index + 6] = this.buffer[6]; + uint8array[index + 7] = this.buffer[7]; + uint8array[index + 8] = this.buffer[8]; + uint8array[index + 9] = this.buffer[9]; + uint8array[index + 10] = this.buffer[10]; + uint8array[index + 11] = this.buffer[11]; + return 12; + } + static createFromTime(time2) { + const buffer2 = ByteUtils.allocate(12); + for (let i4 = 11; i4 >= 4; i4--) + buffer2[i4] = 0; + NumberUtils.setInt32BE(buffer2, 0, time2); + return new _ObjectId(buffer2); + } + static createFromHexString(hexString) { + if (hexString?.length !== 24) { + throw new BSONError("hex string must be 24 characters"); + } + return new _ObjectId(ByteUtils.fromHex(hexString)); + } + static createFromBase64(base64) { + if (base64?.length !== 16) { + throw new BSONError("base64 string must be 16 characters"); + } + return new _ObjectId(ByteUtils.fromBase64(base64)); + } + static isValid(id) { + if (id == null) + return false; + if (typeof id === "string") + return _ObjectId.validateHexString(id); + try { + new _ObjectId(id); + return true; + } catch { + return false; + } + } + toExtendedJSON() { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString("hex") }; + } + static fromExtendedJSON(doc) { + return new _ObjectId(doc.$oid); + } + isCached() { + return _ObjectId.cacheHexString && __idCache.has(this); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new ObjectId(${inspect(this.toHexString(), options)})`; + } + }; + ObjectId2.index = Math.floor(Math.random() * 16777215); + function internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined) { + let totalLength = 4 + 1; + if (Array.isArray(object)) { + for (let i4 = 0; i4 < object.length; i4++) { + totalLength += calculateElement(i4.toString(), object[i4], serializeFunctions, true, ignoreUndefined); + } + } else { + if (typeof object?.toBSON === "function") { + object = object.toBSON(); + } + for (const key of Object.keys(object)) { + totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined); + } + } + return totalLength; + } + function calculateElement(name, value, serializeFunctions = false, isArray = false, ignoreUndefined = false) { + if (typeof value?.toBSON === "function") { + value = value.toBSON(); + } + switch (typeof value) { + case "string": + return 1 + ByteUtils.utf8ByteLength(name) + 1 + 4 + ByteUtils.utf8ByteLength(value) + 1; + case "number": + if (Math.floor(value) === value && value >= JS_INT_MIN && value <= JS_INT_MAX) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (4 + 1); + } else { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (8 + 1); + } + } else { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (8 + 1); + } + case "undefined": + if (isArray || !ignoreUndefined) + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + 1; + return 0; + case "boolean": + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (1 + 1); + case "object": + if (value != null && typeof value._bsontype === "string" && value[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } else if (value == null || value._bsontype === "MinKey" || value._bsontype === "MaxKey") { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + 1; + } else if (value._bsontype === "ObjectId") { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (12 + 1); + } else if (value instanceof Date || isDate(value)) { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (8 + 1); + } else if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer || isAnyArrayBuffer(value)) { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (1 + 4 + 1) + value.byteLength; + } else if (value._bsontype === "Long" || value._bsontype === "Double" || value._bsontype === "Timestamp") { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (8 + 1); + } else if (value._bsontype === "Decimal128") { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (16 + 1); + } else if (value._bsontype === "Code") { + if (value.scope != null && Object.keys(value.scope).length > 0) { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + 1 + 4 + 4 + ByteUtils.utf8ByteLength(value.code.toString()) + 1 + internalCalculateObjectSize(value.scope, serializeFunctions, ignoreUndefined); + } else { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + 1 + 4 + ByteUtils.utf8ByteLength(value.code.toString()) + 1; + } + } else if (value._bsontype === "Binary") { + const binary = value; + if (binary.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (binary.position + 1 + 4 + 1 + 4); + } else { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (binary.position + 1 + 4 + 1); + } + } else if (value._bsontype === "Symbol") { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + ByteUtils.utf8ByteLength(value.value) + 4 + 1 + 1; + } else if (value._bsontype === "DBRef") { + const ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + if (value.db != null) { + ordered_values["$db"] = value.db; + } + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + 1 + internalCalculateObjectSize(ordered_values, serializeFunctions, ignoreUndefined); + } else if (value instanceof RegExp || isRegExp(value)) { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + 1 + ByteUtils.utf8ByteLength(value.source) + 1 + (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1; + } else if (value._bsontype === "BSONRegExp") { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + 1 + ByteUtils.utf8ByteLength(value.pattern) + 1 + ByteUtils.utf8ByteLength(value.options) + 1; + } else { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + internalCalculateObjectSize(value, serializeFunctions, ignoreUndefined) + 1; + } + case "function": + if (serializeFunctions) { + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + 1 + 4 + ByteUtils.utf8ByteLength(value.toString()) + 1; + } + return 0; + case "bigint": + return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (8 + 1); + case "symbol": + return 0; + default: + throw new BSONError(`Unrecognized JS type: ${typeof value}`); + } + } + function alphabetize(str) { + return str.split("").sort().join(""); + } + var BSONRegExp = class _BSONRegExp extends BSONValue { + get _bsontype() { + return "BSONRegExp"; + } + constructor(pattern, options) { + super(); + this.pattern = pattern; + this.options = alphabetize(options ?? ""); + if (this.pattern.indexOf("\0") !== -1) { + throw new BSONError(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`); + } + if (this.options.indexOf("\0") !== -1) { + throw new BSONError(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`); + } + for (let i4 = 0; i4 < this.options.length; i4++) { + if (!(this.options[i4] === "i" || this.options[i4] === "m" || this.options[i4] === "x" || this.options[i4] === "l" || this.options[i4] === "s" || this.options[i4] === "u")) { + throw new BSONError(`The regular expression option [${this.options[i4]}] is not supported`); + } + } + } + static parseOptions(options) { + return options ? options.split("").sort().join("") : ""; + } + toExtendedJSON(options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + } + static fromExtendedJSON(doc) { + if ("$regex" in doc) { + if (typeof doc.$regex !== "string") { + if (doc.$regex._bsontype === "BSONRegExp") { + return doc; + } + } else { + return new _BSONRegExp(doc.$regex, _BSONRegExp.parseOptions(doc.$options)); + } + } + if ("$regularExpression" in doc) { + return new _BSONRegExp(doc.$regularExpression.pattern, _BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new BSONError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(doc)}`); + } + inspect(depth, options, inspect) { + const stylize = getStylizeFunction(options) ?? ((v4) => v4); + inspect ??= defaultInspect; + const pattern = stylize(inspect(this.pattern), "regexp"); + const flags = stylize(inspect(this.options), "regexp"); + return `new BSONRegExp(${pattern}, ${flags})`; + } + }; + var BSONSymbol = class _BSONSymbol extends BSONValue { + get _bsontype() { + return "BSONSymbol"; + } + constructor(value) { + super(); + this.value = value; + } + valueOf() { + return this.value; + } + toString() { + return this.value; + } + toJSON() { + return this.value; + } + toExtendedJSON() { + return { $symbol: this.value }; + } + static fromExtendedJSON(doc) { + return new _BSONSymbol(doc.$symbol); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + return `new BSONSymbol(${inspect(this.value, options)})`; + } + }; + var LongWithoutOverridesClass = Long; + var Timestamp = class _Timestamp extends LongWithoutOverridesClass { + get _bsontype() { + return "Timestamp"; + } + get i() { + return this.low >>> 0; + } + get t() { + return this.high >>> 0; + } + constructor(low) { + if (low == null) { + super(0, 0, true); + } else if (typeof low === "bigint") { + super(low, true); + } else if (Long.isLong(low)) { + super(low.low, low.high, true); + } else if (typeof low === "object" && "t" in low && "i" in low) { + if (typeof low.t !== "number" && (typeof low.t !== "object" || low.t._bsontype !== "Int32")) { + throw new BSONError("Timestamp constructed from { t, i } must provide t as a number"); + } + if (typeof low.i !== "number" && (typeof low.i !== "object" || low.i._bsontype !== "Int32")) { + throw new BSONError("Timestamp constructed from { t, i } must provide i as a number"); + } + const t4 = Number(low.t); + const i4 = Number(low.i); + if (t4 < 0 || Number.isNaN(t4)) { + throw new BSONError("Timestamp constructed from { t, i } must provide a positive t"); + } + if (i4 < 0 || Number.isNaN(i4)) { + throw new BSONError("Timestamp constructed from { t, i } must provide a positive i"); + } + if (t4 > 4294967295) { + throw new BSONError("Timestamp constructed from { t, i } must provide t equal or less than uint32 max"); + } + if (i4 > 4294967295) { + throw new BSONError("Timestamp constructed from { t, i } must provide i equal or less than uint32 max"); + } + super(i4, t4, true); + } else { + throw new BSONError("A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }"); + } + } + toJSON() { + return { + $timestamp: this.toString() + }; + } + static fromInt(value) { + return new _Timestamp(Long.fromInt(value, true)); + } + static fromNumber(value) { + return new _Timestamp(Long.fromNumber(value, true)); + } + static fromBits(lowBits, highBits) { + return new _Timestamp({ i: lowBits, t: highBits }); + } + static fromString(str, optRadix) { + return new _Timestamp(Long.fromString(str, true, optRadix)); + } + toExtendedJSON() { + return { $timestamp: { t: this.t, i: this.i } }; + } + static fromExtendedJSON(doc) { + const i4 = Long.isLong(doc.$timestamp.i) ? doc.$timestamp.i.getLowBitsUnsigned() : doc.$timestamp.i; + const t4 = Long.isLong(doc.$timestamp.t) ? doc.$timestamp.t.getLowBitsUnsigned() : doc.$timestamp.t; + return new _Timestamp({ t: t4, i: i4 }); + } + inspect(depth, options, inspect) { + inspect ??= defaultInspect; + const t4 = inspect(this.t, options); + const i4 = inspect(this.i, options); + return `new Timestamp({ t: ${t4}, i: ${i4} })`; + } + }; + Timestamp.MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + var JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX); + var JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN); + function internalDeserialize(buffer2, options, isArray) { + options = options == null ? {} : options; + const index = options && options.index ? options.index : 0; + const size = NumberUtils.getInt32LE(buffer2, index); + if (size < 5) { + throw new BSONError(`bson size must be >= 5, is ${size}`); + } + if (options.allowObjectSmallerThanBufferSize && buffer2.length < size) { + throw new BSONError(`buffer length ${buffer2.length} must be >= bson size ${size}`); + } + if (!options.allowObjectSmallerThanBufferSize && buffer2.length !== size) { + throw new BSONError(`buffer length ${buffer2.length} must === bson size ${size}`); + } + if (size + index > buffer2.byteLength) { + throw new BSONError(`(bson size ${size} + options.index ${index} must be <= buffer length ${buffer2.byteLength})`); + } + if (buffer2[index + size - 1] !== 0) { + throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + return deserializeObject(buffer2, index, options, isArray); + } + var allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; + function deserializeObject(buffer2, index, options, isArray = false) { + const fieldsAsRaw = options["fieldsAsRaw"] == null ? null : options["fieldsAsRaw"]; + const raw = options["raw"] == null ? false : options["raw"]; + const bsonRegExp = typeof options["bsonRegExp"] === "boolean" ? options["bsonRegExp"] : false; + const promoteBuffers = options.promoteBuffers ?? false; + const promoteLongs = options.promoteLongs ?? true; + const promoteValues = options.promoteValues ?? true; + const useBigInt64 = options.useBigInt64 ?? false; + if (useBigInt64 && !promoteValues) { + throw new BSONError("Must either request bigint or Long for int64 deserialization"); + } + if (useBigInt64 && !promoteLongs) { + throw new BSONError("Must either request bigint or Long for int64 deserialization"); + } + const validation = options.validation == null ? { utf8: true } : options.validation; + let globalUTFValidation = true; + let validationSetting; + let utf8KeysSet; + const utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === "boolean") { + validationSetting = utf8ValidatedKeys; + } else { + globalUTFValidation = false; + const utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function(key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError("UTF-8 validation setting cannot be empty"); + } + if (typeof utf8ValidationValues[0] !== "boolean") { + throw new BSONError("Invalid UTF-8 validation option, must specify boolean values"); + } + validationSetting = utf8ValidationValues[0]; + if (!utf8ValidationValues.every((item) => item === validationSetting)) { + throw new BSONError("Invalid UTF-8 validation option - keys must be all true or all false"); + } + } + if (!globalUTFValidation) { + utf8KeysSet = /* @__PURE__ */ new Set(); + for (const key of Object.keys(utf8ValidatedKeys)) { + utf8KeysSet.add(key); + } + } + const startIndex = index; + if (buffer2.length < 5) + throw new BSONError("corrupt bson message < 5 bytes long"); + const size = NumberUtils.getInt32LE(buffer2, index); + index += 4; + if (size < 5 || size > buffer2.length) + throw new BSONError("corrupt bson message"); + const object = isArray ? [] : {}; + let arrayIndex = 0; + let isPossibleDBRef = isArray ? false : null; + while (true) { + const elementType = buffer2[index++]; + if (elementType === 0) + break; + let i4 = index; + while (buffer2[i4] !== 0 && i4 < buffer2.length) { + i4++; + } + if (i4 >= buffer2.byteLength) + throw new BSONError("Bad BSON Document: illegal CString"); + const name = isArray ? arrayIndex++ : ByteUtils.toUTF8(buffer2, index, i4, false); + let shouldValidateKey = true; + if (globalUTFValidation || utf8KeysSet?.has(name)) { + shouldValidateKey = validationSetting; + } else { + shouldValidateKey = !validationSetting; + } + if (isPossibleDBRef !== false && name[0] === "$") { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + let value; + index = i4 + 1; + if (elementType === BSON_DATA_STRING) { + const stringSize = NumberUtils.getInt32LE(buffer2, index); + index += 4; + if (stringSize <= 0 || stringSize > buffer2.length - index || buffer2[index + stringSize - 1] !== 0) { + throw new BSONError("bad string length in bson"); + } + value = ByteUtils.toUTF8(buffer2, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } else if (elementType === BSON_DATA_OID) { + const oid = ByteUtils.allocateUnsafe(12); + for (let i5 = 0; i5 < 12; i5++) + oid[i5] = buffer2[index + i5]; + value = new ObjectId2(oid); + index = index + 12; + } else if (elementType === BSON_DATA_INT && promoteValues === false) { + value = new Int32(NumberUtils.getInt32LE(buffer2, index)); + index += 4; + } else if (elementType === BSON_DATA_INT) { + value = NumberUtils.getInt32LE(buffer2, index); + index += 4; + } else if (elementType === BSON_DATA_NUMBER) { + value = NumberUtils.getFloat64LE(buffer2, index); + index += 8; + if (promoteValues === false) + value = new Double(value); + } else if (elementType === BSON_DATA_DATE) { + const lowBits = NumberUtils.getInt32LE(buffer2, index); + const highBits = NumberUtils.getInt32LE(buffer2, index + 4); + index += 8; + value = new Date(new Long(lowBits, highBits).toNumber()); + } else if (elementType === BSON_DATA_BOOLEAN) { + if (buffer2[index] !== 0 && buffer2[index] !== 1) + throw new BSONError("illegal boolean type value"); + value = buffer2[index++] === 1; + } else if (elementType === BSON_DATA_OBJECT) { + const _index = index; + const objectSize = NumberUtils.getInt32LE(buffer2, index); + if (objectSize <= 0 || objectSize > buffer2.length - index) + throw new BSONError("bad embedded document length in bson"); + if (raw) { + value = buffer2.subarray(index, index + objectSize); + } else { + let objectOptions = options; + if (!globalUTFValidation) { + objectOptions = { ...options, validation: { utf8: shouldValidateKey } }; + } + value = deserializeObject(buffer2, _index, objectOptions, false); + } + index = index + objectSize; + } else if (elementType === BSON_DATA_ARRAY) { + const _index = index; + const objectSize = NumberUtils.getInt32LE(buffer2, index); + let arrayOptions = options; + const stopIndex = index + objectSize; + if (fieldsAsRaw && fieldsAsRaw[name]) { + arrayOptions = { ...options, raw: true }; + } + if (!globalUTFValidation) { + arrayOptions = { ...arrayOptions, validation: { utf8: shouldValidateKey } }; + } + value = deserializeObject(buffer2, _index, arrayOptions, true); + index = index + objectSize; + if (buffer2[index - 1] !== 0) + throw new BSONError("invalid array terminator byte"); + if (index !== stopIndex) + throw new BSONError("corrupted array bson"); + } else if (elementType === BSON_DATA_UNDEFINED) { + value = void 0; + } else if (elementType === BSON_DATA_NULL) { + value = null; + } else if (elementType === BSON_DATA_LONG) { + if (useBigInt64) { + value = NumberUtils.getBigInt64LE(buffer2, index); + index += 8; + } else { + const lowBits = NumberUtils.getInt32LE(buffer2, index); + const highBits = NumberUtils.getInt32LE(buffer2, index + 4); + index += 8; + const long = new Long(lowBits, highBits); + if (promoteLongs && promoteValues === true) { + value = long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) ? long.toNumber() : long; + } else { + value = long; + } + } + } else if (elementType === BSON_DATA_DECIMAL128) { + const bytes = ByteUtils.allocateUnsafe(16); + for (let i5 = 0; i5 < 16; i5++) + bytes[i5] = buffer2[index + i5]; + index = index + 16; + value = new Decimal128(bytes); + } else if (elementType === BSON_DATA_BINARY) { + let binarySize = NumberUtils.getInt32LE(buffer2, index); + index += 4; + const totalBinarySize = binarySize; + const subType = buffer2[index++]; + if (binarySize < 0) + throw new BSONError("Negative binary type element size found"); + if (binarySize > buffer2.byteLength) + throw new BSONError("Binary type size larger than document size"); + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = NumberUtils.getInt32LE(buffer2, index); + index += 4; + if (binarySize < 0) + throw new BSONError("Negative binary type element size found for subtype 0x02"); + if (binarySize > totalBinarySize - 4) + throw new BSONError("Binary type with subtype 0x02 contains too long binary size"); + if (binarySize < totalBinarySize - 4) + throw new BSONError("Binary type with subtype 0x02 contains too short binary size"); + } + if (promoteBuffers && promoteValues) { + value = ByteUtils.toLocalBufferType(buffer2.subarray(index, index + binarySize)); + } else { + value = new Binary(buffer2.subarray(index, index + binarySize), subType); + if (subType === BSON_BINARY_SUBTYPE_UUID_NEW && UUID.isValid(value)) { + value = value.toUUID(); + } + } + index = index + binarySize; + } else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) { + i4 = index; + while (buffer2[i4] !== 0 && i4 < buffer2.length) { + i4++; + } + if (i4 >= buffer2.length) + throw new BSONError("Bad BSON Document: illegal CString"); + const source = ByteUtils.toUTF8(buffer2, index, i4, false); + index = i4 + 1; + i4 = index; + while (buffer2[i4] !== 0 && i4 < buffer2.length) { + i4++; + } + if (i4 >= buffer2.length) + throw new BSONError("Bad BSON Document: illegal CString"); + const regExpOptions = ByteUtils.toUTF8(buffer2, index, i4, false); + index = i4 + 1; + const optionsArray = new Array(regExpOptions.length); + for (i4 = 0; i4 < regExpOptions.length; i4++) { + switch (regExpOptions[i4]) { + case "m": + optionsArray[i4] = "m"; + break; + case "s": + optionsArray[i4] = "g"; + break; + case "i": + optionsArray[i4] = "i"; + break; + } + } + value = new RegExp(source, optionsArray.join("")); + } else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) { + i4 = index; + while (buffer2[i4] !== 0 && i4 < buffer2.length) { + i4++; + } + if (i4 >= buffer2.length) + throw new BSONError("Bad BSON Document: illegal CString"); + const source = ByteUtils.toUTF8(buffer2, index, i4, false); + index = i4 + 1; + i4 = index; + while (buffer2[i4] !== 0 && i4 < buffer2.length) { + i4++; + } + if (i4 >= buffer2.length) + throw new BSONError("Bad BSON Document: illegal CString"); + const regExpOptions = ByteUtils.toUTF8(buffer2, index, i4, false); + index = i4 + 1; + value = new BSONRegExp(source, regExpOptions); + } else if (elementType === BSON_DATA_SYMBOL) { + const stringSize = NumberUtils.getInt32LE(buffer2, index); + index += 4; + if (stringSize <= 0 || stringSize > buffer2.length - index || buffer2[index + stringSize - 1] !== 0) { + throw new BSONError("bad string length in bson"); + } + const symbol = ByteUtils.toUTF8(buffer2, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } else if (elementType === BSON_DATA_TIMESTAMP) { + value = new Timestamp({ + i: NumberUtils.getUint32LE(buffer2, index), + t: NumberUtils.getUint32LE(buffer2, index + 4) + }); + index += 8; + } else if (elementType === BSON_DATA_MIN_KEY) { + value = new MinKey(); + } else if (elementType === BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } else if (elementType === BSON_DATA_CODE) { + const stringSize = NumberUtils.getInt32LE(buffer2, index); + index += 4; + if (stringSize <= 0 || stringSize > buffer2.length - index || buffer2[index + stringSize - 1] !== 0) { + throw new BSONError("bad string length in bson"); + } + const functionString = ByteUtils.toUTF8(buffer2, index, index + stringSize - 1, shouldValidateKey); + value = new Code(functionString); + index = index + stringSize; + } else if (elementType === BSON_DATA_CODE_W_SCOPE) { + const totalSize = NumberUtils.getInt32LE(buffer2, index); + index += 4; + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError("code_w_scope total size shorter minimum expected length"); + } + const stringSize = NumberUtils.getInt32LE(buffer2, index); + index += 4; + if (stringSize <= 0 || stringSize > buffer2.length - index || buffer2[index + stringSize - 1] !== 0) { + throw new BSONError("bad string length in bson"); + } + const functionString = ByteUtils.toUTF8(buffer2, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + const _index = index; + const objectSize = NumberUtils.getInt32LE(buffer2, index); + const scopeObject = deserializeObject(buffer2, _index, options, false); + index = index + objectSize; + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError("code_w_scope total size is too short, truncating scope"); + } + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError("code_w_scope total size is too long, clips outer document"); + } + value = new Code(functionString, scopeObject); + } else if (elementType === BSON_DATA_DBPOINTER) { + const stringSize = NumberUtils.getInt32LE(buffer2, index); + index += 4; + if (stringSize <= 0 || stringSize > buffer2.length - index || buffer2[index + stringSize - 1] !== 0) + throw new BSONError("bad string length in bson"); + const namespace = ByteUtils.toUTF8(buffer2, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + const oidBuffer = ByteUtils.allocateUnsafe(12); + for (let i5 = 0; i5 < 12; i5++) + oidBuffer[i5] = buffer2[index + i5]; + const oid = new ObjectId2(oidBuffer); + index = index + 12; + value = new DBRef(namespace, oid); + } else { + throw new BSONError(`Detected unknown BSON type ${elementType.toString(16)} for fieldname "${name}"`); + } + if (name === "__proto__") { + Object.defineProperty(object, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } else { + object[name] = value; + } + } + if (size !== index - startIndex) { + if (isArray) + throw new BSONError("corrupt array bson"); + throw new BSONError("corrupt object bson"); + } + if (!isPossibleDBRef) + return object; + if (isDBRefLike(object)) { + const copy = Object.assign({}, object); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(object.$ref, object.$id, object.$db, copy); + } + return object; + } + var regexp = /\x00/; + var ignoreKeys = /* @__PURE__ */ new Set(["$db", "$ref", "$id", "$clusterTime"]); + function serializeString(buffer2, key, value, index) { + buffer2[index++] = BSON_DATA_STRING; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes + 1; + buffer2[index - 1] = 0; + const size = ByteUtils.encodeUTF8Into(buffer2, value, index + 4); + NumberUtils.setInt32LE(buffer2, index, size + 1); + index = index + 4 + size; + buffer2[index++] = 0; + return index; + } + function serializeNumber(buffer2, key, value, index) { + const isNegativeZero = Object.is(value, -0); + const type = !isNegativeZero && Number.isSafeInteger(value) && value <= BSON_INT32_MAX && value >= BSON_INT32_MIN ? BSON_DATA_INT : BSON_DATA_NUMBER; + buffer2[index++] = type; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + if (type === BSON_DATA_INT) { + index += NumberUtils.setInt32LE(buffer2, index, value); + } else { + index += NumberUtils.setFloat64LE(buffer2, index, value); + } + return index; + } + function serializeBigInt(buffer2, key, value, index) { + buffer2[index++] = BSON_DATA_LONG; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index += numberOfWrittenBytes; + buffer2[index++] = 0; + index += NumberUtils.setBigInt64LE(buffer2, index, value); + return index; + } + function serializeNull(buffer2, key, _, index) { + buffer2[index++] = BSON_DATA_NULL; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + return index; + } + function serializeBoolean(buffer2, key, value, index) { + buffer2[index++] = BSON_DATA_BOOLEAN; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + buffer2[index++] = value ? 1 : 0; + return index; + } + function serializeDate(buffer2, key, value, index) { + buffer2[index++] = BSON_DATA_DATE; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + const dateInMilis = Long.fromNumber(value.getTime()); + const lowBits = dateInMilis.getLowBits(); + const highBits = dateInMilis.getHighBits(); + index += NumberUtils.setInt32LE(buffer2, index, lowBits); + index += NumberUtils.setInt32LE(buffer2, index, highBits); + return index; + } + function serializeRegExp(buffer2, key, value, index) { + buffer2[index++] = BSON_DATA_REGEXP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw new BSONError("value " + value.source + " must not contain null bytes"); + } + index = index + ByteUtils.encodeUTF8Into(buffer2, value.source, index); + buffer2[index++] = 0; + if (value.ignoreCase) + buffer2[index++] = 105; + if (value.global) + buffer2[index++] = 115; + if (value.multiline) + buffer2[index++] = 109; + buffer2[index++] = 0; + return index; + } + function serializeBSONRegExp(buffer2, key, value, index) { + buffer2[index++] = BSON_DATA_REGEXP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + if (value.pattern.match(regexp) != null) { + throw new BSONError("pattern " + value.pattern + " must not contain null bytes"); + } + index = index + ByteUtils.encodeUTF8Into(buffer2, value.pattern, index); + buffer2[index++] = 0; + const sortedOptions = value.options.split("").sort().join(""); + index = index + ByteUtils.encodeUTF8Into(buffer2, sortedOptions, index); + buffer2[index++] = 0; + return index; + } + function serializeMinMax(buffer2, key, value, index) { + if (value === null) { + buffer2[index++] = BSON_DATA_NULL; + } else if (value._bsontype === "MinKey") { + buffer2[index++] = BSON_DATA_MIN_KEY; + } else { + buffer2[index++] = BSON_DATA_MAX_KEY; + } + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + return index; + } + function serializeObjectId(buffer2, key, value, index) { + buffer2[index++] = BSON_DATA_OID; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + index += value.serializeInto(buffer2, index); + return index; + } + function serializeBuffer(buffer2, key, value, index) { + buffer2[index++] = BSON_DATA_BINARY; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + const size = value.length; + index += NumberUtils.setInt32LE(buffer2, index, size); + buffer2[index++] = BSON_BINARY_SUBTYPE_DEFAULT; + if (size <= 16) { + for (let i4 = 0; i4 < size; i4++) + buffer2[index + i4] = value[i4]; + } else { + buffer2.set(value, index); + } + index = index + size; + return index; + } + function serializeObject(buffer2, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, path) { + if (path.has(value)) { + throw new BSONError("Cannot convert circular structure to BSON"); + } + path.add(value); + buffer2[index++] = Array.isArray(value) ? BSON_DATA_ARRAY : BSON_DATA_OBJECT; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + const endIndex = serializeInto(buffer2, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path); + path.delete(value); + return endIndex; + } + function serializeDecimal128(buffer2, key, value, index) { + buffer2[index++] = BSON_DATA_DECIMAL128; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + for (let i4 = 0; i4 < 16; i4++) + buffer2[index + i4] = value.bytes[i4]; + return index + 16; + } + function serializeLong(buffer2, key, value, index) { + buffer2[index++] = value._bsontype === "Long" ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + const lowBits = value.getLowBits(); + const highBits = value.getHighBits(); + index += NumberUtils.setInt32LE(buffer2, index, lowBits); + index += NumberUtils.setInt32LE(buffer2, index, highBits); + return index; + } + function serializeInt32(buffer2, key, value, index) { + value = value.valueOf(); + buffer2[index++] = BSON_DATA_INT; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + index += NumberUtils.setInt32LE(buffer2, index, value); + return index; + } + function serializeDouble(buffer2, key, value, index) { + buffer2[index++] = BSON_DATA_NUMBER; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + index += NumberUtils.setFloat64LE(buffer2, index, value.value); + return index; + } + function serializeFunction(buffer2, key, value, index) { + buffer2[index++] = BSON_DATA_CODE; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + const functionString = value.toString(); + const size = ByteUtils.encodeUTF8Into(buffer2, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer2, index, size); + index = index + 4 + size - 1; + buffer2[index++] = 0; + return index; + } + function serializeCode(buffer2, key, value, index, checkKeys = false, depth = 0, serializeFunctions = false, ignoreUndefined = true, path) { + if (value.scope && typeof value.scope === "object") { + buffer2[index++] = BSON_DATA_CODE_W_SCOPE; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + let startIndex = index; + const functionString = value.code; + index = index + 4; + const codeSize = ByteUtils.encodeUTF8Into(buffer2, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer2, index, codeSize); + buffer2[index + 4 + codeSize - 1] = 0; + index = index + codeSize + 4; + const endIndex = serializeInto(buffer2, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path); + index = endIndex - 1; + const totalSize = endIndex - startIndex; + startIndex += NumberUtils.setInt32LE(buffer2, startIndex, totalSize); + buffer2[index++] = 0; + } else { + buffer2[index++] = BSON_DATA_CODE; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + const functionString = value.code.toString(); + const size = ByteUtils.encodeUTF8Into(buffer2, functionString, index + 4) + 1; + NumberUtils.setInt32LE(buffer2, index, size); + index = index + 4 + size - 1; + buffer2[index++] = 0; + } + return index; + } + function serializeBinary(buffer2, key, value, index) { + buffer2[index++] = BSON_DATA_BINARY; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + const data2 = value.buffer; + let size = value.position; + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + index += NumberUtils.setInt32LE(buffer2, index, size); + buffer2[index++] = value.sub_type; + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + index += NumberUtils.setInt32LE(buffer2, index, size); + } + if (value.sub_type === Binary.SUBTYPE_VECTOR) { + validateBinaryVector(value); + } + if (size <= 16) { + for (let i4 = 0; i4 < size; i4++) + buffer2[index + i4] = data2[i4]; + } else { + buffer2.set(data2, index); + } + index = index + value.position; + return index; + } + function serializeSymbol(buffer2, key, value, index) { + buffer2[index++] = BSON_DATA_SYMBOL; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + const size = ByteUtils.encodeUTF8Into(buffer2, value.value, index + 4) + 1; + NumberUtils.setInt32LE(buffer2, index, size); + index = index + 4 + size - 1; + buffer2[index++] = 0; + return index; + } + function serializeDBRef(buffer2, key, value, index, depth, serializeFunctions, path) { + buffer2[index++] = BSON_DATA_OBJECT; + const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer2, key, index); + index = index + numberOfWrittenBytes; + buffer2[index++] = 0; + let startIndex = index; + let output = { + $ref: value.collection || value.namespace, + $id: value.oid + }; + if (value.db != null) { + output.$db = value.db; + } + output = Object.assign(output, value.fields); + const endIndex = serializeInto(buffer2, output, false, index, depth + 1, serializeFunctions, true, path); + const size = endIndex - startIndex; + startIndex += NumberUtils.setInt32LE(buffer2, index, size); + return endIndex; + } + function serializeInto(buffer2, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) { + if (path == null) { + if (object == null) { + buffer2[0] = 5; + buffer2[1] = 0; + buffer2[2] = 0; + buffer2[3] = 0; + buffer2[4] = 0; + return 5; + } + if (Array.isArray(object)) { + throw new BSONError("serialize does not support an array as the root input"); + } + if (typeof object !== "object") { + throw new BSONError("serialize does not support non-object as the root input"); + } else if ("_bsontype" in object && typeof object._bsontype === "string") { + throw new BSONError(`BSON types cannot be serialized as a document`); + } else if (isDate(object) || isRegExp(object) || isUint8Array(object) || isAnyArrayBuffer(object)) { + throw new BSONError(`date, regexp, typedarray, and arraybuffer cannot be BSON documents`); + } + path = /* @__PURE__ */ new Set(); + } + path.add(object); + let index = startingIndex + 4; + if (Array.isArray(object)) { + for (let i4 = 0; i4 < object.length; i4++) { + const key = `${i4}`; + let value = object[i4]; + if (typeof value?.toBSON === "function") { + value = value.toBSON(); + } + const type = typeof value; + if (value === void 0) { + index = serializeNull(buffer2, key, value, index); + } else if (value === null) { + index = serializeNull(buffer2, key, value, index); + } else if (type === "string") { + index = serializeString(buffer2, key, value, index); + } else if (type === "number") { + index = serializeNumber(buffer2, key, value, index); + } else if (type === "bigint") { + index = serializeBigInt(buffer2, key, value, index); + } else if (type === "boolean") { + index = serializeBoolean(buffer2, key, value, index); + } else if (type === "object" && value._bsontype == null) { + if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer2, key, value, index); + } else if (value instanceof Uint8Array || isUint8Array(value)) { + index = serializeBuffer(buffer2, key, value, index); + } else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer2, key, value, index); + } else { + index = serializeObject(buffer2, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, path); + } + } else if (type === "object") { + if (value[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } else if (value._bsontype === "ObjectId") { + index = serializeObjectId(buffer2, key, value, index); + } else if (value._bsontype === "Decimal128") { + index = serializeDecimal128(buffer2, key, value, index); + } else if (value._bsontype === "Long" || value._bsontype === "Timestamp") { + index = serializeLong(buffer2, key, value, index); + } else if (value._bsontype === "Double") { + index = serializeDouble(buffer2, key, value, index); + } else if (value._bsontype === "Code") { + index = serializeCode(buffer2, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, path); + } else if (value._bsontype === "Binary") { + index = serializeBinary(buffer2, key, value, index); + } else if (value._bsontype === "BSONSymbol") { + index = serializeSymbol(buffer2, key, value, index); + } else if (value._bsontype === "DBRef") { + index = serializeDBRef(buffer2, key, value, index, depth, serializeFunctions, path); + } else if (value._bsontype === "BSONRegExp") { + index = serializeBSONRegExp(buffer2, key, value, index); + } else if (value._bsontype === "Int32") { + index = serializeInt32(buffer2, key, value, index); + } else if (value._bsontype === "MinKey" || value._bsontype === "MaxKey") { + index = serializeMinMax(buffer2, key, value, index); + } else if (typeof value._bsontype !== "undefined") { + throw new BSONError(`Unrecognized or invalid _bsontype: ${String(value._bsontype)}`); + } + } else if (type === "function" && serializeFunctions) { + index = serializeFunction(buffer2, key, value, index); + } + } + } else if (object instanceof Map || isMap(object)) { + const iterator = object.entries(); + let done = false; + while (!done) { + const entry = iterator.next(); + done = !!entry.done; + if (done) + continue; + const key = entry.value ? entry.value[0] : void 0; + let value = entry.value ? entry.value[1] : void 0; + if (typeof value?.toBSON === "function") { + value = value.toBSON(); + } + const type = typeof value; + if (typeof key === "string" && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + throw new BSONError("key " + key + " must not contain null bytes"); + } + if (checkKeys) { + if ("$" === key[0]) { + throw new BSONError("key " + key + " must not start with '$'"); + } else if (key.includes(".")) { + throw new BSONError("key " + key + " must not contain '.'"); + } + } + } + if (value === void 0) { + if (ignoreUndefined === false) + index = serializeNull(buffer2, key, value, index); + } else if (value === null) { + index = serializeNull(buffer2, key, value, index); + } else if (type === "string") { + index = serializeString(buffer2, key, value, index); + } else if (type === "number") { + index = serializeNumber(buffer2, key, value, index); + } else if (type === "bigint") { + index = serializeBigInt(buffer2, key, value, index); + } else if (type === "boolean") { + index = serializeBoolean(buffer2, key, value, index); + } else if (type === "object" && value._bsontype == null) { + if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer2, key, value, index); + } else if (value instanceof Uint8Array || isUint8Array(value)) { + index = serializeBuffer(buffer2, key, value, index); + } else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer2, key, value, index); + } else { + index = serializeObject(buffer2, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, path); + } + } else if (type === "object") { + if (value[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } else if (value._bsontype === "ObjectId") { + index = serializeObjectId(buffer2, key, value, index); + } else if (value._bsontype === "Decimal128") { + index = serializeDecimal128(buffer2, key, value, index); + } else if (value._bsontype === "Long" || value._bsontype === "Timestamp") { + index = serializeLong(buffer2, key, value, index); + } else if (value._bsontype === "Double") { + index = serializeDouble(buffer2, key, value, index); + } else if (value._bsontype === "Code") { + index = serializeCode(buffer2, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, path); + } else if (value._bsontype === "Binary") { + index = serializeBinary(buffer2, key, value, index); + } else if (value._bsontype === "BSONSymbol") { + index = serializeSymbol(buffer2, key, value, index); + } else if (value._bsontype === "DBRef") { + index = serializeDBRef(buffer2, key, value, index, depth, serializeFunctions, path); + } else if (value._bsontype === "BSONRegExp") { + index = serializeBSONRegExp(buffer2, key, value, index); + } else if (value._bsontype === "Int32") { + index = serializeInt32(buffer2, key, value, index); + } else if (value._bsontype === "MinKey" || value._bsontype === "MaxKey") { + index = serializeMinMax(buffer2, key, value, index); + } else if (typeof value._bsontype !== "undefined") { + throw new BSONError(`Unrecognized or invalid _bsontype: ${String(value._bsontype)}`); + } + } else if (type === "function" && serializeFunctions) { + index = serializeFunction(buffer2, key, value, index); + } + } + } else { + if (typeof object?.toBSON === "function") { + object = object.toBSON(); + if (object != null && typeof object !== "object") { + throw new BSONError("toBSON function did not return an object"); + } + } + for (const key of Object.keys(object)) { + let value = object[key]; + if (typeof value?.toBSON === "function") { + value = value.toBSON(); + } + const type = typeof value; + if (typeof key === "string" && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + throw new BSONError("key " + key + " must not contain null bytes"); + } + if (checkKeys) { + if ("$" === key[0]) { + throw new BSONError("key " + key + " must not start with '$'"); + } else if (key.includes(".")) { + throw new BSONError("key " + key + " must not contain '.'"); + } + } + } + if (value === void 0) { + if (ignoreUndefined === false) + index = serializeNull(buffer2, key, value, index); + } else if (value === null) { + index = serializeNull(buffer2, key, value, index); + } else if (type === "string") { + index = serializeString(buffer2, key, value, index); + } else if (type === "number") { + index = serializeNumber(buffer2, key, value, index); + } else if (type === "bigint") { + index = serializeBigInt(buffer2, key, value, index); + } else if (type === "boolean") { + index = serializeBoolean(buffer2, key, value, index); + } else if (type === "object" && value._bsontype == null) { + if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer2, key, value, index); + } else if (value instanceof Uint8Array || isUint8Array(value)) { + index = serializeBuffer(buffer2, key, value, index); + } else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer2, key, value, index); + } else { + index = serializeObject(buffer2, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, path); + } + } else if (type === "object") { + if (value[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } else if (value._bsontype === "ObjectId") { + index = serializeObjectId(buffer2, key, value, index); + } else if (value._bsontype === "Decimal128") { + index = serializeDecimal128(buffer2, key, value, index); + } else if (value._bsontype === "Long" || value._bsontype === "Timestamp") { + index = serializeLong(buffer2, key, value, index); + } else if (value._bsontype === "Double") { + index = serializeDouble(buffer2, key, value, index); + } else if (value._bsontype === "Code") { + index = serializeCode(buffer2, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, path); + } else if (value._bsontype === "Binary") { + index = serializeBinary(buffer2, key, value, index); + } else if (value._bsontype === "BSONSymbol") { + index = serializeSymbol(buffer2, key, value, index); + } else if (value._bsontype === "DBRef") { + index = serializeDBRef(buffer2, key, value, index, depth, serializeFunctions, path); + } else if (value._bsontype === "BSONRegExp") { + index = serializeBSONRegExp(buffer2, key, value, index); + } else if (value._bsontype === "Int32") { + index = serializeInt32(buffer2, key, value, index); + } else if (value._bsontype === "MinKey" || value._bsontype === "MaxKey") { + index = serializeMinMax(buffer2, key, value, index); + } else if (typeof value._bsontype !== "undefined") { + throw new BSONError(`Unrecognized or invalid _bsontype: ${String(value._bsontype)}`); + } + } else if (type === "function" && serializeFunctions) { + index = serializeFunction(buffer2, key, value, index); + } + } + } + path.delete(object); + buffer2[index++] = 0; + const size = index - startingIndex; + startingIndex += NumberUtils.setInt32LE(buffer2, startingIndex, size); + return index; + } + function isBSONType(value) { + return value != null && typeof value === "object" && "_bsontype" in value && typeof value._bsontype === "string"; + } + var keysToCodecs = { + $oid: ObjectId2, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp + }; + function deserializeValue(value, options = {}) { + if (typeof value === "number") { + const in32BitRange = value <= BSON_INT32_MAX && value >= BSON_INT32_MIN; + const in64BitRange = value <= BSON_INT64_MAX && value >= BSON_INT64_MIN; + if (options.relaxed || options.legacy) { + return value; + } + if (Number.isInteger(value) && !Object.is(value, -0)) { + if (in32BitRange) { + return new Int32(value); + } + if (in64BitRange) { + if (options.useBigInt64) { + return BigInt(value); + } + return Long.fromNumber(value); + } + } + return new Double(value); + } + if (value == null || typeof value !== "object") + return value; + if (value.$undefined) + return null; + const keys = Object.keys(value).filter((k4) => k4.startsWith("$") && value[k4] != null); + for (let i4 = 0; i4 < keys.length; i4++) { + const c4 = keysToCodecs[keys[i4]]; + if (c4) + return c4.fromExtendedJSON(value, options); + } + if (value.$date != null) { + const d4 = value.$date; + const date2 = /* @__PURE__ */ new Date(); + if (options.legacy) { + if (typeof d4 === "number") + date2.setTime(d4); + else if (typeof d4 === "string") + date2.setTime(Date.parse(d4)); + else if (typeof d4 === "bigint") + date2.setTime(Number(d4)); + else + throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d4}`); + } else { + if (typeof d4 === "string") + date2.setTime(Date.parse(d4)); + else if (Long.isLong(d4)) + date2.setTime(d4.toNumber()); + else if (typeof d4 === "number" && options.relaxed) + date2.setTime(d4); + else if (typeof d4 === "bigint") + date2.setTime(Number(d4)); + else + throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d4}`); + } + return date2; + } + if (value.$code != null) { + const copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return Code.fromExtendedJSON(value); + } + if (isDBRefLike(value) || value.$dbPointer) { + const v4 = value.$ref ? value : value.$dbPointer; + if (v4 instanceof DBRef) + return v4; + const dollarKeys = Object.keys(v4).filter((k4) => k4.startsWith("$")); + let valid = true; + dollarKeys.forEach((k4) => { + if (["$ref", "$id", "$db"].indexOf(k4) === -1) + valid = false; + }); + if (valid) + return DBRef.fromExtendedJSON(v4); + } + return value; + } + function serializeArray(array, options) { + return array.map((v4, index) => { + options.seenObjects.push({ propertyName: `index ${index}`, obj: null }); + try { + return serializeValue(v4, options); + } finally { + options.seenObjects.pop(); + } + }); + } + function getISOString(date2) { + const isoStr = date2.toISOString(); + return date2.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + "Z"; + } + function serializeValue(value, options) { + if (value instanceof Map || isMap(value)) { + const obj = /* @__PURE__ */ Object.create(null); + for (const [k4, v4] of value) { + if (typeof k4 !== "string") { + throw new BSONError("Can only serialize maps with string keys"); + } + obj[k4] = v4; + } + return serializeValue(obj, options); + } + if ((typeof value === "object" || typeof value === "function") && value !== null) { + const index = options.seenObjects.findIndex((entry) => entry.obj === value); + if (index !== -1) { + const props = options.seenObjects.map((entry) => entry.propertyName); + const leadingPart = props.slice(0, index).map((prop) => `${prop} -> `).join(""); + const alreadySeen = props[index]; + const circularPart = " -> " + props.slice(index + 1, props.length - 1).map((prop) => `${prop} -> `).join(""); + const current = props[props.length - 1]; + const leadingSpace = " ".repeat(leadingPart.length + alreadySeen.length / 2); + const dashes = "-".repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new BSONError(`Converting circular structure to EJSON: + ${leadingPart}${alreadySeen}${circularPart}${current} + ${leadingSpace}\\${dashes}/`); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === void 0) + return null; + if (value instanceof Date || isDate(value)) { + const dateNum = value.getTime(), inRange = dateNum > -1 && dateNum < 2534023188e5; + if (options.legacy) { + return options.relaxed && inRange ? { $date: value.getTime() } : { $date: getISOString(value) }; + } + return options.relaxed && inRange ? { $date: getISOString(value) } : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === "number" && (!options.relaxed || !isFinite(value))) { + if (Number.isInteger(value) && !Object.is(value, -0)) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + return { $numberInt: value.toString() }; + } + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) { + return { $numberLong: value.toString() }; + } + } + return { $numberDouble: Object.is(value, -0) ? "-0.0" : value.toString() }; + } + if (typeof value === "bigint") { + if (!options.relaxed) { + return { $numberLong: BigInt.asIntN(64, value).toString() }; + } + return Number(BigInt.asIntN(64, value)); + } + if (value instanceof RegExp || isRegExp(value)) { + let flags = value.flags; + if (flags === void 0) { + const match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + const rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === "object") + return serializeDocument(value, options); + return value; + } + var BSON_TYPE_MAPPINGS = { + Binary: (o4) => new Binary(o4.value(), o4.sub_type), + Code: (o4) => new Code(o4.code, o4.scope), + DBRef: (o4) => new DBRef(o4.collection || o4.namespace, o4.oid, o4.db, o4.fields), + Decimal128: (o4) => new Decimal128(o4.bytes), + Double: (o4) => new Double(o4.value), + Int32: (o4) => new Int32(o4.value), + Long: (o4) => Long.fromBits(o4.low != null ? o4.low : o4.low_, o4.low != null ? o4.high : o4.high_, o4.low != null ? o4.unsigned : o4.unsigned_), + MaxKey: () => new MaxKey(), + MinKey: () => new MinKey(), + ObjectId: (o4) => new ObjectId2(o4), + BSONRegExp: (o4) => new BSONRegExp(o4.pattern, o4.options), + BSONSymbol: (o4) => new BSONSymbol(o4.value), + Timestamp: (o4) => Timestamp.fromBits(o4.low, o4.high) + }; + function serializeDocument(doc, options) { + if (doc == null || typeof doc !== "object") + throw new BSONError("not an object instance"); + const bsontype = doc._bsontype; + if (typeof bsontype === "undefined") { + const _doc = {}; + for (const name of Object.keys(doc)) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + const value = serializeValue(doc[name], options); + if (name === "__proto__") { + Object.defineProperty(_doc, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } else { + _doc[name] = value; + } + } finally { + options.seenObjects.pop(); + } + } + return _doc; + } else if (doc != null && typeof doc === "object" && typeof doc._bsontype === "string" && doc[BSON_VERSION_SYMBOL] !== BSON_MAJOR_VERSION) { + throw new BSONVersionError(); + } else if (isBSONType(doc)) { + let outDoc = doc; + if (typeof outDoc.toExtendedJSON !== "function") { + const mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONError("Unrecognized or invalid _bsontype: " + doc._bsontype); + } + outDoc = mapper(outDoc); + } + if (bsontype === "Code" && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } else if (bsontype === "DBRef" && outDoc.oid) { + outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } else { + throw new BSONError("_bsontype must be a string, but was: " + typeof bsontype); + } + } + function parse(text, options) { + const ejsonOptions = { + useBigInt64: options?.useBigInt64 ?? false, + relaxed: options?.relaxed ?? true, + legacy: options?.legacy ?? false + }; + return JSON.parse(text, (key, value) => { + if (key.indexOf("\0") !== -1) { + throw new BSONError(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(key)}`); + } + return deserializeValue(value, ejsonOptions); + }); + } + function stringify(value, replacer, space, options) { + if (space != null && typeof space === "object") { + options = space; + space = 0; + } + if (replacer != null && typeof replacer === "object" && !Array.isArray(replacer)) { + options = replacer; + replacer = void 0; + space = 0; + } + const serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: "(root)", obj: null }] + }); + const doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacer, space); + } + function EJSONserialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); + } + function EJSONdeserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); + } + var EJSON = /* @__PURE__ */ Object.create(null); + EJSON.parse = parse; + EJSON.stringify = stringify; + EJSON.serialize = EJSONserialize; + EJSON.deserialize = EJSONdeserialize; + Object.freeze(EJSON); + var BSONElementType = { + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: 255, + maxKey: 127 + }; + function getSize(source, offset) { + try { + return NumberUtils.getNonnegativeInt32LE(source, offset); + } catch (cause) { + throw new BSONOffsetError("BSON size cannot be negative", offset, { cause }); + } + } + function findNull(bytes, offset) { + let nullTerminatorOffset = offset; + for (; bytes[nullTerminatorOffset] !== 0; nullTerminatorOffset++) + ; + if (nullTerminatorOffset === bytes.length - 1) { + throw new BSONOffsetError("Null terminator not found", offset); + } + return nullTerminatorOffset; + } + function parseToElements(bytes, startOffset = 0) { + startOffset ??= 0; + if (bytes.length < 5) { + throw new BSONOffsetError(`Input must be at least 5 bytes, got ${bytes.length} bytes`, startOffset); + } + const documentSize = getSize(bytes, startOffset); + if (documentSize > bytes.length - startOffset) { + throw new BSONOffsetError(`Parsed documentSize (${documentSize} bytes) does not match input length (${bytes.length} bytes)`, startOffset); + } + if (bytes[startOffset + documentSize - 1] !== 0) { + throw new BSONOffsetError("BSON documents must end in 0x00", startOffset + documentSize); + } + const elements = []; + let offset = startOffset + 4; + while (offset <= documentSize + startOffset) { + const type = bytes[offset]; + offset += 1; + if (type === 0) { + if (offset - startOffset !== documentSize) { + throw new BSONOffsetError(`Invalid 0x00 type byte`, offset); + } + break; + } + const nameOffset = offset; + const nameLength = findNull(bytes, offset) - nameOffset; + offset += nameLength + 1; + let length; + if (type === BSONElementType.double || type === BSONElementType.long || type === BSONElementType.date || type === BSONElementType.timestamp) { + length = 8; + } else if (type === BSONElementType.int) { + length = 4; + } else if (type === BSONElementType.objectId) { + length = 12; + } else if (type === BSONElementType.decimal) { + length = 16; + } else if (type === BSONElementType.bool) { + length = 1; + } else if (type === BSONElementType.null || type === BSONElementType.undefined || type === BSONElementType.maxKey || type === BSONElementType.minKey) { + length = 0; + } else if (type === BSONElementType.regex) { + length = findNull(bytes, findNull(bytes, offset) + 1) + 1 - offset; + } else if (type === BSONElementType.object || type === BSONElementType.array || type === BSONElementType.javascriptWithScope) { + length = getSize(bytes, offset); + } else if (type === BSONElementType.string || type === BSONElementType.binData || type === BSONElementType.dbPointer || type === BSONElementType.javascript || type === BSONElementType.symbol) { + length = getSize(bytes, offset) + 4; + if (type === BSONElementType.binData) { + length += 1; + } + if (type === BSONElementType.dbPointer) { + length += 12; + } + } else { + throw new BSONOffsetError(`Invalid 0x${type.toString(16).padStart(2, "0")} type byte`, offset); + } + if (length > documentSize) { + throw new BSONOffsetError("value reports length larger than document", offset); + } + elements.push([type, nameOffset, nameLength, offset, length]); + offset += length; + } + return elements; + } + var onDemand = /* @__PURE__ */ Object.create(null); + onDemand.parseToElements = parseToElements; + onDemand.ByteUtils = ByteUtils; + onDemand.NumberUtils = NumberUtils; + Object.freeze(onDemand); + var MAXSIZE = 1024 * 1024 * 17; + var buffer = ByteUtils.allocate(MAXSIZE); + function setInternalBufferSize(size) { + if (buffer.length < size) { + buffer = ByteUtils.allocate(size); + } + } + function serialize(object, options = {}) { + const checkKeys = typeof options.checkKeys === "boolean" ? options.checkKeys : false; + const serializeFunctions = typeof options.serializeFunctions === "boolean" ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === "boolean" ? options.ignoreUndefined : true; + const minInternalBufferSize = typeof options.minInternalBufferSize === "number" ? options.minInternalBufferSize : MAXSIZE; + if (buffer.length < minInternalBufferSize) { + buffer = ByteUtils.allocate(minInternalBufferSize); + } + const serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, null); + const finishedBuffer = ByteUtils.allocateUnsafe(serializationIndex); + finishedBuffer.set(buffer.subarray(0, serializationIndex), 0); + return finishedBuffer; + } + function serializeWithBufferAndIndex(object, finalBuffer, options = {}) { + const checkKeys = typeof options.checkKeys === "boolean" ? options.checkKeys : false; + const serializeFunctions = typeof options.serializeFunctions === "boolean" ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === "boolean" ? options.ignoreUndefined : true; + const startIndex = typeof options.index === "number" ? options.index : 0; + const serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, null); + finalBuffer.set(buffer.subarray(0, serializationIndex), startIndex); + return startIndex + serializationIndex - 1; + } + function deserialize(buffer2, options = {}) { + return internalDeserialize(ByteUtils.toLocalBufferType(buffer2), options); + } + function calculateObjectSize(object, options = {}) { + options = options || {}; + const serializeFunctions = typeof options.serializeFunctions === "boolean" ? options.serializeFunctions : false; + const ignoreUndefined = typeof options.ignoreUndefined === "boolean" ? options.ignoreUndefined : true; + return internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined); + } + function deserializeStream(data2, startIndex, numberOfDocuments, documents, docStartIndex, options) { + const internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + const bufferData = ByteUtils.toLocalBufferType(data2); + let index = startIndex; + for (let i4 = 0; i4 < numberOfDocuments; i4++) { + const size = NumberUtils.getInt32LE(bufferData, index); + internalOptions.index = index; + documents[docStartIndex + i4] = internalDeserialize(bufferData, internalOptions); + index = index + size; + } + return index; + } + var bson = /* @__PURE__ */ Object.freeze({ + __proto__: null, + BSONError, + BSONOffsetError, + BSONRegExp, + BSONRuntimeError, + BSONSymbol, + BSONType, + BSONValue, + BSONVersionError, + Binary, + Code, + DBRef, + Decimal128, + Double, + EJSON, + Int32, + Long, + MaxKey, + MinKey, + ObjectId: ObjectId2, + Timestamp, + UUID, + calculateObjectSize, + deserialize, + deserializeStream, + onDemand, + serialize, + serializeWithBufferAndIndex, + setInternalBufferSize + }); + exports2.BSON = bson; + exports2.BSONError = BSONError; + exports2.BSONOffsetError = BSONOffsetError; + exports2.BSONRegExp = BSONRegExp; + exports2.BSONRuntimeError = BSONRuntimeError; + exports2.BSONSymbol = BSONSymbol; + exports2.BSONType = BSONType; + exports2.BSONValue = BSONValue; + exports2.BSONVersionError = BSONVersionError; + exports2.Binary = Binary; + exports2.Code = Code; + exports2.DBRef = DBRef; + exports2.Decimal128 = Decimal128; + exports2.Double = Double; + exports2.EJSON = EJSON; + exports2.Int32 = Int32; + exports2.Long = Long; + exports2.MaxKey = MaxKey; + exports2.MinKey = MinKey; + exports2.ObjectId = ObjectId2; + exports2.Timestamp = Timestamp; + exports2.UUID = UUID; + exports2.calculateObjectSize = calculateObjectSize; + exports2.deserialize = deserialize; + exports2.deserializeStream = deserializeStream; + exports2.onDemand = onDemand; + exports2.serialize = serialize; + exports2.serializeWithBufferAndIndex = serializeWithBufferAndIndex; + exports2.setInternalBufferSize = setInternalBufferSize; + } +}); + +// node_modules/mongodb/lib/bson.js +var require_bson2 = __commonJS({ + "node_modules/mongodb/lib/bson.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.toUTF8 = exports2.getBigInt64LE = exports2.getFloat64LE = exports2.getInt32LE = exports2.UUID = exports2.Timestamp = exports2.serialize = exports2.ObjectId = exports2.MinKey = exports2.MaxKey = exports2.Long = exports2.Int32 = exports2.EJSON = exports2.Double = exports2.deserialize = exports2.Decimal128 = exports2.DBRef = exports2.Code = exports2.calculateObjectSize = exports2.BSONType = exports2.BSONSymbol = exports2.BSONRegExp = exports2.BSONError = exports2.BSON = exports2.Binary = void 0; + exports2.parseToElementsToArray = parseToElementsToArray; + exports2.pluckBSONSerializeOptions = pluckBSONSerializeOptions; + exports2.resolveBSONOptions = resolveBSONOptions; + exports2.parseUtf8ValidationOption = parseUtf8ValidationOption; + var bson_1 = require_bson(); + var bson_2 = require_bson(); + Object.defineProperty(exports2, "Binary", { enumerable: true, get: function() { + return bson_2.Binary; + } }); + Object.defineProperty(exports2, "BSON", { enumerable: true, get: function() { + return bson_2.BSON; + } }); + Object.defineProperty(exports2, "BSONError", { enumerable: true, get: function() { + return bson_2.BSONError; + } }); + Object.defineProperty(exports2, "BSONRegExp", { enumerable: true, get: function() { + return bson_2.BSONRegExp; + } }); + Object.defineProperty(exports2, "BSONSymbol", { enumerable: true, get: function() { + return bson_2.BSONSymbol; + } }); + Object.defineProperty(exports2, "BSONType", { enumerable: true, get: function() { + return bson_2.BSONType; + } }); + Object.defineProperty(exports2, "calculateObjectSize", { enumerable: true, get: function() { + return bson_2.calculateObjectSize; + } }); + Object.defineProperty(exports2, "Code", { enumerable: true, get: function() { + return bson_2.Code; + } }); + Object.defineProperty(exports2, "DBRef", { enumerable: true, get: function() { + return bson_2.DBRef; + } }); + Object.defineProperty(exports2, "Decimal128", { enumerable: true, get: function() { + return bson_2.Decimal128; + } }); + Object.defineProperty(exports2, "deserialize", { enumerable: true, get: function() { + return bson_2.deserialize; + } }); + Object.defineProperty(exports2, "Double", { enumerable: true, get: function() { + return bson_2.Double; + } }); + Object.defineProperty(exports2, "EJSON", { enumerable: true, get: function() { + return bson_2.EJSON; + } }); + Object.defineProperty(exports2, "Int32", { enumerable: true, get: function() { + return bson_2.Int32; + } }); + Object.defineProperty(exports2, "Long", { enumerable: true, get: function() { + return bson_2.Long; + } }); + Object.defineProperty(exports2, "MaxKey", { enumerable: true, get: function() { + return bson_2.MaxKey; + } }); + Object.defineProperty(exports2, "MinKey", { enumerable: true, get: function() { + return bson_2.MinKey; + } }); + Object.defineProperty(exports2, "ObjectId", { enumerable: true, get: function() { + return bson_2.ObjectId; + } }); + Object.defineProperty(exports2, "serialize", { enumerable: true, get: function() { + return bson_2.serialize; + } }); + Object.defineProperty(exports2, "Timestamp", { enumerable: true, get: function() { + return bson_2.Timestamp; + } }); + Object.defineProperty(exports2, "UUID", { enumerable: true, get: function() { + return bson_2.UUID; + } }); + function parseToElementsToArray(bytes, offset) { + const res = bson_1.BSON.onDemand.parseToElements(bytes, offset); + return Array.isArray(res) ? res : [...res]; + } + exports2.getInt32LE = bson_1.BSON.onDemand.NumberUtils.getInt32LE; + exports2.getFloat64LE = bson_1.BSON.onDemand.NumberUtils.getFloat64LE; + exports2.getBigInt64LE = bson_1.BSON.onDemand.NumberUtils.getBigInt64LE; + exports2.toUTF8 = bson_1.BSON.onDemand.ByteUtils.toUTF8; + function pluckBSONSerializeOptions(options) { + const { fieldsAsRaw, useBigInt64, promoteValues, promoteBuffers, promoteLongs, serializeFunctions, ignoreUndefined, bsonRegExp, raw, enableUtf8Validation } = options; + return { + fieldsAsRaw, + useBigInt64, + promoteValues, + promoteBuffers, + promoteLongs, + serializeFunctions, + ignoreUndefined, + bsonRegExp, + raw, + enableUtf8Validation + }; + } + function resolveBSONOptions(options, parent) { + const parentOptions = parent?.bsonOptions; + return { + raw: options?.raw ?? parentOptions?.raw ?? false, + useBigInt64: options?.useBigInt64 ?? parentOptions?.useBigInt64 ?? false, + promoteLongs: options?.promoteLongs ?? parentOptions?.promoteLongs ?? true, + promoteValues: options?.promoteValues ?? parentOptions?.promoteValues ?? true, + promoteBuffers: options?.promoteBuffers ?? parentOptions?.promoteBuffers ?? false, + ignoreUndefined: options?.ignoreUndefined ?? parentOptions?.ignoreUndefined ?? false, + bsonRegExp: options?.bsonRegExp ?? parentOptions?.bsonRegExp ?? false, + serializeFunctions: options?.serializeFunctions ?? parentOptions?.serializeFunctions ?? false, + fieldsAsRaw: options?.fieldsAsRaw ?? parentOptions?.fieldsAsRaw ?? {}, + enableUtf8Validation: options?.enableUtf8Validation ?? parentOptions?.enableUtf8Validation ?? true + }; + } + function parseUtf8ValidationOption(options) { + const enableUtf8Validation = options?.enableUtf8Validation; + if (enableUtf8Validation === false) { + return { utf8: false }; + } + return { utf8: { writeErrors: false } }; + } + } +}); + +// node_modules/mongodb/lib/error.js +var require_error = __commonJS({ + "node_modules/mongodb/lib/error.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MongoWriteConcernError = exports2.MongoServerSelectionError = exports2.MongoSystemError = exports2.MongoMissingDependencyError = exports2.MongoMissingCredentialsError = exports2.MongoCompatibilityError = exports2.MongoInvalidArgumentError = exports2.MongoParseError = exports2.MongoNetworkTimeoutError = exports2.MongoNetworkError = exports2.MongoClientClosedError = exports2.MongoTopologyClosedError = exports2.MongoCursorExhaustedError = exports2.MongoServerClosedError = exports2.MongoCursorInUseError = exports2.MongoOperationTimeoutError = exports2.MongoUnexpectedServerResponseError = exports2.MongoGridFSChunkError = exports2.MongoGridFSStreamError = exports2.MongoTailableCursorError = exports2.MongoChangeStreamError = exports2.MongoClientBulkWriteExecutionError = exports2.MongoClientBulkWriteCursorError = exports2.MongoClientBulkWriteError = exports2.MongoGCPError = exports2.MongoAzureError = exports2.MongoOIDCError = exports2.MongoAWSError = exports2.MongoKerberosError = exports2.MongoExpiredSessionError = exports2.MongoTransactionError = exports2.MongoNotConnectedError = exports2.MongoDecompressionError = exports2.MongoBatchReExecutionError = exports2.MongoStalePrimaryError = exports2.MongoRuntimeError = exports2.MongoAPIError = exports2.MongoDriverError = exports2.MongoServerError = exports2.MongoError = exports2.MongoErrorLabel = exports2.GET_MORE_RESUMABLE_CODES = exports2.MONGODB_ERROR_CODES = exports2.NODE_IS_RECOVERING_ERROR_MESSAGE = exports2.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE = exports2.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE = void 0; + exports2.needsRetryableWriteLabel = needsRetryableWriteLabel; + exports2.isRetryableWriteError = isRetryableWriteError; + exports2.isRetryableReadError = isRetryableReadError; + exports2.isNodeShuttingDownError = isNodeShuttingDownError; + exports2.isSDAMUnrecoverableError = isSDAMUnrecoverableError; + exports2.isNetworkTimeoutError = isNetworkTimeoutError; + exports2.isResumableError = isResumableError; + exports2.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE = new RegExp("not master", "i"); + exports2.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE = new RegExp("not master or secondary", "i"); + exports2.NODE_IS_RECOVERING_ERROR_MESSAGE = new RegExp("node is recovering", "i"); + exports2.MONGODB_ERROR_CODES = Object.freeze({ + HostUnreachable: 6, + HostNotFound: 7, + AuthenticationFailed: 18, + NetworkTimeout: 89, + ShutdownInProgress: 91, + PrimarySteppedDown: 189, + ExceededTimeLimit: 262, + SocketException: 9001, + NotWritablePrimary: 10107, + InterruptedAtShutdown: 11600, + InterruptedDueToReplStateChange: 11602, + NotPrimaryNoSecondaryOk: 13435, + NotPrimaryOrSecondary: 13436, + StaleShardVersion: 63, + StaleEpoch: 150, + StaleConfig: 13388, + RetryChangeStream: 234, + FailedToSatisfyReadPreference: 133, + CursorNotFound: 43, + LegacyNotPrimary: 10058, + // WriteConcernTimeout is WriteConcernFailed on pre-8.1 servers + WriteConcernTimeout: 64, + NamespaceNotFound: 26, + IllegalOperation: 20, + MaxTimeMSExpired: 50, + UnknownReplWriteConcern: 79, + UnsatisfiableWriteConcern: 100, + Reauthenticate: 391, + ReadConcernMajorityNotAvailableYet: 134 + }); + exports2.GET_MORE_RESUMABLE_CODES = /* @__PURE__ */ new Set([ + exports2.MONGODB_ERROR_CODES.HostUnreachable, + exports2.MONGODB_ERROR_CODES.HostNotFound, + exports2.MONGODB_ERROR_CODES.NetworkTimeout, + exports2.MONGODB_ERROR_CODES.ShutdownInProgress, + exports2.MONGODB_ERROR_CODES.PrimarySteppedDown, + exports2.MONGODB_ERROR_CODES.ExceededTimeLimit, + exports2.MONGODB_ERROR_CODES.SocketException, + exports2.MONGODB_ERROR_CODES.NotWritablePrimary, + exports2.MONGODB_ERROR_CODES.InterruptedAtShutdown, + exports2.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + exports2.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + exports2.MONGODB_ERROR_CODES.NotPrimaryOrSecondary, + exports2.MONGODB_ERROR_CODES.StaleShardVersion, + exports2.MONGODB_ERROR_CODES.StaleEpoch, + exports2.MONGODB_ERROR_CODES.StaleConfig, + exports2.MONGODB_ERROR_CODES.RetryChangeStream, + exports2.MONGODB_ERROR_CODES.FailedToSatisfyReadPreference, + exports2.MONGODB_ERROR_CODES.CursorNotFound + ]); + exports2.MongoErrorLabel = Object.freeze({ + RetryableWriteError: "RetryableWriteError", + TransientTransactionError: "TransientTransactionError", + UnknownTransactionCommitResult: "UnknownTransactionCommitResult", + ResumableChangeStreamError: "ResumableChangeStreamError", + HandshakeError: "HandshakeError", + ResetPool: "ResetPool", + PoolRequstedRetry: "PoolRequstedRetry", + InterruptInUseConnections: "InterruptInUseConnections", + NoWritesPerformed: "NoWritesPerformed" + }); + function isAggregateError(e4) { + return e4 != null && typeof e4 === "object" && "errors" in e4 && Array.isArray(e4.errors); + } + var MongoError = class extends Error { + get errorLabels() { + return Array.from(this.errorLabelSet); + } + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, options) { + super(message2, options); + this.errorLabelSet = /* @__PURE__ */ new Set(); + } + /** @internal */ + static buildErrorMessage(e4) { + if (typeof e4 === "string") { + return e4; + } + if (isAggregateError(e4) && e4.message.length === 0) { + return e4.errors.length === 0 ? "AggregateError has an empty errors array. Please check the `cause` property for more information." : e4.errors.map(({ message: message2 }) => message2).join(", "); + } + return e4 != null && typeof e4 === "object" && "message" in e4 && typeof e4.message === "string" ? e4.message : "empty error message"; + } + get name() { + return "MongoError"; + } + /** Legacy name for server error responses */ + get errmsg() { + return this.message; + } + /** + * Checks the error to see if it has an error label + * + * @param label - The error label to check for + * @returns returns true if the error has the provided error label + */ + hasErrorLabel(label) { + return this.errorLabelSet.has(label); + } + addErrorLabel(label) { + this.errorLabelSet.add(label); + } + }; + exports2.MongoError = MongoError; + var MongoServerError = class extends MongoError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2.message || message2.errmsg || message2.$err || "n/a"); + if (message2.errorLabels) { + for (const label of message2.errorLabels) + this.addErrorLabel(label); + } + this.errorResponse = message2; + for (const name in message2) { + if (name !== "errorLabels" && name !== "errmsg" && name !== "message" && name !== "errorResponse") { + this[name] = message2[name]; + } + } + } + get name() { + return "MongoServerError"; + } + }; + exports2.MongoServerError = MongoServerError; + var MongoDriverError = class extends MongoError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, options) { + super(message2, options); + } + get name() { + return "MongoDriverError"; + } + }; + exports2.MongoDriverError = MongoDriverError; + var MongoAPIError = class extends MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, options) { + super(message2, options); + } + get name() { + return "MongoAPIError"; + } + }; + exports2.MongoAPIError = MongoAPIError; + var MongoRuntimeError = class extends MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, options) { + super(message2, options); + } + get name() { + return "MongoRuntimeError"; + } + }; + exports2.MongoRuntimeError = MongoRuntimeError; + var MongoStalePrimaryError = class extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, options) { + super(message2, options); + } + get name() { + return "MongoStalePrimaryError"; + } + }; + exports2.MongoStalePrimaryError = MongoStalePrimaryError; + var MongoBatchReExecutionError = class extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2 = "This batch has already been executed, create new batch to execute") { + super(message2); + } + get name() { + return "MongoBatchReExecutionError"; + } + }; + exports2.MongoBatchReExecutionError = MongoBatchReExecutionError; + var MongoDecompressionError = class extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoDecompressionError"; + } + }; + exports2.MongoDecompressionError = MongoDecompressionError; + var MongoNotConnectedError = class extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoNotConnectedError"; + } + }; + exports2.MongoNotConnectedError = MongoNotConnectedError; + var MongoTransactionError = class extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoTransactionError"; + } + }; + exports2.MongoTransactionError = MongoTransactionError; + var MongoExpiredSessionError = class extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2 = "Cannot use a session that has ended") { + super(message2); + } + get name() { + return "MongoExpiredSessionError"; + } + }; + exports2.MongoExpiredSessionError = MongoExpiredSessionError; + var MongoKerberosError = class extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoKerberosError"; + } + }; + exports2.MongoKerberosError = MongoKerberosError; + var MongoAWSError = class extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, options) { + super(message2, options); + } + get name() { + return "MongoAWSError"; + } + }; + exports2.MongoAWSError = MongoAWSError; + var MongoOIDCError = class extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoOIDCError"; + } + }; + exports2.MongoOIDCError = MongoOIDCError; + var MongoAzureError = class extends MongoOIDCError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoAzureError"; + } + }; + exports2.MongoAzureError = MongoAzureError; + var MongoGCPError = class extends MongoOIDCError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoGCPError"; + } + }; + exports2.MongoGCPError = MongoGCPError; + var MongoClientBulkWriteError = class extends MongoServerError { + /** + * Initialize the client bulk write error. + * @param message - The error message. + */ + constructor(message2) { + super(message2); + this.writeConcernErrors = []; + this.writeErrors = /* @__PURE__ */ new Map(); + } + get name() { + return "MongoClientBulkWriteError"; + } + }; + exports2.MongoClientBulkWriteError = MongoClientBulkWriteError; + var MongoClientBulkWriteCursorError = class extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoClientBulkWriteCursorError"; + } + }; + exports2.MongoClientBulkWriteCursorError = MongoClientBulkWriteCursorError; + var MongoClientBulkWriteExecutionError = class extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoClientBulkWriteExecutionError"; + } + }; + exports2.MongoClientBulkWriteExecutionError = MongoClientBulkWriteExecutionError; + var MongoChangeStreamError = class extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoChangeStreamError"; + } + }; + exports2.MongoChangeStreamError = MongoChangeStreamError; + var MongoTailableCursorError = class extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2 = "Tailable cursor does not support this operation") { + super(message2); + } + get name() { + return "MongoTailableCursorError"; + } + }; + exports2.MongoTailableCursorError = MongoTailableCursorError; + var MongoGridFSStreamError = class extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoGridFSStreamError"; + } + }; + exports2.MongoGridFSStreamError = MongoGridFSStreamError; + var MongoGridFSChunkError = class extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoGridFSChunkError"; + } + }; + exports2.MongoGridFSChunkError = MongoGridFSChunkError; + var MongoUnexpectedServerResponseError = class extends MongoRuntimeError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, options) { + super(message2, options); + } + get name() { + return "MongoUnexpectedServerResponseError"; + } + }; + exports2.MongoUnexpectedServerResponseError = MongoUnexpectedServerResponseError; + var MongoOperationTimeoutError = class extends MongoDriverError { + get name() { + return "MongoOperationTimeoutError"; + } + }; + exports2.MongoOperationTimeoutError = MongoOperationTimeoutError; + var MongoCursorInUseError = class extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2 = "Cursor is already initialized") { + super(message2); + } + get name() { + return "MongoCursorInUseError"; + } + }; + exports2.MongoCursorInUseError = MongoCursorInUseError; + var MongoServerClosedError = class extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2 = "Server is closed") { + super(message2); + } + get name() { + return "MongoServerClosedError"; + } + }; + exports2.MongoServerClosedError = MongoServerClosedError; + var MongoCursorExhaustedError = class extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2 || "Cursor is exhausted"); + } + get name() { + return "MongoCursorExhaustedError"; + } + }; + exports2.MongoCursorExhaustedError = MongoCursorExhaustedError; + var MongoTopologyClosedError = class extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2 = "Topology is closed") { + super(message2); + } + get name() { + return "MongoTopologyClosedError"; + } + }; + exports2.MongoTopologyClosedError = MongoTopologyClosedError; + var MongoClientClosedError = class extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor() { + super("Operation interrupted because client was closed"); + } + get name() { + return "MongoClientClosedError"; + } + }; + exports2.MongoClientClosedError = MongoClientClosedError; + var MongoNetworkError = class extends MongoError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, options) { + super(message2, { cause: options?.cause }); + this.beforeHandshake = !!options?.beforeHandshake; + } + get name() { + return "MongoNetworkError"; + } + }; + exports2.MongoNetworkError = MongoNetworkError; + var MongoNetworkTimeoutError = class extends MongoNetworkError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, options) { + super(message2, options); + } + get name() { + return "MongoNetworkTimeoutError"; + } + }; + exports2.MongoNetworkTimeoutError = MongoNetworkTimeoutError; + var MongoParseError = class extends MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoParseError"; + } + }; + exports2.MongoParseError = MongoParseError; + var MongoInvalidArgumentError = class extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, options) { + super(message2, options); + } + get name() { + return "MongoInvalidArgumentError"; + } + }; + exports2.MongoInvalidArgumentError = MongoInvalidArgumentError; + var MongoCompatibilityError = class extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoCompatibilityError"; + } + }; + exports2.MongoCompatibilityError = MongoCompatibilityError; + var MongoMissingCredentialsError = class extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoMissingCredentialsError"; + } + }; + exports2.MongoMissingCredentialsError = MongoMissingCredentialsError; + var MongoMissingDependencyError = class extends MongoAPIError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, options) { + super(message2, options); + this.dependencyName = options.dependencyName; + } + get name() { + return "MongoMissingDependencyError"; + } + }; + exports2.MongoMissingDependencyError = MongoMissingDependencyError; + var MongoSystemError = class extends MongoError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, reason) { + if (reason && reason.error) { + super(MongoError.buildErrorMessage(reason.error.message || reason.error), { + cause: reason.error + }); + } else { + super(message2); + } + if (reason) { + this.reason = reason; + } + this.code = reason.error?.code; + } + get name() { + return "MongoSystemError"; + } + }; + exports2.MongoSystemError = MongoSystemError; + var MongoServerSelectionError = class extends MongoSystemError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, reason) { + super(message2, reason); + } + get name() { + return "MongoServerSelectionError"; + } + }; + exports2.MongoServerSelectionError = MongoServerSelectionError; + var MongoWriteConcernError = class extends MongoServerError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(result) { + super({ ...result.writeConcernError, ...result }); + this.errInfo = result.writeConcernError.errInfo; + this.result = result; + } + get name() { + return "MongoWriteConcernError"; + } + }; + exports2.MongoWriteConcernError = MongoWriteConcernError; + var RETRYABLE_READ_ERROR_CODES = /* @__PURE__ */ new Set([ + exports2.MONGODB_ERROR_CODES.HostUnreachable, + exports2.MONGODB_ERROR_CODES.HostNotFound, + exports2.MONGODB_ERROR_CODES.NetworkTimeout, + exports2.MONGODB_ERROR_CODES.ShutdownInProgress, + exports2.MONGODB_ERROR_CODES.PrimarySteppedDown, + exports2.MONGODB_ERROR_CODES.SocketException, + exports2.MONGODB_ERROR_CODES.NotWritablePrimary, + exports2.MONGODB_ERROR_CODES.InterruptedAtShutdown, + exports2.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + exports2.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + exports2.MONGODB_ERROR_CODES.NotPrimaryOrSecondary, + exports2.MONGODB_ERROR_CODES.ExceededTimeLimit, + exports2.MONGODB_ERROR_CODES.ReadConcernMajorityNotAvailableYet + ]); + var RETRYABLE_WRITE_ERROR_CODES = RETRYABLE_READ_ERROR_CODES; + function needsRetryableWriteLabel(error2, maxWireVersion, serverType) { + if (error2 instanceof MongoNetworkError) { + return true; + } + if (error2 instanceof MongoError) { + if ((maxWireVersion >= 9 || isRetryableWriteError(error2)) && !error2.hasErrorLabel(exports2.MongoErrorLabel.HandshakeError)) { + return false; + } + } + if (error2 instanceof MongoWriteConcernError) { + if (serverType === "Mongos" && maxWireVersion < 9) { + return RETRYABLE_WRITE_ERROR_CODES.has(error2.result.code ?? 0); + } + const code = error2.result.writeConcernError.code ?? Number(error2.code); + return RETRYABLE_WRITE_ERROR_CODES.has(Number.isNaN(code) ? 0 : code); + } + if (error2 instanceof MongoError) { + return RETRYABLE_WRITE_ERROR_CODES.has(Number(error2.code)); + } + const isNotWritablePrimaryError2 = exports2.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(error2.message); + if (isNotWritablePrimaryError2) { + return true; + } + const isNodeIsRecoveringError = exports2.NODE_IS_RECOVERING_ERROR_MESSAGE.test(error2.message); + if (isNodeIsRecoveringError) { + return true; + } + return false; + } + function isRetryableWriteError(error2) { + return error2.hasErrorLabel(exports2.MongoErrorLabel.RetryableWriteError) || error2.hasErrorLabel(exports2.MongoErrorLabel.PoolRequstedRetry); + } + function isRetryableReadError(error2) { + const hasRetryableErrorCode = typeof error2.code === "number" ? RETRYABLE_READ_ERROR_CODES.has(error2.code) : false; + if (hasRetryableErrorCode) { + return true; + } + if (error2 instanceof MongoNetworkError) { + return true; + } + const isNotWritablePrimaryError2 = exports2.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(error2.message); + if (isNotWritablePrimaryError2) { + return true; + } + const isNodeIsRecoveringError = exports2.NODE_IS_RECOVERING_ERROR_MESSAGE.test(error2.message); + if (isNodeIsRecoveringError) { + return true; + } + return false; + } + var SDAM_RECOVERING_CODES = /* @__PURE__ */ new Set([ + exports2.MONGODB_ERROR_CODES.ShutdownInProgress, + exports2.MONGODB_ERROR_CODES.PrimarySteppedDown, + exports2.MONGODB_ERROR_CODES.InterruptedAtShutdown, + exports2.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + exports2.MONGODB_ERROR_CODES.NotPrimaryOrSecondary + ]); + var SDAM_NOT_PRIMARY_CODES = /* @__PURE__ */ new Set([ + exports2.MONGODB_ERROR_CODES.NotWritablePrimary, + exports2.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + exports2.MONGODB_ERROR_CODES.LegacyNotPrimary + ]); + var SDAM_NODE_SHUTTING_DOWN_ERROR_CODES = /* @__PURE__ */ new Set([ + exports2.MONGODB_ERROR_CODES.InterruptedAtShutdown, + exports2.MONGODB_ERROR_CODES.ShutdownInProgress + ]); + function isRecoveringError(err) { + if (typeof err.code === "number") { + return SDAM_RECOVERING_CODES.has(err.code); + } + return exports2.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE.test(err.message) || exports2.NODE_IS_RECOVERING_ERROR_MESSAGE.test(err.message); + } + function isNotWritablePrimaryError(err) { + if (typeof err.code === "number") { + return SDAM_NOT_PRIMARY_CODES.has(err.code); + } + if (isRecoveringError(err)) { + return false; + } + return exports2.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(err.message); + } + function isNodeShuttingDownError(err) { + return !!(typeof err.code === "number" && SDAM_NODE_SHUTTING_DOWN_ERROR_CODES.has(err.code)); + } + function isSDAMUnrecoverableError(error2) { + if (error2 instanceof MongoParseError || error2 == null) { + return true; + } + return isRecoveringError(error2) || isNotWritablePrimaryError(error2); + } + function isNetworkTimeoutError(err) { + return !!(err instanceof MongoNetworkError && err.message.match(/timed out/)); + } + function isResumableError(error2, wireVersion) { + if (error2 == null || !(error2 instanceof MongoError)) { + return false; + } + if (error2 instanceof MongoNetworkError) { + return true; + } + if (error2 instanceof MongoServerSelectionError) { + return true; + } + if (wireVersion != null && wireVersion >= 9) { + if (error2.code === exports2.MONGODB_ERROR_CODES.CursorNotFound) { + return true; + } + return error2.hasErrorLabel(exports2.MongoErrorLabel.ResumableChangeStreamError); + } + if (typeof error2.code === "number") { + return exports2.GET_MORE_RESUMABLE_CODES.has(error2.code); + } + return false; + } + } +}); + +// node_modules/mongodb/lib/cmap/wire_protocol/constants.js +var require_constants = __commonJS({ + "node_modules/mongodb/lib/cmap/wire_protocol/constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OP_MSG = exports2.OP_COMPRESSED = exports2.OP_DELETE = exports2.OP_QUERY = exports2.OP_INSERT = exports2.OP_UPDATE = exports2.OP_REPLY = exports2.MIN_SUPPORTED_RAW_DATA_SERVER_VERSION = exports2.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION = exports2.MIN_SUPPORTED_QE_SERVER_VERSION = exports2.MIN_SUPPORTED_QE_WIRE_VERSION = exports2.MAX_SUPPORTED_WIRE_VERSION = exports2.MIN_SUPPORTED_WIRE_VERSION = exports2.MAX_SUPPORTED_SERVER_VERSION = exports2.MIN_SUPPORTED_SERVER_VERSION = void 0; + exports2.MIN_SUPPORTED_SERVER_VERSION = "4.2"; + exports2.MAX_SUPPORTED_SERVER_VERSION = "8.2"; + exports2.MIN_SUPPORTED_WIRE_VERSION = 8; + exports2.MAX_SUPPORTED_WIRE_VERSION = 27; + exports2.MIN_SUPPORTED_QE_WIRE_VERSION = 21; + exports2.MIN_SUPPORTED_QE_SERVER_VERSION = "7.0"; + exports2.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION = 27; + exports2.MIN_SUPPORTED_RAW_DATA_SERVER_VERSION = "8.2"; + exports2.OP_REPLY = 1; + exports2.OP_UPDATE = 2001; + exports2.OP_INSERT = 2002; + exports2.OP_QUERY = 2004; + exports2.OP_DELETE = 2006; + exports2.OP_COMPRESSED = 2012; + exports2.OP_MSG = 2013; + } +}); + +// node_modules/mongodb/lib/constants.js +var require_constants2 = __commonJS({ + "node_modules/mongodb/lib/constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.END = exports2.CHANGE = exports2.INIT = exports2.MORE = exports2.RESPONSE = exports2.SERVER_HEARTBEAT_FAILED = exports2.SERVER_HEARTBEAT_SUCCEEDED = exports2.SERVER_HEARTBEAT_STARTED = exports2.COMMAND_FAILED = exports2.COMMAND_SUCCEEDED = exports2.COMMAND_STARTED = exports2.CLUSTER_TIME_RECEIVED = exports2.CONNECTION_CHECKED_IN = exports2.CONNECTION_CHECKED_OUT = exports2.CONNECTION_CHECK_OUT_FAILED = exports2.CONNECTION_CHECK_OUT_STARTED = exports2.CONNECTION_CLOSED = exports2.CONNECTION_READY = exports2.CONNECTION_CREATED = exports2.CONNECTION_POOL_READY = exports2.CONNECTION_POOL_CLEARED = exports2.CONNECTION_POOL_CLOSED = exports2.CONNECTION_POOL_CREATED = exports2.WAITING_FOR_SUITABLE_SERVER = exports2.SERVER_SELECTION_SUCCEEDED = exports2.SERVER_SELECTION_FAILED = exports2.SERVER_SELECTION_STARTED = exports2.TOPOLOGY_DESCRIPTION_CHANGED = exports2.TOPOLOGY_CLOSED = exports2.TOPOLOGY_OPENING = exports2.SERVER_DESCRIPTION_CHANGED = exports2.SERVER_CLOSED = exports2.SERVER_OPENING = exports2.DESCRIPTION_RECEIVED = exports2.UNPINNED = exports2.PINNED = exports2.MESSAGE = exports2.ENDED = exports2.CLOSED = exports2.CONNECT = exports2.OPEN = exports2.CLOSE = exports2.TIMEOUT = exports2.ERROR = exports2.SYSTEM_JS_COLLECTION = exports2.SYSTEM_COMMAND_COLLECTION = exports2.SYSTEM_USER_COLLECTION = exports2.SYSTEM_PROFILE_COLLECTION = exports2.SYSTEM_INDEX_COLLECTION = exports2.SYSTEM_NAMESPACE_COLLECTION = void 0; + exports2.kDecoratedKeys = exports2.kDecorateResult = exports2.LEGACY_HELLO_COMMAND_CAMEL_CASE = exports2.LEGACY_HELLO_COMMAND = exports2.MONGO_CLIENT_EVENTS = exports2.LOCAL_SERVER_EVENTS = exports2.SERVER_RELAY_EVENTS = exports2.APM_EVENTS = exports2.TOPOLOGY_EVENTS = exports2.CMAP_EVENTS = exports2.HEARTBEAT_EVENTS = exports2.RESUME_TOKEN_CHANGED = void 0; + exports2.SYSTEM_NAMESPACE_COLLECTION = "system.namespaces"; + exports2.SYSTEM_INDEX_COLLECTION = "system.indexes"; + exports2.SYSTEM_PROFILE_COLLECTION = "system.profile"; + exports2.SYSTEM_USER_COLLECTION = "system.users"; + exports2.SYSTEM_COMMAND_COLLECTION = "$cmd"; + exports2.SYSTEM_JS_COLLECTION = "system.js"; + exports2.ERROR = "error"; + exports2.TIMEOUT = "timeout"; + exports2.CLOSE = "close"; + exports2.OPEN = "open"; + exports2.CONNECT = "connect"; + exports2.CLOSED = "closed"; + exports2.ENDED = "ended"; + exports2.MESSAGE = "message"; + exports2.PINNED = "pinned"; + exports2.UNPINNED = "unpinned"; + exports2.DESCRIPTION_RECEIVED = "descriptionReceived"; + exports2.SERVER_OPENING = "serverOpening"; + exports2.SERVER_CLOSED = "serverClosed"; + exports2.SERVER_DESCRIPTION_CHANGED = "serverDescriptionChanged"; + exports2.TOPOLOGY_OPENING = "topologyOpening"; + exports2.TOPOLOGY_CLOSED = "topologyClosed"; + exports2.TOPOLOGY_DESCRIPTION_CHANGED = "topologyDescriptionChanged"; + exports2.SERVER_SELECTION_STARTED = "serverSelectionStarted"; + exports2.SERVER_SELECTION_FAILED = "serverSelectionFailed"; + exports2.SERVER_SELECTION_SUCCEEDED = "serverSelectionSucceeded"; + exports2.WAITING_FOR_SUITABLE_SERVER = "waitingForSuitableServer"; + exports2.CONNECTION_POOL_CREATED = "connectionPoolCreated"; + exports2.CONNECTION_POOL_CLOSED = "connectionPoolClosed"; + exports2.CONNECTION_POOL_CLEARED = "connectionPoolCleared"; + exports2.CONNECTION_POOL_READY = "connectionPoolReady"; + exports2.CONNECTION_CREATED = "connectionCreated"; + exports2.CONNECTION_READY = "connectionReady"; + exports2.CONNECTION_CLOSED = "connectionClosed"; + exports2.CONNECTION_CHECK_OUT_STARTED = "connectionCheckOutStarted"; + exports2.CONNECTION_CHECK_OUT_FAILED = "connectionCheckOutFailed"; + exports2.CONNECTION_CHECKED_OUT = "connectionCheckedOut"; + exports2.CONNECTION_CHECKED_IN = "connectionCheckedIn"; + exports2.CLUSTER_TIME_RECEIVED = "clusterTimeReceived"; + exports2.COMMAND_STARTED = "commandStarted"; + exports2.COMMAND_SUCCEEDED = "commandSucceeded"; + exports2.COMMAND_FAILED = "commandFailed"; + exports2.SERVER_HEARTBEAT_STARTED = "serverHeartbeatStarted"; + exports2.SERVER_HEARTBEAT_SUCCEEDED = "serverHeartbeatSucceeded"; + exports2.SERVER_HEARTBEAT_FAILED = "serverHeartbeatFailed"; + exports2.RESPONSE = "response"; + exports2.MORE = "more"; + exports2.INIT = "init"; + exports2.CHANGE = "change"; + exports2.END = "end"; + exports2.RESUME_TOKEN_CHANGED = "resumeTokenChanged"; + exports2.HEARTBEAT_EVENTS = Object.freeze([ + exports2.SERVER_HEARTBEAT_STARTED, + exports2.SERVER_HEARTBEAT_SUCCEEDED, + exports2.SERVER_HEARTBEAT_FAILED + ]); + exports2.CMAP_EVENTS = Object.freeze([ + exports2.CONNECTION_POOL_CREATED, + exports2.CONNECTION_POOL_READY, + exports2.CONNECTION_POOL_CLEARED, + exports2.CONNECTION_POOL_CLOSED, + exports2.CONNECTION_CREATED, + exports2.CONNECTION_READY, + exports2.CONNECTION_CLOSED, + exports2.CONNECTION_CHECK_OUT_STARTED, + exports2.CONNECTION_CHECK_OUT_FAILED, + exports2.CONNECTION_CHECKED_OUT, + exports2.CONNECTION_CHECKED_IN + ]); + exports2.TOPOLOGY_EVENTS = Object.freeze([ + exports2.SERVER_OPENING, + exports2.SERVER_CLOSED, + exports2.SERVER_DESCRIPTION_CHANGED, + exports2.TOPOLOGY_OPENING, + exports2.TOPOLOGY_CLOSED, + exports2.TOPOLOGY_DESCRIPTION_CHANGED, + exports2.ERROR, + exports2.TIMEOUT, + exports2.CLOSE + ]); + exports2.APM_EVENTS = Object.freeze([ + exports2.COMMAND_STARTED, + exports2.COMMAND_SUCCEEDED, + exports2.COMMAND_FAILED + ]); + exports2.SERVER_RELAY_EVENTS = Object.freeze([ + exports2.SERVER_HEARTBEAT_STARTED, + exports2.SERVER_HEARTBEAT_SUCCEEDED, + exports2.SERVER_HEARTBEAT_FAILED, + exports2.COMMAND_STARTED, + exports2.COMMAND_SUCCEEDED, + exports2.COMMAND_FAILED, + ...exports2.CMAP_EVENTS + ]); + exports2.LOCAL_SERVER_EVENTS = Object.freeze([ + exports2.CONNECT, + exports2.DESCRIPTION_RECEIVED, + exports2.CLOSED, + exports2.ENDED + ]); + exports2.MONGO_CLIENT_EVENTS = Object.freeze([ + ...exports2.CMAP_EVENTS, + ...exports2.APM_EVENTS, + ...exports2.TOPOLOGY_EVENTS, + ...exports2.HEARTBEAT_EVENTS + ]); + exports2.LEGACY_HELLO_COMMAND = "ismaster"; + exports2.LEGACY_HELLO_COMMAND_CAMEL_CASE = "isMaster"; + exports2.kDecorateResult = /* @__PURE__ */ Symbol.for("@@mdb.decorateDecryptionResult"); + exports2.kDecoratedKeys = /* @__PURE__ */ Symbol.for("@@mdb.decryptedKeys"); + } +}); + +// node_modules/mongodb/lib/read_concern.js +var require_read_concern = __commonJS({ + "node_modules/mongodb/lib/read_concern.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ReadConcern = exports2.ReadConcernLevel = void 0; + exports2.ReadConcernLevel = Object.freeze({ + local: "local", + majority: "majority", + linearizable: "linearizable", + available: "available", + snapshot: "snapshot" + }); + var ReadConcern = class _ReadConcern { + /** Constructs a ReadConcern from the read concern level.*/ + constructor(level) { + this.level = exports2.ReadConcernLevel[level] ?? level; + } + /** + * Construct a ReadConcern given an options object. + * + * @param options - The options object from which to extract the write concern. + */ + static fromOptions(options) { + if (options == null) { + return; + } + if (options.readConcern) { + const { readConcern } = options; + if (readConcern instanceof _ReadConcern) { + return readConcern; + } else if (typeof readConcern === "string") { + return new _ReadConcern(readConcern); + } else if ("level" in readConcern && readConcern.level) { + return new _ReadConcern(readConcern.level); + } + } + if (options.level) { + return new _ReadConcern(options.level); + } + return; + } + static get MAJORITY() { + return exports2.ReadConcernLevel.majority; + } + static get AVAILABLE() { + return exports2.ReadConcernLevel.available; + } + static get LINEARIZABLE() { + return exports2.ReadConcernLevel.linearizable; + } + static get SNAPSHOT() { + return exports2.ReadConcernLevel.snapshot; + } + toJSON() { + return { level: this.level }; + } + }; + exports2.ReadConcern = ReadConcern; + } +}); + +// node_modules/mongodb/lib/read_preference.js +var require_read_preference = __commonJS({ + "node_modules/mongodb/lib/read_preference.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ReadPreference = exports2.ReadPreferenceMode = void 0; + var error_1 = require_error(); + exports2.ReadPreferenceMode = Object.freeze({ + primary: "primary", + primaryPreferred: "primaryPreferred", + secondary: "secondary", + secondaryPreferred: "secondaryPreferred", + nearest: "nearest" + }); + var ReadPreference = class _ReadPreference { + /** + * @param mode - A string describing the read preference mode (primary|primaryPreferred|secondary|secondaryPreferred|nearest) + * @param tags - A tag set used to target reads to members with the specified tag(s). tagSet is not available if using read preference mode primary. + * @param options - Additional read preference options + */ + constructor(mode, tags, options) { + if (!_ReadPreference.isValid(mode)) { + throw new error_1.MongoInvalidArgumentError(`Invalid read preference mode ${JSON.stringify(mode)}`); + } + if (options == null && typeof tags === "object" && !Array.isArray(tags)) { + options = tags; + tags = void 0; + } else if (tags && !Array.isArray(tags)) { + throw new error_1.MongoInvalidArgumentError("ReadPreference tags must be an array"); + } + this.mode = mode; + this.tags = tags; + this.hedge = options?.hedge; + this.maxStalenessSeconds = void 0; + this.minWireVersion = void 0; + options = options ?? {}; + if (options.maxStalenessSeconds != null) { + if (options.maxStalenessSeconds <= 0) { + throw new error_1.MongoInvalidArgumentError("maxStalenessSeconds must be a positive integer"); + } + this.maxStalenessSeconds = options.maxStalenessSeconds; + this.minWireVersion = 5; + } + if (this.mode === _ReadPreference.PRIMARY) { + if (this.tags && Array.isArray(this.tags) && this.tags.length > 0) { + throw new error_1.MongoInvalidArgumentError("Primary read preference cannot be combined with tags"); + } + if (this.maxStalenessSeconds) { + throw new error_1.MongoInvalidArgumentError("Primary read preference cannot be combined with maxStalenessSeconds"); + } + if (this.hedge) { + throw new error_1.MongoInvalidArgumentError("Primary read preference cannot be combined with hedge"); + } + } + } + // Support the deprecated `preference` property introduced in the porcelain layer + get preference() { + return this.mode; + } + static fromString(mode) { + return new _ReadPreference(mode); + } + /** + * Construct a ReadPreference given an options object. + * + * @param options - The options object from which to extract the read preference. + */ + static fromOptions(options) { + if (!options) + return; + const readPreference = options.readPreference ?? options.session?.transaction.options.readPreference; + const readPreferenceTags = options.readPreferenceTags; + if (readPreference == null) { + return; + } + if (typeof readPreference === "string") { + return new _ReadPreference(readPreference, readPreferenceTags, { + maxStalenessSeconds: options.maxStalenessSeconds, + hedge: options.hedge + }); + } else if (!(readPreference instanceof _ReadPreference) && typeof readPreference === "object") { + const mode = readPreference.mode || readPreference.preference; + if (mode && typeof mode === "string") { + return new _ReadPreference(mode, readPreference.tags ?? readPreferenceTags, { + maxStalenessSeconds: readPreference.maxStalenessSeconds, + hedge: options.hedge + }); + } + } + if (readPreferenceTags) { + readPreference.tags = readPreferenceTags; + } + return readPreference; + } + /** + * Replaces options.readPreference with a ReadPreference instance + */ + static translate(options) { + if (options.readPreference == null) + return options; + const r4 = options.readPreference; + if (typeof r4 === "string") { + options.readPreference = new _ReadPreference(r4); + } else if (r4 && !(r4 instanceof _ReadPreference) && typeof r4 === "object") { + const mode = r4.mode || r4.preference; + if (mode && typeof mode === "string") { + options.readPreference = new _ReadPreference(mode, r4.tags, { + maxStalenessSeconds: r4.maxStalenessSeconds + }); + } + } else if (!(r4 instanceof _ReadPreference)) { + throw new error_1.MongoInvalidArgumentError(`Invalid read preference: ${r4}`); + } + return options; + } + /** + * Validate if a mode is legal + * + * @param mode - The string representing the read preference mode. + */ + static isValid(mode) { + const VALID_MODES = /* @__PURE__ */ new Set([ + _ReadPreference.PRIMARY, + _ReadPreference.PRIMARY_PREFERRED, + _ReadPreference.SECONDARY, + _ReadPreference.SECONDARY_PREFERRED, + _ReadPreference.NEAREST, + null + ]); + return VALID_MODES.has(mode); + } + /** + * Validate if a mode is legal + * + * @param mode - The string representing the read preference mode. + */ + isValid(mode) { + return _ReadPreference.isValid(typeof mode === "string" ? mode : this.mode); + } + /** + * Indicates that this readPreference needs the "SecondaryOk" bit when sent over the wire + * @see https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/#op-query + */ + secondaryOk() { + const NEEDS_SECONDARYOK = /* @__PURE__ */ new Set([ + _ReadPreference.PRIMARY_PREFERRED, + _ReadPreference.SECONDARY, + _ReadPreference.SECONDARY_PREFERRED, + _ReadPreference.NEAREST + ]); + return NEEDS_SECONDARYOK.has(this.mode); + } + /** + * Check if the two ReadPreferences are equivalent + * + * @param readPreference - The read preference with which to check equality + */ + equals(readPreference) { + return readPreference.mode === this.mode; + } + /** Return JSON representation */ + toJSON() { + const readPreference = { mode: this.mode }; + if (Array.isArray(this.tags)) + readPreference.tags = this.tags; + if (this.maxStalenessSeconds) + readPreference.maxStalenessSeconds = this.maxStalenessSeconds; + if (this.hedge) + readPreference.hedge = this.hedge; + return readPreference; + } + }; + exports2.ReadPreference = ReadPreference; + ReadPreference.PRIMARY = exports2.ReadPreferenceMode.primary; + ReadPreference.PRIMARY_PREFERRED = exports2.ReadPreferenceMode.primaryPreferred; + ReadPreference.SECONDARY = exports2.ReadPreferenceMode.secondary; + ReadPreference.SECONDARY_PREFERRED = exports2.ReadPreferenceMode.secondaryPreferred; + ReadPreference.NEAREST = exports2.ReadPreferenceMode.nearest; + ReadPreference.primary = new ReadPreference(exports2.ReadPreferenceMode.primary); + ReadPreference.primaryPreferred = new ReadPreference(exports2.ReadPreferenceMode.primaryPreferred); + ReadPreference.secondary = new ReadPreference(exports2.ReadPreferenceMode.secondary); + ReadPreference.secondaryPreferred = new ReadPreference(exports2.ReadPreferenceMode.secondaryPreferred); + ReadPreference.nearest = new ReadPreference(exports2.ReadPreferenceMode.nearest); + } +}); + +// node_modules/mongodb/lib/sdam/common.js +var require_common = __commonJS({ + "node_modules/mongodb/lib/sdam/common.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ServerType = exports2.TopologyType = exports2.STATE_CONNECTED = exports2.STATE_CONNECTING = exports2.STATE_CLOSED = exports2.STATE_CLOSING = void 0; + exports2._advanceClusterTime = _advanceClusterTime; + exports2.STATE_CLOSING = "closing"; + exports2.STATE_CLOSED = "closed"; + exports2.STATE_CONNECTING = "connecting"; + exports2.STATE_CONNECTED = "connected"; + exports2.TopologyType = Object.freeze({ + Single: "Single", + ReplicaSetNoPrimary: "ReplicaSetNoPrimary", + ReplicaSetWithPrimary: "ReplicaSetWithPrimary", + Sharded: "Sharded", + Unknown: "Unknown", + LoadBalanced: "LoadBalanced" + }); + exports2.ServerType = Object.freeze({ + Standalone: "Standalone", + Mongos: "Mongos", + PossiblePrimary: "PossiblePrimary", + RSPrimary: "RSPrimary", + RSSecondary: "RSSecondary", + RSArbiter: "RSArbiter", + RSOther: "RSOther", + RSGhost: "RSGhost", + Unknown: "Unknown", + LoadBalancer: "LoadBalancer" + }); + function _advanceClusterTime(entity, $clusterTime) { + if (entity.clusterTime == null) { + entity.clusterTime = $clusterTime; + } else { + if ($clusterTime.clusterTime.greaterThan(entity.clusterTime.clusterTime)) { + entity.clusterTime = $clusterTime; + } + } + } + } +}); + +// node_modules/mongodb/lib/write_concern.js +var require_write_concern = __commonJS({ + "node_modules/mongodb/lib/write_concern.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.WriteConcern = exports2.WRITE_CONCERN_KEYS = void 0; + exports2.throwIfWriteConcernError = throwIfWriteConcernError; + var responses_1 = require_responses(); + var error_1 = require_error(); + exports2.WRITE_CONCERN_KEYS = ["w", "wtimeout", "j", "journal", "fsync"]; + var WriteConcern = class _WriteConcern { + /** + * Constructs a WriteConcern from the write concern properties. + * @param w - request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags. + * @param wtimeoutMS - specify a time limit to prevent write operations from blocking indefinitely + * @param journal - request acknowledgment that the write operation has been written to the on-disk journal + * @param fsync - equivalent to the j option. Is deprecated and will be removed in the next major version. + */ + constructor(w4, wtimeoutMS, journal, fsync) { + if (w4 != null) { + if (!Number.isNaN(Number(w4))) { + this.w = Number(w4); + } else { + this.w = w4; + } + } + if (wtimeoutMS != null) { + this.wtimeoutMS = this.wtimeout = wtimeoutMS; + } + if (journal != null) { + this.journal = this.j = journal; + } + if (fsync != null) { + this.journal = this.j = fsync ? true : false; + } + } + /** + * Apply a write concern to a command document. Will modify and return the command. + */ + static apply(command, writeConcern) { + const wc = {}; + if (writeConcern.w != null) + wc.w = writeConcern.w; + if (writeConcern.wtimeoutMS != null) + wc.wtimeout = writeConcern.wtimeoutMS; + if (writeConcern.journal != null) + wc.j = writeConcern.j; + command.writeConcern = wc; + return command; + } + /** Construct a WriteConcern given an options object. */ + static fromOptions(options, inherit) { + if (options == null) + return void 0; + inherit = inherit ?? {}; + let opts; + if (typeof options === "string" || typeof options === "number") { + opts = { w: options }; + } else if (options instanceof _WriteConcern) { + opts = options; + } else { + opts = options.writeConcern; + } + const parentOpts = inherit instanceof _WriteConcern ? inherit : inherit.writeConcern; + const mergedOpts = { ...parentOpts, ...opts }; + const { w: w4 = void 0, wtimeout = void 0, j: j4 = void 0, fsync = void 0, journal = void 0, wtimeoutMS = void 0 } = mergedOpts; + if (w4 != null || wtimeout != null || wtimeoutMS != null || j4 != null || journal != null || fsync != null) { + return new _WriteConcern(w4, wtimeout ?? wtimeoutMS, j4 ?? journal, fsync); + } + return void 0; + } + }; + exports2.WriteConcern = WriteConcern; + function throwIfWriteConcernError(response) { + if (typeof response === "object" && response != null) { + const writeConcernError = responses_1.MongoDBResponse.is(response) && response.has("writeConcernError") ? response.toObject() : !responses_1.MongoDBResponse.is(response) && "writeConcernError" in response ? response : null; + if (writeConcernError != null) { + throw new error_1.MongoWriteConcernError(writeConcernError); + } + } + } + } +}); + +// node_modules/mongodb/lib/utils.js +var require_utils3 = __commonJS({ + "node_modules/mongodb/lib/utils.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.kDispose = exports2.randomBytes = exports2.COSMOS_DB_MSG = exports2.DOCUMENT_DB_MSG = exports2.COSMOS_DB_CHECK = exports2.DOCUMENT_DB_CHECK = exports2.MONGODB_WARNING_CODE = exports2.DEFAULT_PK_FACTORY = exports2.HostAddress = exports2.BufferPool = exports2.List = exports2.MongoDBCollectionNamespace = exports2.MongoDBNamespace = exports2.ByteUtils = void 0; + exports2.isUint8Array = isUint8Array; + exports2.hostMatchesWildcards = hostMatchesWildcards; + exports2.normalizeHintField = normalizeHintField; + exports2.isObject = isObject; + exports2.mergeOptions = mergeOptions; + exports2.filterOptions = filterOptions; + exports2.applyRetryableWrites = applyRetryableWrites; + exports2.isPromiseLike = isPromiseLike; + exports2.decorateWithCollation = decorateWithCollation; + exports2.decorateWithReadConcern = decorateWithReadConcern; + exports2.getTopology = getTopology; + exports2.ns = ns; + exports2.makeCounter = makeCounter; + exports2.uuidV4 = uuidV4; + exports2.maxWireVersion = maxWireVersion; + exports2.arrayStrictEqual = arrayStrictEqual; + exports2.errorStrictEqual = errorStrictEqual; + exports2.makeStateMachine = makeStateMachine; + exports2.now = now; + exports2.calculateDurationInMs = calculateDurationInMs; + exports2.hasAtomicOperators = hasAtomicOperators; + exports2.resolveTimeoutOptions = resolveTimeoutOptions; + exports2.resolveOptions = resolveOptions; + exports2.isSuperset = isSuperset; + exports2.isHello = isHello; + exports2.setDifference = setDifference; + exports2.isRecord = isRecord; + exports2.emitWarning = emitWarning; + exports2.emitWarningOnce = emitWarningOnce; + exports2.enumToString = enumToString; + exports2.supportsRetryableWrites = supportsRetryableWrites; + exports2.shuffle = shuffle; + exports2.commandSupportsReadConcern = commandSupportsReadConcern; + exports2.compareObjectId = compareObjectId; + exports2.parseInteger = parseInteger; + exports2.parseUnsignedInteger = parseUnsignedInteger; + exports2.checkParentDomainMatch = checkParentDomainMatch; + exports2.get = get2; + exports2.request = request; + exports2.isHostMatch = isHostMatch; + exports2.promiseWithResolvers = promiseWithResolvers; + exports2.squashError = squashError; + exports2.once = once; + exports2.maybeAddIdToDocuments = maybeAddIdToDocuments; + exports2.fileIsAccessible = fileIsAccessible; + exports2.csotMin = csotMin; + exports2.noop = noop; + exports2.decorateDecryptionResult = decorateDecryptionResult; + exports2.addAbortListener = addAbortListener; + exports2.abortable = abortable; + var crypto2 = require("crypto"); + var fs_1 = require("fs"); + var http = require("http"); + var timers_1 = require("timers"); + var url = require("url"); + var url_1 = require("url"); + var util_1 = require("util"); + var bson_1 = require_bson2(); + var constants_1 = require_constants(); + var constants_2 = require_constants2(); + var error_1 = require_error(); + var read_concern_1 = require_read_concern(); + var read_preference_1 = require_read_preference(); + var common_1 = require_common(); + var write_concern_1 = require_write_concern(); + exports2.ByteUtils = { + toLocalBufferType(buffer) { + return Buffer.isBuffer(buffer) ? buffer : Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength); + }, + equals(seqA, seqB) { + return exports2.ByteUtils.toLocalBufferType(seqA).equals(seqB); + }, + compare(seqA, seqB) { + return exports2.ByteUtils.toLocalBufferType(seqA).compare(seqB); + }, + toBase64(uint8array) { + return exports2.ByteUtils.toLocalBufferType(uint8array).toString("base64"); + } + }; + function isUint8Array(value) { + return value != null && typeof value === "object" && Symbol.toStringTag in value && value[Symbol.toStringTag] === "Uint8Array"; + } + function hostMatchesWildcards(host, wildcards) { + for (const wildcard of wildcards) { + if (host === wildcard || wildcard.startsWith("*.") && host?.endsWith(wildcard.substring(2, wildcard.length)) || wildcard.startsWith("*/") && host?.endsWith(wildcard.substring(2, wildcard.length))) { + return true; + } + } + return false; + } + function normalizeHintField(hint) { + let finalHint = void 0; + if (typeof hint === "string") { + finalHint = hint; + } else if (Array.isArray(hint)) { + finalHint = {}; + hint.forEach((param) => { + finalHint[param] = 1; + }); + } else if (hint != null && typeof hint === "object") { + finalHint = {}; + for (const name in hint) { + finalHint[name] = hint[name]; + } + } + return finalHint; + } + var TO_STRING = (object) => Object.prototype.toString.call(object); + function isObject(arg) { + return "[object Object]" === TO_STRING(arg); + } + function mergeOptions(target, source) { + return { ...target, ...source }; + } + function filterOptions(options, names) { + const filterOptions2 = {}; + for (const name in options) { + if (names.includes(name)) { + filterOptions2[name] = options[name]; + } + } + return filterOptions2; + } + function applyRetryableWrites(target, db) { + if (db && db.s.options?.retryWrites) { + target.retryWrites = true; + } + return target; + } + function isPromiseLike(value) { + return value != null && typeof value === "object" && "then" in value && typeof value.then === "function"; + } + function decorateWithCollation(command, options) { + if (options.collation && typeof options.collation === "object") { + command.collation = options.collation; + } + } + function decorateWithReadConcern(command, coll, options) { + if (options && options.session && options.session.inTransaction()) { + return; + } + const readConcern = Object.assign({}, command.readConcern || {}); + if (coll.s.readConcern) { + Object.assign(readConcern, coll.s.readConcern); + } + if (Object.keys(readConcern).length > 0) { + Object.assign(command, { readConcern }); + } + } + function getTopology(provider) { + if ("topology" in provider && provider.topology) { + return provider.topology; + } else if ("client" in provider && provider.client.topology) { + return provider.client.topology; + } + throw new error_1.MongoNotConnectedError("MongoClient must be connected to perform this operation"); + } + function ns(ns2) { + return MongoDBNamespace.fromString(ns2); + } + var MongoDBNamespace = class _MongoDBNamespace { + /** + * Create a namespace object + * + * @param db - database name + * @param collection - collection name + */ + constructor(db, collection) { + this.db = db; + this.collection = collection === "" ? void 0 : collection; + } + toString() { + return this.collection ? `${this.db}.${this.collection}` : this.db; + } + withCollection(collection) { + return new MongoDBCollectionNamespace(this.db, collection); + } + static fromString(namespace) { + if (typeof namespace !== "string" || namespace === "") { + throw new error_1.MongoRuntimeError(`Cannot parse namespace from "${namespace}"`); + } + const [db, ...collectionParts] = namespace.split("."); + const collection = collectionParts.join("."); + return new _MongoDBNamespace(db, collection === "" ? void 0 : collection); + } + }; + exports2.MongoDBNamespace = MongoDBNamespace; + var MongoDBCollectionNamespace = class extends MongoDBNamespace { + constructor(db, collection) { + super(db, collection); + this.collection = collection; + } + static fromString(namespace) { + return super.fromString(namespace); + } + }; + exports2.MongoDBCollectionNamespace = MongoDBCollectionNamespace; + function* makeCounter(seed = 0) { + let count = seed; + while (true) { + const newCount = count; + count += 1; + yield newCount; + } + } + function uuidV4() { + const result = crypto2.randomBytes(16); + result[6] = result[6] & 15 | 64; + result[8] = result[8] & 63 | 128; + return result; + } + function maxWireVersion(handshakeAware) { + if (handshakeAware) { + if (handshakeAware.hello) { + return handshakeAware.hello.maxWireVersion; + } + if (handshakeAware.serverApi?.version) { + return constants_1.MAX_SUPPORTED_WIRE_VERSION; + } + if (handshakeAware.loadBalanced) { + return constants_1.MAX_SUPPORTED_WIRE_VERSION; + } + if ("lastHello" in handshakeAware && typeof handshakeAware.lastHello === "function") { + const lastHello = handshakeAware.lastHello(); + if (lastHello) { + return lastHello.maxWireVersion; + } + } + if (handshakeAware.description && "maxWireVersion" in handshakeAware.description && handshakeAware.description.maxWireVersion != null) { + return handshakeAware.description.maxWireVersion; + } + } + return 0; + } + function arrayStrictEqual(arr, arr2) { + if (!Array.isArray(arr) || !Array.isArray(arr2)) { + return false; + } + return arr.length === arr2.length && arr.every((elt, idx) => elt === arr2[idx]); + } + function errorStrictEqual(lhs, rhs) { + if (lhs === rhs) { + return true; + } + if (!lhs || !rhs) { + return lhs === rhs; + } + if (lhs == null && rhs != null || lhs != null && rhs == null) { + return false; + } + if (lhs.constructor.name !== rhs.constructor.name) { + return false; + } + if (lhs.message !== rhs.message) { + return false; + } + return true; + } + function makeStateMachine(stateTable) { + return function stateTransition(target, newState) { + const legalStates = stateTable[target.s.state]; + if (legalStates && legalStates.indexOf(newState) < 0) { + throw new error_1.MongoRuntimeError(`illegal state transition from [${target.s.state}] => [${newState}], allowed: [${legalStates}]`); + } + target.emit("stateChanged", target.s.state, newState); + target.s.state = newState; + }; + } + function now() { + const hrtime = process.hrtime(); + return Math.floor(hrtime[0] * 1e3 + hrtime[1] / 1e6); + } + function calculateDurationInMs(started) { + if (typeof started !== "number") { + return -1; + } + const elapsed = now() - started; + return elapsed < 0 ? 0 : elapsed; + } + function hasAtomicOperators(doc, options) { + if (Array.isArray(doc)) { + for (const document2 of doc) { + if (hasAtomicOperators(document2)) { + return true; + } + } + return false; + } + const keys = Object.keys(doc); + if (options?.ignoreUndefined) { + let allUndefined = true; + for (const key of keys) { + if (doc[key] !== void 0) { + allUndefined = false; + break; + } + } + if (allUndefined) { + throw new error_1.MongoInvalidArgumentError("Update operations require that all atomic operators have defined values, but none were provided."); + } + } + return keys.length > 0 && keys[0][0] === "$"; + } + function resolveTimeoutOptions(client, options) { + const { socketTimeoutMS, serverSelectionTimeoutMS, waitQueueTimeoutMS, timeoutMS } = client.s.options; + return { socketTimeoutMS, serverSelectionTimeoutMS, waitQueueTimeoutMS, timeoutMS, ...options }; + } + function resolveOptions(parent, options) { + const result = Object.assign({}, options, (0, bson_1.resolveBSONOptions)(options, parent)); + const timeoutMS = options?.timeoutMS ?? parent?.timeoutMS; + const session = options?.session; + if (!session?.inTransaction()) { + const readConcern = read_concern_1.ReadConcern.fromOptions(options) ?? parent?.readConcern; + if (readConcern) { + result.readConcern = readConcern; + } + let writeConcern = write_concern_1.WriteConcern.fromOptions(options) ?? parent?.writeConcern; + if (writeConcern) { + if (timeoutMS != null) { + writeConcern = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...writeConcern, + wtimeout: void 0, + wtimeoutMS: void 0 + } + }); + } + result.writeConcern = writeConcern; + } + } + result.timeoutMS = timeoutMS; + const readPreference = read_preference_1.ReadPreference.fromOptions(options) ?? parent?.readPreference; + if (readPreference) { + result.readPreference = readPreference; + } + const isConvenientTransaction = session?.explicit && session?.timeoutContext != null; + if (isConvenientTransaction && options?.timeoutMS != null) { + throw new error_1.MongoInvalidArgumentError("An operation cannot be given a timeoutMS setting when inside a withTransaction call that has a timeoutMS setting"); + } + return result; + } + function isSuperset(set, subset) { + set = Array.isArray(set) ? new Set(set) : set; + subset = Array.isArray(subset) ? new Set(subset) : subset; + for (const elem of subset) { + if (!set.has(elem)) { + return false; + } + } + return true; + } + function isHello(doc) { + return doc[constants_2.LEGACY_HELLO_COMMAND] || doc.hello ? true : false; + } + function setDifference(setA, setB) { + const difference = new Set(setA); + for (const elem of setB) { + difference.delete(elem); + } + return difference; + } + var HAS_OWN = (object, prop) => Object.prototype.hasOwnProperty.call(object, prop); + function isRecord(value, requiredKeys = void 0) { + if (!isObject(value)) { + return false; + } + const ctor = value.constructor; + if (ctor && ctor.prototype) { + if (!isObject(ctor.prototype)) { + return false; + } + if (!HAS_OWN(ctor.prototype, "isPrototypeOf")) { + return false; + } + } + if (requiredKeys) { + const keys = Object.keys(value); + return isSuperset(keys, requiredKeys); + } + return true; + } + var List = class { + get length() { + return this.count; + } + get [Symbol.toStringTag]() { + return "List"; + } + constructor() { + this.count = 0; + this.head = { + next: null, + prev: null, + value: null + }; + this.head.next = this.head; + this.head.prev = this.head; + } + toArray() { + return Array.from(this); + } + toString() { + return `head <=> ${this.toArray().join(" <=> ")} <=> head`; + } + *[Symbol.iterator]() { + for (const node of this.nodes()) { + yield node.value; + } + } + *nodes() { + let ptr = this.head.next; + while (ptr !== this.head) { + const { next } = ptr; + yield ptr; + ptr = next; + } + } + /** Insert at end of list */ + push(value) { + this.count += 1; + const newNode = { + next: this.head, + prev: this.head.prev, + value + }; + this.head.prev.next = newNode; + this.head.prev = newNode; + } + /** Inserts every item inside an iterable instead of the iterable itself */ + pushMany(iterable) { + for (const value of iterable) { + this.push(value); + } + } + /** Insert at front of list */ + unshift(value) { + this.count += 1; + const newNode = { + next: this.head.next, + prev: this.head, + value + }; + this.head.next.prev = newNode; + this.head.next = newNode; + } + remove(node) { + if (node === this.head || this.length === 0) { + return null; + } + this.count -= 1; + const prevNode = node.prev; + const nextNode = node.next; + prevNode.next = nextNode; + nextNode.prev = prevNode; + return node.value; + } + /** Removes the first node at the front of the list */ + shift() { + return this.remove(this.head.next); + } + /** Removes the last node at the end of the list */ + pop() { + return this.remove(this.head.prev); + } + /** Iterates through the list and removes nodes where filter returns true */ + prune(filter) { + for (const node of this.nodes()) { + if (filter(node.value)) { + this.remove(node); + } + } + } + clear() { + this.count = 0; + this.head.next = this.head; + this.head.prev = this.head; + } + /** Returns the first item in the list, does not remove */ + first() { + return this.head.next.value; + } + /** Returns the last item in the list, does not remove */ + last() { + return this.head.prev.value; + } + }; + exports2.List = List; + var BufferPool = class { + constructor() { + this.buffers = new List(); + this.totalByteLength = 0; + } + get length() { + return this.totalByteLength; + } + /** Adds a buffer to the internal buffer pool list */ + append(buffer) { + this.buffers.push(buffer); + this.totalByteLength += buffer.length; + } + /** + * If BufferPool contains 4 bytes or more construct an int32 from the leading bytes, + * otherwise return null. Size can be negative, caller should error check. + */ + getInt32() { + if (this.totalByteLength < 4) { + return null; + } + const firstBuffer = this.buffers.first(); + if (firstBuffer != null && firstBuffer.byteLength >= 4) { + return firstBuffer.readInt32LE(0); + } + const top4Bytes = this.read(4); + const value = top4Bytes.readInt32LE(0); + this.totalByteLength += 4; + this.buffers.unshift(top4Bytes); + return value; + } + /** Reads the requested number of bytes, optionally consuming them */ + read(size) { + if (typeof size !== "number" || size < 0) { + throw new error_1.MongoInvalidArgumentError('Argument "size" must be a non-negative number'); + } + if (size > this.totalByteLength) { + return Buffer.alloc(0); + } + const result = Buffer.allocUnsafe(size); + for (let bytesRead = 0; bytesRead < size; ) { + const buffer = this.buffers.shift(); + if (buffer == null) { + break; + } + const bytesRemaining = size - bytesRead; + const bytesReadable = Math.min(bytesRemaining, buffer.byteLength); + const bytes = buffer.subarray(0, bytesReadable); + result.set(bytes, bytesRead); + bytesRead += bytesReadable; + this.totalByteLength -= bytesReadable; + if (bytesReadable < buffer.byteLength) { + this.buffers.unshift(buffer.subarray(bytesReadable)); + } + } + return result; + } + }; + exports2.BufferPool = BufferPool; + var HostAddress = class _HostAddress { + constructor(hostString) { + this.host = void 0; + this.port = void 0; + this.socketPath = void 0; + this.isIPv6 = false; + const escapedHost = hostString.split(" ").join("%20"); + if (escapedHost.endsWith(".sock")) { + this.socketPath = decodeURIComponent(escapedHost); + return; + } + const urlString = `iLoveJS://${escapedHost}`; + let url2; + try { + url2 = new url_1.URL(urlString); + } catch (urlError) { + const runtimeError = new error_1.MongoRuntimeError(`Unable to parse ${escapedHost} with URL`); + runtimeError.cause = urlError; + throw runtimeError; + } + const hostname = url2.hostname; + const port = url2.port; + let normalized = decodeURIComponent(hostname).toLowerCase(); + if (normalized.startsWith("[") && normalized.endsWith("]")) { + this.isIPv6 = true; + normalized = normalized.substring(1, hostname.length - 1); + } + this.host = normalized.toLowerCase(); + if (typeof port === "number") { + this.port = port; + } else if (typeof port === "string" && port !== "") { + this.port = Number.parseInt(port, 10); + } else { + this.port = 27017; + } + if (this.port === 0) { + throw new error_1.MongoParseError("Invalid port (zero) with hostname"); + } + Object.freeze(this); + } + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { + return this.inspect(); + } + inspect() { + return `new HostAddress('${this.toString()}')`; + } + toString() { + if (typeof this.host === "string") { + if (this.isIPv6) { + return `[${this.host}]:${this.port}`; + } + return `${this.host}:${this.port}`; + } + return `${this.socketPath}`; + } + static fromString(s4) { + return new _HostAddress(s4); + } + static fromHostPort(host, port) { + if (host.includes(":")) { + host = `[${host}]`; + } + return _HostAddress.fromString(`${host}:${port}`); + } + static fromSrvRecord({ name, port }) { + return _HostAddress.fromHostPort(name, port); + } + toHostPort() { + if (this.socketPath) { + return { host: this.socketPath, port: 0 }; + } + const host = this.host ?? ""; + const port = this.port ?? 0; + return { host, port }; + } + }; + exports2.HostAddress = HostAddress; + exports2.DEFAULT_PK_FACTORY = { + // We prefer not to rely on ObjectId having a createPk method + createPk() { + return new bson_1.ObjectId(); + } + }; + exports2.MONGODB_WARNING_CODE = "MONGODB DRIVER"; + function emitWarning(message2) { + return process.emitWarning(message2, { code: exports2.MONGODB_WARNING_CODE }); + } + var emittedWarnings = /* @__PURE__ */ new Set(); + function emitWarningOnce(message2) { + if (!emittedWarnings.has(message2)) { + emittedWarnings.add(message2); + return emitWarning(message2); + } + } + function enumToString(en) { + return Object.values(en).join(", "); + } + function supportsRetryableWrites(server) { + if (!server) { + return false; + } + if (server.loadBalanced) { + return true; + } + if (server.description.logicalSessionTimeoutMinutes != null) { + if (server.description.type !== common_1.ServerType.Standalone) { + return true; + } + } + return false; + } + function shuffle(sequence, limit = 0) { + const items = Array.from(sequence); + if (limit > items.length) { + throw new error_1.MongoRuntimeError("Limit must be less than the number of items"); + } + let remainingItemsToShuffle = items.length; + const lowerBound = limit % items.length === 0 ? 1 : items.length - limit; + while (remainingItemsToShuffle > lowerBound) { + const randomIndex = Math.floor(Math.random() * remainingItemsToShuffle); + remainingItemsToShuffle -= 1; + const swapHold = items[remainingItemsToShuffle]; + items[remainingItemsToShuffle] = items[randomIndex]; + items[randomIndex] = swapHold; + } + return limit % items.length === 0 ? items : items.slice(lowerBound); + } + function commandSupportsReadConcern(command) { + if (command.aggregate || command.count || command.distinct || command.find || command.geoNear) { + return true; + } + return false; + } + function compareObjectId(oid1, oid2) { + if (oid1 == null && oid2 == null) { + return 0; + } + if (oid1 == null) { + return -1; + } + if (oid2 == null) { + return 1; + } + return exports2.ByteUtils.compare(oid1.id, oid2.id); + } + function parseInteger(value) { + if (typeof value === "number") + return Math.trunc(value); + const parsedValue = Number.parseInt(String(value), 10); + return Number.isNaN(parsedValue) ? null : parsedValue; + } + function parseUnsignedInteger(value) { + const parsedInt = parseInteger(value); + return parsedInt != null && parsedInt >= 0 ? parsedInt : null; + } + function checkParentDomainMatch(address, srvHost) { + const normalizedAddress = address.endsWith(".") ? address.slice(0, address.length - 1) : address; + const normalizedSrvHost = srvHost.endsWith(".") ? srvHost.slice(0, srvHost.length - 1) : srvHost; + const allCharacterBeforeFirstDot = /^.*?\./; + const srvIsLessThanThreeParts = normalizedSrvHost.split(".").length < 3; + const addressDomain = `.${normalizedAddress.replace(allCharacterBeforeFirstDot, "")}`; + let srvHostDomain = srvIsLessThanThreeParts ? normalizedSrvHost : `.${normalizedSrvHost.replace(allCharacterBeforeFirstDot, "")}`; + if (!srvHostDomain.startsWith(".")) { + srvHostDomain = "." + srvHostDomain; + } + if (srvIsLessThanThreeParts && normalizedAddress.split(".").length <= normalizedSrvHost.split(".").length) { + throw new error_1.MongoAPIError("Server record does not have at least one more domain level than parent URI"); + } + if (!addressDomain.endsWith(srvHostDomain)) { + throw new error_1.MongoAPIError("Server record does not share hostname with parent URI"); + } + } + function get2(url2, options = {}) { + return new Promise((resolve, reject) => { + let timeoutId; + const request2 = http.get(url2, options, (response) => { + response.setEncoding("utf8"); + let body = ""; + response.on("data", (chunk) => body += chunk); + response.on("end", () => { + (0, timers_1.clearTimeout)(timeoutId); + resolve({ status: response.statusCode, body }); + }); + }).on("error", (error2) => { + (0, timers_1.clearTimeout)(timeoutId); + reject(error2); + }).end(); + timeoutId = (0, timers_1.setTimeout)(() => { + request2.destroy(new error_1.MongoNetworkTimeoutError(`request timed out after 10 seconds`)); + }, 1e4); + }); + } + async function request(uri, options = {}) { + return await new Promise((resolve, reject) => { + const requestOptions = { + method: "GET", + timeout: 1e4, + json: true, + ...url.parse(uri), + ...options + }; + const req = http.request(requestOptions, (res) => { + res.setEncoding("utf8"); + let data2 = ""; + res.on("data", (d4) => { + data2 += d4; + }); + res.once("end", () => { + if (options.json === false) { + resolve(data2); + return; + } + try { + const parsed = JSON.parse(data2); + resolve(parsed); + } catch { + reject(new error_1.MongoRuntimeError(`Invalid JSON response: "${data2}"`)); + } + }); + }); + req.once("timeout", () => req.destroy(new error_1.MongoNetworkTimeoutError(`Network request to ${uri} timed out after ${options.timeout} ms`))); + req.once("error", (error2) => reject(error2)); + req.end(); + }); + } + exports2.DOCUMENT_DB_CHECK = /(\.docdb\.amazonaws\.com$)|(\.docdb-elastic\.amazonaws\.com$)/; + exports2.COSMOS_DB_CHECK = /\.cosmos\.azure\.com$/; + exports2.DOCUMENT_DB_MSG = "You appear to be connected to a DocumentDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/documentdb"; + exports2.COSMOS_DB_MSG = "You appear to be connected to a CosmosDB cluster. For more information regarding feature compatibility and support please visit https://www.mongodb.com/supportability/cosmosdb"; + function isHostMatch(match, host) { + return host && match.test(host.toLowerCase()) ? true : false; + } + function promiseWithResolvers() { + let resolve; + let reject; + const promise = new Promise(function withResolversExecutor(promiseResolve, promiseReject) { + resolve = promiseResolve; + reject = promiseReject; + }); + return { promise, resolve, reject }; + } + function squashError(_error) { + return; + } + exports2.randomBytes = (0, util_1.promisify)(crypto2.randomBytes); + async function once(ee, name, options) { + options?.signal?.throwIfAborted(); + const { promise, resolve, reject } = promiseWithResolvers(); + const onEvent = (data2) => resolve(data2); + const onError = (error2) => reject(error2); + const abortListener = addAbortListener(options?.signal, function() { + reject(this.reason); + }); + ee.once(name, onEvent).once("error", onError); + try { + return await promise; + } finally { + ee.off(name, onEvent); + ee.off("error", onError); + abortListener?.[exports2.kDispose](); + } + } + function maybeAddIdToDocuments(collection, document2, options) { + const forceServerObjectId = options.forceServerObjectId ?? collection.db.options?.forceServerObjectId ?? false; + if (forceServerObjectId) { + return document2; + } + if (document2._id == null) { + document2._id = collection.s.pkFactory.createPk(); + } + return document2; + } + async function fileIsAccessible(fileName, mode) { + try { + await fs_1.promises.access(fileName, mode); + return true; + } catch { + return false; + } + } + function csotMin(duration1, duration2) { + if (duration1 === 0) + return duration2; + if (duration2 === 0) + return duration1; + return Math.min(duration1, duration2); + } + function noop() { + return; + } + function decorateDecryptionResult(decrypted, original, isTopLevelDecorateCall = true) { + if (isTopLevelDecorateCall) { + if (Buffer.isBuffer(original)) { + original = (0, bson_1.deserialize)(original); + } + if (Buffer.isBuffer(decrypted)) { + throw new error_1.MongoRuntimeError("Expected result of decryption to be deserialized BSON object"); + } + } + if (!decrypted || typeof decrypted !== "object") + return; + for (const k4 of Object.keys(decrypted)) { + const originalValue = original[k4]; + if (originalValue && originalValue._bsontype === "Binary" && originalValue.sub_type === 6) { + if (!decrypted[constants_2.kDecoratedKeys]) { + Object.defineProperty(decrypted, constants_2.kDecoratedKeys, { + value: [], + configurable: true, + enumerable: false, + writable: false + }); + } + decrypted[constants_2.kDecoratedKeys].push(k4); + continue; + } + decorateDecryptionResult(decrypted[k4], originalValue, false); + } + } + exports2.kDispose = Symbol.dispose ?? /* @__PURE__ */ Symbol("dispose"); + function addAbortListener(signal, listener) { + if (signal == null) + return; + signal.addEventListener("abort", listener, { once: true }); + return { [exports2.kDispose]: () => signal.removeEventListener("abort", listener) }; + } + async function abortable(promise, { signal }) { + if (signal == null) { + return await promise; + } + const { promise: aborted, reject } = promiseWithResolvers(); + const abortListener = signal.aborted ? reject(signal.reason) : addAbortListener(signal, function() { + reject(this.reason); + }); + try { + return await Promise.race([promise, aborted]); + } finally { + abortListener?.[exports2.kDispose](); + } + } + } +}); + +// node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js +var require_document = __commonJS({ + "node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OnDemandDocument = void 0; + var bson_1 = require_bson2(); + var BSONElementOffset = { + type: 0, + nameOffset: 1, + nameLength: 2, + offset: 3, + length: 4 + }; + var OnDemandDocument = class _OnDemandDocument { + constructor(bson, offset = 0, isArray = false, elements) { + this.cache = /* @__PURE__ */ Object.create(null); + this.indexFound = /* @__PURE__ */ Object.create(null); + this.bson = bson; + this.offset = offset; + this.isArray = isArray; + this.elements = elements ?? (0, bson_1.parseToElementsToArray)(this.bson, offset); + } + /** Only supports basic latin strings */ + isElementName(name, element) { + const nameLength = element[BSONElementOffset.nameLength]; + const nameOffset = element[BSONElementOffset.nameOffset]; + if (name.length !== nameLength) + return false; + const nameEnd = nameOffset + nameLength; + for (let byteIndex = nameOffset, charIndex = 0; charIndex < name.length && byteIndex < nameEnd; charIndex++, byteIndex++) { + if (this.bson[byteIndex] !== name.charCodeAt(charIndex)) + return false; + } + return true; + } + /** + * Seeks into the elements array for an element matching the given name. + * + * @remarks + * Caching: + * - Caches the existence of a property making subsequent look ups for non-existent properties return immediately + * - Caches names mapped to elements to avoid reiterating the array and comparing the name again + * - Caches the index at which an element has been found to prevent rechecking against elements already determined to belong to another name + * + * @param name - a basic latin string name of a BSON element + * @returns + */ + getElement(name) { + const cachedElement = this.cache[name]; + if (cachedElement === false) + return null; + if (cachedElement != null) { + return cachedElement; + } + if (typeof name === "number") { + if (this.isArray) { + if (name < this.elements.length) { + const element = this.elements[name]; + const cachedElement2 = { element, value: void 0 }; + this.cache[name] = cachedElement2; + this.indexFound[name] = true; + return cachedElement2; + } else { + return null; + } + } else { + return null; + } + } + for (let index = 0; index < this.elements.length; index++) { + const element = this.elements[index]; + if (!(index in this.indexFound) && this.isElementName(name, element)) { + const cachedElement2 = { element, value: void 0 }; + this.cache[name] = cachedElement2; + this.indexFound[index] = true; + return cachedElement2; + } + } + this.cache[name] = false; + return null; + } + toJSValue(element, as) { + const type = element[BSONElementOffset.type]; + const offset = element[BSONElementOffset.offset]; + const length = element[BSONElementOffset.length]; + if (as !== type) { + return null; + } + switch (as) { + case bson_1.BSONType.null: + case bson_1.BSONType.undefined: + return null; + case bson_1.BSONType.double: + return (0, bson_1.getFloat64LE)(this.bson, offset); + case bson_1.BSONType.int: + return (0, bson_1.getInt32LE)(this.bson, offset); + case bson_1.BSONType.long: + return (0, bson_1.getBigInt64LE)(this.bson, offset); + case bson_1.BSONType.bool: + return Boolean(this.bson[offset]); + case bson_1.BSONType.objectId: + return new bson_1.ObjectId(this.bson.subarray(offset, offset + 12)); + case bson_1.BSONType.timestamp: + return new bson_1.Timestamp((0, bson_1.getBigInt64LE)(this.bson, offset)); + case bson_1.BSONType.string: + return (0, bson_1.toUTF8)(this.bson, offset + 4, offset + length - 1, false); + case bson_1.BSONType.binData: { + const totalBinarySize = (0, bson_1.getInt32LE)(this.bson, offset); + const subType = this.bson[offset + 4]; + if (subType === 2) { + const subType2BinarySize = (0, bson_1.getInt32LE)(this.bson, offset + 1 + 4); + if (subType2BinarySize < 0) + throw new bson_1.BSONError("Negative binary type element size found for subtype 0x02"); + if (subType2BinarySize > totalBinarySize - 4) + throw new bson_1.BSONError("Binary type with subtype 0x02 contains too long binary size"); + if (subType2BinarySize < totalBinarySize - 4) + throw new bson_1.BSONError("Binary type with subtype 0x02 contains too short binary size"); + return new bson_1.Binary(this.bson.subarray(offset + 1 + 4 + 4, offset + 1 + 4 + 4 + subType2BinarySize), 2); + } + return new bson_1.Binary(this.bson.subarray(offset + 1 + 4, offset + 1 + 4 + totalBinarySize), subType); + } + case bson_1.BSONType.date: + return new Date(Number((0, bson_1.getBigInt64LE)(this.bson, offset))); + case bson_1.BSONType.object: + return new _OnDemandDocument(this.bson, offset); + case bson_1.BSONType.array: + return new _OnDemandDocument(this.bson, offset, true); + default: + throw new bson_1.BSONError(`Unsupported BSON type: ${as}`); + } + } + /** + * Returns the number of elements in this BSON document + */ + size() { + return this.elements.length; + } + /** + * Checks for the existence of an element by name. + * + * @remarks + * Uses `getElement` with the expectation that will populate caches such that a `has` call + * followed by a `getElement` call will not repeat the cost paid by the first look up. + * + * @param name - element name + */ + has(name) { + const cachedElement = this.cache[name]; + if (cachedElement === false) + return false; + if (cachedElement != null) + return true; + return this.getElement(name) != null; + } + get(name, as, required) { + const element = this.getElement(name); + if (element == null) { + if (required === true) { + throw new bson_1.BSONError(`BSON element "${name}" is missing`); + } else { + return null; + } + } + if (element.value == null) { + const value = this.toJSValue(element.element, as); + if (value == null) { + if (required === true) { + throw new bson_1.BSONError(`BSON element "${name}" is missing`); + } else { + return null; + } + } + element.value = value; + } + return element.value; + } + getNumber(name, required) { + const maybeBool = this.get(name, bson_1.BSONType.bool); + const bool = maybeBool == null ? null : maybeBool ? 1 : 0; + const maybeLong = this.get(name, bson_1.BSONType.long); + const long = maybeLong == null ? null : Number(maybeLong); + const result = bool ?? long ?? this.get(name, bson_1.BSONType.int) ?? this.get(name, bson_1.BSONType.double); + if (required === true && result == null) { + throw new bson_1.BSONError(`BSON element "${name}" is missing`); + } + return result; + } + /** + * Deserialize this object, DOES NOT cache result so avoid multiple invocations + * @param options - BSON deserialization options + */ + toObject(options) { + return (0, bson_1.deserialize)(this.bson, { + ...options, + index: this.offset, + allowObjectSmallerThanBufferSize: true + }); + } + /** Returns this document's bytes only */ + toBytes() { + const size = (0, bson_1.getInt32LE)(this.bson, this.offset); + return this.bson.subarray(this.offset, this.offset + size); + } + }; + exports2.OnDemandDocument = OnDemandDocument; + } +}); + +// node_modules/mongodb/lib/cmap/wire_protocol/responses.js +var require_responses = __commonJS({ + "node_modules/mongodb/lib/cmap/wire_protocol/responses.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ClientBulkWriteCursorResponse = exports2.ExplainedCursorResponse = exports2.CursorResponse = exports2.MongoDBResponse = void 0; + exports2.isErrorResponse = isErrorResponse; + var bson_1 = require_bson2(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var document_1 = require_document(); + var BSONElementOffset = { + type: 0, + nameOffset: 1, + nameLength: 2, + offset: 3, + length: 4 + }; + function isErrorResponse(bson, elements) { + for (let eIdx = 0; eIdx < elements.length; eIdx++) { + const element = elements[eIdx]; + if (element[BSONElementOffset.nameLength] === 2) { + const nameOffset = element[BSONElementOffset.nameOffset]; + if (bson[nameOffset] === 111 && bson[nameOffset + 1] === 107) { + const valueOffset = element[BSONElementOffset.offset]; + const valueLength = element[BSONElementOffset.length]; + for (let i4 = valueOffset; i4 < valueOffset + valueLength; i4++) { + if (bson[i4] !== 0) + return false; + } + return true; + } + } + } + return true; + } + var MongoDBResponse = class _MongoDBResponse extends document_1.OnDemandDocument { + get(name, as, required) { + try { + return super.get(name, as, required); + } catch (cause) { + throw new error_1.MongoUnexpectedServerResponseError(cause.message, { cause }); + } + } + static is(value) { + return value instanceof _MongoDBResponse; + } + static make(bson) { + const elements = (0, bson_1.parseToElementsToArray)(bson, 0); + const isError = isErrorResponse(bson, elements); + return isError ? new _MongoDBResponse(bson, 0, false, elements) : new this(bson, 0, false, elements); + } + /** + * Returns true iff: + * - ok is 0 and the top-level code === 50 + * - ok is 1 and the writeErrors array contains a code === 50 + * - ok is 1 and the writeConcern object contains a code === 50 + */ + get isMaxTimeExpiredError() { + const isTopLevel = this.ok === 0 && this.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired; + if (isTopLevel) + return true; + if (this.ok === 0) + return false; + const isWriteConcern = this.get("writeConcernError", bson_1.BSONType.object)?.getNumber("code") === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired; + if (isWriteConcern) + return true; + const writeErrors = this.get("writeErrors", bson_1.BSONType.array); + if (writeErrors?.size()) { + for (let i4 = 0; i4 < writeErrors.size(); i4++) { + const isWriteError = writeErrors.get(i4, bson_1.BSONType.object)?.getNumber("code") === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired; + if (isWriteError) + return true; + } + } + return false; + } + /** + * Drivers can safely assume that the `recoveryToken` field is always a BSON document but drivers MUST NOT modify the + * contents of the document. + */ + get recoveryToken() { + return this.get("recoveryToken", bson_1.BSONType.object)?.toObject({ + promoteValues: false, + promoteLongs: false, + promoteBuffers: false, + validation: { utf8: true } + }) ?? null; + } + /** + * The server creates a cursor in response to a snapshot find/aggregate command and reports atClusterTime within the cursor field in the response. + * For the distinct command the server adds a top-level atClusterTime field to the response. + * The atClusterTime field represents the timestamp of the read and is guaranteed to be majority committed. + */ + get atClusterTime() { + return this.get("cursor", bson_1.BSONType.object)?.get("atClusterTime", bson_1.BSONType.timestamp) ?? this.get("atClusterTime", bson_1.BSONType.timestamp); + } + get operationTime() { + return this.get("operationTime", bson_1.BSONType.timestamp); + } + /** Normalizes whatever BSON value is "ok" to a JS number 1 or 0. */ + get ok() { + return this.getNumber("ok") ? 1 : 0; + } + get $err() { + return this.get("$err", bson_1.BSONType.string); + } + get errmsg() { + return this.get("errmsg", bson_1.BSONType.string); + } + get code() { + return this.getNumber("code"); + } + get $clusterTime() { + if (!("clusterTime" in this)) { + const clusterTimeDoc = this.get("$clusterTime", bson_1.BSONType.object); + if (clusterTimeDoc == null) { + this.clusterTime = null; + return null; + } + const clusterTime = clusterTimeDoc.get("clusterTime", bson_1.BSONType.timestamp, true); + const signature = clusterTimeDoc.get("signature", bson_1.BSONType.object)?.toObject(); + this.clusterTime = { clusterTime, signature }; + } + return this.clusterTime ?? null; + } + toObject(options) { + const exactBSONOptions = { + ...(0, bson_1.pluckBSONSerializeOptions)(options ?? {}), + validation: (0, bson_1.parseUtf8ValidationOption)(options) + }; + return super.toObject(exactBSONOptions); + } + }; + exports2.MongoDBResponse = MongoDBResponse; + MongoDBResponse.empty = new MongoDBResponse(new Uint8Array([13, 0, 0, 0, 16, 111, 107, 0, 1, 0, 0, 0, 0])); + var CursorResponse = class _CursorResponse extends MongoDBResponse { + constructor() { + super(...arguments); + this._batch = null; + this.iterated = 0; + this._encryptedBatch = null; + } + /** + * This supports a feature of the FindCursor. + * It is an optimization to avoid an extra getMore when the limit has been reached + */ + static get emptyGetMore() { + return new _CursorResponse((0, bson_1.serialize)({ ok: 1, cursor: { id: 0n, nextBatch: [] } })); + } + static is(value) { + return value instanceof _CursorResponse || value === _CursorResponse.emptyGetMore; + } + get cursor() { + return this.get("cursor", bson_1.BSONType.object, true); + } + get id() { + try { + return bson_1.Long.fromBigInt(this.cursor.get("id", bson_1.BSONType.long, true)); + } catch (cause) { + throw new error_1.MongoUnexpectedServerResponseError(cause.message, { cause }); + } + } + get ns() { + const namespace = this.cursor.get("ns", bson_1.BSONType.string); + if (namespace != null) + return (0, utils_1.ns)(namespace); + return null; + } + get length() { + return Math.max(this.batchSize - this.iterated, 0); + } + get encryptedBatch() { + if (this.encryptedResponse == null) + return null; + if (this._encryptedBatch != null) + return this._encryptedBatch; + const cursor2 = this.encryptedResponse?.get("cursor", bson_1.BSONType.object); + if (cursor2?.has("firstBatch")) + this._encryptedBatch = cursor2.get("firstBatch", bson_1.BSONType.array, true); + else if (cursor2?.has("nextBatch")) + this._encryptedBatch = cursor2.get("nextBatch", bson_1.BSONType.array, true); + else + throw new error_1.MongoUnexpectedServerResponseError("Cursor document did not contain a batch"); + return this._encryptedBatch; + } + get batch() { + if (this._batch != null) + return this._batch; + const cursor2 = this.cursor; + if (cursor2.has("firstBatch")) + this._batch = cursor2.get("firstBatch", bson_1.BSONType.array, true); + else if (cursor2.has("nextBatch")) + this._batch = cursor2.get("nextBatch", bson_1.BSONType.array, true); + else + throw new error_1.MongoUnexpectedServerResponseError("Cursor document did not contain a batch"); + return this._batch; + } + get batchSize() { + return this.batch?.size(); + } + get postBatchResumeToken() { + return this.cursor.get("postBatchResumeToken", bson_1.BSONType.object)?.toObject({ + promoteValues: false, + promoteLongs: false, + promoteBuffers: false, + validation: { utf8: true } + }) ?? null; + } + shift(options) { + if (this.iterated >= this.batchSize) { + return null; + } + const result = this.batch.get(this.iterated, bson_1.BSONType.object, true) ?? null; + const encryptedResult = this.encryptedBatch?.get(this.iterated, bson_1.BSONType.object, true) ?? null; + this.iterated += 1; + if (options?.raw) { + return result.toBytes(); + } else { + const object = result.toObject(options); + if (encryptedResult) { + (0, utils_1.decorateDecryptionResult)(object, encryptedResult.toObject(options), true); + } + return object; + } + } + clear() { + this.iterated = this.batchSize; + } + }; + exports2.CursorResponse = CursorResponse; + var ExplainedCursorResponse = class extends CursorResponse { + constructor() { + super(...arguments); + this.isExplain = true; + this._length = 1; + } + get id() { + return bson_1.Long.fromBigInt(0n); + } + get batchSize() { + return 0; + } + get ns() { + return null; + } + get length() { + return this._length; + } + shift(options) { + if (this._length === 0) + return null; + this._length -= 1; + return this.toObject(options); + } + }; + exports2.ExplainedCursorResponse = ExplainedCursorResponse; + var ClientBulkWriteCursorResponse = class extends CursorResponse { + get insertedCount() { + return this.get("nInserted", bson_1.BSONType.int, true); + } + get upsertedCount() { + return this.get("nUpserted", bson_1.BSONType.int, true); + } + get matchedCount() { + return this.get("nMatched", bson_1.BSONType.int, true); + } + get modifiedCount() { + return this.get("nModified", bson_1.BSONType.int, true); + } + get deletedCount() { + return this.get("nDeleted", bson_1.BSONType.int, true); + } + get writeConcernError() { + return this.get("writeConcernError", bson_1.BSONType.object, false); + } + }; + exports2.ClientBulkWriteCursorResponse = ClientBulkWriteCursorResponse; + } +}); + +// node_modules/mongodb/lib/explain.js +var require_explain = __commonJS({ + "node_modules/mongodb/lib/explain.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Explain = exports2.ExplainVerbosity = void 0; + exports2.validateExplainTimeoutOptions = validateExplainTimeoutOptions; + exports2.decorateWithExplain = decorateWithExplain; + var error_1 = require_error(); + exports2.ExplainVerbosity = Object.freeze({ + queryPlanner: "queryPlanner", + queryPlannerExtended: "queryPlannerExtended", + executionStats: "executionStats", + allPlansExecution: "allPlansExecution" + }); + var Explain = class _Explain { + constructor(verbosity, maxTimeMS) { + if (typeof verbosity === "boolean") { + this.verbosity = verbosity ? exports2.ExplainVerbosity.allPlansExecution : exports2.ExplainVerbosity.queryPlanner; + } else { + this.verbosity = verbosity; + } + this.maxTimeMS = maxTimeMS; + } + static fromOptions({ explain } = {}) { + if (explain == null) + return; + if (typeof explain === "boolean" || typeof explain === "string") { + return new _Explain(explain); + } + const { verbosity, maxTimeMS } = explain; + return new _Explain(verbosity, maxTimeMS); + } + }; + exports2.Explain = Explain; + function validateExplainTimeoutOptions(options, explain) { + const { maxTimeMS, timeoutMS } = options; + if (timeoutMS != null && (maxTimeMS != null || explain?.maxTimeMS != null)) { + throw new error_1.MongoAPIError("Cannot use maxTimeMS with timeoutMS for explain commands."); + } + } + function decorateWithExplain(command, explain) { + const { verbosity, maxTimeMS } = explain; + const baseCommand = { explain: command, verbosity }; + if (typeof maxTimeMS === "number") { + baseCommand.maxTimeMS = maxTimeMS; + } + return baseCommand; + } + } +}); + +// node_modules/mongodb/lib/operations/operation.js +var require_operation = __commonJS({ + "node_modules/mongodb/lib/operations/operation.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AbstractOperation = exports2.Aspect = void 0; + exports2.defineAspects = defineAspects; + var bson_1 = require_bson2(); + var read_preference_1 = require_read_preference(); + exports2.Aspect = { + READ_OPERATION: /* @__PURE__ */ Symbol("READ_OPERATION"), + WRITE_OPERATION: /* @__PURE__ */ Symbol("WRITE_OPERATION"), + RETRYABLE: /* @__PURE__ */ Symbol("RETRYABLE"), + EXPLAINABLE: /* @__PURE__ */ Symbol("EXPLAINABLE"), + SKIP_COLLATION: /* @__PURE__ */ Symbol("SKIP_COLLATION"), + CURSOR_CREATING: /* @__PURE__ */ Symbol("CURSOR_CREATING"), + MUST_SELECT_SAME_SERVER: /* @__PURE__ */ Symbol("MUST_SELECT_SAME_SERVER"), + COMMAND_BATCHING: /* @__PURE__ */ Symbol("COMMAND_BATCHING"), + SUPPORTS_RAW_DATA: /* @__PURE__ */ Symbol("SUPPORTS_RAW_DATA") + }; + var AbstractOperation = class { + constructor(options = {}) { + this.readPreference = this.hasAspect(exports2.Aspect.WRITE_OPERATION) ? read_preference_1.ReadPreference.primary : read_preference_1.ReadPreference.fromOptions(options) ?? read_preference_1.ReadPreference.primary; + this.bsonOptions = (0, bson_1.resolveBSONOptions)(options); + this._session = options.session != null ? options.session : void 0; + this.options = options; + this.bypassPinningCheck = !!options.bypassPinningCheck; + } + hasAspect(aspect) { + const ctor = this.constructor; + if (ctor.aspects == null) { + return false; + } + return ctor.aspects.has(aspect); + } + // Make sure the session is not writable from outside this class. + get session() { + return this._session; + } + set session(session) { + this._session = session; + } + clearSession() { + this._session = void 0; + } + resetBatch() { + return true; + } + get canRetryRead() { + return this.hasAspect(exports2.Aspect.RETRYABLE) && this.hasAspect(exports2.Aspect.READ_OPERATION); + } + get canRetryWrite() { + return this.hasAspect(exports2.Aspect.RETRYABLE) && this.hasAspect(exports2.Aspect.WRITE_OPERATION); + } + /** + * Given an instance of a MongoDBResponse, map the response to the correct result type. For + * example, a `CountOperation` might map the response as follows: + * + * ```typescript + * override handleOk(response: InstanceType): TResult { + * return response.toObject(this.bsonOptions).n ?? 0; + * } + * + * // or, with type safety: + * override handleOk(response: InstanceType): TResult { + * return response.getNumber('n') ?? 0; + * } + * ``` + */ + handleOk(response) { + return response.toObject(this.bsonOptions); + } + /** + * Optional. + * + * If the operation performs error handling, such as wrapping, renaming the error, or squashing errors + * this method can be overridden. + */ + handleError(error2) { + throw error2; + } + }; + exports2.AbstractOperation = AbstractOperation; + function defineAspects(operation2, aspects) { + if (!Array.isArray(aspects) && !(aspects instanceof Set)) { + aspects = [aspects]; + } + aspects = new Set(aspects); + Object.defineProperty(operation2, "aspects", { + value: aspects, + writable: false + }); + return aspects; + } + } +}); + +// node_modules/mongodb/lib/operations/command.js +var require_command = __commonJS({ + "node_modules/mongodb/lib/operations/command.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.CommandOperation = void 0; + var constants_1 = require_constants(); + var error_1 = require_error(); + var explain_1 = require_explain(); + var read_concern_1 = require_read_concern(); + var utils_1 = require_utils3(); + var write_concern_1 = require_write_concern(); + var operation_1 = require_operation(); + var CommandOperation = class extends operation_1.AbstractOperation { + constructor(parent, options) { + super(options); + this.options = options ?? {}; + const dbNameOverride = options?.dbName || options?.authdb; + if (dbNameOverride) { + this.ns = new utils_1.MongoDBNamespace(dbNameOverride, "$cmd"); + } else { + this.ns = parent ? parent.s.namespace.withCollection("$cmd") : new utils_1.MongoDBNamespace("admin", "$cmd"); + } + this.readConcern = read_concern_1.ReadConcern.fromOptions(options); + this.writeConcern = write_concern_1.WriteConcern.fromOptions(options); + if (this.hasAspect(operation_1.Aspect.EXPLAINABLE)) { + this.explain = explain_1.Explain.fromOptions(options); + if (this.explain) + (0, explain_1.validateExplainTimeoutOptions)(this.options, this.explain); + } else if (options?.explain != null) { + throw new error_1.MongoInvalidArgumentError(`Option "explain" is not supported on this command`); + } + } + get canRetryWrite() { + if (this.hasAspect(operation_1.Aspect.EXPLAINABLE)) { + return this.explain == null; + } + return super.canRetryWrite; + } + buildOptions(timeoutContext) { + return { + ...this.options, + ...this.bsonOptions, + timeoutContext, + readPreference: this.readPreference, + session: this.session + }; + } + buildCommand(connection, session) { + const command = this.buildCommandDocument(connection, session); + const inTransaction = this.session && this.session.inTransaction(); + if (this.readConcern && (0, utils_1.commandSupportsReadConcern)(command) && !inTransaction) { + Object.assign(command, { readConcern: this.readConcern }); + } + if (this.writeConcern && this.hasAspect(operation_1.Aspect.WRITE_OPERATION) && !inTransaction) { + write_concern_1.WriteConcern.apply(command, this.writeConcern); + } + if (this.options.collation && typeof this.options.collation === "object" && !this.hasAspect(operation_1.Aspect.SKIP_COLLATION)) { + Object.assign(command, { collation: this.options.collation }); + } + if (typeof this.options.maxTimeMS === "number") { + command.maxTimeMS = this.options.maxTimeMS; + } + if (this.options.rawData != null && this.hasAspect(operation_1.Aspect.SUPPORTS_RAW_DATA) && (0, utils_1.maxWireVersion)(connection) >= constants_1.MIN_SUPPORTED_RAW_DATA_WIRE_VERSION) { + command.rawData = this.options.rawData; + } + if (this.hasAspect(operation_1.Aspect.EXPLAINABLE) && this.explain) { + return (0, explain_1.decorateWithExplain)(command, this.explain); + } + return command; + } + }; + exports2.CommandOperation = CommandOperation; + } +}); + +// node_modules/mongodb/lib/operations/delete.js +var require_delete = __commonJS({ + "node_modules/mongodb/lib/operations/delete.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DeleteManyOperation = exports2.DeleteOneOperation = exports2.DeleteOperation = void 0; + exports2.makeDeleteStatement = makeDeleteStatement; + var responses_1 = require_responses(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var command_1 = require_command(); + var operation_1 = require_operation(); + var DeleteOperation = class extends command_1.CommandOperation { + constructor(ns, statements, options) { + super(void 0, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.ns = ns; + this.statements = statements; + } + get commandName() { + return "delete"; + } + get canRetryWrite() { + if (super.canRetryWrite === false) { + return false; + } + return this.statements.every((op2) => op2.limit != null ? op2.limit > 0 : true); + } + buildCommandDocument(connection, _session) { + const options = this.options; + const ordered = typeof options.ordered === "boolean" ? options.ordered : true; + const command = { + delete: this.ns.collection, + deletes: this.statements, + ordered + }; + if (options.let) { + command.let = options.let; + } + if (options.comment !== void 0) { + command.comment = options.comment; + } + const unacknowledgedWrite = this.writeConcern && this.writeConcern.w === 0; + if (unacknowledgedWrite && (0, utils_1.maxWireVersion)(connection) < 9) { + if (this.statements.find((o4) => o4.hint)) { + throw new error_1.MongoCompatibilityError(`hint for the delete command is only supported on MongoDB 4.4+`); + } + } + return command; + } + }; + exports2.DeleteOperation = DeleteOperation; + var DeleteOneOperation = class extends DeleteOperation { + constructor(ns, filter, options) { + super(ns, [makeDeleteStatement(filter, { ...options, limit: 1 })], options); + } + handleOk(response) { + const res = super.handleOk(response); + if (this.explain) + return res; + if (res.code) + throw new error_1.MongoServerError(res); + if (res.writeErrors) + throw new error_1.MongoServerError(res.writeErrors[0]); + return { + acknowledged: this.writeConcern?.w !== 0, + deletedCount: res.n + }; + } + }; + exports2.DeleteOneOperation = DeleteOneOperation; + var DeleteManyOperation = class extends DeleteOperation { + constructor(ns, filter, options) { + super(ns, [makeDeleteStatement(filter, options)], options); + } + handleOk(response) { + const res = super.handleOk(response); + if (this.explain) + return res; + if (res.code) + throw new error_1.MongoServerError(res); + if (res.writeErrors) + throw new error_1.MongoServerError(res.writeErrors[0]); + return { + acknowledged: this.writeConcern?.w !== 0, + deletedCount: res.n + }; + } + }; + exports2.DeleteManyOperation = DeleteManyOperation; + function makeDeleteStatement(filter, options) { + const op2 = { + q: filter, + limit: typeof options.limit === "number" ? options.limit : 0 + }; + if (options.collation) { + op2.collation = options.collation; + } + if (options.hint) { + op2.hint = options.hint; + } + return op2; + } + (0, operation_1.defineAspects)(DeleteOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + (0, operation_1.defineAspects)(DeleteOneOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SKIP_COLLATION, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + (0, operation_1.defineAspects)(DeleteManyOperation, [ + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SKIP_COLLATION, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + } +}); + +// node_modules/mongodb/lib/sdam/server_selection.js +var require_server_selection = __commonJS({ + "node_modules/mongodb/lib/sdam/server_selection.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MIN_SECONDARY_WRITE_WIRE_VERSION = void 0; + exports2.writableServerSelector = writableServerSelector; + exports2.sameServerSelector = sameServerSelector; + exports2.secondaryWritableServerSelector = secondaryWritableServerSelector; + exports2.readPreferenceServerSelector = readPreferenceServerSelector; + var error_1 = require_error(); + var read_preference_1 = require_read_preference(); + var common_1 = require_common(); + var IDLE_WRITE_PERIOD = 1e4; + var SMALLEST_MAX_STALENESS_SECONDS = 90; + exports2.MIN_SECONDARY_WRITE_WIRE_VERSION = 13; + function writableServerSelector() { + return function writableServer(topologyDescription, servers) { + return latencyWindowReducer(topologyDescription, servers.filter((s4) => s4.isWritable)); + }; + } + function sameServerSelector(description) { + return function sameServerSelector2(topologyDescription, servers) { + if (!description) + return []; + return servers.filter((sd) => { + return sd.address === description.address && sd.type !== common_1.ServerType.Unknown; + }); + }; + } + function secondaryWritableServerSelector(wireVersion, readPreference) { + if (!readPreference || !wireVersion || wireVersion && wireVersion < exports2.MIN_SECONDARY_WRITE_WIRE_VERSION) { + return readPreferenceServerSelector(read_preference_1.ReadPreference.primary); + } + return readPreferenceServerSelector(readPreference); + } + function maxStalenessReducer(readPreference, topologyDescription, servers) { + if (readPreference.maxStalenessSeconds == null || readPreference.maxStalenessSeconds < 0) { + return servers; + } + const maxStaleness = readPreference.maxStalenessSeconds; + const maxStalenessVariance = (topologyDescription.heartbeatFrequencyMS + IDLE_WRITE_PERIOD) / 1e3; + if (maxStaleness < maxStalenessVariance) { + throw new error_1.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${maxStalenessVariance} seconds`); + } + if (maxStaleness < SMALLEST_MAX_STALENESS_SECONDS) { + throw new error_1.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${SMALLEST_MAX_STALENESS_SECONDS} seconds`); + } + if (topologyDescription.type === common_1.TopologyType.ReplicaSetWithPrimary) { + const primary = Array.from(topologyDescription.servers.values()).filter(primaryFilter)[0]; + return servers.reduce((result, server) => { + const stalenessMS = server.lastUpdateTime - server.lastWriteDate - (primary.lastUpdateTime - primary.lastWriteDate) + topologyDescription.heartbeatFrequencyMS; + const staleness = stalenessMS / 1e3; + const maxStalenessSeconds = readPreference.maxStalenessSeconds ?? 0; + if (staleness <= maxStalenessSeconds) { + result.push(server); + } + return result; + }, []); + } + if (topologyDescription.type === common_1.TopologyType.ReplicaSetNoPrimary) { + if (servers.length === 0) { + return servers; + } + const sMax = servers.reduce((max, s4) => s4.lastWriteDate > max.lastWriteDate ? s4 : max); + return servers.reduce((result, server) => { + const stalenessMS = sMax.lastWriteDate - server.lastWriteDate + topologyDescription.heartbeatFrequencyMS; + const staleness = stalenessMS / 1e3; + const maxStalenessSeconds = readPreference.maxStalenessSeconds ?? 0; + if (staleness <= maxStalenessSeconds) { + result.push(server); + } + return result; + }, []); + } + return servers; + } + function tagSetMatch(tagSet, serverTags) { + const keys = Object.keys(tagSet); + const serverTagKeys = Object.keys(serverTags); + for (let i4 = 0; i4 < keys.length; ++i4) { + const key = keys[i4]; + if (serverTagKeys.indexOf(key) === -1 || serverTags[key] !== tagSet[key]) { + return false; + } + } + return true; + } + function tagSetReducer(readPreference, servers) { + if (readPreference.tags == null || Array.isArray(readPreference.tags) && readPreference.tags.length === 0) { + return servers; + } + for (let i4 = 0; i4 < readPreference.tags.length; ++i4) { + const tagSet = readPreference.tags[i4]; + const serversMatchingTagset = servers.reduce((matched, server) => { + if (tagSetMatch(tagSet, server.tags)) + matched.push(server); + return matched; + }, []); + if (serversMatchingTagset.length) { + return serversMatchingTagset; + } + } + return []; + } + function latencyWindowReducer(topologyDescription, servers) { + const low = servers.reduce((min, server) => Math.min(server.roundTripTime, min), Infinity); + const high = low + topologyDescription.localThresholdMS; + return servers.reduce((result, server) => { + if (server.roundTripTime <= high && server.roundTripTime >= low) + result.push(server); + return result; + }, []); + } + function primaryFilter(server) { + return server.type === common_1.ServerType.RSPrimary; + } + function secondaryFilter(server) { + return server.type === common_1.ServerType.RSSecondary; + } + function nearestFilter(server) { + return server.type === common_1.ServerType.RSSecondary || server.type === common_1.ServerType.RSPrimary; + } + function knownFilter(server) { + return server.type !== common_1.ServerType.Unknown; + } + function loadBalancerFilter(server) { + return server.type === common_1.ServerType.LoadBalancer; + } + function readPreferenceServerSelector(readPreference) { + if (!readPreference.isValid()) { + throw new error_1.MongoInvalidArgumentError("Invalid read preference specified"); + } + return function readPreferenceServers(topologyDescription, servers, deprioritized = []) { + if (topologyDescription.type === common_1.TopologyType.LoadBalanced) { + return servers.filter(loadBalancerFilter); + } + if (topologyDescription.type === common_1.TopologyType.Unknown) { + return []; + } + if (topologyDescription.type === common_1.TopologyType.Single) { + return latencyWindowReducer(topologyDescription, servers.filter(knownFilter)); + } + if (topologyDescription.type === common_1.TopologyType.Sharded) { + const filtered = servers.filter((server) => { + return !deprioritized.includes(server); + }); + const selectable = filtered.length > 0 ? filtered : deprioritized; + return latencyWindowReducer(topologyDescription, selectable.filter(knownFilter)); + } + const mode = readPreference.mode; + if (mode === read_preference_1.ReadPreference.PRIMARY) { + return servers.filter(primaryFilter); + } + if (mode === read_preference_1.ReadPreference.PRIMARY_PREFERRED) { + const result = servers.filter(primaryFilter); + if (result.length) { + return result; + } + } + const filter = mode === read_preference_1.ReadPreference.NEAREST ? nearestFilter : secondaryFilter; + const selectedServers = latencyWindowReducer(topologyDescription, tagSetReducer(readPreference, maxStalenessReducer(readPreference, topologyDescription, servers.filter(filter)))); + if (mode === read_preference_1.ReadPreference.SECONDARY_PREFERRED && selectedServers.length === 0) { + return servers.filter(primaryFilter); + } + return selectedServers; + }; + } + } +}); + +// node_modules/mongodb/lib/timeout.js +var require_timeout = __commonJS({ + "node_modules/mongodb/lib/timeout.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.LegacyTimeoutContext = exports2.CSOTTimeoutContext = exports2.TimeoutContext = exports2.Timeout = exports2.TimeoutError = void 0; + var timers_1 = require("timers"); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var TimeoutError = class extends Error { + get name() { + return "TimeoutError"; + } + constructor(message2, options) { + super(message2, options); + this.duration = options.duration; + } + static is(error2) { + return error2 != null && typeof error2 === "object" && "name" in error2 && error2.name === "TimeoutError"; + } + }; + exports2.TimeoutError = TimeoutError; + var Timeout = class _Timeout extends Promise { + get remainingTime() { + if (this.timedOut) + return 0; + if (this.duration === 0) + return Infinity; + return this.start + this.duration - Math.trunc(performance.now()); + } + get timeElapsed() { + return Math.trunc(performance.now()) - this.start; + } + /** Create a new timeout that expires in `duration` ms */ + constructor(executor = () => null, options) { + const duration = options?.duration ?? 0; + const unref = !!options?.unref; + const rejection = options?.rejection; + if (duration < 0) { + throw new error_1.MongoInvalidArgumentError("Cannot create a Timeout with a negative duration"); + } + let reject; + super((_, promiseReject) => { + reject = promiseReject; + executor(utils_1.noop, promiseReject); + }); + this.ended = null; + this.timedOut = false; + this.cleared = false; + this.duration = duration; + this.start = Math.trunc(performance.now()); + if (rejection == null && this.duration > 0) { + this.id = (0, timers_1.setTimeout)(() => { + this.ended = Math.trunc(performance.now()); + this.timedOut = true; + reject(new TimeoutError(`Expired after ${duration}ms`, { duration })); + }, this.duration); + if (typeof this.id.unref === "function" && unref) { + this.id.unref(); + } + } else if (rejection != null) { + this.ended = Math.trunc(performance.now()); + this.timedOut = true; + reject(rejection); + } + } + /** + * Clears the underlying timeout. This method is idempotent + */ + clear() { + (0, timers_1.clearTimeout)(this.id); + this.id = void 0; + this.timedOut = false; + this.cleared = true; + } + throwIfExpired() { + if (this.timedOut) { + this.then(void 0, utils_1.squashError); + throw new TimeoutError("Timed out", { duration: this.duration }); + } + } + static expires(duration, unref) { + return new _Timeout(void 0, { duration, unref }); + } + static reject(rejection) { + return new _Timeout(void 0, { duration: 0, unref: true, rejection }); + } + }; + exports2.Timeout = Timeout; + function isLegacyTimeoutContextOptions(v4) { + return v4 != null && typeof v4 === "object" && "serverSelectionTimeoutMS" in v4 && typeof v4.serverSelectionTimeoutMS === "number" && "waitQueueTimeoutMS" in v4 && typeof v4.waitQueueTimeoutMS === "number"; + } + function isCSOTTimeoutContextOptions(v4) { + return v4 != null && typeof v4 === "object" && "serverSelectionTimeoutMS" in v4 && typeof v4.serverSelectionTimeoutMS === "number" && "timeoutMS" in v4 && typeof v4.timeoutMS === "number"; + } + var TimeoutContext = class { + static create(options) { + if (options.session?.timeoutContext != null) + return options.session?.timeoutContext; + if (isCSOTTimeoutContextOptions(options)) + return new CSOTTimeoutContext(options); + else if (isLegacyTimeoutContextOptions(options)) + return new LegacyTimeoutContext(options); + else + throw new error_1.MongoRuntimeError("Unrecognized options"); + } + }; + exports2.TimeoutContext = TimeoutContext; + var CSOTTimeoutContext = class _CSOTTimeoutContext extends TimeoutContext { + constructor(options) { + super(); + this.minRoundTripTime = 0; + this.start = Math.trunc(performance.now()); + this.timeoutMS = options.timeoutMS; + this.serverSelectionTimeoutMS = options.serverSelectionTimeoutMS; + this.socketTimeoutMS = options.socketTimeoutMS; + this.clearServerSelectionTimeout = false; + } + get maxTimeMS() { + return this.remainingTimeMS - this.minRoundTripTime; + } + get remainingTimeMS() { + const timePassed = Math.trunc(performance.now()) - this.start; + return this.timeoutMS <= 0 ? Infinity : this.timeoutMS - timePassed; + } + csotEnabled() { + return true; + } + get serverSelectionTimeout() { + if (typeof this._serverSelectionTimeout !== "object" || this._serverSelectionTimeout?.cleared) { + const { remainingTimeMS, serverSelectionTimeoutMS } = this; + if (remainingTimeMS <= 0) + return Timeout.reject(new error_1.MongoOperationTimeoutError(`Timed out in server selection after ${this.timeoutMS}ms`)); + const usingServerSelectionTimeoutMS = serverSelectionTimeoutMS !== 0 && (0, utils_1.csotMin)(remainingTimeMS, serverSelectionTimeoutMS) === serverSelectionTimeoutMS; + if (usingServerSelectionTimeoutMS) { + this._serverSelectionTimeout = Timeout.expires(serverSelectionTimeoutMS); + } else { + if (remainingTimeMS > 0 && Number.isFinite(remainingTimeMS)) { + this._serverSelectionTimeout = Timeout.expires(remainingTimeMS); + } else { + this._serverSelectionTimeout = null; + } + } + } + return this._serverSelectionTimeout; + } + get connectionCheckoutTimeout() { + if (typeof this._connectionCheckoutTimeout !== "object" || this._connectionCheckoutTimeout?.cleared) { + if (typeof this._serverSelectionTimeout === "object") { + this._connectionCheckoutTimeout = this._serverSelectionTimeout; + } else { + throw new error_1.MongoRuntimeError("Unreachable. If you are seeing this error, please file a ticket on the NODE driver project on Jira"); + } + } + return this._connectionCheckoutTimeout; + } + get timeoutForSocketWrite() { + const { remainingTimeMS } = this; + if (!Number.isFinite(remainingTimeMS)) + return null; + if (remainingTimeMS > 0) + return Timeout.expires(remainingTimeMS); + return Timeout.reject(new error_1.MongoOperationTimeoutError("Timed out before socket write")); + } + get timeoutForSocketRead() { + const { remainingTimeMS } = this; + if (!Number.isFinite(remainingTimeMS)) + return null; + if (remainingTimeMS > 0) + return Timeout.expires(remainingTimeMS); + return Timeout.reject(new error_1.MongoOperationTimeoutError("Timed out before socket read")); + } + refresh() { + this.start = Math.trunc(performance.now()); + this.minRoundTripTime = 0; + this._serverSelectionTimeout?.clear(); + this._connectionCheckoutTimeout?.clear(); + } + clear() { + this._serverSelectionTimeout?.clear(); + this._connectionCheckoutTimeout?.clear(); + } + /** + * @internal + * Throws a MongoOperationTimeoutError if the context has expired. + * If the context has not expired, returns the `remainingTimeMS` + **/ + getRemainingTimeMSOrThrow(message2) { + const { remainingTimeMS } = this; + if (remainingTimeMS <= 0) + throw new error_1.MongoOperationTimeoutError(message2 ?? `Expired after ${this.timeoutMS}ms`); + return remainingTimeMS; + } + /** + * @internal + * This method is intended to be used in situations where concurrent operation are on the same deadline, but cannot share a single `TimeoutContext` instance. + * Returns a new instance of `CSOTTimeoutContext` constructed with identical options, but setting the `start` property to `this.start`. + */ + clone() { + const timeoutContext = new _CSOTTimeoutContext({ + timeoutMS: this.timeoutMS, + serverSelectionTimeoutMS: this.serverSelectionTimeoutMS + }); + timeoutContext.start = this.start; + return timeoutContext; + } + refreshed() { + return new _CSOTTimeoutContext(this); + } + addMaxTimeMSToCommand(command, options) { + if (options.omitMaxTimeMS) + return; + const maxTimeMS = this.remainingTimeMS - this.minRoundTripTime; + if (maxTimeMS > 0 && Number.isFinite(maxTimeMS)) + command.maxTimeMS = maxTimeMS; + } + getSocketTimeoutMS() { + return 0; + } + }; + exports2.CSOTTimeoutContext = CSOTTimeoutContext; + var LegacyTimeoutContext = class _LegacyTimeoutContext extends TimeoutContext { + constructor(options) { + super(); + this.options = options; + this.clearServerSelectionTimeout = true; + } + csotEnabled() { + return false; + } + get serverSelectionTimeout() { + if (this.options.serverSelectionTimeoutMS != null && this.options.serverSelectionTimeoutMS > 0) + return Timeout.expires(this.options.serverSelectionTimeoutMS); + return null; + } + get connectionCheckoutTimeout() { + if (this.options.waitQueueTimeoutMS != null && this.options.waitQueueTimeoutMS > 0) + return Timeout.expires(this.options.waitQueueTimeoutMS); + return null; + } + get timeoutForSocketWrite() { + return null; + } + get timeoutForSocketRead() { + return null; + } + refresh() { + return; + } + clear() { + return; + } + get maxTimeMS() { + return null; + } + refreshed() { + return new _LegacyTimeoutContext(this.options); + } + addMaxTimeMSToCommand(_command, _options) { + } + getSocketTimeoutMS() { + return this.options.socketTimeoutMS; + } + }; + exports2.LegacyTimeoutContext = LegacyTimeoutContext; + } +}); + +// node_modules/mongodb/lib/operations/aggregate.js +var require_aggregate = __commonJS({ + "node_modules/mongodb/lib/operations/aggregate.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AggregateOperation = exports2.DB_AGGREGATE_COLLECTION = void 0; + var responses_1 = require_responses(); + var error_1 = require_error(); + var write_concern_1 = require_write_concern(); + var command_1 = require_command(); + var operation_1 = require_operation(); + exports2.DB_AGGREGATE_COLLECTION = 1; + var AggregateOperation = class extends command_1.CommandOperation { + constructor(ns, pipeline, options) { + super(void 0, { ...options, dbName: ns.db }); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.CursorResponse; + this.options = { ...options }; + this.target = ns.collection || exports2.DB_AGGREGATE_COLLECTION; + this.pipeline = pipeline; + this.hasWriteStage = false; + if (typeof options?.out === "string") { + this.pipeline = this.pipeline.concat({ $out: options.out }); + this.hasWriteStage = true; + } else if (pipeline.length > 0) { + const finalStage = pipeline[pipeline.length - 1]; + if (finalStage.$out || finalStage.$merge) { + this.hasWriteStage = true; + } + } + if (!this.hasWriteStage) { + delete this.options.writeConcern; + } + if (this.explain && this.writeConcern) { + throw new error_1.MongoInvalidArgumentError('Option "explain" cannot be used on an aggregate call with writeConcern'); + } + if (options?.cursor != null && typeof options.cursor !== "object") { + throw new error_1.MongoInvalidArgumentError("Cursor options must be an object"); + } + this.SERVER_COMMAND_RESPONSE_TYPE = this.explain ? responses_1.ExplainedCursorResponse : responses_1.CursorResponse; + } + get commandName() { + return "aggregate"; + } + get canRetryRead() { + return !this.hasWriteStage; + } + addToPipeline(stage) { + this.pipeline.push(stage); + } + buildCommandDocument() { + const options = this.options; + const command = { aggregate: this.target, pipeline: this.pipeline }; + if (this.hasWriteStage && this.writeConcern) { + write_concern_1.WriteConcern.apply(command, this.writeConcern); + } + if (options.bypassDocumentValidation === true) { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + if (typeof options.allowDiskUse === "boolean") { + command.allowDiskUse = options.allowDiskUse; + } + if (options.hint) { + command.hint = options.hint; + } + if (options.let) { + command.let = options.let; + } + if (options.comment !== void 0) { + command.comment = options.comment; + } + command.cursor = options.cursor || {}; + if (options.batchSize && !this.hasWriteStage) { + command.cursor.batchSize = options.batchSize; + } + return command; + } + handleOk(response) { + return response; + } + }; + exports2.AggregateOperation = AggregateOperation; + (0, operation_1.defineAspects)(AggregateOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.CURSOR_CREATING, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + } +}); + +// node_modules/mongodb/lib/operations/execute_operation.js +var require_execute_operation = __commonJS({ + "node_modules/mongodb/lib/operations/execute_operation.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.executeOperation = executeOperation; + exports2.autoConnect = autoConnect; + var error_1 = require_error(); + var read_preference_1 = require_read_preference(); + var server_selection_1 = require_server_selection(); + var timeout_1 = require_timeout(); + var utils_1 = require_utils3(); + var aggregate_1 = require_aggregate(); + var operation_1 = require_operation(); + var MMAPv1_RETRY_WRITES_ERROR_CODE = error_1.MONGODB_ERROR_CODES.IllegalOperation; + var MMAPv1_RETRY_WRITES_ERROR_MESSAGE = "This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string."; + async function executeOperation(client, operation2, timeoutContext) { + if (!(operation2 instanceof operation_1.AbstractOperation)) { + throw new error_1.MongoRuntimeError("This method requires a valid operation instance"); + } + const topology = client.topology == null ? await (0, utils_1.abortable)(autoConnect(client), operation2.options) : client.topology; + let session = operation2.session; + let owner; + if (session == null) { + owner = /* @__PURE__ */ Symbol(); + session = client.startSession({ owner, explicit: false }); + } else if (session.hasEnded) { + throw new error_1.MongoExpiredSessionError("Use of expired sessions is not permitted"); + } else if (session.snapshotEnabled && !topology.capabilities.supportsSnapshotReads) { + throw new error_1.MongoCompatibilityError("Snapshot reads require MongoDB 5.0 or later"); + } else if (session.client !== client) { + throw new error_1.MongoInvalidArgumentError("ClientSession must be from the same MongoClient"); + } + operation2.session ??= session; + const readPreference = operation2.readPreference ?? read_preference_1.ReadPreference.primary; + const inTransaction = !!session?.inTransaction(); + const hasReadAspect = operation2.hasAspect(operation_1.Aspect.READ_OPERATION); + if (inTransaction && !readPreference.equals(read_preference_1.ReadPreference.primary) && (hasReadAspect || operation2.commandName === "runCommand")) { + throw new error_1.MongoTransactionError(`Read preference in a transaction must be primary, not: ${readPreference.mode}`); + } + if (session?.isPinned && session.transaction.isCommitted && !operation2.bypassPinningCheck) { + session.unpin(); + } + timeoutContext ??= timeout_1.TimeoutContext.create({ + session, + serverSelectionTimeoutMS: client.s.options.serverSelectionTimeoutMS, + waitQueueTimeoutMS: client.s.options.waitQueueTimeoutMS, + timeoutMS: operation2.options.timeoutMS + }); + try { + return await tryOperation(operation2, { + topology, + timeoutContext, + session, + readPreference + }); + } finally { + if (session?.owner != null && session.owner === owner) { + await session.endSession(); + } + } + } + async function autoConnect(client) { + if (client.topology == null) { + if (client.s.hasBeenClosed) { + throw new error_1.MongoNotConnectedError("Client must be connected before running operations"); + } + client.s.options.__skipPingOnConnect = true; + try { + await client.connect(); + if (client.topology == null) { + throw new error_1.MongoRuntimeError("client.connect did not create a topology but also did not throw"); + } + return client.topology; + } finally { + delete client.s.options.__skipPingOnConnect; + } + } + return client.topology; + } + async function tryOperation(operation2, { topology, timeoutContext, session, readPreference }) { + let selector; + if (operation2.hasAspect(operation_1.Aspect.MUST_SELECT_SAME_SERVER)) { + selector = (0, server_selection_1.sameServerSelector)(operation2.server?.description); + } else if (operation2 instanceof aggregate_1.AggregateOperation && operation2.hasWriteStage) { + selector = (0, server_selection_1.secondaryWritableServerSelector)(topology.commonWireVersion, readPreference); + } else { + selector = readPreference; + } + let server = await topology.selectServer(selector, { + session, + operationName: operation2.commandName, + timeoutContext, + signal: operation2.options.signal + }); + const hasReadAspect = operation2.hasAspect(operation_1.Aspect.READ_OPERATION); + const hasWriteAspect = operation2.hasAspect(operation_1.Aspect.WRITE_OPERATION); + const inTransaction = session?.inTransaction() ?? false; + const willRetryRead = topology.s.options.retryReads && !inTransaction && operation2.canRetryRead; + const willRetryWrite = topology.s.options.retryWrites && !inTransaction && (0, utils_1.supportsRetryableWrites)(server) && operation2.canRetryWrite; + const willRetry = operation2.hasAspect(operation_1.Aspect.RETRYABLE) && session != null && (hasReadAspect && willRetryRead || hasWriteAspect && willRetryWrite); + if (hasWriteAspect && willRetryWrite && session != null) { + operation2.options.willRetryWrite = true; + session.incrementTransactionNumber(); + } + const maxTries = willRetry ? timeoutContext.csotEnabled() ? Infinity : 2 : 1; + let previousOperationError; + let previousServer; + for (let tries = 0; tries < maxTries; tries++) { + if (previousOperationError) { + if (hasWriteAspect && previousOperationError.code === MMAPv1_RETRY_WRITES_ERROR_CODE) { + throw new error_1.MongoServerError({ + message: MMAPv1_RETRY_WRITES_ERROR_MESSAGE, + errmsg: MMAPv1_RETRY_WRITES_ERROR_MESSAGE, + originalError: previousOperationError + }); + } + if (operation2.hasAspect(operation_1.Aspect.COMMAND_BATCHING) && !operation2.canRetryWrite) { + throw previousOperationError; + } + if (hasWriteAspect && !(0, error_1.isRetryableWriteError)(previousOperationError)) + throw previousOperationError; + if (hasReadAspect && !(0, error_1.isRetryableReadError)(previousOperationError)) { + throw previousOperationError; + } + if (previousOperationError instanceof error_1.MongoNetworkError && operation2.hasAspect(operation_1.Aspect.CURSOR_CREATING) && session != null && session.isPinned && !session.inTransaction()) { + session.unpin({ force: true, forceClear: true }); + } + server = await topology.selectServer(selector, { + session, + operationName: operation2.commandName, + previousServer, + signal: operation2.options.signal + }); + if (hasWriteAspect && !(0, utils_1.supportsRetryableWrites)(server)) { + throw new error_1.MongoUnexpectedServerResponseError("Selected server does not support retryable writes"); + } + } + operation2.server = server; + try { + if (tries > 0 && operation2.hasAspect(operation_1.Aspect.COMMAND_BATCHING)) { + operation2.resetBatch(); + } + try { + const result = await server.command(operation2, timeoutContext); + return operation2.handleOk(result); + } catch (error2) { + return operation2.handleError(error2); + } + } catch (operationError) { + if (!(operationError instanceof error_1.MongoError)) + throw operationError; + if (previousOperationError != null && operationError.hasErrorLabel(error_1.MongoErrorLabel.NoWritesPerformed)) { + throw previousOperationError; + } + previousServer = server.description; + previousOperationError = operationError; + timeoutContext.clear(); + } + } + throw previousOperationError ?? new error_1.MongoRuntimeError("Tried to propagate retryability error, but no error was found."); + } + } +}); + +// node_modules/mongodb/lib/operations/insert.js +var require_insert = __commonJS({ + "node_modules/mongodb/lib/operations/insert.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.InsertOneOperation = exports2.InsertOperation = void 0; + var responses_1 = require_responses(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var command_1 = require_command(); + var operation_1 = require_operation(); + var InsertOperation = class extends command_1.CommandOperation { + constructor(ns, documents, options) { + super(void 0, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = { ...options, checkKeys: options.checkKeys ?? false }; + this.ns = ns; + this.documents = documents; + } + get commandName() { + return "insert"; + } + buildCommandDocument(_connection, _session) { + const options = this.options ?? {}; + const ordered = typeof options.ordered === "boolean" ? options.ordered : true; + const command = { + insert: this.ns.collection, + documents: this.documents, + ordered + }; + if (typeof options.bypassDocumentValidation === "boolean") { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + if (options.comment !== void 0) { + command.comment = options.comment; + } + return command; + } + }; + exports2.InsertOperation = InsertOperation; + var InsertOneOperation = class extends InsertOperation { + constructor(collection, doc, options) { + super(collection.s.namespace, [(0, utils_1.maybeAddIdToDocuments)(collection, doc, options)], options); + } + handleOk(response) { + const res = super.handleOk(response); + if (res.code) + throw new error_1.MongoServerError(res); + if (res.writeErrors) { + throw new error_1.MongoServerError(res.writeErrors[0]); + } + return { + acknowledged: this.writeConcern?.w !== 0, + insertedId: this.documents[0]._id + }; + } + }; + exports2.InsertOneOperation = InsertOneOperation; + (0, operation_1.defineAspects)(InsertOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + (0, operation_1.defineAspects)(InsertOneOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + } +}); + +// node_modules/mongodb/lib/sort.js +var require_sort = __commonJS({ + "node_modules/mongodb/lib/sort.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.formatSort = formatSort; + var error_1 = require_error(); + function prepareDirection(direction = 1) { + const value = `${direction}`.toLowerCase(); + if (isMeta(direction)) + return direction; + switch (value) { + case "ascending": + case "asc": + case "1": + return 1; + case "descending": + case "desc": + case "-1": + return -1; + default: + throw new error_1.MongoInvalidArgumentError(`Invalid sort direction: ${JSON.stringify(direction)}`); + } + } + function isMeta(t4) { + return typeof t4 === "object" && t4 != null && "$meta" in t4 && typeof t4.$meta === "string"; + } + function isPair(t4) { + if (Array.isArray(t4) && t4.length === 2) { + try { + prepareDirection(t4[1]); + return true; + } catch { + return false; + } + } + return false; + } + function isDeep(t4) { + return Array.isArray(t4) && Array.isArray(t4[0]); + } + function isMap(t4) { + return t4 instanceof Map && t4.size > 0; + } + function isReadonlyArray(value) { + return Array.isArray(value); + } + function pairToMap(v4) { + return /* @__PURE__ */ new Map([[`${v4[0]}`, prepareDirection([v4[1]])]]); + } + function deepToMap(t4) { + const sortEntries = t4.map(([k4, v4]) => [`${k4}`, prepareDirection(v4)]); + return new Map(sortEntries); + } + function stringsToMap(t4) { + const sortEntries = t4.map((key) => [`${key}`, 1]); + return new Map(sortEntries); + } + function objectToMap(t4) { + const sortEntries = Object.entries(t4).map(([k4, v4]) => [ + `${k4}`, + prepareDirection(v4) + ]); + return new Map(sortEntries); + } + function mapToMap(t4) { + const sortEntries = Array.from(t4).map(([k4, v4]) => [ + `${k4}`, + prepareDirection(v4) + ]); + return new Map(sortEntries); + } + function formatSort(sort, direction) { + if (sort == null) + return void 0; + if (typeof sort === "string") + return /* @__PURE__ */ new Map([[sort, prepareDirection(direction)]]); + if (typeof sort !== "object") { + throw new error_1.MongoInvalidArgumentError(`Invalid sort format: ${JSON.stringify(sort)} Sort must be a valid object`); + } + if (!isReadonlyArray(sort)) { + if (isMap(sort)) + return mapToMap(sort); + if (Object.keys(sort).length) + return objectToMap(sort); + return void 0; + } + if (!sort.length) + return void 0; + if (isDeep(sort)) + return deepToMap(sort); + if (isPair(sort)) + return pairToMap(sort); + return stringsToMap(sort); + } + } +}); + +// node_modules/mongodb/lib/operations/update.js +var require_update = __commonJS({ + "node_modules/mongodb/lib/operations/update.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ReplaceOneOperation = exports2.UpdateManyOperation = exports2.UpdateOneOperation = exports2.UpdateOperation = void 0; + exports2.makeUpdateStatement = makeUpdateStatement; + var responses_1 = require_responses(); + var error_1 = require_error(); + var sort_1 = require_sort(); + var utils_1 = require_utils3(); + var command_1 = require_command(); + var operation_1 = require_operation(); + var UpdateOperation = class extends command_1.CommandOperation { + constructor(ns, statements, options) { + super(void 0, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.ns = ns; + this.statements = statements; + } + get commandName() { + return "update"; + } + get canRetryWrite() { + if (super.canRetryWrite === false) { + return false; + } + return this.statements.every((op2) => op2.multi == null || op2.multi === false); + } + buildCommandDocument(_connection, _session) { + const options = this.options; + const command = { + update: this.ns.collection, + updates: this.statements, + ordered: options.ordered ?? true + }; + if (typeof options.bypassDocumentValidation === "boolean") { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + if (options.let) { + command.let = options.let; + } + if (options.comment !== void 0) { + command.comment = options.comment; + } + return command; + } + }; + exports2.UpdateOperation = UpdateOperation; + var UpdateOneOperation = class extends UpdateOperation { + constructor(ns, filter, update, options) { + super(ns, [makeUpdateStatement(filter, update, { ...options, multi: false })], options); + if (!(0, utils_1.hasAtomicOperators)(update, options)) { + throw new error_1.MongoInvalidArgumentError("Update document requires atomic operators"); + } + } + handleOk(response) { + const res = super.handleOk(response); + if (this.explain != null) + return res; + if (res.code) + throw new error_1.MongoServerError(res); + if (res.writeErrors) + throw new error_1.MongoServerError(res.writeErrors[0]); + return { + acknowledged: this.writeConcern?.w !== 0, + modifiedCount: res.nModified ?? res.n, + upsertedId: Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }; + } + }; + exports2.UpdateOneOperation = UpdateOneOperation; + var UpdateManyOperation = class extends UpdateOperation { + constructor(ns, filter, update, options) { + super(ns, [makeUpdateStatement(filter, update, { ...options, multi: true })], options); + if (!(0, utils_1.hasAtomicOperators)(update, options)) { + throw new error_1.MongoInvalidArgumentError("Update document requires atomic operators"); + } + } + handleOk(response) { + const res = super.handleOk(response); + if (this.explain != null) + return res; + if (res.code) + throw new error_1.MongoServerError(res); + if (res.writeErrors) + throw new error_1.MongoServerError(res.writeErrors[0]); + return { + acknowledged: this.writeConcern?.w !== 0, + modifiedCount: res.nModified ?? res.n, + upsertedId: Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }; + } + }; + exports2.UpdateManyOperation = UpdateManyOperation; + var ReplaceOneOperation = class extends UpdateOperation { + constructor(ns, filter, replacement, options) { + super(ns, [makeUpdateStatement(filter, replacement, { ...options, multi: false })], options); + if ((0, utils_1.hasAtomicOperators)(replacement)) { + throw new error_1.MongoInvalidArgumentError("Replacement document must not contain atomic operators"); + } + } + handleOk(response) { + const res = super.handleOk(response); + if (this.explain != null) + return res; + if (res.code) + throw new error_1.MongoServerError(res); + if (res.writeErrors) + throw new error_1.MongoServerError(res.writeErrors[0]); + return { + acknowledged: this.writeConcern?.w !== 0, + modifiedCount: res.nModified ?? res.n, + upsertedId: Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }; + } + }; + exports2.ReplaceOneOperation = ReplaceOneOperation; + function makeUpdateStatement(filter, update, options) { + if (filter == null || typeof filter !== "object") { + throw new error_1.MongoInvalidArgumentError("Selector must be a valid JavaScript object"); + } + if (update == null || typeof update !== "object") { + throw new error_1.MongoInvalidArgumentError("Document must be a valid JavaScript object"); + } + const op2 = { q: filter, u: update }; + if (typeof options.upsert === "boolean") { + op2.upsert = options.upsert; + } + if (options.multi) { + op2.multi = options.multi; + } + if (options.hint) { + op2.hint = options.hint; + } + if (options.arrayFilters) { + op2.arrayFilters = options.arrayFilters; + } + if (options.collation) { + op2.collation = options.collation; + } + if (!options.multi && options.sort != null) { + op2.sort = (0, sort_1.formatSort)(options.sort); + } + return op2; + } + (0, operation_1.defineAspects)(UpdateOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.SKIP_COLLATION, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + (0, operation_1.defineAspects)(UpdateOneOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SKIP_COLLATION, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + (0, operation_1.defineAspects)(UpdateManyOperation, [ + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SKIP_COLLATION, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + (0, operation_1.defineAspects)(ReplaceOneOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.SKIP_COLLATION, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + } +}); + +// node_modules/mongodb/lib/bulk/common.js +var require_common2 = __commonJS({ + "node_modules/mongodb/lib/bulk/common.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.BulkOperationBase = exports2.FindOperators = exports2.MongoBulkWriteError = exports2.WriteError = exports2.WriteConcernError = exports2.BulkWriteResult = exports2.Batch = exports2.BatchType = void 0; + exports2.mergeBatchResults = mergeBatchResults; + var bson_1 = require_bson2(); + var error_1 = require_error(); + var delete_1 = require_delete(); + var execute_operation_1 = require_execute_operation(); + var insert_1 = require_insert(); + var update_1 = require_update(); + var timeout_1 = require_timeout(); + var utils_1 = require_utils3(); + var write_concern_1 = require_write_concern(); + exports2.BatchType = Object.freeze({ + INSERT: 1, + UPDATE: 2, + DELETE: 3 + }); + var Batch = class { + constructor(batchType, originalZeroIndex) { + this.originalZeroIndex = originalZeroIndex; + this.currentIndex = 0; + this.originalIndexes = []; + this.batchType = batchType; + this.operations = []; + this.size = 0; + this.sizeBytes = 0; + } + }; + exports2.Batch = Batch; + var BulkWriteResult = class _BulkWriteResult { + static generateIdMap(ids) { + const idMap = {}; + for (const doc of ids) { + idMap[doc.index] = doc._id; + } + return idMap; + } + /** + * Create a new BulkWriteResult instance + * @internal + */ + constructor(bulkResult, isOrdered) { + this.result = bulkResult; + this.insertedCount = this.result.nInserted ?? 0; + this.matchedCount = this.result.nMatched ?? 0; + this.modifiedCount = this.result.nModified ?? 0; + this.deletedCount = this.result.nRemoved ?? 0; + this.upsertedCount = this.result.upserted.length ?? 0; + this.upsertedIds = _BulkWriteResult.generateIdMap(this.result.upserted); + this.insertedIds = _BulkWriteResult.generateIdMap(this.getSuccessfullyInsertedIds(bulkResult, isOrdered)); + Object.defineProperty(this, "result", { value: this.result, enumerable: false }); + } + /** Evaluates to true if the bulk operation correctly executes */ + get ok() { + return this.result.ok; + } + /** + * Returns document_ids that were actually inserted + * @internal + */ + getSuccessfullyInsertedIds(bulkResult, isOrdered) { + if (bulkResult.writeErrors.length === 0) + return bulkResult.insertedIds; + if (isOrdered) { + return bulkResult.insertedIds.slice(0, bulkResult.writeErrors[0].index); + } + return bulkResult.insertedIds.filter(({ index }) => !bulkResult.writeErrors.some((writeError) => index === writeError.index)); + } + /** Returns the upserted id at the given index */ + getUpsertedIdAt(index) { + return this.result.upserted[index]; + } + /** Returns raw internal result */ + getRawResponse() { + return this.result; + } + /** Returns true if the bulk operation contains a write error */ + hasWriteErrors() { + return this.result.writeErrors.length > 0; + } + /** Returns the number of write errors from the bulk operation */ + getWriteErrorCount() { + return this.result.writeErrors.length; + } + /** Returns a specific write error object */ + getWriteErrorAt(index) { + return index < this.result.writeErrors.length ? this.result.writeErrors[index] : void 0; + } + /** Retrieve all write errors */ + getWriteErrors() { + return this.result.writeErrors; + } + /** Retrieve the write concern error if one exists */ + getWriteConcernError() { + if (this.result.writeConcernErrors.length === 0) { + return; + } else if (this.result.writeConcernErrors.length === 1) { + return this.result.writeConcernErrors[0]; + } else { + let errmsg = ""; + for (let i4 = 0; i4 < this.result.writeConcernErrors.length; i4++) { + const err = this.result.writeConcernErrors[i4]; + errmsg = errmsg + err.errmsg; + if (i4 === 0) + errmsg = errmsg + " and "; + } + return new WriteConcernError({ errmsg, code: error_1.MONGODB_ERROR_CODES.WriteConcernTimeout }); + } + } + toString() { + return `BulkWriteResult(${bson_1.EJSON.stringify(this.result)})`; + } + isOk() { + return this.result.ok === 1; + } + }; + exports2.BulkWriteResult = BulkWriteResult; + var WriteConcernError = class { + constructor(error2) { + this.serverError = error2; + } + /** Write concern error code. */ + get code() { + return this.serverError.code; + } + /** Write concern error message. */ + get errmsg() { + return this.serverError.errmsg; + } + /** Write concern error info. */ + get errInfo() { + return this.serverError.errInfo; + } + toJSON() { + return this.serverError; + } + toString() { + return `WriteConcernError(${this.errmsg})`; + } + }; + exports2.WriteConcernError = WriteConcernError; + var WriteError = class { + constructor(err) { + this.err = err; + } + /** WriteError code. */ + get code() { + return this.err.code; + } + /** WriteError original bulk operation index. */ + get index() { + return this.err.index; + } + /** WriteError message. */ + get errmsg() { + return this.err.errmsg; + } + /** WriteError details. */ + get errInfo() { + return this.err.errInfo; + } + /** Returns the underlying operation that caused the error */ + getOperation() { + return this.err.op; + } + toJSON() { + return { code: this.err.code, index: this.err.index, errmsg: this.err.errmsg, op: this.err.op }; + } + toString() { + return `WriteError(${JSON.stringify(this.toJSON())})`; + } + }; + exports2.WriteError = WriteError; + function mergeBatchResults(batch, bulkResult, err, result) { + if (err) { + result = err; + } else if (result && result.result) { + result = result.result; + } + if (result == null) { + return; + } + if (result.ok === 0 && bulkResult.ok === 1) { + bulkResult.ok = 0; + const writeError = { + index: 0, + code: result.code || 0, + errmsg: result.message, + errInfo: result.errInfo, + op: batch.operations[0] + }; + bulkResult.writeErrors.push(new WriteError(writeError)); + return; + } else if (result.ok === 0 && bulkResult.ok === 0) { + return; + } + if (isInsertBatch(batch) && result.n) { + bulkResult.nInserted = bulkResult.nInserted + result.n; + } + if (isDeleteBatch(batch) && result.n) { + bulkResult.nRemoved = bulkResult.nRemoved + result.n; + } + let nUpserted = 0; + if (Array.isArray(result.upserted)) { + nUpserted = result.upserted.length; + for (let i4 = 0; i4 < result.upserted.length; i4++) { + bulkResult.upserted.push({ + index: result.upserted[i4].index + batch.originalZeroIndex, + _id: result.upserted[i4]._id + }); + } + } else if (result.upserted) { + nUpserted = 1; + bulkResult.upserted.push({ + index: batch.originalZeroIndex, + _id: result.upserted + }); + } + if (isUpdateBatch(batch) && result.n) { + const nModified = result.nModified; + bulkResult.nUpserted = bulkResult.nUpserted + nUpserted; + bulkResult.nMatched = bulkResult.nMatched + (result.n - nUpserted); + if (typeof nModified === "number") { + bulkResult.nModified = bulkResult.nModified + nModified; + } else { + bulkResult.nModified = 0; + } + } + if (Array.isArray(result.writeErrors)) { + for (let i4 = 0; i4 < result.writeErrors.length; i4++) { + const writeError = { + index: batch.originalIndexes[result.writeErrors[i4].index], + code: result.writeErrors[i4].code, + errmsg: result.writeErrors[i4].errmsg, + errInfo: result.writeErrors[i4].errInfo, + op: batch.operations[result.writeErrors[i4].index] + }; + bulkResult.writeErrors.push(new WriteError(writeError)); + } + } + if (result.writeConcernError) { + bulkResult.writeConcernErrors.push(new WriteConcernError(result.writeConcernError)); + } + } + async function executeCommands(bulkOperation, options) { + if (bulkOperation.s.batches.length === 0) { + return new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered); + } + for (const batch of bulkOperation.s.batches) { + const finalOptions = (0, utils_1.resolveOptions)(bulkOperation, { + ...options, + ordered: bulkOperation.isOrdered + }); + if (finalOptions.bypassDocumentValidation !== true) { + delete finalOptions.bypassDocumentValidation; + } + if (bulkOperation.s.bypassDocumentValidation === true) { + finalOptions.bypassDocumentValidation = true; + } + if (bulkOperation.s.checkKeys === false) { + finalOptions.checkKeys = false; + } + if (finalOptions.retryWrites) { + if (isUpdateBatch(batch)) { + finalOptions.retryWrites = finalOptions.retryWrites && !batch.operations.some((op2) => op2.multi); + } + if (isDeleteBatch(batch)) { + finalOptions.retryWrites = finalOptions.retryWrites && !batch.operations.some((op2) => op2.limit === 0); + } + } + const operation2 = isInsertBatch(batch) ? new insert_1.InsertOperation(bulkOperation.s.namespace, batch.operations, finalOptions) : isUpdateBatch(batch) ? new update_1.UpdateOperation(bulkOperation.s.namespace, batch.operations, finalOptions) : isDeleteBatch(batch) ? new delete_1.DeleteOperation(bulkOperation.s.namespace, batch.operations, finalOptions) : null; + if (operation2 == null) + throw new error_1.MongoRuntimeError(`Unknown batchType: ${batch.batchType}`); + let thrownError = null; + let result; + try { + result = await (0, execute_operation_1.executeOperation)(bulkOperation.s.collection.client, operation2, finalOptions.timeoutContext); + } catch (error2) { + thrownError = error2; + } + if (thrownError != null) { + if (thrownError instanceof error_1.MongoWriteConcernError) { + mergeBatchResults(batch, bulkOperation.s.bulkResult, thrownError, result); + const writeResult3 = new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered); + throw new MongoBulkWriteError({ + message: thrownError.result.writeConcernError.errmsg, + code: thrownError.result.writeConcernError.code + }, writeResult3); + } else { + throw new MongoBulkWriteError(thrownError, new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered)); + } + } + mergeBatchResults(batch, bulkOperation.s.bulkResult, thrownError, result); + const writeResult2 = new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered); + bulkOperation.handleWriteError(writeResult2); + } + bulkOperation.s.batches.length = 0; + const writeResult = new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered); + bulkOperation.handleWriteError(writeResult); + return writeResult; + } + var MongoBulkWriteError = class extends error_1.MongoServerError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(error2, result) { + super(error2); + this.writeErrors = []; + if (error2 instanceof WriteConcernError) + this.err = error2; + else if (!(error2 instanceof Error)) { + this.message = error2.message; + this.code = error2.code; + this.writeErrors = error2.writeErrors ?? []; + } + this.result = result; + Object.assign(this, error2); + } + get name() { + return "MongoBulkWriteError"; + } + /** Number of documents inserted. */ + get insertedCount() { + return this.result.insertedCount; + } + /** Number of documents matched for update. */ + get matchedCount() { + return this.result.matchedCount; + } + /** Number of documents modified. */ + get modifiedCount() { + return this.result.modifiedCount; + } + /** Number of documents deleted. */ + get deletedCount() { + return this.result.deletedCount; + } + /** Number of documents upserted. */ + get upsertedCount() { + return this.result.upsertedCount; + } + /** Inserted document generated Id's, hash key is the index of the originating operation */ + get insertedIds() { + return this.result.insertedIds; + } + /** Upserted document generated Id's, hash key is the index of the originating operation */ + get upsertedIds() { + return this.result.upsertedIds; + } + }; + exports2.MongoBulkWriteError = MongoBulkWriteError; + var FindOperators = class { + /** + * Creates a new FindOperators object. + * @internal + */ + constructor(bulkOperation) { + this.bulkOperation = bulkOperation; + } + /** Add a multiple update operation to the bulk operation */ + update(updateDocument) { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports2.BatchType.UPDATE, (0, update_1.makeUpdateStatement)(currentOp.selector, updateDocument, { + ...currentOp, + multi: true + })); + } + /** Add a single update operation to the bulk operation */ + updateOne(updateDocument) { + if (!(0, utils_1.hasAtomicOperators)(updateDocument, this.bulkOperation.bsonOptions)) { + throw new error_1.MongoInvalidArgumentError("Update document requires atomic operators"); + } + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports2.BatchType.UPDATE, (0, update_1.makeUpdateStatement)(currentOp.selector, updateDocument, { ...currentOp, multi: false })); + } + /** Add a replace one operation to the bulk operation */ + replaceOne(replacement) { + if ((0, utils_1.hasAtomicOperators)(replacement)) { + throw new error_1.MongoInvalidArgumentError("Replacement document must not use atomic operators"); + } + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports2.BatchType.UPDATE, (0, update_1.makeUpdateStatement)(currentOp.selector, replacement, { ...currentOp, multi: false })); + } + /** Add a delete one operation to the bulk operation */ + deleteOne() { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports2.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(currentOp.selector, { ...currentOp, limit: 1 })); + } + /** Add a delete many operation to the bulk operation */ + delete() { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports2.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(currentOp.selector, { ...currentOp, limit: 0 })); + } + /** Upsert modifier for update bulk operation, noting that this operation is an upsert. */ + upsert() { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + this.bulkOperation.s.currentOp.upsert = true; + return this; + } + /** Specifies the collation for the query condition. */ + collation(collation) { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + this.bulkOperation.s.currentOp.collation = collation; + return this; + } + /** Specifies arrayFilters for UpdateOne or UpdateMany bulk operations. */ + arrayFilters(arrayFilters) { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + this.bulkOperation.s.currentOp.arrayFilters = arrayFilters; + return this; + } + /** Specifies hint for the bulk operation. */ + hint(hint) { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + this.bulkOperation.s.currentOp.hint = hint; + return this; + } + }; + exports2.FindOperators = FindOperators; + var BulkOperationBase = class { + /** + * Create a new OrderedBulkOperation or UnorderedBulkOperation instance + * @internal + */ + constructor(collection, options, isOrdered) { + this.collection = collection; + this.isOrdered = isOrdered; + const topology = (0, utils_1.getTopology)(collection); + options = options == null ? {} : options; + const namespace = collection.s.namespace; + const executed = false; + const currentOp = void 0; + const hello = topology.lastHello(); + const usingAutoEncryption = !!(topology.s.options && topology.s.options.autoEncrypter); + const maxBsonObjectSize = hello && hello.maxBsonObjectSize ? hello.maxBsonObjectSize : 1024 * 1024 * 16; + const maxBatchSizeBytes = usingAutoEncryption ? 1024 * 1024 * 2 : maxBsonObjectSize; + const maxWriteBatchSize = hello && hello.maxWriteBatchSize ? hello.maxWriteBatchSize : 1e3; + const maxKeySize = (maxWriteBatchSize - 1).toString(10).length + 2; + let finalOptions = Object.assign({}, options); + finalOptions = (0, utils_1.applyRetryableWrites)(finalOptions, collection.db); + const bulkResult = { + ok: 1, + writeErrors: [], + writeConcernErrors: [], + insertedIds: [], + nInserted: 0, + nUpserted: 0, + nMatched: 0, + nModified: 0, + nRemoved: 0, + upserted: [] + }; + this.s = { + // Final result + bulkResult, + // Current batch state + currentBatch: void 0, + currentIndex: 0, + // ordered specific + currentBatchSize: 0, + currentBatchSizeBytes: 0, + // unordered specific + currentInsertBatch: void 0, + currentUpdateBatch: void 0, + currentRemoveBatch: void 0, + batches: [], + // Write concern + writeConcern: write_concern_1.WriteConcern.fromOptions(options), + // Max batch size options + maxBsonObjectSize, + maxBatchSizeBytes, + maxWriteBatchSize, + maxKeySize, + // Namespace + namespace, + // Topology + topology, + // Options + options: finalOptions, + // BSON options + bsonOptions: (0, bson_1.resolveBSONOptions)(options), + // Current operation + currentOp, + // Executed + executed, + // Collection + collection, + // Fundamental error + err: void 0, + // check keys + checkKeys: typeof options.checkKeys === "boolean" ? options.checkKeys : false + }; + if (options.bypassDocumentValidation === true) { + this.s.bypassDocumentValidation = true; + } + } + /** + * Add a single insert document to the bulk operation + * + * @example + * ```ts + * const bulkOp = collection.initializeOrderedBulkOp(); + * + * // Adds three inserts to the bulkOp. + * bulkOp + * .insert({ a: 1 }) + * .insert({ b: 2 }) + * .insert({ c: 3 }); + * await bulkOp.execute(); + * ``` + */ + insert(document2) { + (0, utils_1.maybeAddIdToDocuments)(this.collection, document2, { + forceServerObjectId: this.shouldForceServerObjectId() + }); + return this.addToOperationsList(exports2.BatchType.INSERT, document2); + } + /** + * Builds a find operation for an update/updateOne/delete/deleteOne/replaceOne. + * Returns a builder object used to complete the definition of the operation. + * + * @example + * ```ts + * const bulkOp = collection.initializeOrderedBulkOp(); + * + * // Add an updateOne to the bulkOp + * bulkOp.find({ a: 1 }).updateOne({ $set: { b: 2 } }); + * + * // Add an updateMany to the bulkOp + * bulkOp.find({ c: 3 }).update({ $set: { d: 4 } }); + * + * // Add an upsert + * bulkOp.find({ e: 5 }).upsert().updateOne({ $set: { f: 6 } }); + * + * // Add a deletion + * bulkOp.find({ g: 7 }).deleteOne(); + * + * // Add a multi deletion + * bulkOp.find({ h: 8 }).delete(); + * + * // Add a replaceOne + * bulkOp.find({ i: 9 }).replaceOne({writeConcern: { j: 10 }}); + * + * // Update using a pipeline (requires Mongodb 4.2 or higher) + * bulk.find({ k: 11, y: { $exists: true }, z: { $exists: true } }).updateOne([ + * { $set: { total: { $sum: [ '$y', '$z' ] } } } + * ]); + * + * // All of the ops will now be executed + * await bulkOp.execute(); + * ``` + */ + find(selector) { + if (!selector) { + throw new error_1.MongoInvalidArgumentError("Bulk find operation must specify a selector"); + } + this.s.currentOp = { + selector + }; + return new FindOperators(this); + } + /** Specifies a raw operation to perform in the bulk write. */ + raw(op2) { + if (op2 == null || typeof op2 !== "object") { + throw new error_1.MongoInvalidArgumentError("Operation must be an object with an operation key"); + } + if ("insertOne" in op2) { + const forceServerObjectId = this.shouldForceServerObjectId(); + const document2 = op2.insertOne && op2.insertOne.document == null ? ( + // TODO(NODE-6003): remove support for omitting the `documents` subdocument in bulk inserts + op2.insertOne + ) : op2.insertOne.document; + (0, utils_1.maybeAddIdToDocuments)(this.collection, document2, { forceServerObjectId }); + return this.addToOperationsList(exports2.BatchType.INSERT, document2); + } + if ("replaceOne" in op2 || "updateOne" in op2 || "updateMany" in op2) { + if ("replaceOne" in op2) { + if ("q" in op2.replaceOne) { + throw new error_1.MongoInvalidArgumentError("Raw operations are not allowed"); + } + const updateStatement = (0, update_1.makeUpdateStatement)(op2.replaceOne.filter, op2.replaceOne.replacement, { ...op2.replaceOne, multi: false }); + if ((0, utils_1.hasAtomicOperators)(updateStatement.u)) { + throw new error_1.MongoInvalidArgumentError("Replacement document must not use atomic operators"); + } + return this.addToOperationsList(exports2.BatchType.UPDATE, updateStatement); + } + if ("updateOne" in op2) { + if ("q" in op2.updateOne) { + throw new error_1.MongoInvalidArgumentError("Raw operations are not allowed"); + } + const updateStatement = (0, update_1.makeUpdateStatement)(op2.updateOne.filter, op2.updateOne.update, { + ...op2.updateOne, + multi: false + }); + if (!(0, utils_1.hasAtomicOperators)(updateStatement.u, this.bsonOptions)) { + throw new error_1.MongoInvalidArgumentError("Update document requires atomic operators"); + } + return this.addToOperationsList(exports2.BatchType.UPDATE, updateStatement); + } + if ("updateMany" in op2) { + if ("q" in op2.updateMany) { + throw new error_1.MongoInvalidArgumentError("Raw operations are not allowed"); + } + const updateStatement = (0, update_1.makeUpdateStatement)(op2.updateMany.filter, op2.updateMany.update, { + ...op2.updateMany, + multi: true + }); + if (!(0, utils_1.hasAtomicOperators)(updateStatement.u, this.bsonOptions)) { + throw new error_1.MongoInvalidArgumentError("Update document requires atomic operators"); + } + return this.addToOperationsList(exports2.BatchType.UPDATE, updateStatement); + } + } + if ("deleteOne" in op2) { + if ("q" in op2.deleteOne) { + throw new error_1.MongoInvalidArgumentError("Raw operations are not allowed"); + } + return this.addToOperationsList(exports2.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(op2.deleteOne.filter, { ...op2.deleteOne, limit: 1 })); + } + if ("deleteMany" in op2) { + if ("q" in op2.deleteMany) { + throw new error_1.MongoInvalidArgumentError("Raw operations are not allowed"); + } + return this.addToOperationsList(exports2.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(op2.deleteMany.filter, { ...op2.deleteMany, limit: 0 })); + } + throw new error_1.MongoInvalidArgumentError("bulkWrite only supports insertOne, updateOne, updateMany, deleteOne, deleteMany"); + } + get length() { + return this.s.currentIndex; + } + get bsonOptions() { + return this.s.bsonOptions; + } + get writeConcern() { + return this.s.writeConcern; + } + get batches() { + const batches = [...this.s.batches]; + if (this.isOrdered) { + if (this.s.currentBatch) + batches.push(this.s.currentBatch); + } else { + if (this.s.currentInsertBatch) + batches.push(this.s.currentInsertBatch); + if (this.s.currentUpdateBatch) + batches.push(this.s.currentUpdateBatch); + if (this.s.currentRemoveBatch) + batches.push(this.s.currentRemoveBatch); + } + return batches; + } + async execute(options = {}) { + if (this.s.executed) { + throw new error_1.MongoBatchReExecutionError(); + } + const writeConcern = write_concern_1.WriteConcern.fromOptions(options); + if (writeConcern) { + this.s.writeConcern = writeConcern; + } + if (this.isOrdered) { + if (this.s.currentBatch) + this.s.batches.push(this.s.currentBatch); + } else { + if (this.s.currentInsertBatch) + this.s.batches.push(this.s.currentInsertBatch); + if (this.s.currentUpdateBatch) + this.s.batches.push(this.s.currentUpdateBatch); + if (this.s.currentRemoveBatch) + this.s.batches.push(this.s.currentRemoveBatch); + } + if (this.s.batches.length === 0) { + throw new error_1.MongoInvalidArgumentError("Invalid BulkOperation, Batch cannot be empty"); + } + this.s.executed = true; + const finalOptions = (0, utils_1.resolveOptions)(this.collection, { ...this.s.options, ...options }); + finalOptions.timeoutContext ??= timeout_1.TimeoutContext.create({ + session: finalOptions.session, + timeoutMS: finalOptions.timeoutMS, + serverSelectionTimeoutMS: this.collection.client.s.options.serverSelectionTimeoutMS, + waitQueueTimeoutMS: this.collection.client.s.options.waitQueueTimeoutMS + }); + if (finalOptions.session == null) { + return await this.collection.client.withSession({ explicit: false }, async (session) => { + return await executeCommands(this, { ...finalOptions, session }); + }); + } + return await executeCommands(this, { ...finalOptions }); + } + /** + * Handles the write error before executing commands + * @internal + */ + handleWriteError(writeResult) { + if (this.s.bulkResult.writeErrors.length > 0) { + const msg = this.s.bulkResult.writeErrors[0].errmsg ? this.s.bulkResult.writeErrors[0].errmsg : "write operation failed"; + throw new MongoBulkWriteError({ + message: msg, + code: this.s.bulkResult.writeErrors[0].code, + writeErrors: this.s.bulkResult.writeErrors + }, writeResult); + } + const writeConcernError = writeResult.getWriteConcernError(); + if (writeConcernError) { + throw new MongoBulkWriteError(writeConcernError, writeResult); + } + } + shouldForceServerObjectId() { + return this.s.options.forceServerObjectId === true || this.s.collection.db.options?.forceServerObjectId === true; + } + }; + exports2.BulkOperationBase = BulkOperationBase; + function isInsertBatch(batch) { + return batch.batchType === exports2.BatchType.INSERT; + } + function isUpdateBatch(batch) { + return batch.batchType === exports2.BatchType.UPDATE; + } + function isDeleteBatch(batch) { + return batch.batchType === exports2.BatchType.DELETE; + } + function buildCurrentOp(bulkOp) { + let { currentOp } = bulkOp.s; + bulkOp.s.currentOp = void 0; + if (!currentOp) + currentOp = {}; + return currentOp; + } + } +}); + +// node_modules/mongoose/lib/drivers/node-mongodb-native/bulkWriteResult.js +var require_bulkWriteResult = __commonJS({ + "node_modules/mongoose/lib/drivers/node-mongodb-native/bulkWriteResult.js"(exports2, module2) { + "use strict"; + var BulkWriteResult = require_common2().BulkWriteResult; + module2.exports = BulkWriteResult; + } +}); + +// node_modules/mongoose/lib/connectionState.js +var require_connectionState = __commonJS({ + "node_modules/mongoose/lib/connectionState.js"(exports2, module2) { + "use strict"; + var STATES = module2.exports = exports2 = /* @__PURE__ */ Object.create(null); + var disconnected = "disconnected"; + var connected = "connected"; + var connecting = "connecting"; + var disconnecting = "disconnecting"; + var uninitialized = "uninitialized"; + STATES[0] = disconnected; + STATES[1] = connected; + STATES[2] = connecting; + STATES[3] = disconnecting; + STATES[99] = uninitialized; + STATES[disconnected] = 0; + STATES[connected] = 1; + STATES[connecting] = 2; + STATES[disconnecting] = 3; + STATES[uninitialized] = 99; + } +}); + +// node_modules/mongoose/lib/helpers/immediate.js +var require_immediate = __commonJS({ + "node_modules/mongoose/lib/helpers/immediate.js"(exports2, module2) { + "use strict"; + var nextTick = typeof process !== "undefined" && typeof process.nextTick === "function" ? process.nextTick.bind(process) : (cb) => setTimeout(cb, 0); + module2.exports = function immediate(cb) { + return nextTick(cb); + }; + } +}); + +// node_modules/mongoose/lib/collection.js +var require_collection = __commonJS({ + "node_modules/mongoose/lib/collection.js"(exports2, module2) { + "use strict"; + var EventEmitter = require("events").EventEmitter; + var STATES = require_connectionState(); + var immediate = require_immediate(); + function Collection(name, conn, opts) { + if (opts === void 0) { + opts = {}; + } + this.opts = opts; + this.name = name; + this.collectionName = name; + this.conn = conn; + this.queue = []; + this.buffer = !conn?._hasOpened; + this.emitter = new EventEmitter(); + if (STATES.connected === this.conn.readyState) { + this.onOpen(); + } + } + Collection.prototype.name; + Collection.prototype.collectionName; + Collection.prototype.conn; + Collection.prototype.onOpen = function() { + this.buffer = false; + immediate(() => this.doQueue()); + }; + Collection.prototype.onClose = function() { + }; + Collection.prototype.addQueue = function(name, args2) { + this.queue.push([name, args2]); + return this; + }; + Collection.prototype.removeQueue = function(name, args2) { + const index = this.queue.findIndex((v4) => v4[0] === name && v4[1] === args2); + if (index === -1) { + return false; + } + this.queue.splice(index, 1); + return true; + }; + Collection.prototype.doQueue = function() { + for (const method of this.queue) { + if (typeof method[0] === "function") { + method[0].apply(this, method[1]); + } else { + this[method[0]].apply(this, method[1]); + } + } + this.queue = []; + const _this = this; + immediate(function() { + _this.emitter.emit("queue"); + }); + return this; + }; + Collection.prototype.ensureIndex = function() { + throw new Error("Collection#ensureIndex unimplemented by driver"); + }; + Collection.prototype.createIndex = function() { + throw new Error("Collection#createIndex unimplemented by driver"); + }; + Collection.prototype.findAndModify = function() { + throw new Error("Collection#findAndModify unimplemented by driver"); + }; + Collection.prototype.findOneAndUpdate = function() { + throw new Error("Collection#findOneAndUpdate unimplemented by driver"); + }; + Collection.prototype.findOneAndDelete = function() { + throw new Error("Collection#findOneAndDelete unimplemented by driver"); + }; + Collection.prototype.findOneAndReplace = function() { + throw new Error("Collection#findOneAndReplace unimplemented by driver"); + }; + Collection.prototype.findOne = function() { + throw new Error("Collection#findOne unimplemented by driver"); + }; + Collection.prototype.find = function() { + throw new Error("Collection#find unimplemented by driver"); + }; + Collection.prototype.insert = function() { + throw new Error("Collection#insert unimplemented by driver"); + }; + Collection.prototype.insertOne = function() { + throw new Error("Collection#insertOne unimplemented by driver"); + }; + Collection.prototype.insertMany = function() { + throw new Error("Collection#insertMany unimplemented by driver"); + }; + Collection.prototype.save = function() { + throw new Error("Collection#save unimplemented by driver"); + }; + Collection.prototype.updateOne = function() { + throw new Error("Collection#updateOne unimplemented by driver"); + }; + Collection.prototype.updateMany = function() { + throw new Error("Collection#updateMany unimplemented by driver"); + }; + Collection.prototype.deleteOne = function() { + throw new Error("Collection#deleteOne unimplemented by driver"); + }; + Collection.prototype.deleteMany = function() { + throw new Error("Collection#deleteMany unimplemented by driver"); + }; + Collection.prototype.getIndexes = function() { + throw new Error("Collection#getIndexes unimplemented by driver"); + }; + Collection.prototype.watch = function() { + throw new Error("Collection#watch unimplemented by driver"); + }; + Collection.prototype._shouldBufferCommands = function _shouldBufferCommands() { + const opts = this.opts; + if (opts.bufferCommands != null) { + return opts.bufferCommands; + } + if (opts && opts.schemaUserProvidedOptions != null && opts.schemaUserProvidedOptions.bufferCommands != null) { + return opts.schemaUserProvidedOptions.bufferCommands; + } + return this.conn._shouldBufferCommands(); + }; + Collection.prototype._getBufferTimeoutMS = function _getBufferTimeoutMS() { + const conn = this.conn; + const opts = this.opts; + if (opts.bufferTimeoutMS != null) { + return opts.bufferTimeoutMS; + } + if (opts && opts.schemaUserProvidedOptions != null && opts.schemaUserProvidedOptions.bufferTimeoutMS != null) { + return opts.schemaUserProvidedOptions.bufferTimeoutMS; + } + return conn._getBufferTimeoutMS(); + }; + module2.exports = Collection; + } +}); + +// node_modules/mongoose/lib/error/mongooseError.js +var require_mongooseError = __commonJS({ + "node_modules/mongoose/lib/error/mongooseError.js"(exports2, module2) { + "use strict"; + var MongooseError = class extends Error { + }; + Object.defineProperty(MongooseError.prototype, "name", { + value: "MongooseError" + }); + module2.exports = MongooseError; + } +}); + +// node_modules/mongodb/lib/operations/list_databases.js +var require_list_databases = __commonJS({ + "node_modules/mongodb/lib/operations/list_databases.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ListDatabasesOperation = void 0; + var responses_1 = require_responses(); + var utils_1 = require_utils3(); + var command_1 = require_command(); + var operation_1 = require_operation(); + var ListDatabasesOperation = class extends command_1.CommandOperation { + constructor(db, options) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options ?? {}; + this.ns = new utils_1.MongoDBNamespace("admin", "$cmd"); + } + get commandName() { + return "listDatabases"; + } + buildCommandDocument(connection, _session) { + const cmd = { listDatabases: 1 }; + if (typeof this.options.nameOnly === "boolean") { + cmd.nameOnly = this.options.nameOnly; + } + if (this.options.filter) { + cmd.filter = this.options.filter; + } + if (typeof this.options.authorizedDatabases === "boolean") { + cmd.authorizedDatabases = this.options.authorizedDatabases; + } + if ((0, utils_1.maxWireVersion)(connection) >= 9 && this.options.comment !== void 0) { + cmd.comment = this.options.comment; + } + return cmd; + } + }; + exports2.ListDatabasesOperation = ListDatabasesOperation; + (0, operation_1.defineAspects)(ListDatabasesOperation, [operation_1.Aspect.READ_OPERATION, operation_1.Aspect.RETRYABLE]); + } +}); + +// node_modules/mongodb/lib/operations/remove_user.js +var require_remove_user = __commonJS({ + "node_modules/mongodb/lib/operations/remove_user.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RemoveUserOperation = void 0; + var responses_1 = require_responses(); + var command_1 = require_command(); + var operation_1 = require_operation(); + var RemoveUserOperation = class extends command_1.CommandOperation { + constructor(db, username, options) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.username = username; + } + get commandName() { + return "dropUser"; + } + buildCommandDocument(_connection) { + return { dropUser: this.username }; + } + handleOk(_response) { + return true; + } + }; + exports2.RemoveUserOperation = RemoveUserOperation; + (0, operation_1.defineAspects)(RemoveUserOperation, [operation_1.Aspect.WRITE_OPERATION]); + } +}); + +// node_modules/mongodb/lib/operations/run_command.js +var require_run_command = __commonJS({ + "node_modules/mongodb/lib/operations/run_command.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RunCursorCommandOperation = exports2.RunCommandOperation = void 0; + var responses_1 = require_responses(); + var operation_1 = require_operation(); + var RunCommandOperation = class extends operation_1.AbstractOperation { + constructor(namespace, command, options) { + super(options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.command = command; + this.options = options; + this.ns = namespace.withCollection("$cmd"); + } + get commandName() { + return "runCommand"; + } + buildCommand(_connection, _session) { + return this.command; + } + buildOptions(timeoutContext) { + return { + ...this.options, + session: this.session, + timeoutContext, + signal: this.options.signal, + readPreference: this.options.readPreference + }; + } + }; + exports2.RunCommandOperation = RunCommandOperation; + var RunCursorCommandOperation = class extends RunCommandOperation { + constructor() { + super(...arguments); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.CursorResponse; + } + handleOk(response) { + return response; + } + }; + exports2.RunCursorCommandOperation = RunCursorCommandOperation; + } +}); + +// node_modules/mongodb/lib/operations/validate_collection.js +var require_validate_collection = __commonJS({ + "node_modules/mongodb/lib/operations/validate_collection.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ValidateCollectionOperation = void 0; + var responses_1 = require_responses(); + var error_1 = require_error(); + var command_1 = require_command(); + var ValidateCollectionOperation = class extends command_1.CommandOperation { + constructor(admin, collectionName, options) { + super(admin.s.db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.collectionName = collectionName; + } + get commandName() { + return "validate"; + } + buildCommandDocument(_connection, _session) { + return { + validate: this.collectionName, + ...Object.fromEntries(Object.entries(this.options).filter((entry) => entry[0] !== "session")) + }; + } + handleOk(response) { + const result = super.handleOk(response); + if (result.result != null && typeof result.result !== "string") + throw new error_1.MongoUnexpectedServerResponseError("Error with validation data"); + if (result.result != null && result.result.match(/exception|corrupt/) != null) + throw new error_1.MongoUnexpectedServerResponseError(`Invalid collection ${this.collectionName}`); + if (result.valid != null && !result.valid) + throw new error_1.MongoUnexpectedServerResponseError(`Invalid collection ${this.collectionName}`); + return response; + } + }; + exports2.ValidateCollectionOperation = ValidateCollectionOperation; + } +}); + +// node_modules/mongodb/lib/admin.js +var require_admin = __commonJS({ + "node_modules/mongodb/lib/admin.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Admin = void 0; + var bson_1 = require_bson2(); + var execute_operation_1 = require_execute_operation(); + var list_databases_1 = require_list_databases(); + var remove_user_1 = require_remove_user(); + var run_command_1 = require_run_command(); + var validate_collection_1 = require_validate_collection(); + var utils_1 = require_utils3(); + var Admin = class { + /** + * Create a new Admin instance + * @internal + */ + constructor(db) { + this.s = { db }; + } + /** + * Execute a command + * + * The driver will ensure the following fields are attached to the command sent to the server: + * - `lsid` - sourced from an implicit session or options.session + * - `$readPreference` - defaults to primary or can be configured by options.readPreference + * - `$db` - sourced from the name of this database + * + * If the client has a serverApi setting: + * - `apiVersion` + * - `apiStrict` + * - `apiDeprecationErrors` + * + * When in a transaction: + * - `readConcern` - sourced from readConcern set on the TransactionOptions + * - `writeConcern` - sourced from writeConcern set on the TransactionOptions + * + * Attaching any of the above fields to the command will have no effect as the driver will overwrite the value. + * + * @param command - The command to execute + * @param options - Optional settings for the command + */ + async command(command, options) { + return await (0, execute_operation_1.executeOperation)(this.s.db.client, new run_command_1.RunCommandOperation(new utils_1.MongoDBNamespace("admin"), command, { + ...(0, bson_1.resolveBSONOptions)(options), + session: options?.session, + readPreference: options?.readPreference, + timeoutMS: options?.timeoutMS ?? this.s.db.timeoutMS + })); + } + /** + * Retrieve the server build information + * + * @param options - Optional settings for the command + */ + async buildInfo(options) { + return await this.command({ buildinfo: 1 }, options); + } + /** + * Retrieve the server build information + * + * @param options - Optional settings for the command + */ + async serverInfo(options) { + return await this.command({ buildinfo: 1 }, options); + } + /** + * Retrieve this db's server status. + * + * @param options - Optional settings for the command + */ + async serverStatus(options) { + return await this.command({ serverStatus: 1 }, options); + } + /** + * Ping the MongoDB server and retrieve results + * + * @param options - Optional settings for the command + */ + async ping(options) { + return await this.command({ ping: 1 }, options); + } + /** + * Remove a user from a database + * + * @param username - The username to remove + * @param options - Optional settings for the command + */ + async removeUser(username, options) { + return await (0, execute_operation_1.executeOperation)(this.s.db.client, new remove_user_1.RemoveUserOperation(this.s.db, username, { dbName: "admin", ...options })); + } + /** + * Validate an existing collection + * + * @param collectionName - The name of the collection to validate. + * @param options - Optional settings for the command + */ + async validateCollection(collectionName, options = {}) { + return await (0, execute_operation_1.executeOperation)(this.s.db.client, new validate_collection_1.ValidateCollectionOperation(this, collectionName, options)); + } + /** + * List the available databases + * + * @param options - Optional settings for the command + */ + async listDatabases(options) { + return await (0, execute_operation_1.executeOperation)(this.s.db.client, new list_databases_1.ListDatabasesOperation(this.s.db, { timeoutMS: this.s.db.timeoutMS, ...options })); + } + /** + * Get ReplicaSet status + * + * @param options - Optional settings for the command + */ + async replSetGetStatus(options) { + return await this.command({ replSetGetStatus: 1 }, options); + } + }; + exports2.Admin = Admin; + } +}); + +// node_modules/mongodb/lib/bulk/ordered.js +var require_ordered = __commonJS({ + "node_modules/mongodb/lib/bulk/ordered.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OrderedBulkOperation = void 0; + var BSON = require_bson2(); + var error_1 = require_error(); + var common_1 = require_common2(); + var OrderedBulkOperation = class extends common_1.BulkOperationBase { + /** @internal */ + constructor(collection, options) { + super(collection, options, true); + } + addToOperationsList(batchType, document2) { + const bsonSize = BSON.calculateObjectSize(document2, { + checkKeys: false, + // Since we don't know what the user selected for BSON options here, + // err on the safe side, and check the size with ignoreUndefined: false. + ignoreUndefined: false + }); + if (bsonSize >= this.s.maxBsonObjectSize) + throw new error_1.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`); + if (this.s.currentBatch == null) { + this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex); + } + const maxKeySize = this.s.maxKeySize; + if ( + // New batch if we exceed the max batch op size + this.s.currentBatchSize + 1 >= this.s.maxWriteBatchSize || // New batch if we exceed the maxBatchSizeBytes. Only matters if batch already has a doc, + // since we can't sent an empty batch + this.s.currentBatchSize > 0 && this.s.currentBatchSizeBytes + maxKeySize + bsonSize >= this.s.maxBatchSizeBytes || // New batch if the new op does not have the same op type as the current batch + this.s.currentBatch.batchType !== batchType + ) { + this.s.batches.push(this.s.currentBatch); + this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex); + this.s.currentBatchSize = 0; + this.s.currentBatchSizeBytes = 0; + } + if (batchType === common_1.BatchType.INSERT) { + this.s.bulkResult.insertedIds.push({ + index: this.s.currentIndex, + _id: document2._id + }); + } + if (Array.isArray(document2)) { + throw new error_1.MongoInvalidArgumentError("Operation passed in cannot be an Array"); + } + this.s.currentBatch.originalIndexes.push(this.s.currentIndex); + this.s.currentBatch.operations.push(document2); + this.s.currentBatchSize += 1; + this.s.currentBatchSizeBytes += maxKeySize + bsonSize; + this.s.currentIndex += 1; + return this; + } + }; + exports2.OrderedBulkOperation = OrderedBulkOperation; + } +}); + +// node_modules/mongodb/lib/bulk/unordered.js +var require_unordered = __commonJS({ + "node_modules/mongodb/lib/bulk/unordered.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.UnorderedBulkOperation = void 0; + var BSON = require_bson2(); + var error_1 = require_error(); + var common_1 = require_common2(); + var UnorderedBulkOperation = class extends common_1.BulkOperationBase { + /** @internal */ + constructor(collection, options) { + super(collection, options, false); + } + handleWriteError(writeResult) { + if (this.s.batches.length) { + return; + } + return super.handleWriteError(writeResult); + } + addToOperationsList(batchType, document2) { + const bsonSize = BSON.calculateObjectSize(document2, { + checkKeys: false, + // Since we don't know what the user selected for BSON options here, + // err on the safe side, and check the size with ignoreUndefined: false. + ignoreUndefined: false + }); + if (bsonSize >= this.s.maxBsonObjectSize) { + throw new error_1.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`); + } + this.s.currentBatch = void 0; + if (batchType === common_1.BatchType.INSERT) { + this.s.currentBatch = this.s.currentInsertBatch; + } else if (batchType === common_1.BatchType.UPDATE) { + this.s.currentBatch = this.s.currentUpdateBatch; + } else if (batchType === common_1.BatchType.DELETE) { + this.s.currentBatch = this.s.currentRemoveBatch; + } + const maxKeySize = this.s.maxKeySize; + if (this.s.currentBatch == null) { + this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex); + } + if ( + // New batch if we exceed the max batch op size + this.s.currentBatch.size + 1 >= this.s.maxWriteBatchSize || // New batch if we exceed the maxBatchSizeBytes. Only matters if batch already has a doc, + // since we can't sent an empty batch + this.s.currentBatch.size > 0 && this.s.currentBatch.sizeBytes + maxKeySize + bsonSize >= this.s.maxBatchSizeBytes || // New batch if the new op does not have the same op type as the current batch + this.s.currentBatch.batchType !== batchType + ) { + this.s.batches.push(this.s.currentBatch); + this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex); + } + if (Array.isArray(document2)) { + throw new error_1.MongoInvalidArgumentError("Operation passed in cannot be an Array"); + } + this.s.currentBatch.operations.push(document2); + this.s.currentBatch.originalIndexes.push(this.s.currentIndex); + this.s.currentIndex = this.s.currentIndex + 1; + if (batchType === common_1.BatchType.INSERT) { + this.s.currentInsertBatch = this.s.currentBatch; + this.s.bulkResult.insertedIds.push({ + index: this.s.bulkResult.insertedIds.length, + _id: document2._id + }); + } else if (batchType === common_1.BatchType.UPDATE) { + this.s.currentUpdateBatch = this.s.currentBatch; + } else if (batchType === common_1.BatchType.DELETE) { + this.s.currentRemoveBatch = this.s.currentBatch; + } + this.s.currentBatch.size += 1; + this.s.currentBatch.sizeBytes += maxKeySize + bsonSize; + return this; + } + }; + exports2.UnorderedBulkOperation = UnorderedBulkOperation; + } +}); + +// node_modules/mongodb/lib/mongo_logger.js +var require_mongo_logger = __commonJS({ + "node_modules/mongodb/lib/mongo_logger.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MongoLogger = exports2.MongoLoggableComponent = exports2.SEVERITY_LEVEL_MAP = exports2.DEFAULT_MAX_DOCUMENT_LENGTH = exports2.SeverityLevel = void 0; + exports2.parseSeverityFromString = parseSeverityFromString; + exports2.createStdioLogger = createStdioLogger; + exports2.stringifyWithMaxLen = stringifyWithMaxLen; + exports2.defaultLogTransform = defaultLogTransform; + var util_1 = require("util"); + var bson_1 = require_bson2(); + var constants_1 = require_constants2(); + var utils_1 = require_utils3(); + exports2.SeverityLevel = Object.freeze({ + EMERGENCY: "emergency", + ALERT: "alert", + CRITICAL: "critical", + ERROR: "error", + WARNING: "warn", + NOTICE: "notice", + INFORMATIONAL: "info", + DEBUG: "debug", + TRACE: "trace", + OFF: "off" + }); + exports2.DEFAULT_MAX_DOCUMENT_LENGTH = 1e3; + var SeverityLevelMap = class extends Map { + constructor(entries) { + const newEntries = []; + for (const [level, value] of entries) { + newEntries.push([value, level]); + } + newEntries.push(...entries); + super(newEntries); + } + getNumericSeverityLevel(severity) { + return this.get(severity); + } + getSeverityLevelName(level) { + return this.get(level); + } + }; + exports2.SEVERITY_LEVEL_MAP = new SeverityLevelMap([ + [exports2.SeverityLevel.OFF, -Infinity], + [exports2.SeverityLevel.EMERGENCY, 0], + [exports2.SeverityLevel.ALERT, 1], + [exports2.SeverityLevel.CRITICAL, 2], + [exports2.SeverityLevel.ERROR, 3], + [exports2.SeverityLevel.WARNING, 4], + [exports2.SeverityLevel.NOTICE, 5], + [exports2.SeverityLevel.INFORMATIONAL, 6], + [exports2.SeverityLevel.DEBUG, 7], + [exports2.SeverityLevel.TRACE, 8] + ]); + exports2.MongoLoggableComponent = Object.freeze({ + COMMAND: "command", + TOPOLOGY: "topology", + SERVER_SELECTION: "serverSelection", + CONNECTION: "connection", + CLIENT: "client" + }); + function parseSeverityFromString(s4) { + const validSeverities = Object.values(exports2.SeverityLevel); + const lowerSeverity = s4?.toLowerCase(); + if (lowerSeverity != null && validSeverities.includes(lowerSeverity)) { + return lowerSeverity; + } + return null; + } + function createStdioLogger(stream) { + return { + write: (0, util_1.promisify)((log2, cb) => { + const logLine = (0, util_1.inspect)(log2, { compact: true, breakLength: Infinity }); + stream.write(`${logLine} +`, "utf-8", cb); + return; + }) + }; + } + function resolveLogPath({ MONGODB_LOG_PATH }, { mongodbLogPath }) { + if (typeof mongodbLogPath === "string" && /^stderr$/i.test(mongodbLogPath)) { + return { mongodbLogPath: createStdioLogger(process.stderr), mongodbLogPathIsStdErr: true }; + } + if (typeof mongodbLogPath === "string" && /^stdout$/i.test(mongodbLogPath)) { + return { mongodbLogPath: createStdioLogger(process.stdout), mongodbLogPathIsStdErr: false }; + } + if (typeof mongodbLogPath === "object" && typeof mongodbLogPath?.write === "function") { + return { mongodbLogPath, mongodbLogPathIsStdErr: false }; + } + if (MONGODB_LOG_PATH && /^stderr$/i.test(MONGODB_LOG_PATH)) { + return { mongodbLogPath: createStdioLogger(process.stderr), mongodbLogPathIsStdErr: true }; + } + if (MONGODB_LOG_PATH && /^stdout$/i.test(MONGODB_LOG_PATH)) { + return { mongodbLogPath: createStdioLogger(process.stdout), mongodbLogPathIsStdErr: false }; + } + return { mongodbLogPath: createStdioLogger(process.stderr), mongodbLogPathIsStdErr: true }; + } + function resolveSeverityConfiguration(clientOption, environmentOption, defaultSeverity) { + return parseSeverityFromString(clientOption) ?? parseSeverityFromString(environmentOption) ?? defaultSeverity; + } + function compareSeverity(s0, s1) { + const s0Num = exports2.SEVERITY_LEVEL_MAP.getNumericSeverityLevel(s0); + const s1Num = exports2.SEVERITY_LEVEL_MAP.getNumericSeverityLevel(s1); + return s0Num < s1Num ? -1 : s0Num > s1Num ? 1 : 0; + } + function stringifyWithMaxLen(value, maxDocumentLength, options = {}) { + let strToTruncate = ""; + let currentLength = 0; + const maxDocumentLengthEnsurer = function maxDocumentLengthEnsurer2(key, value2) { + if (currentLength >= maxDocumentLength) { + return void 0; + } + if (key === "") { + currentLength += 1; + return value2; + } + currentLength += key.length + 4; + if (value2 == null) + return value2; + switch (typeof value2) { + case "string": + currentLength += value2.length + 2; + break; + case "number": + case "bigint": + currentLength += String(value2).length; + break; + case "boolean": + currentLength += value2 ? 4 : 5; + break; + case "object": + if ((0, utils_1.isUint8Array)(value2)) { + currentLength += 22 + value2.byteLength + value2.byteLength * 0.33 + 18 | 0; + } else if ("_bsontype" in value2) { + const v4 = value2; + switch (v4._bsontype) { + case "Int32": + currentLength += String(v4.value).length; + break; + case "Double": + currentLength += (v4.value | 0) === v4.value ? String(v4.value).length + 2 : String(v4.value).length; + break; + case "Long": + currentLength += v4.toString().length; + break; + case "ObjectId": + currentLength += 35; + break; + case "MaxKey": + case "MinKey": + currentLength += 13; + break; + case "Binary": + currentLength += 22 + value2.position + value2.position * 0.33 + 18 | 0; + break; + case "Timestamp": + currentLength += 19 + String(v4.t).length + 5 + String(v4.i).length + 2; + break; + case "Code": + if (v4.scope == null) { + currentLength += v4.code.length + 10 + 2; + } else { + currentLength += v4.code.length + 10 + 11; + } + break; + case "BSONRegExp": + currentLength += 34 + v4.pattern.length + 13 + v4.options.length + 3; + break; + } + } + } + return value2; + }; + if (typeof value === "string") { + strToTruncate = value; + } else if (typeof value === "function") { + strToTruncate = value.name; + } else { + try { + if (maxDocumentLength !== 0) { + strToTruncate = bson_1.EJSON.stringify(value, maxDocumentLengthEnsurer, 0, options); + } else { + strToTruncate = bson_1.EJSON.stringify(value, options); + } + } catch (e4) { + strToTruncate = `Extended JSON serialization failed with: ${e4.message}`; + } + } + if (maxDocumentLength !== 0 && strToTruncate.length > maxDocumentLength && strToTruncate.charCodeAt(maxDocumentLength - 1) !== strToTruncate.codePointAt(maxDocumentLength - 1)) { + maxDocumentLength--; + if (maxDocumentLength === 0) { + return ""; + } + } + return maxDocumentLength !== 0 && strToTruncate.length > maxDocumentLength ? `${strToTruncate.slice(0, maxDocumentLength)}...` : strToTruncate; + } + function isLogConvertible(obj) { + const objAsLogConvertible = obj; + return objAsLogConvertible.toLog !== void 0 && typeof objAsLogConvertible.toLog === "function"; + } + function attachServerSelectionFields(log2, serverSelectionEvent, maxDocumentLength = exports2.DEFAULT_MAX_DOCUMENT_LENGTH) { + const { selector, operation: operation2, topologyDescription, message: message2 } = serverSelectionEvent; + log2.selector = stringifyWithMaxLen(selector, maxDocumentLength); + log2.operation = operation2; + log2.topologyDescription = stringifyWithMaxLen(topologyDescription, maxDocumentLength); + log2.message = message2; + return log2; + } + function attachCommandFields(log2, commandEvent) { + log2.commandName = commandEvent.commandName; + log2.requestId = commandEvent.requestId; + log2.driverConnectionId = commandEvent.connectionId; + const { host, port } = utils_1.HostAddress.fromString(commandEvent.address).toHostPort(); + log2.serverHost = host; + log2.serverPort = port; + if (commandEvent?.serviceId) { + log2.serviceId = commandEvent.serviceId.toHexString(); + } + log2.databaseName = commandEvent.databaseName; + log2.serverConnectionId = commandEvent.serverConnectionId; + return log2; + } + function attachConnectionFields(log2, event) { + const { host, port } = utils_1.HostAddress.fromString(event.address).toHostPort(); + log2.serverHost = host; + log2.serverPort = port; + return log2; + } + function attachSDAMFields(log2, sdamEvent) { + log2.topologyId = sdamEvent.topologyId; + return log2; + } + function attachServerHeartbeatFields(log2, serverHeartbeatEvent) { + const { awaited, connectionId } = serverHeartbeatEvent; + log2.awaited = awaited; + log2.driverConnectionId = serverHeartbeatEvent.connectionId; + const { host, port } = utils_1.HostAddress.fromString(connectionId).toHostPort(); + log2.serverHost = host; + log2.serverPort = port; + return log2; + } + function defaultLogTransform(logObject, maxDocumentLength = exports2.DEFAULT_MAX_DOCUMENT_LENGTH) { + let log2 = /* @__PURE__ */ Object.create(null); + switch (logObject.name) { + case constants_1.SERVER_SELECTION_STARTED: + log2 = attachServerSelectionFields(log2, logObject, maxDocumentLength); + return log2; + case constants_1.SERVER_SELECTION_FAILED: + log2 = attachServerSelectionFields(log2, logObject, maxDocumentLength); + log2.failure = logObject.failure?.message; + return log2; + case constants_1.SERVER_SELECTION_SUCCEEDED: + log2 = attachServerSelectionFields(log2, logObject, maxDocumentLength); + log2.serverHost = logObject.serverHost; + log2.serverPort = logObject.serverPort; + return log2; + case constants_1.WAITING_FOR_SUITABLE_SERVER: + log2 = attachServerSelectionFields(log2, logObject, maxDocumentLength); + log2.remainingTimeMS = logObject.remainingTimeMS; + return log2; + case constants_1.COMMAND_STARTED: + log2 = attachCommandFields(log2, logObject); + log2.message = "Command started"; + log2.command = stringifyWithMaxLen(logObject.command, maxDocumentLength, { relaxed: true }); + log2.databaseName = logObject.databaseName; + return log2; + case constants_1.COMMAND_SUCCEEDED: + log2 = attachCommandFields(log2, logObject); + log2.message = "Command succeeded"; + log2.durationMS = logObject.duration; + log2.reply = stringifyWithMaxLen(logObject.reply, maxDocumentLength, { relaxed: true }); + return log2; + case constants_1.COMMAND_FAILED: + log2 = attachCommandFields(log2, logObject); + log2.message = "Command failed"; + log2.durationMS = logObject.duration; + log2.failure = logObject.failure?.message ?? "(redacted)"; + return log2; + case constants_1.CONNECTION_POOL_CREATED: + log2 = attachConnectionFields(log2, logObject); + log2.message = "Connection pool created"; + if (logObject.options) { + const { maxIdleTimeMS, minPoolSize, maxPoolSize, maxConnecting, waitQueueTimeoutMS } = logObject.options; + log2 = { + ...log2, + maxIdleTimeMS, + minPoolSize, + maxPoolSize, + maxConnecting, + waitQueueTimeoutMS + }; + } + return log2; + case constants_1.CONNECTION_POOL_READY: + log2 = attachConnectionFields(log2, logObject); + log2.message = "Connection pool ready"; + return log2; + case constants_1.CONNECTION_POOL_CLEARED: + log2 = attachConnectionFields(log2, logObject); + log2.message = "Connection pool cleared"; + if (logObject.serviceId?._bsontype === "ObjectId") { + log2.serviceId = logObject.serviceId?.toHexString(); + } + return log2; + case constants_1.CONNECTION_POOL_CLOSED: + log2 = attachConnectionFields(log2, logObject); + log2.message = "Connection pool closed"; + return log2; + case constants_1.CONNECTION_CREATED: + log2 = attachConnectionFields(log2, logObject); + log2.message = "Connection created"; + log2.driverConnectionId = logObject.connectionId; + return log2; + case constants_1.CONNECTION_READY: + log2 = attachConnectionFields(log2, logObject); + log2.message = "Connection ready"; + log2.driverConnectionId = logObject.connectionId; + log2.durationMS = logObject.durationMS; + return log2; + case constants_1.CONNECTION_CLOSED: + log2 = attachConnectionFields(log2, logObject); + log2.message = "Connection closed"; + log2.driverConnectionId = logObject.connectionId; + switch (logObject.reason) { + case "stale": + log2.reason = "Connection became stale because the pool was cleared"; + break; + case "idle": + log2.reason = "Connection has been available but unused for longer than the configured max idle time"; + break; + case "error": + log2.reason = "An error occurred while using the connection"; + if (logObject.error) { + log2.error = logObject.error; + } + break; + case "poolClosed": + log2.reason = "Connection pool was closed"; + break; + default: + log2.reason = `Unknown close reason: ${logObject.reason}`; + } + return log2; + case constants_1.CONNECTION_CHECK_OUT_STARTED: + log2 = attachConnectionFields(log2, logObject); + log2.message = "Connection checkout started"; + return log2; + case constants_1.CONNECTION_CHECK_OUT_FAILED: + log2 = attachConnectionFields(log2, logObject); + log2.message = "Connection checkout failed"; + switch (logObject.reason) { + case "poolClosed": + log2.reason = "Connection pool was closed"; + break; + case "timeout": + log2.reason = "Wait queue timeout elapsed without a connection becoming available"; + break; + case "connectionError": + log2.reason = "An error occurred while trying to establish a new connection"; + if (logObject.error) { + log2.error = logObject.error; + } + break; + default: + log2.reason = `Unknown close reason: ${logObject.reason}`; + } + log2.durationMS = logObject.durationMS; + return log2; + case constants_1.CONNECTION_CHECKED_OUT: + log2 = attachConnectionFields(log2, logObject); + log2.message = "Connection checked out"; + log2.driverConnectionId = logObject.connectionId; + log2.durationMS = logObject.durationMS; + return log2; + case constants_1.CONNECTION_CHECKED_IN: + log2 = attachConnectionFields(log2, logObject); + log2.message = "Connection checked in"; + log2.driverConnectionId = logObject.connectionId; + return log2; + case constants_1.SERVER_OPENING: + log2 = attachSDAMFields(log2, logObject); + log2 = attachConnectionFields(log2, logObject); + log2.message = "Starting server monitoring"; + return log2; + case constants_1.SERVER_CLOSED: + log2 = attachSDAMFields(log2, logObject); + log2 = attachConnectionFields(log2, logObject); + log2.message = "Stopped server monitoring"; + return log2; + case constants_1.SERVER_HEARTBEAT_STARTED: + log2 = attachSDAMFields(log2, logObject); + log2 = attachServerHeartbeatFields(log2, logObject); + log2.message = "Server heartbeat started"; + return log2; + case constants_1.SERVER_HEARTBEAT_SUCCEEDED: + log2 = attachSDAMFields(log2, logObject); + log2 = attachServerHeartbeatFields(log2, logObject); + log2.message = "Server heartbeat succeeded"; + log2.durationMS = logObject.duration; + log2.serverConnectionId = logObject.serverConnectionId; + log2.reply = stringifyWithMaxLen(logObject.reply, maxDocumentLength, { relaxed: true }); + return log2; + case constants_1.SERVER_HEARTBEAT_FAILED: + log2 = attachSDAMFields(log2, logObject); + log2 = attachServerHeartbeatFields(log2, logObject); + log2.message = "Server heartbeat failed"; + log2.durationMS = logObject.duration; + log2.failure = logObject.failure?.message; + return log2; + case constants_1.TOPOLOGY_OPENING: + log2 = attachSDAMFields(log2, logObject); + log2.message = "Starting topology monitoring"; + return log2; + case constants_1.TOPOLOGY_CLOSED: + log2 = attachSDAMFields(log2, logObject); + log2.message = "Stopped topology monitoring"; + return log2; + case constants_1.TOPOLOGY_DESCRIPTION_CHANGED: + log2 = attachSDAMFields(log2, logObject); + log2.message = "Topology description changed"; + log2.previousDescription = log2.reply = stringifyWithMaxLen(logObject.previousDescription, maxDocumentLength); + log2.newDescription = log2.reply = stringifyWithMaxLen(logObject.newDescription, maxDocumentLength); + return log2; + default: + for (const [key, value] of Object.entries(logObject)) { + if (value != null) + log2[key] = value; + } + } + return log2; + } + var MongoLogger = class { + constructor(options) { + this.pendingLog = null; + this.error = this.log.bind(this, "error"); + this.warn = this.log.bind(this, "warn"); + this.info = this.log.bind(this, "info"); + this.debug = this.log.bind(this, "debug"); + this.trace = this.log.bind(this, "trace"); + this.componentSeverities = options.componentSeverities; + this.maxDocumentLength = options.maxDocumentLength; + this.logDestination = options.logDestination; + this.logDestinationIsStdErr = options.logDestinationIsStdErr; + this.severities = this.createLoggingSeverities(); + } + createLoggingSeverities() { + const severities = Object(); + for (const component of Object.values(exports2.MongoLoggableComponent)) { + severities[component] = {}; + for (const severityLevel of Object.values(exports2.SeverityLevel)) { + severities[component][severityLevel] = compareSeverity(severityLevel, this.componentSeverities[component]) <= 0; + } + } + return severities; + } + turnOffSeverities() { + for (const component of Object.values(exports2.MongoLoggableComponent)) { + this.componentSeverities[component] = exports2.SeverityLevel.OFF; + for (const severityLevel of Object.values(exports2.SeverityLevel)) { + this.severities[component][severityLevel] = false; + } + } + } + logWriteFailureHandler(error2) { + if (this.logDestinationIsStdErr) { + this.turnOffSeverities(); + this.clearPendingLog(); + return; + } + this.logDestination = createStdioLogger(process.stderr); + this.logDestinationIsStdErr = true; + this.clearPendingLog(); + this.error(exports2.MongoLoggableComponent.CLIENT, { + toLog: function() { + return { + message: "User input for mongodbLogPath is now invalid. Logging is halted.", + error: error2.message + }; + } + }); + this.turnOffSeverities(); + this.clearPendingLog(); + } + clearPendingLog() { + this.pendingLog = null; + } + willLog(component, severity) { + if (severity === exports2.SeverityLevel.OFF) + return false; + return this.severities[component][severity]; + } + log(severity, component, message2) { + if (!this.willLog(component, severity)) + return; + let logMessage = { t: /* @__PURE__ */ new Date(), c: component, s: severity }; + if (typeof message2 === "string") { + logMessage.message = message2; + } else if (typeof message2 === "object") { + if (isLogConvertible(message2)) { + logMessage = { ...logMessage, ...message2.toLog() }; + } else { + logMessage = { ...logMessage, ...defaultLogTransform(message2, this.maxDocumentLength) }; + } + } + if ((0, utils_1.isPromiseLike)(this.pendingLog)) { + this.pendingLog = this.pendingLog.then(() => this.logDestination.write(logMessage)).then(this.clearPendingLog.bind(this), this.logWriteFailureHandler.bind(this)); + return; + } + try { + const logResult = this.logDestination.write(logMessage); + if ((0, utils_1.isPromiseLike)(logResult)) { + this.pendingLog = logResult.then(this.clearPendingLog.bind(this), this.logWriteFailureHandler.bind(this)); + } + } catch (error2) { + this.logWriteFailureHandler(error2); + } + } + /** + * Merges options set through environment variables and the MongoClient, preferring environment + * variables when both are set, and substituting defaults for values not set. Options set in + * constructor take precedence over both environment variables and MongoClient options. + * + * @remarks + * When parsing component severity levels, invalid values are treated as unset and replaced with + * the default severity. + * + * @param envOptions - options set for the logger from the environment + * @param clientOptions - options set for the logger in the MongoClient options + * @returns a MongoLoggerOptions object to be used when instantiating a new MongoLogger + */ + static resolveOptions(envOptions, clientOptions) { + const resolvedLogPath = resolveLogPath(envOptions, clientOptions); + const combinedOptions = { + ...envOptions, + ...clientOptions, + mongodbLogPath: resolvedLogPath.mongodbLogPath, + mongodbLogPathIsStdErr: resolvedLogPath.mongodbLogPathIsStdErr + }; + const defaultSeverity = resolveSeverityConfiguration(combinedOptions.mongodbLogComponentSeverities?.default, combinedOptions.MONGODB_LOG_ALL, exports2.SeverityLevel.OFF); + return { + componentSeverities: { + command: resolveSeverityConfiguration(combinedOptions.mongodbLogComponentSeverities?.command, combinedOptions.MONGODB_LOG_COMMAND, defaultSeverity), + topology: resolveSeverityConfiguration(combinedOptions.mongodbLogComponentSeverities?.topology, combinedOptions.MONGODB_LOG_TOPOLOGY, defaultSeverity), + serverSelection: resolveSeverityConfiguration(combinedOptions.mongodbLogComponentSeverities?.serverSelection, combinedOptions.MONGODB_LOG_SERVER_SELECTION, defaultSeverity), + connection: resolveSeverityConfiguration(combinedOptions.mongodbLogComponentSeverities?.connection, combinedOptions.MONGODB_LOG_CONNECTION, defaultSeverity), + client: resolveSeverityConfiguration(combinedOptions.mongodbLogComponentSeverities?.client, combinedOptions.MONGODB_LOG_CLIENT, defaultSeverity), + default: defaultSeverity + }, + maxDocumentLength: combinedOptions.mongodbLogMaxDocumentLength ?? (0, utils_1.parseUnsignedInteger)(combinedOptions.MONGODB_LOG_MAX_DOCUMENT_LENGTH) ?? 1e3, + logDestination: combinedOptions.mongodbLogPath, + logDestinationIsStdErr: combinedOptions.mongodbLogPathIsStdErr + }; + } + }; + exports2.MongoLogger = MongoLogger; + } +}); + +// node_modules/mongodb/lib/mongo_types.js +var require_mongo_types = __commonJS({ + "node_modules/mongodb/lib/mongo_types.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.CancellationToken = exports2.TypedEventEmitter = void 0; + var events_1 = require("events"); + var mongo_logger_1 = require_mongo_logger(); + var utils_1 = require_utils3(); + var TypedEventEmitter = class extends events_1.EventEmitter { + /** @internal */ + emitAndLog(event, ...args2) { + this.emit(event, ...args2); + if (this.component) + this.mongoLogger?.debug(this.component, args2[0]); + } + /** @internal */ + emitAndLogHeartbeat(event, topologyId, serverConnectionId, ...args2) { + this.emit(event, ...args2); + if (this.component) { + const loggableHeartbeatEvent = { + topologyId, + serverConnectionId: serverConnectionId ?? null, + ...args2[0] + }; + this.mongoLogger?.debug(this.component, loggableHeartbeatEvent); + } + } + /** @internal */ + emitAndLogCommand(monitorCommands, event, databaseName, connectionEstablished, ...args2) { + if (monitorCommands) { + this.emit(event, ...args2); + } + if (connectionEstablished) { + const loggableCommandEvent = { + databaseName, + ...args2[0] + }; + this.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.COMMAND, loggableCommandEvent); + } + } + }; + exports2.TypedEventEmitter = TypedEventEmitter; + var CancellationToken = class extends TypedEventEmitter { + constructor(...args2) { + super(...args2); + this.on("error", utils_1.noop); + } + }; + exports2.CancellationToken = CancellationToken; + } +}); + +// node_modules/mongodb/lib/operations/get_more.js +var require_get_more = __commonJS({ + "node_modules/mongodb/lib/operations/get_more.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.GetMoreOperation = void 0; + var responses_1 = require_responses(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var operation_1 = require_operation(); + var GetMoreOperation = class extends operation_1.AbstractOperation { + constructor(ns, cursorId, server, options) { + super(options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.CursorResponse; + this.options = options; + this.ns = ns; + this.cursorId = cursorId; + this.server = server; + } + get commandName() { + return "getMore"; + } + buildCommand(connection) { + if (this.cursorId == null || this.cursorId.isZero()) { + throw new error_1.MongoRuntimeError("Unable to iterate cursor with no id"); + } + const collection = this.ns.collection; + if (collection == null) { + throw new error_1.MongoRuntimeError("A collection name must be determined before getMore"); + } + const getMoreCmd = { + getMore: this.cursorId, + collection + }; + if (typeof this.options.batchSize === "number") { + getMoreCmd.batchSize = Math.abs(this.options.batchSize); + } + if (typeof this.options.maxAwaitTimeMS === "number") { + getMoreCmd.maxTimeMS = this.options.maxAwaitTimeMS; + } + if (this.options.comment !== void 0 && (0, utils_1.maxWireVersion)(connection) >= 9) { + getMoreCmd.comment = this.options.comment; + } + return getMoreCmd; + } + buildOptions(timeoutContext) { + return { + returnFieldSelector: null, + documentsReturnedIn: "nextBatch", + timeoutContext, + ...this.options + }; + } + handleOk(response) { + return response; + } + }; + exports2.GetMoreOperation = GetMoreOperation; + (0, operation_1.defineAspects)(GetMoreOperation, [operation_1.Aspect.READ_OPERATION, operation_1.Aspect.MUST_SELECT_SAME_SERVER]); + } +}); + +// node_modules/mongodb/lib/operations/kill_cursors.js +var require_kill_cursors = __commonJS({ + "node_modules/mongodb/lib/operations/kill_cursors.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.KillCursorsOperation = void 0; + var responses_1 = require_responses(); + var error_1 = require_error(); + var operation_1 = require_operation(); + var KillCursorsOperation = class extends operation_1.AbstractOperation { + constructor(cursorId, ns, server, options) { + super(options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.ns = ns; + this.cursorId = cursorId; + this.server = server; + } + get commandName() { + return "killCursors"; + } + buildCommand(_connection, _session) { + const killCursors = this.ns.collection; + if (killCursors == null) { + throw new error_1.MongoRuntimeError("A collection name must be determined before killCursors"); + } + const killCursorsCommand = { + killCursors, + cursors: [this.cursorId] + }; + return killCursorsCommand; + } + buildOptions(timeoutContext) { + return { + session: this.session, + timeoutContext + }; + } + handleError(_error) { + } + }; + exports2.KillCursorsOperation = KillCursorsOperation; + (0, operation_1.defineAspects)(KillCursorsOperation, [operation_1.Aspect.MUST_SELECT_SAME_SERVER]); + } +}); + +// node_modules/smart-buffer/build/utils.js +var require_utils4 = __commonJS({ + "node_modules/smart-buffer/build/utils.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var buffer_1 = require("buffer"); + var ERRORS = { + INVALID_ENCODING: "Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.", + INVALID_SMARTBUFFER_SIZE: "Invalid size provided. Size must be a valid integer greater than zero.", + INVALID_SMARTBUFFER_BUFFER: "Invalid Buffer provided in SmartBufferOptions.", + INVALID_SMARTBUFFER_OBJECT: "Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.", + INVALID_OFFSET: "An invalid offset value was provided.", + INVALID_OFFSET_NON_NUMBER: "An invalid offset value was provided. A numeric value is required.", + INVALID_LENGTH: "An invalid length value was provided.", + INVALID_LENGTH_NON_NUMBER: "An invalid length value was provived. A numeric value is required.", + INVALID_TARGET_OFFSET: "Target offset is beyond the bounds of the internal SmartBuffer data.", + INVALID_TARGET_LENGTH: "Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.", + INVALID_READ_BEYOND_BOUNDS: "Attempted to read beyond the bounds of the managed data.", + INVALID_WRITE_BEYOND_BOUNDS: "Attempted to write beyond the bounds of the managed data." + }; + exports2.ERRORS = ERRORS; + function checkEncoding(encoding) { + if (!buffer_1.Buffer.isEncoding(encoding)) { + throw new Error(ERRORS.INVALID_ENCODING); + } + } + exports2.checkEncoding = checkEncoding; + function isFiniteInteger(value) { + return typeof value === "number" && isFinite(value) && isInteger(value); + } + exports2.isFiniteInteger = isFiniteInteger; + function checkOffsetOrLengthValue(value, offset) { + if (typeof value === "number") { + if (!isFiniteInteger(value) || value < 0) { + throw new Error(offset ? ERRORS.INVALID_OFFSET : ERRORS.INVALID_LENGTH); + } + } else { + throw new Error(offset ? ERRORS.INVALID_OFFSET_NON_NUMBER : ERRORS.INVALID_LENGTH_NON_NUMBER); + } + } + function checkLengthValue(length) { + checkOffsetOrLengthValue(length, false); + } + exports2.checkLengthValue = checkLengthValue; + function checkOffsetValue(offset) { + checkOffsetOrLengthValue(offset, true); + } + exports2.checkOffsetValue = checkOffsetValue; + function checkTargetOffset(offset, buff) { + if (offset < 0 || offset > buff.length) { + throw new Error(ERRORS.INVALID_TARGET_OFFSET); + } + } + exports2.checkTargetOffset = checkTargetOffset; + function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; + } + function bigIntAndBufferInt64Check(bufferMethod) { + if (typeof BigInt === "undefined") { + throw new Error("Platform does not support JS BigInt type."); + } + if (typeof buffer_1.Buffer.prototype[bufferMethod] === "undefined") { + throw new Error(`Platform does not support Buffer.prototype.${bufferMethod}.`); + } + } + exports2.bigIntAndBufferInt64Check = bigIntAndBufferInt64Check; + } +}); + +// node_modules/smart-buffer/build/smartbuffer.js +var require_smartbuffer = __commonJS({ + "node_modules/smart-buffer/build/smartbuffer.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var utils_1 = require_utils4(); + var DEFAULT_SMARTBUFFER_SIZE = 4096; + var DEFAULT_SMARTBUFFER_ENCODING = "utf8"; + var SmartBuffer = class _SmartBuffer { + /** + * Creates a new SmartBuffer instance. + * + * @param options { SmartBufferOptions } The SmartBufferOptions to apply to this instance. + */ + constructor(options) { + this.length = 0; + this._encoding = DEFAULT_SMARTBUFFER_ENCODING; + this._writeOffset = 0; + this._readOffset = 0; + if (_SmartBuffer.isSmartBufferOptions(options)) { + if (options.encoding) { + utils_1.checkEncoding(options.encoding); + this._encoding = options.encoding; + } + if (options.size) { + if (utils_1.isFiniteInteger(options.size) && options.size > 0) { + this._buff = Buffer.allocUnsafe(options.size); + } else { + throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_SIZE); + } + } else if (options.buff) { + if (Buffer.isBuffer(options.buff)) { + this._buff = options.buff; + this.length = options.buff.length; + } else { + throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_BUFFER); + } + } else { + this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE); + } + } else { + if (typeof options !== "undefined") { + throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_OBJECT); + } + this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE); + } + } + /** + * Creates a new SmartBuffer instance with the provided internal Buffer size and optional encoding. + * + * @param size { Number } The size of the internal Buffer. + * @param encoding { String } The BufferEncoding to use for strings. + * + * @return { SmartBuffer } + */ + static fromSize(size, encoding) { + return new this({ + size, + encoding + }); + } + /** + * Creates a new SmartBuffer instance with the provided Buffer and optional encoding. + * + * @param buffer { Buffer } The Buffer to use as the internal Buffer value. + * @param encoding { String } The BufferEncoding to use for strings. + * + * @return { SmartBuffer } + */ + static fromBuffer(buff, encoding) { + return new this({ + buff, + encoding + }); + } + /** + * Creates a new SmartBuffer instance with the provided SmartBufferOptions options. + * + * @param options { SmartBufferOptions } The options to use when creating the SmartBuffer instance. + */ + static fromOptions(options) { + return new this(options); + } + /** + * Type checking function that determines if an object is a SmartBufferOptions object. + */ + static isSmartBufferOptions(options) { + const castOptions = options; + return castOptions && (castOptions.encoding !== void 0 || castOptions.size !== void 0 || castOptions.buff !== void 0); + } + // Signed integers + /** + * Reads an Int8 value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt8(offset) { + return this._readNumberValue(Buffer.prototype.readInt8, 1, offset); + } + /** + * Reads an Int16BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt16BE(offset) { + return this._readNumberValue(Buffer.prototype.readInt16BE, 2, offset); + } + /** + * Reads an Int16LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt16LE(offset) { + return this._readNumberValue(Buffer.prototype.readInt16LE, 2, offset); + } + /** + * Reads an Int32BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt32BE(offset) { + return this._readNumberValue(Buffer.prototype.readInt32BE, 4, offset); + } + /** + * Reads an Int32LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt32LE(offset) { + return this._readNumberValue(Buffer.prototype.readInt32LE, 4, offset); + } + /** + * Reads a BigInt64BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { BigInt } + */ + readBigInt64BE(offset) { + utils_1.bigIntAndBufferInt64Check("readBigInt64BE"); + return this._readNumberValue(Buffer.prototype.readBigInt64BE, 8, offset); + } + /** + * Reads a BigInt64LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { BigInt } + */ + readBigInt64LE(offset) { + utils_1.bigIntAndBufferInt64Check("readBigInt64LE"); + return this._readNumberValue(Buffer.prototype.readBigInt64LE, 8, offset); + } + /** + * Writes an Int8 value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt8(value, offset) { + this._writeNumberValue(Buffer.prototype.writeInt8, 1, value, offset); + return this; + } + /** + * Inserts an Int8 value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt8(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeInt8, 1, value, offset); + } + /** + * Writes an Int16BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt16BE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset); + } + /** + * Inserts an Int16BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt16BE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset); + } + /** + * Writes an Int16LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt16LE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset); + } + /** + * Inserts an Int16LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt16LE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset); + } + /** + * Writes an Int32BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt32BE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset); + } + /** + * Inserts an Int32BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt32BE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset); + } + /** + * Writes an Int32LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt32LE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset); + } + /** + * Inserts an Int32LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt32LE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset); + } + /** + * Writes a BigInt64BE value to the current write position (or at optional offset). + * + * @param value { BigInt } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeBigInt64BE(value, offset) { + utils_1.bigIntAndBufferInt64Check("writeBigInt64BE"); + return this._writeNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset); + } + /** + * Inserts a BigInt64BE value at the given offset value. + * + * @param value { BigInt } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertBigInt64BE(value, offset) { + utils_1.bigIntAndBufferInt64Check("writeBigInt64BE"); + return this._insertNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset); + } + /** + * Writes a BigInt64LE value to the current write position (or at optional offset). + * + * @param value { BigInt } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeBigInt64LE(value, offset) { + utils_1.bigIntAndBufferInt64Check("writeBigInt64LE"); + return this._writeNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset); + } + /** + * Inserts a Int64LE value at the given offset value. + * + * @param value { BigInt } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertBigInt64LE(value, offset) { + utils_1.bigIntAndBufferInt64Check("writeBigInt64LE"); + return this._insertNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset); + } + // Unsigned Integers + /** + * Reads an UInt8 value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt8(offset) { + return this._readNumberValue(Buffer.prototype.readUInt8, 1, offset); + } + /** + * Reads an UInt16BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt16BE(offset) { + return this._readNumberValue(Buffer.prototype.readUInt16BE, 2, offset); + } + /** + * Reads an UInt16LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt16LE(offset) { + return this._readNumberValue(Buffer.prototype.readUInt16LE, 2, offset); + } + /** + * Reads an UInt32BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt32BE(offset) { + return this._readNumberValue(Buffer.prototype.readUInt32BE, 4, offset); + } + /** + * Reads an UInt32LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt32LE(offset) { + return this._readNumberValue(Buffer.prototype.readUInt32LE, 4, offset); + } + /** + * Reads a BigUInt64BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { BigInt } + */ + readBigUInt64BE(offset) { + utils_1.bigIntAndBufferInt64Check("readBigUInt64BE"); + return this._readNumberValue(Buffer.prototype.readBigUInt64BE, 8, offset); + } + /** + * Reads a BigUInt64LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { BigInt } + */ + readBigUInt64LE(offset) { + utils_1.bigIntAndBufferInt64Check("readBigUInt64LE"); + return this._readNumberValue(Buffer.prototype.readBigUInt64LE, 8, offset); + } + /** + * Writes an UInt8 value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt8(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeUInt8, 1, value, offset); + } + /** + * Inserts an UInt8 value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt8(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeUInt8, 1, value, offset); + } + /** + * Writes an UInt16BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt16BE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset); + } + /** + * Inserts an UInt16BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt16BE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset); + } + /** + * Writes an UInt16LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt16LE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset); + } + /** + * Inserts an UInt16LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt16LE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset); + } + /** + * Writes an UInt32BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt32BE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset); + } + /** + * Inserts an UInt32BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt32BE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset); + } + /** + * Writes an UInt32LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt32LE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset); + } + /** + * Inserts an UInt32LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt32LE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset); + } + /** + * Writes a BigUInt64BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeBigUInt64BE(value, offset) { + utils_1.bigIntAndBufferInt64Check("writeBigUInt64BE"); + return this._writeNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset); + } + /** + * Inserts a BigUInt64BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertBigUInt64BE(value, offset) { + utils_1.bigIntAndBufferInt64Check("writeBigUInt64BE"); + return this._insertNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset); + } + /** + * Writes a BigUInt64LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeBigUInt64LE(value, offset) { + utils_1.bigIntAndBufferInt64Check("writeBigUInt64LE"); + return this._writeNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset); + } + /** + * Inserts a BigUInt64LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertBigUInt64LE(value, offset) { + utils_1.bigIntAndBufferInt64Check("writeBigUInt64LE"); + return this._insertNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset); + } + // Floating Point + /** + * Reads an FloatBE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readFloatBE(offset) { + return this._readNumberValue(Buffer.prototype.readFloatBE, 4, offset); + } + /** + * Reads an FloatLE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readFloatLE(offset) { + return this._readNumberValue(Buffer.prototype.readFloatLE, 4, offset); + } + /** + * Writes a FloatBE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeFloatBE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset); + } + /** + * Inserts a FloatBE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertFloatBE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset); + } + /** + * Writes a FloatLE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeFloatLE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset); + } + /** + * Inserts a FloatLE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertFloatLE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset); + } + // Double Floating Point + /** + * Reads an DoublEBE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readDoubleBE(offset) { + return this._readNumberValue(Buffer.prototype.readDoubleBE, 8, offset); + } + /** + * Reads an DoubleLE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readDoubleLE(offset) { + return this._readNumberValue(Buffer.prototype.readDoubleLE, 8, offset); + } + /** + * Writes a DoubleBE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeDoubleBE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset); + } + /** + * Inserts a DoubleBE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertDoubleBE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset); + } + /** + * Writes a DoubleLE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeDoubleLE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset); + } + /** + * Inserts a DoubleLE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertDoubleLE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset); + } + // Strings + /** + * Reads a String from the current read position. + * + * @param arg1 { Number | String } The number of bytes to read as a String, or the BufferEncoding to use for + * the string (Defaults to instance level encoding). + * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding). + * + * @return { String } + */ + readString(arg1, encoding) { + let lengthVal; + if (typeof arg1 === "number") { + utils_1.checkLengthValue(arg1); + lengthVal = Math.min(arg1, this.length - this._readOffset); + } else { + encoding = arg1; + lengthVal = this.length - this._readOffset; + } + if (typeof encoding !== "undefined") { + utils_1.checkEncoding(encoding); + } + const value = this._buff.slice(this._readOffset, this._readOffset + lengthVal).toString(encoding || this._encoding); + this._readOffset += lengthVal; + return value; + } + /** + * Inserts a String + * + * @param value { String } The String value to insert. + * @param offset { Number } The offset to insert the string at. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + * + * @return this + */ + insertString(value, offset, encoding) { + utils_1.checkOffsetValue(offset); + return this._handleString(value, true, offset, encoding); + } + /** + * Writes a String + * + * @param value { String } The String value to write. + * @param arg2 { Number | String } The offset to write the string at, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + * + * @return this + */ + writeString(value, arg2, encoding) { + return this._handleString(value, false, arg2, encoding); + } + /** + * Reads a null-terminated String from the current read position. + * + * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding). + * + * @return { String } + */ + readStringNT(encoding) { + if (typeof encoding !== "undefined") { + utils_1.checkEncoding(encoding); + } + let nullPos = this.length; + for (let i4 = this._readOffset; i4 < this.length; i4++) { + if (this._buff[i4] === 0) { + nullPos = i4; + break; + } + } + const value = this._buff.slice(this._readOffset, nullPos); + this._readOffset = nullPos + 1; + return value.toString(encoding || this._encoding); + } + /** + * Inserts a null-terminated String. + * + * @param value { String } The String value to write. + * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + * + * @return this + */ + insertStringNT(value, offset, encoding) { + utils_1.checkOffsetValue(offset); + this.insertString(value, offset, encoding); + this.insertUInt8(0, offset + value.length); + return this; + } + /** + * Writes a null-terminated String. + * + * @param value { String } The String value to write. + * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + * + * @return this + */ + writeStringNT(value, arg2, encoding) { + this.writeString(value, arg2, encoding); + this.writeUInt8(0, typeof arg2 === "number" ? arg2 + value.length : this.writeOffset); + return this; + } + // Buffers + /** + * Reads a Buffer from the internal read position. + * + * @param length { Number } The length of data to read as a Buffer. + * + * @return { Buffer } + */ + readBuffer(length) { + if (typeof length !== "undefined") { + utils_1.checkLengthValue(length); + } + const lengthVal = typeof length === "number" ? length : this.length; + const endPoint = Math.min(this.length, this._readOffset + lengthVal); + const value = this._buff.slice(this._readOffset, endPoint); + this._readOffset = endPoint; + return value; + } + /** + * Writes a Buffer to the current write position. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + * + * @return this + */ + insertBuffer(value, offset) { + utils_1.checkOffsetValue(offset); + return this._handleBuffer(value, true, offset); + } + /** + * Writes a Buffer to the current write position. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + * + * @return this + */ + writeBuffer(value, offset) { + return this._handleBuffer(value, false, offset); + } + /** + * Reads a null-terminated Buffer from the current read poisiton. + * + * @return { Buffer } + */ + readBufferNT() { + let nullPos = this.length; + for (let i4 = this._readOffset; i4 < this.length; i4++) { + if (this._buff[i4] === 0) { + nullPos = i4; + break; + } + } + const value = this._buff.slice(this._readOffset, nullPos); + this._readOffset = nullPos + 1; + return value; + } + /** + * Inserts a null-terminated Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + * + * @return this + */ + insertBufferNT(value, offset) { + utils_1.checkOffsetValue(offset); + this.insertBuffer(value, offset); + this.insertUInt8(0, offset + value.length); + return this; + } + /** + * Writes a null-terminated Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + * + * @return this + */ + writeBufferNT(value, offset) { + if (typeof offset !== "undefined") { + utils_1.checkOffsetValue(offset); + } + this.writeBuffer(value, offset); + this.writeUInt8(0, typeof offset === "number" ? offset + value.length : this._writeOffset); + return this; + } + /** + * Clears the SmartBuffer instance to its original empty state. + */ + clear() { + this._writeOffset = 0; + this._readOffset = 0; + this.length = 0; + return this; + } + /** + * Gets the remaining data left to be read from the SmartBuffer instance. + * + * @return { Number } + */ + remaining() { + return this.length - this._readOffset; + } + /** + * Gets the current read offset value of the SmartBuffer instance. + * + * @return { Number } + */ + get readOffset() { + return this._readOffset; + } + /** + * Sets the read offset value of the SmartBuffer instance. + * + * @param offset { Number } - The offset value to set. + */ + set readOffset(offset) { + utils_1.checkOffsetValue(offset); + utils_1.checkTargetOffset(offset, this); + this._readOffset = offset; + } + /** + * Gets the current write offset value of the SmartBuffer instance. + * + * @return { Number } + */ + get writeOffset() { + return this._writeOffset; + } + /** + * Sets the write offset value of the SmartBuffer instance. + * + * @param offset { Number } - The offset value to set. + */ + set writeOffset(offset) { + utils_1.checkOffsetValue(offset); + utils_1.checkTargetOffset(offset, this); + this._writeOffset = offset; + } + /** + * Gets the currently set string encoding of the SmartBuffer instance. + * + * @return { BufferEncoding } The string Buffer encoding currently set. + */ + get encoding() { + return this._encoding; + } + /** + * Sets the string encoding of the SmartBuffer instance. + * + * @param encoding { BufferEncoding } The string Buffer encoding to set. + */ + set encoding(encoding) { + utils_1.checkEncoding(encoding); + this._encoding = encoding; + } + /** + * Gets the underlying internal Buffer. (This includes unmanaged data in the Buffer) + * + * @return { Buffer } The Buffer value. + */ + get internalBuffer() { + return this._buff; + } + /** + * Gets the value of the internal managed Buffer (Includes managed data only) + * + * @param { Buffer } + */ + toBuffer() { + return this._buff.slice(0, this.length); + } + /** + * Gets the String value of the internal managed Buffer + * + * @param encoding { String } The BufferEncoding to display the Buffer as (defaults to instance level encoding). + */ + toString(encoding) { + const encodingVal = typeof encoding === "string" ? encoding : this._encoding; + utils_1.checkEncoding(encodingVal); + return this._buff.toString(encodingVal, 0, this.length); + } + /** + * Destroys the SmartBuffer instance. + */ + destroy() { + this.clear(); + return this; + } + /** + * Handles inserting and writing strings. + * + * @param value { String } The String value to insert. + * @param isInsert { Boolean } True if inserting a string, false if writing. + * @param arg2 { Number | String } The offset to insert the string at, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + */ + _handleString(value, isInsert, arg3, encoding) { + let offsetVal = this._writeOffset; + let encodingVal = this._encoding; + if (typeof arg3 === "number") { + offsetVal = arg3; + } else if (typeof arg3 === "string") { + utils_1.checkEncoding(arg3); + encodingVal = arg3; + } + if (typeof encoding === "string") { + utils_1.checkEncoding(encoding); + encodingVal = encoding; + } + const byteLength = Buffer.byteLength(value, encodingVal); + if (isInsert) { + this.ensureInsertable(byteLength, offsetVal); + } else { + this._ensureWriteable(byteLength, offsetVal); + } + this._buff.write(value, offsetVal, byteLength, encodingVal); + if (isInsert) { + this._writeOffset += byteLength; + } else { + if (typeof arg3 === "number") { + this._writeOffset = Math.max(this._writeOffset, offsetVal + byteLength); + } else { + this._writeOffset += byteLength; + } + } + return this; + } + /** + * Handles writing or insert of a Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + */ + _handleBuffer(value, isInsert, offset) { + const offsetVal = typeof offset === "number" ? offset : this._writeOffset; + if (isInsert) { + this.ensureInsertable(value.length, offsetVal); + } else { + this._ensureWriteable(value.length, offsetVal); + } + value.copy(this._buff, offsetVal); + if (isInsert) { + this._writeOffset += value.length; + } else { + if (typeof offset === "number") { + this._writeOffset = Math.max(this._writeOffset, offsetVal + value.length); + } else { + this._writeOffset += value.length; + } + } + return this; + } + /** + * Ensures that the internal Buffer is large enough to read data. + * + * @param length { Number } The length of the data that needs to be read. + * @param offset { Number } The offset of the data that needs to be read. + */ + ensureReadable(length, offset) { + let offsetVal = this._readOffset; + if (typeof offset !== "undefined") { + utils_1.checkOffsetValue(offset); + offsetVal = offset; + } + if (offsetVal < 0 || offsetVal + length > this.length) { + throw new Error(utils_1.ERRORS.INVALID_READ_BEYOND_BOUNDS); + } + } + /** + * Ensures that the internal Buffer is large enough to insert data. + * + * @param dataLength { Number } The length of the data that needs to be written. + * @param offset { Number } The offset of the data to be written. + */ + ensureInsertable(dataLength, offset) { + utils_1.checkOffsetValue(offset); + this._ensureCapacity(this.length + dataLength); + if (offset < this.length) { + this._buff.copy(this._buff, offset + dataLength, offset, this._buff.length); + } + if (offset + dataLength > this.length) { + this.length = offset + dataLength; + } else { + this.length += dataLength; + } + } + /** + * Ensures that the internal Buffer is large enough to write data. + * + * @param dataLength { Number } The length of the data that needs to be written. + * @param offset { Number } The offset of the data to be written (defaults to writeOffset). + */ + _ensureWriteable(dataLength, offset) { + const offsetVal = typeof offset === "number" ? offset : this._writeOffset; + this._ensureCapacity(offsetVal + dataLength); + if (offsetVal + dataLength > this.length) { + this.length = offsetVal + dataLength; + } + } + /** + * Ensures that the internal Buffer is large enough to write at least the given amount of data. + * + * @param minLength { Number } The minimum length of the data needs to be written. + */ + _ensureCapacity(minLength) { + const oldLength = this._buff.length; + if (minLength > oldLength) { + let data2 = this._buff; + let newLength = oldLength * 3 / 2 + 1; + if (newLength < minLength) { + newLength = minLength; + } + this._buff = Buffer.allocUnsafe(newLength); + data2.copy(this._buff, 0, 0, oldLength); + } + } + /** + * Reads a numeric number value using the provided function. + * + * @typeparam T { number | bigint } The type of the value to be read + * + * @param func { Function(offset: number) => number } The function to read data on the internal Buffer with. + * @param byteSize { Number } The number of bytes read. + * @param offset { Number } The offset to read from (optional). When this is not provided, the managed readOffset is used instead. + * + * @returns { T } the number value + */ + _readNumberValue(func, byteSize, offset) { + this.ensureReadable(byteSize, offset); + const value = func.call(this._buff, typeof offset === "number" ? offset : this._readOffset); + if (typeof offset === "undefined") { + this._readOffset += byteSize; + } + return value; + } + /** + * Inserts a numeric number value based on the given offset and value. + * + * @typeparam T { number | bigint } The type of the value to be written + * + * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with. + * @param byteSize { Number } The number of bytes written. + * @param value { T } The number value to write. + * @param offset { Number } the offset to write the number at (REQUIRED). + * + * @returns SmartBuffer this buffer + */ + _insertNumberValue(func, byteSize, value, offset) { + utils_1.checkOffsetValue(offset); + this.ensureInsertable(byteSize, offset); + func.call(this._buff, value, offset); + this._writeOffset += byteSize; + return this; + } + /** + * Writes a numeric number value based on the given offset and value. + * + * @typeparam T { number | bigint } The type of the value to be written + * + * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with. + * @param byteSize { Number } The number of bytes written. + * @param value { T } The number value to write. + * @param offset { Number } the offset to write the number at (REQUIRED). + * + * @returns SmartBuffer this buffer + */ + _writeNumberValue(func, byteSize, value, offset) { + if (typeof offset === "number") { + if (offset < 0) { + throw new Error(utils_1.ERRORS.INVALID_WRITE_BEYOND_BOUNDS); + } + utils_1.checkOffsetValue(offset); + } + const offsetVal = typeof offset === "number" ? offset : this._writeOffset; + this._ensureWriteable(byteSize, offsetVal); + func.call(this._buff, value, offsetVal); + if (typeof offset === "number") { + this._writeOffset = Math.max(this._writeOffset, offsetVal + byteSize); + } else { + this._writeOffset += byteSize; + } + return this; + } + }; + exports2.SmartBuffer = SmartBuffer; + } +}); + +// node_modules/socks/build/common/constants.js +var require_constants3 = __commonJS({ + "node_modules/socks/build/common/constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SOCKS5_NO_ACCEPTABLE_AUTH = exports2.SOCKS5_CUSTOM_AUTH_END = exports2.SOCKS5_CUSTOM_AUTH_START = exports2.SOCKS_INCOMING_PACKET_SIZES = exports2.SocksClientState = exports2.Socks5Response = exports2.Socks5HostType = exports2.Socks5Auth = exports2.Socks4Response = exports2.SocksCommand = exports2.ERRORS = exports2.DEFAULT_TIMEOUT = void 0; + var DEFAULT_TIMEOUT = 3e4; + exports2.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT; + var ERRORS = { + InvalidSocksCommand: "An invalid SOCKS command was provided. Valid options are connect, bind, and associate.", + InvalidSocksCommandForOperation: "An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.", + InvalidSocksCommandChain: "An invalid SOCKS command was provided. Chaining currently only supports the connect command.", + InvalidSocksClientOptionsDestination: "An invalid destination host was provided.", + InvalidSocksClientOptionsExistingSocket: "An invalid existing socket was provided. This should be an instance of stream.Duplex.", + InvalidSocksClientOptionsProxy: "Invalid SOCKS proxy details were provided.", + InvalidSocksClientOptionsTimeout: "An invalid timeout value was provided. Please enter a value above 0 (in ms).", + InvalidSocksClientOptionsProxiesLength: "At least two socks proxies must be provided for chaining.", + InvalidSocksClientOptionsCustomAuthRange: "Custom auth must be a value between 0x80 and 0xFE.", + InvalidSocksClientOptionsCustomAuthOptions: "When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.", + NegotiationError: "Negotiation error", + SocketClosed: "Socket closed", + ProxyConnectionTimedOut: "Proxy connection timed out", + InternalError: "SocksClient internal error (this should not happen)", + InvalidSocks4HandshakeResponse: "Received invalid Socks4 handshake response", + Socks4ProxyRejectedConnection: "Socks4 Proxy rejected connection", + InvalidSocks4IncomingConnectionResponse: "Socks4 invalid incoming connection response", + Socks4ProxyRejectedIncomingBoundConnection: "Socks4 Proxy rejected incoming bound connection", + InvalidSocks5InitialHandshakeResponse: "Received invalid Socks5 initial handshake response", + InvalidSocks5IntiailHandshakeSocksVersion: "Received invalid Socks5 initial handshake (invalid socks version)", + InvalidSocks5InitialHandshakeNoAcceptedAuthType: "Received invalid Socks5 initial handshake (no accepted authentication type)", + InvalidSocks5InitialHandshakeUnknownAuthType: "Received invalid Socks5 initial handshake (unknown authentication type)", + Socks5AuthenticationFailed: "Socks5 Authentication failed", + InvalidSocks5FinalHandshake: "Received invalid Socks5 final handshake response", + InvalidSocks5FinalHandshakeRejected: "Socks5 proxy rejected connection", + InvalidSocks5IncomingConnectionResponse: "Received invalid Socks5 incoming connection response", + Socks5ProxyRejectedIncomingBoundConnection: "Socks5 Proxy rejected incoming bound connection" + }; + exports2.ERRORS = ERRORS; + var SOCKS_INCOMING_PACKET_SIZES = { + Socks5InitialHandshakeResponse: 2, + Socks5UserPassAuthenticationResponse: 2, + // Command response + incoming connection (bind) + Socks5ResponseHeader: 5, + // We need at least 5 to read the hostname length, then we wait for the address+port information. + Socks5ResponseIPv4: 10, + // 4 header + 4 ip + 2 port + Socks5ResponseIPv6: 22, + // 4 header + 16 ip + 2 port + Socks5ResponseHostname: (hostNameLength) => hostNameLength + 7, + // 4 header + 1 host length + host + 2 port + // Command response + incoming connection (bind) + Socks4Response: 8 + // 2 header + 2 port + 4 ip + }; + exports2.SOCKS_INCOMING_PACKET_SIZES = SOCKS_INCOMING_PACKET_SIZES; + var SocksCommand; + (function(SocksCommand2) { + SocksCommand2[SocksCommand2["connect"] = 1] = "connect"; + SocksCommand2[SocksCommand2["bind"] = 2] = "bind"; + SocksCommand2[SocksCommand2["associate"] = 3] = "associate"; + })(SocksCommand || (exports2.SocksCommand = SocksCommand = {})); + var Socks4Response; + (function(Socks4Response2) { + Socks4Response2[Socks4Response2["Granted"] = 90] = "Granted"; + Socks4Response2[Socks4Response2["Failed"] = 91] = "Failed"; + Socks4Response2[Socks4Response2["Rejected"] = 92] = "Rejected"; + Socks4Response2[Socks4Response2["RejectedIdent"] = 93] = "RejectedIdent"; + })(Socks4Response || (exports2.Socks4Response = Socks4Response = {})); + var Socks5Auth; + (function(Socks5Auth2) { + Socks5Auth2[Socks5Auth2["NoAuth"] = 0] = "NoAuth"; + Socks5Auth2[Socks5Auth2["GSSApi"] = 1] = "GSSApi"; + Socks5Auth2[Socks5Auth2["UserPass"] = 2] = "UserPass"; + })(Socks5Auth || (exports2.Socks5Auth = Socks5Auth = {})); + var SOCKS5_CUSTOM_AUTH_START = 128; + exports2.SOCKS5_CUSTOM_AUTH_START = SOCKS5_CUSTOM_AUTH_START; + var SOCKS5_CUSTOM_AUTH_END = 254; + exports2.SOCKS5_CUSTOM_AUTH_END = SOCKS5_CUSTOM_AUTH_END; + var SOCKS5_NO_ACCEPTABLE_AUTH = 255; + exports2.SOCKS5_NO_ACCEPTABLE_AUTH = SOCKS5_NO_ACCEPTABLE_AUTH; + var Socks5Response; + (function(Socks5Response2) { + Socks5Response2[Socks5Response2["Granted"] = 0] = "Granted"; + Socks5Response2[Socks5Response2["Failure"] = 1] = "Failure"; + Socks5Response2[Socks5Response2["NotAllowed"] = 2] = "NotAllowed"; + Socks5Response2[Socks5Response2["NetworkUnreachable"] = 3] = "NetworkUnreachable"; + Socks5Response2[Socks5Response2["HostUnreachable"] = 4] = "HostUnreachable"; + Socks5Response2[Socks5Response2["ConnectionRefused"] = 5] = "ConnectionRefused"; + Socks5Response2[Socks5Response2["TTLExpired"] = 6] = "TTLExpired"; + Socks5Response2[Socks5Response2["CommandNotSupported"] = 7] = "CommandNotSupported"; + Socks5Response2[Socks5Response2["AddressNotSupported"] = 8] = "AddressNotSupported"; + })(Socks5Response || (exports2.Socks5Response = Socks5Response = {})); + var Socks5HostType; + (function(Socks5HostType2) { + Socks5HostType2[Socks5HostType2["IPv4"] = 1] = "IPv4"; + Socks5HostType2[Socks5HostType2["Hostname"] = 3] = "Hostname"; + Socks5HostType2[Socks5HostType2["IPv6"] = 4] = "IPv6"; + })(Socks5HostType || (exports2.Socks5HostType = Socks5HostType = {})); + var SocksClientState; + (function(SocksClientState2) { + SocksClientState2[SocksClientState2["Created"] = 0] = "Created"; + SocksClientState2[SocksClientState2["Connecting"] = 1] = "Connecting"; + SocksClientState2[SocksClientState2["Connected"] = 2] = "Connected"; + SocksClientState2[SocksClientState2["SentInitialHandshake"] = 3] = "SentInitialHandshake"; + SocksClientState2[SocksClientState2["ReceivedInitialHandshakeResponse"] = 4] = "ReceivedInitialHandshakeResponse"; + SocksClientState2[SocksClientState2["SentAuthentication"] = 5] = "SentAuthentication"; + SocksClientState2[SocksClientState2["ReceivedAuthenticationResponse"] = 6] = "ReceivedAuthenticationResponse"; + SocksClientState2[SocksClientState2["SentFinalHandshake"] = 7] = "SentFinalHandshake"; + SocksClientState2[SocksClientState2["ReceivedFinalResponse"] = 8] = "ReceivedFinalResponse"; + SocksClientState2[SocksClientState2["BoundWaitingForConnection"] = 9] = "BoundWaitingForConnection"; + SocksClientState2[SocksClientState2["Established"] = 10] = "Established"; + SocksClientState2[SocksClientState2["Disconnected"] = 11] = "Disconnected"; + SocksClientState2[SocksClientState2["Error"] = 99] = "Error"; + })(SocksClientState || (exports2.SocksClientState = SocksClientState = {})); + } +}); + +// node_modules/socks/build/common/util.js +var require_util = __commonJS({ + "node_modules/socks/build/common/util.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.shuffleArray = exports2.SocksClientError = void 0; + var SocksClientError = class extends Error { + constructor(message2, options) { + super(message2); + this.options = options; + } + }; + exports2.SocksClientError = SocksClientError; + function shuffleArray(array) { + for (let i4 = array.length - 1; i4 > 0; i4--) { + const j4 = Math.floor(Math.random() * (i4 + 1)); + [array[i4], array[j4]] = [array[j4], array[i4]]; + } + } + exports2.shuffleArray = shuffleArray; + } +}); + +// node_modules/ip-address/dist/common.js +var require_common3 = __commonJS({ + "node_modules/ip-address/dist/common.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isInSubnet = isInSubnet; + exports2.isCorrect = isCorrect; + exports2.numberToPaddedHex = numberToPaddedHex; + exports2.stringToPaddedHex = stringToPaddedHex; + exports2.testBit = testBit; + function isInSubnet(address) { + if (this.subnetMask < address.subnetMask) { + return false; + } + if (this.mask(address.subnetMask) === address.mask()) { + return true; + } + return false; + } + function isCorrect(defaultBits) { + return function() { + if (this.addressMinusSuffix !== this.correctForm()) { + return false; + } + if (this.subnetMask === defaultBits && !this.parsedSubnet) { + return true; + } + return this.parsedSubnet === String(this.subnetMask); + }; + } + function numberToPaddedHex(number) { + return number.toString(16).padStart(2, "0"); + } + function stringToPaddedHex(numberString) { + return numberToPaddedHex(parseInt(numberString, 10)); + } + function testBit(binaryValue, position) { + const { length } = binaryValue; + if (position > length) { + return false; + } + const positionInString = length - position; + return binaryValue.substring(positionInString, positionInString + 1) === "1"; + } + } +}); + +// node_modules/ip-address/dist/v4/constants.js +var require_constants4 = __commonJS({ + "node_modules/ip-address/dist/v4/constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RE_SUBNET_STRING = exports2.RE_ADDRESS = exports2.GROUPS = exports2.BITS = void 0; + exports2.BITS = 32; + exports2.GROUPS = 4; + exports2.RE_ADDRESS = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g; + exports2.RE_SUBNET_STRING = /\/\d{1,2}$/; + } +}); + +// node_modules/ip-address/dist/address-error.js +var require_address_error = __commonJS({ + "node_modules/ip-address/dist/address-error.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AddressError = void 0; + var AddressError = class extends Error { + constructor(message2, parseMessage) { + super(message2); + this.name = "AddressError"; + this.parseMessage = parseMessage; + } + }; + exports2.AddressError = AddressError; + } +}); + +// node_modules/ip-address/dist/ipv4.js +var require_ipv4 = __commonJS({ + "node_modules/ip-address/dist/ipv4.js"(exports2) { + "use strict"; + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + var desc = Object.getOwnPropertyDescriptor(m4, k4); + if (!desc || ("get" in desc ? !m4.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m4[k4]; + } }; + } + Object.defineProperty(o4, k22, desc); + }) : (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + o4[k22] = m4[k4]; + })); + var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o4, v4) { + Object.defineProperty(o4, "default", { enumerable: true, value: v4 }); + }) : function(o4, v4) { + o4["default"] = v4; + }); + var __importStar2 = exports2 && exports2.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k4 in mod) if (k4 !== "default" && Object.prototype.hasOwnProperty.call(mod, k4)) __createBinding2(result, mod, k4); + } + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Address4 = void 0; + var common = __importStar2(require_common3()); + var constants = __importStar2(require_constants4()); + var address_error_1 = require_address_error(); + var Address4 = class _Address4 { + constructor(address) { + this.groups = constants.GROUPS; + this.parsedAddress = []; + this.parsedSubnet = ""; + this.subnet = "/32"; + this.subnetMask = 32; + this.v4 = true; + this.isCorrect = common.isCorrect(constants.BITS); + this.isInSubnet = common.isInSubnet; + this.address = address; + const subnet = constants.RE_SUBNET_STRING.exec(address); + if (subnet) { + this.parsedSubnet = subnet[0].replace("/", ""); + this.subnetMask = parseInt(this.parsedSubnet, 10); + this.subnet = `/${this.subnetMask}`; + if (this.subnetMask < 0 || this.subnetMask > constants.BITS) { + throw new address_error_1.AddressError("Invalid subnet mask."); + } + address = address.replace(constants.RE_SUBNET_STRING, ""); + } + this.addressMinusSuffix = address; + this.parsedAddress = this.parse(address); + } + static isValid(address) { + try { + new _Address4(address); + return true; + } catch (e4) { + return false; + } + } + /* + * Parses a v4 address + */ + parse(address) { + const groups = address.split("."); + if (!address.match(constants.RE_ADDRESS)) { + throw new address_error_1.AddressError("Invalid IPv4 address."); + } + return groups; + } + /** + * Returns the correct form of an address + * @memberof Address4 + * @instance + * @returns {String} + */ + correctForm() { + return this.parsedAddress.map((part) => parseInt(part, 10)).join("."); + } + /** + * Converts a hex string to an IPv4 address object + * @memberof Address4 + * @static + * @param {string} hex - a hex string to convert + * @returns {Address4} + */ + static fromHex(hex) { + const padded = hex.replace(/:/g, "").padStart(8, "0"); + const groups = []; + let i4; + for (i4 = 0; i4 < 8; i4 += 2) { + const h4 = padded.slice(i4, i4 + 2); + groups.push(parseInt(h4, 16)); + } + return new _Address4(groups.join(".")); + } + /** + * Converts an integer into a IPv4 address object + * @memberof Address4 + * @static + * @param {integer} integer - a number to convert + * @returns {Address4} + */ + static fromInteger(integer) { + return _Address4.fromHex(integer.toString(16)); + } + /** + * Return an address from in-addr.arpa form + * @memberof Address4 + * @static + * @param {string} arpaFormAddress - an 'in-addr.arpa' form ipv4 address + * @returns {Adress4} + * @example + * var address = Address4.fromArpa(42.2.0.192.in-addr.arpa.) + * address.correctForm(); // '192.0.2.42' + */ + static fromArpa(arpaFormAddress) { + const leader = arpaFormAddress.replace(/(\.in-addr\.arpa)?\.$/, ""); + const address = leader.split(".").reverse().join("."); + return new _Address4(address); + } + /** + * Converts an IPv4 address object to a hex string + * @memberof Address4 + * @instance + * @returns {String} + */ + toHex() { + return this.parsedAddress.map((part) => common.stringToPaddedHex(part)).join(":"); + } + /** + * Converts an IPv4 address object to an array of bytes + * @memberof Address4 + * @instance + * @returns {Array} + */ + toArray() { + return this.parsedAddress.map((part) => parseInt(part, 10)); + } + /** + * Converts an IPv4 address object to an IPv6 address group + * @memberof Address4 + * @instance + * @returns {String} + */ + toGroup6() { + const output = []; + let i4; + for (i4 = 0; i4 < constants.GROUPS; i4 += 2) { + output.push(`${common.stringToPaddedHex(this.parsedAddress[i4])}${common.stringToPaddedHex(this.parsedAddress[i4 + 1])}`); + } + return output.join(":"); + } + /** + * Returns the address as a `bigint` + * @memberof Address4 + * @instance + * @returns {bigint} + */ + bigInt() { + return BigInt(`0x${this.parsedAddress.map((n4) => common.stringToPaddedHex(n4)).join("")}`); + } + /** + * Helper function getting start address. + * @memberof Address4 + * @instance + * @returns {bigint} + */ + _startAddress() { + return BigInt(`0b${this.mask() + "0".repeat(constants.BITS - this.subnetMask)}`); + } + /** + * The first address in the range given by this address' subnet. + * Often referred to as the Network Address. + * @memberof Address4 + * @instance + * @returns {Address4} + */ + startAddress() { + return _Address4.fromBigInt(this._startAddress()); + } + /** + * The first host address in the range given by this address's subnet ie + * the first address after the Network Address + * @memberof Address4 + * @instance + * @returns {Address4} + */ + startAddressExclusive() { + const adjust = BigInt("1"); + return _Address4.fromBigInt(this._startAddress() + adjust); + } + /** + * Helper function getting end address. + * @memberof Address4 + * @instance + * @returns {bigint} + */ + _endAddress() { + return BigInt(`0b${this.mask() + "1".repeat(constants.BITS - this.subnetMask)}`); + } + /** + * The last address in the range given by this address' subnet + * Often referred to as the Broadcast + * @memberof Address4 + * @instance + * @returns {Address4} + */ + endAddress() { + return _Address4.fromBigInt(this._endAddress()); + } + /** + * The last host address in the range given by this address's subnet ie + * the last address prior to the Broadcast Address + * @memberof Address4 + * @instance + * @returns {Address4} + */ + endAddressExclusive() { + const adjust = BigInt("1"); + return _Address4.fromBigInt(this._endAddress() - adjust); + } + /** + * Converts a BigInt to a v4 address object + * @memberof Address4 + * @static + * @param {bigint} bigInt - a BigInt to convert + * @returns {Address4} + */ + static fromBigInt(bigInt) { + return _Address4.fromHex(bigInt.toString(16)); + } + /** + * Convert a byte array to an Address4 object + * @memberof Address4 + * @static + * @param {Array} bytes - an array of 4 bytes (0-255) + * @returns {Address4} + */ + static fromByteArray(bytes) { + if (bytes.length !== 4) { + throw new address_error_1.AddressError("IPv4 addresses require exactly 4 bytes"); + } + for (let i4 = 0; i4 < bytes.length; i4++) { + if (!Number.isInteger(bytes[i4]) || bytes[i4] < 0 || bytes[i4] > 255) { + throw new address_error_1.AddressError("All bytes must be integers between 0 and 255"); + } + } + return this.fromUnsignedByteArray(bytes); + } + /** + * Convert an unsigned byte array to an Address4 object + * @memberof Address4 + * @static + * @param {Array} bytes - an array of 4 unsigned bytes (0-255) + * @returns {Address4} + */ + static fromUnsignedByteArray(bytes) { + if (bytes.length !== 4) { + throw new address_error_1.AddressError("IPv4 addresses require exactly 4 bytes"); + } + const address = bytes.join("."); + return new _Address4(address); + } + /** + * Returns the first n bits of the address, defaulting to the + * subnet mask + * @memberof Address4 + * @instance + * @returns {String} + */ + mask(mask) { + if (mask === void 0) { + mask = this.subnetMask; + } + return this.getBitsBase2(0, mask); + } + /** + * Returns the bits in the given range as a base-2 string + * @memberof Address4 + * @instance + * @returns {string} + */ + getBitsBase2(start, end) { + return this.binaryZeroPad().slice(start, end); + } + /** + * Return the reversed ip6.arpa form of the address + * @memberof Address4 + * @param {Object} options + * @param {boolean} options.omitSuffix - omit the "in-addr.arpa" suffix + * @instance + * @returns {String} + */ + reverseForm(options) { + if (!options) { + options = {}; + } + const reversed = this.correctForm().split(".").reverse().join("."); + if (options.omitSuffix) { + return reversed; + } + return `${reversed}.in-addr.arpa.`; + } + /** + * Returns true if the given address is a multicast address + * @memberof Address4 + * @instance + * @returns {boolean} + */ + isMulticast() { + return this.isInSubnet(new _Address4("224.0.0.0/4")); + } + /** + * Returns a zero-padded base-2 string representation of the address + * @memberof Address4 + * @instance + * @returns {string} + */ + binaryZeroPad() { + return this.bigInt().toString(2).padStart(constants.BITS, "0"); + } + /** + * Groups an IPv4 address for inclusion at the end of an IPv6 address + * @returns {String} + */ + groupForV6() { + const segments = this.parsedAddress; + return this.address.replace(constants.RE_ADDRESS, `${segments.slice(0, 2).join(".")}.${segments.slice(2, 4).join(".")}`); + } + }; + exports2.Address4 = Address4; + } +}); + +// node_modules/ip-address/dist/v6/constants.js +var require_constants5 = __commonJS({ + "node_modules/ip-address/dist/v6/constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RE_URL_WITH_PORT = exports2.RE_URL = exports2.RE_ZONE_STRING = exports2.RE_SUBNET_STRING = exports2.RE_BAD_ADDRESS = exports2.RE_BAD_CHARACTERS = exports2.TYPES = exports2.SCOPES = exports2.GROUPS = exports2.BITS = void 0; + exports2.BITS = 128; + exports2.GROUPS = 8; + exports2.SCOPES = { + 0: "Reserved", + 1: "Interface local", + 2: "Link local", + 4: "Admin local", + 5: "Site local", + 8: "Organization local", + 14: "Global", + 15: "Reserved" + }; + exports2.TYPES = { + "ff01::1/128": "Multicast (All nodes on this interface)", + "ff01::2/128": "Multicast (All routers on this interface)", + "ff02::1/128": "Multicast (All nodes on this link)", + "ff02::2/128": "Multicast (All routers on this link)", + "ff05::2/128": "Multicast (All routers in this site)", + "ff02::5/128": "Multicast (OSPFv3 AllSPF routers)", + "ff02::6/128": "Multicast (OSPFv3 AllDR routers)", + "ff02::9/128": "Multicast (RIP routers)", + "ff02::a/128": "Multicast (EIGRP routers)", + "ff02::d/128": "Multicast (PIM routers)", + "ff02::16/128": "Multicast (MLDv2 reports)", + "ff01::fb/128": "Multicast (mDNSv6)", + "ff02::fb/128": "Multicast (mDNSv6)", + "ff05::fb/128": "Multicast (mDNSv6)", + "ff02::1:2/128": "Multicast (All DHCP servers and relay agents on this link)", + "ff05::1:2/128": "Multicast (All DHCP servers and relay agents in this site)", + "ff02::1:3/128": "Multicast (All DHCP servers on this link)", + "ff05::1:3/128": "Multicast (All DHCP servers in this site)", + "::/128": "Unspecified", + "::1/128": "Loopback", + "ff00::/8": "Multicast", + "fe80::/10": "Link-local unicast" + }; + exports2.RE_BAD_CHARACTERS = /([^0-9a-f:/%])/gi; + exports2.RE_BAD_ADDRESS = /([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi; + exports2.RE_SUBNET_STRING = /\/\d{1,3}(?=%|$)/; + exports2.RE_ZONE_STRING = /%.*$/; + exports2.RE_URL = /^\[{0,1}([0-9a-f:]+)\]{0,1}/; + exports2.RE_URL_WITH_PORT = /\[([0-9a-f:]+)\]:([0-9]{1,5})/; + } +}); + +// node_modules/ip-address/dist/v6/helpers.js +var require_helpers = __commonJS({ + "node_modules/ip-address/dist/v6/helpers.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.spanAllZeroes = spanAllZeroes; + exports2.spanAll = spanAll; + exports2.spanLeadingZeroes = spanLeadingZeroes; + exports2.simpleGroup = simpleGroup; + function spanAllZeroes(s4) { + return s4.replace(/(0+)/g, '$1'); + } + function spanAll(s4, offset = 0) { + const letters = s4.split(""); + return letters.map((n4, i4) => `${spanAllZeroes(n4)}`).join(""); + } + function spanLeadingZeroesSimple(group) { + return group.replace(/^(0+)/, '$1'); + } + function spanLeadingZeroes(address) { + const groups = address.split(":"); + return groups.map((g4) => spanLeadingZeroesSimple(g4)).join(":"); + } + function simpleGroup(addressString, offset = 0) { + const groups = addressString.split(":"); + return groups.map((g4, i4) => { + if (/group-v4/.test(g4)) { + return g4; + } + return `${spanLeadingZeroesSimple(g4)}`; + }); + } + } +}); + +// node_modules/ip-address/dist/v6/regular-expressions.js +var require_regular_expressions = __commonJS({ + "node_modules/ip-address/dist/v6/regular-expressions.js"(exports2) { + "use strict"; + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + var desc = Object.getOwnPropertyDescriptor(m4, k4); + if (!desc || ("get" in desc ? !m4.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m4[k4]; + } }; + } + Object.defineProperty(o4, k22, desc); + }) : (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + o4[k22] = m4[k4]; + })); + var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o4, v4) { + Object.defineProperty(o4, "default", { enumerable: true, value: v4 }); + }) : function(o4, v4) { + o4["default"] = v4; + }); + var __importStar2 = exports2 && exports2.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k4 in mod) if (k4 !== "default" && Object.prototype.hasOwnProperty.call(mod, k4)) __createBinding2(result, mod, k4); + } + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ADDRESS_BOUNDARY = void 0; + exports2.groupPossibilities = groupPossibilities; + exports2.padGroup = padGroup; + exports2.simpleRegularExpression = simpleRegularExpression; + exports2.possibleElisions = possibleElisions; + var v6 = __importStar2(require_constants5()); + function groupPossibilities(possibilities) { + return `(${possibilities.join("|")})`; + } + function padGroup(group) { + if (group.length < 4) { + return `0{0,${4 - group.length}}${group}`; + } + return group; + } + exports2.ADDRESS_BOUNDARY = "[^A-Fa-f0-9:]"; + function simpleRegularExpression(groups) { + const zeroIndexes = []; + groups.forEach((group, i4) => { + const groupInteger = parseInt(group, 16); + if (groupInteger === 0) { + zeroIndexes.push(i4); + } + }); + const possibilities = zeroIndexes.map((zeroIndex) => groups.map((group, i4) => { + if (i4 === zeroIndex) { + const elision = i4 === 0 || i4 === v6.GROUPS - 1 ? ":" : ""; + return groupPossibilities([padGroup(group), elision]); + } + return padGroup(group); + }).join(":")); + possibilities.push(groups.map(padGroup).join(":")); + return groupPossibilities(possibilities); + } + function possibleElisions(elidedGroups, moreLeft, moreRight) { + const left = moreLeft ? "" : ":"; + const right = moreRight ? "" : ":"; + const possibilities = []; + if (!moreLeft && !moreRight) { + possibilities.push("::"); + } + if (moreLeft && moreRight) { + possibilities.push(""); + } + if (moreRight && !moreLeft || !moreRight && moreLeft) { + possibilities.push(":"); + } + possibilities.push(`${left}(:0{1,4}){1,${elidedGroups - 1}}`); + possibilities.push(`(0{1,4}:){1,${elidedGroups - 1}}${right}`); + possibilities.push(`(0{1,4}:){${elidedGroups - 1}}0{1,4}`); + for (let groups = 1; groups < elidedGroups - 1; groups++) { + for (let position = 1; position < elidedGroups - groups; position++) { + possibilities.push(`(0{1,4}:){${position}}:(0{1,4}:){${elidedGroups - position - groups - 1}}0{1,4}`); + } + } + return groupPossibilities(possibilities); + } + } +}); + +// node_modules/ip-address/dist/ipv6.js +var require_ipv6 = __commonJS({ + "node_modules/ip-address/dist/ipv6.js"(exports2) { + "use strict"; + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + var desc = Object.getOwnPropertyDescriptor(m4, k4); + if (!desc || ("get" in desc ? !m4.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m4[k4]; + } }; + } + Object.defineProperty(o4, k22, desc); + }) : (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + o4[k22] = m4[k4]; + })); + var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o4, v4) { + Object.defineProperty(o4, "default", { enumerable: true, value: v4 }); + }) : function(o4, v4) { + o4["default"] = v4; + }); + var __importStar2 = exports2 && exports2.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k4 in mod) if (k4 !== "default" && Object.prototype.hasOwnProperty.call(mod, k4)) __createBinding2(result, mod, k4); + } + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Address6 = void 0; + var common = __importStar2(require_common3()); + var constants4 = __importStar2(require_constants4()); + var constants6 = __importStar2(require_constants5()); + var helpers = __importStar2(require_helpers()); + var ipv4_1 = require_ipv4(); + var regular_expressions_1 = require_regular_expressions(); + var address_error_1 = require_address_error(); + var common_1 = require_common3(); + function assert(condition) { + if (!condition) { + throw new Error("Assertion failed."); + } + } + function addCommas(number) { + const r4 = /(\d+)(\d{3})/; + while (r4.test(number)) { + number = number.replace(r4, "$1,$2"); + } + return number; + } + function spanLeadingZeroes4(n4) { + n4 = n4.replace(/^(0{1,})([1-9]+)$/, '$1$2'); + n4 = n4.replace(/^(0{1,})(0)$/, '$1$2'); + return n4; + } + function compact(address, slice) { + const s1 = []; + const s22 = []; + let i4; + for (i4 = 0; i4 < address.length; i4++) { + if (i4 < slice[0]) { + s1.push(address[i4]); + } else if (i4 > slice[1]) { + s22.push(address[i4]); + } + } + return s1.concat(["compact"]).concat(s22); + } + function paddedHex(octet) { + return parseInt(octet, 16).toString(16).padStart(4, "0"); + } + function unsignByte(b4) { + return b4 & 255; + } + var Address6 = class _Address6 { + constructor(address, optionalGroups) { + this.addressMinusSuffix = ""; + this.parsedSubnet = ""; + this.subnet = "/128"; + this.subnetMask = 128; + this.v4 = false; + this.zone = ""; + this.isInSubnet = common.isInSubnet; + this.isCorrect = common.isCorrect(constants6.BITS); + if (optionalGroups === void 0) { + this.groups = constants6.GROUPS; + } else { + this.groups = optionalGroups; + } + this.address = address; + const subnet = constants6.RE_SUBNET_STRING.exec(address); + if (subnet) { + this.parsedSubnet = subnet[0].replace("/", ""); + this.subnetMask = parseInt(this.parsedSubnet, 10); + this.subnet = `/${this.subnetMask}`; + if (Number.isNaN(this.subnetMask) || this.subnetMask < 0 || this.subnetMask > constants6.BITS) { + throw new address_error_1.AddressError("Invalid subnet mask."); + } + address = address.replace(constants6.RE_SUBNET_STRING, ""); + } else if (/\//.test(address)) { + throw new address_error_1.AddressError("Invalid subnet mask."); + } + const zone = constants6.RE_ZONE_STRING.exec(address); + if (zone) { + this.zone = zone[0]; + address = address.replace(constants6.RE_ZONE_STRING, ""); + } + this.addressMinusSuffix = address; + this.parsedAddress = this.parse(this.addressMinusSuffix); + } + static isValid(address) { + try { + new _Address6(address); + return true; + } catch (e4) { + return false; + } + } + /** + * Convert a BigInt to a v6 address object + * @memberof Address6 + * @static + * @param {bigint} bigInt - a BigInt to convert + * @returns {Address6} + * @example + * var bigInt = BigInt('1000000000000'); + * var address = Address6.fromBigInt(bigInt); + * address.correctForm(); // '::e8:d4a5:1000' + */ + static fromBigInt(bigInt) { + const hex = bigInt.toString(16).padStart(32, "0"); + const groups = []; + let i4; + for (i4 = 0; i4 < constants6.GROUPS; i4++) { + groups.push(hex.slice(i4 * 4, (i4 + 1) * 4)); + } + return new _Address6(groups.join(":")); + } + /** + * Convert a URL (with optional port number) to an address object + * @memberof Address6 + * @static + * @param {string} url - a URL with optional port number + * @example + * var addressAndPort = Address6.fromURL('http://[ffff::]:8080/foo/'); + * addressAndPort.address.correctForm(); // 'ffff::' + * addressAndPort.port; // 8080 + */ + static fromURL(url) { + let host; + let port = null; + let result; + if (url.indexOf("[") !== -1 && url.indexOf("]:") !== -1) { + result = constants6.RE_URL_WITH_PORT.exec(url); + if (result === null) { + return { + error: "failed to parse address with port", + address: null, + port: null + }; + } + host = result[1]; + port = result[2]; + } else if (url.indexOf("/") !== -1) { + url = url.replace(/^[a-z0-9]+:\/\//, ""); + result = constants6.RE_URL.exec(url); + if (result === null) { + return { + error: "failed to parse address from URL", + address: null, + port: null + }; + } + host = result[1]; + } else { + host = url; + } + if (port) { + port = parseInt(port, 10); + if (port < 0 || port > 65536) { + port = null; + } + } else { + port = null; + } + return { + address: new _Address6(host), + port + }; + } + /** + * Create an IPv6-mapped address given an IPv4 address + * @memberof Address6 + * @static + * @param {string} address - An IPv4 address string + * @returns {Address6} + * @example + * var address = Address6.fromAddress4('192.168.0.1'); + * address.correctForm(); // '::ffff:c0a8:1' + * address.to4in6(); // '::ffff:192.168.0.1' + */ + static fromAddress4(address) { + const address4 = new ipv4_1.Address4(address); + const mask6 = constants6.BITS - (constants4.BITS - address4.subnetMask); + return new _Address6(`::ffff:${address4.correctForm()}/${mask6}`); + } + /** + * Return an address from ip6.arpa form + * @memberof Address6 + * @static + * @param {string} arpaFormAddress - an 'ip6.arpa' form address + * @returns {Adress6} + * @example + * var address = Address6.fromArpa(e.f.f.f.3.c.2.6.f.f.f.e.6.6.8.e.1.0.6.7.9.4.e.c.0.0.0.0.1.0.0.2.ip6.arpa.) + * address.correctForm(); // '2001:0:ce49:7601:e866:efff:62c3:fffe' + */ + static fromArpa(arpaFormAddress) { + let address = arpaFormAddress.replace(/(\.ip6\.arpa)?\.$/, ""); + const semicolonAmount = 7; + if (address.length !== 63) { + throw new address_error_1.AddressError("Invalid 'ip6.arpa' form."); + } + const parts = address.split(".").reverse(); + for (let i4 = semicolonAmount; i4 > 0; i4--) { + const insertIndex = i4 * 4; + parts.splice(insertIndex, 0, ":"); + } + address = parts.join(""); + return new _Address6(address); + } + /** + * Return the Microsoft UNC transcription of the address + * @memberof Address6 + * @instance + * @returns {String} the Microsoft UNC transcription of the address + */ + microsoftTranscription() { + return `${this.correctForm().replace(/:/g, "-")}.ipv6-literal.net`; + } + /** + * Return the first n bits of the address, defaulting to the subnet mask + * @memberof Address6 + * @instance + * @param {number} [mask=subnet] - the number of bits to mask + * @returns {String} the first n bits of the address as a string + */ + mask(mask = this.subnetMask) { + return this.getBitsBase2(0, mask); + } + /** + * Return the number of possible subnets of a given size in the address + * @memberof Address6 + * @instance + * @param {number} [subnetSize=128] - the subnet size + * @returns {String} + */ + // TODO: probably useful to have a numeric version of this too + possibleSubnets(subnetSize = 128) { + const availableBits = constants6.BITS - this.subnetMask; + const subnetBits = Math.abs(subnetSize - constants6.BITS); + const subnetPowers = availableBits - subnetBits; + if (subnetPowers < 0) { + return "0"; + } + return addCommas((BigInt("2") ** BigInt(subnetPowers)).toString(10)); + } + /** + * Helper function getting start address. + * @memberof Address6 + * @instance + * @returns {bigint} + */ + _startAddress() { + return BigInt(`0b${this.mask() + "0".repeat(constants6.BITS - this.subnetMask)}`); + } + /** + * The first address in the range given by this address' subnet + * Often referred to as the Network Address. + * @memberof Address6 + * @instance + * @returns {Address6} + */ + startAddress() { + return _Address6.fromBigInt(this._startAddress()); + } + /** + * The first host address in the range given by this address's subnet ie + * the first address after the Network Address + * @memberof Address6 + * @instance + * @returns {Address6} + */ + startAddressExclusive() { + const adjust = BigInt("1"); + return _Address6.fromBigInt(this._startAddress() + adjust); + } + /** + * Helper function getting end address. + * @memberof Address6 + * @instance + * @returns {bigint} + */ + _endAddress() { + return BigInt(`0b${this.mask() + "1".repeat(constants6.BITS - this.subnetMask)}`); + } + /** + * The last address in the range given by this address' subnet + * Often referred to as the Broadcast + * @memberof Address6 + * @instance + * @returns {Address6} + */ + endAddress() { + return _Address6.fromBigInt(this._endAddress()); + } + /** + * The last host address in the range given by this address's subnet ie + * the last address prior to the Broadcast Address + * @memberof Address6 + * @instance + * @returns {Address6} + */ + endAddressExclusive() { + const adjust = BigInt("1"); + return _Address6.fromBigInt(this._endAddress() - adjust); + } + /** + * Return the scope of the address + * @memberof Address6 + * @instance + * @returns {String} + */ + getScope() { + let scope = constants6.SCOPES[parseInt(this.getBits(12, 16).toString(10), 10)]; + if (this.getType() === "Global unicast" && scope !== "Link local") { + scope = "Global"; + } + return scope || "Unknown"; + } + /** + * Return the type of the address + * @memberof Address6 + * @instance + * @returns {String} + */ + getType() { + for (const subnet of Object.keys(constants6.TYPES)) { + if (this.isInSubnet(new _Address6(subnet))) { + return constants6.TYPES[subnet]; + } + } + return "Global unicast"; + } + /** + * Return the bits in the given range as a BigInt + * @memberof Address6 + * @instance + * @returns {bigint} + */ + getBits(start, end) { + return BigInt(`0b${this.getBitsBase2(start, end)}`); + } + /** + * Return the bits in the given range as a base-2 string + * @memberof Address6 + * @instance + * @returns {String} + */ + getBitsBase2(start, end) { + return this.binaryZeroPad().slice(start, end); + } + /** + * Return the bits in the given range as a base-16 string + * @memberof Address6 + * @instance + * @returns {String} + */ + getBitsBase16(start, end) { + const length = end - start; + if (length % 4 !== 0) { + throw new Error("Length of bits to retrieve must be divisible by four"); + } + return this.getBits(start, end).toString(16).padStart(length / 4, "0"); + } + /** + * Return the bits that are set past the subnet mask length + * @memberof Address6 + * @instance + * @returns {String} + */ + getBitsPastSubnet() { + return this.getBitsBase2(this.subnetMask, constants6.BITS); + } + /** + * Return the reversed ip6.arpa form of the address + * @memberof Address6 + * @param {Object} options + * @param {boolean} options.omitSuffix - omit the "ip6.arpa" suffix + * @instance + * @returns {String} + */ + reverseForm(options) { + if (!options) { + options = {}; + } + const characters = Math.floor(this.subnetMask / 4); + const reversed = this.canonicalForm().replace(/:/g, "").split("").slice(0, characters).reverse().join("."); + if (characters > 0) { + if (options.omitSuffix) { + return reversed; + } + return `${reversed}.ip6.arpa.`; + } + if (options.omitSuffix) { + return ""; + } + return "ip6.arpa."; + } + /** + * Return the correct form of the address + * @memberof Address6 + * @instance + * @returns {String} + */ + correctForm() { + let i4; + let groups = []; + let zeroCounter = 0; + const zeroes = []; + for (i4 = 0; i4 < this.parsedAddress.length; i4++) { + const value = parseInt(this.parsedAddress[i4], 16); + if (value === 0) { + zeroCounter++; + } + if (value !== 0 && zeroCounter > 0) { + if (zeroCounter > 1) { + zeroes.push([i4 - zeroCounter, i4 - 1]); + } + zeroCounter = 0; + } + } + if (zeroCounter > 1) { + zeroes.push([this.parsedAddress.length - zeroCounter, this.parsedAddress.length - 1]); + } + const zeroLengths = zeroes.map((n4) => n4[1] - n4[0] + 1); + if (zeroes.length > 0) { + const index = zeroLengths.indexOf(Math.max(...zeroLengths)); + groups = compact(this.parsedAddress, zeroes[index]); + } else { + groups = this.parsedAddress; + } + for (i4 = 0; i4 < groups.length; i4++) { + if (groups[i4] !== "compact") { + groups[i4] = parseInt(groups[i4], 16).toString(16); + } + } + let correct = groups.join(":"); + correct = correct.replace(/^compact$/, "::"); + correct = correct.replace(/(^compact)|(compact$)/, ":"); + correct = correct.replace(/compact/, ""); + return correct; + } + /** + * Return a zero-padded base-2 string representation of the address + * @memberof Address6 + * @instance + * @returns {String} + * @example + * var address = new Address6('2001:4860:4001:803::1011'); + * address.binaryZeroPad(); + * // '0010000000000001010010000110000001000000000000010000100000000011 + * // 0000000000000000000000000000000000000000000000000001000000010001' + */ + binaryZeroPad() { + return this.bigInt().toString(2).padStart(constants6.BITS, "0"); + } + // TODO: Improve the semantics of this helper function + parse4in6(address) { + const groups = address.split(":"); + const lastGroup = groups.slice(-1)[0]; + const address4 = lastGroup.match(constants4.RE_ADDRESS); + if (address4) { + this.parsedAddress4 = address4[0]; + this.address4 = new ipv4_1.Address4(this.parsedAddress4); + for (let i4 = 0; i4 < this.address4.groups; i4++) { + if (/^0[0-9]+/.test(this.address4.parsedAddress[i4])) { + throw new address_error_1.AddressError("IPv4 addresses can't have leading zeroes.", address.replace(constants4.RE_ADDRESS, this.address4.parsedAddress.map(spanLeadingZeroes4).join("."))); + } + } + this.v4 = true; + groups[groups.length - 1] = this.address4.toGroup6(); + address = groups.join(":"); + } + return address; + } + // TODO: Make private? + parse(address) { + address = this.parse4in6(address); + const badCharacters = address.match(constants6.RE_BAD_CHARACTERS); + if (badCharacters) { + throw new address_error_1.AddressError(`Bad character${badCharacters.length > 1 ? "s" : ""} detected in address: ${badCharacters.join("")}`, address.replace(constants6.RE_BAD_CHARACTERS, '$1')); + } + const badAddress = address.match(constants6.RE_BAD_ADDRESS); + if (badAddress) { + throw new address_error_1.AddressError(`Address failed regex: ${badAddress.join("")}`, address.replace(constants6.RE_BAD_ADDRESS, '$1')); + } + let groups = []; + const halves = address.split("::"); + if (halves.length === 2) { + let first = halves[0].split(":"); + let last = halves[1].split(":"); + if (first.length === 1 && first[0] === "") { + first = []; + } + if (last.length === 1 && last[0] === "") { + last = []; + } + const remaining = this.groups - (first.length + last.length); + if (!remaining) { + throw new address_error_1.AddressError("Error parsing groups"); + } + this.elidedGroups = remaining; + this.elisionBegin = first.length; + this.elisionEnd = first.length + this.elidedGroups; + groups = groups.concat(first); + for (let i4 = 0; i4 < remaining; i4++) { + groups.push("0"); + } + groups = groups.concat(last); + } else if (halves.length === 1) { + groups = address.split(":"); + this.elidedGroups = 0; + } else { + throw new address_error_1.AddressError("Too many :: groups found"); + } + groups = groups.map((group) => parseInt(group, 16).toString(16)); + if (groups.length !== this.groups) { + throw new address_error_1.AddressError("Incorrect number of groups found"); + } + return groups; + } + /** + * Return the canonical form of the address + * @memberof Address6 + * @instance + * @returns {String} + */ + canonicalForm() { + return this.parsedAddress.map(paddedHex).join(":"); + } + /** + * Return the decimal form of the address + * @memberof Address6 + * @instance + * @returns {String} + */ + decimal() { + return this.parsedAddress.map((n4) => parseInt(n4, 16).toString(10).padStart(5, "0")).join(":"); + } + /** + * Return the address as a BigInt + * @memberof Address6 + * @instance + * @returns {bigint} + */ + bigInt() { + return BigInt(`0x${this.parsedAddress.map(paddedHex).join("")}`); + } + /** + * Return the last two groups of this address as an IPv4 address string + * @memberof Address6 + * @instance + * @returns {Address4} + * @example + * var address = new Address6('2001:4860:4001::1825:bf11'); + * address.to4().correctForm(); // '24.37.191.17' + */ + to4() { + const binary = this.binaryZeroPad().split(""); + return ipv4_1.Address4.fromHex(BigInt(`0b${binary.slice(96, 128).join("")}`).toString(16)); + } + /** + * Return the v4-in-v6 form of the address + * @memberof Address6 + * @instance + * @returns {String} + */ + to4in6() { + const address4 = this.to4(); + const address6 = new _Address6(this.parsedAddress.slice(0, 6).join(":"), 6); + const correct = address6.correctForm(); + let infix = ""; + if (!/:$/.test(correct)) { + infix = ":"; + } + return correct + infix + address4.address; + } + /** + * Return an object containing the Teredo properties of the address + * @memberof Address6 + * @instance + * @returns {Object} + */ + inspectTeredo() { + const prefix = this.getBitsBase16(0, 32); + const bitsForUdpPort = this.getBits(80, 96); + const udpPort = (bitsForUdpPort ^ BigInt("0xffff")).toString(); + const server4 = ipv4_1.Address4.fromHex(this.getBitsBase16(32, 64)); + const bitsForClient4 = this.getBits(96, 128); + const client4 = ipv4_1.Address4.fromHex((bitsForClient4 ^ BigInt("0xffffffff")).toString(16)); + const flagsBase2 = this.getBitsBase2(64, 80); + const coneNat = (0, common_1.testBit)(flagsBase2, 15); + const reserved = (0, common_1.testBit)(flagsBase2, 14); + const groupIndividual = (0, common_1.testBit)(flagsBase2, 8); + const universalLocal = (0, common_1.testBit)(flagsBase2, 9); + const nonce = BigInt(`0b${flagsBase2.slice(2, 6) + flagsBase2.slice(8, 16)}`).toString(10); + return { + prefix: `${prefix.slice(0, 4)}:${prefix.slice(4, 8)}`, + server4: server4.address, + client4: client4.address, + flags: flagsBase2, + coneNat, + microsoft: { + reserved, + universalLocal, + groupIndividual, + nonce + }, + udpPort + }; + } + /** + * Return an object containing the 6to4 properties of the address + * @memberof Address6 + * @instance + * @returns {Object} + */ + inspect6to4() { + const prefix = this.getBitsBase16(0, 16); + const gateway = ipv4_1.Address4.fromHex(this.getBitsBase16(16, 48)); + return { + prefix: prefix.slice(0, 4), + gateway: gateway.address + }; + } + /** + * Return a v6 6to4 address from a v6 v4inv6 address + * @memberof Address6 + * @instance + * @returns {Address6} + */ + to6to4() { + if (!this.is4()) { + return null; + } + const addr6to4 = [ + "2002", + this.getBitsBase16(96, 112), + this.getBitsBase16(112, 128), + "", + "/16" + ].join(":"); + return new _Address6(addr6to4); + } + /** + * Return a byte array + * @memberof Address6 + * @instance + * @returns {Array} + */ + toByteArray() { + const valueWithoutPadding = this.bigInt().toString(16); + const leadingPad = "0".repeat(valueWithoutPadding.length % 2); + const value = `${leadingPad}${valueWithoutPadding}`; + const bytes = []; + for (let i4 = 0, length = value.length; i4 < length; i4 += 2) { + bytes.push(parseInt(value.substring(i4, i4 + 2), 16)); + } + return bytes; + } + /** + * Return an unsigned byte array + * @memberof Address6 + * @instance + * @returns {Array} + */ + toUnsignedByteArray() { + return this.toByteArray().map(unsignByte); + } + /** + * Convert a byte array to an Address6 object + * @memberof Address6 + * @static + * @returns {Address6} + */ + static fromByteArray(bytes) { + return this.fromUnsignedByteArray(bytes.map(unsignByte)); + } + /** + * Convert an unsigned byte array to an Address6 object + * @memberof Address6 + * @static + * @returns {Address6} + */ + static fromUnsignedByteArray(bytes) { + const BYTE_MAX = BigInt("256"); + let result = BigInt("0"); + let multiplier = BigInt("1"); + for (let i4 = bytes.length - 1; i4 >= 0; i4--) { + result += multiplier * BigInt(bytes[i4].toString(10)); + multiplier *= BYTE_MAX; + } + return _Address6.fromBigInt(result); + } + /** + * Returns true if the address is in the canonical form, false otherwise + * @memberof Address6 + * @instance + * @returns {boolean} + */ + isCanonical() { + return this.addressMinusSuffix === this.canonicalForm(); + } + /** + * Returns true if the address is a link local address, false otherwise + * @memberof Address6 + * @instance + * @returns {boolean} + */ + isLinkLocal() { + if (this.getBitsBase2(0, 64) === "1111111010000000000000000000000000000000000000000000000000000000") { + return true; + } + return false; + } + /** + * Returns true if the address is a multicast address, false otherwise + * @memberof Address6 + * @instance + * @returns {boolean} + */ + isMulticast() { + return this.getType() === "Multicast"; + } + /** + * Returns true if the address is a v4-in-v6 address, false otherwise + * @memberof Address6 + * @instance + * @returns {boolean} + */ + is4() { + return this.v4; + } + /** + * Returns true if the address is a Teredo address, false otherwise + * @memberof Address6 + * @instance + * @returns {boolean} + */ + isTeredo() { + return this.isInSubnet(new _Address6("2001::/32")); + } + /** + * Returns true if the address is a 6to4 address, false otherwise + * @memberof Address6 + * @instance + * @returns {boolean} + */ + is6to4() { + return this.isInSubnet(new _Address6("2002::/16")); + } + /** + * Returns true if the address is a loopback address, false otherwise + * @memberof Address6 + * @instance + * @returns {boolean} + */ + isLoopback() { + return this.getType() === "Loopback"; + } + // #endregion + // #region HTML + /** + * @returns {String} the address in link form with a default port of 80 + */ + href(optionalPort) { + if (optionalPort === void 0) { + optionalPort = ""; + } else { + optionalPort = `:${optionalPort}`; + } + return `http://[${this.correctForm()}]${optionalPort}/`; + } + /** + * @returns {String} a link suitable for conveying the address via a URL hash + */ + link(options) { + if (!options) { + options = {}; + } + if (options.className === void 0) { + options.className = ""; + } + if (options.prefix === void 0) { + options.prefix = "/#address="; + } + if (options.v4 === void 0) { + options.v4 = false; + } + let formFunction = this.correctForm; + if (options.v4) { + formFunction = this.to4in6; + } + const form = formFunction.call(this); + if (options.className) { + return `${form}`; + } + return `${form}`; + } + /** + * Groups an address + * @returns {String} + */ + group() { + if (this.elidedGroups === 0) { + return helpers.simpleGroup(this.address).join(":"); + } + assert(typeof this.elidedGroups === "number"); + assert(typeof this.elisionBegin === "number"); + const output = []; + const [left, right] = this.address.split("::"); + if (left.length) { + output.push(...helpers.simpleGroup(left)); + } else { + output.push(""); + } + const classes = ["hover-group"]; + for (let i4 = this.elisionBegin; i4 < this.elisionBegin + this.elidedGroups; i4++) { + classes.push(`group-${i4}`); + } + output.push(``); + if (right.length) { + output.push(...helpers.simpleGroup(right, this.elisionEnd)); + } else { + output.push(""); + } + if (this.is4()) { + assert(this.address4 instanceof ipv4_1.Address4); + output.pop(); + output.push(this.address4.groupForV6()); + } + return output.join(":"); + } + // #endregion + // #region Regular expressions + /** + * Generate a regular expression string that can be used to find or validate + * all variations of this address + * @memberof Address6 + * @instance + * @param {boolean} substringSearch + * @returns {string} + */ + regularExpressionString(substringSearch = false) { + let output = []; + const address6 = new _Address6(this.correctForm()); + if (address6.elidedGroups === 0) { + output.push((0, regular_expressions_1.simpleRegularExpression)(address6.parsedAddress)); + } else if (address6.elidedGroups === constants6.GROUPS) { + output.push((0, regular_expressions_1.possibleElisions)(constants6.GROUPS)); + } else { + const halves = address6.address.split("::"); + if (halves[0].length) { + output.push((0, regular_expressions_1.simpleRegularExpression)(halves[0].split(":"))); + } + assert(typeof address6.elidedGroups === "number"); + output.push((0, regular_expressions_1.possibleElisions)(address6.elidedGroups, halves[0].length !== 0, halves[1].length !== 0)); + if (halves[1].length) { + output.push((0, regular_expressions_1.simpleRegularExpression)(halves[1].split(":"))); + } + output = [output.join(":")]; + } + if (!substringSearch) { + output = [ + "(?=^|", + regular_expressions_1.ADDRESS_BOUNDARY, + "|[^\\w\\:])(", + ...output, + ")(?=[^\\w\\:]|", + regular_expressions_1.ADDRESS_BOUNDARY, + "|$)" + ]; + } + return output.join(""); + } + /** + * Generate a regular expression that can be used to find or validate all + * variations of this address. + * @memberof Address6 + * @instance + * @param {boolean} substringSearch + * @returns {RegExp} + */ + regularExpression(substringSearch = false) { + return new RegExp(this.regularExpressionString(substringSearch), "i"); + } + }; + exports2.Address6 = Address6; + } +}); + +// node_modules/ip-address/dist/ip-address.js +var require_ip_address = __commonJS({ + "node_modules/ip-address/dist/ip-address.js"(exports2) { + "use strict"; + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + var desc = Object.getOwnPropertyDescriptor(m4, k4); + if (!desc || ("get" in desc ? !m4.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m4[k4]; + } }; + } + Object.defineProperty(o4, k22, desc); + }) : (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + o4[k22] = m4[k4]; + })); + var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o4, v4) { + Object.defineProperty(o4, "default", { enumerable: true, value: v4 }); + }) : function(o4, v4) { + o4["default"] = v4; + }); + var __importStar2 = exports2 && exports2.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k4 in mod) if (k4 !== "default" && Object.prototype.hasOwnProperty.call(mod, k4)) __createBinding2(result, mod, k4); + } + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.v6 = exports2.AddressError = exports2.Address6 = exports2.Address4 = void 0; + var ipv4_1 = require_ipv4(); + Object.defineProperty(exports2, "Address4", { enumerable: true, get: function() { + return ipv4_1.Address4; + } }); + var ipv6_1 = require_ipv6(); + Object.defineProperty(exports2, "Address6", { enumerable: true, get: function() { + return ipv6_1.Address6; + } }); + var address_error_1 = require_address_error(); + Object.defineProperty(exports2, "AddressError", { enumerable: true, get: function() { + return address_error_1.AddressError; + } }); + var helpers = __importStar2(require_helpers()); + exports2.v6 = { helpers }; + } +}); + +// node_modules/socks/build/common/helpers.js +var require_helpers2 = __commonJS({ + "node_modules/socks/build/common/helpers.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ipToBuffer = exports2.int32ToIpv4 = exports2.ipv4ToInt32 = exports2.validateSocksClientChainOptions = exports2.validateSocksClientOptions = void 0; + var util_1 = require_util(); + var constants_1 = require_constants3(); + var stream = require("stream"); + var ip_address_1 = require_ip_address(); + var net = require("net"); + function validateSocksClientOptions(options, acceptedCommands = ["connect", "bind", "associate"]) { + if (!constants_1.SocksCommand[options.command]) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommand, options); + } + if (acceptedCommands.indexOf(options.command) === -1) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandForOperation, options); + } + if (!isValidSocksRemoteHost(options.destination)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options); + } + if (!isValidSocksProxy(options.proxy)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options); + } + validateCustomProxyAuth(options.proxy, options); + if (options.timeout && !isValidTimeoutValue(options.timeout)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options); + } + if (options.existing_socket && !(options.existing_socket instanceof stream.Duplex)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsExistingSocket, options); + } + } + exports2.validateSocksClientOptions = validateSocksClientOptions; + function validateSocksClientChainOptions(options) { + if (options.command !== "connect") { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandChain, options); + } + if (!isValidSocksRemoteHost(options.destination)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options); + } + if (!(options.proxies && Array.isArray(options.proxies) && options.proxies.length >= 2)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxiesLength, options); + } + options.proxies.forEach((proxy) => { + if (!isValidSocksProxy(proxy)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options); + } + validateCustomProxyAuth(proxy, options); + }); + if (options.timeout && !isValidTimeoutValue(options.timeout)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options); + } + } + exports2.validateSocksClientChainOptions = validateSocksClientChainOptions; + function validateCustomProxyAuth(proxy, options) { + if (proxy.custom_auth_method !== void 0) { + if (proxy.custom_auth_method < constants_1.SOCKS5_CUSTOM_AUTH_START || proxy.custom_auth_method > constants_1.SOCKS5_CUSTOM_AUTH_END) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthRange, options); + } + if (proxy.custom_auth_request_handler === void 0 || typeof proxy.custom_auth_request_handler !== "function") { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); + } + if (proxy.custom_auth_response_size === void 0) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); + } + if (proxy.custom_auth_response_handler === void 0 || typeof proxy.custom_auth_response_handler !== "function") { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); + } + } + } + function isValidSocksRemoteHost(remoteHost) { + return remoteHost && typeof remoteHost.host === "string" && Buffer.byteLength(remoteHost.host) < 256 && typeof remoteHost.port === "number" && remoteHost.port >= 0 && remoteHost.port <= 65535; + } + function isValidSocksProxy(proxy) { + return proxy && (typeof proxy.host === "string" || typeof proxy.ipaddress === "string") && typeof proxy.port === "number" && proxy.port >= 0 && proxy.port <= 65535 && (proxy.type === 4 || proxy.type === 5); + } + function isValidTimeoutValue(value) { + return typeof value === "number" && value > 0; + } + function ipv4ToInt32(ip) { + const address = new ip_address_1.Address4(ip); + return address.toArray().reduce((acc, part) => (acc << 8) + part, 0) >>> 0; + } + exports2.ipv4ToInt32 = ipv4ToInt32; + function int32ToIpv4(int32) { + const octet1 = int32 >>> 24 & 255; + const octet2 = int32 >>> 16 & 255; + const octet3 = int32 >>> 8 & 255; + const octet4 = int32 & 255; + return [octet1, octet2, octet3, octet4].join("."); + } + exports2.int32ToIpv4 = int32ToIpv4; + function ipToBuffer(ip) { + if (net.isIPv4(ip)) { + const address = new ip_address_1.Address4(ip); + return Buffer.from(address.toArray()); + } else if (net.isIPv6(ip)) { + const address = new ip_address_1.Address6(ip); + return Buffer.from(address.canonicalForm().split(":").map((segment) => segment.padStart(4, "0")).join(""), "hex"); + } else { + throw new Error("Invalid IP address format"); + } + } + exports2.ipToBuffer = ipToBuffer; + } +}); + +// node_modules/socks/build/common/receivebuffer.js +var require_receivebuffer = __commonJS({ + "node_modules/socks/build/common/receivebuffer.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ReceiveBuffer = void 0; + var ReceiveBuffer = class { + constructor(size = 4096) { + this.buffer = Buffer.allocUnsafe(size); + this.offset = 0; + this.originalSize = size; + } + get length() { + return this.offset; + } + append(data2) { + if (!Buffer.isBuffer(data2)) { + throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer."); + } + if (this.offset + data2.length >= this.buffer.length) { + const tmp = this.buffer; + this.buffer = Buffer.allocUnsafe(Math.max(this.buffer.length + this.originalSize, this.buffer.length + data2.length)); + tmp.copy(this.buffer); + } + data2.copy(this.buffer, this.offset); + return this.offset += data2.length; + } + peek(length) { + if (length > this.offset) { + throw new Error("Attempted to read beyond the bounds of the managed internal data."); + } + return this.buffer.slice(0, length); + } + get(length) { + if (length > this.offset) { + throw new Error("Attempted to read beyond the bounds of the managed internal data."); + } + const value = Buffer.allocUnsafe(length); + this.buffer.slice(0, length).copy(value); + this.buffer.copyWithin(0, length, length + this.offset - length); + this.offset -= length; + return value; + } + }; + exports2.ReceiveBuffer = ReceiveBuffer; + } +}); + +// node_modules/socks/build/client/socksclient.js +var require_socksclient = __commonJS({ + "node_modules/socks/build/client/socksclient.js"(exports2) { + "use strict"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e4) { + reject(e4); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e4) { + reject(e4); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SocksClientError = exports2.SocksClient = void 0; + var events_1 = require("events"); + var net = require("net"); + var smart_buffer_1 = require_smartbuffer(); + var constants_1 = require_constants3(); + var helpers_1 = require_helpers2(); + var receivebuffer_1 = require_receivebuffer(); + var util_1 = require_util(); + Object.defineProperty(exports2, "SocksClientError", { enumerable: true, get: function() { + return util_1.SocksClientError; + } }); + var ip_address_1 = require_ip_address(); + var SocksClient = class _SocksClient extends events_1.EventEmitter { + constructor(options) { + super(); + this.options = Object.assign({}, options); + (0, helpers_1.validateSocksClientOptions)(options); + this.setState(constants_1.SocksClientState.Created); + } + /** + * Creates a new SOCKS connection. + * + * Note: Supports callbacks and promises. Only supports the connect command. + * @param options { SocksClientOptions } Options. + * @param callback { Function } An optional callback function. + * @returns { Promise } + */ + static createConnection(options, callback) { + return new Promise((resolve, reject) => { + try { + (0, helpers_1.validateSocksClientOptions)(options, ["connect"]); + } catch (err) { + if (typeof callback === "function") { + callback(err); + return resolve(err); + } else { + return reject(err); + } + } + const client = new _SocksClient(options); + client.connect(options.existing_socket); + client.once("established", (info) => { + client.removeAllListeners(); + if (typeof callback === "function") { + callback(null, info); + resolve(info); + } else { + resolve(info); + } + }); + client.once("error", (err) => { + client.removeAllListeners(); + if (typeof callback === "function") { + callback(err); + resolve(err); + } else { + reject(err); + } + }); + }); + } + /** + * Creates a new SOCKS connection chain to a destination host through 2 or more SOCKS proxies. + * + * Note: Supports callbacks and promises. Only supports the connect method. + * Note: Implemented via createConnection() factory function. + * @param options { SocksClientChainOptions } Options + * @param callback { Function } An optional callback function. + * @returns { Promise } + */ + static createConnectionChain(options, callback) { + return new Promise((resolve, reject) => __awaiter2(this, void 0, void 0, function* () { + try { + (0, helpers_1.validateSocksClientChainOptions)(options); + } catch (err) { + if (typeof callback === "function") { + callback(err); + return resolve(err); + } else { + return reject(err); + } + } + if (options.randomizeChain) { + (0, util_1.shuffleArray)(options.proxies); + } + try { + let sock; + for (let i4 = 0; i4 < options.proxies.length; i4++) { + const nextProxy = options.proxies[i4]; + const nextDestination = i4 === options.proxies.length - 1 ? options.destination : { + host: options.proxies[i4 + 1].host || options.proxies[i4 + 1].ipaddress, + port: options.proxies[i4 + 1].port + }; + const result = yield _SocksClient.createConnection({ + command: "connect", + proxy: nextProxy, + destination: nextDestination, + existing_socket: sock + }); + sock = sock || result.socket; + } + if (typeof callback === "function") { + callback(null, { socket: sock }); + resolve({ socket: sock }); + } else { + resolve({ socket: sock }); + } + } catch (err) { + if (typeof callback === "function") { + callback(err); + resolve(err); + } else { + reject(err); + } + } + })); + } + /** + * Creates a SOCKS UDP Frame. + * @param options + */ + static createUDPFrame(options) { + const buff = new smart_buffer_1.SmartBuffer(); + buff.writeUInt16BE(0); + buff.writeUInt8(options.frameNumber || 0); + if (net.isIPv4(options.remoteHost.host)) { + buff.writeUInt8(constants_1.Socks5HostType.IPv4); + buff.writeUInt32BE((0, helpers_1.ipv4ToInt32)(options.remoteHost.host)); + } else if (net.isIPv6(options.remoteHost.host)) { + buff.writeUInt8(constants_1.Socks5HostType.IPv6); + buff.writeBuffer((0, helpers_1.ipToBuffer)(options.remoteHost.host)); + } else { + buff.writeUInt8(constants_1.Socks5HostType.Hostname); + buff.writeUInt8(Buffer.byteLength(options.remoteHost.host)); + buff.writeString(options.remoteHost.host); + } + buff.writeUInt16BE(options.remoteHost.port); + buff.writeBuffer(options.data); + return buff.toBuffer(); + } + /** + * Parses a SOCKS UDP frame. + * @param data + */ + static parseUDPFrame(data2) { + const buff = smart_buffer_1.SmartBuffer.fromBuffer(data2); + buff.readOffset = 2; + const frameNumber = buff.readUInt8(); + const hostType = buff.readUInt8(); + let remoteHost; + if (hostType === constants_1.Socks5HostType.IPv4) { + remoteHost = (0, helpers_1.int32ToIpv4)(buff.readUInt32BE()); + } else if (hostType === constants_1.Socks5HostType.IPv6) { + remoteHost = ip_address_1.Address6.fromByteArray(Array.from(buff.readBuffer(16))).canonicalForm(); + } else { + remoteHost = buff.readString(buff.readUInt8()); + } + const remotePort = buff.readUInt16BE(); + return { + frameNumber, + remoteHost: { + host: remoteHost, + port: remotePort + }, + data: buff.readBuffer() + }; + } + /** + * Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state. + */ + setState(newState) { + if (this.state !== constants_1.SocksClientState.Error) { + this.state = newState; + } + } + /** + * Starts the connection establishment to the proxy and destination. + * @param existingSocket Connected socket to use instead of creating a new one (internal use). + */ + connect(existingSocket) { + this.onDataReceived = (data2) => this.onDataReceivedHandler(data2); + this.onClose = () => this.onCloseHandler(); + this.onError = (err) => this.onErrorHandler(err); + this.onConnect = () => this.onConnectHandler(); + const timer = setTimeout(() => this.onEstablishedTimeout(), this.options.timeout || constants_1.DEFAULT_TIMEOUT); + if (timer.unref && typeof timer.unref === "function") { + timer.unref(); + } + if (existingSocket) { + this.socket = existingSocket; + } else { + this.socket = new net.Socket(); + } + this.socket.once("close", this.onClose); + this.socket.once("error", this.onError); + this.socket.once("connect", this.onConnect); + this.socket.on("data", this.onDataReceived); + this.setState(constants_1.SocksClientState.Connecting); + this.receiveBuffer = new receivebuffer_1.ReceiveBuffer(); + if (existingSocket) { + this.socket.emit("connect"); + } else { + this.socket.connect(this.getSocketOptions()); + if (this.options.set_tcp_nodelay !== void 0 && this.options.set_tcp_nodelay !== null) { + this.socket.setNoDelay(!!this.options.set_tcp_nodelay); + } + } + this.prependOnceListener("established", (info) => { + setImmediate(() => { + if (this.receiveBuffer.length > 0) { + const excessData = this.receiveBuffer.get(this.receiveBuffer.length); + info.socket.emit("data", excessData); + } + info.socket.resume(); + }); + }); + } + // Socket options (defaults host/port to options.proxy.host/options.proxy.port) + getSocketOptions() { + return Object.assign(Object.assign({}, this.options.socket_options), { host: this.options.proxy.host || this.options.proxy.ipaddress, port: this.options.proxy.port }); + } + /** + * Handles internal Socks timeout callback. + * Note: If the Socks client is not BoundWaitingForConnection or Established, the connection will be closed. + */ + onEstablishedTimeout() { + if (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.BoundWaitingForConnection) { + this.closeSocket(constants_1.ERRORS.ProxyConnectionTimedOut); + } + } + /** + * Handles Socket connect event. + */ + onConnectHandler() { + this.setState(constants_1.SocksClientState.Connected); + if (this.options.proxy.type === 4) { + this.sendSocks4InitialHandshake(); + } else { + this.sendSocks5InitialHandshake(); + } + this.setState(constants_1.SocksClientState.SentInitialHandshake); + } + /** + * Handles Socket data event. + * @param data + */ + onDataReceivedHandler(data2) { + this.receiveBuffer.append(data2); + this.processData(); + } + /** + * Handles processing of the data we have received. + */ + processData() { + while (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.Error && this.receiveBuffer.length >= this.nextRequiredPacketBufferSize) { + if (this.state === constants_1.SocksClientState.SentInitialHandshake) { + if (this.options.proxy.type === 4) { + this.handleSocks4FinalHandshakeResponse(); + } else { + this.handleInitialSocks5HandshakeResponse(); + } + } else if (this.state === constants_1.SocksClientState.SentAuthentication) { + this.handleInitialSocks5AuthenticationHandshakeResponse(); + } else if (this.state === constants_1.SocksClientState.SentFinalHandshake) { + this.handleSocks5FinalHandshakeResponse(); + } else if (this.state === constants_1.SocksClientState.BoundWaitingForConnection) { + if (this.options.proxy.type === 4) { + this.handleSocks4IncomingConnectionResponse(); + } else { + this.handleSocks5IncomingConnectionResponse(); + } + } else { + this.closeSocket(constants_1.ERRORS.InternalError); + break; + } + } + } + /** + * Handles Socket close event. + * @param had_error + */ + onCloseHandler() { + this.closeSocket(constants_1.ERRORS.SocketClosed); + } + /** + * Handles Socket error event. + * @param err + */ + onErrorHandler(err) { + this.closeSocket(err.message); + } + /** + * Removes internal event listeners on the underlying Socket. + */ + removeInternalSocketHandlers() { + this.socket.pause(); + this.socket.removeListener("data", this.onDataReceived); + this.socket.removeListener("close", this.onClose); + this.socket.removeListener("error", this.onError); + this.socket.removeListener("connect", this.onConnect); + } + /** + * Closes and destroys the underlying Socket. Emits an error event. + * @param err { String } An error string to include in error event. + */ + closeSocket(err) { + if (this.state !== constants_1.SocksClientState.Error) { + this.setState(constants_1.SocksClientState.Error); + this.socket.destroy(); + this.removeInternalSocketHandlers(); + this.emit("error", new util_1.SocksClientError(err, this.options)); + } + } + /** + * Sends initial Socks v4 handshake request. + */ + sendSocks4InitialHandshake() { + const userId = this.options.proxy.userId || ""; + const buff = new smart_buffer_1.SmartBuffer(); + buff.writeUInt8(4); + buff.writeUInt8(constants_1.SocksCommand[this.options.command]); + buff.writeUInt16BE(this.options.destination.port); + if (net.isIPv4(this.options.destination.host)) { + buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host)); + buff.writeStringNT(userId); + } else { + buff.writeUInt8(0); + buff.writeUInt8(0); + buff.writeUInt8(0); + buff.writeUInt8(1); + buff.writeStringNT(userId); + buff.writeStringNT(this.options.destination.host); + } + this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks4Response; + this.socket.write(buff.toBuffer()); + } + /** + * Handles Socks v4 handshake response. + * @param data + */ + handleSocks4FinalHandshakeResponse() { + const data2 = this.receiveBuffer.get(8); + if (data2[1] !== constants_1.Socks4Response.Granted) { + this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedConnection} - (${constants_1.Socks4Response[data2[1]]})`); + } else { + if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) { + const buff = smart_buffer_1.SmartBuffer.fromBuffer(data2); + buff.readOffset = 2; + const remoteHost = { + port: buff.readUInt16BE(), + host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE()) + }; + if (remoteHost.host === "0.0.0.0") { + remoteHost.host = this.options.proxy.ipaddress; + } + this.setState(constants_1.SocksClientState.BoundWaitingForConnection); + this.emit("bound", { remoteHost, socket: this.socket }); + } else { + this.setState(constants_1.SocksClientState.Established); + this.removeInternalSocketHandlers(); + this.emit("established", { socket: this.socket }); + } + } + } + /** + * Handles Socks v4 incoming connection request (BIND) + * @param data + */ + handleSocks4IncomingConnectionResponse() { + const data2 = this.receiveBuffer.get(8); + if (data2[1] !== constants_1.Socks4Response.Granted) { + this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${constants_1.Socks4Response[data2[1]]})`); + } else { + const buff = smart_buffer_1.SmartBuffer.fromBuffer(data2); + buff.readOffset = 2; + const remoteHost = { + port: buff.readUInt16BE(), + host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE()) + }; + this.setState(constants_1.SocksClientState.Established); + this.removeInternalSocketHandlers(); + this.emit("established", { remoteHost, socket: this.socket }); + } + } + /** + * Sends initial Socks v5 handshake request. + */ + sendSocks5InitialHandshake() { + const buff = new smart_buffer_1.SmartBuffer(); + const supportedAuthMethods = [constants_1.Socks5Auth.NoAuth]; + if (this.options.proxy.userId || this.options.proxy.password) { + supportedAuthMethods.push(constants_1.Socks5Auth.UserPass); + } + if (this.options.proxy.custom_auth_method !== void 0) { + supportedAuthMethods.push(this.options.proxy.custom_auth_method); + } + buff.writeUInt8(5); + buff.writeUInt8(supportedAuthMethods.length); + for (const authMethod of supportedAuthMethods) { + buff.writeUInt8(authMethod); + } + this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse; + this.socket.write(buff.toBuffer()); + this.setState(constants_1.SocksClientState.SentInitialHandshake); + } + /** + * Handles initial Socks v5 handshake response. + * @param data + */ + handleInitialSocks5HandshakeResponse() { + const data2 = this.receiveBuffer.get(2); + if (data2[0] !== 5) { + this.closeSocket(constants_1.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion); + } else if (data2[1] === constants_1.SOCKS5_NO_ACCEPTABLE_AUTH) { + this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType); + } else { + if (data2[1] === constants_1.Socks5Auth.NoAuth) { + this.socks5ChosenAuthType = constants_1.Socks5Auth.NoAuth; + this.sendSocks5CommandRequest(); + } else if (data2[1] === constants_1.Socks5Auth.UserPass) { + this.socks5ChosenAuthType = constants_1.Socks5Auth.UserPass; + this.sendSocks5UserPassAuthentication(); + } else if (data2[1] === this.options.proxy.custom_auth_method) { + this.socks5ChosenAuthType = this.options.proxy.custom_auth_method; + this.sendSocks5CustomAuthentication(); + } else { + this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType); + } + } + } + /** + * Sends Socks v5 user & password auth handshake. + * + * Note: No auth and user/pass are currently supported. + */ + sendSocks5UserPassAuthentication() { + const userId = this.options.proxy.userId || ""; + const password = this.options.proxy.password || ""; + const buff = new smart_buffer_1.SmartBuffer(); + buff.writeUInt8(1); + buff.writeUInt8(Buffer.byteLength(userId)); + buff.writeString(userId); + buff.writeUInt8(Buffer.byteLength(password)); + buff.writeString(password); + this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse; + this.socket.write(buff.toBuffer()); + this.setState(constants_1.SocksClientState.SentAuthentication); + } + sendSocks5CustomAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + this.nextRequiredPacketBufferSize = this.options.proxy.custom_auth_response_size; + this.socket.write(yield this.options.proxy.custom_auth_request_handler()); + this.setState(constants_1.SocksClientState.SentAuthentication); + }); + } + handleSocks5CustomAuthHandshakeResponse(data2) { + return __awaiter2(this, void 0, void 0, function* () { + return yield this.options.proxy.custom_auth_response_handler(data2); + }); + } + handleSocks5AuthenticationNoAuthHandshakeResponse(data2) { + return __awaiter2(this, void 0, void 0, function* () { + return data2[1] === 0; + }); + } + handleSocks5AuthenticationUserPassHandshakeResponse(data2) { + return __awaiter2(this, void 0, void 0, function* () { + return data2[1] === 0; + }); + } + /** + * Handles Socks v5 auth handshake response. + * @param data + */ + handleInitialSocks5AuthenticationHandshakeResponse() { + return __awaiter2(this, void 0, void 0, function* () { + this.setState(constants_1.SocksClientState.ReceivedAuthenticationResponse); + let authResult = false; + if (this.socks5ChosenAuthType === constants_1.Socks5Auth.NoAuth) { + authResult = yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)); + } else if (this.socks5ChosenAuthType === constants_1.Socks5Auth.UserPass) { + authResult = yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)); + } else if (this.socks5ChosenAuthType === this.options.proxy.custom_auth_method) { + authResult = yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size)); + } + if (!authResult) { + this.closeSocket(constants_1.ERRORS.Socks5AuthenticationFailed); + } else { + this.sendSocks5CommandRequest(); + } + }); + } + /** + * Sends Socks v5 final handshake request. + */ + sendSocks5CommandRequest() { + const buff = new smart_buffer_1.SmartBuffer(); + buff.writeUInt8(5); + buff.writeUInt8(constants_1.SocksCommand[this.options.command]); + buff.writeUInt8(0); + if (net.isIPv4(this.options.destination.host)) { + buff.writeUInt8(constants_1.Socks5HostType.IPv4); + buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host)); + } else if (net.isIPv6(this.options.destination.host)) { + buff.writeUInt8(constants_1.Socks5HostType.IPv6); + buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host)); + } else { + buff.writeUInt8(constants_1.Socks5HostType.Hostname); + buff.writeUInt8(this.options.destination.host.length); + buff.writeString(this.options.destination.host); + } + buff.writeUInt16BE(this.options.destination.port); + this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader; + this.socket.write(buff.toBuffer()); + this.setState(constants_1.SocksClientState.SentFinalHandshake); + } + /** + * Handles Socks v5 final handshake response. + * @param data + */ + handleSocks5FinalHandshakeResponse() { + const header = this.receiveBuffer.peek(5); + if (header[0] !== 5 || header[1] !== constants_1.Socks5Response.Granted) { + this.closeSocket(`${constants_1.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${constants_1.Socks5Response[header[1]]}`); + } else { + const addressType = header[3]; + let remoteHost; + let buff; + if (addressType === constants_1.Socks5HostType.IPv4) { + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4; + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); + remoteHost = { + host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE()), + port: buff.readUInt16BE() + }; + if (remoteHost.host === "0.0.0.0") { + remoteHost.host = this.options.proxy.ipaddress; + } + } else if (addressType === constants_1.Socks5HostType.Hostname) { + const hostLength = header[4]; + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength); + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5)); + remoteHost = { + host: buff.readString(hostLength), + port: buff.readUInt16BE() + }; + } else if (addressType === constants_1.Socks5HostType.IPv6) { + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); + remoteHost = { + host: ip_address_1.Address6.fromByteArray(Array.from(buff.readBuffer(16))).canonicalForm(), + port: buff.readUInt16BE() + }; + } + this.setState(constants_1.SocksClientState.ReceivedFinalResponse); + if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.connect) { + this.setState(constants_1.SocksClientState.Established); + this.removeInternalSocketHandlers(); + this.emit("established", { remoteHost, socket: this.socket }); + } else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) { + this.setState(constants_1.SocksClientState.BoundWaitingForConnection); + this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader; + this.emit("bound", { remoteHost, socket: this.socket }); + } else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.associate) { + this.setState(constants_1.SocksClientState.Established); + this.removeInternalSocketHandlers(); + this.emit("established", { + remoteHost, + socket: this.socket + }); + } + } + } + /** + * Handles Socks v5 incoming connection request (BIND). + */ + handleSocks5IncomingConnectionResponse() { + const header = this.receiveBuffer.peek(5); + if (header[0] !== 5 || header[1] !== constants_1.Socks5Response.Granted) { + this.closeSocket(`${constants_1.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${constants_1.Socks5Response[header[1]]}`); + } else { + const addressType = header[3]; + let remoteHost; + let buff; + if (addressType === constants_1.Socks5HostType.IPv4) { + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4; + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); + remoteHost = { + host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE()), + port: buff.readUInt16BE() + }; + if (remoteHost.host === "0.0.0.0") { + remoteHost.host = this.options.proxy.ipaddress; + } + } else if (addressType === constants_1.Socks5HostType.Hostname) { + const hostLength = header[4]; + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength); + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5)); + remoteHost = { + host: buff.readString(hostLength), + port: buff.readUInt16BE() + }; + } else if (addressType === constants_1.Socks5HostType.IPv6) { + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); + remoteHost = { + host: ip_address_1.Address6.fromByteArray(Array.from(buff.readBuffer(16))).canonicalForm(), + port: buff.readUInt16BE() + }; + } + this.setState(constants_1.SocksClientState.Established); + this.removeInternalSocketHandlers(); + this.emit("established", { remoteHost, socket: this.socket }); + } + } + get socksClientOptions() { + return Object.assign({}, this.options); + } + }; + exports2.SocksClient = SocksClient; + } +}); + +// node_modules/socks/build/index.js +var require_build = __commonJS({ + "node_modules/socks/build/index.js"(exports2) { + "use strict"; + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + var desc = Object.getOwnPropertyDescriptor(m4, k4); + if (!desc || ("get" in desc ? !m4.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m4[k4]; + } }; + } + Object.defineProperty(o4, k22, desc); + }) : (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + o4[k22] = m4[k4]; + })); + var __exportStar2 = exports2 && exports2.__exportStar || function(m4, exports3) { + for (var p4 in m4) if (p4 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p4)) __createBinding2(exports3, m4, p4); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + __exportStar2(require_socksclient(), exports2); + } +}); + +// node_modules/mongodb/lib/deps.js +var require_deps = __commonJS({ + "node_modules/mongodb/lib/deps.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.aws4 = void 0; + exports2.getKerberos = getKerberos; + exports2.getZstdLibrary = getZstdLibrary; + exports2.getAwsCredentialProvider = getAwsCredentialProvider; + exports2.getGcpMetadata = getGcpMetadata; + exports2.getSnappy = getSnappy; + exports2.getSocks = getSocks; + exports2.getMongoDBClientEncryption = getMongoDBClientEncryption; + var error_1 = require_error(); + function makeErrorModule(error2) { + const props = error2 ? { kModuleError: error2 } : {}; + return new Proxy(props, { + get: (_, key) => { + if (key === "kModuleError") { + return error2; + } + throw error2; + }, + set: () => { + throw error2; + } + }); + } + function getKerberos() { + let kerberos; + try { + kerberos = require("kerberos"); + } catch (error2) { + kerberos = makeErrorModule(new error_1.MongoMissingDependencyError("Optional module `kerberos` not found. Please install it to enable kerberos authentication", { cause: error2, dependencyName: "kerberos" })); + } + return kerberos; + } + function getZstdLibrary() { + let ZStandard; + try { + ZStandard = require("@mongodb-js/zstd"); + } catch (error2) { + ZStandard = makeErrorModule(new error_1.MongoMissingDependencyError("Optional module `@mongodb-js/zstd` not found. Please install it to enable zstd compression", { cause: error2, dependencyName: "zstd" })); + } + return ZStandard; + } + function getAwsCredentialProvider() { + try { + const credentialProvider = require("@aws-sdk/credential-providers"); + return credentialProvider; + } catch (error2) { + return makeErrorModule(new error_1.MongoMissingDependencyError("Optional module `@aws-sdk/credential-providers` not found. Please install it to enable getting aws credentials via the official sdk.", { cause: error2, dependencyName: "@aws-sdk/credential-providers" })); + } + } + function getGcpMetadata() { + try { + const credentialProvider = require("gcp-metadata"); + return credentialProvider; + } catch (error2) { + return makeErrorModule(new error_1.MongoMissingDependencyError("Optional module `gcp-metadata` not found. Please install it to enable getting gcp credentials via the official sdk.", { cause: error2, dependencyName: "gcp-metadata" })); + } + } + function getSnappy() { + try { + const value = require("snappy"); + return value; + } catch (error2) { + const kModuleError = new error_1.MongoMissingDependencyError("Optional module `snappy` not found. Please install it to enable snappy compression", { cause: error2, dependencyName: "snappy" }); + return { kModuleError }; + } + } + function getSocks() { + try { + const value = require_build(); + return value; + } catch (error2) { + const kModuleError = new error_1.MongoMissingDependencyError("Optional module `socks` not found. Please install it to connections over a SOCKS5 proxy", { cause: error2, dependencyName: "socks" }); + return { kModuleError }; + } + } + exports2.aws4 = loadAws4(); + function loadAws4() { + let aws4; + try { + aws4 = require("aws4"); + } catch (error2) { + aws4 = makeErrorModule(new error_1.MongoMissingDependencyError("Optional module `aws4` not found. Please install it to enable AWS authentication", { cause: error2, dependencyName: "aws4" })); + } + return aws4; + } + function getMongoDBClientEncryption() { + let mongodbClientEncryption = null; + try { + mongodbClientEncryption = require("mongodb-client-encryption"); + } catch (error2) { + const kModuleError = new error_1.MongoMissingDependencyError("Optional module `mongodb-client-encryption` not found. Please install it to use auto encryption or ClientEncryption.", { cause: error2, dependencyName: "mongodb-client-encryption" }); + return { kModuleError }; + } + return mongodbClientEncryption; + } + } +}); + +// node_modules/mongodb/lib/cmap/auth/auth_provider.js +var require_auth_provider = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/auth_provider.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AuthProvider = exports2.AuthContext = void 0; + var error_1 = require_error(); + var AuthContext = class { + constructor(connection, credentials, options) { + this.reauthenticating = false; + this.connection = connection; + this.credentials = credentials; + this.options = options; + } + }; + exports2.AuthContext = AuthContext; + var AuthProvider = class { + /** + * Prepare the handshake document before the initial handshake. + * + * @param handshakeDoc - The document used for the initial handshake on a connection + * @param authContext - Context for authentication flow + */ + async prepare(handshakeDoc, _authContext) { + return handshakeDoc; + } + /** + * Reauthenticate. + * @param context - The shared auth context. + */ + async reauth(context) { + if (context.reauthenticating) { + throw new error_1.MongoRuntimeError("Reauthentication already in progress."); + } + try { + context.reauthenticating = true; + await this.auth(context); + } finally { + context.reauthenticating = false; + } + } + }; + exports2.AuthProvider = AuthProvider; + } +}); + +// node_modules/mongodb/lib/cmap/auth/gssapi.js +var require_gssapi = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/gssapi.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.GSSAPI = exports2.GSSAPICanonicalizationValue = void 0; + exports2.performGSSAPICanonicalizeHostName = performGSSAPICanonicalizeHostName; + exports2.resolveCname = resolveCname; + var dns = require("dns"); + var deps_1 = require_deps(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var auth_provider_1 = require_auth_provider(); + exports2.GSSAPICanonicalizationValue = Object.freeze({ + on: true, + off: false, + none: "none", + forward: "forward", + forwardAndReverse: "forwardAndReverse" + }); + async function externalCommand(connection, command) { + const response = await connection.command((0, utils_1.ns)("$external.$cmd"), command); + return response; + } + var krb; + var GSSAPI = class extends auth_provider_1.AuthProvider { + async auth(authContext) { + const { connection, credentials } = authContext; + if (credentials == null) { + throw new error_1.MongoMissingCredentialsError("Credentials required for GSSAPI authentication"); + } + const { username } = credentials; + const client = await makeKerberosClient(authContext); + const payload2 = await client.step(""); + const saslStartResponse = await externalCommand(connection, saslStart(payload2)); + const negotiatedPayload = await negotiate(client, 10, saslStartResponse.payload); + const saslContinueResponse = await externalCommand(connection, saslContinue(negotiatedPayload, saslStartResponse.conversationId)); + const finalizePayload = await finalize(client, username, saslContinueResponse.payload); + await externalCommand(connection, { + saslContinue: 1, + conversationId: saslContinueResponse.conversationId, + payload: finalizePayload + }); + } + }; + exports2.GSSAPI = GSSAPI; + async function makeKerberosClient(authContext) { + const { hostAddress } = authContext.options; + const { credentials } = authContext; + if (!hostAddress || typeof hostAddress.host !== "string" || !credentials) { + throw new error_1.MongoInvalidArgumentError("Connection must have host and port and credentials defined."); + } + loadKrb(); + if ("kModuleError" in krb) { + throw krb["kModuleError"]; + } + const { initializeClient } = krb; + const { username, password } = credentials; + const mechanismProperties = credentials.mechanismProperties; + const serviceName = mechanismProperties.SERVICE_NAME ?? "mongodb"; + const host = await performGSSAPICanonicalizeHostName(hostAddress.host, mechanismProperties); + const initOptions = {}; + if (password != null) { + Object.assign(initOptions, { user: username, password }); + } + const spnHost = mechanismProperties.SERVICE_HOST ?? host; + let spn = `${serviceName}${process.platform === "win32" ? "/" : "@"}${spnHost}`; + if ("SERVICE_REALM" in mechanismProperties) { + spn = `${spn}@${mechanismProperties.SERVICE_REALM}`; + } + return await initializeClient(spn, initOptions); + } + function saslStart(payload2) { + return { + saslStart: 1, + mechanism: "GSSAPI", + payload: payload2, + autoAuthorize: 1 + }; + } + function saslContinue(payload2, conversationId) { + return { + saslContinue: 1, + conversationId, + payload: payload2 + }; + } + async function negotiate(client, retries, payload2) { + try { + const response = await client.step(payload2); + return response || ""; + } catch (error2) { + if (retries === 0) { + throw error2; + } + return await negotiate(client, retries - 1, payload2); + } + } + async function finalize(client, user, payload2) { + const response = await client.unwrap(payload2); + return await client.wrap(response || "", { user }); + } + async function performGSSAPICanonicalizeHostName(host, mechanismProperties) { + const mode = mechanismProperties.CANONICALIZE_HOST_NAME; + if (!mode || mode === exports2.GSSAPICanonicalizationValue.none) { + return host; + } + if (mode === exports2.GSSAPICanonicalizationValue.on || mode === exports2.GSSAPICanonicalizationValue.forwardAndReverse) { + const { address } = await dns.promises.lookup(host); + try { + const results = await dns.promises.resolvePtr(address); + return results.length > 0 ? results[0] : host; + } catch { + return await resolveCname(host); + } + } else { + return await resolveCname(host); + } + } + async function resolveCname(host) { + try { + const results = await dns.promises.resolveCname(host); + return results.length > 0 ? results[0] : host; + } catch { + return host; + } + } + function loadKrb() { + if (!krb) { + krb = (0, deps_1.getKerberos)(); + } + } + } +}); + +// node_modules/mongodb/lib/cmap/auth/providers.js +var require_providers = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/providers.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AUTH_MECHS_AUTH_SRC_EXTERNAL = exports2.AuthMechanism = void 0; + exports2.AuthMechanism = Object.freeze({ + MONGODB_AWS: "MONGODB-AWS", + MONGODB_CR: "MONGODB-CR", + MONGODB_DEFAULT: "DEFAULT", + MONGODB_GSSAPI: "GSSAPI", + MONGODB_PLAIN: "PLAIN", + MONGODB_SCRAM_SHA1: "SCRAM-SHA-1", + MONGODB_SCRAM_SHA256: "SCRAM-SHA-256", + MONGODB_X509: "MONGODB-X509", + MONGODB_OIDC: "MONGODB-OIDC" + }); + exports2.AUTH_MECHS_AUTH_SRC_EXTERNAL = /* @__PURE__ */ new Set([ + exports2.AuthMechanism.MONGODB_GSSAPI, + exports2.AuthMechanism.MONGODB_AWS, + exports2.AuthMechanism.MONGODB_OIDC, + exports2.AuthMechanism.MONGODB_X509 + ]); + } +}); + +// node_modules/mongodb/lib/cmap/auth/mongo_credentials.js +var require_mongo_credentials = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/mongo_credentials.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MongoCredentials = exports2.DEFAULT_ALLOWED_HOSTS = void 0; + var error_1 = require_error(); + var gssapi_1 = require_gssapi(); + var providers_1 = require_providers(); + function getDefaultAuthMechanism(hello) { + if (hello) { + if (Array.isArray(hello.saslSupportedMechs)) { + return hello.saslSupportedMechs.includes(providers_1.AuthMechanism.MONGODB_SCRAM_SHA256) ? providers_1.AuthMechanism.MONGODB_SCRAM_SHA256 : providers_1.AuthMechanism.MONGODB_SCRAM_SHA1; + } + } + return providers_1.AuthMechanism.MONGODB_SCRAM_SHA256; + } + var ALLOWED_ENVIRONMENT_NAMES = [ + "test", + "azure", + "gcp", + "k8s" + ]; + var ALLOWED_HOSTS_ERROR = "Auth mechanism property ALLOWED_HOSTS must be an array of strings."; + exports2.DEFAULT_ALLOWED_HOSTS = [ + "*.mongodb.net", + "*.mongodb-qa.net", + "*.mongodb-dev.net", + "*.mongodbgov.net", + "localhost", + "127.0.0.1", + "::1" + ]; + var TOKEN_RESOURCE_MISSING_ERROR = "TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure or gcp."; + var MongoCredentials = class _MongoCredentials { + constructor(options) { + this.username = options.username ?? ""; + this.password = options.password; + this.source = options.source; + if (!this.source && options.db) { + this.source = options.db; + } + this.mechanism = options.mechanism || providers_1.AuthMechanism.MONGODB_DEFAULT; + this.mechanismProperties = options.mechanismProperties || {}; + if (this.mechanism.match(/MONGODB-AWS/i)) { + if (!this.username && process.env.AWS_ACCESS_KEY_ID) { + this.username = process.env.AWS_ACCESS_KEY_ID; + } + if (!this.password && process.env.AWS_SECRET_ACCESS_KEY) { + this.password = process.env.AWS_SECRET_ACCESS_KEY; + } + if (this.mechanismProperties.AWS_SESSION_TOKEN == null && process.env.AWS_SESSION_TOKEN != null) { + this.mechanismProperties = { + ...this.mechanismProperties, + AWS_SESSION_TOKEN: process.env.AWS_SESSION_TOKEN + }; + } + } + if (this.mechanism === providers_1.AuthMechanism.MONGODB_OIDC && !this.mechanismProperties.ALLOWED_HOSTS) { + this.mechanismProperties = { + ...this.mechanismProperties, + ALLOWED_HOSTS: exports2.DEFAULT_ALLOWED_HOSTS + }; + } + Object.freeze(this.mechanismProperties); + Object.freeze(this); + } + /** Determines if two MongoCredentials objects are equivalent */ + equals(other) { + return this.mechanism === other.mechanism && this.username === other.username && this.password === other.password && this.source === other.source; + } + /** + * If the authentication mechanism is set to "default", resolves the authMechanism + * based on the server version and server supported sasl mechanisms. + * + * @param hello - A hello response from the server + */ + resolveAuthMechanism(hello) { + if (this.mechanism.match(/DEFAULT/i)) { + return new _MongoCredentials({ + username: this.username, + password: this.password, + source: this.source, + mechanism: getDefaultAuthMechanism(hello), + mechanismProperties: this.mechanismProperties + }); + } + return this; + } + validate() { + if ((this.mechanism === providers_1.AuthMechanism.MONGODB_GSSAPI || this.mechanism === providers_1.AuthMechanism.MONGODB_PLAIN || this.mechanism === providers_1.AuthMechanism.MONGODB_SCRAM_SHA1 || this.mechanism === providers_1.AuthMechanism.MONGODB_SCRAM_SHA256) && !this.username) { + throw new error_1.MongoMissingCredentialsError(`Username required for mechanism '${this.mechanism}'`); + } + if (this.mechanism === providers_1.AuthMechanism.MONGODB_OIDC) { + if (this.username && this.mechanismProperties.ENVIRONMENT && this.mechanismProperties.ENVIRONMENT !== "azure") { + throw new error_1.MongoInvalidArgumentError(`username and ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' may not be used together for mechanism '${this.mechanism}'.`); + } + if (this.username && this.password) { + throw new error_1.MongoInvalidArgumentError(`No password is allowed in ENVIRONMENT '${this.mechanismProperties.ENVIRONMENT}' for '${this.mechanism}'.`); + } + if ((this.mechanismProperties.ENVIRONMENT === "azure" || this.mechanismProperties.ENVIRONMENT === "gcp") && !this.mechanismProperties.TOKEN_RESOURCE) { + throw new error_1.MongoInvalidArgumentError(TOKEN_RESOURCE_MISSING_ERROR); + } + if (this.mechanismProperties.ENVIRONMENT && !ALLOWED_ENVIRONMENT_NAMES.includes(this.mechanismProperties.ENVIRONMENT)) { + throw new error_1.MongoInvalidArgumentError(`Currently only a ENVIRONMENT in ${ALLOWED_ENVIRONMENT_NAMES.join(",")} is supported for mechanism '${this.mechanism}'.`); + } + if (!this.mechanismProperties.ENVIRONMENT && !this.mechanismProperties.OIDC_CALLBACK && !this.mechanismProperties.OIDC_HUMAN_CALLBACK) { + throw new error_1.MongoInvalidArgumentError(`Either a ENVIRONMENT, OIDC_CALLBACK, or OIDC_HUMAN_CALLBACK must be specified for mechanism '${this.mechanism}'.`); + } + if (this.mechanismProperties.ALLOWED_HOSTS) { + const hosts = this.mechanismProperties.ALLOWED_HOSTS; + if (!Array.isArray(hosts)) { + throw new error_1.MongoInvalidArgumentError(ALLOWED_HOSTS_ERROR); + } + for (const host of hosts) { + if (typeof host !== "string") { + throw new error_1.MongoInvalidArgumentError(ALLOWED_HOSTS_ERROR); + } + } + } + } + if (providers_1.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(this.mechanism)) { + if (this.source != null && this.source !== "$external") { + throw new error_1.MongoAPIError(`Invalid source '${this.source}' for mechanism '${this.mechanism}' specified.`); + } + } + if (this.mechanism === providers_1.AuthMechanism.MONGODB_PLAIN && this.source == null) { + throw new error_1.MongoAPIError("PLAIN Authentication Mechanism needs an auth source"); + } + if (this.mechanism === providers_1.AuthMechanism.MONGODB_X509 && this.password != null) { + if (this.password === "") { + Reflect.set(this, "password", void 0); + return; + } + throw new error_1.MongoAPIError(`Password not allowed for mechanism MONGODB-X509`); + } + const canonicalization = this.mechanismProperties.CANONICALIZE_HOST_NAME ?? false; + if (!Object.values(gssapi_1.GSSAPICanonicalizationValue).includes(canonicalization)) { + throw new error_1.MongoAPIError(`Invalid CANONICALIZE_HOST_NAME value: ${canonicalization}`); + } + } + static merge(creds, options) { + return new _MongoCredentials({ + username: options.username ?? creds?.username ?? "", + password: options.password ?? creds?.password ?? "", + mechanism: options.mechanism ?? creds?.mechanism ?? providers_1.AuthMechanism.MONGODB_DEFAULT, + mechanismProperties: options.mechanismProperties ?? creds?.mechanismProperties ?? {}, + source: options.source ?? options.db ?? creds?.source ?? "admin" + }); + } + }; + exports2.MongoCredentials = MongoCredentials; + } +}); + +// node_modules/mongodb/package.json +var require_package = __commonJS({ + "node_modules/mongodb/package.json"(exports2, module2) { + module2.exports = { + name: "mongodb", + version: "6.20.0", + description: "The official MongoDB driver for Node.js", + main: "lib/index.js", + files: [ + "lib", + "src", + "etc/prepare.js", + "mongodb.d.ts", + "tsconfig.json" + ], + types: "mongodb.d.ts", + repository: { + type: "git", + url: "git@github.com:mongodb/node-mongodb-native.git" + }, + keywords: [ + "mongodb", + "driver", + "official" + ], + author: { + name: "The MongoDB NodeJS Team", + email: "dbx-node@mongodb.com" + }, + dependencies: { + "@mongodb-js/saslprep": "^1.3.0", + bson: "^6.10.4", + "mongodb-connection-string-url": "^3.0.2" + }, + peerDependencies: { + "@aws-sdk/credential-providers": "^3.188.0", + "@mongodb-js/zstd": "^1.1.0 || ^2.0.0", + "gcp-metadata": "^5.2.0", + kerberos: "^2.0.1", + "mongodb-client-encryption": ">=6.0.0 <7", + snappy: "^7.3.2", + socks: "^2.7.1" + }, + peerDependenciesMeta: { + "@aws-sdk/credential-providers": { + optional: true + }, + "@mongodb-js/zstd": { + optional: true + }, + kerberos: { + optional: true + }, + snappy: { + optional: true + }, + "mongodb-client-encryption": { + optional: true + }, + "gcp-metadata": { + optional: true + }, + socks: { + optional: true + } + }, + devDependencies: { + "@aws-sdk/credential-providers": "^3.876.0", + "@iarna/toml": "^2.2.5", + "@istanbuljs/nyc-config-typescript": "^1.0.2", + "@microsoft/api-extractor": "^7.52.11", + "@microsoft/tsdoc-config": "^0.17.1", + "@mongodb-js/zstd": "^2.0.1", + "@types/chai": "^4.3.17", + "@types/chai-subset": "^1.3.5", + "@types/express": "^5.0.3", + "@types/kerberos": "^1.1.5", + "@types/mocha": "^10.0.9", + "@types/node": "^22.15.3", + "@types/saslprep": "^1.0.3", + "@types/semver": "^7.7.0", + "@types/sinon": "^17.0.4", + "@types/sinon-chai": "^4.0.0", + "@types/whatwg-url": "^13.0.0", + "@typescript-eslint/eslint-plugin": "^8.41.0", + "@typescript-eslint/parser": "^8.31.1", + chai: "^4.4.1", + "chai-subset": "^1.6.0", + chalk: "^4.1.2", + eslint: "^9.34.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-mocha": "^10.4.1", + "eslint-plugin-prettier": "^5.5.4", + "eslint-plugin-simple-import-sort": "^12.1.1", + "eslint-plugin-tsdoc": "^0.4.0", + "eslint-plugin-unused-imports": "^4.2.0", + express: "^5.1.0", + "gcp-metadata": "^5.3.0", + "js-yaml": "^4.1.0", + mocha: "^11.7.1", + "mocha-sinon": "^2.1.2", + "mongodb-client-encryption": "^6.5.0", + "mongodb-legacy": "^6.1.3", + nyc: "^15.1.0", + prettier: "^3.6.2", + semver: "^7.7.2", + sinon: "^18.0.1", + "sinon-chai": "^3.7.0", + snappy: "^7.3.2", + socks: "^2.8.7", + "source-map-support": "^0.5.21", + "ts-node": "^10.9.2", + tsd: "^0.33.0", + typescript: "5.8.3", + "typescript-cached-transpile": "^0.0.6", + "v8-heapsnapshot": "^1.3.1", + yargs: "^18.0.0" + }, + license: "Apache-2.0", + engines: { + node: ">=16.20.1" + }, + bugs: { + url: "https://jira.mongodb.org/projects/NODE/issues/" + }, + homepage: "https://github.com/mongodb/node-mongodb-native", + scripts: { + "build:evergreen": "node .evergreen/generate_evergreen_tasks.js", + "build:ts": "node ./node_modules/typescript/bin/tsc", + "build:dts": "npm run build:ts && api-extractor run && node etc/clean_definition_files.cjs && ESLINT_USE_FLAT_CONFIG=false eslint --no-ignore --fix mongodb.d.ts lib/beta.d.ts", + "build:docs": "./etc/docs/build.ts", + "build:typedoc": "typedoc", + "build:nightly": "node ./.github/scripts/nightly.mjs", + "check:bench": "npm --prefix test/benchmarks/driver_bench start", + "check:coverage": "nyc npm run test:all", + "check:integration-coverage": "nyc npm run check:test", + "check:lambda": "nyc mocha --config test/mocha_lambda.js test/integration/node-specific/examples/handler.test.js", + "check:lambda:aws": "nyc mocha --config test/mocha_lambda.js test/integration/node-specific/examples/aws_handler.test.js", + "check:lint": "npm run build:dts && npm run check:dts && npm run check:eslint && npm run check:tsd", + "check:eslint": "npm run build:dts && ESLINT_USE_FLAT_CONFIG=false eslint -v && ESLINT_USE_FLAT_CONFIG=false eslint --max-warnings=0 --ext '.js,.ts' src test", + "check:tsd": "tsd --version && tsd", + "check:dependencies": "mocha test/action/dependency.test.ts", + "check:dts": "node ./node_modules/typescript/bin/tsc --noEmit mongodb.d.ts && tsd", + "check:search-indexes": "nyc mocha --config test/mocha_mongodb.js test/manual/search-index-management.prose.test.ts", + "check:test": "mocha --config test/mocha_mongodb.js test/integration", + "check:unit": "nyc mocha test/unit", + "check:ts": "node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit", + "check:atlas": "nyc mocha --config test/manual/mocharc.js test/manual/atlas_connectivity.test.ts", + "check:resource-management": "nyc mocha --config test/manual/mocharc.js test/manual/resource_management.test.ts", + "check:drivers-atlas-testing": "nyc mocha --config test/mocha_mongodb.js test/atlas/drivers_atlas_testing.test.ts", + "check:adl": "nyc mocha --config test/mocha_mongodb.js test/manual/atlas-data-lake-testing", + "check:aws": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_aws.test.ts", + "check:oidc-auth": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/auth.spec.test.ts", + "check:oidc-test": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc.prose.test.ts", + "check:oidc-azure": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_azure.prose.05.test.ts", + "check:oidc-gcp": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_gcp.prose.06.test.ts", + "check:oidc-k8s": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts", + "check:kerberos": "nyc mocha --config test/manual/mocharc.js test/manual/kerberos.test.ts", + "check:tls": "nyc mocha --config test/manual/mocharc.js test/manual/tls_support.test.ts", + "check:ldap": "nyc mocha --config test/manual/mocharc.js test/manual/ldap.test.ts", + "check:socks5": "nyc mocha --config test/manual/mocharc.js test/manual/socks5.test.ts", + "check:csfle": "nyc mocha --config test/mocha_mongodb.js test/integration/client-side-encryption", + "check:snappy": "nyc mocha test/unit/assorted/snappy.test.js", + "check:x509": "nyc mocha test/manual/x509_auth.test.ts", + "fix:eslint": "npm run check:eslint -- --fix", + prepare: "node etc/prepare.js", + "preview:docs": "ts-node etc/docs/preview.ts", + test: "npm run check:lint && npm run test:all", + "test:all": "npm run check:unit && npm run check:test", + "update:docs": "npm run build:docs -- --yes" + }, + tsd: { + directory: "test/types", + compilerOptions: { + strict: true, + target: "esnext", + module: "commonjs", + moduleResolution: "node" + } + } + }; + } +}); + +// node_modules/mongodb/lib/cmap/handshake/client_metadata.js +var require_client_metadata = __commonJS({ + "node_modules/mongodb/lib/cmap/handshake/client_metadata.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.LimitedSizeDocument = void 0; + exports2.isDriverInfoEqual = isDriverInfoEqual; + exports2.makeClientMetadata = makeClientMetadata; + exports2.addContainerMetadata = addContainerMetadata; + exports2.getFAASEnv = getFAASEnv; + var os = require("os"); + var process2 = require("process"); + var bson_1 = require_bson2(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var NODE_DRIVER_VERSION = require_package().version; + function isDriverInfoEqual(info1, info2) { + const nonEmptyCmp = (s1, s22) => { + s1 ||= void 0; + s22 ||= void 0; + return s1 === s22; + }; + return nonEmptyCmp(info1.name, info2.name) && nonEmptyCmp(info1.platform, info2.platform) && nonEmptyCmp(info1.version, info2.version); + } + var LimitedSizeDocument = class { + constructor(maxSize) { + this.document = /* @__PURE__ */ new Map(); + this.documentSize = 5; + this.maxSize = maxSize; + } + /** Only adds key/value if the bsonByteLength is less than MAX_SIZE */ + ifItFitsItSits(key, value) { + const newElementSize = bson_1.BSON.serialize((/* @__PURE__ */ new Map()).set(key, value)).byteLength - 5; + if (newElementSize + this.documentSize > this.maxSize) { + return false; + } + this.documentSize += newElementSize; + this.document.set(key, value); + return true; + } + toObject() { + return bson_1.BSON.deserialize(bson_1.BSON.serialize(this.document), { + promoteLongs: false, + promoteBuffers: false, + promoteValues: false, + useBigInt64: false + }); + } + }; + exports2.LimitedSizeDocument = LimitedSizeDocument; + function makeClientMetadata(driverInfoList, { appName = "" }) { + const metadataDocument = new LimitedSizeDocument(512); + if (appName.length > 0) { + const name = Buffer.byteLength(appName, "utf8") <= 128 ? appName : Buffer.from(appName, "utf8").subarray(0, 128).toString("utf8"); + metadataDocument.ifItFitsItSits("application", { name }); + } + const driverInfo = { + name: "nodejs", + version: NODE_DRIVER_VERSION + }; + for (const { name: n4 = "", version: v4 = "" } of driverInfoList) { + if (n4.length > 0) { + driverInfo.name = `${driverInfo.name}|${n4}`; + } + if (v4.length > 0) { + driverInfo.version = `${driverInfo.version}|${v4}`; + } + } + if (!metadataDocument.ifItFitsItSits("driver", driverInfo)) { + throw new error_1.MongoInvalidArgumentError("Unable to include driverInfo name and version, metadata cannot exceed 512 bytes"); + } + let runtimeInfo = getRuntimeInfo(); + for (const { platform = "" } of driverInfoList) { + if (platform.length > 0) { + runtimeInfo = `${runtimeInfo}|${platform}`; + } + } + if (!metadataDocument.ifItFitsItSits("platform", runtimeInfo)) { + throw new error_1.MongoInvalidArgumentError("Unable to include driverInfo platform, metadata cannot exceed 512 bytes"); + } + const osInfo = (/* @__PURE__ */ new Map()).set("name", process2.platform).set("architecture", process2.arch).set("version", os.release()).set("type", os.type()); + if (!metadataDocument.ifItFitsItSits("os", osInfo)) { + for (const key of osInfo.keys()) { + osInfo.delete(key); + if (osInfo.size === 0) + break; + if (metadataDocument.ifItFitsItSits("os", osInfo)) + break; + } + } + const faasEnv = getFAASEnv(); + if (faasEnv != null) { + if (!metadataDocument.ifItFitsItSits("env", faasEnv)) { + for (const key of faasEnv.keys()) { + faasEnv.delete(key); + if (faasEnv.size === 0) + break; + if (metadataDocument.ifItFitsItSits("env", faasEnv)) + break; + } + } + } + return metadataDocument.toObject(); + } + var dockerPromise; + async function getContainerMetadata() { + const containerMetadata = {}; + dockerPromise ??= (0, utils_1.fileIsAccessible)("/.dockerenv"); + const isDocker = await dockerPromise; + const { KUBERNETES_SERVICE_HOST = "" } = process2.env; + const isKubernetes = KUBERNETES_SERVICE_HOST.length > 0 ? true : false; + if (isDocker) + containerMetadata.runtime = "docker"; + if (isKubernetes) + containerMetadata.orchestrator = "kubernetes"; + return containerMetadata; + } + async function addContainerMetadata(originalMetadata) { + const containerMetadata = await getContainerMetadata(); + if (Object.keys(containerMetadata).length === 0) + return originalMetadata; + const extendedMetadata = new LimitedSizeDocument(512); + const extendedEnvMetadata = { ...originalMetadata?.env, container: containerMetadata }; + for (const [key, val] of Object.entries(originalMetadata)) { + if (key !== "env") { + extendedMetadata.ifItFitsItSits(key, val); + } else { + if (!extendedMetadata.ifItFitsItSits("env", extendedEnvMetadata)) { + extendedMetadata.ifItFitsItSits("env", val); + } + } + } + if (!("env" in originalMetadata)) { + extendedMetadata.ifItFitsItSits("env", extendedEnvMetadata); + } + return extendedMetadata.toObject(); + } + function getFAASEnv() { + const { AWS_EXECUTION_ENV = "", AWS_LAMBDA_RUNTIME_API = "", FUNCTIONS_WORKER_RUNTIME = "", K_SERVICE = "", FUNCTION_NAME = "", VERCEL = "", AWS_LAMBDA_FUNCTION_MEMORY_SIZE = "", AWS_REGION = "", FUNCTION_MEMORY_MB = "", FUNCTION_REGION = "", FUNCTION_TIMEOUT_SEC = "", VERCEL_REGION = "" } = process2.env; + const isAWSFaaS = AWS_EXECUTION_ENV.startsWith("AWS_Lambda_") || AWS_LAMBDA_RUNTIME_API.length > 0; + const isAzureFaaS = FUNCTIONS_WORKER_RUNTIME.length > 0; + const isGCPFaaS = K_SERVICE.length > 0 || FUNCTION_NAME.length > 0; + const isVercelFaaS = VERCEL.length > 0; + const faasEnv = /* @__PURE__ */ new Map(); + if (isVercelFaaS && !(isAzureFaaS || isGCPFaaS)) { + if (VERCEL_REGION.length > 0) { + faasEnv.set("region", VERCEL_REGION); + } + faasEnv.set("name", "vercel"); + return faasEnv; + } + if (isAWSFaaS && !(isAzureFaaS || isGCPFaaS || isVercelFaaS)) { + if (AWS_REGION.length > 0) { + faasEnv.set("region", AWS_REGION); + } + if (AWS_LAMBDA_FUNCTION_MEMORY_SIZE.length > 0 && Number.isInteger(+AWS_LAMBDA_FUNCTION_MEMORY_SIZE)) { + faasEnv.set("memory_mb", new bson_1.Int32(AWS_LAMBDA_FUNCTION_MEMORY_SIZE)); + } + faasEnv.set("name", "aws.lambda"); + return faasEnv; + } + if (isAzureFaaS && !(isGCPFaaS || isAWSFaaS || isVercelFaaS)) { + faasEnv.set("name", "azure.func"); + return faasEnv; + } + if (isGCPFaaS && !(isAzureFaaS || isAWSFaaS || isVercelFaaS)) { + if (FUNCTION_REGION.length > 0) { + faasEnv.set("region", FUNCTION_REGION); + } + if (FUNCTION_MEMORY_MB.length > 0 && Number.isInteger(+FUNCTION_MEMORY_MB)) { + faasEnv.set("memory_mb", new bson_1.Int32(FUNCTION_MEMORY_MB)); + } + if (FUNCTION_TIMEOUT_SEC.length > 0 && Number.isInteger(+FUNCTION_TIMEOUT_SEC)) { + faasEnv.set("timeout_sec", new bson_1.Int32(FUNCTION_TIMEOUT_SEC)); + } + faasEnv.set("name", "gcp.func"); + return faasEnv; + } + return null; + } + function getRuntimeInfo() { + if ("Deno" in globalThis) { + const version = typeof Deno?.version?.deno === "string" ? Deno?.version?.deno : "0.0.0-unknown"; + return `Deno v${version}, ${os.endianness()}`; + } + if ("Bun" in globalThis) { + const version = typeof Bun?.version === "string" ? Bun?.version : "0.0.0-unknown"; + return `Bun v${version}, ${os.endianness()}`; + } + return `Node.js ${process2.version}, ${os.endianness()}`; + } + } +}); + +// node_modules/webidl-conversions/lib/index.js +var require_lib4 = __commonJS({ + "node_modules/webidl-conversions/lib/index.js"(exports2) { + "use strict"; + function makeException(ErrorType, message2, options) { + if (options.globals) { + ErrorType = options.globals[ErrorType.name]; + } + return new ErrorType(`${options.context ? options.context : "Value"} ${message2}.`); + } + function toNumber(value, options) { + if (typeof value === "bigint") { + throw makeException(TypeError, "is a BigInt which cannot be converted to a number", options); + } + if (!options.globals) { + return Number(value); + } + return options.globals.Number(value); + } + function evenRound(x4) { + if (x4 > 0 && x4 % 1 === 0.5 && (x4 & 1) === 0 || x4 < 0 && x4 % 1 === -0.5 && (x4 & 1) === 1) { + return censorNegativeZero(Math.floor(x4)); + } + return censorNegativeZero(Math.round(x4)); + } + function integerPart(n4) { + return censorNegativeZero(Math.trunc(n4)); + } + function sign(x4) { + return x4 < 0 ? -1 : 1; + } + function modulo(x4, y2) { + const signMightNotMatch = x4 % y2; + if (sign(y2) !== sign(signMightNotMatch)) { + return signMightNotMatch + y2; + } + return signMightNotMatch; + } + function censorNegativeZero(x4) { + return x4 === 0 ? 0 : x4; + } + function createIntegerConversion(bitLength, { unsigned }) { + let lowerBound, upperBound; + if (unsigned) { + lowerBound = 0; + upperBound = 2 ** bitLength - 1; + } else { + lowerBound = -(2 ** (bitLength - 1)); + upperBound = 2 ** (bitLength - 1) - 1; + } + const twoToTheBitLength = 2 ** bitLength; + const twoToOneLessThanTheBitLength = 2 ** (bitLength - 1); + return (value, options = {}) => { + let x4 = toNumber(value, options); + x4 = censorNegativeZero(x4); + if (options.enforceRange) { + if (!Number.isFinite(x4)) { + throw makeException(TypeError, "is not a finite number", options); + } + x4 = integerPart(x4); + if (x4 < lowerBound || x4 > upperBound) { + throw makeException( + TypeError, + `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, + options + ); + } + return x4; + } + if (!Number.isNaN(x4) && options.clamp) { + x4 = Math.min(Math.max(x4, lowerBound), upperBound); + x4 = evenRound(x4); + return x4; + } + if (!Number.isFinite(x4) || x4 === 0) { + return 0; + } + x4 = integerPart(x4); + if (x4 >= lowerBound && x4 <= upperBound) { + return x4; + } + x4 = modulo(x4, twoToTheBitLength); + if (!unsigned && x4 >= twoToOneLessThanTheBitLength) { + return x4 - twoToTheBitLength; + } + return x4; + }; + } + function createLongLongConversion(bitLength, { unsigned }) { + const upperBound = Number.MAX_SAFE_INTEGER; + const lowerBound = unsigned ? 0 : Number.MIN_SAFE_INTEGER; + const asBigIntN = unsigned ? BigInt.asUintN : BigInt.asIntN; + return (value, options = {}) => { + let x4 = toNumber(value, options); + x4 = censorNegativeZero(x4); + if (options.enforceRange) { + if (!Number.isFinite(x4)) { + throw makeException(TypeError, "is not a finite number", options); + } + x4 = integerPart(x4); + if (x4 < lowerBound || x4 > upperBound) { + throw makeException( + TypeError, + `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, + options + ); + } + return x4; + } + if (!Number.isNaN(x4) && options.clamp) { + x4 = Math.min(Math.max(x4, lowerBound), upperBound); + x4 = evenRound(x4); + return x4; + } + if (!Number.isFinite(x4) || x4 === 0) { + return 0; + } + let xBigInt = BigInt(integerPart(x4)); + xBigInt = asBigIntN(bitLength, xBigInt); + return Number(xBigInt); + }; + } + exports2.any = (value) => { + return value; + }; + exports2.undefined = () => { + return void 0; + }; + exports2.boolean = (value) => { + return Boolean(value); + }; + exports2.byte = createIntegerConversion(8, { unsigned: false }); + exports2.octet = createIntegerConversion(8, { unsigned: true }); + exports2.short = createIntegerConversion(16, { unsigned: false }); + exports2["unsigned short"] = createIntegerConversion(16, { unsigned: true }); + exports2.long = createIntegerConversion(32, { unsigned: false }); + exports2["unsigned long"] = createIntegerConversion(32, { unsigned: true }); + exports2["long long"] = createLongLongConversion(64, { unsigned: false }); + exports2["unsigned long long"] = createLongLongConversion(64, { unsigned: true }); + exports2.double = (value, options = {}) => { + const x4 = toNumber(value, options); + if (!Number.isFinite(x4)) { + throw makeException(TypeError, "is not a finite floating-point value", options); + } + return x4; + }; + exports2["unrestricted double"] = (value, options = {}) => { + const x4 = toNumber(value, options); + return x4; + }; + exports2.float = (value, options = {}) => { + const x4 = toNumber(value, options); + if (!Number.isFinite(x4)) { + throw makeException(TypeError, "is not a finite floating-point value", options); + } + if (Object.is(x4, -0)) { + return x4; + } + const y2 = Math.fround(x4); + if (!Number.isFinite(y2)) { + throw makeException(TypeError, "is outside the range of a single-precision floating-point value", options); + } + return y2; + }; + exports2["unrestricted float"] = (value, options = {}) => { + const x4 = toNumber(value, options); + if (isNaN(x4)) { + return x4; + } + if (Object.is(x4, -0)) { + return x4; + } + return Math.fround(x4); + }; + exports2.DOMString = (value, options = {}) => { + if (options.treatNullAsEmptyString && value === null) { + return ""; + } + if (typeof value === "symbol") { + throw makeException(TypeError, "is a symbol, which cannot be converted to a string", options); + } + const StringCtor = options.globals ? options.globals.String : String; + return StringCtor(value); + }; + exports2.ByteString = (value, options = {}) => { + const x4 = exports2.DOMString(value, options); + let c4; + for (let i4 = 0; (c4 = x4.codePointAt(i4)) !== void 0; ++i4) { + if (c4 > 255) { + throw makeException(TypeError, "is not a valid ByteString", options); + } + } + return x4; + }; + exports2.USVString = (value, options = {}) => { + const S = exports2.DOMString(value, options); + const n4 = S.length; + const U = []; + for (let i4 = 0; i4 < n4; ++i4) { + const c4 = S.charCodeAt(i4); + if (c4 < 55296 || c4 > 57343) { + U.push(String.fromCodePoint(c4)); + } else if (56320 <= c4 && c4 <= 57343) { + U.push(String.fromCodePoint(65533)); + } else if (i4 === n4 - 1) { + U.push(String.fromCodePoint(65533)); + } else { + const d4 = S.charCodeAt(i4 + 1); + if (56320 <= d4 && d4 <= 57343) { + const a4 = c4 & 1023; + const b4 = d4 & 1023; + U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a4 + b4)); + ++i4; + } else { + U.push(String.fromCodePoint(65533)); + } + } + } + return U.join(""); + }; + exports2.object = (value, options = {}) => { + if (value === null || typeof value !== "object" && typeof value !== "function") { + throw makeException(TypeError, "is not an object", options); + } + return value; + }; + var abByteLengthGetter = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; + var sabByteLengthGetter = typeof SharedArrayBuffer === "function" ? Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength").get : null; + function isNonSharedArrayBuffer(value) { + try { + abByteLengthGetter.call(value); + return true; + } catch { + return false; + } + } + function isSharedArrayBuffer(value) { + try { + sabByteLengthGetter.call(value); + return true; + } catch { + return false; + } + } + function isArrayBufferDetached(value) { + try { + new Uint8Array(value); + return false; + } catch { + return true; + } + } + exports2.ArrayBuffer = (value, options = {}) => { + if (!isNonSharedArrayBuffer(value)) { + if (options.allowShared && !isSharedArrayBuffer(value)) { + throw makeException(TypeError, "is not an ArrayBuffer or SharedArrayBuffer", options); + } + throw makeException(TypeError, "is not an ArrayBuffer", options); + } + if (isArrayBufferDetached(value)) { + throw makeException(TypeError, "is a detached ArrayBuffer", options); + } + return value; + }; + var dvByteLengthGetter = Object.getOwnPropertyDescriptor(DataView.prototype, "byteLength").get; + exports2.DataView = (value, options = {}) => { + try { + dvByteLengthGetter.call(value); + } catch (e4) { + throw makeException(TypeError, "is not a DataView", options); + } + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is backed by a SharedArrayBuffer, which is not allowed", options); + } + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is backed by a detached ArrayBuffer", options); + } + return value; + }; + var typedArrayNameGetter = Object.getOwnPropertyDescriptor( + Object.getPrototypeOf(Uint8Array).prototype, + Symbol.toStringTag + ).get; + [ + Int8Array, + Int16Array, + Int32Array, + Uint8Array, + Uint16Array, + Uint32Array, + Uint8ClampedArray, + Float32Array, + Float64Array + ].forEach((func) => { + const { name } = func; + const article = /^[AEIOU]/u.test(name) ? "an" : "a"; + exports2[name] = (value, options = {}) => { + if (!ArrayBuffer.isView(value) || typedArrayNameGetter.call(value) !== name) { + throw makeException(TypeError, `is not ${article} ${name} object`, options); + } + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); + } + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); + } + return value; + }; + }); + exports2.ArrayBufferView = (value, options = {}) => { + if (!ArrayBuffer.isView(value)) { + throw makeException(TypeError, "is not a view on an ArrayBuffer or SharedArrayBuffer", options); + } + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); + } + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); + } + return value; + }; + exports2.BufferSource = (value, options = {}) => { + if (ArrayBuffer.isView(value)) { + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); + } + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); + } + return value; + } + if (!options.allowShared && !isNonSharedArrayBuffer(value)) { + throw makeException(TypeError, "is not an ArrayBuffer or a view on one", options); + } + if (options.allowShared && !isSharedArrayBuffer(value) && !isNonSharedArrayBuffer(value)) { + throw makeException(TypeError, "is not an ArrayBuffer, SharedArrayBuffer, or a view on one", options); + } + if (isArrayBufferDetached(value)) { + throw makeException(TypeError, "is a detached ArrayBuffer", options); + } + return value; + }; + exports2.DOMTimeStamp = exports2["unsigned long long"]; + } +}); + +// node_modules/whatwg-url/lib/utils.js +var require_utils5 = __commonJS({ + "node_modules/whatwg-url/lib/utils.js"(exports2, module2) { + "use strict"; + function isObject(value) { + return typeof value === "object" && value !== null || typeof value === "function"; + } + var hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty); + function define2(target, source) { + for (const key of Reflect.ownKeys(source)) { + const descriptor = Reflect.getOwnPropertyDescriptor(source, key); + if (descriptor && !Reflect.defineProperty(target, key, descriptor)) { + throw new TypeError(`Cannot redefine property: ${String(key)}`); + } + } + } + function newObjectInRealm(globalObject, object) { + const ctorRegistry = initCtorRegistry(globalObject); + return Object.defineProperties( + Object.create(ctorRegistry["%Object.prototype%"]), + Object.getOwnPropertyDescriptors(object) + ); + } + var wrapperSymbol = /* @__PURE__ */ Symbol("wrapper"); + var implSymbol = /* @__PURE__ */ Symbol("impl"); + var sameObjectCaches = /* @__PURE__ */ Symbol("SameObject caches"); + var ctorRegistrySymbol = /* @__PURE__ */ Symbol.for("[webidl2js] constructor registry"); + var AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () { + }).prototype); + function initCtorRegistry(globalObject) { + if (hasOwn(globalObject, ctorRegistrySymbol)) { + return globalObject[ctorRegistrySymbol]; + } + const ctorRegistry = /* @__PURE__ */ Object.create(null); + ctorRegistry["%Object.prototype%"] = globalObject.Object.prototype; + ctorRegistry["%IteratorPrototype%"] = Object.getPrototypeOf( + Object.getPrototypeOf(new globalObject.Array()[Symbol.iterator]()) + ); + try { + ctorRegistry["%AsyncIteratorPrototype%"] = Object.getPrototypeOf( + Object.getPrototypeOf( + globalObject.eval("(async function* () {})").prototype + ) + ); + } catch { + ctorRegistry["%AsyncIteratorPrototype%"] = AsyncIteratorPrototype; + } + globalObject[ctorRegistrySymbol] = ctorRegistry; + return ctorRegistry; + } + function getSameObject(wrapper, prop, creator) { + if (!wrapper[sameObjectCaches]) { + wrapper[sameObjectCaches] = /* @__PURE__ */ Object.create(null); + } + if (prop in wrapper[sameObjectCaches]) { + return wrapper[sameObjectCaches][prop]; + } + wrapper[sameObjectCaches][prop] = creator(); + return wrapper[sameObjectCaches][prop]; + } + function wrapperForImpl(impl) { + return impl ? impl[wrapperSymbol] : null; + } + function implForWrapper(wrapper) { + return wrapper ? wrapper[implSymbol] : null; + } + function tryWrapperForImpl(impl) { + const wrapper = wrapperForImpl(impl); + return wrapper ? wrapper : impl; + } + function tryImplForWrapper(wrapper) { + const impl = implForWrapper(wrapper); + return impl ? impl : wrapper; + } + var iterInternalSymbol = /* @__PURE__ */ Symbol("internal"); + function isArrayIndexPropName(P) { + if (typeof P !== "string") { + return false; + } + const i4 = P >>> 0; + if (i4 === 2 ** 32 - 1) { + return false; + } + const s4 = `${i4}`; + if (P !== s4) { + return false; + } + return true; + } + var byteLengthGetter = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; + function isArrayBuffer(value) { + try { + byteLengthGetter.call(value); + return true; + } catch (e4) { + return false; + } + } + function iteratorResult([key, value], kind) { + let result; + switch (kind) { + case "key": + result = key; + break; + case "value": + result = value; + break; + case "key+value": + result = [key, value]; + break; + } + return { value: result, done: false }; + } + var supportsPropertyIndex = /* @__PURE__ */ Symbol("supports property index"); + var supportedPropertyIndices = /* @__PURE__ */ Symbol("supported property indices"); + var supportsPropertyName = /* @__PURE__ */ Symbol("supports property name"); + var supportedPropertyNames = /* @__PURE__ */ Symbol("supported property names"); + var indexedGet = /* @__PURE__ */ Symbol("indexed property get"); + var indexedSetNew = /* @__PURE__ */ Symbol("indexed property set new"); + var indexedSetExisting = /* @__PURE__ */ Symbol("indexed property set existing"); + var namedGet = /* @__PURE__ */ Symbol("named property get"); + var namedSetNew = /* @__PURE__ */ Symbol("named property set new"); + var namedSetExisting = /* @__PURE__ */ Symbol("named property set existing"); + var namedDelete = /* @__PURE__ */ Symbol("named property delete"); + var asyncIteratorNext = /* @__PURE__ */ Symbol("async iterator get the next iteration result"); + var asyncIteratorReturn = /* @__PURE__ */ Symbol("async iterator return steps"); + var asyncIteratorInit = /* @__PURE__ */ Symbol("async iterator initialization steps"); + var asyncIteratorEOI = /* @__PURE__ */ Symbol("async iterator end of iteration"); + module2.exports = exports2 = { + isObject, + hasOwn, + define: define2, + newObjectInRealm, + wrapperSymbol, + implSymbol, + getSameObject, + ctorRegistrySymbol, + initCtorRegistry, + wrapperForImpl, + implForWrapper, + tryWrapperForImpl, + tryImplForWrapper, + iterInternalSymbol, + isArrayBuffer, + isArrayIndexPropName, + supportsPropertyIndex, + supportedPropertyIndices, + supportsPropertyName, + supportedPropertyNames, + indexedGet, + indexedSetNew, + indexedSetExisting, + namedGet, + namedSetNew, + namedSetExisting, + namedDelete, + asyncIteratorNext, + asyncIteratorReturn, + asyncIteratorInit, + asyncIteratorEOI, + iteratorResult + }; + } +}); + +// node_modules/punycode/punycode.js +var require_punycode = __commonJS({ + "node_modules/punycode/punycode.js"(exports2, module2) { + "use strict"; + var maxInt = 2147483647; + var base = 36; + var tMin = 1; + var tMax = 26; + var skew = 38; + var damp = 700; + var initialBias = 72; + var initialN = 128; + var delimiter = "-"; + var regexPunycode = /^xn--/; + var regexNonASCII = /[^\0-\x7F]/; + var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; + var errors = { + "overflow": "Overflow: input needs wider integers to process", + "not-basic": "Illegal input >= 0x80 (not a basic code point)", + "invalid-input": "Invalid input" + }; + var baseMinusTMin = base - tMin; + var floor = Math.floor; + var stringFromCharCode = String.fromCharCode; + function error2(type) { + throw new RangeError(errors[type]); + } + function map2(array, callback) { + const result = []; + let length = array.length; + while (length--) { + result[length] = callback(array[length]); + } + return result; + } + function mapDomain(domain, callback) { + const parts = domain.split("@"); + let result = ""; + if (parts.length > 1) { + result = parts[0] + "@"; + domain = parts[1]; + } + domain = domain.replace(regexSeparators, "."); + const labels = domain.split("."); + const encoded = map2(labels, callback).join("."); + return result + encoded; + } + function ucs2decode(string) { + const output = []; + let counter = 0; + const length = string.length; + while (counter < length) { + const value = string.charCodeAt(counter++); + if (value >= 55296 && value <= 56319 && counter < length) { + const extra = string.charCodeAt(counter++); + if ((extra & 64512) == 56320) { + output.push(((value & 1023) << 10) + (extra & 1023) + 65536); + } else { + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + var ucs2encode = (codePoints) => String.fromCodePoint(...codePoints); + var basicToDigit = function(codePoint) { + if (codePoint >= 48 && codePoint < 58) { + return 26 + (codePoint - 48); + } + if (codePoint >= 65 && codePoint < 91) { + return codePoint - 65; + } + if (codePoint >= 97 && codePoint < 123) { + return codePoint - 97; + } + return base; + }; + var digitToBasic = function(digit, flag) { + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + }; + var adapt = function(delta, numPoints, firstTime) { + let k4 = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (; delta > baseMinusTMin * tMax >> 1; k4 += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k4 + (baseMinusTMin + 1) * delta / (delta + skew)); + }; + var decode2 = function(input) { + const output = []; + const inputLength = input.length; + let i4 = 0; + let n4 = initialN; + let bias = initialBias; + let basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + for (let j4 = 0; j4 < basic; ++j4) { + if (input.charCodeAt(j4) >= 128) { + error2("not-basic"); + } + output.push(input.charCodeAt(j4)); + } + for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; ) { + const oldi = i4; + for (let w4 = 1, k4 = base; ; k4 += base) { + if (index >= inputLength) { + error2("invalid-input"); + } + const digit = basicToDigit(input.charCodeAt(index++)); + if (digit >= base) { + error2("invalid-input"); + } + if (digit > floor((maxInt - i4) / w4)) { + error2("overflow"); + } + i4 += digit * w4; + const t4 = k4 <= bias ? tMin : k4 >= bias + tMax ? tMax : k4 - bias; + if (digit < t4) { + break; + } + const baseMinusT = base - t4; + if (w4 > floor(maxInt / baseMinusT)) { + error2("overflow"); + } + w4 *= baseMinusT; + } + const out = output.length + 1; + bias = adapt(i4 - oldi, out, oldi == 0); + if (floor(i4 / out) > maxInt - n4) { + error2("overflow"); + } + n4 += floor(i4 / out); + i4 %= out; + output.splice(i4++, 0, n4); + } + return String.fromCodePoint(...output); + }; + var encode2 = function(input) { + const output = []; + input = ucs2decode(input); + const inputLength = input.length; + let n4 = initialN; + let delta = 0; + let bias = initialBias; + for (const currentValue of input) { + if (currentValue < 128) { + output.push(stringFromCharCode(currentValue)); + } + } + const basicLength = output.length; + let handledCPCount = basicLength; + if (basicLength) { + output.push(delimiter); + } + while (handledCPCount < inputLength) { + let m4 = maxInt; + for (const currentValue of input) { + if (currentValue >= n4 && currentValue < m4) { + m4 = currentValue; + } + } + const handledCPCountPlusOne = handledCPCount + 1; + if (m4 - n4 > floor((maxInt - delta) / handledCPCountPlusOne)) { + error2("overflow"); + } + delta += (m4 - n4) * handledCPCountPlusOne; + n4 = m4; + for (const currentValue of input) { + if (currentValue < n4 && ++delta > maxInt) { + error2("overflow"); + } + if (currentValue === n4) { + let q4 = delta; + for (let k4 = base; ; k4 += base) { + const t4 = k4 <= bias ? tMin : k4 >= bias + tMax ? tMax : k4 - bias; + if (q4 < t4) { + break; + } + const qMinusT = q4 - t4; + const baseMinusT = base - t4; + output.push( + stringFromCharCode(digitToBasic(t4 + qMinusT % baseMinusT, 0)) + ); + q4 = floor(qMinusT / baseMinusT); + } + output.push(stringFromCharCode(digitToBasic(q4, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); + delta = 0; + ++handledCPCount; + } + } + ++delta; + ++n4; + } + return output.join(""); + }; + var toUnicode = function(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) ? decode2(string.slice(4).toLowerCase()) : string; + }); + }; + var toASCII = function(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) ? "xn--" + encode2(string) : string; + }); + }; + var punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + "version": "2.3.1", + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + "ucs2": { + "decode": ucs2decode, + "encode": ucs2encode + }, + "decode": decode2, + "encode": encode2, + "toASCII": toASCII, + "toUnicode": toUnicode + }; + module2.exports = punycode; + } +}); + +// node_modules/tr46/lib/regexes.js +var require_regexes = __commonJS({ + "node_modules/tr46/lib/regexes.js"(exports2, module2) { + "use strict"; + var combiningMarks = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{11241}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113B8}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{11F00}\u{11F01}\u{11F03}\u{11F34}-\u{11F3A}\u{11F3E}-\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]/u; + var combiningClassVirama = /[\u094D\u09CD\u0A4D\u0ACD\u0B4D\u0BCD\u0C4D\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E3A\u0EBA\u0F84\u1039\u103A\u1714\u1715\u1734\u17D2\u1A60\u1B44\u1BAA\u1BAB\u1BF2\u1BF3\u2D7F\uA806\uA82C\uA8C4\uA953\uA9C0\uAAF6\uABED\u{10A3F}\u{11046}\u{11070}\u{1107F}\u{110B9}\u{11133}\u{11134}\u{111C0}\u{11235}\u{112EA}\u{1134D}\u{113CE}-\u{113D0}\u{11442}\u{114C2}\u{115BF}\u{1163F}\u{116B6}\u{1172B}\u{11839}\u{1193D}\u{1193E}\u{119E0}\u{11A34}\u{11A47}\u{11A99}\u{11C3F}\u{11D44}\u{11D45}\u{11D97}\u{11F41}\u{11F42}\u{1612F}]/u; + var validZWNJ = /[\u0620\u0626\u0628\u062A-\u062E\u0633-\u063F\u0641-\u0647\u0649\u064A\u066E\u066F\u0678-\u0687\u069A-\u06BF\u06C1\u06C2\u06CC\u06CE\u06D0\u06D1\u06FA-\u06FC\u06FF\u0712-\u0714\u071A-\u071D\u071F-\u0727\u0729\u072B\u072D\u072E\u074E-\u0758\u075C-\u076A\u076D-\u0770\u0772\u0775-\u0777\u077A-\u077F\u07CA-\u07EA\u0841-\u0845\u0848\u084A-\u0853\u0855\u0860\u0862-\u0865\u0868\u0886\u0889-\u088D\u08A0-\u08A9\u08AF\u08B0\u08B3-\u08B8\u08BA-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA872\u{10AC0}-\u{10AC4}\u{10ACD}\u{10AD3}-\u{10ADC}\u{10ADE}-\u{10AE0}\u{10AEB}-\u{10AEE}\u{10B80}\u{10B82}\u{10B86}-\u{10B88}\u{10B8A}\u{10B8B}\u{10B8D}\u{10B90}\u{10BAD}\u{10BAE}\u{10D00}-\u{10D21}\u{10D23}\u{10EC3}\u{10EC4}\u{10F30}-\u{10F32}\u{10F34}-\u{10F44}\u{10F51}-\u{10F53}\u{10F70}-\u{10F73}\u{10F76}-\u{10F81}\u{10FB0}\u{10FB2}\u{10FB3}\u{10FB8}\u{10FBB}\u{10FBC}\u{10FBE}\u{10FBF}\u{10FC1}\u{10FC4}\u{10FCA}\u{10FCB}\u{1E900}-\u{1E943}][\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*\u200C[\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*[\u0620\u0622-\u063F\u0641-\u064A\u066E\u066F\u0671-\u0673\u0675-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u077F\u07CA-\u07EA\u0840-\u0858\u0860\u0862-\u0865\u0867-\u086A\u0870-\u0882\u0886\u0889-\u088E\u08A0-\u08AC\u08AE-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA871\u{10AC0}-\u{10AC5}\u{10AC7}\u{10AC9}\u{10ACA}\u{10ACE}-\u{10AD6}\u{10AD8}-\u{10AE1}\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B80}-\u{10B91}\u{10BA9}-\u{10BAE}\u{10D01}-\u{10D23}\u{10EC2}-\u{10EC4}\u{10F30}-\u{10F44}\u{10F51}-\u{10F54}\u{10F70}-\u{10F81}\u{10FB0}\u{10FB2}-\u{10FB6}\u{10FB8}-\u{10FBF}\u{10FC1}-\u{10FC4}\u{10FC9}\u{10FCA}\u{1E900}-\u{1E943}]/u; + var bidiDomain = /[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u; + var bidiS1LTR = /[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCEF}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D800}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]/u; + var bidiS1RTL = /[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u; + var bidiS2 = /^[\0-\x08\x0E-\x1B!-@\[-`\{-\x84\x86-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02B9\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u036F\u0374\u0375\u037E\u0384\u0385\u0387\u03F6\u0483-\u0489\u058A\u058D-\u058F\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u0897-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09F2\u09F3\u09FB\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF1\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0BF3-\u0BFA\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C78-\u0C7E\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E3F\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1390-\u1399\u1400\u169B\u169C\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DB\u17DD\u17F0-\u17F9\u1800-\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1940\u1944\u1945\u19DE-\u19FF\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u200B-\u200D\u200F-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20C0\u20D0-\u20F0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189-\u218B\u2190-\u2335\u237B-\u2394\u2396-\u2429\u2440-\u244A\u2460-\u249B\u24EA-\u26AB\u26AD-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF9-\u2CFF\u2D7F\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u302A-\u302D\u3030\u3036\u3037\u303D-\u303F\u3099-\u309C\u30A0\u30FB\u31C0-\u31E5\u31EF\u321D\u321E\u3250-\u325F\u327C-\u327E\u32B1-\u32BF\u32CC-\u32CF\u3377-\u337A\u33DE\u33DF\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA66F-\uA67F\uA69E\uA69F\uA6F0\uA6F1\uA700-\uA721\uA788\uA802\uA806\uA80B\uA825\uA826\uA828-\uA82C\uA838\uA839\uA874-\uA877\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uAB6A\uAB6B\uABE5\uABE8\uABED\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD8F\uFD92-\uFDC7\uFDCF\uFDF0-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE74\uFE76-\uFEFC\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10101}\u{10140}-\u{1018C}\u{10190}-\u{1019C}\u{101A0}\u{101FD}\u{102E0}-\u{102FB}\u{10376}-\u{1037A}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{1091F}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A38}-\u{10A3A}\u{10A3F}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE6}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B39}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D27}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D69}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAB}-\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10EFC}-\u{10F27}\u{10F30}-\u{10F59}\u{10F70}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11001}\u{11038}-\u{11046}\u{11052}-\u{11065}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{11660}-\u{1166C}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{11FD5}-\u{11FF1}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE2}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CC00}-\u{1CCD5}\u{1CCF0}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D1E9}\u{1D1EA}\u{1D200}-\u{1D245}\u{1D300}-\u{1D356}\u{1D6C1}\u{1D6DB}\u{1D6FB}\u{1D715}\u{1D735}\u{1D74F}\u{1D76F}\u{1D789}\u{1D7A9}\u{1D7C3}\u{1D7CE}-\u{1D7FF}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E2FF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8D6}\u{1E900}-\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F10F}\u{1F12F}\u{1F16A}-\u{1F16F}\u{1F1AD}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*$/u; + var bidiS3 = /[0-9\xB2\xB3\xB9\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\u{102E1}-\u{102FB}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u; + var bidiS4EN = /[0-9\xB2\xB3\xB9\u06F0-\u06F9\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFF10-\uFF19\u{102E1}-\u{102FB}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}]/u; + var bidiS4AN = /[\u0600-\u0605\u0660-\u0669\u066B\u066C\u06DD\u0890\u0891\u08E2\u{10D30}-\u{10D39}\u{10D40}-\u{10D49}\u{10E60}-\u{10E7E}]/u; + var bidiS5 = /^[\0-\x08\x0E-\x1B!-\x84\x86-\u0377\u037A-\u037F\u0384-\u038A\u038C\u038E-\u03A1\u03A3-\u052F\u0531-\u0556\u0559-\u058A\u058D-\u058F\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0606\u0607\u0609\u060A\u060C\u060E-\u061A\u064B-\u065F\u066A\u0670\u06D6-\u06DC\u06DE-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F6-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5D\u0C60-\u0C63\u0C66-\u0C6F\u0C77-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E3A\u0E3F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FDA\u1000-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u13A0-\u13F5\u13F8-\u13FD\u1400-\u167F\u1681-\u169C\u16A0-\u16F8\u1700-\u1715\u171F-\u1736\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u1800-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE-\u1A1B\u1A1E-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1AB0-\u1ACE\u1B00-\u1B4C\u1B4E-\u1BF3\u1BFC-\u1C37\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD0-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u200B-\u200E\u2010-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2071\u2074-\u208E\u2090-\u209C\u20A0-\u20C0\u20D0-\u20F0\u2100-\u218B\u2190-\u2429\u2440-\u244A\u2460-\u2B73\u2B76-\u2B95\u2B97-\u2CF3\u2CF9-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u303F\u3041-\u3096\u3099-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31E5\u31EF-\u321E\u3220-\uA48C\uA490-\uA4C6\uA4D0-\uA62B\uA640-\uA6F7\uA700-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA82C\uA830-\uA839\uA840-\uA877\uA880-\uA8C5\uA8CE-\uA8D9\uA8E0-\uA953\uA95F-\uA97C\uA980-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAAC2\uAADB-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB6B\uAB70-\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1E\uFB29\uFD3E-\uFD4F\uFDCF\uFDFD-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}-\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1018E}\u{10190}-\u{1019C}\u{101A0}\u{101D0}-\u{101FD}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E0}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{1037A}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{1091F}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10B39}-\u{10B3F}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6E}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{1104D}\u{11052}-\u{11075}\u{1107F}-\u{110C2}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11100}-\u{11134}\u{11136}-\u{11147}\u{11150}-\u{11176}\u{11180}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{11241}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112EA}\u{112F0}-\u{112F9}\u{11300}-\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133B}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D5}\u{113D7}\u{113D8}\u{113E1}\u{113E2}\u{11400}-\u{1145B}\u{1145D}-\u{11461}\u{11480}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B5}\u{115B8}-\u{115DD}\u{11600}-\u{11644}\u{11650}-\u{11659}\u{11660}-\u{1166C}\u{11680}-\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171D}-\u{1172B}\u{11730}-\u{11746}\u{11800}-\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D7}\u{119DA}-\u{119E4}\u{11A00}-\u{11A47}\u{11A50}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C36}\u{11C38}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D47}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF8}\u{11F00}-\u{11F10}\u{11F12}-\u{11F3A}\u{11F3E}-\u{11F5A}\u{11FB0}\u{11FC0}-\u{11FF1}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{13455}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF0}-\u{16AF5}\u{16B00}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}-\u{16FE4}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}-\u{1BCA3}\u{1CC00}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D1EA}\u{1D200}-\u{1D245}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D300}-\u{1D356}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D7CB}\u{1D7CE}-\u{1DA8B}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E030}-\u{1E06D}\u{1E08F}\u{1E100}-\u{1E12C}\u{1E130}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AE}\u{1E2C0}-\u{1E2F9}\u{1E2FF}\u{1E4D0}-\u{1E4F9}\u{1E5D0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F1AD}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]*$/u; + var bidiS6 = /[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u06F0-\u06F9\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u2488-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCF9}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F100}-\u{1F10A}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u; + module2.exports = { + combiningMarks, + combiningClassVirama, + validZWNJ, + bidiDomain, + bidiS1LTR, + bidiS1RTL, + bidiS2, + bidiS3, + bidiS4EN, + bidiS4AN, + bidiS5, + bidiS6 + }; + } +}); + +// node_modules/tr46/lib/mappingTable.json +var require_mappingTable = __commonJS({ + "node_modules/tr46/lib/mappingTable.json"(exports2, module2) { + module2.exports = [[[0, 44], 2], [[45, 46], 2], [47, 2], [[48, 57], 2], [[58, 64], 2], [65, 1, "a"], [66, 1, "b"], [67, 1, "c"], [68, 1, "d"], [69, 1, "e"], [70, 1, "f"], [71, 1, "g"], [72, 1, "h"], [73, 1, "i"], [74, 1, "j"], [75, 1, "k"], [76, 1, "l"], [77, 1, "m"], [78, 1, "n"], [79, 1, "o"], [80, 1, "p"], [81, 1, "q"], [82, 1, "r"], [83, 1, "s"], [84, 1, "t"], [85, 1, "u"], [86, 1, "v"], [87, 1, "w"], [88, 1, "x"], [89, 1, "y"], [90, 1, "z"], [[91, 96], 2], [[97, 122], 2], [[123, 127], 2], [[128, 159], 3], [160, 1, " "], [[161, 167], 2], [168, 1, " \u0308"], [169, 2], [170, 1, "a"], [[171, 172], 2], [173, 7], [174, 2], [175, 1, " \u0304"], [[176, 177], 2], [178, 1, "2"], [179, 1, "3"], [180, 1, " \u0301"], [181, 1, "\u03BC"], [182, 2], [183, 2], [184, 1, " \u0327"], [185, 1, "1"], [186, 1, "o"], [187, 2], [188, 1, "1\u20444"], [189, 1, "1\u20442"], [190, 1, "3\u20444"], [191, 2], [192, 1, "\xE0"], [193, 1, "\xE1"], [194, 1, "\xE2"], [195, 1, "\xE3"], [196, 1, "\xE4"], [197, 1, "\xE5"], [198, 1, "\xE6"], [199, 1, "\xE7"], [200, 1, "\xE8"], [201, 1, "\xE9"], [202, 1, "\xEA"], [203, 1, "\xEB"], [204, 1, "\xEC"], [205, 1, "\xED"], [206, 1, "\xEE"], [207, 1, "\xEF"], [208, 1, "\xF0"], [209, 1, "\xF1"], [210, 1, "\xF2"], [211, 1, "\xF3"], [212, 1, "\xF4"], [213, 1, "\xF5"], [214, 1, "\xF6"], [215, 2], [216, 1, "\xF8"], [217, 1, "\xF9"], [218, 1, "\xFA"], [219, 1, "\xFB"], [220, 1, "\xFC"], [221, 1, "\xFD"], [222, 1, "\xFE"], [223, 6, "ss"], [[224, 246], 2], [247, 2], [[248, 255], 2], [256, 1, "\u0101"], [257, 2], [258, 1, "\u0103"], [259, 2], [260, 1, "\u0105"], [261, 2], [262, 1, "\u0107"], [263, 2], [264, 1, "\u0109"], [265, 2], [266, 1, "\u010B"], [267, 2], [268, 1, "\u010D"], [269, 2], [270, 1, "\u010F"], [271, 2], [272, 1, "\u0111"], [273, 2], [274, 1, "\u0113"], [275, 2], [276, 1, "\u0115"], [277, 2], [278, 1, "\u0117"], [279, 2], [280, 1, "\u0119"], [281, 2], [282, 1, "\u011B"], [283, 2], [284, 1, "\u011D"], [285, 2], [286, 1, "\u011F"], [287, 2], [288, 1, "\u0121"], [289, 2], [290, 1, "\u0123"], [291, 2], [292, 1, "\u0125"], [293, 2], [294, 1, "\u0127"], [295, 2], [296, 1, "\u0129"], [297, 2], [298, 1, "\u012B"], [299, 2], [300, 1, "\u012D"], [301, 2], [302, 1, "\u012F"], [303, 2], [304, 1, "i\u0307"], [305, 2], [[306, 307], 1, "ij"], [308, 1, "\u0135"], [309, 2], [310, 1, "\u0137"], [[311, 312], 2], [313, 1, "\u013A"], [314, 2], [315, 1, "\u013C"], [316, 2], [317, 1, "\u013E"], [318, 2], [[319, 320], 1, "l\xB7"], [321, 1, "\u0142"], [322, 2], [323, 1, "\u0144"], [324, 2], [325, 1, "\u0146"], [326, 2], [327, 1, "\u0148"], [328, 2], [329, 1, "\u02BCn"], [330, 1, "\u014B"], [331, 2], [332, 1, "\u014D"], [333, 2], [334, 1, "\u014F"], [335, 2], [336, 1, "\u0151"], [337, 2], [338, 1, "\u0153"], [339, 2], [340, 1, "\u0155"], [341, 2], [342, 1, "\u0157"], [343, 2], [344, 1, "\u0159"], [345, 2], [346, 1, "\u015B"], [347, 2], [348, 1, "\u015D"], [349, 2], [350, 1, "\u015F"], [351, 2], [352, 1, "\u0161"], [353, 2], [354, 1, "\u0163"], [355, 2], [356, 1, "\u0165"], [357, 2], [358, 1, "\u0167"], [359, 2], [360, 1, "\u0169"], [361, 2], [362, 1, "\u016B"], [363, 2], [364, 1, "\u016D"], [365, 2], [366, 1, "\u016F"], [367, 2], [368, 1, "\u0171"], [369, 2], [370, 1, "\u0173"], [371, 2], [372, 1, "\u0175"], [373, 2], [374, 1, "\u0177"], [375, 2], [376, 1, "\xFF"], [377, 1, "\u017A"], [378, 2], [379, 1, "\u017C"], [380, 2], [381, 1, "\u017E"], [382, 2], [383, 1, "s"], [384, 2], [385, 1, "\u0253"], [386, 1, "\u0183"], [387, 2], [388, 1, "\u0185"], [389, 2], [390, 1, "\u0254"], [391, 1, "\u0188"], [392, 2], [393, 1, "\u0256"], [394, 1, "\u0257"], [395, 1, "\u018C"], [[396, 397], 2], [398, 1, "\u01DD"], [399, 1, "\u0259"], [400, 1, "\u025B"], [401, 1, "\u0192"], [402, 2], [403, 1, "\u0260"], [404, 1, "\u0263"], [405, 2], [406, 1, "\u0269"], [407, 1, "\u0268"], [408, 1, "\u0199"], [[409, 411], 2], [412, 1, "\u026F"], [413, 1, "\u0272"], [414, 2], [415, 1, "\u0275"], [416, 1, "\u01A1"], [417, 2], [418, 1, "\u01A3"], [419, 2], [420, 1, "\u01A5"], [421, 2], [422, 1, "\u0280"], [423, 1, "\u01A8"], [424, 2], [425, 1, "\u0283"], [[426, 427], 2], [428, 1, "\u01AD"], [429, 2], [430, 1, "\u0288"], [431, 1, "\u01B0"], [432, 2], [433, 1, "\u028A"], [434, 1, "\u028B"], [435, 1, "\u01B4"], [436, 2], [437, 1, "\u01B6"], [438, 2], [439, 1, "\u0292"], [440, 1, "\u01B9"], [[441, 443], 2], [444, 1, "\u01BD"], [[445, 451], 2], [[452, 454], 1, "d\u017E"], [[455, 457], 1, "lj"], [[458, 460], 1, "nj"], [461, 1, "\u01CE"], [462, 2], [463, 1, "\u01D0"], [464, 2], [465, 1, "\u01D2"], [466, 2], [467, 1, "\u01D4"], [468, 2], [469, 1, "\u01D6"], [470, 2], [471, 1, "\u01D8"], [472, 2], [473, 1, "\u01DA"], [474, 2], [475, 1, "\u01DC"], [[476, 477], 2], [478, 1, "\u01DF"], [479, 2], [480, 1, "\u01E1"], [481, 2], [482, 1, "\u01E3"], [483, 2], [484, 1, "\u01E5"], [485, 2], [486, 1, "\u01E7"], [487, 2], [488, 1, "\u01E9"], [489, 2], [490, 1, "\u01EB"], [491, 2], [492, 1, "\u01ED"], [493, 2], [494, 1, "\u01EF"], [[495, 496], 2], [[497, 499], 1, "dz"], [500, 1, "\u01F5"], [501, 2], [502, 1, "\u0195"], [503, 1, "\u01BF"], [504, 1, "\u01F9"], [505, 2], [506, 1, "\u01FB"], [507, 2], [508, 1, "\u01FD"], [509, 2], [510, 1, "\u01FF"], [511, 2], [512, 1, "\u0201"], [513, 2], [514, 1, "\u0203"], [515, 2], [516, 1, "\u0205"], [517, 2], [518, 1, "\u0207"], [519, 2], [520, 1, "\u0209"], [521, 2], [522, 1, "\u020B"], [523, 2], [524, 1, "\u020D"], [525, 2], [526, 1, "\u020F"], [527, 2], [528, 1, "\u0211"], [529, 2], [530, 1, "\u0213"], [531, 2], [532, 1, "\u0215"], [533, 2], [534, 1, "\u0217"], [535, 2], [536, 1, "\u0219"], [537, 2], [538, 1, "\u021B"], [539, 2], [540, 1, "\u021D"], [541, 2], [542, 1, "\u021F"], [543, 2], [544, 1, "\u019E"], [545, 2], [546, 1, "\u0223"], [547, 2], [548, 1, "\u0225"], [549, 2], [550, 1, "\u0227"], [551, 2], [552, 1, "\u0229"], [553, 2], [554, 1, "\u022B"], [555, 2], [556, 1, "\u022D"], [557, 2], [558, 1, "\u022F"], [559, 2], [560, 1, "\u0231"], [561, 2], [562, 1, "\u0233"], [563, 2], [[564, 566], 2], [[567, 569], 2], [570, 1, "\u2C65"], [571, 1, "\u023C"], [572, 2], [573, 1, "\u019A"], [574, 1, "\u2C66"], [[575, 576], 2], [577, 1, "\u0242"], [578, 2], [579, 1, "\u0180"], [580, 1, "\u0289"], [581, 1, "\u028C"], [582, 1, "\u0247"], [583, 2], [584, 1, "\u0249"], [585, 2], [586, 1, "\u024B"], [587, 2], [588, 1, "\u024D"], [589, 2], [590, 1, "\u024F"], [591, 2], [[592, 680], 2], [[681, 685], 2], [[686, 687], 2], [688, 1, "h"], [689, 1, "\u0266"], [690, 1, "j"], [691, 1, "r"], [692, 1, "\u0279"], [693, 1, "\u027B"], [694, 1, "\u0281"], [695, 1, "w"], [696, 1, "y"], [[697, 705], 2], [[706, 709], 2], [[710, 721], 2], [[722, 727], 2], [728, 1, " \u0306"], [729, 1, " \u0307"], [730, 1, " \u030A"], [731, 1, " \u0328"], [732, 1, " \u0303"], [733, 1, " \u030B"], [734, 2], [735, 2], [736, 1, "\u0263"], [737, 1, "l"], [738, 1, "s"], [739, 1, "x"], [740, 1, "\u0295"], [[741, 745], 2], [[746, 747], 2], [748, 2], [749, 2], [750, 2], [[751, 767], 2], [[768, 831], 2], [832, 1, "\u0300"], [833, 1, "\u0301"], [834, 2], [835, 1, "\u0313"], [836, 1, "\u0308\u0301"], [837, 1, "\u03B9"], [[838, 846], 2], [847, 7], [[848, 855], 2], [[856, 860], 2], [[861, 863], 2], [[864, 865], 2], [866, 2], [[867, 879], 2], [880, 1, "\u0371"], [881, 2], [882, 1, "\u0373"], [883, 2], [884, 1, "\u02B9"], [885, 2], [886, 1, "\u0377"], [887, 2], [[888, 889], 3], [890, 1, " \u03B9"], [[891, 893], 2], [894, 1, ";"], [895, 1, "\u03F3"], [[896, 899], 3], [900, 1, " \u0301"], [901, 1, " \u0308\u0301"], [902, 1, "\u03AC"], [903, 1, "\xB7"], [904, 1, "\u03AD"], [905, 1, "\u03AE"], [906, 1, "\u03AF"], [907, 3], [908, 1, "\u03CC"], [909, 3], [910, 1, "\u03CD"], [911, 1, "\u03CE"], [912, 2], [913, 1, "\u03B1"], [914, 1, "\u03B2"], [915, 1, "\u03B3"], [916, 1, "\u03B4"], [917, 1, "\u03B5"], [918, 1, "\u03B6"], [919, 1, "\u03B7"], [920, 1, "\u03B8"], [921, 1, "\u03B9"], [922, 1, "\u03BA"], [923, 1, "\u03BB"], [924, 1, "\u03BC"], [925, 1, "\u03BD"], [926, 1, "\u03BE"], [927, 1, "\u03BF"], [928, 1, "\u03C0"], [929, 1, "\u03C1"], [930, 3], [931, 1, "\u03C3"], [932, 1, "\u03C4"], [933, 1, "\u03C5"], [934, 1, "\u03C6"], [935, 1, "\u03C7"], [936, 1, "\u03C8"], [937, 1, "\u03C9"], [938, 1, "\u03CA"], [939, 1, "\u03CB"], [[940, 961], 2], [962, 6, "\u03C3"], [[963, 974], 2], [975, 1, "\u03D7"], [976, 1, "\u03B2"], [977, 1, "\u03B8"], [978, 1, "\u03C5"], [979, 1, "\u03CD"], [980, 1, "\u03CB"], [981, 1, "\u03C6"], [982, 1, "\u03C0"], [983, 2], [984, 1, "\u03D9"], [985, 2], [986, 1, "\u03DB"], [987, 2], [988, 1, "\u03DD"], [989, 2], [990, 1, "\u03DF"], [991, 2], [992, 1, "\u03E1"], [993, 2], [994, 1, "\u03E3"], [995, 2], [996, 1, "\u03E5"], [997, 2], [998, 1, "\u03E7"], [999, 2], [1e3, 1, "\u03E9"], [1001, 2], [1002, 1, "\u03EB"], [1003, 2], [1004, 1, "\u03ED"], [1005, 2], [1006, 1, "\u03EF"], [1007, 2], [1008, 1, "\u03BA"], [1009, 1, "\u03C1"], [1010, 1, "\u03C3"], [1011, 2], [1012, 1, "\u03B8"], [1013, 1, "\u03B5"], [1014, 2], [1015, 1, "\u03F8"], [1016, 2], [1017, 1, "\u03C3"], [1018, 1, "\u03FB"], [1019, 2], [1020, 2], [1021, 1, "\u037B"], [1022, 1, "\u037C"], [1023, 1, "\u037D"], [1024, 1, "\u0450"], [1025, 1, "\u0451"], [1026, 1, "\u0452"], [1027, 1, "\u0453"], [1028, 1, "\u0454"], [1029, 1, "\u0455"], [1030, 1, "\u0456"], [1031, 1, "\u0457"], [1032, 1, "\u0458"], [1033, 1, "\u0459"], [1034, 1, "\u045A"], [1035, 1, "\u045B"], [1036, 1, "\u045C"], [1037, 1, "\u045D"], [1038, 1, "\u045E"], [1039, 1, "\u045F"], [1040, 1, "\u0430"], [1041, 1, "\u0431"], [1042, 1, "\u0432"], [1043, 1, "\u0433"], [1044, 1, "\u0434"], [1045, 1, "\u0435"], [1046, 1, "\u0436"], [1047, 1, "\u0437"], [1048, 1, "\u0438"], [1049, 1, "\u0439"], [1050, 1, "\u043A"], [1051, 1, "\u043B"], [1052, 1, "\u043C"], [1053, 1, "\u043D"], [1054, 1, "\u043E"], [1055, 1, "\u043F"], [1056, 1, "\u0440"], [1057, 1, "\u0441"], [1058, 1, "\u0442"], [1059, 1, "\u0443"], [1060, 1, "\u0444"], [1061, 1, "\u0445"], [1062, 1, "\u0446"], [1063, 1, "\u0447"], [1064, 1, "\u0448"], [1065, 1, "\u0449"], [1066, 1, "\u044A"], [1067, 1, "\u044B"], [1068, 1, "\u044C"], [1069, 1, "\u044D"], [1070, 1, "\u044E"], [1071, 1, "\u044F"], [[1072, 1103], 2], [1104, 2], [[1105, 1116], 2], [1117, 2], [[1118, 1119], 2], [1120, 1, "\u0461"], [1121, 2], [1122, 1, "\u0463"], [1123, 2], [1124, 1, "\u0465"], [1125, 2], [1126, 1, "\u0467"], [1127, 2], [1128, 1, "\u0469"], [1129, 2], [1130, 1, "\u046B"], [1131, 2], [1132, 1, "\u046D"], [1133, 2], [1134, 1, "\u046F"], [1135, 2], [1136, 1, "\u0471"], [1137, 2], [1138, 1, "\u0473"], [1139, 2], [1140, 1, "\u0475"], [1141, 2], [1142, 1, "\u0477"], [1143, 2], [1144, 1, "\u0479"], [1145, 2], [1146, 1, "\u047B"], [1147, 2], [1148, 1, "\u047D"], [1149, 2], [1150, 1, "\u047F"], [1151, 2], [1152, 1, "\u0481"], [1153, 2], [1154, 2], [[1155, 1158], 2], [1159, 2], [[1160, 1161], 2], [1162, 1, "\u048B"], [1163, 2], [1164, 1, "\u048D"], [1165, 2], [1166, 1, "\u048F"], [1167, 2], [1168, 1, "\u0491"], [1169, 2], [1170, 1, "\u0493"], [1171, 2], [1172, 1, "\u0495"], [1173, 2], [1174, 1, "\u0497"], [1175, 2], [1176, 1, "\u0499"], [1177, 2], [1178, 1, "\u049B"], [1179, 2], [1180, 1, "\u049D"], [1181, 2], [1182, 1, "\u049F"], [1183, 2], [1184, 1, "\u04A1"], [1185, 2], [1186, 1, "\u04A3"], [1187, 2], [1188, 1, "\u04A5"], [1189, 2], [1190, 1, "\u04A7"], [1191, 2], [1192, 1, "\u04A9"], [1193, 2], [1194, 1, "\u04AB"], [1195, 2], [1196, 1, "\u04AD"], [1197, 2], [1198, 1, "\u04AF"], [1199, 2], [1200, 1, "\u04B1"], [1201, 2], [1202, 1, "\u04B3"], [1203, 2], [1204, 1, "\u04B5"], [1205, 2], [1206, 1, "\u04B7"], [1207, 2], [1208, 1, "\u04B9"], [1209, 2], [1210, 1, "\u04BB"], [1211, 2], [1212, 1, "\u04BD"], [1213, 2], [1214, 1, "\u04BF"], [1215, 2], [1216, 1, "\u04CF"], [1217, 1, "\u04C2"], [1218, 2], [1219, 1, "\u04C4"], [1220, 2], [1221, 1, "\u04C6"], [1222, 2], [1223, 1, "\u04C8"], [1224, 2], [1225, 1, "\u04CA"], [1226, 2], [1227, 1, "\u04CC"], [1228, 2], [1229, 1, "\u04CE"], [1230, 2], [1231, 2], [1232, 1, "\u04D1"], [1233, 2], [1234, 1, "\u04D3"], [1235, 2], [1236, 1, "\u04D5"], [1237, 2], [1238, 1, "\u04D7"], [1239, 2], [1240, 1, "\u04D9"], [1241, 2], [1242, 1, "\u04DB"], [1243, 2], [1244, 1, "\u04DD"], [1245, 2], [1246, 1, "\u04DF"], [1247, 2], [1248, 1, "\u04E1"], [1249, 2], [1250, 1, "\u04E3"], [1251, 2], [1252, 1, "\u04E5"], [1253, 2], [1254, 1, "\u04E7"], [1255, 2], [1256, 1, "\u04E9"], [1257, 2], [1258, 1, "\u04EB"], [1259, 2], [1260, 1, "\u04ED"], [1261, 2], [1262, 1, "\u04EF"], [1263, 2], [1264, 1, "\u04F1"], [1265, 2], [1266, 1, "\u04F3"], [1267, 2], [1268, 1, "\u04F5"], [1269, 2], [1270, 1, "\u04F7"], [1271, 2], [1272, 1, "\u04F9"], [1273, 2], [1274, 1, "\u04FB"], [1275, 2], [1276, 1, "\u04FD"], [1277, 2], [1278, 1, "\u04FF"], [1279, 2], [1280, 1, "\u0501"], [1281, 2], [1282, 1, "\u0503"], [1283, 2], [1284, 1, "\u0505"], [1285, 2], [1286, 1, "\u0507"], [1287, 2], [1288, 1, "\u0509"], [1289, 2], [1290, 1, "\u050B"], [1291, 2], [1292, 1, "\u050D"], [1293, 2], [1294, 1, "\u050F"], [1295, 2], [1296, 1, "\u0511"], [1297, 2], [1298, 1, "\u0513"], [1299, 2], [1300, 1, "\u0515"], [1301, 2], [1302, 1, "\u0517"], [1303, 2], [1304, 1, "\u0519"], [1305, 2], [1306, 1, "\u051B"], [1307, 2], [1308, 1, "\u051D"], [1309, 2], [1310, 1, "\u051F"], [1311, 2], [1312, 1, "\u0521"], [1313, 2], [1314, 1, "\u0523"], [1315, 2], [1316, 1, "\u0525"], [1317, 2], [1318, 1, "\u0527"], [1319, 2], [1320, 1, "\u0529"], [1321, 2], [1322, 1, "\u052B"], [1323, 2], [1324, 1, "\u052D"], [1325, 2], [1326, 1, "\u052F"], [1327, 2], [1328, 3], [1329, 1, "\u0561"], [1330, 1, "\u0562"], [1331, 1, "\u0563"], [1332, 1, "\u0564"], [1333, 1, "\u0565"], [1334, 1, "\u0566"], [1335, 1, "\u0567"], [1336, 1, "\u0568"], [1337, 1, "\u0569"], [1338, 1, "\u056A"], [1339, 1, "\u056B"], [1340, 1, "\u056C"], [1341, 1, "\u056D"], [1342, 1, "\u056E"], [1343, 1, "\u056F"], [1344, 1, "\u0570"], [1345, 1, "\u0571"], [1346, 1, "\u0572"], [1347, 1, "\u0573"], [1348, 1, "\u0574"], [1349, 1, "\u0575"], [1350, 1, "\u0576"], [1351, 1, "\u0577"], [1352, 1, "\u0578"], [1353, 1, "\u0579"], [1354, 1, "\u057A"], [1355, 1, "\u057B"], [1356, 1, "\u057C"], [1357, 1, "\u057D"], [1358, 1, "\u057E"], [1359, 1, "\u057F"], [1360, 1, "\u0580"], [1361, 1, "\u0581"], [1362, 1, "\u0582"], [1363, 1, "\u0583"], [1364, 1, "\u0584"], [1365, 1, "\u0585"], [1366, 1, "\u0586"], [[1367, 1368], 3], [1369, 2], [[1370, 1375], 2], [1376, 2], [[1377, 1414], 2], [1415, 1, "\u0565\u0582"], [1416, 2], [1417, 2], [1418, 2], [[1419, 1420], 3], [[1421, 1422], 2], [1423, 2], [1424, 3], [[1425, 1441], 2], [1442, 2], [[1443, 1455], 2], [[1456, 1465], 2], [1466, 2], [[1467, 1469], 2], [1470, 2], [1471, 2], [1472, 2], [[1473, 1474], 2], [1475, 2], [1476, 2], [1477, 2], [1478, 2], [1479, 2], [[1480, 1487], 3], [[1488, 1514], 2], [[1515, 1518], 3], [1519, 2], [[1520, 1524], 2], [[1525, 1535], 3], [[1536, 1539], 3], [1540, 3], [1541, 3], [[1542, 1546], 2], [1547, 2], [1548, 2], [[1549, 1551], 2], [[1552, 1557], 2], [[1558, 1562], 2], [1563, 2], [1564, 3], [1565, 2], [1566, 2], [1567, 2], [1568, 2], [[1569, 1594], 2], [[1595, 1599], 2], [1600, 2], [[1601, 1618], 2], [[1619, 1621], 2], [[1622, 1624], 2], [[1625, 1630], 2], [1631, 2], [[1632, 1641], 2], [[1642, 1645], 2], [[1646, 1647], 2], [[1648, 1652], 2], [1653, 1, "\u0627\u0674"], [1654, 1, "\u0648\u0674"], [1655, 1, "\u06C7\u0674"], [1656, 1, "\u064A\u0674"], [[1657, 1719], 2], [[1720, 1721], 2], [[1722, 1726], 2], [1727, 2], [[1728, 1742], 2], [1743, 2], [[1744, 1747], 2], [1748, 2], [[1749, 1756], 2], [1757, 3], [1758, 2], [[1759, 1768], 2], [1769, 2], [[1770, 1773], 2], [[1774, 1775], 2], [[1776, 1785], 2], [[1786, 1790], 2], [1791, 2], [[1792, 1805], 2], [1806, 3], [1807, 3], [[1808, 1836], 2], [[1837, 1839], 2], [[1840, 1866], 2], [[1867, 1868], 3], [[1869, 1871], 2], [[1872, 1901], 2], [[1902, 1919], 2], [[1920, 1968], 2], [1969, 2], [[1970, 1983], 3], [[1984, 2037], 2], [[2038, 2042], 2], [[2043, 2044], 3], [2045, 2], [[2046, 2047], 2], [[2048, 2093], 2], [[2094, 2095], 3], [[2096, 2110], 2], [2111, 3], [[2112, 2139], 2], [[2140, 2141], 3], [2142, 2], [2143, 3], [[2144, 2154], 2], [[2155, 2159], 3], [[2160, 2183], 2], [2184, 2], [[2185, 2190], 2], [2191, 3], [[2192, 2193], 3], [[2194, 2198], 3], [2199, 2], [[2200, 2207], 2], [2208, 2], [2209, 2], [[2210, 2220], 2], [[2221, 2226], 2], [[2227, 2228], 2], [2229, 2], [[2230, 2237], 2], [[2238, 2247], 2], [[2248, 2258], 2], [2259, 2], [[2260, 2273], 2], [2274, 3], [2275, 2], [[2276, 2302], 2], [2303, 2], [2304, 2], [[2305, 2307], 2], [2308, 2], [[2309, 2361], 2], [[2362, 2363], 2], [[2364, 2381], 2], [2382, 2], [2383, 2], [[2384, 2388], 2], [2389, 2], [[2390, 2391], 2], [2392, 1, "\u0915\u093C"], [2393, 1, "\u0916\u093C"], [2394, 1, "\u0917\u093C"], [2395, 1, "\u091C\u093C"], [2396, 1, "\u0921\u093C"], [2397, 1, "\u0922\u093C"], [2398, 1, "\u092B\u093C"], [2399, 1, "\u092F\u093C"], [[2400, 2403], 2], [[2404, 2405], 2], [[2406, 2415], 2], [2416, 2], [[2417, 2418], 2], [[2419, 2423], 2], [2424, 2], [[2425, 2426], 2], [[2427, 2428], 2], [2429, 2], [[2430, 2431], 2], [2432, 2], [[2433, 2435], 2], [2436, 3], [[2437, 2444], 2], [[2445, 2446], 3], [[2447, 2448], 2], [[2449, 2450], 3], [[2451, 2472], 2], [2473, 3], [[2474, 2480], 2], [2481, 3], [2482, 2], [[2483, 2485], 3], [[2486, 2489], 2], [[2490, 2491], 3], [2492, 2], [2493, 2], [[2494, 2500], 2], [[2501, 2502], 3], [[2503, 2504], 2], [[2505, 2506], 3], [[2507, 2509], 2], [2510, 2], [[2511, 2518], 3], [2519, 2], [[2520, 2523], 3], [2524, 1, "\u09A1\u09BC"], [2525, 1, "\u09A2\u09BC"], [2526, 3], [2527, 1, "\u09AF\u09BC"], [[2528, 2531], 2], [[2532, 2533], 3], [[2534, 2545], 2], [[2546, 2554], 2], [2555, 2], [2556, 2], [2557, 2], [2558, 2], [[2559, 2560], 3], [2561, 2], [2562, 2], [2563, 2], [2564, 3], [[2565, 2570], 2], [[2571, 2574], 3], [[2575, 2576], 2], [[2577, 2578], 3], [[2579, 2600], 2], [2601, 3], [[2602, 2608], 2], [2609, 3], [2610, 2], [2611, 1, "\u0A32\u0A3C"], [2612, 3], [2613, 2], [2614, 1, "\u0A38\u0A3C"], [2615, 3], [[2616, 2617], 2], [[2618, 2619], 3], [2620, 2], [2621, 3], [[2622, 2626], 2], [[2627, 2630], 3], [[2631, 2632], 2], [[2633, 2634], 3], [[2635, 2637], 2], [[2638, 2640], 3], [2641, 2], [[2642, 2648], 3], [2649, 1, "\u0A16\u0A3C"], [2650, 1, "\u0A17\u0A3C"], [2651, 1, "\u0A1C\u0A3C"], [2652, 2], [2653, 3], [2654, 1, "\u0A2B\u0A3C"], [[2655, 2661], 3], [[2662, 2676], 2], [2677, 2], [2678, 2], [[2679, 2688], 3], [[2689, 2691], 2], [2692, 3], [[2693, 2699], 2], [2700, 2], [2701, 2], [2702, 3], [[2703, 2705], 2], [2706, 3], [[2707, 2728], 2], [2729, 3], [[2730, 2736], 2], [2737, 3], [[2738, 2739], 2], [2740, 3], [[2741, 2745], 2], [[2746, 2747], 3], [[2748, 2757], 2], [2758, 3], [[2759, 2761], 2], [2762, 3], [[2763, 2765], 2], [[2766, 2767], 3], [2768, 2], [[2769, 2783], 3], [2784, 2], [[2785, 2787], 2], [[2788, 2789], 3], [[2790, 2799], 2], [2800, 2], [2801, 2], [[2802, 2808], 3], [2809, 2], [[2810, 2815], 2], [2816, 3], [[2817, 2819], 2], [2820, 3], [[2821, 2828], 2], [[2829, 2830], 3], [[2831, 2832], 2], [[2833, 2834], 3], [[2835, 2856], 2], [2857, 3], [[2858, 2864], 2], [2865, 3], [[2866, 2867], 2], [2868, 3], [2869, 2], [[2870, 2873], 2], [[2874, 2875], 3], [[2876, 2883], 2], [2884, 2], [[2885, 2886], 3], [[2887, 2888], 2], [[2889, 2890], 3], [[2891, 2893], 2], [[2894, 2900], 3], [2901, 2], [[2902, 2903], 2], [[2904, 2907], 3], [2908, 1, "\u0B21\u0B3C"], [2909, 1, "\u0B22\u0B3C"], [2910, 3], [[2911, 2913], 2], [[2914, 2915], 2], [[2916, 2917], 3], [[2918, 2927], 2], [2928, 2], [2929, 2], [[2930, 2935], 2], [[2936, 2945], 3], [[2946, 2947], 2], [2948, 3], [[2949, 2954], 2], [[2955, 2957], 3], [[2958, 2960], 2], [2961, 3], [[2962, 2965], 2], [[2966, 2968], 3], [[2969, 2970], 2], [2971, 3], [2972, 2], [2973, 3], [[2974, 2975], 2], [[2976, 2978], 3], [[2979, 2980], 2], [[2981, 2983], 3], [[2984, 2986], 2], [[2987, 2989], 3], [[2990, 2997], 2], [2998, 2], [[2999, 3001], 2], [[3002, 3005], 3], [[3006, 3010], 2], [[3011, 3013], 3], [[3014, 3016], 2], [3017, 3], [[3018, 3021], 2], [[3022, 3023], 3], [3024, 2], [[3025, 3030], 3], [3031, 2], [[3032, 3045], 3], [3046, 2], [[3047, 3055], 2], [[3056, 3058], 2], [[3059, 3066], 2], [[3067, 3071], 3], [3072, 2], [[3073, 3075], 2], [3076, 2], [[3077, 3084], 2], [3085, 3], [[3086, 3088], 2], [3089, 3], [[3090, 3112], 2], [3113, 3], [[3114, 3123], 2], [3124, 2], [[3125, 3129], 2], [[3130, 3131], 3], [3132, 2], [3133, 2], [[3134, 3140], 2], [3141, 3], [[3142, 3144], 2], [3145, 3], [[3146, 3149], 2], [[3150, 3156], 3], [[3157, 3158], 2], [3159, 3], [[3160, 3161], 2], [3162, 2], [[3163, 3164], 3], [3165, 2], [[3166, 3167], 3], [[3168, 3169], 2], [[3170, 3171], 2], [[3172, 3173], 3], [[3174, 3183], 2], [[3184, 3190], 3], [3191, 2], [[3192, 3199], 2], [3200, 2], [3201, 2], [[3202, 3203], 2], [3204, 2], [[3205, 3212], 2], [3213, 3], [[3214, 3216], 2], [3217, 3], [[3218, 3240], 2], [3241, 3], [[3242, 3251], 2], [3252, 3], [[3253, 3257], 2], [[3258, 3259], 3], [[3260, 3261], 2], [[3262, 3268], 2], [3269, 3], [[3270, 3272], 2], [3273, 3], [[3274, 3277], 2], [[3278, 3284], 3], [[3285, 3286], 2], [[3287, 3292], 3], [3293, 2], [3294, 2], [3295, 3], [[3296, 3297], 2], [[3298, 3299], 2], [[3300, 3301], 3], [[3302, 3311], 2], [3312, 3], [[3313, 3314], 2], [3315, 2], [[3316, 3327], 3], [3328, 2], [3329, 2], [[3330, 3331], 2], [3332, 2], [[3333, 3340], 2], [3341, 3], [[3342, 3344], 2], [3345, 3], [[3346, 3368], 2], [3369, 2], [[3370, 3385], 2], [3386, 2], [[3387, 3388], 2], [3389, 2], [[3390, 3395], 2], [3396, 2], [3397, 3], [[3398, 3400], 2], [3401, 3], [[3402, 3405], 2], [3406, 2], [3407, 2], [[3408, 3411], 3], [[3412, 3414], 2], [3415, 2], [[3416, 3422], 2], [3423, 2], [[3424, 3425], 2], [[3426, 3427], 2], [[3428, 3429], 3], [[3430, 3439], 2], [[3440, 3445], 2], [[3446, 3448], 2], [3449, 2], [[3450, 3455], 2], [3456, 3], [3457, 2], [[3458, 3459], 2], [3460, 3], [[3461, 3478], 2], [[3479, 3481], 3], [[3482, 3505], 2], [3506, 3], [[3507, 3515], 2], [3516, 3], [3517, 2], [[3518, 3519], 3], [[3520, 3526], 2], [[3527, 3529], 3], [3530, 2], [[3531, 3534], 3], [[3535, 3540], 2], [3541, 3], [3542, 2], [3543, 3], [[3544, 3551], 2], [[3552, 3557], 3], [[3558, 3567], 2], [[3568, 3569], 3], [[3570, 3571], 2], [3572, 2], [[3573, 3584], 3], [[3585, 3634], 2], [3635, 1, "\u0E4D\u0E32"], [[3636, 3642], 2], [[3643, 3646], 3], [3647, 2], [[3648, 3662], 2], [3663, 2], [[3664, 3673], 2], [[3674, 3675], 2], [[3676, 3712], 3], [[3713, 3714], 2], [3715, 3], [3716, 2], [3717, 3], [3718, 2], [[3719, 3720], 2], [3721, 2], [3722, 2], [3723, 3], [3724, 2], [3725, 2], [[3726, 3731], 2], [[3732, 3735], 2], [3736, 2], [[3737, 3743], 2], [3744, 2], [[3745, 3747], 2], [3748, 3], [3749, 2], [3750, 3], [3751, 2], [[3752, 3753], 2], [[3754, 3755], 2], [3756, 2], [[3757, 3762], 2], [3763, 1, "\u0ECD\u0EB2"], [[3764, 3769], 2], [3770, 2], [[3771, 3773], 2], [[3774, 3775], 3], [[3776, 3780], 2], [3781, 3], [3782, 2], [3783, 3], [[3784, 3789], 2], [3790, 2], [3791, 3], [[3792, 3801], 2], [[3802, 3803], 3], [3804, 1, "\u0EAB\u0E99"], [3805, 1, "\u0EAB\u0EA1"], [[3806, 3807], 2], [[3808, 3839], 3], [3840, 2], [[3841, 3850], 2], [3851, 2], [3852, 1, "\u0F0B"], [[3853, 3863], 2], [[3864, 3865], 2], [[3866, 3871], 2], [[3872, 3881], 2], [[3882, 3892], 2], [3893, 2], [3894, 2], [3895, 2], [3896, 2], [3897, 2], [[3898, 3901], 2], [[3902, 3906], 2], [3907, 1, "\u0F42\u0FB7"], [[3908, 3911], 2], [3912, 3], [[3913, 3916], 2], [3917, 1, "\u0F4C\u0FB7"], [[3918, 3921], 2], [3922, 1, "\u0F51\u0FB7"], [[3923, 3926], 2], [3927, 1, "\u0F56\u0FB7"], [[3928, 3931], 2], [3932, 1, "\u0F5B\u0FB7"], [[3933, 3944], 2], [3945, 1, "\u0F40\u0FB5"], [3946, 2], [[3947, 3948], 2], [[3949, 3952], 3], [[3953, 3954], 2], [3955, 1, "\u0F71\u0F72"], [3956, 2], [3957, 1, "\u0F71\u0F74"], [3958, 1, "\u0FB2\u0F80"], [3959, 1, "\u0FB2\u0F71\u0F80"], [3960, 1, "\u0FB3\u0F80"], [3961, 1, "\u0FB3\u0F71\u0F80"], [[3962, 3968], 2], [3969, 1, "\u0F71\u0F80"], [[3970, 3972], 2], [3973, 2], [[3974, 3979], 2], [[3980, 3983], 2], [[3984, 3986], 2], [3987, 1, "\u0F92\u0FB7"], [[3988, 3989], 2], [3990, 2], [3991, 2], [3992, 3], [[3993, 3996], 2], [3997, 1, "\u0F9C\u0FB7"], [[3998, 4001], 2], [4002, 1, "\u0FA1\u0FB7"], [[4003, 4006], 2], [4007, 1, "\u0FA6\u0FB7"], [[4008, 4011], 2], [4012, 1, "\u0FAB\u0FB7"], [4013, 2], [[4014, 4016], 2], [[4017, 4023], 2], [4024, 2], [4025, 1, "\u0F90\u0FB5"], [[4026, 4028], 2], [4029, 3], [[4030, 4037], 2], [4038, 2], [[4039, 4044], 2], [4045, 3], [4046, 2], [4047, 2], [[4048, 4049], 2], [[4050, 4052], 2], [[4053, 4056], 2], [[4057, 4058], 2], [[4059, 4095], 3], [[4096, 4129], 2], [4130, 2], [[4131, 4135], 2], [4136, 2], [[4137, 4138], 2], [4139, 2], [[4140, 4146], 2], [[4147, 4149], 2], [[4150, 4153], 2], [[4154, 4159], 2], [[4160, 4169], 2], [[4170, 4175], 2], [[4176, 4185], 2], [[4186, 4249], 2], [[4250, 4253], 2], [[4254, 4255], 2], [4256, 1, "\u2D00"], [4257, 1, "\u2D01"], [4258, 1, "\u2D02"], [4259, 1, "\u2D03"], [4260, 1, "\u2D04"], [4261, 1, "\u2D05"], [4262, 1, "\u2D06"], [4263, 1, "\u2D07"], [4264, 1, "\u2D08"], [4265, 1, "\u2D09"], [4266, 1, "\u2D0A"], [4267, 1, "\u2D0B"], [4268, 1, "\u2D0C"], [4269, 1, "\u2D0D"], [4270, 1, "\u2D0E"], [4271, 1, "\u2D0F"], [4272, 1, "\u2D10"], [4273, 1, "\u2D11"], [4274, 1, "\u2D12"], [4275, 1, "\u2D13"], [4276, 1, "\u2D14"], [4277, 1, "\u2D15"], [4278, 1, "\u2D16"], [4279, 1, "\u2D17"], [4280, 1, "\u2D18"], [4281, 1, "\u2D19"], [4282, 1, "\u2D1A"], [4283, 1, "\u2D1B"], [4284, 1, "\u2D1C"], [4285, 1, "\u2D1D"], [4286, 1, "\u2D1E"], [4287, 1, "\u2D1F"], [4288, 1, "\u2D20"], [4289, 1, "\u2D21"], [4290, 1, "\u2D22"], [4291, 1, "\u2D23"], [4292, 1, "\u2D24"], [4293, 1, "\u2D25"], [4294, 3], [4295, 1, "\u2D27"], [[4296, 4300], 3], [4301, 1, "\u2D2D"], [[4302, 4303], 3], [[4304, 4342], 2], [[4343, 4344], 2], [[4345, 4346], 2], [4347, 2], [4348, 1, "\u10DC"], [[4349, 4351], 2], [[4352, 4441], 2], [[4442, 4446], 2], [[4447, 4448], 7], [[4449, 4514], 2], [[4515, 4519], 2], [[4520, 4601], 2], [[4602, 4607], 2], [[4608, 4614], 2], [4615, 2], [[4616, 4678], 2], [4679, 2], [4680, 2], [4681, 3], [[4682, 4685], 2], [[4686, 4687], 3], [[4688, 4694], 2], [4695, 3], [4696, 2], [4697, 3], [[4698, 4701], 2], [[4702, 4703], 3], [[4704, 4742], 2], [4743, 2], [4744, 2], [4745, 3], [[4746, 4749], 2], [[4750, 4751], 3], [[4752, 4782], 2], [4783, 2], [4784, 2], [4785, 3], [[4786, 4789], 2], [[4790, 4791], 3], [[4792, 4798], 2], [4799, 3], [4800, 2], [4801, 3], [[4802, 4805], 2], [[4806, 4807], 3], [[4808, 4814], 2], [4815, 2], [[4816, 4822], 2], [4823, 3], [[4824, 4846], 2], [4847, 2], [[4848, 4878], 2], [4879, 2], [4880, 2], [4881, 3], [[4882, 4885], 2], [[4886, 4887], 3], [[4888, 4894], 2], [4895, 2], [[4896, 4934], 2], [4935, 2], [[4936, 4954], 2], [[4955, 4956], 3], [[4957, 4958], 2], [4959, 2], [4960, 2], [[4961, 4988], 2], [[4989, 4991], 3], [[4992, 5007], 2], [[5008, 5017], 2], [[5018, 5023], 3], [[5024, 5108], 2], [5109, 2], [[5110, 5111], 3], [5112, 1, "\u13F0"], [5113, 1, "\u13F1"], [5114, 1, "\u13F2"], [5115, 1, "\u13F3"], [5116, 1, "\u13F4"], [5117, 1, "\u13F5"], [[5118, 5119], 3], [5120, 2], [[5121, 5740], 2], [[5741, 5742], 2], [[5743, 5750], 2], [[5751, 5759], 2], [5760, 3], [[5761, 5786], 2], [[5787, 5788], 2], [[5789, 5791], 3], [[5792, 5866], 2], [[5867, 5872], 2], [[5873, 5880], 2], [[5881, 5887], 3], [[5888, 5900], 2], [5901, 2], [[5902, 5908], 2], [5909, 2], [[5910, 5918], 3], [5919, 2], [[5920, 5940], 2], [[5941, 5942], 2], [[5943, 5951], 3], [[5952, 5971], 2], [[5972, 5983], 3], [[5984, 5996], 2], [5997, 3], [[5998, 6e3], 2], [6001, 3], [[6002, 6003], 2], [[6004, 6015], 3], [[6016, 6067], 2], [[6068, 6069], 7], [[6070, 6099], 2], [[6100, 6102], 2], [6103, 2], [[6104, 6107], 2], [6108, 2], [6109, 2], [[6110, 6111], 3], [[6112, 6121], 2], [[6122, 6127], 3], [[6128, 6137], 2], [[6138, 6143], 3], [[6144, 6154], 2], [[6155, 6158], 7], [6159, 7], [[6160, 6169], 2], [[6170, 6175], 3], [[6176, 6263], 2], [6264, 2], [[6265, 6271], 3], [[6272, 6313], 2], [6314, 2], [[6315, 6319], 3], [[6320, 6389], 2], [[6390, 6399], 3], [[6400, 6428], 2], [[6429, 6430], 2], [6431, 3], [[6432, 6443], 2], [[6444, 6447], 3], [[6448, 6459], 2], [[6460, 6463], 3], [6464, 2], [[6465, 6467], 3], [[6468, 6469], 2], [[6470, 6509], 2], [[6510, 6511], 3], [[6512, 6516], 2], [[6517, 6527], 3], [[6528, 6569], 2], [[6570, 6571], 2], [[6572, 6575], 3], [[6576, 6601], 2], [[6602, 6607], 3], [[6608, 6617], 2], [6618, 2], [[6619, 6621], 3], [[6622, 6623], 2], [[6624, 6655], 2], [[6656, 6683], 2], [[6684, 6685], 3], [[6686, 6687], 2], [[6688, 6750], 2], [6751, 3], [[6752, 6780], 2], [[6781, 6782], 3], [[6783, 6793], 2], [[6794, 6799], 3], [[6800, 6809], 2], [[6810, 6815], 3], [[6816, 6822], 2], [6823, 2], [[6824, 6829], 2], [[6830, 6831], 3], [[6832, 6845], 2], [6846, 2], [[6847, 6848], 2], [[6849, 6862], 2], [[6863, 6911], 3], [[6912, 6987], 2], [6988, 2], [6989, 3], [[6990, 6991], 2], [[6992, 7001], 2], [[7002, 7018], 2], [[7019, 7027], 2], [[7028, 7036], 2], [[7037, 7038], 2], [7039, 2], [[7040, 7082], 2], [[7083, 7085], 2], [[7086, 7097], 2], [[7098, 7103], 2], [[7104, 7155], 2], [[7156, 7163], 3], [[7164, 7167], 2], [[7168, 7223], 2], [[7224, 7226], 3], [[7227, 7231], 2], [[7232, 7241], 2], [[7242, 7244], 3], [[7245, 7293], 2], [[7294, 7295], 2], [7296, 1, "\u0432"], [7297, 1, "\u0434"], [7298, 1, "\u043E"], [7299, 1, "\u0441"], [[7300, 7301], 1, "\u0442"], [7302, 1, "\u044A"], [7303, 1, "\u0463"], [7304, 1, "\uA64B"], [7305, 1, "\u1C8A"], [7306, 2], [[7307, 7311], 3], [7312, 1, "\u10D0"], [7313, 1, "\u10D1"], [7314, 1, "\u10D2"], [7315, 1, "\u10D3"], [7316, 1, "\u10D4"], [7317, 1, "\u10D5"], [7318, 1, "\u10D6"], [7319, 1, "\u10D7"], [7320, 1, "\u10D8"], [7321, 1, "\u10D9"], [7322, 1, "\u10DA"], [7323, 1, "\u10DB"], [7324, 1, "\u10DC"], [7325, 1, "\u10DD"], [7326, 1, "\u10DE"], [7327, 1, "\u10DF"], [7328, 1, "\u10E0"], [7329, 1, "\u10E1"], [7330, 1, "\u10E2"], [7331, 1, "\u10E3"], [7332, 1, "\u10E4"], [7333, 1, "\u10E5"], [7334, 1, "\u10E6"], [7335, 1, "\u10E7"], [7336, 1, "\u10E8"], [7337, 1, "\u10E9"], [7338, 1, "\u10EA"], [7339, 1, "\u10EB"], [7340, 1, "\u10EC"], [7341, 1, "\u10ED"], [7342, 1, "\u10EE"], [7343, 1, "\u10EF"], [7344, 1, "\u10F0"], [7345, 1, "\u10F1"], [7346, 1, "\u10F2"], [7347, 1, "\u10F3"], [7348, 1, "\u10F4"], [7349, 1, "\u10F5"], [7350, 1, "\u10F6"], [7351, 1, "\u10F7"], [7352, 1, "\u10F8"], [7353, 1, "\u10F9"], [7354, 1, "\u10FA"], [[7355, 7356], 3], [7357, 1, "\u10FD"], [7358, 1, "\u10FE"], [7359, 1, "\u10FF"], [[7360, 7367], 2], [[7368, 7375], 3], [[7376, 7378], 2], [7379, 2], [[7380, 7410], 2], [[7411, 7414], 2], [7415, 2], [[7416, 7417], 2], [7418, 2], [[7419, 7423], 3], [[7424, 7467], 2], [7468, 1, "a"], [7469, 1, "\xE6"], [7470, 1, "b"], [7471, 2], [7472, 1, "d"], [7473, 1, "e"], [7474, 1, "\u01DD"], [7475, 1, "g"], [7476, 1, "h"], [7477, 1, "i"], [7478, 1, "j"], [7479, 1, "k"], [7480, 1, "l"], [7481, 1, "m"], [7482, 1, "n"], [7483, 2], [7484, 1, "o"], [7485, 1, "\u0223"], [7486, 1, "p"], [7487, 1, "r"], [7488, 1, "t"], [7489, 1, "u"], [7490, 1, "w"], [7491, 1, "a"], [7492, 1, "\u0250"], [7493, 1, "\u0251"], [7494, 1, "\u1D02"], [7495, 1, "b"], [7496, 1, "d"], [7497, 1, "e"], [7498, 1, "\u0259"], [7499, 1, "\u025B"], [7500, 1, "\u025C"], [7501, 1, "g"], [7502, 2], [7503, 1, "k"], [7504, 1, "m"], [7505, 1, "\u014B"], [7506, 1, "o"], [7507, 1, "\u0254"], [7508, 1, "\u1D16"], [7509, 1, "\u1D17"], [7510, 1, "p"], [7511, 1, "t"], [7512, 1, "u"], [7513, 1, "\u1D1D"], [7514, 1, "\u026F"], [7515, 1, "v"], [7516, 1, "\u1D25"], [7517, 1, "\u03B2"], [7518, 1, "\u03B3"], [7519, 1, "\u03B4"], [7520, 1, "\u03C6"], [7521, 1, "\u03C7"], [7522, 1, "i"], [7523, 1, "r"], [7524, 1, "u"], [7525, 1, "v"], [7526, 1, "\u03B2"], [7527, 1, "\u03B3"], [7528, 1, "\u03C1"], [7529, 1, "\u03C6"], [7530, 1, "\u03C7"], [7531, 2], [[7532, 7543], 2], [7544, 1, "\u043D"], [[7545, 7578], 2], [7579, 1, "\u0252"], [7580, 1, "c"], [7581, 1, "\u0255"], [7582, 1, "\xF0"], [7583, 1, "\u025C"], [7584, 1, "f"], [7585, 1, "\u025F"], [7586, 1, "\u0261"], [7587, 1, "\u0265"], [7588, 1, "\u0268"], [7589, 1, "\u0269"], [7590, 1, "\u026A"], [7591, 1, "\u1D7B"], [7592, 1, "\u029D"], [7593, 1, "\u026D"], [7594, 1, "\u1D85"], [7595, 1, "\u029F"], [7596, 1, "\u0271"], [7597, 1, "\u0270"], [7598, 1, "\u0272"], [7599, 1, "\u0273"], [7600, 1, "\u0274"], [7601, 1, "\u0275"], [7602, 1, "\u0278"], [7603, 1, "\u0282"], [7604, 1, "\u0283"], [7605, 1, "\u01AB"], [7606, 1, "\u0289"], [7607, 1, "\u028A"], [7608, 1, "\u1D1C"], [7609, 1, "\u028B"], [7610, 1, "\u028C"], [7611, 1, "z"], [7612, 1, "\u0290"], [7613, 1, "\u0291"], [7614, 1, "\u0292"], [7615, 1, "\u03B8"], [[7616, 7619], 2], [[7620, 7626], 2], [[7627, 7654], 2], [[7655, 7669], 2], [[7670, 7673], 2], [7674, 2], [7675, 2], [7676, 2], [7677, 2], [[7678, 7679], 2], [7680, 1, "\u1E01"], [7681, 2], [7682, 1, "\u1E03"], [7683, 2], [7684, 1, "\u1E05"], [7685, 2], [7686, 1, "\u1E07"], [7687, 2], [7688, 1, "\u1E09"], [7689, 2], [7690, 1, "\u1E0B"], [7691, 2], [7692, 1, "\u1E0D"], [7693, 2], [7694, 1, "\u1E0F"], [7695, 2], [7696, 1, "\u1E11"], [7697, 2], [7698, 1, "\u1E13"], [7699, 2], [7700, 1, "\u1E15"], [7701, 2], [7702, 1, "\u1E17"], [7703, 2], [7704, 1, "\u1E19"], [7705, 2], [7706, 1, "\u1E1B"], [7707, 2], [7708, 1, "\u1E1D"], [7709, 2], [7710, 1, "\u1E1F"], [7711, 2], [7712, 1, "\u1E21"], [7713, 2], [7714, 1, "\u1E23"], [7715, 2], [7716, 1, "\u1E25"], [7717, 2], [7718, 1, "\u1E27"], [7719, 2], [7720, 1, "\u1E29"], [7721, 2], [7722, 1, "\u1E2B"], [7723, 2], [7724, 1, "\u1E2D"], [7725, 2], [7726, 1, "\u1E2F"], [7727, 2], [7728, 1, "\u1E31"], [7729, 2], [7730, 1, "\u1E33"], [7731, 2], [7732, 1, "\u1E35"], [7733, 2], [7734, 1, "\u1E37"], [7735, 2], [7736, 1, "\u1E39"], [7737, 2], [7738, 1, "\u1E3B"], [7739, 2], [7740, 1, "\u1E3D"], [7741, 2], [7742, 1, "\u1E3F"], [7743, 2], [7744, 1, "\u1E41"], [7745, 2], [7746, 1, "\u1E43"], [7747, 2], [7748, 1, "\u1E45"], [7749, 2], [7750, 1, "\u1E47"], [7751, 2], [7752, 1, "\u1E49"], [7753, 2], [7754, 1, "\u1E4B"], [7755, 2], [7756, 1, "\u1E4D"], [7757, 2], [7758, 1, "\u1E4F"], [7759, 2], [7760, 1, "\u1E51"], [7761, 2], [7762, 1, "\u1E53"], [7763, 2], [7764, 1, "\u1E55"], [7765, 2], [7766, 1, "\u1E57"], [7767, 2], [7768, 1, "\u1E59"], [7769, 2], [7770, 1, "\u1E5B"], [7771, 2], [7772, 1, "\u1E5D"], [7773, 2], [7774, 1, "\u1E5F"], [7775, 2], [7776, 1, "\u1E61"], [7777, 2], [7778, 1, "\u1E63"], [7779, 2], [7780, 1, "\u1E65"], [7781, 2], [7782, 1, "\u1E67"], [7783, 2], [7784, 1, "\u1E69"], [7785, 2], [7786, 1, "\u1E6B"], [7787, 2], [7788, 1, "\u1E6D"], [7789, 2], [7790, 1, "\u1E6F"], [7791, 2], [7792, 1, "\u1E71"], [7793, 2], [7794, 1, "\u1E73"], [7795, 2], [7796, 1, "\u1E75"], [7797, 2], [7798, 1, "\u1E77"], [7799, 2], [7800, 1, "\u1E79"], [7801, 2], [7802, 1, "\u1E7B"], [7803, 2], [7804, 1, "\u1E7D"], [7805, 2], [7806, 1, "\u1E7F"], [7807, 2], [7808, 1, "\u1E81"], [7809, 2], [7810, 1, "\u1E83"], [7811, 2], [7812, 1, "\u1E85"], [7813, 2], [7814, 1, "\u1E87"], [7815, 2], [7816, 1, "\u1E89"], [7817, 2], [7818, 1, "\u1E8B"], [7819, 2], [7820, 1, "\u1E8D"], [7821, 2], [7822, 1, "\u1E8F"], [7823, 2], [7824, 1, "\u1E91"], [7825, 2], [7826, 1, "\u1E93"], [7827, 2], [7828, 1, "\u1E95"], [[7829, 7833], 2], [7834, 1, "a\u02BE"], [7835, 1, "\u1E61"], [[7836, 7837], 2], [7838, 1, "\xDF"], [7839, 2], [7840, 1, "\u1EA1"], [7841, 2], [7842, 1, "\u1EA3"], [7843, 2], [7844, 1, "\u1EA5"], [7845, 2], [7846, 1, "\u1EA7"], [7847, 2], [7848, 1, "\u1EA9"], [7849, 2], [7850, 1, "\u1EAB"], [7851, 2], [7852, 1, "\u1EAD"], [7853, 2], [7854, 1, "\u1EAF"], [7855, 2], [7856, 1, "\u1EB1"], [7857, 2], [7858, 1, "\u1EB3"], [7859, 2], [7860, 1, "\u1EB5"], [7861, 2], [7862, 1, "\u1EB7"], [7863, 2], [7864, 1, "\u1EB9"], [7865, 2], [7866, 1, "\u1EBB"], [7867, 2], [7868, 1, "\u1EBD"], [7869, 2], [7870, 1, "\u1EBF"], [7871, 2], [7872, 1, "\u1EC1"], [7873, 2], [7874, 1, "\u1EC3"], [7875, 2], [7876, 1, "\u1EC5"], [7877, 2], [7878, 1, "\u1EC7"], [7879, 2], [7880, 1, "\u1EC9"], [7881, 2], [7882, 1, "\u1ECB"], [7883, 2], [7884, 1, "\u1ECD"], [7885, 2], [7886, 1, "\u1ECF"], [7887, 2], [7888, 1, "\u1ED1"], [7889, 2], [7890, 1, "\u1ED3"], [7891, 2], [7892, 1, "\u1ED5"], [7893, 2], [7894, 1, "\u1ED7"], [7895, 2], [7896, 1, "\u1ED9"], [7897, 2], [7898, 1, "\u1EDB"], [7899, 2], [7900, 1, "\u1EDD"], [7901, 2], [7902, 1, "\u1EDF"], [7903, 2], [7904, 1, "\u1EE1"], [7905, 2], [7906, 1, "\u1EE3"], [7907, 2], [7908, 1, "\u1EE5"], [7909, 2], [7910, 1, "\u1EE7"], [7911, 2], [7912, 1, "\u1EE9"], [7913, 2], [7914, 1, "\u1EEB"], [7915, 2], [7916, 1, "\u1EED"], [7917, 2], [7918, 1, "\u1EEF"], [7919, 2], [7920, 1, "\u1EF1"], [7921, 2], [7922, 1, "\u1EF3"], [7923, 2], [7924, 1, "\u1EF5"], [7925, 2], [7926, 1, "\u1EF7"], [7927, 2], [7928, 1, "\u1EF9"], [7929, 2], [7930, 1, "\u1EFB"], [7931, 2], [7932, 1, "\u1EFD"], [7933, 2], [7934, 1, "\u1EFF"], [7935, 2], [[7936, 7943], 2], [7944, 1, "\u1F00"], [7945, 1, "\u1F01"], [7946, 1, "\u1F02"], [7947, 1, "\u1F03"], [7948, 1, "\u1F04"], [7949, 1, "\u1F05"], [7950, 1, "\u1F06"], [7951, 1, "\u1F07"], [[7952, 7957], 2], [[7958, 7959], 3], [7960, 1, "\u1F10"], [7961, 1, "\u1F11"], [7962, 1, "\u1F12"], [7963, 1, "\u1F13"], [7964, 1, "\u1F14"], [7965, 1, "\u1F15"], [[7966, 7967], 3], [[7968, 7975], 2], [7976, 1, "\u1F20"], [7977, 1, "\u1F21"], [7978, 1, "\u1F22"], [7979, 1, "\u1F23"], [7980, 1, "\u1F24"], [7981, 1, "\u1F25"], [7982, 1, "\u1F26"], [7983, 1, "\u1F27"], [[7984, 7991], 2], [7992, 1, "\u1F30"], [7993, 1, "\u1F31"], [7994, 1, "\u1F32"], [7995, 1, "\u1F33"], [7996, 1, "\u1F34"], [7997, 1, "\u1F35"], [7998, 1, "\u1F36"], [7999, 1, "\u1F37"], [[8e3, 8005], 2], [[8006, 8007], 3], [8008, 1, "\u1F40"], [8009, 1, "\u1F41"], [8010, 1, "\u1F42"], [8011, 1, "\u1F43"], [8012, 1, "\u1F44"], [8013, 1, "\u1F45"], [[8014, 8015], 3], [[8016, 8023], 2], [8024, 3], [8025, 1, "\u1F51"], [8026, 3], [8027, 1, "\u1F53"], [8028, 3], [8029, 1, "\u1F55"], [8030, 3], [8031, 1, "\u1F57"], [[8032, 8039], 2], [8040, 1, "\u1F60"], [8041, 1, "\u1F61"], [8042, 1, "\u1F62"], [8043, 1, "\u1F63"], [8044, 1, "\u1F64"], [8045, 1, "\u1F65"], [8046, 1, "\u1F66"], [8047, 1, "\u1F67"], [8048, 2], [8049, 1, "\u03AC"], [8050, 2], [8051, 1, "\u03AD"], [8052, 2], [8053, 1, "\u03AE"], [8054, 2], [8055, 1, "\u03AF"], [8056, 2], [8057, 1, "\u03CC"], [8058, 2], [8059, 1, "\u03CD"], [8060, 2], [8061, 1, "\u03CE"], [[8062, 8063], 3], [8064, 1, "\u1F00\u03B9"], [8065, 1, "\u1F01\u03B9"], [8066, 1, "\u1F02\u03B9"], [8067, 1, "\u1F03\u03B9"], [8068, 1, "\u1F04\u03B9"], [8069, 1, "\u1F05\u03B9"], [8070, 1, "\u1F06\u03B9"], [8071, 1, "\u1F07\u03B9"], [8072, 1, "\u1F00\u03B9"], [8073, 1, "\u1F01\u03B9"], [8074, 1, "\u1F02\u03B9"], [8075, 1, "\u1F03\u03B9"], [8076, 1, "\u1F04\u03B9"], [8077, 1, "\u1F05\u03B9"], [8078, 1, "\u1F06\u03B9"], [8079, 1, "\u1F07\u03B9"], [8080, 1, "\u1F20\u03B9"], [8081, 1, "\u1F21\u03B9"], [8082, 1, "\u1F22\u03B9"], [8083, 1, "\u1F23\u03B9"], [8084, 1, "\u1F24\u03B9"], [8085, 1, "\u1F25\u03B9"], [8086, 1, "\u1F26\u03B9"], [8087, 1, "\u1F27\u03B9"], [8088, 1, "\u1F20\u03B9"], [8089, 1, "\u1F21\u03B9"], [8090, 1, "\u1F22\u03B9"], [8091, 1, "\u1F23\u03B9"], [8092, 1, "\u1F24\u03B9"], [8093, 1, "\u1F25\u03B9"], [8094, 1, "\u1F26\u03B9"], [8095, 1, "\u1F27\u03B9"], [8096, 1, "\u1F60\u03B9"], [8097, 1, "\u1F61\u03B9"], [8098, 1, "\u1F62\u03B9"], [8099, 1, "\u1F63\u03B9"], [8100, 1, "\u1F64\u03B9"], [8101, 1, "\u1F65\u03B9"], [8102, 1, "\u1F66\u03B9"], [8103, 1, "\u1F67\u03B9"], [8104, 1, "\u1F60\u03B9"], [8105, 1, "\u1F61\u03B9"], [8106, 1, "\u1F62\u03B9"], [8107, 1, "\u1F63\u03B9"], [8108, 1, "\u1F64\u03B9"], [8109, 1, "\u1F65\u03B9"], [8110, 1, "\u1F66\u03B9"], [8111, 1, "\u1F67\u03B9"], [[8112, 8113], 2], [8114, 1, "\u1F70\u03B9"], [8115, 1, "\u03B1\u03B9"], [8116, 1, "\u03AC\u03B9"], [8117, 3], [8118, 2], [8119, 1, "\u1FB6\u03B9"], [8120, 1, "\u1FB0"], [8121, 1, "\u1FB1"], [8122, 1, "\u1F70"], [8123, 1, "\u03AC"], [8124, 1, "\u03B1\u03B9"], [8125, 1, " \u0313"], [8126, 1, "\u03B9"], [8127, 1, " \u0313"], [8128, 1, " \u0342"], [8129, 1, " \u0308\u0342"], [8130, 1, "\u1F74\u03B9"], [8131, 1, "\u03B7\u03B9"], [8132, 1, "\u03AE\u03B9"], [8133, 3], [8134, 2], [8135, 1, "\u1FC6\u03B9"], [8136, 1, "\u1F72"], [8137, 1, "\u03AD"], [8138, 1, "\u1F74"], [8139, 1, "\u03AE"], [8140, 1, "\u03B7\u03B9"], [8141, 1, " \u0313\u0300"], [8142, 1, " \u0313\u0301"], [8143, 1, " \u0313\u0342"], [[8144, 8146], 2], [8147, 1, "\u0390"], [[8148, 8149], 3], [[8150, 8151], 2], [8152, 1, "\u1FD0"], [8153, 1, "\u1FD1"], [8154, 1, "\u1F76"], [8155, 1, "\u03AF"], [8156, 3], [8157, 1, " \u0314\u0300"], [8158, 1, " \u0314\u0301"], [8159, 1, " \u0314\u0342"], [[8160, 8162], 2], [8163, 1, "\u03B0"], [[8164, 8167], 2], [8168, 1, "\u1FE0"], [8169, 1, "\u1FE1"], [8170, 1, "\u1F7A"], [8171, 1, "\u03CD"], [8172, 1, "\u1FE5"], [8173, 1, " \u0308\u0300"], [8174, 1, " \u0308\u0301"], [8175, 1, "`"], [[8176, 8177], 3], [8178, 1, "\u1F7C\u03B9"], [8179, 1, "\u03C9\u03B9"], [8180, 1, "\u03CE\u03B9"], [8181, 3], [8182, 2], [8183, 1, "\u1FF6\u03B9"], [8184, 1, "\u1F78"], [8185, 1, "\u03CC"], [8186, 1, "\u1F7C"], [8187, 1, "\u03CE"], [8188, 1, "\u03C9\u03B9"], [8189, 1, " \u0301"], [8190, 1, " \u0314"], [8191, 3], [[8192, 8202], 1, " "], [8203, 7], [[8204, 8205], 6, ""], [[8206, 8207], 3], [8208, 2], [8209, 1, "\u2010"], [[8210, 8214], 2], [8215, 1, " \u0333"], [[8216, 8227], 2], [[8228, 8230], 3], [8231, 2], [[8232, 8238], 3], [8239, 1, " "], [[8240, 8242], 2], [8243, 1, "\u2032\u2032"], [8244, 1, "\u2032\u2032\u2032"], [8245, 2], [8246, 1, "\u2035\u2035"], [8247, 1, "\u2035\u2035\u2035"], [[8248, 8251], 2], [8252, 1, "!!"], [8253, 2], [8254, 1, " \u0305"], [[8255, 8262], 2], [8263, 1, "??"], [8264, 1, "?!"], [8265, 1, "!?"], [[8266, 8269], 2], [[8270, 8274], 2], [[8275, 8276], 2], [[8277, 8278], 2], [8279, 1, "\u2032\u2032\u2032\u2032"], [[8280, 8286], 2], [8287, 1, " "], [[8288, 8291], 7], [8292, 7], [8293, 3], [[8294, 8297], 3], [[8298, 8303], 7], [8304, 1, "0"], [8305, 1, "i"], [[8306, 8307], 3], [8308, 1, "4"], [8309, 1, "5"], [8310, 1, "6"], [8311, 1, "7"], [8312, 1, "8"], [8313, 1, "9"], [8314, 1, "+"], [8315, 1, "\u2212"], [8316, 1, "="], [8317, 1, "("], [8318, 1, ")"], [8319, 1, "n"], [8320, 1, "0"], [8321, 1, "1"], [8322, 1, "2"], [8323, 1, "3"], [8324, 1, "4"], [8325, 1, "5"], [8326, 1, "6"], [8327, 1, "7"], [8328, 1, "8"], [8329, 1, "9"], [8330, 1, "+"], [8331, 1, "\u2212"], [8332, 1, "="], [8333, 1, "("], [8334, 1, ")"], [8335, 3], [8336, 1, "a"], [8337, 1, "e"], [8338, 1, "o"], [8339, 1, "x"], [8340, 1, "\u0259"], [8341, 1, "h"], [8342, 1, "k"], [8343, 1, "l"], [8344, 1, "m"], [8345, 1, "n"], [8346, 1, "p"], [8347, 1, "s"], [8348, 1, "t"], [[8349, 8351], 3], [[8352, 8359], 2], [8360, 1, "rs"], [[8361, 8362], 2], [8363, 2], [8364, 2], [[8365, 8367], 2], [[8368, 8369], 2], [[8370, 8373], 2], [[8374, 8376], 2], [8377, 2], [8378, 2], [[8379, 8381], 2], [8382, 2], [8383, 2], [8384, 2], [[8385, 8399], 3], [[8400, 8417], 2], [[8418, 8419], 2], [[8420, 8426], 2], [8427, 2], [[8428, 8431], 2], [8432, 2], [[8433, 8447], 3], [8448, 1, "a/c"], [8449, 1, "a/s"], [8450, 1, "c"], [8451, 1, "\xB0c"], [8452, 2], [8453, 1, "c/o"], [8454, 1, "c/u"], [8455, 1, "\u025B"], [8456, 2], [8457, 1, "\xB0f"], [8458, 1, "g"], [[8459, 8462], 1, "h"], [8463, 1, "\u0127"], [[8464, 8465], 1, "i"], [[8466, 8467], 1, "l"], [8468, 2], [8469, 1, "n"], [8470, 1, "no"], [[8471, 8472], 2], [8473, 1, "p"], [8474, 1, "q"], [[8475, 8477], 1, "r"], [[8478, 8479], 2], [8480, 1, "sm"], [8481, 1, "tel"], [8482, 1, "tm"], [8483, 2], [8484, 1, "z"], [8485, 2], [8486, 1, "\u03C9"], [8487, 2], [8488, 1, "z"], [8489, 2], [8490, 1, "k"], [8491, 1, "\xE5"], [8492, 1, "b"], [8493, 1, "c"], [8494, 2], [[8495, 8496], 1, "e"], [8497, 1, "f"], [8498, 1, "\u214E"], [8499, 1, "m"], [8500, 1, "o"], [8501, 1, "\u05D0"], [8502, 1, "\u05D1"], [8503, 1, "\u05D2"], [8504, 1, "\u05D3"], [8505, 1, "i"], [8506, 2], [8507, 1, "fax"], [8508, 1, "\u03C0"], [[8509, 8510], 1, "\u03B3"], [8511, 1, "\u03C0"], [8512, 1, "\u2211"], [[8513, 8516], 2], [[8517, 8518], 1, "d"], [8519, 1, "e"], [8520, 1, "i"], [8521, 1, "j"], [[8522, 8523], 2], [8524, 2], [8525, 2], [8526, 2], [8527, 2], [8528, 1, "1\u20447"], [8529, 1, "1\u20449"], [8530, 1, "1\u204410"], [8531, 1, "1\u20443"], [8532, 1, "2\u20443"], [8533, 1, "1\u20445"], [8534, 1, "2\u20445"], [8535, 1, "3\u20445"], [8536, 1, "4\u20445"], [8537, 1, "1\u20446"], [8538, 1, "5\u20446"], [8539, 1, "1\u20448"], [8540, 1, "3\u20448"], [8541, 1, "5\u20448"], [8542, 1, "7\u20448"], [8543, 1, "1\u2044"], [8544, 1, "i"], [8545, 1, "ii"], [8546, 1, "iii"], [8547, 1, "iv"], [8548, 1, "v"], [8549, 1, "vi"], [8550, 1, "vii"], [8551, 1, "viii"], [8552, 1, "ix"], [8553, 1, "x"], [8554, 1, "xi"], [8555, 1, "xii"], [8556, 1, "l"], [8557, 1, "c"], [8558, 1, "d"], [8559, 1, "m"], [8560, 1, "i"], [8561, 1, "ii"], [8562, 1, "iii"], [8563, 1, "iv"], [8564, 1, "v"], [8565, 1, "vi"], [8566, 1, "vii"], [8567, 1, "viii"], [8568, 1, "ix"], [8569, 1, "x"], [8570, 1, "xi"], [8571, 1, "xii"], [8572, 1, "l"], [8573, 1, "c"], [8574, 1, "d"], [8575, 1, "m"], [[8576, 8578], 2], [8579, 1, "\u2184"], [8580, 2], [[8581, 8584], 2], [8585, 1, "0\u20443"], [[8586, 8587], 2], [[8588, 8591], 3], [[8592, 8682], 2], [[8683, 8691], 2], [[8692, 8703], 2], [[8704, 8747], 2], [8748, 1, "\u222B\u222B"], [8749, 1, "\u222B\u222B\u222B"], [8750, 2], [8751, 1, "\u222E\u222E"], [8752, 1, "\u222E\u222E\u222E"], [[8753, 8945], 2], [[8946, 8959], 2], [8960, 2], [8961, 2], [[8962, 9e3], 2], [9001, 1, "\u3008"], [9002, 1, "\u3009"], [[9003, 9082], 2], [9083, 2], [9084, 2], [[9085, 9114], 2], [[9115, 9166], 2], [[9167, 9168], 2], [[9169, 9179], 2], [[9180, 9191], 2], [9192, 2], [[9193, 9203], 2], [[9204, 9210], 2], [[9211, 9214], 2], [9215, 2], [[9216, 9252], 2], [[9253, 9254], 2], [[9255, 9257], 2], [[9258, 9279], 3], [[9280, 9290], 2], [[9291, 9311], 3], [9312, 1, "1"], [9313, 1, "2"], [9314, 1, "3"], [9315, 1, "4"], [9316, 1, "5"], [9317, 1, "6"], [9318, 1, "7"], [9319, 1, "8"], [9320, 1, "9"], [9321, 1, "10"], [9322, 1, "11"], [9323, 1, "12"], [9324, 1, "13"], [9325, 1, "14"], [9326, 1, "15"], [9327, 1, "16"], [9328, 1, "17"], [9329, 1, "18"], [9330, 1, "19"], [9331, 1, "20"], [9332, 1, "(1)"], [9333, 1, "(2)"], [9334, 1, "(3)"], [9335, 1, "(4)"], [9336, 1, "(5)"], [9337, 1, "(6)"], [9338, 1, "(7)"], [9339, 1, "(8)"], [9340, 1, "(9)"], [9341, 1, "(10)"], [9342, 1, "(11)"], [9343, 1, "(12)"], [9344, 1, "(13)"], [9345, 1, "(14)"], [9346, 1, "(15)"], [9347, 1, "(16)"], [9348, 1, "(17)"], [9349, 1, "(18)"], [9350, 1, "(19)"], [9351, 1, "(20)"], [[9352, 9371], 3], [9372, 1, "(a)"], [9373, 1, "(b)"], [9374, 1, "(c)"], [9375, 1, "(d)"], [9376, 1, "(e)"], [9377, 1, "(f)"], [9378, 1, "(g)"], [9379, 1, "(h)"], [9380, 1, "(i)"], [9381, 1, "(j)"], [9382, 1, "(k)"], [9383, 1, "(l)"], [9384, 1, "(m)"], [9385, 1, "(n)"], [9386, 1, "(o)"], [9387, 1, "(p)"], [9388, 1, "(q)"], [9389, 1, "(r)"], [9390, 1, "(s)"], [9391, 1, "(t)"], [9392, 1, "(u)"], [9393, 1, "(v)"], [9394, 1, "(w)"], [9395, 1, "(x)"], [9396, 1, "(y)"], [9397, 1, "(z)"], [9398, 1, "a"], [9399, 1, "b"], [9400, 1, "c"], [9401, 1, "d"], [9402, 1, "e"], [9403, 1, "f"], [9404, 1, "g"], [9405, 1, "h"], [9406, 1, "i"], [9407, 1, "j"], [9408, 1, "k"], [9409, 1, "l"], [9410, 1, "m"], [9411, 1, "n"], [9412, 1, "o"], [9413, 1, "p"], [9414, 1, "q"], [9415, 1, "r"], [9416, 1, "s"], [9417, 1, "t"], [9418, 1, "u"], [9419, 1, "v"], [9420, 1, "w"], [9421, 1, "x"], [9422, 1, "y"], [9423, 1, "z"], [9424, 1, "a"], [9425, 1, "b"], [9426, 1, "c"], [9427, 1, "d"], [9428, 1, "e"], [9429, 1, "f"], [9430, 1, "g"], [9431, 1, "h"], [9432, 1, "i"], [9433, 1, "j"], [9434, 1, "k"], [9435, 1, "l"], [9436, 1, "m"], [9437, 1, "n"], [9438, 1, "o"], [9439, 1, "p"], [9440, 1, "q"], [9441, 1, "r"], [9442, 1, "s"], [9443, 1, "t"], [9444, 1, "u"], [9445, 1, "v"], [9446, 1, "w"], [9447, 1, "x"], [9448, 1, "y"], [9449, 1, "z"], [9450, 1, "0"], [[9451, 9470], 2], [9471, 2], [[9472, 9621], 2], [[9622, 9631], 2], [[9632, 9711], 2], [[9712, 9719], 2], [[9720, 9727], 2], [[9728, 9747], 2], [[9748, 9749], 2], [[9750, 9751], 2], [9752, 2], [9753, 2], [[9754, 9839], 2], [[9840, 9841], 2], [[9842, 9853], 2], [[9854, 9855], 2], [[9856, 9865], 2], [[9866, 9873], 2], [[9874, 9884], 2], [9885, 2], [[9886, 9887], 2], [[9888, 9889], 2], [[9890, 9905], 2], [9906, 2], [[9907, 9916], 2], [[9917, 9919], 2], [[9920, 9923], 2], [[9924, 9933], 2], [9934, 2], [[9935, 9953], 2], [9954, 2], [9955, 2], [[9956, 9959], 2], [[9960, 9983], 2], [9984, 2], [[9985, 9988], 2], [9989, 2], [[9990, 9993], 2], [[9994, 9995], 2], [[9996, 10023], 2], [10024, 2], [[10025, 10059], 2], [10060, 2], [10061, 2], [10062, 2], [[10063, 10066], 2], [[10067, 10069], 2], [10070, 2], [10071, 2], [[10072, 10078], 2], [[10079, 10080], 2], [[10081, 10087], 2], [[10088, 10101], 2], [[10102, 10132], 2], [[10133, 10135], 2], [[10136, 10159], 2], [10160, 2], [[10161, 10174], 2], [10175, 2], [[10176, 10182], 2], [[10183, 10186], 2], [10187, 2], [10188, 2], [10189, 2], [[10190, 10191], 2], [[10192, 10219], 2], [[10220, 10223], 2], [[10224, 10239], 2], [[10240, 10495], 2], [[10496, 10763], 2], [10764, 1, "\u222B\u222B\u222B\u222B"], [[10765, 10867], 2], [10868, 1, "::="], [10869, 1, "=="], [10870, 1, "==="], [[10871, 10971], 2], [10972, 1, "\u2ADD\u0338"], [[10973, 11007], 2], [[11008, 11021], 2], [[11022, 11027], 2], [[11028, 11034], 2], [[11035, 11039], 2], [[11040, 11043], 2], [[11044, 11084], 2], [[11085, 11087], 2], [[11088, 11092], 2], [[11093, 11097], 2], [[11098, 11123], 2], [[11124, 11125], 3], [[11126, 11157], 2], [11158, 3], [11159, 2], [[11160, 11193], 2], [[11194, 11196], 2], [[11197, 11208], 2], [11209, 2], [[11210, 11217], 2], [11218, 2], [[11219, 11243], 2], [[11244, 11247], 2], [[11248, 11262], 2], [11263, 2], [11264, 1, "\u2C30"], [11265, 1, "\u2C31"], [11266, 1, "\u2C32"], [11267, 1, "\u2C33"], [11268, 1, "\u2C34"], [11269, 1, "\u2C35"], [11270, 1, "\u2C36"], [11271, 1, "\u2C37"], [11272, 1, "\u2C38"], [11273, 1, "\u2C39"], [11274, 1, "\u2C3A"], [11275, 1, "\u2C3B"], [11276, 1, "\u2C3C"], [11277, 1, "\u2C3D"], [11278, 1, "\u2C3E"], [11279, 1, "\u2C3F"], [11280, 1, "\u2C40"], [11281, 1, "\u2C41"], [11282, 1, "\u2C42"], [11283, 1, "\u2C43"], [11284, 1, "\u2C44"], [11285, 1, "\u2C45"], [11286, 1, "\u2C46"], [11287, 1, "\u2C47"], [11288, 1, "\u2C48"], [11289, 1, "\u2C49"], [11290, 1, "\u2C4A"], [11291, 1, "\u2C4B"], [11292, 1, "\u2C4C"], [11293, 1, "\u2C4D"], [11294, 1, "\u2C4E"], [11295, 1, "\u2C4F"], [11296, 1, "\u2C50"], [11297, 1, "\u2C51"], [11298, 1, "\u2C52"], [11299, 1, "\u2C53"], [11300, 1, "\u2C54"], [11301, 1, "\u2C55"], [11302, 1, "\u2C56"], [11303, 1, "\u2C57"], [11304, 1, "\u2C58"], [11305, 1, "\u2C59"], [11306, 1, "\u2C5A"], [11307, 1, "\u2C5B"], [11308, 1, "\u2C5C"], [11309, 1, "\u2C5D"], [11310, 1, "\u2C5E"], [11311, 1, "\u2C5F"], [[11312, 11358], 2], [11359, 2], [11360, 1, "\u2C61"], [11361, 2], [11362, 1, "\u026B"], [11363, 1, "\u1D7D"], [11364, 1, "\u027D"], [[11365, 11366], 2], [11367, 1, "\u2C68"], [11368, 2], [11369, 1, "\u2C6A"], [11370, 2], [11371, 1, "\u2C6C"], [11372, 2], [11373, 1, "\u0251"], [11374, 1, "\u0271"], [11375, 1, "\u0250"], [11376, 1, "\u0252"], [11377, 2], [11378, 1, "\u2C73"], [11379, 2], [11380, 2], [11381, 1, "\u2C76"], [[11382, 11383], 2], [[11384, 11387], 2], [11388, 1, "j"], [11389, 1, "v"], [11390, 1, "\u023F"], [11391, 1, "\u0240"], [11392, 1, "\u2C81"], [11393, 2], [11394, 1, "\u2C83"], [11395, 2], [11396, 1, "\u2C85"], [11397, 2], [11398, 1, "\u2C87"], [11399, 2], [11400, 1, "\u2C89"], [11401, 2], [11402, 1, "\u2C8B"], [11403, 2], [11404, 1, "\u2C8D"], [11405, 2], [11406, 1, "\u2C8F"], [11407, 2], [11408, 1, "\u2C91"], [11409, 2], [11410, 1, "\u2C93"], [11411, 2], [11412, 1, "\u2C95"], [11413, 2], [11414, 1, "\u2C97"], [11415, 2], [11416, 1, "\u2C99"], [11417, 2], [11418, 1, "\u2C9B"], [11419, 2], [11420, 1, "\u2C9D"], [11421, 2], [11422, 1, "\u2C9F"], [11423, 2], [11424, 1, "\u2CA1"], [11425, 2], [11426, 1, "\u2CA3"], [11427, 2], [11428, 1, "\u2CA5"], [11429, 2], [11430, 1, "\u2CA7"], [11431, 2], [11432, 1, "\u2CA9"], [11433, 2], [11434, 1, "\u2CAB"], [11435, 2], [11436, 1, "\u2CAD"], [11437, 2], [11438, 1, "\u2CAF"], [11439, 2], [11440, 1, "\u2CB1"], [11441, 2], [11442, 1, "\u2CB3"], [11443, 2], [11444, 1, "\u2CB5"], [11445, 2], [11446, 1, "\u2CB7"], [11447, 2], [11448, 1, "\u2CB9"], [11449, 2], [11450, 1, "\u2CBB"], [11451, 2], [11452, 1, "\u2CBD"], [11453, 2], [11454, 1, "\u2CBF"], [11455, 2], [11456, 1, "\u2CC1"], [11457, 2], [11458, 1, "\u2CC3"], [11459, 2], [11460, 1, "\u2CC5"], [11461, 2], [11462, 1, "\u2CC7"], [11463, 2], [11464, 1, "\u2CC9"], [11465, 2], [11466, 1, "\u2CCB"], [11467, 2], [11468, 1, "\u2CCD"], [11469, 2], [11470, 1, "\u2CCF"], [11471, 2], [11472, 1, "\u2CD1"], [11473, 2], [11474, 1, "\u2CD3"], [11475, 2], [11476, 1, "\u2CD5"], [11477, 2], [11478, 1, "\u2CD7"], [11479, 2], [11480, 1, "\u2CD9"], [11481, 2], [11482, 1, "\u2CDB"], [11483, 2], [11484, 1, "\u2CDD"], [11485, 2], [11486, 1, "\u2CDF"], [11487, 2], [11488, 1, "\u2CE1"], [11489, 2], [11490, 1, "\u2CE3"], [[11491, 11492], 2], [[11493, 11498], 2], [11499, 1, "\u2CEC"], [11500, 2], [11501, 1, "\u2CEE"], [[11502, 11505], 2], [11506, 1, "\u2CF3"], [11507, 2], [[11508, 11512], 3], [[11513, 11519], 2], [[11520, 11557], 2], [11558, 3], [11559, 2], [[11560, 11564], 3], [11565, 2], [[11566, 11567], 3], [[11568, 11621], 2], [[11622, 11623], 2], [[11624, 11630], 3], [11631, 1, "\u2D61"], [11632, 2], [[11633, 11646], 3], [11647, 2], [[11648, 11670], 2], [[11671, 11679], 3], [[11680, 11686], 2], [11687, 3], [[11688, 11694], 2], [11695, 3], [[11696, 11702], 2], [11703, 3], [[11704, 11710], 2], [11711, 3], [[11712, 11718], 2], [11719, 3], [[11720, 11726], 2], [11727, 3], [[11728, 11734], 2], [11735, 3], [[11736, 11742], 2], [11743, 3], [[11744, 11775], 2], [[11776, 11799], 2], [[11800, 11803], 2], [[11804, 11805], 2], [[11806, 11822], 2], [11823, 2], [11824, 2], [11825, 2], [[11826, 11835], 2], [[11836, 11842], 2], [[11843, 11844], 2], [[11845, 11849], 2], [[11850, 11854], 2], [11855, 2], [[11856, 11858], 2], [[11859, 11869], 2], [[11870, 11903], 3], [[11904, 11929], 2], [11930, 3], [[11931, 11934], 2], [11935, 1, "\u6BCD"], [[11936, 12018], 2], [12019, 1, "\u9F9F"], [[12020, 12031], 3], [12032, 1, "\u4E00"], [12033, 1, "\u4E28"], [12034, 1, "\u4E36"], [12035, 1, "\u4E3F"], [12036, 1, "\u4E59"], [12037, 1, "\u4E85"], [12038, 1, "\u4E8C"], [12039, 1, "\u4EA0"], [12040, 1, "\u4EBA"], [12041, 1, "\u513F"], [12042, 1, "\u5165"], [12043, 1, "\u516B"], [12044, 1, "\u5182"], [12045, 1, "\u5196"], [12046, 1, "\u51AB"], [12047, 1, "\u51E0"], [12048, 1, "\u51F5"], [12049, 1, "\u5200"], [12050, 1, "\u529B"], [12051, 1, "\u52F9"], [12052, 1, "\u5315"], [12053, 1, "\u531A"], [12054, 1, "\u5338"], [12055, 1, "\u5341"], [12056, 1, "\u535C"], [12057, 1, "\u5369"], [12058, 1, "\u5382"], [12059, 1, "\u53B6"], [12060, 1, "\u53C8"], [12061, 1, "\u53E3"], [12062, 1, "\u56D7"], [12063, 1, "\u571F"], [12064, 1, "\u58EB"], [12065, 1, "\u5902"], [12066, 1, "\u590A"], [12067, 1, "\u5915"], [12068, 1, "\u5927"], [12069, 1, "\u5973"], [12070, 1, "\u5B50"], [12071, 1, "\u5B80"], [12072, 1, "\u5BF8"], [12073, 1, "\u5C0F"], [12074, 1, "\u5C22"], [12075, 1, "\u5C38"], [12076, 1, "\u5C6E"], [12077, 1, "\u5C71"], [12078, 1, "\u5DDB"], [12079, 1, "\u5DE5"], [12080, 1, "\u5DF1"], [12081, 1, "\u5DFE"], [12082, 1, "\u5E72"], [12083, 1, "\u5E7A"], [12084, 1, "\u5E7F"], [12085, 1, "\u5EF4"], [12086, 1, "\u5EFE"], [12087, 1, "\u5F0B"], [12088, 1, "\u5F13"], [12089, 1, "\u5F50"], [12090, 1, "\u5F61"], [12091, 1, "\u5F73"], [12092, 1, "\u5FC3"], [12093, 1, "\u6208"], [12094, 1, "\u6236"], [12095, 1, "\u624B"], [12096, 1, "\u652F"], [12097, 1, "\u6534"], [12098, 1, "\u6587"], [12099, 1, "\u6597"], [12100, 1, "\u65A4"], [12101, 1, "\u65B9"], [12102, 1, "\u65E0"], [12103, 1, "\u65E5"], [12104, 1, "\u66F0"], [12105, 1, "\u6708"], [12106, 1, "\u6728"], [12107, 1, "\u6B20"], [12108, 1, "\u6B62"], [12109, 1, "\u6B79"], [12110, 1, "\u6BB3"], [12111, 1, "\u6BCB"], [12112, 1, "\u6BD4"], [12113, 1, "\u6BDB"], [12114, 1, "\u6C0F"], [12115, 1, "\u6C14"], [12116, 1, "\u6C34"], [12117, 1, "\u706B"], [12118, 1, "\u722A"], [12119, 1, "\u7236"], [12120, 1, "\u723B"], [12121, 1, "\u723F"], [12122, 1, "\u7247"], [12123, 1, "\u7259"], [12124, 1, "\u725B"], [12125, 1, "\u72AC"], [12126, 1, "\u7384"], [12127, 1, "\u7389"], [12128, 1, "\u74DC"], [12129, 1, "\u74E6"], [12130, 1, "\u7518"], [12131, 1, "\u751F"], [12132, 1, "\u7528"], [12133, 1, "\u7530"], [12134, 1, "\u758B"], [12135, 1, "\u7592"], [12136, 1, "\u7676"], [12137, 1, "\u767D"], [12138, 1, "\u76AE"], [12139, 1, "\u76BF"], [12140, 1, "\u76EE"], [12141, 1, "\u77DB"], [12142, 1, "\u77E2"], [12143, 1, "\u77F3"], [12144, 1, "\u793A"], [12145, 1, "\u79B8"], [12146, 1, "\u79BE"], [12147, 1, "\u7A74"], [12148, 1, "\u7ACB"], [12149, 1, "\u7AF9"], [12150, 1, "\u7C73"], [12151, 1, "\u7CF8"], [12152, 1, "\u7F36"], [12153, 1, "\u7F51"], [12154, 1, "\u7F8A"], [12155, 1, "\u7FBD"], [12156, 1, "\u8001"], [12157, 1, "\u800C"], [12158, 1, "\u8012"], [12159, 1, "\u8033"], [12160, 1, "\u807F"], [12161, 1, "\u8089"], [12162, 1, "\u81E3"], [12163, 1, "\u81EA"], [12164, 1, "\u81F3"], [12165, 1, "\u81FC"], [12166, 1, "\u820C"], [12167, 1, "\u821B"], [12168, 1, "\u821F"], [12169, 1, "\u826E"], [12170, 1, "\u8272"], [12171, 1, "\u8278"], [12172, 1, "\u864D"], [12173, 1, "\u866B"], [12174, 1, "\u8840"], [12175, 1, "\u884C"], [12176, 1, "\u8863"], [12177, 1, "\u897E"], [12178, 1, "\u898B"], [12179, 1, "\u89D2"], [12180, 1, "\u8A00"], [12181, 1, "\u8C37"], [12182, 1, "\u8C46"], [12183, 1, "\u8C55"], [12184, 1, "\u8C78"], [12185, 1, "\u8C9D"], [12186, 1, "\u8D64"], [12187, 1, "\u8D70"], [12188, 1, "\u8DB3"], [12189, 1, "\u8EAB"], [12190, 1, "\u8ECA"], [12191, 1, "\u8F9B"], [12192, 1, "\u8FB0"], [12193, 1, "\u8FB5"], [12194, 1, "\u9091"], [12195, 1, "\u9149"], [12196, 1, "\u91C6"], [12197, 1, "\u91CC"], [12198, 1, "\u91D1"], [12199, 1, "\u9577"], [12200, 1, "\u9580"], [12201, 1, "\u961C"], [12202, 1, "\u96B6"], [12203, 1, "\u96B9"], [12204, 1, "\u96E8"], [12205, 1, "\u9751"], [12206, 1, "\u975E"], [12207, 1, "\u9762"], [12208, 1, "\u9769"], [12209, 1, "\u97CB"], [12210, 1, "\u97ED"], [12211, 1, "\u97F3"], [12212, 1, "\u9801"], [12213, 1, "\u98A8"], [12214, 1, "\u98DB"], [12215, 1, "\u98DF"], [12216, 1, "\u9996"], [12217, 1, "\u9999"], [12218, 1, "\u99AC"], [12219, 1, "\u9AA8"], [12220, 1, "\u9AD8"], [12221, 1, "\u9ADF"], [12222, 1, "\u9B25"], [12223, 1, "\u9B2F"], [12224, 1, "\u9B32"], [12225, 1, "\u9B3C"], [12226, 1, "\u9B5A"], [12227, 1, "\u9CE5"], [12228, 1, "\u9E75"], [12229, 1, "\u9E7F"], [12230, 1, "\u9EA5"], [12231, 1, "\u9EBB"], [12232, 1, "\u9EC3"], [12233, 1, "\u9ECD"], [12234, 1, "\u9ED1"], [12235, 1, "\u9EF9"], [12236, 1, "\u9EFD"], [12237, 1, "\u9F0E"], [12238, 1, "\u9F13"], [12239, 1, "\u9F20"], [12240, 1, "\u9F3B"], [12241, 1, "\u9F4A"], [12242, 1, "\u9F52"], [12243, 1, "\u9F8D"], [12244, 1, "\u9F9C"], [12245, 1, "\u9FA0"], [[12246, 12271], 3], [[12272, 12283], 3], [[12284, 12287], 3], [12288, 1, " "], [12289, 2], [12290, 1, "."], [[12291, 12292], 2], [[12293, 12295], 2], [[12296, 12329], 2], [[12330, 12333], 2], [[12334, 12341], 2], [12342, 1, "\u3012"], [12343, 2], [12344, 1, "\u5341"], [12345, 1, "\u5344"], [12346, 1, "\u5345"], [12347, 2], [12348, 2], [12349, 2], [12350, 2], [12351, 2], [12352, 3], [[12353, 12436], 2], [[12437, 12438], 2], [[12439, 12440], 3], [[12441, 12442], 2], [12443, 1, " \u3099"], [12444, 1, " \u309A"], [[12445, 12446], 2], [12447, 1, "\u3088\u308A"], [12448, 2], [[12449, 12542], 2], [12543, 1, "\u30B3\u30C8"], [[12544, 12548], 3], [[12549, 12588], 2], [12589, 2], [12590, 2], [12591, 2], [12592, 3], [12593, 1, "\u1100"], [12594, 1, "\u1101"], [12595, 1, "\u11AA"], [12596, 1, "\u1102"], [12597, 1, "\u11AC"], [12598, 1, "\u11AD"], [12599, 1, "\u1103"], [12600, 1, "\u1104"], [12601, 1, "\u1105"], [12602, 1, "\u11B0"], [12603, 1, "\u11B1"], [12604, 1, "\u11B2"], [12605, 1, "\u11B3"], [12606, 1, "\u11B4"], [12607, 1, "\u11B5"], [12608, 1, "\u111A"], [12609, 1, "\u1106"], [12610, 1, "\u1107"], [12611, 1, "\u1108"], [12612, 1, "\u1121"], [12613, 1, "\u1109"], [12614, 1, "\u110A"], [12615, 1, "\u110B"], [12616, 1, "\u110C"], [12617, 1, "\u110D"], [12618, 1, "\u110E"], [12619, 1, "\u110F"], [12620, 1, "\u1110"], [12621, 1, "\u1111"], [12622, 1, "\u1112"], [12623, 1, "\u1161"], [12624, 1, "\u1162"], [12625, 1, "\u1163"], [12626, 1, "\u1164"], [12627, 1, "\u1165"], [12628, 1, "\u1166"], [12629, 1, "\u1167"], [12630, 1, "\u1168"], [12631, 1, "\u1169"], [12632, 1, "\u116A"], [12633, 1, "\u116B"], [12634, 1, "\u116C"], [12635, 1, "\u116D"], [12636, 1, "\u116E"], [12637, 1, "\u116F"], [12638, 1, "\u1170"], [12639, 1, "\u1171"], [12640, 1, "\u1172"], [12641, 1, "\u1173"], [12642, 1, "\u1174"], [12643, 1, "\u1175"], [12644, 7], [12645, 1, "\u1114"], [12646, 1, "\u1115"], [12647, 1, "\u11C7"], [12648, 1, "\u11C8"], [12649, 1, "\u11CC"], [12650, 1, "\u11CE"], [12651, 1, "\u11D3"], [12652, 1, "\u11D7"], [12653, 1, "\u11D9"], [12654, 1, "\u111C"], [12655, 1, "\u11DD"], [12656, 1, "\u11DF"], [12657, 1, "\u111D"], [12658, 1, "\u111E"], [12659, 1, "\u1120"], [12660, 1, "\u1122"], [12661, 1, "\u1123"], [12662, 1, "\u1127"], [12663, 1, "\u1129"], [12664, 1, "\u112B"], [12665, 1, "\u112C"], [12666, 1, "\u112D"], [12667, 1, "\u112E"], [12668, 1, "\u112F"], [12669, 1, "\u1132"], [12670, 1, "\u1136"], [12671, 1, "\u1140"], [12672, 1, "\u1147"], [12673, 1, "\u114C"], [12674, 1, "\u11F1"], [12675, 1, "\u11F2"], [12676, 1, "\u1157"], [12677, 1, "\u1158"], [12678, 1, "\u1159"], [12679, 1, "\u1184"], [12680, 1, "\u1185"], [12681, 1, "\u1188"], [12682, 1, "\u1191"], [12683, 1, "\u1192"], [12684, 1, "\u1194"], [12685, 1, "\u119E"], [12686, 1, "\u11A1"], [12687, 3], [[12688, 12689], 2], [12690, 1, "\u4E00"], [12691, 1, "\u4E8C"], [12692, 1, "\u4E09"], [12693, 1, "\u56DB"], [12694, 1, "\u4E0A"], [12695, 1, "\u4E2D"], [12696, 1, "\u4E0B"], [12697, 1, "\u7532"], [12698, 1, "\u4E59"], [12699, 1, "\u4E19"], [12700, 1, "\u4E01"], [12701, 1, "\u5929"], [12702, 1, "\u5730"], [12703, 1, "\u4EBA"], [[12704, 12727], 2], [[12728, 12730], 2], [[12731, 12735], 2], [[12736, 12751], 2], [[12752, 12771], 2], [[12772, 12773], 2], [[12774, 12782], 3], [12783, 3], [[12784, 12799], 2], [12800, 1, "(\u1100)"], [12801, 1, "(\u1102)"], [12802, 1, "(\u1103)"], [12803, 1, "(\u1105)"], [12804, 1, "(\u1106)"], [12805, 1, "(\u1107)"], [12806, 1, "(\u1109)"], [12807, 1, "(\u110B)"], [12808, 1, "(\u110C)"], [12809, 1, "(\u110E)"], [12810, 1, "(\u110F)"], [12811, 1, "(\u1110)"], [12812, 1, "(\u1111)"], [12813, 1, "(\u1112)"], [12814, 1, "(\uAC00)"], [12815, 1, "(\uB098)"], [12816, 1, "(\uB2E4)"], [12817, 1, "(\uB77C)"], [12818, 1, "(\uB9C8)"], [12819, 1, "(\uBC14)"], [12820, 1, "(\uC0AC)"], [12821, 1, "(\uC544)"], [12822, 1, "(\uC790)"], [12823, 1, "(\uCC28)"], [12824, 1, "(\uCE74)"], [12825, 1, "(\uD0C0)"], [12826, 1, "(\uD30C)"], [12827, 1, "(\uD558)"], [12828, 1, "(\uC8FC)"], [12829, 1, "(\uC624\uC804)"], [12830, 1, "(\uC624\uD6C4)"], [12831, 3], [12832, 1, "(\u4E00)"], [12833, 1, "(\u4E8C)"], [12834, 1, "(\u4E09)"], [12835, 1, "(\u56DB)"], [12836, 1, "(\u4E94)"], [12837, 1, "(\u516D)"], [12838, 1, "(\u4E03)"], [12839, 1, "(\u516B)"], [12840, 1, "(\u4E5D)"], [12841, 1, "(\u5341)"], [12842, 1, "(\u6708)"], [12843, 1, "(\u706B)"], [12844, 1, "(\u6C34)"], [12845, 1, "(\u6728)"], [12846, 1, "(\u91D1)"], [12847, 1, "(\u571F)"], [12848, 1, "(\u65E5)"], [12849, 1, "(\u682A)"], [12850, 1, "(\u6709)"], [12851, 1, "(\u793E)"], [12852, 1, "(\u540D)"], [12853, 1, "(\u7279)"], [12854, 1, "(\u8CA1)"], [12855, 1, "(\u795D)"], [12856, 1, "(\u52B4)"], [12857, 1, "(\u4EE3)"], [12858, 1, "(\u547C)"], [12859, 1, "(\u5B66)"], [12860, 1, "(\u76E3)"], [12861, 1, "(\u4F01)"], [12862, 1, "(\u8CC7)"], [12863, 1, "(\u5354)"], [12864, 1, "(\u796D)"], [12865, 1, "(\u4F11)"], [12866, 1, "(\u81EA)"], [12867, 1, "(\u81F3)"], [12868, 1, "\u554F"], [12869, 1, "\u5E7C"], [12870, 1, "\u6587"], [12871, 1, "\u7B8F"], [[12872, 12879], 2], [12880, 1, "pte"], [12881, 1, "21"], [12882, 1, "22"], [12883, 1, "23"], [12884, 1, "24"], [12885, 1, "25"], [12886, 1, "26"], [12887, 1, "27"], [12888, 1, "28"], [12889, 1, "29"], [12890, 1, "30"], [12891, 1, "31"], [12892, 1, "32"], [12893, 1, "33"], [12894, 1, "34"], [12895, 1, "35"], [12896, 1, "\u1100"], [12897, 1, "\u1102"], [12898, 1, "\u1103"], [12899, 1, "\u1105"], [12900, 1, "\u1106"], [12901, 1, "\u1107"], [12902, 1, "\u1109"], [12903, 1, "\u110B"], [12904, 1, "\u110C"], [12905, 1, "\u110E"], [12906, 1, "\u110F"], [12907, 1, "\u1110"], [12908, 1, "\u1111"], [12909, 1, "\u1112"], [12910, 1, "\uAC00"], [12911, 1, "\uB098"], [12912, 1, "\uB2E4"], [12913, 1, "\uB77C"], [12914, 1, "\uB9C8"], [12915, 1, "\uBC14"], [12916, 1, "\uC0AC"], [12917, 1, "\uC544"], [12918, 1, "\uC790"], [12919, 1, "\uCC28"], [12920, 1, "\uCE74"], [12921, 1, "\uD0C0"], [12922, 1, "\uD30C"], [12923, 1, "\uD558"], [12924, 1, "\uCC38\uACE0"], [12925, 1, "\uC8FC\uC758"], [12926, 1, "\uC6B0"], [12927, 2], [12928, 1, "\u4E00"], [12929, 1, "\u4E8C"], [12930, 1, "\u4E09"], [12931, 1, "\u56DB"], [12932, 1, "\u4E94"], [12933, 1, "\u516D"], [12934, 1, "\u4E03"], [12935, 1, "\u516B"], [12936, 1, "\u4E5D"], [12937, 1, "\u5341"], [12938, 1, "\u6708"], [12939, 1, "\u706B"], [12940, 1, "\u6C34"], [12941, 1, "\u6728"], [12942, 1, "\u91D1"], [12943, 1, "\u571F"], [12944, 1, "\u65E5"], [12945, 1, "\u682A"], [12946, 1, "\u6709"], [12947, 1, "\u793E"], [12948, 1, "\u540D"], [12949, 1, "\u7279"], [12950, 1, "\u8CA1"], [12951, 1, "\u795D"], [12952, 1, "\u52B4"], [12953, 1, "\u79D8"], [12954, 1, "\u7537"], [12955, 1, "\u5973"], [12956, 1, "\u9069"], [12957, 1, "\u512A"], [12958, 1, "\u5370"], [12959, 1, "\u6CE8"], [12960, 1, "\u9805"], [12961, 1, "\u4F11"], [12962, 1, "\u5199"], [12963, 1, "\u6B63"], [12964, 1, "\u4E0A"], [12965, 1, "\u4E2D"], [12966, 1, "\u4E0B"], [12967, 1, "\u5DE6"], [12968, 1, "\u53F3"], [12969, 1, "\u533B"], [12970, 1, "\u5B97"], [12971, 1, "\u5B66"], [12972, 1, "\u76E3"], [12973, 1, "\u4F01"], [12974, 1, "\u8CC7"], [12975, 1, "\u5354"], [12976, 1, "\u591C"], [12977, 1, "36"], [12978, 1, "37"], [12979, 1, "38"], [12980, 1, "39"], [12981, 1, "40"], [12982, 1, "41"], [12983, 1, "42"], [12984, 1, "43"], [12985, 1, "44"], [12986, 1, "45"], [12987, 1, "46"], [12988, 1, "47"], [12989, 1, "48"], [12990, 1, "49"], [12991, 1, "50"], [12992, 1, "1\u6708"], [12993, 1, "2\u6708"], [12994, 1, "3\u6708"], [12995, 1, "4\u6708"], [12996, 1, "5\u6708"], [12997, 1, "6\u6708"], [12998, 1, "7\u6708"], [12999, 1, "8\u6708"], [13e3, 1, "9\u6708"], [13001, 1, "10\u6708"], [13002, 1, "11\u6708"], [13003, 1, "12\u6708"], [13004, 1, "hg"], [13005, 1, "erg"], [13006, 1, "ev"], [13007, 1, "ltd"], [13008, 1, "\u30A2"], [13009, 1, "\u30A4"], [13010, 1, "\u30A6"], [13011, 1, "\u30A8"], [13012, 1, "\u30AA"], [13013, 1, "\u30AB"], [13014, 1, "\u30AD"], [13015, 1, "\u30AF"], [13016, 1, "\u30B1"], [13017, 1, "\u30B3"], [13018, 1, "\u30B5"], [13019, 1, "\u30B7"], [13020, 1, "\u30B9"], [13021, 1, "\u30BB"], [13022, 1, "\u30BD"], [13023, 1, "\u30BF"], [13024, 1, "\u30C1"], [13025, 1, "\u30C4"], [13026, 1, "\u30C6"], [13027, 1, "\u30C8"], [13028, 1, "\u30CA"], [13029, 1, "\u30CB"], [13030, 1, "\u30CC"], [13031, 1, "\u30CD"], [13032, 1, "\u30CE"], [13033, 1, "\u30CF"], [13034, 1, "\u30D2"], [13035, 1, "\u30D5"], [13036, 1, "\u30D8"], [13037, 1, "\u30DB"], [13038, 1, "\u30DE"], [13039, 1, "\u30DF"], [13040, 1, "\u30E0"], [13041, 1, "\u30E1"], [13042, 1, "\u30E2"], [13043, 1, "\u30E4"], [13044, 1, "\u30E6"], [13045, 1, "\u30E8"], [13046, 1, "\u30E9"], [13047, 1, "\u30EA"], [13048, 1, "\u30EB"], [13049, 1, "\u30EC"], [13050, 1, "\u30ED"], [13051, 1, "\u30EF"], [13052, 1, "\u30F0"], [13053, 1, "\u30F1"], [13054, 1, "\u30F2"], [13055, 1, "\u4EE4\u548C"], [13056, 1, "\u30A2\u30D1\u30FC\u30C8"], [13057, 1, "\u30A2\u30EB\u30D5\u30A1"], [13058, 1, "\u30A2\u30F3\u30DA\u30A2"], [13059, 1, "\u30A2\u30FC\u30EB"], [13060, 1, "\u30A4\u30CB\u30F3\u30B0"], [13061, 1, "\u30A4\u30F3\u30C1"], [13062, 1, "\u30A6\u30A9\u30F3"], [13063, 1, "\u30A8\u30B9\u30AF\u30FC\u30C9"], [13064, 1, "\u30A8\u30FC\u30AB\u30FC"], [13065, 1, "\u30AA\u30F3\u30B9"], [13066, 1, "\u30AA\u30FC\u30E0"], [13067, 1, "\u30AB\u30A4\u30EA"], [13068, 1, "\u30AB\u30E9\u30C3\u30C8"], [13069, 1, "\u30AB\u30ED\u30EA\u30FC"], [13070, 1, "\u30AC\u30ED\u30F3"], [13071, 1, "\u30AC\u30F3\u30DE"], [13072, 1, "\u30AE\u30AC"], [13073, 1, "\u30AE\u30CB\u30FC"], [13074, 1, "\u30AD\u30E5\u30EA\u30FC"], [13075, 1, "\u30AE\u30EB\u30C0\u30FC"], [13076, 1, "\u30AD\u30ED"], [13077, 1, "\u30AD\u30ED\u30B0\u30E9\u30E0"], [13078, 1, "\u30AD\u30ED\u30E1\u30FC\u30C8\u30EB"], [13079, 1, "\u30AD\u30ED\u30EF\u30C3\u30C8"], [13080, 1, "\u30B0\u30E9\u30E0"], [13081, 1, "\u30B0\u30E9\u30E0\u30C8\u30F3"], [13082, 1, "\u30AF\u30EB\u30BC\u30A4\u30ED"], [13083, 1, "\u30AF\u30ED\u30FC\u30CD"], [13084, 1, "\u30B1\u30FC\u30B9"], [13085, 1, "\u30B3\u30EB\u30CA"], [13086, 1, "\u30B3\u30FC\u30DD"], [13087, 1, "\u30B5\u30A4\u30AF\u30EB"], [13088, 1, "\u30B5\u30F3\u30C1\u30FC\u30E0"], [13089, 1, "\u30B7\u30EA\u30F3\u30B0"], [13090, 1, "\u30BB\u30F3\u30C1"], [13091, 1, "\u30BB\u30F3\u30C8"], [13092, 1, "\u30C0\u30FC\u30B9"], [13093, 1, "\u30C7\u30B7"], [13094, 1, "\u30C9\u30EB"], [13095, 1, "\u30C8\u30F3"], [13096, 1, "\u30CA\u30CE"], [13097, 1, "\u30CE\u30C3\u30C8"], [13098, 1, "\u30CF\u30A4\u30C4"], [13099, 1, "\u30D1\u30FC\u30BB\u30F3\u30C8"], [13100, 1, "\u30D1\u30FC\u30C4"], [13101, 1, "\u30D0\u30FC\u30EC\u30EB"], [13102, 1, "\u30D4\u30A2\u30B9\u30C8\u30EB"], [13103, 1, "\u30D4\u30AF\u30EB"], [13104, 1, "\u30D4\u30B3"], [13105, 1, "\u30D3\u30EB"], [13106, 1, "\u30D5\u30A1\u30E9\u30C3\u30C9"], [13107, 1, "\u30D5\u30A3\u30FC\u30C8"], [13108, 1, "\u30D6\u30C3\u30B7\u30A7\u30EB"], [13109, 1, "\u30D5\u30E9\u30F3"], [13110, 1, "\u30D8\u30AF\u30BF\u30FC\u30EB"], [13111, 1, "\u30DA\u30BD"], [13112, 1, "\u30DA\u30CB\u30D2"], [13113, 1, "\u30D8\u30EB\u30C4"], [13114, 1, "\u30DA\u30F3\u30B9"], [13115, 1, "\u30DA\u30FC\u30B8"], [13116, 1, "\u30D9\u30FC\u30BF"], [13117, 1, "\u30DD\u30A4\u30F3\u30C8"], [13118, 1, "\u30DC\u30EB\u30C8"], [13119, 1, "\u30DB\u30F3"], [13120, 1, "\u30DD\u30F3\u30C9"], [13121, 1, "\u30DB\u30FC\u30EB"], [13122, 1, "\u30DB\u30FC\u30F3"], [13123, 1, "\u30DE\u30A4\u30AF\u30ED"], [13124, 1, "\u30DE\u30A4\u30EB"], [13125, 1, "\u30DE\u30C3\u30CF"], [13126, 1, "\u30DE\u30EB\u30AF"], [13127, 1, "\u30DE\u30F3\u30B7\u30E7\u30F3"], [13128, 1, "\u30DF\u30AF\u30ED\u30F3"], [13129, 1, "\u30DF\u30EA"], [13130, 1, "\u30DF\u30EA\u30D0\u30FC\u30EB"], [13131, 1, "\u30E1\u30AC"], [13132, 1, "\u30E1\u30AC\u30C8\u30F3"], [13133, 1, "\u30E1\u30FC\u30C8\u30EB"], [13134, 1, "\u30E4\u30FC\u30C9"], [13135, 1, "\u30E4\u30FC\u30EB"], [13136, 1, "\u30E6\u30A2\u30F3"], [13137, 1, "\u30EA\u30C3\u30C8\u30EB"], [13138, 1, "\u30EA\u30E9"], [13139, 1, "\u30EB\u30D4\u30FC"], [13140, 1, "\u30EB\u30FC\u30D6\u30EB"], [13141, 1, "\u30EC\u30E0"], [13142, 1, "\u30EC\u30F3\u30C8\u30B2\u30F3"], [13143, 1, "\u30EF\u30C3\u30C8"], [13144, 1, "0\u70B9"], [13145, 1, "1\u70B9"], [13146, 1, "2\u70B9"], [13147, 1, "3\u70B9"], [13148, 1, "4\u70B9"], [13149, 1, "5\u70B9"], [13150, 1, "6\u70B9"], [13151, 1, "7\u70B9"], [13152, 1, "8\u70B9"], [13153, 1, "9\u70B9"], [13154, 1, "10\u70B9"], [13155, 1, "11\u70B9"], [13156, 1, "12\u70B9"], [13157, 1, "13\u70B9"], [13158, 1, "14\u70B9"], [13159, 1, "15\u70B9"], [13160, 1, "16\u70B9"], [13161, 1, "17\u70B9"], [13162, 1, "18\u70B9"], [13163, 1, "19\u70B9"], [13164, 1, "20\u70B9"], [13165, 1, "21\u70B9"], [13166, 1, "22\u70B9"], [13167, 1, "23\u70B9"], [13168, 1, "24\u70B9"], [13169, 1, "hpa"], [13170, 1, "da"], [13171, 1, "au"], [13172, 1, "bar"], [13173, 1, "ov"], [13174, 1, "pc"], [13175, 1, "dm"], [13176, 1, "dm2"], [13177, 1, "dm3"], [13178, 1, "iu"], [13179, 1, "\u5E73\u6210"], [13180, 1, "\u662D\u548C"], [13181, 1, "\u5927\u6B63"], [13182, 1, "\u660E\u6CBB"], [13183, 1, "\u682A\u5F0F\u4F1A\u793E"], [13184, 1, "pa"], [13185, 1, "na"], [13186, 1, "\u03BCa"], [13187, 1, "ma"], [13188, 1, "ka"], [13189, 1, "kb"], [13190, 1, "mb"], [13191, 1, "gb"], [13192, 1, "cal"], [13193, 1, "kcal"], [13194, 1, "pf"], [13195, 1, "nf"], [13196, 1, "\u03BCf"], [13197, 1, "\u03BCg"], [13198, 1, "mg"], [13199, 1, "kg"], [13200, 1, "hz"], [13201, 1, "khz"], [13202, 1, "mhz"], [13203, 1, "ghz"], [13204, 1, "thz"], [13205, 1, "\u03BCl"], [13206, 1, "ml"], [13207, 1, "dl"], [13208, 1, "kl"], [13209, 1, "fm"], [13210, 1, "nm"], [13211, 1, "\u03BCm"], [13212, 1, "mm"], [13213, 1, "cm"], [13214, 1, "km"], [13215, 1, "mm2"], [13216, 1, "cm2"], [13217, 1, "m2"], [13218, 1, "km2"], [13219, 1, "mm3"], [13220, 1, "cm3"], [13221, 1, "m3"], [13222, 1, "km3"], [13223, 1, "m\u2215s"], [13224, 1, "m\u2215s2"], [13225, 1, "pa"], [13226, 1, "kpa"], [13227, 1, "mpa"], [13228, 1, "gpa"], [13229, 1, "rad"], [13230, 1, "rad\u2215s"], [13231, 1, "rad\u2215s2"], [13232, 1, "ps"], [13233, 1, "ns"], [13234, 1, "\u03BCs"], [13235, 1, "ms"], [13236, 1, "pv"], [13237, 1, "nv"], [13238, 1, "\u03BCv"], [13239, 1, "mv"], [13240, 1, "kv"], [13241, 1, "mv"], [13242, 1, "pw"], [13243, 1, "nw"], [13244, 1, "\u03BCw"], [13245, 1, "mw"], [13246, 1, "kw"], [13247, 1, "mw"], [13248, 1, "k\u03C9"], [13249, 1, "m\u03C9"], [13250, 3], [13251, 1, "bq"], [13252, 1, "cc"], [13253, 1, "cd"], [13254, 1, "c\u2215kg"], [13255, 3], [13256, 1, "db"], [13257, 1, "gy"], [13258, 1, "ha"], [13259, 1, "hp"], [13260, 1, "in"], [13261, 1, "kk"], [13262, 1, "km"], [13263, 1, "kt"], [13264, 1, "lm"], [13265, 1, "ln"], [13266, 1, "log"], [13267, 1, "lx"], [13268, 1, "mb"], [13269, 1, "mil"], [13270, 1, "mol"], [13271, 1, "ph"], [13272, 3], [13273, 1, "ppm"], [13274, 1, "pr"], [13275, 1, "sr"], [13276, 1, "sv"], [13277, 1, "wb"], [13278, 1, "v\u2215m"], [13279, 1, "a\u2215m"], [13280, 1, "1\u65E5"], [13281, 1, "2\u65E5"], [13282, 1, "3\u65E5"], [13283, 1, "4\u65E5"], [13284, 1, "5\u65E5"], [13285, 1, "6\u65E5"], [13286, 1, "7\u65E5"], [13287, 1, "8\u65E5"], [13288, 1, "9\u65E5"], [13289, 1, "10\u65E5"], [13290, 1, "11\u65E5"], [13291, 1, "12\u65E5"], [13292, 1, "13\u65E5"], [13293, 1, "14\u65E5"], [13294, 1, "15\u65E5"], [13295, 1, "16\u65E5"], [13296, 1, "17\u65E5"], [13297, 1, "18\u65E5"], [13298, 1, "19\u65E5"], [13299, 1, "20\u65E5"], [13300, 1, "21\u65E5"], [13301, 1, "22\u65E5"], [13302, 1, "23\u65E5"], [13303, 1, "24\u65E5"], [13304, 1, "25\u65E5"], [13305, 1, "26\u65E5"], [13306, 1, "27\u65E5"], [13307, 1, "28\u65E5"], [13308, 1, "29\u65E5"], [13309, 1, "30\u65E5"], [13310, 1, "31\u65E5"], [13311, 1, "gal"], [[13312, 19893], 2], [[19894, 19903], 2], [[19904, 19967], 2], [[19968, 40869], 2], [[40870, 40891], 2], [[40892, 40899], 2], [[40900, 40907], 2], [40908, 2], [[40909, 40917], 2], [[40918, 40938], 2], [[40939, 40943], 2], [[40944, 40956], 2], [[40957, 40959], 2], [[40960, 42124], 2], [[42125, 42127], 3], [[42128, 42145], 2], [[42146, 42147], 2], [[42148, 42163], 2], [42164, 2], [[42165, 42176], 2], [42177, 2], [[42178, 42180], 2], [42181, 2], [42182, 2], [[42183, 42191], 3], [[42192, 42237], 2], [[42238, 42239], 2], [[42240, 42508], 2], [[42509, 42511], 2], [[42512, 42539], 2], [[42540, 42559], 3], [42560, 1, "\uA641"], [42561, 2], [42562, 1, "\uA643"], [42563, 2], [42564, 1, "\uA645"], [42565, 2], [42566, 1, "\uA647"], [42567, 2], [42568, 1, "\uA649"], [42569, 2], [42570, 1, "\uA64B"], [42571, 2], [42572, 1, "\uA64D"], [42573, 2], [42574, 1, "\uA64F"], [42575, 2], [42576, 1, "\uA651"], [42577, 2], [42578, 1, "\uA653"], [42579, 2], [42580, 1, "\uA655"], [42581, 2], [42582, 1, "\uA657"], [42583, 2], [42584, 1, "\uA659"], [42585, 2], [42586, 1, "\uA65B"], [42587, 2], [42588, 1, "\uA65D"], [42589, 2], [42590, 1, "\uA65F"], [42591, 2], [42592, 1, "\uA661"], [42593, 2], [42594, 1, "\uA663"], [42595, 2], [42596, 1, "\uA665"], [42597, 2], [42598, 1, "\uA667"], [42599, 2], [42600, 1, "\uA669"], [42601, 2], [42602, 1, "\uA66B"], [42603, 2], [42604, 1, "\uA66D"], [[42605, 42607], 2], [[42608, 42611], 2], [[42612, 42619], 2], [[42620, 42621], 2], [42622, 2], [42623, 2], [42624, 1, "\uA681"], [42625, 2], [42626, 1, "\uA683"], [42627, 2], [42628, 1, "\uA685"], [42629, 2], [42630, 1, "\uA687"], [42631, 2], [42632, 1, "\uA689"], [42633, 2], [42634, 1, "\uA68B"], [42635, 2], [42636, 1, "\uA68D"], [42637, 2], [42638, 1, "\uA68F"], [42639, 2], [42640, 1, "\uA691"], [42641, 2], [42642, 1, "\uA693"], [42643, 2], [42644, 1, "\uA695"], [42645, 2], [42646, 1, "\uA697"], [42647, 2], [42648, 1, "\uA699"], [42649, 2], [42650, 1, "\uA69B"], [42651, 2], [42652, 1, "\u044A"], [42653, 1, "\u044C"], [42654, 2], [42655, 2], [[42656, 42725], 2], [[42726, 42735], 2], [[42736, 42737], 2], [[42738, 42743], 2], [[42744, 42751], 3], [[42752, 42774], 2], [[42775, 42778], 2], [[42779, 42783], 2], [[42784, 42785], 2], [42786, 1, "\uA723"], [42787, 2], [42788, 1, "\uA725"], [42789, 2], [42790, 1, "\uA727"], [42791, 2], [42792, 1, "\uA729"], [42793, 2], [42794, 1, "\uA72B"], [42795, 2], [42796, 1, "\uA72D"], [42797, 2], [42798, 1, "\uA72F"], [[42799, 42801], 2], [42802, 1, "\uA733"], [42803, 2], [42804, 1, "\uA735"], [42805, 2], [42806, 1, "\uA737"], [42807, 2], [42808, 1, "\uA739"], [42809, 2], [42810, 1, "\uA73B"], [42811, 2], [42812, 1, "\uA73D"], [42813, 2], [42814, 1, "\uA73F"], [42815, 2], [42816, 1, "\uA741"], [42817, 2], [42818, 1, "\uA743"], [42819, 2], [42820, 1, "\uA745"], [42821, 2], [42822, 1, "\uA747"], [42823, 2], [42824, 1, "\uA749"], [42825, 2], [42826, 1, "\uA74B"], [42827, 2], [42828, 1, "\uA74D"], [42829, 2], [42830, 1, "\uA74F"], [42831, 2], [42832, 1, "\uA751"], [42833, 2], [42834, 1, "\uA753"], [42835, 2], [42836, 1, "\uA755"], [42837, 2], [42838, 1, "\uA757"], [42839, 2], [42840, 1, "\uA759"], [42841, 2], [42842, 1, "\uA75B"], [42843, 2], [42844, 1, "\uA75D"], [42845, 2], [42846, 1, "\uA75F"], [42847, 2], [42848, 1, "\uA761"], [42849, 2], [42850, 1, "\uA763"], [42851, 2], [42852, 1, "\uA765"], [42853, 2], [42854, 1, "\uA767"], [42855, 2], [42856, 1, "\uA769"], [42857, 2], [42858, 1, "\uA76B"], [42859, 2], [42860, 1, "\uA76D"], [42861, 2], [42862, 1, "\uA76F"], [42863, 2], [42864, 1, "\uA76F"], [[42865, 42872], 2], [42873, 1, "\uA77A"], [42874, 2], [42875, 1, "\uA77C"], [42876, 2], [42877, 1, "\u1D79"], [42878, 1, "\uA77F"], [42879, 2], [42880, 1, "\uA781"], [42881, 2], [42882, 1, "\uA783"], [42883, 2], [42884, 1, "\uA785"], [42885, 2], [42886, 1, "\uA787"], [[42887, 42888], 2], [[42889, 42890], 2], [42891, 1, "\uA78C"], [42892, 2], [42893, 1, "\u0265"], [42894, 2], [42895, 2], [42896, 1, "\uA791"], [42897, 2], [42898, 1, "\uA793"], [42899, 2], [[42900, 42901], 2], [42902, 1, "\uA797"], [42903, 2], [42904, 1, "\uA799"], [42905, 2], [42906, 1, "\uA79B"], [42907, 2], [42908, 1, "\uA79D"], [42909, 2], [42910, 1, "\uA79F"], [42911, 2], [42912, 1, "\uA7A1"], [42913, 2], [42914, 1, "\uA7A3"], [42915, 2], [42916, 1, "\uA7A5"], [42917, 2], [42918, 1, "\uA7A7"], [42919, 2], [42920, 1, "\uA7A9"], [42921, 2], [42922, 1, "\u0266"], [42923, 1, "\u025C"], [42924, 1, "\u0261"], [42925, 1, "\u026C"], [42926, 1, "\u026A"], [42927, 2], [42928, 1, "\u029E"], [42929, 1, "\u0287"], [42930, 1, "\u029D"], [42931, 1, "\uAB53"], [42932, 1, "\uA7B5"], [42933, 2], [42934, 1, "\uA7B7"], [42935, 2], [42936, 1, "\uA7B9"], [42937, 2], [42938, 1, "\uA7BB"], [42939, 2], [42940, 1, "\uA7BD"], [42941, 2], [42942, 1, "\uA7BF"], [42943, 2], [42944, 1, "\uA7C1"], [42945, 2], [42946, 1, "\uA7C3"], [42947, 2], [42948, 1, "\uA794"], [42949, 1, "\u0282"], [42950, 1, "\u1D8E"], [42951, 1, "\uA7C8"], [42952, 2], [42953, 1, "\uA7CA"], [42954, 2], [42955, 1, "\u0264"], [42956, 1, "\uA7CD"], [42957, 2], [[42958, 42959], 3], [42960, 1, "\uA7D1"], [42961, 2], [42962, 3], [42963, 2], [42964, 3], [42965, 2], [42966, 1, "\uA7D7"], [42967, 2], [42968, 1, "\uA7D9"], [42969, 2], [42970, 1, "\uA7DB"], [42971, 2], [42972, 1, "\u019B"], [[42973, 42993], 3], [42994, 1, "c"], [42995, 1, "f"], [42996, 1, "q"], [42997, 1, "\uA7F6"], [42998, 2], [42999, 2], [43e3, 1, "\u0127"], [43001, 1, "\u0153"], [43002, 2], [[43003, 43007], 2], [[43008, 43047], 2], [[43048, 43051], 2], [43052, 2], [[43053, 43055], 3], [[43056, 43065], 2], [[43066, 43071], 3], [[43072, 43123], 2], [[43124, 43127], 2], [[43128, 43135], 3], [[43136, 43204], 2], [43205, 2], [[43206, 43213], 3], [[43214, 43215], 2], [[43216, 43225], 2], [[43226, 43231], 3], [[43232, 43255], 2], [[43256, 43258], 2], [43259, 2], [43260, 2], [43261, 2], [[43262, 43263], 2], [[43264, 43309], 2], [[43310, 43311], 2], [[43312, 43347], 2], [[43348, 43358], 3], [43359, 2], [[43360, 43388], 2], [[43389, 43391], 3], [[43392, 43456], 2], [[43457, 43469], 2], [43470, 3], [[43471, 43481], 2], [[43482, 43485], 3], [[43486, 43487], 2], [[43488, 43518], 2], [43519, 3], [[43520, 43574], 2], [[43575, 43583], 3], [[43584, 43597], 2], [[43598, 43599], 3], [[43600, 43609], 2], [[43610, 43611], 3], [[43612, 43615], 2], [[43616, 43638], 2], [[43639, 43641], 2], [[43642, 43643], 2], [[43644, 43647], 2], [[43648, 43714], 2], [[43715, 43738], 3], [[43739, 43741], 2], [[43742, 43743], 2], [[43744, 43759], 2], [[43760, 43761], 2], [[43762, 43766], 2], [[43767, 43776], 3], [[43777, 43782], 2], [[43783, 43784], 3], [[43785, 43790], 2], [[43791, 43792], 3], [[43793, 43798], 2], [[43799, 43807], 3], [[43808, 43814], 2], [43815, 3], [[43816, 43822], 2], [43823, 3], [[43824, 43866], 2], [43867, 2], [43868, 1, "\uA727"], [43869, 1, "\uAB37"], [43870, 1, "\u026B"], [43871, 1, "\uAB52"], [[43872, 43875], 2], [[43876, 43877], 2], [[43878, 43879], 2], [43880, 2], [43881, 1, "\u028D"], [[43882, 43883], 2], [[43884, 43887], 3], [43888, 1, "\u13A0"], [43889, 1, "\u13A1"], [43890, 1, "\u13A2"], [43891, 1, "\u13A3"], [43892, 1, "\u13A4"], [43893, 1, "\u13A5"], [43894, 1, "\u13A6"], [43895, 1, "\u13A7"], [43896, 1, "\u13A8"], [43897, 1, "\u13A9"], [43898, 1, "\u13AA"], [43899, 1, "\u13AB"], [43900, 1, "\u13AC"], [43901, 1, "\u13AD"], [43902, 1, "\u13AE"], [43903, 1, "\u13AF"], [43904, 1, "\u13B0"], [43905, 1, "\u13B1"], [43906, 1, "\u13B2"], [43907, 1, "\u13B3"], [43908, 1, "\u13B4"], [43909, 1, "\u13B5"], [43910, 1, "\u13B6"], [43911, 1, "\u13B7"], [43912, 1, "\u13B8"], [43913, 1, "\u13B9"], [43914, 1, "\u13BA"], [43915, 1, "\u13BB"], [43916, 1, "\u13BC"], [43917, 1, "\u13BD"], [43918, 1, "\u13BE"], [43919, 1, "\u13BF"], [43920, 1, "\u13C0"], [43921, 1, "\u13C1"], [43922, 1, "\u13C2"], [43923, 1, "\u13C3"], [43924, 1, "\u13C4"], [43925, 1, "\u13C5"], [43926, 1, "\u13C6"], [43927, 1, "\u13C7"], [43928, 1, "\u13C8"], [43929, 1, "\u13C9"], [43930, 1, "\u13CA"], [43931, 1, "\u13CB"], [43932, 1, "\u13CC"], [43933, 1, "\u13CD"], [43934, 1, "\u13CE"], [43935, 1, "\u13CF"], [43936, 1, "\u13D0"], [43937, 1, "\u13D1"], [43938, 1, "\u13D2"], [43939, 1, "\u13D3"], [43940, 1, "\u13D4"], [43941, 1, "\u13D5"], [43942, 1, "\u13D6"], [43943, 1, "\u13D7"], [43944, 1, "\u13D8"], [43945, 1, "\u13D9"], [43946, 1, "\u13DA"], [43947, 1, "\u13DB"], [43948, 1, "\u13DC"], [43949, 1, "\u13DD"], [43950, 1, "\u13DE"], [43951, 1, "\u13DF"], [43952, 1, "\u13E0"], [43953, 1, "\u13E1"], [43954, 1, "\u13E2"], [43955, 1, "\u13E3"], [43956, 1, "\u13E4"], [43957, 1, "\u13E5"], [43958, 1, "\u13E6"], [43959, 1, "\u13E7"], [43960, 1, "\u13E8"], [43961, 1, "\u13E9"], [43962, 1, "\u13EA"], [43963, 1, "\u13EB"], [43964, 1, "\u13EC"], [43965, 1, "\u13ED"], [43966, 1, "\u13EE"], [43967, 1, "\u13EF"], [[43968, 44010], 2], [44011, 2], [[44012, 44013], 2], [[44014, 44015], 3], [[44016, 44025], 2], [[44026, 44031], 3], [[44032, 55203], 2], [[55204, 55215], 3], [[55216, 55238], 2], [[55239, 55242], 3], [[55243, 55291], 2], [[55292, 55295], 3], [[55296, 57343], 3], [[57344, 63743], 3], [63744, 1, "\u8C48"], [63745, 1, "\u66F4"], [63746, 1, "\u8ECA"], [63747, 1, "\u8CC8"], [63748, 1, "\u6ED1"], [63749, 1, "\u4E32"], [63750, 1, "\u53E5"], [[63751, 63752], 1, "\u9F9C"], [63753, 1, "\u5951"], [63754, 1, "\u91D1"], [63755, 1, "\u5587"], [63756, 1, "\u5948"], [63757, 1, "\u61F6"], [63758, 1, "\u7669"], [63759, 1, "\u7F85"], [63760, 1, "\u863F"], [63761, 1, "\u87BA"], [63762, 1, "\u88F8"], [63763, 1, "\u908F"], [63764, 1, "\u6A02"], [63765, 1, "\u6D1B"], [63766, 1, "\u70D9"], [63767, 1, "\u73DE"], [63768, 1, "\u843D"], [63769, 1, "\u916A"], [63770, 1, "\u99F1"], [63771, 1, "\u4E82"], [63772, 1, "\u5375"], [63773, 1, "\u6B04"], [63774, 1, "\u721B"], [63775, 1, "\u862D"], [63776, 1, "\u9E1E"], [63777, 1, "\u5D50"], [63778, 1, "\u6FEB"], [63779, 1, "\u85CD"], [63780, 1, "\u8964"], [63781, 1, "\u62C9"], [63782, 1, "\u81D8"], [63783, 1, "\u881F"], [63784, 1, "\u5ECA"], [63785, 1, "\u6717"], [63786, 1, "\u6D6A"], [63787, 1, "\u72FC"], [63788, 1, "\u90CE"], [63789, 1, "\u4F86"], [63790, 1, "\u51B7"], [63791, 1, "\u52DE"], [63792, 1, "\u64C4"], [63793, 1, "\u6AD3"], [63794, 1, "\u7210"], [63795, 1, "\u76E7"], [63796, 1, "\u8001"], [63797, 1, "\u8606"], [63798, 1, "\u865C"], [63799, 1, "\u8DEF"], [63800, 1, "\u9732"], [63801, 1, "\u9B6F"], [63802, 1, "\u9DFA"], [63803, 1, "\u788C"], [63804, 1, "\u797F"], [63805, 1, "\u7DA0"], [63806, 1, "\u83C9"], [63807, 1, "\u9304"], [63808, 1, "\u9E7F"], [63809, 1, "\u8AD6"], [63810, 1, "\u58DF"], [63811, 1, "\u5F04"], [63812, 1, "\u7C60"], [63813, 1, "\u807E"], [63814, 1, "\u7262"], [63815, 1, "\u78CA"], [63816, 1, "\u8CC2"], [63817, 1, "\u96F7"], [63818, 1, "\u58D8"], [63819, 1, "\u5C62"], [63820, 1, "\u6A13"], [63821, 1, "\u6DDA"], [63822, 1, "\u6F0F"], [63823, 1, "\u7D2F"], [63824, 1, "\u7E37"], [63825, 1, "\u964B"], [63826, 1, "\u52D2"], [63827, 1, "\u808B"], [63828, 1, "\u51DC"], [63829, 1, "\u51CC"], [63830, 1, "\u7A1C"], [63831, 1, "\u7DBE"], [63832, 1, "\u83F1"], [63833, 1, "\u9675"], [63834, 1, "\u8B80"], [63835, 1, "\u62CF"], [63836, 1, "\u6A02"], [63837, 1, "\u8AFE"], [63838, 1, "\u4E39"], [63839, 1, "\u5BE7"], [63840, 1, "\u6012"], [63841, 1, "\u7387"], [63842, 1, "\u7570"], [63843, 1, "\u5317"], [63844, 1, "\u78FB"], [63845, 1, "\u4FBF"], [63846, 1, "\u5FA9"], [63847, 1, "\u4E0D"], [63848, 1, "\u6CCC"], [63849, 1, "\u6578"], [63850, 1, "\u7D22"], [63851, 1, "\u53C3"], [63852, 1, "\u585E"], [63853, 1, "\u7701"], [63854, 1, "\u8449"], [63855, 1, "\u8AAA"], [63856, 1, "\u6BBA"], [63857, 1, "\u8FB0"], [63858, 1, "\u6C88"], [63859, 1, "\u62FE"], [63860, 1, "\u82E5"], [63861, 1, "\u63A0"], [63862, 1, "\u7565"], [63863, 1, "\u4EAE"], [63864, 1, "\u5169"], [63865, 1, "\u51C9"], [63866, 1, "\u6881"], [63867, 1, "\u7CE7"], [63868, 1, "\u826F"], [63869, 1, "\u8AD2"], [63870, 1, "\u91CF"], [63871, 1, "\u52F5"], [63872, 1, "\u5442"], [63873, 1, "\u5973"], [63874, 1, "\u5EEC"], [63875, 1, "\u65C5"], [63876, 1, "\u6FFE"], [63877, 1, "\u792A"], [63878, 1, "\u95AD"], [63879, 1, "\u9A6A"], [63880, 1, "\u9E97"], [63881, 1, "\u9ECE"], [63882, 1, "\u529B"], [63883, 1, "\u66C6"], [63884, 1, "\u6B77"], [63885, 1, "\u8F62"], [63886, 1, "\u5E74"], [63887, 1, "\u6190"], [63888, 1, "\u6200"], [63889, 1, "\u649A"], [63890, 1, "\u6F23"], [63891, 1, "\u7149"], [63892, 1, "\u7489"], [63893, 1, "\u79CA"], [63894, 1, "\u7DF4"], [63895, 1, "\u806F"], [63896, 1, "\u8F26"], [63897, 1, "\u84EE"], [63898, 1, "\u9023"], [63899, 1, "\u934A"], [63900, 1, "\u5217"], [63901, 1, "\u52A3"], [63902, 1, "\u54BD"], [63903, 1, "\u70C8"], [63904, 1, "\u88C2"], [63905, 1, "\u8AAA"], [63906, 1, "\u5EC9"], [63907, 1, "\u5FF5"], [63908, 1, "\u637B"], [63909, 1, "\u6BAE"], [63910, 1, "\u7C3E"], [63911, 1, "\u7375"], [63912, 1, "\u4EE4"], [63913, 1, "\u56F9"], [63914, 1, "\u5BE7"], [63915, 1, "\u5DBA"], [63916, 1, "\u601C"], [63917, 1, "\u73B2"], [63918, 1, "\u7469"], [63919, 1, "\u7F9A"], [63920, 1, "\u8046"], [63921, 1, "\u9234"], [63922, 1, "\u96F6"], [63923, 1, "\u9748"], [63924, 1, "\u9818"], [63925, 1, "\u4F8B"], [63926, 1, "\u79AE"], [63927, 1, "\u91B4"], [63928, 1, "\u96B8"], [63929, 1, "\u60E1"], [63930, 1, "\u4E86"], [63931, 1, "\u50DA"], [63932, 1, "\u5BEE"], [63933, 1, "\u5C3F"], [63934, 1, "\u6599"], [63935, 1, "\u6A02"], [63936, 1, "\u71CE"], [63937, 1, "\u7642"], [63938, 1, "\u84FC"], [63939, 1, "\u907C"], [63940, 1, "\u9F8D"], [63941, 1, "\u6688"], [63942, 1, "\u962E"], [63943, 1, "\u5289"], [63944, 1, "\u677B"], [63945, 1, "\u67F3"], [63946, 1, "\u6D41"], [63947, 1, "\u6E9C"], [63948, 1, "\u7409"], [63949, 1, "\u7559"], [63950, 1, "\u786B"], [63951, 1, "\u7D10"], [63952, 1, "\u985E"], [63953, 1, "\u516D"], [63954, 1, "\u622E"], [63955, 1, "\u9678"], [63956, 1, "\u502B"], [63957, 1, "\u5D19"], [63958, 1, "\u6DEA"], [63959, 1, "\u8F2A"], [63960, 1, "\u5F8B"], [63961, 1, "\u6144"], [63962, 1, "\u6817"], [63963, 1, "\u7387"], [63964, 1, "\u9686"], [63965, 1, "\u5229"], [63966, 1, "\u540F"], [63967, 1, "\u5C65"], [63968, 1, "\u6613"], [63969, 1, "\u674E"], [63970, 1, "\u68A8"], [63971, 1, "\u6CE5"], [63972, 1, "\u7406"], [63973, 1, "\u75E2"], [63974, 1, "\u7F79"], [63975, 1, "\u88CF"], [63976, 1, "\u88E1"], [63977, 1, "\u91CC"], [63978, 1, "\u96E2"], [63979, 1, "\u533F"], [63980, 1, "\u6EBA"], [63981, 1, "\u541D"], [63982, 1, "\u71D0"], [63983, 1, "\u7498"], [63984, 1, "\u85FA"], [63985, 1, "\u96A3"], [63986, 1, "\u9C57"], [63987, 1, "\u9E9F"], [63988, 1, "\u6797"], [63989, 1, "\u6DCB"], [63990, 1, "\u81E8"], [63991, 1, "\u7ACB"], [63992, 1, "\u7B20"], [63993, 1, "\u7C92"], [63994, 1, "\u72C0"], [63995, 1, "\u7099"], [63996, 1, "\u8B58"], [63997, 1, "\u4EC0"], [63998, 1, "\u8336"], [63999, 1, "\u523A"], [64e3, 1, "\u5207"], [64001, 1, "\u5EA6"], [64002, 1, "\u62D3"], [64003, 1, "\u7CD6"], [64004, 1, "\u5B85"], [64005, 1, "\u6D1E"], [64006, 1, "\u66B4"], [64007, 1, "\u8F3B"], [64008, 1, "\u884C"], [64009, 1, "\u964D"], [64010, 1, "\u898B"], [64011, 1, "\u5ED3"], [64012, 1, "\u5140"], [64013, 1, "\u55C0"], [[64014, 64015], 2], [64016, 1, "\u585A"], [64017, 2], [64018, 1, "\u6674"], [[64019, 64020], 2], [64021, 1, "\u51DE"], [64022, 1, "\u732A"], [64023, 1, "\u76CA"], [64024, 1, "\u793C"], [64025, 1, "\u795E"], [64026, 1, "\u7965"], [64027, 1, "\u798F"], [64028, 1, "\u9756"], [64029, 1, "\u7CBE"], [64030, 1, "\u7FBD"], [64031, 2], [64032, 1, "\u8612"], [64033, 2], [64034, 1, "\u8AF8"], [[64035, 64036], 2], [64037, 1, "\u9038"], [64038, 1, "\u90FD"], [[64039, 64041], 2], [64042, 1, "\u98EF"], [64043, 1, "\u98FC"], [64044, 1, "\u9928"], [64045, 1, "\u9DB4"], [64046, 1, "\u90DE"], [64047, 1, "\u96B7"], [64048, 1, "\u4FAE"], [64049, 1, "\u50E7"], [64050, 1, "\u514D"], [64051, 1, "\u52C9"], [64052, 1, "\u52E4"], [64053, 1, "\u5351"], [64054, 1, "\u559D"], [64055, 1, "\u5606"], [64056, 1, "\u5668"], [64057, 1, "\u5840"], [64058, 1, "\u58A8"], [64059, 1, "\u5C64"], [64060, 1, "\u5C6E"], [64061, 1, "\u6094"], [64062, 1, "\u6168"], [64063, 1, "\u618E"], [64064, 1, "\u61F2"], [64065, 1, "\u654F"], [64066, 1, "\u65E2"], [64067, 1, "\u6691"], [64068, 1, "\u6885"], [64069, 1, "\u6D77"], [64070, 1, "\u6E1A"], [64071, 1, "\u6F22"], [64072, 1, "\u716E"], [64073, 1, "\u722B"], [64074, 1, "\u7422"], [64075, 1, "\u7891"], [64076, 1, "\u793E"], [64077, 1, "\u7949"], [64078, 1, "\u7948"], [64079, 1, "\u7950"], [64080, 1, "\u7956"], [64081, 1, "\u795D"], [64082, 1, "\u798D"], [64083, 1, "\u798E"], [64084, 1, "\u7A40"], [64085, 1, "\u7A81"], [64086, 1, "\u7BC0"], [64087, 1, "\u7DF4"], [64088, 1, "\u7E09"], [64089, 1, "\u7E41"], [64090, 1, "\u7F72"], [64091, 1, "\u8005"], [64092, 1, "\u81ED"], [[64093, 64094], 1, "\u8279"], [64095, 1, "\u8457"], [64096, 1, "\u8910"], [64097, 1, "\u8996"], [64098, 1, "\u8B01"], [64099, 1, "\u8B39"], [64100, 1, "\u8CD3"], [64101, 1, "\u8D08"], [64102, 1, "\u8FB6"], [64103, 1, "\u9038"], [64104, 1, "\u96E3"], [64105, 1, "\u97FF"], [64106, 1, "\u983B"], [64107, 1, "\u6075"], [64108, 1, "\u{242EE}"], [64109, 1, "\u8218"], [[64110, 64111], 3], [64112, 1, "\u4E26"], [64113, 1, "\u51B5"], [64114, 1, "\u5168"], [64115, 1, "\u4F80"], [64116, 1, "\u5145"], [64117, 1, "\u5180"], [64118, 1, "\u52C7"], [64119, 1, "\u52FA"], [64120, 1, "\u559D"], [64121, 1, "\u5555"], [64122, 1, "\u5599"], [64123, 1, "\u55E2"], [64124, 1, "\u585A"], [64125, 1, "\u58B3"], [64126, 1, "\u5944"], [64127, 1, "\u5954"], [64128, 1, "\u5A62"], [64129, 1, "\u5B28"], [64130, 1, "\u5ED2"], [64131, 1, "\u5ED9"], [64132, 1, "\u5F69"], [64133, 1, "\u5FAD"], [64134, 1, "\u60D8"], [64135, 1, "\u614E"], [64136, 1, "\u6108"], [64137, 1, "\u618E"], [64138, 1, "\u6160"], [64139, 1, "\u61F2"], [64140, 1, "\u6234"], [64141, 1, "\u63C4"], [64142, 1, "\u641C"], [64143, 1, "\u6452"], [64144, 1, "\u6556"], [64145, 1, "\u6674"], [64146, 1, "\u6717"], [64147, 1, "\u671B"], [64148, 1, "\u6756"], [64149, 1, "\u6B79"], [64150, 1, "\u6BBA"], [64151, 1, "\u6D41"], [64152, 1, "\u6EDB"], [64153, 1, "\u6ECB"], [64154, 1, "\u6F22"], [64155, 1, "\u701E"], [64156, 1, "\u716E"], [64157, 1, "\u77A7"], [64158, 1, "\u7235"], [64159, 1, "\u72AF"], [64160, 1, "\u732A"], [64161, 1, "\u7471"], [64162, 1, "\u7506"], [64163, 1, "\u753B"], [64164, 1, "\u761D"], [64165, 1, "\u761F"], [64166, 1, "\u76CA"], [64167, 1, "\u76DB"], [64168, 1, "\u76F4"], [64169, 1, "\u774A"], [64170, 1, "\u7740"], [64171, 1, "\u78CC"], [64172, 1, "\u7AB1"], [64173, 1, "\u7BC0"], [64174, 1, "\u7C7B"], [64175, 1, "\u7D5B"], [64176, 1, "\u7DF4"], [64177, 1, "\u7F3E"], [64178, 1, "\u8005"], [64179, 1, "\u8352"], [64180, 1, "\u83EF"], [64181, 1, "\u8779"], [64182, 1, "\u8941"], [64183, 1, "\u8986"], [64184, 1, "\u8996"], [64185, 1, "\u8ABF"], [64186, 1, "\u8AF8"], [64187, 1, "\u8ACB"], [64188, 1, "\u8B01"], [64189, 1, "\u8AFE"], [64190, 1, "\u8AED"], [64191, 1, "\u8B39"], [64192, 1, "\u8B8A"], [64193, 1, "\u8D08"], [64194, 1, "\u8F38"], [64195, 1, "\u9072"], [64196, 1, "\u9199"], [64197, 1, "\u9276"], [64198, 1, "\u967C"], [64199, 1, "\u96E3"], [64200, 1, "\u9756"], [64201, 1, "\u97DB"], [64202, 1, "\u97FF"], [64203, 1, "\u980B"], [64204, 1, "\u983B"], [64205, 1, "\u9B12"], [64206, 1, "\u9F9C"], [64207, 1, "\u{2284A}"], [64208, 1, "\u{22844}"], [64209, 1, "\u{233D5}"], [64210, 1, "\u3B9D"], [64211, 1, "\u4018"], [64212, 1, "\u4039"], [64213, 1, "\u{25249}"], [64214, 1, "\u{25CD0}"], [64215, 1, "\u{27ED3}"], [64216, 1, "\u9F43"], [64217, 1, "\u9F8E"], [[64218, 64255], 3], [64256, 1, "ff"], [64257, 1, "fi"], [64258, 1, "fl"], [64259, 1, "ffi"], [64260, 1, "ffl"], [[64261, 64262], 1, "st"], [[64263, 64274], 3], [64275, 1, "\u0574\u0576"], [64276, 1, "\u0574\u0565"], [64277, 1, "\u0574\u056B"], [64278, 1, "\u057E\u0576"], [64279, 1, "\u0574\u056D"], [[64280, 64284], 3], [64285, 1, "\u05D9\u05B4"], [64286, 2], [64287, 1, "\u05F2\u05B7"], [64288, 1, "\u05E2"], [64289, 1, "\u05D0"], [64290, 1, "\u05D3"], [64291, 1, "\u05D4"], [64292, 1, "\u05DB"], [64293, 1, "\u05DC"], [64294, 1, "\u05DD"], [64295, 1, "\u05E8"], [64296, 1, "\u05EA"], [64297, 1, "+"], [64298, 1, "\u05E9\u05C1"], [64299, 1, "\u05E9\u05C2"], [64300, 1, "\u05E9\u05BC\u05C1"], [64301, 1, "\u05E9\u05BC\u05C2"], [64302, 1, "\u05D0\u05B7"], [64303, 1, "\u05D0\u05B8"], [64304, 1, "\u05D0\u05BC"], [64305, 1, "\u05D1\u05BC"], [64306, 1, "\u05D2\u05BC"], [64307, 1, "\u05D3\u05BC"], [64308, 1, "\u05D4\u05BC"], [64309, 1, "\u05D5\u05BC"], [64310, 1, "\u05D6\u05BC"], [64311, 3], [64312, 1, "\u05D8\u05BC"], [64313, 1, "\u05D9\u05BC"], [64314, 1, "\u05DA\u05BC"], [64315, 1, "\u05DB\u05BC"], [64316, 1, "\u05DC\u05BC"], [64317, 3], [64318, 1, "\u05DE\u05BC"], [64319, 3], [64320, 1, "\u05E0\u05BC"], [64321, 1, "\u05E1\u05BC"], [64322, 3], [64323, 1, "\u05E3\u05BC"], [64324, 1, "\u05E4\u05BC"], [64325, 3], [64326, 1, "\u05E6\u05BC"], [64327, 1, "\u05E7\u05BC"], [64328, 1, "\u05E8\u05BC"], [64329, 1, "\u05E9\u05BC"], [64330, 1, "\u05EA\u05BC"], [64331, 1, "\u05D5\u05B9"], [64332, 1, "\u05D1\u05BF"], [64333, 1, "\u05DB\u05BF"], [64334, 1, "\u05E4\u05BF"], [64335, 1, "\u05D0\u05DC"], [[64336, 64337], 1, "\u0671"], [[64338, 64341], 1, "\u067B"], [[64342, 64345], 1, "\u067E"], [[64346, 64349], 1, "\u0680"], [[64350, 64353], 1, "\u067A"], [[64354, 64357], 1, "\u067F"], [[64358, 64361], 1, "\u0679"], [[64362, 64365], 1, "\u06A4"], [[64366, 64369], 1, "\u06A6"], [[64370, 64373], 1, "\u0684"], [[64374, 64377], 1, "\u0683"], [[64378, 64381], 1, "\u0686"], [[64382, 64385], 1, "\u0687"], [[64386, 64387], 1, "\u068D"], [[64388, 64389], 1, "\u068C"], [[64390, 64391], 1, "\u068E"], [[64392, 64393], 1, "\u0688"], [[64394, 64395], 1, "\u0698"], [[64396, 64397], 1, "\u0691"], [[64398, 64401], 1, "\u06A9"], [[64402, 64405], 1, "\u06AF"], [[64406, 64409], 1, "\u06B3"], [[64410, 64413], 1, "\u06B1"], [[64414, 64415], 1, "\u06BA"], [[64416, 64419], 1, "\u06BB"], [[64420, 64421], 1, "\u06C0"], [[64422, 64425], 1, "\u06C1"], [[64426, 64429], 1, "\u06BE"], [[64430, 64431], 1, "\u06D2"], [[64432, 64433], 1, "\u06D3"], [[64434, 64449], 2], [64450, 2], [[64451, 64466], 3], [[64467, 64470], 1, "\u06AD"], [[64471, 64472], 1, "\u06C7"], [[64473, 64474], 1, "\u06C6"], [[64475, 64476], 1, "\u06C8"], [64477, 1, "\u06C7\u0674"], [[64478, 64479], 1, "\u06CB"], [[64480, 64481], 1, "\u06C5"], [[64482, 64483], 1, "\u06C9"], [[64484, 64487], 1, "\u06D0"], [[64488, 64489], 1, "\u0649"], [[64490, 64491], 1, "\u0626\u0627"], [[64492, 64493], 1, "\u0626\u06D5"], [[64494, 64495], 1, "\u0626\u0648"], [[64496, 64497], 1, "\u0626\u06C7"], [[64498, 64499], 1, "\u0626\u06C6"], [[64500, 64501], 1, "\u0626\u06C8"], [[64502, 64504], 1, "\u0626\u06D0"], [[64505, 64507], 1, "\u0626\u0649"], [[64508, 64511], 1, "\u06CC"], [64512, 1, "\u0626\u062C"], [64513, 1, "\u0626\u062D"], [64514, 1, "\u0626\u0645"], [64515, 1, "\u0626\u0649"], [64516, 1, "\u0626\u064A"], [64517, 1, "\u0628\u062C"], [64518, 1, "\u0628\u062D"], [64519, 1, "\u0628\u062E"], [64520, 1, "\u0628\u0645"], [64521, 1, "\u0628\u0649"], [64522, 1, "\u0628\u064A"], [64523, 1, "\u062A\u062C"], [64524, 1, "\u062A\u062D"], [64525, 1, "\u062A\u062E"], [64526, 1, "\u062A\u0645"], [64527, 1, "\u062A\u0649"], [64528, 1, "\u062A\u064A"], [64529, 1, "\u062B\u062C"], [64530, 1, "\u062B\u0645"], [64531, 1, "\u062B\u0649"], [64532, 1, "\u062B\u064A"], [64533, 1, "\u062C\u062D"], [64534, 1, "\u062C\u0645"], [64535, 1, "\u062D\u062C"], [64536, 1, "\u062D\u0645"], [64537, 1, "\u062E\u062C"], [64538, 1, "\u062E\u062D"], [64539, 1, "\u062E\u0645"], [64540, 1, "\u0633\u062C"], [64541, 1, "\u0633\u062D"], [64542, 1, "\u0633\u062E"], [64543, 1, "\u0633\u0645"], [64544, 1, "\u0635\u062D"], [64545, 1, "\u0635\u0645"], [64546, 1, "\u0636\u062C"], [64547, 1, "\u0636\u062D"], [64548, 1, "\u0636\u062E"], [64549, 1, "\u0636\u0645"], [64550, 1, "\u0637\u062D"], [64551, 1, "\u0637\u0645"], [64552, 1, "\u0638\u0645"], [64553, 1, "\u0639\u062C"], [64554, 1, "\u0639\u0645"], [64555, 1, "\u063A\u062C"], [64556, 1, "\u063A\u0645"], [64557, 1, "\u0641\u062C"], [64558, 1, "\u0641\u062D"], [64559, 1, "\u0641\u062E"], [64560, 1, "\u0641\u0645"], [64561, 1, "\u0641\u0649"], [64562, 1, "\u0641\u064A"], [64563, 1, "\u0642\u062D"], [64564, 1, "\u0642\u0645"], [64565, 1, "\u0642\u0649"], [64566, 1, "\u0642\u064A"], [64567, 1, "\u0643\u0627"], [64568, 1, "\u0643\u062C"], [64569, 1, "\u0643\u062D"], [64570, 1, "\u0643\u062E"], [64571, 1, "\u0643\u0644"], [64572, 1, "\u0643\u0645"], [64573, 1, "\u0643\u0649"], [64574, 1, "\u0643\u064A"], [64575, 1, "\u0644\u062C"], [64576, 1, "\u0644\u062D"], [64577, 1, "\u0644\u062E"], [64578, 1, "\u0644\u0645"], [64579, 1, "\u0644\u0649"], [64580, 1, "\u0644\u064A"], [64581, 1, "\u0645\u062C"], [64582, 1, "\u0645\u062D"], [64583, 1, "\u0645\u062E"], [64584, 1, "\u0645\u0645"], [64585, 1, "\u0645\u0649"], [64586, 1, "\u0645\u064A"], [64587, 1, "\u0646\u062C"], [64588, 1, "\u0646\u062D"], [64589, 1, "\u0646\u062E"], [64590, 1, "\u0646\u0645"], [64591, 1, "\u0646\u0649"], [64592, 1, "\u0646\u064A"], [64593, 1, "\u0647\u062C"], [64594, 1, "\u0647\u0645"], [64595, 1, "\u0647\u0649"], [64596, 1, "\u0647\u064A"], [64597, 1, "\u064A\u062C"], [64598, 1, "\u064A\u062D"], [64599, 1, "\u064A\u062E"], [64600, 1, "\u064A\u0645"], [64601, 1, "\u064A\u0649"], [64602, 1, "\u064A\u064A"], [64603, 1, "\u0630\u0670"], [64604, 1, "\u0631\u0670"], [64605, 1, "\u0649\u0670"], [64606, 1, " \u064C\u0651"], [64607, 1, " \u064D\u0651"], [64608, 1, " \u064E\u0651"], [64609, 1, " \u064F\u0651"], [64610, 1, " \u0650\u0651"], [64611, 1, " \u0651\u0670"], [64612, 1, "\u0626\u0631"], [64613, 1, "\u0626\u0632"], [64614, 1, "\u0626\u0645"], [64615, 1, "\u0626\u0646"], [64616, 1, "\u0626\u0649"], [64617, 1, "\u0626\u064A"], [64618, 1, "\u0628\u0631"], [64619, 1, "\u0628\u0632"], [64620, 1, "\u0628\u0645"], [64621, 1, "\u0628\u0646"], [64622, 1, "\u0628\u0649"], [64623, 1, "\u0628\u064A"], [64624, 1, "\u062A\u0631"], [64625, 1, "\u062A\u0632"], [64626, 1, "\u062A\u0645"], [64627, 1, "\u062A\u0646"], [64628, 1, "\u062A\u0649"], [64629, 1, "\u062A\u064A"], [64630, 1, "\u062B\u0631"], [64631, 1, "\u062B\u0632"], [64632, 1, "\u062B\u0645"], [64633, 1, "\u062B\u0646"], [64634, 1, "\u062B\u0649"], [64635, 1, "\u062B\u064A"], [64636, 1, "\u0641\u0649"], [64637, 1, "\u0641\u064A"], [64638, 1, "\u0642\u0649"], [64639, 1, "\u0642\u064A"], [64640, 1, "\u0643\u0627"], [64641, 1, "\u0643\u0644"], [64642, 1, "\u0643\u0645"], [64643, 1, "\u0643\u0649"], [64644, 1, "\u0643\u064A"], [64645, 1, "\u0644\u0645"], [64646, 1, "\u0644\u0649"], [64647, 1, "\u0644\u064A"], [64648, 1, "\u0645\u0627"], [64649, 1, "\u0645\u0645"], [64650, 1, "\u0646\u0631"], [64651, 1, "\u0646\u0632"], [64652, 1, "\u0646\u0645"], [64653, 1, "\u0646\u0646"], [64654, 1, "\u0646\u0649"], [64655, 1, "\u0646\u064A"], [64656, 1, "\u0649\u0670"], [64657, 1, "\u064A\u0631"], [64658, 1, "\u064A\u0632"], [64659, 1, "\u064A\u0645"], [64660, 1, "\u064A\u0646"], [64661, 1, "\u064A\u0649"], [64662, 1, "\u064A\u064A"], [64663, 1, "\u0626\u062C"], [64664, 1, "\u0626\u062D"], [64665, 1, "\u0626\u062E"], [64666, 1, "\u0626\u0645"], [64667, 1, "\u0626\u0647"], [64668, 1, "\u0628\u062C"], [64669, 1, "\u0628\u062D"], [64670, 1, "\u0628\u062E"], [64671, 1, "\u0628\u0645"], [64672, 1, "\u0628\u0647"], [64673, 1, "\u062A\u062C"], [64674, 1, "\u062A\u062D"], [64675, 1, "\u062A\u062E"], [64676, 1, "\u062A\u0645"], [64677, 1, "\u062A\u0647"], [64678, 1, "\u062B\u0645"], [64679, 1, "\u062C\u062D"], [64680, 1, "\u062C\u0645"], [64681, 1, "\u062D\u062C"], [64682, 1, "\u062D\u0645"], [64683, 1, "\u062E\u062C"], [64684, 1, "\u062E\u0645"], [64685, 1, "\u0633\u062C"], [64686, 1, "\u0633\u062D"], [64687, 1, "\u0633\u062E"], [64688, 1, "\u0633\u0645"], [64689, 1, "\u0635\u062D"], [64690, 1, "\u0635\u062E"], [64691, 1, "\u0635\u0645"], [64692, 1, "\u0636\u062C"], [64693, 1, "\u0636\u062D"], [64694, 1, "\u0636\u062E"], [64695, 1, "\u0636\u0645"], [64696, 1, "\u0637\u062D"], [64697, 1, "\u0638\u0645"], [64698, 1, "\u0639\u062C"], [64699, 1, "\u0639\u0645"], [64700, 1, "\u063A\u062C"], [64701, 1, "\u063A\u0645"], [64702, 1, "\u0641\u062C"], [64703, 1, "\u0641\u062D"], [64704, 1, "\u0641\u062E"], [64705, 1, "\u0641\u0645"], [64706, 1, "\u0642\u062D"], [64707, 1, "\u0642\u0645"], [64708, 1, "\u0643\u062C"], [64709, 1, "\u0643\u062D"], [64710, 1, "\u0643\u062E"], [64711, 1, "\u0643\u0644"], [64712, 1, "\u0643\u0645"], [64713, 1, "\u0644\u062C"], [64714, 1, "\u0644\u062D"], [64715, 1, "\u0644\u062E"], [64716, 1, "\u0644\u0645"], [64717, 1, "\u0644\u0647"], [64718, 1, "\u0645\u062C"], [64719, 1, "\u0645\u062D"], [64720, 1, "\u0645\u062E"], [64721, 1, "\u0645\u0645"], [64722, 1, "\u0646\u062C"], [64723, 1, "\u0646\u062D"], [64724, 1, "\u0646\u062E"], [64725, 1, "\u0646\u0645"], [64726, 1, "\u0646\u0647"], [64727, 1, "\u0647\u062C"], [64728, 1, "\u0647\u0645"], [64729, 1, "\u0647\u0670"], [64730, 1, "\u064A\u062C"], [64731, 1, "\u064A\u062D"], [64732, 1, "\u064A\u062E"], [64733, 1, "\u064A\u0645"], [64734, 1, "\u064A\u0647"], [64735, 1, "\u0626\u0645"], [64736, 1, "\u0626\u0647"], [64737, 1, "\u0628\u0645"], [64738, 1, "\u0628\u0647"], [64739, 1, "\u062A\u0645"], [64740, 1, "\u062A\u0647"], [64741, 1, "\u062B\u0645"], [64742, 1, "\u062B\u0647"], [64743, 1, "\u0633\u0645"], [64744, 1, "\u0633\u0647"], [64745, 1, "\u0634\u0645"], [64746, 1, "\u0634\u0647"], [64747, 1, "\u0643\u0644"], [64748, 1, "\u0643\u0645"], [64749, 1, "\u0644\u0645"], [64750, 1, "\u0646\u0645"], [64751, 1, "\u0646\u0647"], [64752, 1, "\u064A\u0645"], [64753, 1, "\u064A\u0647"], [64754, 1, "\u0640\u064E\u0651"], [64755, 1, "\u0640\u064F\u0651"], [64756, 1, "\u0640\u0650\u0651"], [64757, 1, "\u0637\u0649"], [64758, 1, "\u0637\u064A"], [64759, 1, "\u0639\u0649"], [64760, 1, "\u0639\u064A"], [64761, 1, "\u063A\u0649"], [64762, 1, "\u063A\u064A"], [64763, 1, "\u0633\u0649"], [64764, 1, "\u0633\u064A"], [64765, 1, "\u0634\u0649"], [64766, 1, "\u0634\u064A"], [64767, 1, "\u062D\u0649"], [64768, 1, "\u062D\u064A"], [64769, 1, "\u062C\u0649"], [64770, 1, "\u062C\u064A"], [64771, 1, "\u062E\u0649"], [64772, 1, "\u062E\u064A"], [64773, 1, "\u0635\u0649"], [64774, 1, "\u0635\u064A"], [64775, 1, "\u0636\u0649"], [64776, 1, "\u0636\u064A"], [64777, 1, "\u0634\u062C"], [64778, 1, "\u0634\u062D"], [64779, 1, "\u0634\u062E"], [64780, 1, "\u0634\u0645"], [64781, 1, "\u0634\u0631"], [64782, 1, "\u0633\u0631"], [64783, 1, "\u0635\u0631"], [64784, 1, "\u0636\u0631"], [64785, 1, "\u0637\u0649"], [64786, 1, "\u0637\u064A"], [64787, 1, "\u0639\u0649"], [64788, 1, "\u0639\u064A"], [64789, 1, "\u063A\u0649"], [64790, 1, "\u063A\u064A"], [64791, 1, "\u0633\u0649"], [64792, 1, "\u0633\u064A"], [64793, 1, "\u0634\u0649"], [64794, 1, "\u0634\u064A"], [64795, 1, "\u062D\u0649"], [64796, 1, "\u062D\u064A"], [64797, 1, "\u062C\u0649"], [64798, 1, "\u062C\u064A"], [64799, 1, "\u062E\u0649"], [64800, 1, "\u062E\u064A"], [64801, 1, "\u0635\u0649"], [64802, 1, "\u0635\u064A"], [64803, 1, "\u0636\u0649"], [64804, 1, "\u0636\u064A"], [64805, 1, "\u0634\u062C"], [64806, 1, "\u0634\u062D"], [64807, 1, "\u0634\u062E"], [64808, 1, "\u0634\u0645"], [64809, 1, "\u0634\u0631"], [64810, 1, "\u0633\u0631"], [64811, 1, "\u0635\u0631"], [64812, 1, "\u0636\u0631"], [64813, 1, "\u0634\u062C"], [64814, 1, "\u0634\u062D"], [64815, 1, "\u0634\u062E"], [64816, 1, "\u0634\u0645"], [64817, 1, "\u0633\u0647"], [64818, 1, "\u0634\u0647"], [64819, 1, "\u0637\u0645"], [64820, 1, "\u0633\u062C"], [64821, 1, "\u0633\u062D"], [64822, 1, "\u0633\u062E"], [64823, 1, "\u0634\u062C"], [64824, 1, "\u0634\u062D"], [64825, 1, "\u0634\u062E"], [64826, 1, "\u0637\u0645"], [64827, 1, "\u0638\u0645"], [[64828, 64829], 1, "\u0627\u064B"], [[64830, 64831], 2], [[64832, 64847], 2], [64848, 1, "\u062A\u062C\u0645"], [[64849, 64850], 1, "\u062A\u062D\u062C"], [64851, 1, "\u062A\u062D\u0645"], [64852, 1, "\u062A\u062E\u0645"], [64853, 1, "\u062A\u0645\u062C"], [64854, 1, "\u062A\u0645\u062D"], [64855, 1, "\u062A\u0645\u062E"], [[64856, 64857], 1, "\u062C\u0645\u062D"], [64858, 1, "\u062D\u0645\u064A"], [64859, 1, "\u062D\u0645\u0649"], [64860, 1, "\u0633\u062D\u062C"], [64861, 1, "\u0633\u062C\u062D"], [64862, 1, "\u0633\u062C\u0649"], [[64863, 64864], 1, "\u0633\u0645\u062D"], [64865, 1, "\u0633\u0645\u062C"], [[64866, 64867], 1, "\u0633\u0645\u0645"], [[64868, 64869], 1, "\u0635\u062D\u062D"], [64870, 1, "\u0635\u0645\u0645"], [[64871, 64872], 1, "\u0634\u062D\u0645"], [64873, 1, "\u0634\u062C\u064A"], [[64874, 64875], 1, "\u0634\u0645\u062E"], [[64876, 64877], 1, "\u0634\u0645\u0645"], [64878, 1, "\u0636\u062D\u0649"], [[64879, 64880], 1, "\u0636\u062E\u0645"], [[64881, 64882], 1, "\u0637\u0645\u062D"], [64883, 1, "\u0637\u0645\u0645"], [64884, 1, "\u0637\u0645\u064A"], [64885, 1, "\u0639\u062C\u0645"], [[64886, 64887], 1, "\u0639\u0645\u0645"], [64888, 1, "\u0639\u0645\u0649"], [64889, 1, "\u063A\u0645\u0645"], [64890, 1, "\u063A\u0645\u064A"], [64891, 1, "\u063A\u0645\u0649"], [[64892, 64893], 1, "\u0641\u062E\u0645"], [64894, 1, "\u0642\u0645\u062D"], [64895, 1, "\u0642\u0645\u0645"], [64896, 1, "\u0644\u062D\u0645"], [64897, 1, "\u0644\u062D\u064A"], [64898, 1, "\u0644\u062D\u0649"], [[64899, 64900], 1, "\u0644\u062C\u062C"], [[64901, 64902], 1, "\u0644\u062E\u0645"], [[64903, 64904], 1, "\u0644\u0645\u062D"], [64905, 1, "\u0645\u062D\u062C"], [64906, 1, "\u0645\u062D\u0645"], [64907, 1, "\u0645\u062D\u064A"], [64908, 1, "\u0645\u062C\u062D"], [64909, 1, "\u0645\u062C\u0645"], [64910, 1, "\u0645\u062E\u062C"], [64911, 1, "\u0645\u062E\u0645"], [[64912, 64913], 3], [64914, 1, "\u0645\u062C\u062E"], [64915, 1, "\u0647\u0645\u062C"], [64916, 1, "\u0647\u0645\u0645"], [64917, 1, "\u0646\u062D\u0645"], [64918, 1, "\u0646\u062D\u0649"], [[64919, 64920], 1, "\u0646\u062C\u0645"], [64921, 1, "\u0646\u062C\u0649"], [64922, 1, "\u0646\u0645\u064A"], [64923, 1, "\u0646\u0645\u0649"], [[64924, 64925], 1, "\u064A\u0645\u0645"], [64926, 1, "\u0628\u062E\u064A"], [64927, 1, "\u062A\u062C\u064A"], [64928, 1, "\u062A\u062C\u0649"], [64929, 1, "\u062A\u062E\u064A"], [64930, 1, "\u062A\u062E\u0649"], [64931, 1, "\u062A\u0645\u064A"], [64932, 1, "\u062A\u0645\u0649"], [64933, 1, "\u062C\u0645\u064A"], [64934, 1, "\u062C\u062D\u0649"], [64935, 1, "\u062C\u0645\u0649"], [64936, 1, "\u0633\u062E\u0649"], [64937, 1, "\u0635\u062D\u064A"], [64938, 1, "\u0634\u062D\u064A"], [64939, 1, "\u0636\u062D\u064A"], [64940, 1, "\u0644\u062C\u064A"], [64941, 1, "\u0644\u0645\u064A"], [64942, 1, "\u064A\u062D\u064A"], [64943, 1, "\u064A\u062C\u064A"], [64944, 1, "\u064A\u0645\u064A"], [64945, 1, "\u0645\u0645\u064A"], [64946, 1, "\u0642\u0645\u064A"], [64947, 1, "\u0646\u062D\u064A"], [64948, 1, "\u0642\u0645\u062D"], [64949, 1, "\u0644\u062D\u0645"], [64950, 1, "\u0639\u0645\u064A"], [64951, 1, "\u0643\u0645\u064A"], [64952, 1, "\u0646\u062C\u062D"], [64953, 1, "\u0645\u062E\u064A"], [64954, 1, "\u0644\u062C\u0645"], [64955, 1, "\u0643\u0645\u0645"], [64956, 1, "\u0644\u062C\u0645"], [64957, 1, "\u0646\u062C\u062D"], [64958, 1, "\u062C\u062D\u064A"], [64959, 1, "\u062D\u062C\u064A"], [64960, 1, "\u0645\u062C\u064A"], [64961, 1, "\u0641\u0645\u064A"], [64962, 1, "\u0628\u062D\u064A"], [64963, 1, "\u0643\u0645\u0645"], [64964, 1, "\u0639\u062C\u0645"], [64965, 1, "\u0635\u0645\u0645"], [64966, 1, "\u0633\u062E\u064A"], [64967, 1, "\u0646\u062C\u064A"], [[64968, 64974], 3], [64975, 2], [[64976, 65007], 3], [65008, 1, "\u0635\u0644\u06D2"], [65009, 1, "\u0642\u0644\u06D2"], [65010, 1, "\u0627\u0644\u0644\u0647"], [65011, 1, "\u0627\u0643\u0628\u0631"], [65012, 1, "\u0645\u062D\u0645\u062F"], [65013, 1, "\u0635\u0644\u0639\u0645"], [65014, 1, "\u0631\u0633\u0648\u0644"], [65015, 1, "\u0639\u0644\u064A\u0647"], [65016, 1, "\u0648\u0633\u0644\u0645"], [65017, 1, "\u0635\u0644\u0649"], [65018, 1, "\u0635\u0644\u0649 \u0627\u0644\u0644\u0647 \u0639\u0644\u064A\u0647 \u0648\u0633\u0644\u0645"], [65019, 1, "\u062C\u0644 \u062C\u0644\u0627\u0644\u0647"], [65020, 1, "\u0631\u06CC\u0627\u0644"], [65021, 2], [[65022, 65023], 2], [[65024, 65039], 7], [65040, 1, ","], [65041, 1, "\u3001"], [65042, 3], [65043, 1, ":"], [65044, 1, ";"], [65045, 1, "!"], [65046, 1, "?"], [65047, 1, "\u3016"], [65048, 1, "\u3017"], [65049, 3], [[65050, 65055], 3], [[65056, 65059], 2], [[65060, 65062], 2], [[65063, 65069], 2], [[65070, 65071], 2], [65072, 3], [65073, 1, "\u2014"], [65074, 1, "\u2013"], [[65075, 65076], 1, "_"], [65077, 1, "("], [65078, 1, ")"], [65079, 1, "{"], [65080, 1, "}"], [65081, 1, "\u3014"], [65082, 1, "\u3015"], [65083, 1, "\u3010"], [65084, 1, "\u3011"], [65085, 1, "\u300A"], [65086, 1, "\u300B"], [65087, 1, "\u3008"], [65088, 1, "\u3009"], [65089, 1, "\u300C"], [65090, 1, "\u300D"], [65091, 1, "\u300E"], [65092, 1, "\u300F"], [[65093, 65094], 2], [65095, 1, "["], [65096, 1, "]"], [[65097, 65100], 1, " \u0305"], [[65101, 65103], 1, "_"], [65104, 1, ","], [65105, 1, "\u3001"], [65106, 3], [65107, 3], [65108, 1, ";"], [65109, 1, ":"], [65110, 1, "?"], [65111, 1, "!"], [65112, 1, "\u2014"], [65113, 1, "("], [65114, 1, ")"], [65115, 1, "{"], [65116, 1, "}"], [65117, 1, "\u3014"], [65118, 1, "\u3015"], [65119, 1, "#"], [65120, 1, "&"], [65121, 1, "*"], [65122, 1, "+"], [65123, 1, "-"], [65124, 1, "<"], [65125, 1, ">"], [65126, 1, "="], [65127, 3], [65128, 1, "\\"], [65129, 1, "$"], [65130, 1, "%"], [65131, 1, "@"], [[65132, 65135], 3], [65136, 1, " \u064B"], [65137, 1, "\u0640\u064B"], [65138, 1, " \u064C"], [65139, 2], [65140, 1, " \u064D"], [65141, 3], [65142, 1, " \u064E"], [65143, 1, "\u0640\u064E"], [65144, 1, " \u064F"], [65145, 1, "\u0640\u064F"], [65146, 1, " \u0650"], [65147, 1, "\u0640\u0650"], [65148, 1, " \u0651"], [65149, 1, "\u0640\u0651"], [65150, 1, " \u0652"], [65151, 1, "\u0640\u0652"], [65152, 1, "\u0621"], [[65153, 65154], 1, "\u0622"], [[65155, 65156], 1, "\u0623"], [[65157, 65158], 1, "\u0624"], [[65159, 65160], 1, "\u0625"], [[65161, 65164], 1, "\u0626"], [[65165, 65166], 1, "\u0627"], [[65167, 65170], 1, "\u0628"], [[65171, 65172], 1, "\u0629"], [[65173, 65176], 1, "\u062A"], [[65177, 65180], 1, "\u062B"], [[65181, 65184], 1, "\u062C"], [[65185, 65188], 1, "\u062D"], [[65189, 65192], 1, "\u062E"], [[65193, 65194], 1, "\u062F"], [[65195, 65196], 1, "\u0630"], [[65197, 65198], 1, "\u0631"], [[65199, 65200], 1, "\u0632"], [[65201, 65204], 1, "\u0633"], [[65205, 65208], 1, "\u0634"], [[65209, 65212], 1, "\u0635"], [[65213, 65216], 1, "\u0636"], [[65217, 65220], 1, "\u0637"], [[65221, 65224], 1, "\u0638"], [[65225, 65228], 1, "\u0639"], [[65229, 65232], 1, "\u063A"], [[65233, 65236], 1, "\u0641"], [[65237, 65240], 1, "\u0642"], [[65241, 65244], 1, "\u0643"], [[65245, 65248], 1, "\u0644"], [[65249, 65252], 1, "\u0645"], [[65253, 65256], 1, "\u0646"], [[65257, 65260], 1, "\u0647"], [[65261, 65262], 1, "\u0648"], [[65263, 65264], 1, "\u0649"], [[65265, 65268], 1, "\u064A"], [[65269, 65270], 1, "\u0644\u0622"], [[65271, 65272], 1, "\u0644\u0623"], [[65273, 65274], 1, "\u0644\u0625"], [[65275, 65276], 1, "\u0644\u0627"], [[65277, 65278], 3], [65279, 7], [65280, 3], [65281, 1, "!"], [65282, 1, '"'], [65283, 1, "#"], [65284, 1, "$"], [65285, 1, "%"], [65286, 1, "&"], [65287, 1, "'"], [65288, 1, "("], [65289, 1, ")"], [65290, 1, "*"], [65291, 1, "+"], [65292, 1, ","], [65293, 1, "-"], [65294, 1, "."], [65295, 1, "/"], [65296, 1, "0"], [65297, 1, "1"], [65298, 1, "2"], [65299, 1, "3"], [65300, 1, "4"], [65301, 1, "5"], [65302, 1, "6"], [65303, 1, "7"], [65304, 1, "8"], [65305, 1, "9"], [65306, 1, ":"], [65307, 1, ";"], [65308, 1, "<"], [65309, 1, "="], [65310, 1, ">"], [65311, 1, "?"], [65312, 1, "@"], [65313, 1, "a"], [65314, 1, "b"], [65315, 1, "c"], [65316, 1, "d"], [65317, 1, "e"], [65318, 1, "f"], [65319, 1, "g"], [65320, 1, "h"], [65321, 1, "i"], [65322, 1, "j"], [65323, 1, "k"], [65324, 1, "l"], [65325, 1, "m"], [65326, 1, "n"], [65327, 1, "o"], [65328, 1, "p"], [65329, 1, "q"], [65330, 1, "r"], [65331, 1, "s"], [65332, 1, "t"], [65333, 1, "u"], [65334, 1, "v"], [65335, 1, "w"], [65336, 1, "x"], [65337, 1, "y"], [65338, 1, "z"], [65339, 1, "["], [65340, 1, "\\"], [65341, 1, "]"], [65342, 1, "^"], [65343, 1, "_"], [65344, 1, "`"], [65345, 1, "a"], [65346, 1, "b"], [65347, 1, "c"], [65348, 1, "d"], [65349, 1, "e"], [65350, 1, "f"], [65351, 1, "g"], [65352, 1, "h"], [65353, 1, "i"], [65354, 1, "j"], [65355, 1, "k"], [65356, 1, "l"], [65357, 1, "m"], [65358, 1, "n"], [65359, 1, "o"], [65360, 1, "p"], [65361, 1, "q"], [65362, 1, "r"], [65363, 1, "s"], [65364, 1, "t"], [65365, 1, "u"], [65366, 1, "v"], [65367, 1, "w"], [65368, 1, "x"], [65369, 1, "y"], [65370, 1, "z"], [65371, 1, "{"], [65372, 1, "|"], [65373, 1, "}"], [65374, 1, "~"], [65375, 1, "\u2985"], [65376, 1, "\u2986"], [65377, 1, "."], [65378, 1, "\u300C"], [65379, 1, "\u300D"], [65380, 1, "\u3001"], [65381, 1, "\u30FB"], [65382, 1, "\u30F2"], [65383, 1, "\u30A1"], [65384, 1, "\u30A3"], [65385, 1, "\u30A5"], [65386, 1, "\u30A7"], [65387, 1, "\u30A9"], [65388, 1, "\u30E3"], [65389, 1, "\u30E5"], [65390, 1, "\u30E7"], [65391, 1, "\u30C3"], [65392, 1, "\u30FC"], [65393, 1, "\u30A2"], [65394, 1, "\u30A4"], [65395, 1, "\u30A6"], [65396, 1, "\u30A8"], [65397, 1, "\u30AA"], [65398, 1, "\u30AB"], [65399, 1, "\u30AD"], [65400, 1, "\u30AF"], [65401, 1, "\u30B1"], [65402, 1, "\u30B3"], [65403, 1, "\u30B5"], [65404, 1, "\u30B7"], [65405, 1, "\u30B9"], [65406, 1, "\u30BB"], [65407, 1, "\u30BD"], [65408, 1, "\u30BF"], [65409, 1, "\u30C1"], [65410, 1, "\u30C4"], [65411, 1, "\u30C6"], [65412, 1, "\u30C8"], [65413, 1, "\u30CA"], [65414, 1, "\u30CB"], [65415, 1, "\u30CC"], [65416, 1, "\u30CD"], [65417, 1, "\u30CE"], [65418, 1, "\u30CF"], [65419, 1, "\u30D2"], [65420, 1, "\u30D5"], [65421, 1, "\u30D8"], [65422, 1, "\u30DB"], [65423, 1, "\u30DE"], [65424, 1, "\u30DF"], [65425, 1, "\u30E0"], [65426, 1, "\u30E1"], [65427, 1, "\u30E2"], [65428, 1, "\u30E4"], [65429, 1, "\u30E6"], [65430, 1, "\u30E8"], [65431, 1, "\u30E9"], [65432, 1, "\u30EA"], [65433, 1, "\u30EB"], [65434, 1, "\u30EC"], [65435, 1, "\u30ED"], [65436, 1, "\u30EF"], [65437, 1, "\u30F3"], [65438, 1, "\u3099"], [65439, 1, "\u309A"], [65440, 7], [65441, 1, "\u1100"], [65442, 1, "\u1101"], [65443, 1, "\u11AA"], [65444, 1, "\u1102"], [65445, 1, "\u11AC"], [65446, 1, "\u11AD"], [65447, 1, "\u1103"], [65448, 1, "\u1104"], [65449, 1, "\u1105"], [65450, 1, "\u11B0"], [65451, 1, "\u11B1"], [65452, 1, "\u11B2"], [65453, 1, "\u11B3"], [65454, 1, "\u11B4"], [65455, 1, "\u11B5"], [65456, 1, "\u111A"], [65457, 1, "\u1106"], [65458, 1, "\u1107"], [65459, 1, "\u1108"], [65460, 1, "\u1121"], [65461, 1, "\u1109"], [65462, 1, "\u110A"], [65463, 1, "\u110B"], [65464, 1, "\u110C"], [65465, 1, "\u110D"], [65466, 1, "\u110E"], [65467, 1, "\u110F"], [65468, 1, "\u1110"], [65469, 1, "\u1111"], [65470, 1, "\u1112"], [[65471, 65473], 3], [65474, 1, "\u1161"], [65475, 1, "\u1162"], [65476, 1, "\u1163"], [65477, 1, "\u1164"], [65478, 1, "\u1165"], [65479, 1, "\u1166"], [[65480, 65481], 3], [65482, 1, "\u1167"], [65483, 1, "\u1168"], [65484, 1, "\u1169"], [65485, 1, "\u116A"], [65486, 1, "\u116B"], [65487, 1, "\u116C"], [[65488, 65489], 3], [65490, 1, "\u116D"], [65491, 1, "\u116E"], [65492, 1, "\u116F"], [65493, 1, "\u1170"], [65494, 1, "\u1171"], [65495, 1, "\u1172"], [[65496, 65497], 3], [65498, 1, "\u1173"], [65499, 1, "\u1174"], [65500, 1, "\u1175"], [[65501, 65503], 3], [65504, 1, "\xA2"], [65505, 1, "\xA3"], [65506, 1, "\xAC"], [65507, 1, " \u0304"], [65508, 1, "\xA6"], [65509, 1, "\xA5"], [65510, 1, "\u20A9"], [65511, 3], [65512, 1, "\u2502"], [65513, 1, "\u2190"], [65514, 1, "\u2191"], [65515, 1, "\u2192"], [65516, 1, "\u2193"], [65517, 1, "\u25A0"], [65518, 1, "\u25CB"], [[65519, 65528], 3], [[65529, 65531], 3], [65532, 3], [65533, 3], [[65534, 65535], 3], [[65536, 65547], 2], [65548, 3], [[65549, 65574], 2], [65575, 3], [[65576, 65594], 2], [65595, 3], [[65596, 65597], 2], [65598, 3], [[65599, 65613], 2], [[65614, 65615], 3], [[65616, 65629], 2], [[65630, 65663], 3], [[65664, 65786], 2], [[65787, 65791], 3], [[65792, 65794], 2], [[65795, 65798], 3], [[65799, 65843], 2], [[65844, 65846], 3], [[65847, 65855], 2], [[65856, 65930], 2], [[65931, 65932], 2], [[65933, 65934], 2], [65935, 3], [[65936, 65947], 2], [65948, 2], [[65949, 65951], 3], [65952, 2], [[65953, 65999], 3], [[66e3, 66044], 2], [66045, 2], [[66046, 66175], 3], [[66176, 66204], 2], [[66205, 66207], 3], [[66208, 66256], 2], [[66257, 66271], 3], [66272, 2], [[66273, 66299], 2], [[66300, 66303], 3], [[66304, 66334], 2], [66335, 2], [[66336, 66339], 2], [[66340, 66348], 3], [[66349, 66351], 2], [[66352, 66368], 2], [66369, 2], [[66370, 66377], 2], [66378, 2], [[66379, 66383], 3], [[66384, 66426], 2], [[66427, 66431], 3], [[66432, 66461], 2], [66462, 3], [66463, 2], [[66464, 66499], 2], [[66500, 66503], 3], [[66504, 66511], 2], [[66512, 66517], 2], [[66518, 66559], 3], [66560, 1, "\u{10428}"], [66561, 1, "\u{10429}"], [66562, 1, "\u{1042A}"], [66563, 1, "\u{1042B}"], [66564, 1, "\u{1042C}"], [66565, 1, "\u{1042D}"], [66566, 1, "\u{1042E}"], [66567, 1, "\u{1042F}"], [66568, 1, "\u{10430}"], [66569, 1, "\u{10431}"], [66570, 1, "\u{10432}"], [66571, 1, "\u{10433}"], [66572, 1, "\u{10434}"], [66573, 1, "\u{10435}"], [66574, 1, "\u{10436}"], [66575, 1, "\u{10437}"], [66576, 1, "\u{10438}"], [66577, 1, "\u{10439}"], [66578, 1, "\u{1043A}"], [66579, 1, "\u{1043B}"], [66580, 1, "\u{1043C}"], [66581, 1, "\u{1043D}"], [66582, 1, "\u{1043E}"], [66583, 1, "\u{1043F}"], [66584, 1, "\u{10440}"], [66585, 1, "\u{10441}"], [66586, 1, "\u{10442}"], [66587, 1, "\u{10443}"], [66588, 1, "\u{10444}"], [66589, 1, "\u{10445}"], [66590, 1, "\u{10446}"], [66591, 1, "\u{10447}"], [66592, 1, "\u{10448}"], [66593, 1, "\u{10449}"], [66594, 1, "\u{1044A}"], [66595, 1, "\u{1044B}"], [66596, 1, "\u{1044C}"], [66597, 1, "\u{1044D}"], [66598, 1, "\u{1044E}"], [66599, 1, "\u{1044F}"], [[66600, 66637], 2], [[66638, 66717], 2], [[66718, 66719], 3], [[66720, 66729], 2], [[66730, 66735], 3], [66736, 1, "\u{104D8}"], [66737, 1, "\u{104D9}"], [66738, 1, "\u{104DA}"], [66739, 1, "\u{104DB}"], [66740, 1, "\u{104DC}"], [66741, 1, "\u{104DD}"], [66742, 1, "\u{104DE}"], [66743, 1, "\u{104DF}"], [66744, 1, "\u{104E0}"], [66745, 1, "\u{104E1}"], [66746, 1, "\u{104E2}"], [66747, 1, "\u{104E3}"], [66748, 1, "\u{104E4}"], [66749, 1, "\u{104E5}"], [66750, 1, "\u{104E6}"], [66751, 1, "\u{104E7}"], [66752, 1, "\u{104E8}"], [66753, 1, "\u{104E9}"], [66754, 1, "\u{104EA}"], [66755, 1, "\u{104EB}"], [66756, 1, "\u{104EC}"], [66757, 1, "\u{104ED}"], [66758, 1, "\u{104EE}"], [66759, 1, "\u{104EF}"], [66760, 1, "\u{104F0}"], [66761, 1, "\u{104F1}"], [66762, 1, "\u{104F2}"], [66763, 1, "\u{104F3}"], [66764, 1, "\u{104F4}"], [66765, 1, "\u{104F5}"], [66766, 1, "\u{104F6}"], [66767, 1, "\u{104F7}"], [66768, 1, "\u{104F8}"], [66769, 1, "\u{104F9}"], [66770, 1, "\u{104FA}"], [66771, 1, "\u{104FB}"], [[66772, 66775], 3], [[66776, 66811], 2], [[66812, 66815], 3], [[66816, 66855], 2], [[66856, 66863], 3], [[66864, 66915], 2], [[66916, 66926], 3], [66927, 2], [66928, 1, "\u{10597}"], [66929, 1, "\u{10598}"], [66930, 1, "\u{10599}"], [66931, 1, "\u{1059A}"], [66932, 1, "\u{1059B}"], [66933, 1, "\u{1059C}"], [66934, 1, "\u{1059D}"], [66935, 1, "\u{1059E}"], [66936, 1, "\u{1059F}"], [66937, 1, "\u{105A0}"], [66938, 1, "\u{105A1}"], [66939, 3], [66940, 1, "\u{105A3}"], [66941, 1, "\u{105A4}"], [66942, 1, "\u{105A5}"], [66943, 1, "\u{105A6}"], [66944, 1, "\u{105A7}"], [66945, 1, "\u{105A8}"], [66946, 1, "\u{105A9}"], [66947, 1, "\u{105AA}"], [66948, 1, "\u{105AB}"], [66949, 1, "\u{105AC}"], [66950, 1, "\u{105AD}"], [66951, 1, "\u{105AE}"], [66952, 1, "\u{105AF}"], [66953, 1, "\u{105B0}"], [66954, 1, "\u{105B1}"], [66955, 3], [66956, 1, "\u{105B3}"], [66957, 1, "\u{105B4}"], [66958, 1, "\u{105B5}"], [66959, 1, "\u{105B6}"], [66960, 1, "\u{105B7}"], [66961, 1, "\u{105B8}"], [66962, 1, "\u{105B9}"], [66963, 3], [66964, 1, "\u{105BB}"], [66965, 1, "\u{105BC}"], [66966, 3], [[66967, 66977], 2], [66978, 3], [[66979, 66993], 2], [66994, 3], [[66995, 67001], 2], [67002, 3], [[67003, 67004], 2], [[67005, 67007], 3], [[67008, 67059], 2], [[67060, 67071], 3], [[67072, 67382], 2], [[67383, 67391], 3], [[67392, 67413], 2], [[67414, 67423], 3], [[67424, 67431], 2], [[67432, 67455], 3], [67456, 2], [67457, 1, "\u02D0"], [67458, 1, "\u02D1"], [67459, 1, "\xE6"], [67460, 1, "\u0299"], [67461, 1, "\u0253"], [67462, 3], [67463, 1, "\u02A3"], [67464, 1, "\uAB66"], [67465, 1, "\u02A5"], [67466, 1, "\u02A4"], [67467, 1, "\u0256"], [67468, 1, "\u0257"], [67469, 1, "\u1D91"], [67470, 1, "\u0258"], [67471, 1, "\u025E"], [67472, 1, "\u02A9"], [67473, 1, "\u0264"], [67474, 1, "\u0262"], [67475, 1, "\u0260"], [67476, 1, "\u029B"], [67477, 1, "\u0127"], [67478, 1, "\u029C"], [67479, 1, "\u0267"], [67480, 1, "\u0284"], [67481, 1, "\u02AA"], [67482, 1, "\u02AB"], [67483, 1, "\u026C"], [67484, 1, "\u{1DF04}"], [67485, 1, "\uA78E"], [67486, 1, "\u026E"], [67487, 1, "\u{1DF05}"], [67488, 1, "\u028E"], [67489, 1, "\u{1DF06}"], [67490, 1, "\xF8"], [67491, 1, "\u0276"], [67492, 1, "\u0277"], [67493, 1, "q"], [67494, 1, "\u027A"], [67495, 1, "\u{1DF08}"], [67496, 1, "\u027D"], [67497, 1, "\u027E"], [67498, 1, "\u0280"], [67499, 1, "\u02A8"], [67500, 1, "\u02A6"], [67501, 1, "\uAB67"], [67502, 1, "\u02A7"], [67503, 1, "\u0288"], [67504, 1, "\u2C71"], [67505, 3], [67506, 1, "\u028F"], [67507, 1, "\u02A1"], [67508, 1, "\u02A2"], [67509, 1, "\u0298"], [67510, 1, "\u01C0"], [67511, 1, "\u01C1"], [67512, 1, "\u01C2"], [67513, 1, "\u{1DF0A}"], [67514, 1, "\u{1DF1E}"], [[67515, 67583], 3], [[67584, 67589], 2], [[67590, 67591], 3], [67592, 2], [67593, 3], [[67594, 67637], 2], [67638, 3], [[67639, 67640], 2], [[67641, 67643], 3], [67644, 2], [[67645, 67646], 3], [67647, 2], [[67648, 67669], 2], [67670, 3], [[67671, 67679], 2], [[67680, 67702], 2], [[67703, 67711], 2], [[67712, 67742], 2], [[67743, 67750], 3], [[67751, 67759], 2], [[67760, 67807], 3], [[67808, 67826], 2], [67827, 3], [[67828, 67829], 2], [[67830, 67834], 3], [[67835, 67839], 2], [[67840, 67861], 2], [[67862, 67865], 2], [[67866, 67867], 2], [[67868, 67870], 3], [67871, 2], [[67872, 67897], 2], [[67898, 67902], 3], [67903, 2], [[67904, 67967], 3], [[67968, 68023], 2], [[68024, 68027], 3], [[68028, 68029], 2], [[68030, 68031], 2], [[68032, 68047], 2], [[68048, 68049], 3], [[68050, 68095], 2], [[68096, 68099], 2], [68100, 3], [[68101, 68102], 2], [[68103, 68107], 3], [[68108, 68115], 2], [68116, 3], [[68117, 68119], 2], [68120, 3], [[68121, 68147], 2], [[68148, 68149], 2], [[68150, 68151], 3], [[68152, 68154], 2], [[68155, 68158], 3], [68159, 2], [[68160, 68167], 2], [68168, 2], [[68169, 68175], 3], [[68176, 68184], 2], [[68185, 68191], 3], [[68192, 68220], 2], [[68221, 68223], 2], [[68224, 68252], 2], [[68253, 68255], 2], [[68256, 68287], 3], [[68288, 68295], 2], [68296, 2], [[68297, 68326], 2], [[68327, 68330], 3], [[68331, 68342], 2], [[68343, 68351], 3], [[68352, 68405], 2], [[68406, 68408], 3], [[68409, 68415], 2], [[68416, 68437], 2], [[68438, 68439], 3], [[68440, 68447], 2], [[68448, 68466], 2], [[68467, 68471], 3], [[68472, 68479], 2], [[68480, 68497], 2], [[68498, 68504], 3], [[68505, 68508], 2], [[68509, 68520], 3], [[68521, 68527], 2], [[68528, 68607], 3], [[68608, 68680], 2], [[68681, 68735], 3], [68736, 1, "\u{10CC0}"], [68737, 1, "\u{10CC1}"], [68738, 1, "\u{10CC2}"], [68739, 1, "\u{10CC3}"], [68740, 1, "\u{10CC4}"], [68741, 1, "\u{10CC5}"], [68742, 1, "\u{10CC6}"], [68743, 1, "\u{10CC7}"], [68744, 1, "\u{10CC8}"], [68745, 1, "\u{10CC9}"], [68746, 1, "\u{10CCA}"], [68747, 1, "\u{10CCB}"], [68748, 1, "\u{10CCC}"], [68749, 1, "\u{10CCD}"], [68750, 1, "\u{10CCE}"], [68751, 1, "\u{10CCF}"], [68752, 1, "\u{10CD0}"], [68753, 1, "\u{10CD1}"], [68754, 1, "\u{10CD2}"], [68755, 1, "\u{10CD3}"], [68756, 1, "\u{10CD4}"], [68757, 1, "\u{10CD5}"], [68758, 1, "\u{10CD6}"], [68759, 1, "\u{10CD7}"], [68760, 1, "\u{10CD8}"], [68761, 1, "\u{10CD9}"], [68762, 1, "\u{10CDA}"], [68763, 1, "\u{10CDB}"], [68764, 1, "\u{10CDC}"], [68765, 1, "\u{10CDD}"], [68766, 1, "\u{10CDE}"], [68767, 1, "\u{10CDF}"], [68768, 1, "\u{10CE0}"], [68769, 1, "\u{10CE1}"], [68770, 1, "\u{10CE2}"], [68771, 1, "\u{10CE3}"], [68772, 1, "\u{10CE4}"], [68773, 1, "\u{10CE5}"], [68774, 1, "\u{10CE6}"], [68775, 1, "\u{10CE7}"], [68776, 1, "\u{10CE8}"], [68777, 1, "\u{10CE9}"], [68778, 1, "\u{10CEA}"], [68779, 1, "\u{10CEB}"], [68780, 1, "\u{10CEC}"], [68781, 1, "\u{10CED}"], [68782, 1, "\u{10CEE}"], [68783, 1, "\u{10CEF}"], [68784, 1, "\u{10CF0}"], [68785, 1, "\u{10CF1}"], [68786, 1, "\u{10CF2}"], [[68787, 68799], 3], [[68800, 68850], 2], [[68851, 68857], 3], [[68858, 68863], 2], [[68864, 68903], 2], [[68904, 68911], 3], [[68912, 68921], 2], [[68922, 68927], 3], [[68928, 68943], 2], [68944, 1, "\u{10D70}"], [68945, 1, "\u{10D71}"], [68946, 1, "\u{10D72}"], [68947, 1, "\u{10D73}"], [68948, 1, "\u{10D74}"], [68949, 1, "\u{10D75}"], [68950, 1, "\u{10D76}"], [68951, 1, "\u{10D77}"], [68952, 1, "\u{10D78}"], [68953, 1, "\u{10D79}"], [68954, 1, "\u{10D7A}"], [68955, 1, "\u{10D7B}"], [68956, 1, "\u{10D7C}"], [68957, 1, "\u{10D7D}"], [68958, 1, "\u{10D7E}"], [68959, 1, "\u{10D7F}"], [68960, 1, "\u{10D80}"], [68961, 1, "\u{10D81}"], [68962, 1, "\u{10D82}"], [68963, 1, "\u{10D83}"], [68964, 1, "\u{10D84}"], [68965, 1, "\u{10D85}"], [[68966, 68968], 3], [[68969, 68973], 2], [68974, 2], [[68975, 68997], 2], [[68998, 69005], 3], [[69006, 69007], 2], [[69008, 69215], 3], [[69216, 69246], 2], [69247, 3], [[69248, 69289], 2], [69290, 3], [[69291, 69292], 2], [69293, 2], [[69294, 69295], 3], [[69296, 69297], 2], [[69298, 69313], 3], [[69314, 69316], 2], [[69317, 69371], 3], [69372, 2], [[69373, 69375], 2], [[69376, 69404], 2], [[69405, 69414], 2], [69415, 2], [[69416, 69423], 3], [[69424, 69456], 2], [[69457, 69465], 2], [[69466, 69487], 3], [[69488, 69509], 2], [[69510, 69513], 2], [[69514, 69551], 3], [[69552, 69572], 2], [[69573, 69579], 2], [[69580, 69599], 3], [[69600, 69622], 2], [[69623, 69631], 3], [[69632, 69702], 2], [[69703, 69709], 2], [[69710, 69713], 3], [[69714, 69733], 2], [[69734, 69743], 2], [[69744, 69749], 2], [[69750, 69758], 3], [69759, 2], [[69760, 69818], 2], [[69819, 69820], 2], [69821, 3], [[69822, 69825], 2], [69826, 2], [[69827, 69836], 3], [69837, 3], [[69838, 69839], 3], [[69840, 69864], 2], [[69865, 69871], 3], [[69872, 69881], 2], [[69882, 69887], 3], [[69888, 69940], 2], [69941, 3], [[69942, 69951], 2], [[69952, 69955], 2], [[69956, 69958], 2], [69959, 2], [[69960, 69967], 3], [[69968, 70003], 2], [[70004, 70005], 2], [70006, 2], [[70007, 70015], 3], [[70016, 70084], 2], [[70085, 70088], 2], [[70089, 70092], 2], [70093, 2], [[70094, 70095], 2], [[70096, 70105], 2], [70106, 2], [70107, 2], [70108, 2], [[70109, 70111], 2], [70112, 3], [[70113, 70132], 2], [[70133, 70143], 3], [[70144, 70161], 2], [70162, 3], [[70163, 70199], 2], [[70200, 70205], 2], [70206, 2], [[70207, 70209], 2], [[70210, 70271], 3], [[70272, 70278], 2], [70279, 3], [70280, 2], [70281, 3], [[70282, 70285], 2], [70286, 3], [[70287, 70301], 2], [70302, 3], [[70303, 70312], 2], [70313, 2], [[70314, 70319], 3], [[70320, 70378], 2], [[70379, 70383], 3], [[70384, 70393], 2], [[70394, 70399], 3], [70400, 2], [[70401, 70403], 2], [70404, 3], [[70405, 70412], 2], [[70413, 70414], 3], [[70415, 70416], 2], [[70417, 70418], 3], [[70419, 70440], 2], [70441, 3], [[70442, 70448], 2], [70449, 3], [[70450, 70451], 2], [70452, 3], [[70453, 70457], 2], [70458, 3], [70459, 2], [[70460, 70468], 2], [[70469, 70470], 3], [[70471, 70472], 2], [[70473, 70474], 3], [[70475, 70477], 2], [[70478, 70479], 3], [70480, 2], [[70481, 70486], 3], [70487, 2], [[70488, 70492], 3], [[70493, 70499], 2], [[70500, 70501], 3], [[70502, 70508], 2], [[70509, 70511], 3], [[70512, 70516], 2], [[70517, 70527], 3], [[70528, 70537], 2], [70538, 3], [70539, 2], [[70540, 70541], 3], [70542, 2], [70543, 3], [[70544, 70581], 2], [70582, 3], [[70583, 70592], 2], [70593, 3], [70594, 2], [[70595, 70596], 3], [70597, 2], [70598, 3], [[70599, 70602], 2], [70603, 3], [[70604, 70611], 2], [[70612, 70613], 2], [70614, 3], [[70615, 70616], 2], [[70617, 70624], 3], [[70625, 70626], 2], [[70627, 70655], 3], [[70656, 70730], 2], [[70731, 70735], 2], [[70736, 70745], 2], [70746, 2], [70747, 2], [70748, 3], [70749, 2], [70750, 2], [70751, 2], [[70752, 70753], 2], [[70754, 70783], 3], [[70784, 70853], 2], [70854, 2], [70855, 2], [[70856, 70863], 3], [[70864, 70873], 2], [[70874, 71039], 3], [[71040, 71093], 2], [[71094, 71095], 3], [[71096, 71104], 2], [[71105, 71113], 2], [[71114, 71127], 2], [[71128, 71133], 2], [[71134, 71167], 3], [[71168, 71232], 2], [[71233, 71235], 2], [71236, 2], [[71237, 71247], 3], [[71248, 71257], 2], [[71258, 71263], 3], [[71264, 71276], 2], [[71277, 71295], 3], [[71296, 71351], 2], [71352, 2], [71353, 2], [[71354, 71359], 3], [[71360, 71369], 2], [[71370, 71375], 3], [[71376, 71395], 2], [[71396, 71423], 3], [[71424, 71449], 2], [71450, 2], [[71451, 71452], 3], [[71453, 71467], 2], [[71468, 71471], 3], [[71472, 71481], 2], [[71482, 71487], 2], [[71488, 71494], 2], [[71495, 71679], 3], [[71680, 71738], 2], [71739, 2], [[71740, 71839], 3], [71840, 1, "\u{118C0}"], [71841, 1, "\u{118C1}"], [71842, 1, "\u{118C2}"], [71843, 1, "\u{118C3}"], [71844, 1, "\u{118C4}"], [71845, 1, "\u{118C5}"], [71846, 1, "\u{118C6}"], [71847, 1, "\u{118C7}"], [71848, 1, "\u{118C8}"], [71849, 1, "\u{118C9}"], [71850, 1, "\u{118CA}"], [71851, 1, "\u{118CB}"], [71852, 1, "\u{118CC}"], [71853, 1, "\u{118CD}"], [71854, 1, "\u{118CE}"], [71855, 1, "\u{118CF}"], [71856, 1, "\u{118D0}"], [71857, 1, "\u{118D1}"], [71858, 1, "\u{118D2}"], [71859, 1, "\u{118D3}"], [71860, 1, "\u{118D4}"], [71861, 1, "\u{118D5}"], [71862, 1, "\u{118D6}"], [71863, 1, "\u{118D7}"], [71864, 1, "\u{118D8}"], [71865, 1, "\u{118D9}"], [71866, 1, "\u{118DA}"], [71867, 1, "\u{118DB}"], [71868, 1, "\u{118DC}"], [71869, 1, "\u{118DD}"], [71870, 1, "\u{118DE}"], [71871, 1, "\u{118DF}"], [[71872, 71913], 2], [[71914, 71922], 2], [[71923, 71934], 3], [71935, 2], [[71936, 71942], 2], [[71943, 71944], 3], [71945, 2], [[71946, 71947], 3], [[71948, 71955], 2], [71956, 3], [[71957, 71958], 2], [71959, 3], [[71960, 71989], 2], [71990, 3], [[71991, 71992], 2], [[71993, 71994], 3], [[71995, 72003], 2], [[72004, 72006], 2], [[72007, 72015], 3], [[72016, 72025], 2], [[72026, 72095], 3], [[72096, 72103], 2], [[72104, 72105], 3], [[72106, 72151], 2], [[72152, 72153], 3], [[72154, 72161], 2], [72162, 2], [[72163, 72164], 2], [[72165, 72191], 3], [[72192, 72254], 2], [[72255, 72262], 2], [72263, 2], [[72264, 72271], 3], [[72272, 72323], 2], [[72324, 72325], 2], [[72326, 72345], 2], [[72346, 72348], 2], [72349, 2], [[72350, 72354], 2], [[72355, 72367], 3], [[72368, 72383], 2], [[72384, 72440], 2], [[72441, 72447], 3], [[72448, 72457], 2], [[72458, 72639], 3], [[72640, 72672], 2], [72673, 2], [[72674, 72687], 3], [[72688, 72697], 2], [[72698, 72703], 3], [[72704, 72712], 2], [72713, 3], [[72714, 72758], 2], [72759, 3], [[72760, 72768], 2], [[72769, 72773], 2], [[72774, 72783], 3], [[72784, 72793], 2], [[72794, 72812], 2], [[72813, 72815], 3], [[72816, 72817], 2], [[72818, 72847], 2], [[72848, 72849], 3], [[72850, 72871], 2], [72872, 3], [[72873, 72886], 2], [[72887, 72959], 3], [[72960, 72966], 2], [72967, 3], [[72968, 72969], 2], [72970, 3], [[72971, 73014], 2], [[73015, 73017], 3], [73018, 2], [73019, 3], [[73020, 73021], 2], [73022, 3], [[73023, 73031], 2], [[73032, 73039], 3], [[73040, 73049], 2], [[73050, 73055], 3], [[73056, 73061], 2], [73062, 3], [[73063, 73064], 2], [73065, 3], [[73066, 73102], 2], [73103, 3], [[73104, 73105], 2], [73106, 3], [[73107, 73112], 2], [[73113, 73119], 3], [[73120, 73129], 2], [[73130, 73439], 3], [[73440, 73462], 2], [[73463, 73464], 2], [[73465, 73471], 3], [[73472, 73488], 2], [73489, 3], [[73490, 73530], 2], [[73531, 73533], 3], [[73534, 73538], 2], [[73539, 73551], 2], [[73552, 73561], 2], [73562, 2], [[73563, 73647], 3], [73648, 2], [[73649, 73663], 3], [[73664, 73713], 2], [[73714, 73726], 3], [73727, 2], [[73728, 74606], 2], [[74607, 74648], 2], [74649, 2], [[74650, 74751], 3], [[74752, 74850], 2], [[74851, 74862], 2], [74863, 3], [[74864, 74867], 2], [74868, 2], [[74869, 74879], 3], [[74880, 75075], 2], [[75076, 77711], 3], [[77712, 77808], 2], [[77809, 77810], 2], [[77811, 77823], 3], [[77824, 78894], 2], [78895, 2], [[78896, 78904], 3], [[78905, 78911], 3], [[78912, 78933], 2], [[78934, 78943], 3], [[78944, 82938], 2], [[82939, 82943], 3], [[82944, 83526], 2], [[83527, 90367], 3], [[90368, 90425], 2], [[90426, 92159], 3], [[92160, 92728], 2], [[92729, 92735], 3], [[92736, 92766], 2], [92767, 3], [[92768, 92777], 2], [[92778, 92781], 3], [[92782, 92783], 2], [[92784, 92862], 2], [92863, 3], [[92864, 92873], 2], [[92874, 92879], 3], [[92880, 92909], 2], [[92910, 92911], 3], [[92912, 92916], 2], [92917, 2], [[92918, 92927], 3], [[92928, 92982], 2], [[92983, 92991], 2], [[92992, 92995], 2], [[92996, 92997], 2], [[92998, 93007], 3], [[93008, 93017], 2], [93018, 3], [[93019, 93025], 2], [93026, 3], [[93027, 93047], 2], [[93048, 93052], 3], [[93053, 93071], 2], [[93072, 93503], 3], [[93504, 93548], 2], [[93549, 93551], 2], [[93552, 93561], 2], [[93562, 93759], 3], [93760, 1, "\u{16E60}"], [93761, 1, "\u{16E61}"], [93762, 1, "\u{16E62}"], [93763, 1, "\u{16E63}"], [93764, 1, "\u{16E64}"], [93765, 1, "\u{16E65}"], [93766, 1, "\u{16E66}"], [93767, 1, "\u{16E67}"], [93768, 1, "\u{16E68}"], [93769, 1, "\u{16E69}"], [93770, 1, "\u{16E6A}"], [93771, 1, "\u{16E6B}"], [93772, 1, "\u{16E6C}"], [93773, 1, "\u{16E6D}"], [93774, 1, "\u{16E6E}"], [93775, 1, "\u{16E6F}"], [93776, 1, "\u{16E70}"], [93777, 1, "\u{16E71}"], [93778, 1, "\u{16E72}"], [93779, 1, "\u{16E73}"], [93780, 1, "\u{16E74}"], [93781, 1, "\u{16E75}"], [93782, 1, "\u{16E76}"], [93783, 1, "\u{16E77}"], [93784, 1, "\u{16E78}"], [93785, 1, "\u{16E79}"], [93786, 1, "\u{16E7A}"], [93787, 1, "\u{16E7B}"], [93788, 1, "\u{16E7C}"], [93789, 1, "\u{16E7D}"], [93790, 1, "\u{16E7E}"], [93791, 1, "\u{16E7F}"], [[93792, 93823], 2], [[93824, 93850], 2], [[93851, 93951], 3], [[93952, 94020], 2], [[94021, 94026], 2], [[94027, 94030], 3], [94031, 2], [[94032, 94078], 2], [[94079, 94087], 2], [[94088, 94094], 3], [[94095, 94111], 2], [[94112, 94175], 3], [94176, 2], [94177, 2], [94178, 2], [94179, 2], [94180, 2], [[94181, 94191], 3], [[94192, 94193], 2], [[94194, 94207], 3], [[94208, 100332], 2], [[100333, 100337], 2], [[100338, 100343], 2], [[100344, 100351], 3], [[100352, 101106], 2], [[101107, 101589], 2], [[101590, 101630], 3], [101631, 2], [[101632, 101640], 2], [[101641, 110575], 3], [[110576, 110579], 2], [110580, 3], [[110581, 110587], 2], [110588, 3], [[110589, 110590], 2], [110591, 3], [[110592, 110593], 2], [[110594, 110878], 2], [[110879, 110882], 2], [[110883, 110897], 3], [110898, 2], [[110899, 110927], 3], [[110928, 110930], 2], [[110931, 110932], 3], [110933, 2], [[110934, 110947], 3], [[110948, 110951], 2], [[110952, 110959], 3], [[110960, 111355], 2], [[111356, 113663], 3], [[113664, 113770], 2], [[113771, 113775], 3], [[113776, 113788], 2], [[113789, 113791], 3], [[113792, 113800], 2], [[113801, 113807], 3], [[113808, 113817], 2], [[113818, 113819], 3], [113820, 2], [[113821, 113822], 2], [113823, 2], [[113824, 113827], 7], [[113828, 117759], 3], [[117760, 117973], 2], [117974, 1, "a"], [117975, 1, "b"], [117976, 1, "c"], [117977, 1, "d"], [117978, 1, "e"], [117979, 1, "f"], [117980, 1, "g"], [117981, 1, "h"], [117982, 1, "i"], [117983, 1, "j"], [117984, 1, "k"], [117985, 1, "l"], [117986, 1, "m"], [117987, 1, "n"], [117988, 1, "o"], [117989, 1, "p"], [117990, 1, "q"], [117991, 1, "r"], [117992, 1, "s"], [117993, 1, "t"], [117994, 1, "u"], [117995, 1, "v"], [117996, 1, "w"], [117997, 1, "x"], [117998, 1, "y"], [117999, 1, "z"], [118e3, 1, "0"], [118001, 1, "1"], [118002, 1, "2"], [118003, 1, "3"], [118004, 1, "4"], [118005, 1, "5"], [118006, 1, "6"], [118007, 1, "7"], [118008, 1, "8"], [118009, 1, "9"], [[118010, 118015], 3], [[118016, 118451], 2], [[118452, 118527], 3], [[118528, 118573], 2], [[118574, 118575], 3], [[118576, 118598], 2], [[118599, 118607], 3], [[118608, 118723], 2], [[118724, 118783], 3], [[118784, 119029], 2], [[119030, 119039], 3], [[119040, 119078], 2], [[119079, 119080], 3], [119081, 2], [[119082, 119133], 2], [119134, 1, "\u{1D157}\u{1D165}"], [119135, 1, "\u{1D158}\u{1D165}"], [119136, 1, "\u{1D158}\u{1D165}\u{1D16E}"], [119137, 1, "\u{1D158}\u{1D165}\u{1D16F}"], [119138, 1, "\u{1D158}\u{1D165}\u{1D170}"], [119139, 1, "\u{1D158}\u{1D165}\u{1D171}"], [119140, 1, "\u{1D158}\u{1D165}\u{1D172}"], [[119141, 119154], 2], [[119155, 119162], 7], [[119163, 119226], 2], [119227, 1, "\u{1D1B9}\u{1D165}"], [119228, 1, "\u{1D1BA}\u{1D165}"], [119229, 1, "\u{1D1B9}\u{1D165}\u{1D16E}"], [119230, 1, "\u{1D1BA}\u{1D165}\u{1D16E}"], [119231, 1, "\u{1D1B9}\u{1D165}\u{1D16F}"], [119232, 1, "\u{1D1BA}\u{1D165}\u{1D16F}"], [[119233, 119261], 2], [[119262, 119272], 2], [[119273, 119274], 2], [[119275, 119295], 3], [[119296, 119365], 2], [[119366, 119487], 3], [[119488, 119507], 2], [[119508, 119519], 3], [[119520, 119539], 2], [[119540, 119551], 3], [[119552, 119638], 2], [[119639, 119647], 3], [[119648, 119665], 2], [[119666, 119672], 2], [[119673, 119807], 3], [119808, 1, "a"], [119809, 1, "b"], [119810, 1, "c"], [119811, 1, "d"], [119812, 1, "e"], [119813, 1, "f"], [119814, 1, "g"], [119815, 1, "h"], [119816, 1, "i"], [119817, 1, "j"], [119818, 1, "k"], [119819, 1, "l"], [119820, 1, "m"], [119821, 1, "n"], [119822, 1, "o"], [119823, 1, "p"], [119824, 1, "q"], [119825, 1, "r"], [119826, 1, "s"], [119827, 1, "t"], [119828, 1, "u"], [119829, 1, "v"], [119830, 1, "w"], [119831, 1, "x"], [119832, 1, "y"], [119833, 1, "z"], [119834, 1, "a"], [119835, 1, "b"], [119836, 1, "c"], [119837, 1, "d"], [119838, 1, "e"], [119839, 1, "f"], [119840, 1, "g"], [119841, 1, "h"], [119842, 1, "i"], [119843, 1, "j"], [119844, 1, "k"], [119845, 1, "l"], [119846, 1, "m"], [119847, 1, "n"], [119848, 1, "o"], [119849, 1, "p"], [119850, 1, "q"], [119851, 1, "r"], [119852, 1, "s"], [119853, 1, "t"], [119854, 1, "u"], [119855, 1, "v"], [119856, 1, "w"], [119857, 1, "x"], [119858, 1, "y"], [119859, 1, "z"], [119860, 1, "a"], [119861, 1, "b"], [119862, 1, "c"], [119863, 1, "d"], [119864, 1, "e"], [119865, 1, "f"], [119866, 1, "g"], [119867, 1, "h"], [119868, 1, "i"], [119869, 1, "j"], [119870, 1, "k"], [119871, 1, "l"], [119872, 1, "m"], [119873, 1, "n"], [119874, 1, "o"], [119875, 1, "p"], [119876, 1, "q"], [119877, 1, "r"], [119878, 1, "s"], [119879, 1, "t"], [119880, 1, "u"], [119881, 1, "v"], [119882, 1, "w"], [119883, 1, "x"], [119884, 1, "y"], [119885, 1, "z"], [119886, 1, "a"], [119887, 1, "b"], [119888, 1, "c"], [119889, 1, "d"], [119890, 1, "e"], [119891, 1, "f"], [119892, 1, "g"], [119893, 3], [119894, 1, "i"], [119895, 1, "j"], [119896, 1, "k"], [119897, 1, "l"], [119898, 1, "m"], [119899, 1, "n"], [119900, 1, "o"], [119901, 1, "p"], [119902, 1, "q"], [119903, 1, "r"], [119904, 1, "s"], [119905, 1, "t"], [119906, 1, "u"], [119907, 1, "v"], [119908, 1, "w"], [119909, 1, "x"], [119910, 1, "y"], [119911, 1, "z"], [119912, 1, "a"], [119913, 1, "b"], [119914, 1, "c"], [119915, 1, "d"], [119916, 1, "e"], [119917, 1, "f"], [119918, 1, "g"], [119919, 1, "h"], [119920, 1, "i"], [119921, 1, "j"], [119922, 1, "k"], [119923, 1, "l"], [119924, 1, "m"], [119925, 1, "n"], [119926, 1, "o"], [119927, 1, "p"], [119928, 1, "q"], [119929, 1, "r"], [119930, 1, "s"], [119931, 1, "t"], [119932, 1, "u"], [119933, 1, "v"], [119934, 1, "w"], [119935, 1, "x"], [119936, 1, "y"], [119937, 1, "z"], [119938, 1, "a"], [119939, 1, "b"], [119940, 1, "c"], [119941, 1, "d"], [119942, 1, "e"], [119943, 1, "f"], [119944, 1, "g"], [119945, 1, "h"], [119946, 1, "i"], [119947, 1, "j"], [119948, 1, "k"], [119949, 1, "l"], [119950, 1, "m"], [119951, 1, "n"], [119952, 1, "o"], [119953, 1, "p"], [119954, 1, "q"], [119955, 1, "r"], [119956, 1, "s"], [119957, 1, "t"], [119958, 1, "u"], [119959, 1, "v"], [119960, 1, "w"], [119961, 1, "x"], [119962, 1, "y"], [119963, 1, "z"], [119964, 1, "a"], [119965, 3], [119966, 1, "c"], [119967, 1, "d"], [[119968, 119969], 3], [119970, 1, "g"], [[119971, 119972], 3], [119973, 1, "j"], [119974, 1, "k"], [[119975, 119976], 3], [119977, 1, "n"], [119978, 1, "o"], [119979, 1, "p"], [119980, 1, "q"], [119981, 3], [119982, 1, "s"], [119983, 1, "t"], [119984, 1, "u"], [119985, 1, "v"], [119986, 1, "w"], [119987, 1, "x"], [119988, 1, "y"], [119989, 1, "z"], [119990, 1, "a"], [119991, 1, "b"], [119992, 1, "c"], [119993, 1, "d"], [119994, 3], [119995, 1, "f"], [119996, 3], [119997, 1, "h"], [119998, 1, "i"], [119999, 1, "j"], [12e4, 1, "k"], [120001, 1, "l"], [120002, 1, "m"], [120003, 1, "n"], [120004, 3], [120005, 1, "p"], [120006, 1, "q"], [120007, 1, "r"], [120008, 1, "s"], [120009, 1, "t"], [120010, 1, "u"], [120011, 1, "v"], [120012, 1, "w"], [120013, 1, "x"], [120014, 1, "y"], [120015, 1, "z"], [120016, 1, "a"], [120017, 1, "b"], [120018, 1, "c"], [120019, 1, "d"], [120020, 1, "e"], [120021, 1, "f"], [120022, 1, "g"], [120023, 1, "h"], [120024, 1, "i"], [120025, 1, "j"], [120026, 1, "k"], [120027, 1, "l"], [120028, 1, "m"], [120029, 1, "n"], [120030, 1, "o"], [120031, 1, "p"], [120032, 1, "q"], [120033, 1, "r"], [120034, 1, "s"], [120035, 1, "t"], [120036, 1, "u"], [120037, 1, "v"], [120038, 1, "w"], [120039, 1, "x"], [120040, 1, "y"], [120041, 1, "z"], [120042, 1, "a"], [120043, 1, "b"], [120044, 1, "c"], [120045, 1, "d"], [120046, 1, "e"], [120047, 1, "f"], [120048, 1, "g"], [120049, 1, "h"], [120050, 1, "i"], [120051, 1, "j"], [120052, 1, "k"], [120053, 1, "l"], [120054, 1, "m"], [120055, 1, "n"], [120056, 1, "o"], [120057, 1, "p"], [120058, 1, "q"], [120059, 1, "r"], [120060, 1, "s"], [120061, 1, "t"], [120062, 1, "u"], [120063, 1, "v"], [120064, 1, "w"], [120065, 1, "x"], [120066, 1, "y"], [120067, 1, "z"], [120068, 1, "a"], [120069, 1, "b"], [120070, 3], [120071, 1, "d"], [120072, 1, "e"], [120073, 1, "f"], [120074, 1, "g"], [[120075, 120076], 3], [120077, 1, "j"], [120078, 1, "k"], [120079, 1, "l"], [120080, 1, "m"], [120081, 1, "n"], [120082, 1, "o"], [120083, 1, "p"], [120084, 1, "q"], [120085, 3], [120086, 1, "s"], [120087, 1, "t"], [120088, 1, "u"], [120089, 1, "v"], [120090, 1, "w"], [120091, 1, "x"], [120092, 1, "y"], [120093, 3], [120094, 1, "a"], [120095, 1, "b"], [120096, 1, "c"], [120097, 1, "d"], [120098, 1, "e"], [120099, 1, "f"], [120100, 1, "g"], [120101, 1, "h"], [120102, 1, "i"], [120103, 1, "j"], [120104, 1, "k"], [120105, 1, "l"], [120106, 1, "m"], [120107, 1, "n"], [120108, 1, "o"], [120109, 1, "p"], [120110, 1, "q"], [120111, 1, "r"], [120112, 1, "s"], [120113, 1, "t"], [120114, 1, "u"], [120115, 1, "v"], [120116, 1, "w"], [120117, 1, "x"], [120118, 1, "y"], [120119, 1, "z"], [120120, 1, "a"], [120121, 1, "b"], [120122, 3], [120123, 1, "d"], [120124, 1, "e"], [120125, 1, "f"], [120126, 1, "g"], [120127, 3], [120128, 1, "i"], [120129, 1, "j"], [120130, 1, "k"], [120131, 1, "l"], [120132, 1, "m"], [120133, 3], [120134, 1, "o"], [[120135, 120137], 3], [120138, 1, "s"], [120139, 1, "t"], [120140, 1, "u"], [120141, 1, "v"], [120142, 1, "w"], [120143, 1, "x"], [120144, 1, "y"], [120145, 3], [120146, 1, "a"], [120147, 1, "b"], [120148, 1, "c"], [120149, 1, "d"], [120150, 1, "e"], [120151, 1, "f"], [120152, 1, "g"], [120153, 1, "h"], [120154, 1, "i"], [120155, 1, "j"], [120156, 1, "k"], [120157, 1, "l"], [120158, 1, "m"], [120159, 1, "n"], [120160, 1, "o"], [120161, 1, "p"], [120162, 1, "q"], [120163, 1, "r"], [120164, 1, "s"], [120165, 1, "t"], [120166, 1, "u"], [120167, 1, "v"], [120168, 1, "w"], [120169, 1, "x"], [120170, 1, "y"], [120171, 1, "z"], [120172, 1, "a"], [120173, 1, "b"], [120174, 1, "c"], [120175, 1, "d"], [120176, 1, "e"], [120177, 1, "f"], [120178, 1, "g"], [120179, 1, "h"], [120180, 1, "i"], [120181, 1, "j"], [120182, 1, "k"], [120183, 1, "l"], [120184, 1, "m"], [120185, 1, "n"], [120186, 1, "o"], [120187, 1, "p"], [120188, 1, "q"], [120189, 1, "r"], [120190, 1, "s"], [120191, 1, "t"], [120192, 1, "u"], [120193, 1, "v"], [120194, 1, "w"], [120195, 1, "x"], [120196, 1, "y"], [120197, 1, "z"], [120198, 1, "a"], [120199, 1, "b"], [120200, 1, "c"], [120201, 1, "d"], [120202, 1, "e"], [120203, 1, "f"], [120204, 1, "g"], [120205, 1, "h"], [120206, 1, "i"], [120207, 1, "j"], [120208, 1, "k"], [120209, 1, "l"], [120210, 1, "m"], [120211, 1, "n"], [120212, 1, "o"], [120213, 1, "p"], [120214, 1, "q"], [120215, 1, "r"], [120216, 1, "s"], [120217, 1, "t"], [120218, 1, "u"], [120219, 1, "v"], [120220, 1, "w"], [120221, 1, "x"], [120222, 1, "y"], [120223, 1, "z"], [120224, 1, "a"], [120225, 1, "b"], [120226, 1, "c"], [120227, 1, "d"], [120228, 1, "e"], [120229, 1, "f"], [120230, 1, "g"], [120231, 1, "h"], [120232, 1, "i"], [120233, 1, "j"], [120234, 1, "k"], [120235, 1, "l"], [120236, 1, "m"], [120237, 1, "n"], [120238, 1, "o"], [120239, 1, "p"], [120240, 1, "q"], [120241, 1, "r"], [120242, 1, "s"], [120243, 1, "t"], [120244, 1, "u"], [120245, 1, "v"], [120246, 1, "w"], [120247, 1, "x"], [120248, 1, "y"], [120249, 1, "z"], [120250, 1, "a"], [120251, 1, "b"], [120252, 1, "c"], [120253, 1, "d"], [120254, 1, "e"], [120255, 1, "f"], [120256, 1, "g"], [120257, 1, "h"], [120258, 1, "i"], [120259, 1, "j"], [120260, 1, "k"], [120261, 1, "l"], [120262, 1, "m"], [120263, 1, "n"], [120264, 1, "o"], [120265, 1, "p"], [120266, 1, "q"], [120267, 1, "r"], [120268, 1, "s"], [120269, 1, "t"], [120270, 1, "u"], [120271, 1, "v"], [120272, 1, "w"], [120273, 1, "x"], [120274, 1, "y"], [120275, 1, "z"], [120276, 1, "a"], [120277, 1, "b"], [120278, 1, "c"], [120279, 1, "d"], [120280, 1, "e"], [120281, 1, "f"], [120282, 1, "g"], [120283, 1, "h"], [120284, 1, "i"], [120285, 1, "j"], [120286, 1, "k"], [120287, 1, "l"], [120288, 1, "m"], [120289, 1, "n"], [120290, 1, "o"], [120291, 1, "p"], [120292, 1, "q"], [120293, 1, "r"], [120294, 1, "s"], [120295, 1, "t"], [120296, 1, "u"], [120297, 1, "v"], [120298, 1, "w"], [120299, 1, "x"], [120300, 1, "y"], [120301, 1, "z"], [120302, 1, "a"], [120303, 1, "b"], [120304, 1, "c"], [120305, 1, "d"], [120306, 1, "e"], [120307, 1, "f"], [120308, 1, "g"], [120309, 1, "h"], [120310, 1, "i"], [120311, 1, "j"], [120312, 1, "k"], [120313, 1, "l"], [120314, 1, "m"], [120315, 1, "n"], [120316, 1, "o"], [120317, 1, "p"], [120318, 1, "q"], [120319, 1, "r"], [120320, 1, "s"], [120321, 1, "t"], [120322, 1, "u"], [120323, 1, "v"], [120324, 1, "w"], [120325, 1, "x"], [120326, 1, "y"], [120327, 1, "z"], [120328, 1, "a"], [120329, 1, "b"], [120330, 1, "c"], [120331, 1, "d"], [120332, 1, "e"], [120333, 1, "f"], [120334, 1, "g"], [120335, 1, "h"], [120336, 1, "i"], [120337, 1, "j"], [120338, 1, "k"], [120339, 1, "l"], [120340, 1, "m"], [120341, 1, "n"], [120342, 1, "o"], [120343, 1, "p"], [120344, 1, "q"], [120345, 1, "r"], [120346, 1, "s"], [120347, 1, "t"], [120348, 1, "u"], [120349, 1, "v"], [120350, 1, "w"], [120351, 1, "x"], [120352, 1, "y"], [120353, 1, "z"], [120354, 1, "a"], [120355, 1, "b"], [120356, 1, "c"], [120357, 1, "d"], [120358, 1, "e"], [120359, 1, "f"], [120360, 1, "g"], [120361, 1, "h"], [120362, 1, "i"], [120363, 1, "j"], [120364, 1, "k"], [120365, 1, "l"], [120366, 1, "m"], [120367, 1, "n"], [120368, 1, "o"], [120369, 1, "p"], [120370, 1, "q"], [120371, 1, "r"], [120372, 1, "s"], [120373, 1, "t"], [120374, 1, "u"], [120375, 1, "v"], [120376, 1, "w"], [120377, 1, "x"], [120378, 1, "y"], [120379, 1, "z"], [120380, 1, "a"], [120381, 1, "b"], [120382, 1, "c"], [120383, 1, "d"], [120384, 1, "e"], [120385, 1, "f"], [120386, 1, "g"], [120387, 1, "h"], [120388, 1, "i"], [120389, 1, "j"], [120390, 1, "k"], [120391, 1, "l"], [120392, 1, "m"], [120393, 1, "n"], [120394, 1, "o"], [120395, 1, "p"], [120396, 1, "q"], [120397, 1, "r"], [120398, 1, "s"], [120399, 1, "t"], [120400, 1, "u"], [120401, 1, "v"], [120402, 1, "w"], [120403, 1, "x"], [120404, 1, "y"], [120405, 1, "z"], [120406, 1, "a"], [120407, 1, "b"], [120408, 1, "c"], [120409, 1, "d"], [120410, 1, "e"], [120411, 1, "f"], [120412, 1, "g"], [120413, 1, "h"], [120414, 1, "i"], [120415, 1, "j"], [120416, 1, "k"], [120417, 1, "l"], [120418, 1, "m"], [120419, 1, "n"], [120420, 1, "o"], [120421, 1, "p"], [120422, 1, "q"], [120423, 1, "r"], [120424, 1, "s"], [120425, 1, "t"], [120426, 1, "u"], [120427, 1, "v"], [120428, 1, "w"], [120429, 1, "x"], [120430, 1, "y"], [120431, 1, "z"], [120432, 1, "a"], [120433, 1, "b"], [120434, 1, "c"], [120435, 1, "d"], [120436, 1, "e"], [120437, 1, "f"], [120438, 1, "g"], [120439, 1, "h"], [120440, 1, "i"], [120441, 1, "j"], [120442, 1, "k"], [120443, 1, "l"], [120444, 1, "m"], [120445, 1, "n"], [120446, 1, "o"], [120447, 1, "p"], [120448, 1, "q"], [120449, 1, "r"], [120450, 1, "s"], [120451, 1, "t"], [120452, 1, "u"], [120453, 1, "v"], [120454, 1, "w"], [120455, 1, "x"], [120456, 1, "y"], [120457, 1, "z"], [120458, 1, "a"], [120459, 1, "b"], [120460, 1, "c"], [120461, 1, "d"], [120462, 1, "e"], [120463, 1, "f"], [120464, 1, "g"], [120465, 1, "h"], [120466, 1, "i"], [120467, 1, "j"], [120468, 1, "k"], [120469, 1, "l"], [120470, 1, "m"], [120471, 1, "n"], [120472, 1, "o"], [120473, 1, "p"], [120474, 1, "q"], [120475, 1, "r"], [120476, 1, "s"], [120477, 1, "t"], [120478, 1, "u"], [120479, 1, "v"], [120480, 1, "w"], [120481, 1, "x"], [120482, 1, "y"], [120483, 1, "z"], [120484, 1, "\u0131"], [120485, 1, "\u0237"], [[120486, 120487], 3], [120488, 1, "\u03B1"], [120489, 1, "\u03B2"], [120490, 1, "\u03B3"], [120491, 1, "\u03B4"], [120492, 1, "\u03B5"], [120493, 1, "\u03B6"], [120494, 1, "\u03B7"], [120495, 1, "\u03B8"], [120496, 1, "\u03B9"], [120497, 1, "\u03BA"], [120498, 1, "\u03BB"], [120499, 1, "\u03BC"], [120500, 1, "\u03BD"], [120501, 1, "\u03BE"], [120502, 1, "\u03BF"], [120503, 1, "\u03C0"], [120504, 1, "\u03C1"], [120505, 1, "\u03B8"], [120506, 1, "\u03C3"], [120507, 1, "\u03C4"], [120508, 1, "\u03C5"], [120509, 1, "\u03C6"], [120510, 1, "\u03C7"], [120511, 1, "\u03C8"], [120512, 1, "\u03C9"], [120513, 1, "\u2207"], [120514, 1, "\u03B1"], [120515, 1, "\u03B2"], [120516, 1, "\u03B3"], [120517, 1, "\u03B4"], [120518, 1, "\u03B5"], [120519, 1, "\u03B6"], [120520, 1, "\u03B7"], [120521, 1, "\u03B8"], [120522, 1, "\u03B9"], [120523, 1, "\u03BA"], [120524, 1, "\u03BB"], [120525, 1, "\u03BC"], [120526, 1, "\u03BD"], [120527, 1, "\u03BE"], [120528, 1, "\u03BF"], [120529, 1, "\u03C0"], [120530, 1, "\u03C1"], [[120531, 120532], 1, "\u03C3"], [120533, 1, "\u03C4"], [120534, 1, "\u03C5"], [120535, 1, "\u03C6"], [120536, 1, "\u03C7"], [120537, 1, "\u03C8"], [120538, 1, "\u03C9"], [120539, 1, "\u2202"], [120540, 1, "\u03B5"], [120541, 1, "\u03B8"], [120542, 1, "\u03BA"], [120543, 1, "\u03C6"], [120544, 1, "\u03C1"], [120545, 1, "\u03C0"], [120546, 1, "\u03B1"], [120547, 1, "\u03B2"], [120548, 1, "\u03B3"], [120549, 1, "\u03B4"], [120550, 1, "\u03B5"], [120551, 1, "\u03B6"], [120552, 1, "\u03B7"], [120553, 1, "\u03B8"], [120554, 1, "\u03B9"], [120555, 1, "\u03BA"], [120556, 1, "\u03BB"], [120557, 1, "\u03BC"], [120558, 1, "\u03BD"], [120559, 1, "\u03BE"], [120560, 1, "\u03BF"], [120561, 1, "\u03C0"], [120562, 1, "\u03C1"], [120563, 1, "\u03B8"], [120564, 1, "\u03C3"], [120565, 1, "\u03C4"], [120566, 1, "\u03C5"], [120567, 1, "\u03C6"], [120568, 1, "\u03C7"], [120569, 1, "\u03C8"], [120570, 1, "\u03C9"], [120571, 1, "\u2207"], [120572, 1, "\u03B1"], [120573, 1, "\u03B2"], [120574, 1, "\u03B3"], [120575, 1, "\u03B4"], [120576, 1, "\u03B5"], [120577, 1, "\u03B6"], [120578, 1, "\u03B7"], [120579, 1, "\u03B8"], [120580, 1, "\u03B9"], [120581, 1, "\u03BA"], [120582, 1, "\u03BB"], [120583, 1, "\u03BC"], [120584, 1, "\u03BD"], [120585, 1, "\u03BE"], [120586, 1, "\u03BF"], [120587, 1, "\u03C0"], [120588, 1, "\u03C1"], [[120589, 120590], 1, "\u03C3"], [120591, 1, "\u03C4"], [120592, 1, "\u03C5"], [120593, 1, "\u03C6"], [120594, 1, "\u03C7"], [120595, 1, "\u03C8"], [120596, 1, "\u03C9"], [120597, 1, "\u2202"], [120598, 1, "\u03B5"], [120599, 1, "\u03B8"], [120600, 1, "\u03BA"], [120601, 1, "\u03C6"], [120602, 1, "\u03C1"], [120603, 1, "\u03C0"], [120604, 1, "\u03B1"], [120605, 1, "\u03B2"], [120606, 1, "\u03B3"], [120607, 1, "\u03B4"], [120608, 1, "\u03B5"], [120609, 1, "\u03B6"], [120610, 1, "\u03B7"], [120611, 1, "\u03B8"], [120612, 1, "\u03B9"], [120613, 1, "\u03BA"], [120614, 1, "\u03BB"], [120615, 1, "\u03BC"], [120616, 1, "\u03BD"], [120617, 1, "\u03BE"], [120618, 1, "\u03BF"], [120619, 1, "\u03C0"], [120620, 1, "\u03C1"], [120621, 1, "\u03B8"], [120622, 1, "\u03C3"], [120623, 1, "\u03C4"], [120624, 1, "\u03C5"], [120625, 1, "\u03C6"], [120626, 1, "\u03C7"], [120627, 1, "\u03C8"], [120628, 1, "\u03C9"], [120629, 1, "\u2207"], [120630, 1, "\u03B1"], [120631, 1, "\u03B2"], [120632, 1, "\u03B3"], [120633, 1, "\u03B4"], [120634, 1, "\u03B5"], [120635, 1, "\u03B6"], [120636, 1, "\u03B7"], [120637, 1, "\u03B8"], [120638, 1, "\u03B9"], [120639, 1, "\u03BA"], [120640, 1, "\u03BB"], [120641, 1, "\u03BC"], [120642, 1, "\u03BD"], [120643, 1, "\u03BE"], [120644, 1, "\u03BF"], [120645, 1, "\u03C0"], [120646, 1, "\u03C1"], [[120647, 120648], 1, "\u03C3"], [120649, 1, "\u03C4"], [120650, 1, "\u03C5"], [120651, 1, "\u03C6"], [120652, 1, "\u03C7"], [120653, 1, "\u03C8"], [120654, 1, "\u03C9"], [120655, 1, "\u2202"], [120656, 1, "\u03B5"], [120657, 1, "\u03B8"], [120658, 1, "\u03BA"], [120659, 1, "\u03C6"], [120660, 1, "\u03C1"], [120661, 1, "\u03C0"], [120662, 1, "\u03B1"], [120663, 1, "\u03B2"], [120664, 1, "\u03B3"], [120665, 1, "\u03B4"], [120666, 1, "\u03B5"], [120667, 1, "\u03B6"], [120668, 1, "\u03B7"], [120669, 1, "\u03B8"], [120670, 1, "\u03B9"], [120671, 1, "\u03BA"], [120672, 1, "\u03BB"], [120673, 1, "\u03BC"], [120674, 1, "\u03BD"], [120675, 1, "\u03BE"], [120676, 1, "\u03BF"], [120677, 1, "\u03C0"], [120678, 1, "\u03C1"], [120679, 1, "\u03B8"], [120680, 1, "\u03C3"], [120681, 1, "\u03C4"], [120682, 1, "\u03C5"], [120683, 1, "\u03C6"], [120684, 1, "\u03C7"], [120685, 1, "\u03C8"], [120686, 1, "\u03C9"], [120687, 1, "\u2207"], [120688, 1, "\u03B1"], [120689, 1, "\u03B2"], [120690, 1, "\u03B3"], [120691, 1, "\u03B4"], [120692, 1, "\u03B5"], [120693, 1, "\u03B6"], [120694, 1, "\u03B7"], [120695, 1, "\u03B8"], [120696, 1, "\u03B9"], [120697, 1, "\u03BA"], [120698, 1, "\u03BB"], [120699, 1, "\u03BC"], [120700, 1, "\u03BD"], [120701, 1, "\u03BE"], [120702, 1, "\u03BF"], [120703, 1, "\u03C0"], [120704, 1, "\u03C1"], [[120705, 120706], 1, "\u03C3"], [120707, 1, "\u03C4"], [120708, 1, "\u03C5"], [120709, 1, "\u03C6"], [120710, 1, "\u03C7"], [120711, 1, "\u03C8"], [120712, 1, "\u03C9"], [120713, 1, "\u2202"], [120714, 1, "\u03B5"], [120715, 1, "\u03B8"], [120716, 1, "\u03BA"], [120717, 1, "\u03C6"], [120718, 1, "\u03C1"], [120719, 1, "\u03C0"], [120720, 1, "\u03B1"], [120721, 1, "\u03B2"], [120722, 1, "\u03B3"], [120723, 1, "\u03B4"], [120724, 1, "\u03B5"], [120725, 1, "\u03B6"], [120726, 1, "\u03B7"], [120727, 1, "\u03B8"], [120728, 1, "\u03B9"], [120729, 1, "\u03BA"], [120730, 1, "\u03BB"], [120731, 1, "\u03BC"], [120732, 1, "\u03BD"], [120733, 1, "\u03BE"], [120734, 1, "\u03BF"], [120735, 1, "\u03C0"], [120736, 1, "\u03C1"], [120737, 1, "\u03B8"], [120738, 1, "\u03C3"], [120739, 1, "\u03C4"], [120740, 1, "\u03C5"], [120741, 1, "\u03C6"], [120742, 1, "\u03C7"], [120743, 1, "\u03C8"], [120744, 1, "\u03C9"], [120745, 1, "\u2207"], [120746, 1, "\u03B1"], [120747, 1, "\u03B2"], [120748, 1, "\u03B3"], [120749, 1, "\u03B4"], [120750, 1, "\u03B5"], [120751, 1, "\u03B6"], [120752, 1, "\u03B7"], [120753, 1, "\u03B8"], [120754, 1, "\u03B9"], [120755, 1, "\u03BA"], [120756, 1, "\u03BB"], [120757, 1, "\u03BC"], [120758, 1, "\u03BD"], [120759, 1, "\u03BE"], [120760, 1, "\u03BF"], [120761, 1, "\u03C0"], [120762, 1, "\u03C1"], [[120763, 120764], 1, "\u03C3"], [120765, 1, "\u03C4"], [120766, 1, "\u03C5"], [120767, 1, "\u03C6"], [120768, 1, "\u03C7"], [120769, 1, "\u03C8"], [120770, 1, "\u03C9"], [120771, 1, "\u2202"], [120772, 1, "\u03B5"], [120773, 1, "\u03B8"], [120774, 1, "\u03BA"], [120775, 1, "\u03C6"], [120776, 1, "\u03C1"], [120777, 1, "\u03C0"], [[120778, 120779], 1, "\u03DD"], [[120780, 120781], 3], [120782, 1, "0"], [120783, 1, "1"], [120784, 1, "2"], [120785, 1, "3"], [120786, 1, "4"], [120787, 1, "5"], [120788, 1, "6"], [120789, 1, "7"], [120790, 1, "8"], [120791, 1, "9"], [120792, 1, "0"], [120793, 1, "1"], [120794, 1, "2"], [120795, 1, "3"], [120796, 1, "4"], [120797, 1, "5"], [120798, 1, "6"], [120799, 1, "7"], [120800, 1, "8"], [120801, 1, "9"], [120802, 1, "0"], [120803, 1, "1"], [120804, 1, "2"], [120805, 1, "3"], [120806, 1, "4"], [120807, 1, "5"], [120808, 1, "6"], [120809, 1, "7"], [120810, 1, "8"], [120811, 1, "9"], [120812, 1, "0"], [120813, 1, "1"], [120814, 1, "2"], [120815, 1, "3"], [120816, 1, "4"], [120817, 1, "5"], [120818, 1, "6"], [120819, 1, "7"], [120820, 1, "8"], [120821, 1, "9"], [120822, 1, "0"], [120823, 1, "1"], [120824, 1, "2"], [120825, 1, "3"], [120826, 1, "4"], [120827, 1, "5"], [120828, 1, "6"], [120829, 1, "7"], [120830, 1, "8"], [120831, 1, "9"], [[120832, 121343], 2], [[121344, 121398], 2], [[121399, 121402], 2], [[121403, 121452], 2], [[121453, 121460], 2], [121461, 2], [[121462, 121475], 2], [121476, 2], [[121477, 121483], 2], [[121484, 121498], 3], [[121499, 121503], 2], [121504, 3], [[121505, 121519], 2], [[121520, 122623], 3], [[122624, 122654], 2], [[122655, 122660], 3], [[122661, 122666], 2], [[122667, 122879], 3], [[122880, 122886], 2], [122887, 3], [[122888, 122904], 2], [[122905, 122906], 3], [[122907, 122913], 2], [122914, 3], [[122915, 122916], 2], [122917, 3], [[122918, 122922], 2], [[122923, 122927], 3], [122928, 1, "\u0430"], [122929, 1, "\u0431"], [122930, 1, "\u0432"], [122931, 1, "\u0433"], [122932, 1, "\u0434"], [122933, 1, "\u0435"], [122934, 1, "\u0436"], [122935, 1, "\u0437"], [122936, 1, "\u0438"], [122937, 1, "\u043A"], [122938, 1, "\u043B"], [122939, 1, "\u043C"], [122940, 1, "\u043E"], [122941, 1, "\u043F"], [122942, 1, "\u0440"], [122943, 1, "\u0441"], [122944, 1, "\u0442"], [122945, 1, "\u0443"], [122946, 1, "\u0444"], [122947, 1, "\u0445"], [122948, 1, "\u0446"], [122949, 1, "\u0447"], [122950, 1, "\u0448"], [122951, 1, "\u044B"], [122952, 1, "\u044D"], [122953, 1, "\u044E"], [122954, 1, "\uA689"], [122955, 1, "\u04D9"], [122956, 1, "\u0456"], [122957, 1, "\u0458"], [122958, 1, "\u04E9"], [122959, 1, "\u04AF"], [122960, 1, "\u04CF"], [122961, 1, "\u0430"], [122962, 1, "\u0431"], [122963, 1, "\u0432"], [122964, 1, "\u0433"], [122965, 1, "\u0434"], [122966, 1, "\u0435"], [122967, 1, "\u0436"], [122968, 1, "\u0437"], [122969, 1, "\u0438"], [122970, 1, "\u043A"], [122971, 1, "\u043B"], [122972, 1, "\u043E"], [122973, 1, "\u043F"], [122974, 1, "\u0441"], [122975, 1, "\u0443"], [122976, 1, "\u0444"], [122977, 1, "\u0445"], [122978, 1, "\u0446"], [122979, 1, "\u0447"], [122980, 1, "\u0448"], [122981, 1, "\u044A"], [122982, 1, "\u044B"], [122983, 1, "\u0491"], [122984, 1, "\u0456"], [122985, 1, "\u0455"], [122986, 1, "\u045F"], [122987, 1, "\u04AB"], [122988, 1, "\uA651"], [122989, 1, "\u04B1"], [[122990, 123022], 3], [123023, 2], [[123024, 123135], 3], [[123136, 123180], 2], [[123181, 123183], 3], [[123184, 123197], 2], [[123198, 123199], 3], [[123200, 123209], 2], [[123210, 123213], 3], [123214, 2], [123215, 2], [[123216, 123535], 3], [[123536, 123566], 2], [[123567, 123583], 3], [[123584, 123641], 2], [[123642, 123646], 3], [123647, 2], [[123648, 124111], 3], [[124112, 124153], 2], [[124154, 124367], 3], [[124368, 124410], 2], [[124411, 124414], 3], [124415, 2], [[124416, 124895], 3], [[124896, 124902], 2], [124903, 3], [[124904, 124907], 2], [124908, 3], [[124909, 124910], 2], [124911, 3], [[124912, 124926], 2], [124927, 3], [[124928, 125124], 2], [[125125, 125126], 3], [[125127, 125135], 2], [[125136, 125142], 2], [[125143, 125183], 3], [125184, 1, "\u{1E922}"], [125185, 1, "\u{1E923}"], [125186, 1, "\u{1E924}"], [125187, 1, "\u{1E925}"], [125188, 1, "\u{1E926}"], [125189, 1, "\u{1E927}"], [125190, 1, "\u{1E928}"], [125191, 1, "\u{1E929}"], [125192, 1, "\u{1E92A}"], [125193, 1, "\u{1E92B}"], [125194, 1, "\u{1E92C}"], [125195, 1, "\u{1E92D}"], [125196, 1, "\u{1E92E}"], [125197, 1, "\u{1E92F}"], [125198, 1, "\u{1E930}"], [125199, 1, "\u{1E931}"], [125200, 1, "\u{1E932}"], [125201, 1, "\u{1E933}"], [125202, 1, "\u{1E934}"], [125203, 1, "\u{1E935}"], [125204, 1, "\u{1E936}"], [125205, 1, "\u{1E937}"], [125206, 1, "\u{1E938}"], [125207, 1, "\u{1E939}"], [125208, 1, "\u{1E93A}"], [125209, 1, "\u{1E93B}"], [125210, 1, "\u{1E93C}"], [125211, 1, "\u{1E93D}"], [125212, 1, "\u{1E93E}"], [125213, 1, "\u{1E93F}"], [125214, 1, "\u{1E940}"], [125215, 1, "\u{1E941}"], [125216, 1, "\u{1E942}"], [125217, 1, "\u{1E943}"], [[125218, 125258], 2], [125259, 2], [[125260, 125263], 3], [[125264, 125273], 2], [[125274, 125277], 3], [[125278, 125279], 2], [[125280, 126064], 3], [[126065, 126132], 2], [[126133, 126208], 3], [[126209, 126269], 2], [[126270, 126463], 3], [126464, 1, "\u0627"], [126465, 1, "\u0628"], [126466, 1, "\u062C"], [126467, 1, "\u062F"], [126468, 3], [126469, 1, "\u0648"], [126470, 1, "\u0632"], [126471, 1, "\u062D"], [126472, 1, "\u0637"], [126473, 1, "\u064A"], [126474, 1, "\u0643"], [126475, 1, "\u0644"], [126476, 1, "\u0645"], [126477, 1, "\u0646"], [126478, 1, "\u0633"], [126479, 1, "\u0639"], [126480, 1, "\u0641"], [126481, 1, "\u0635"], [126482, 1, "\u0642"], [126483, 1, "\u0631"], [126484, 1, "\u0634"], [126485, 1, "\u062A"], [126486, 1, "\u062B"], [126487, 1, "\u062E"], [126488, 1, "\u0630"], [126489, 1, "\u0636"], [126490, 1, "\u0638"], [126491, 1, "\u063A"], [126492, 1, "\u066E"], [126493, 1, "\u06BA"], [126494, 1, "\u06A1"], [126495, 1, "\u066F"], [126496, 3], [126497, 1, "\u0628"], [126498, 1, "\u062C"], [126499, 3], [126500, 1, "\u0647"], [[126501, 126502], 3], [126503, 1, "\u062D"], [126504, 3], [126505, 1, "\u064A"], [126506, 1, "\u0643"], [126507, 1, "\u0644"], [126508, 1, "\u0645"], [126509, 1, "\u0646"], [126510, 1, "\u0633"], [126511, 1, "\u0639"], [126512, 1, "\u0641"], [126513, 1, "\u0635"], [126514, 1, "\u0642"], [126515, 3], [126516, 1, "\u0634"], [126517, 1, "\u062A"], [126518, 1, "\u062B"], [126519, 1, "\u062E"], [126520, 3], [126521, 1, "\u0636"], [126522, 3], [126523, 1, "\u063A"], [[126524, 126529], 3], [126530, 1, "\u062C"], [[126531, 126534], 3], [126535, 1, "\u062D"], [126536, 3], [126537, 1, "\u064A"], [126538, 3], [126539, 1, "\u0644"], [126540, 3], [126541, 1, "\u0646"], [126542, 1, "\u0633"], [126543, 1, "\u0639"], [126544, 3], [126545, 1, "\u0635"], [126546, 1, "\u0642"], [126547, 3], [126548, 1, "\u0634"], [[126549, 126550], 3], [126551, 1, "\u062E"], [126552, 3], [126553, 1, "\u0636"], [126554, 3], [126555, 1, "\u063A"], [126556, 3], [126557, 1, "\u06BA"], [126558, 3], [126559, 1, "\u066F"], [126560, 3], [126561, 1, "\u0628"], [126562, 1, "\u062C"], [126563, 3], [126564, 1, "\u0647"], [[126565, 126566], 3], [126567, 1, "\u062D"], [126568, 1, "\u0637"], [126569, 1, "\u064A"], [126570, 1, "\u0643"], [126571, 3], [126572, 1, "\u0645"], [126573, 1, "\u0646"], [126574, 1, "\u0633"], [126575, 1, "\u0639"], [126576, 1, "\u0641"], [126577, 1, "\u0635"], [126578, 1, "\u0642"], [126579, 3], [126580, 1, "\u0634"], [126581, 1, "\u062A"], [126582, 1, "\u062B"], [126583, 1, "\u062E"], [126584, 3], [126585, 1, "\u0636"], [126586, 1, "\u0638"], [126587, 1, "\u063A"], [126588, 1, "\u066E"], [126589, 3], [126590, 1, "\u06A1"], [126591, 3], [126592, 1, "\u0627"], [126593, 1, "\u0628"], [126594, 1, "\u062C"], [126595, 1, "\u062F"], [126596, 1, "\u0647"], [126597, 1, "\u0648"], [126598, 1, "\u0632"], [126599, 1, "\u062D"], [126600, 1, "\u0637"], [126601, 1, "\u064A"], [126602, 3], [126603, 1, "\u0644"], [126604, 1, "\u0645"], [126605, 1, "\u0646"], [126606, 1, "\u0633"], [126607, 1, "\u0639"], [126608, 1, "\u0641"], [126609, 1, "\u0635"], [126610, 1, "\u0642"], [126611, 1, "\u0631"], [126612, 1, "\u0634"], [126613, 1, "\u062A"], [126614, 1, "\u062B"], [126615, 1, "\u062E"], [126616, 1, "\u0630"], [126617, 1, "\u0636"], [126618, 1, "\u0638"], [126619, 1, "\u063A"], [[126620, 126624], 3], [126625, 1, "\u0628"], [126626, 1, "\u062C"], [126627, 1, "\u062F"], [126628, 3], [126629, 1, "\u0648"], [126630, 1, "\u0632"], [126631, 1, "\u062D"], [126632, 1, "\u0637"], [126633, 1, "\u064A"], [126634, 3], [126635, 1, "\u0644"], [126636, 1, "\u0645"], [126637, 1, "\u0646"], [126638, 1, "\u0633"], [126639, 1, "\u0639"], [126640, 1, "\u0641"], [126641, 1, "\u0635"], [126642, 1, "\u0642"], [126643, 1, "\u0631"], [126644, 1, "\u0634"], [126645, 1, "\u062A"], [126646, 1, "\u062B"], [126647, 1, "\u062E"], [126648, 1, "\u0630"], [126649, 1, "\u0636"], [126650, 1, "\u0638"], [126651, 1, "\u063A"], [[126652, 126703], 3], [[126704, 126705], 2], [[126706, 126975], 3], [[126976, 127019], 2], [[127020, 127023], 3], [[127024, 127123], 2], [[127124, 127135], 3], [[127136, 127150], 2], [[127151, 127152], 3], [[127153, 127166], 2], [127167, 2], [127168, 3], [[127169, 127183], 2], [127184, 3], [[127185, 127199], 2], [[127200, 127221], 2], [[127222, 127231], 3], [127232, 3], [127233, 1, "0,"], [127234, 1, "1,"], [127235, 1, "2,"], [127236, 1, "3,"], [127237, 1, "4,"], [127238, 1, "5,"], [127239, 1, "6,"], [127240, 1, "7,"], [127241, 1, "8,"], [127242, 1, "9,"], [[127243, 127244], 2], [[127245, 127247], 2], [127248, 1, "(a)"], [127249, 1, "(b)"], [127250, 1, "(c)"], [127251, 1, "(d)"], [127252, 1, "(e)"], [127253, 1, "(f)"], [127254, 1, "(g)"], [127255, 1, "(h)"], [127256, 1, "(i)"], [127257, 1, "(j)"], [127258, 1, "(k)"], [127259, 1, "(l)"], [127260, 1, "(m)"], [127261, 1, "(n)"], [127262, 1, "(o)"], [127263, 1, "(p)"], [127264, 1, "(q)"], [127265, 1, "(r)"], [127266, 1, "(s)"], [127267, 1, "(t)"], [127268, 1, "(u)"], [127269, 1, "(v)"], [127270, 1, "(w)"], [127271, 1, "(x)"], [127272, 1, "(y)"], [127273, 1, "(z)"], [127274, 1, "\u3014s\u3015"], [127275, 1, "c"], [127276, 1, "r"], [127277, 1, "cd"], [127278, 1, "wz"], [127279, 2], [127280, 1, "a"], [127281, 1, "b"], [127282, 1, "c"], [127283, 1, "d"], [127284, 1, "e"], [127285, 1, "f"], [127286, 1, "g"], [127287, 1, "h"], [127288, 1, "i"], [127289, 1, "j"], [127290, 1, "k"], [127291, 1, "l"], [127292, 1, "m"], [127293, 1, "n"], [127294, 1, "o"], [127295, 1, "p"], [127296, 1, "q"], [127297, 1, "r"], [127298, 1, "s"], [127299, 1, "t"], [127300, 1, "u"], [127301, 1, "v"], [127302, 1, "w"], [127303, 1, "x"], [127304, 1, "y"], [127305, 1, "z"], [127306, 1, "hv"], [127307, 1, "mv"], [127308, 1, "sd"], [127309, 1, "ss"], [127310, 1, "ppv"], [127311, 1, "wc"], [[127312, 127318], 2], [127319, 2], [[127320, 127326], 2], [127327, 2], [[127328, 127337], 2], [127338, 1, "mc"], [127339, 1, "md"], [127340, 1, "mr"], [[127341, 127343], 2], [[127344, 127352], 2], [127353, 2], [127354, 2], [[127355, 127356], 2], [[127357, 127358], 2], [127359, 2], [[127360, 127369], 2], [[127370, 127373], 2], [[127374, 127375], 2], [127376, 1, "dj"], [[127377, 127386], 2], [[127387, 127404], 2], [127405, 2], [[127406, 127461], 3], [[127462, 127487], 2], [127488, 1, "\u307B\u304B"], [127489, 1, "\u30B3\u30B3"], [127490, 1, "\u30B5"], [[127491, 127503], 3], [127504, 1, "\u624B"], [127505, 1, "\u5B57"], [127506, 1, "\u53CC"], [127507, 1, "\u30C7"], [127508, 1, "\u4E8C"], [127509, 1, "\u591A"], [127510, 1, "\u89E3"], [127511, 1, "\u5929"], [127512, 1, "\u4EA4"], [127513, 1, "\u6620"], [127514, 1, "\u7121"], [127515, 1, "\u6599"], [127516, 1, "\u524D"], [127517, 1, "\u5F8C"], [127518, 1, "\u518D"], [127519, 1, "\u65B0"], [127520, 1, "\u521D"], [127521, 1, "\u7D42"], [127522, 1, "\u751F"], [127523, 1, "\u8CA9"], [127524, 1, "\u58F0"], [127525, 1, "\u5439"], [127526, 1, "\u6F14"], [127527, 1, "\u6295"], [127528, 1, "\u6355"], [127529, 1, "\u4E00"], [127530, 1, "\u4E09"], [127531, 1, "\u904A"], [127532, 1, "\u5DE6"], [127533, 1, "\u4E2D"], [127534, 1, "\u53F3"], [127535, 1, "\u6307"], [127536, 1, "\u8D70"], [127537, 1, "\u6253"], [127538, 1, "\u7981"], [127539, 1, "\u7A7A"], [127540, 1, "\u5408"], [127541, 1, "\u6E80"], [127542, 1, "\u6709"], [127543, 1, "\u6708"], [127544, 1, "\u7533"], [127545, 1, "\u5272"], [127546, 1, "\u55B6"], [127547, 1, "\u914D"], [[127548, 127551], 3], [127552, 1, "\u3014\u672C\u3015"], [127553, 1, "\u3014\u4E09\u3015"], [127554, 1, "\u3014\u4E8C\u3015"], [127555, 1, "\u3014\u5B89\u3015"], [127556, 1, "\u3014\u70B9\u3015"], [127557, 1, "\u3014\u6253\u3015"], [127558, 1, "\u3014\u76D7\u3015"], [127559, 1, "\u3014\u52DD\u3015"], [127560, 1, "\u3014\u6557\u3015"], [[127561, 127567], 3], [127568, 1, "\u5F97"], [127569, 1, "\u53EF"], [[127570, 127583], 3], [[127584, 127589], 2], [[127590, 127743], 3], [[127744, 127776], 2], [[127777, 127788], 2], [[127789, 127791], 2], [[127792, 127797], 2], [127798, 2], [[127799, 127868], 2], [127869, 2], [[127870, 127871], 2], [[127872, 127891], 2], [[127892, 127903], 2], [[127904, 127940], 2], [127941, 2], [[127942, 127946], 2], [[127947, 127950], 2], [[127951, 127955], 2], [[127956, 127967], 2], [[127968, 127984], 2], [[127985, 127991], 2], [[127992, 127999], 2], [[128e3, 128062], 2], [128063, 2], [128064, 2], [128065, 2], [[128066, 128247], 2], [128248, 2], [[128249, 128252], 2], [[128253, 128254], 2], [128255, 2], [[128256, 128317], 2], [[128318, 128319], 2], [[128320, 128323], 2], [[128324, 128330], 2], [[128331, 128335], 2], [[128336, 128359], 2], [[128360, 128377], 2], [128378, 2], [[128379, 128419], 2], [128420, 2], [[128421, 128506], 2], [[128507, 128511], 2], [128512, 2], [[128513, 128528], 2], [128529, 2], [[128530, 128532], 2], [128533, 2], [128534, 2], [128535, 2], [128536, 2], [128537, 2], [128538, 2], [128539, 2], [[128540, 128542], 2], [128543, 2], [[128544, 128549], 2], [[128550, 128551], 2], [[128552, 128555], 2], [128556, 2], [128557, 2], [[128558, 128559], 2], [[128560, 128563], 2], [128564, 2], [[128565, 128576], 2], [[128577, 128578], 2], [[128579, 128580], 2], [[128581, 128591], 2], [[128592, 128639], 2], [[128640, 128709], 2], [[128710, 128719], 2], [128720, 2], [[128721, 128722], 2], [[128723, 128724], 2], [128725, 2], [[128726, 128727], 2], [[128728, 128731], 3], [128732, 2], [[128733, 128735], 2], [[128736, 128748], 2], [[128749, 128751], 3], [[128752, 128755], 2], [[128756, 128758], 2], [[128759, 128760], 2], [128761, 2], [128762, 2], [[128763, 128764], 2], [[128765, 128767], 3], [[128768, 128883], 2], [[128884, 128886], 2], [[128887, 128890], 3], [[128891, 128895], 2], [[128896, 128980], 2], [[128981, 128984], 2], [128985, 2], [[128986, 128991], 3], [[128992, 129003], 2], [[129004, 129007], 3], [129008, 2], [[129009, 129023], 3], [[129024, 129035], 2], [[129036, 129039], 3], [[129040, 129095], 2], [[129096, 129103], 3], [[129104, 129113], 2], [[129114, 129119], 3], [[129120, 129159], 2], [[129160, 129167], 3], [[129168, 129197], 2], [[129198, 129199], 3], [[129200, 129201], 2], [[129202, 129211], 2], [[129212, 129215], 3], [[129216, 129217], 2], [[129218, 129279], 3], [[129280, 129291], 2], [129292, 2], [[129293, 129295], 2], [[129296, 129304], 2], [[129305, 129310], 2], [129311, 2], [[129312, 129319], 2], [[129320, 129327], 2], [129328, 2], [[129329, 129330], 2], [[129331, 129342], 2], [129343, 2], [[129344, 129355], 2], [129356, 2], [[129357, 129359], 2], [[129360, 129374], 2], [[129375, 129387], 2], [[129388, 129392], 2], [129393, 2], [129394, 2], [[129395, 129398], 2], [[129399, 129400], 2], [129401, 2], [129402, 2], [129403, 2], [[129404, 129407], 2], [[129408, 129412], 2], [[129413, 129425], 2], [[129426, 129431], 2], [[129432, 129442], 2], [[129443, 129444], 2], [[129445, 129450], 2], [[129451, 129453], 2], [[129454, 129455], 2], [[129456, 129465], 2], [[129466, 129471], 2], [129472, 2], [[129473, 129474], 2], [[129475, 129482], 2], [129483, 2], [129484, 2], [[129485, 129487], 2], [[129488, 129510], 2], [[129511, 129535], 2], [[129536, 129619], 2], [[129620, 129631], 3], [[129632, 129645], 2], [[129646, 129647], 3], [[129648, 129651], 2], [129652, 2], [[129653, 129655], 2], [[129656, 129658], 2], [[129659, 129660], 2], [[129661, 129663], 3], [[129664, 129666], 2], [[129667, 129670], 2], [[129671, 129672], 2], [129673, 2], [[129674, 129678], 3], [129679, 2], [[129680, 129685], 2], [[129686, 129704], 2], [[129705, 129708], 2], [[129709, 129711], 2], [[129712, 129718], 2], [[129719, 129722], 2], [[129723, 129725], 2], [129726, 2], [129727, 2], [[129728, 129730], 2], [[129731, 129733], 2], [129734, 2], [[129735, 129741], 3], [[129742, 129743], 2], [[129744, 129750], 2], [[129751, 129753], 2], [[129754, 129755], 2], [129756, 2], [[129757, 129758], 3], [129759, 2], [[129760, 129767], 2], [129768, 2], [129769, 2], [[129770, 129775], 3], [[129776, 129782], 2], [[129783, 129784], 2], [[129785, 129791], 3], [[129792, 129938], 2], [129939, 3], [[129940, 129994], 2], [[129995, 130031], 2], [130032, 1, "0"], [130033, 1, "1"], [130034, 1, "2"], [130035, 1, "3"], [130036, 1, "4"], [130037, 1, "5"], [130038, 1, "6"], [130039, 1, "7"], [130040, 1, "8"], [130041, 1, "9"], [[130042, 131069], 3], [[131070, 131071], 3], [[131072, 173782], 2], [[173783, 173789], 2], [[173790, 173791], 2], [[173792, 173823], 3], [[173824, 177972], 2], [[177973, 177976], 2], [177977, 2], [[177978, 177983], 3], [[177984, 178205], 2], [[178206, 178207], 3], [[178208, 183969], 2], [[183970, 183983], 3], [[183984, 191456], 2], [[191457, 191471], 3], [[191472, 192093], 2], [[192094, 194559], 3], [194560, 1, "\u4E3D"], [194561, 1, "\u4E38"], [194562, 1, "\u4E41"], [194563, 1, "\u{20122}"], [194564, 1, "\u4F60"], [194565, 1, "\u4FAE"], [194566, 1, "\u4FBB"], [194567, 1, "\u5002"], [194568, 1, "\u507A"], [194569, 1, "\u5099"], [194570, 1, "\u50E7"], [194571, 1, "\u50CF"], [194572, 1, "\u349E"], [194573, 1, "\u{2063A}"], [194574, 1, "\u514D"], [194575, 1, "\u5154"], [194576, 1, "\u5164"], [194577, 1, "\u5177"], [194578, 1, "\u{2051C}"], [194579, 1, "\u34B9"], [194580, 1, "\u5167"], [194581, 1, "\u518D"], [194582, 1, "\u{2054B}"], [194583, 1, "\u5197"], [194584, 1, "\u51A4"], [194585, 1, "\u4ECC"], [194586, 1, "\u51AC"], [194587, 1, "\u51B5"], [194588, 1, "\u{291DF}"], [194589, 1, "\u51F5"], [194590, 1, "\u5203"], [194591, 1, "\u34DF"], [194592, 1, "\u523B"], [194593, 1, "\u5246"], [194594, 1, "\u5272"], [194595, 1, "\u5277"], [194596, 1, "\u3515"], [194597, 1, "\u52C7"], [194598, 1, "\u52C9"], [194599, 1, "\u52E4"], [194600, 1, "\u52FA"], [194601, 1, "\u5305"], [194602, 1, "\u5306"], [194603, 1, "\u5317"], [194604, 1, "\u5349"], [194605, 1, "\u5351"], [194606, 1, "\u535A"], [194607, 1, "\u5373"], [194608, 1, "\u537D"], [[194609, 194611], 1, "\u537F"], [194612, 1, "\u{20A2C}"], [194613, 1, "\u7070"], [194614, 1, "\u53CA"], [194615, 1, "\u53DF"], [194616, 1, "\u{20B63}"], [194617, 1, "\u53EB"], [194618, 1, "\u53F1"], [194619, 1, "\u5406"], [194620, 1, "\u549E"], [194621, 1, "\u5438"], [194622, 1, "\u5448"], [194623, 1, "\u5468"], [194624, 1, "\u54A2"], [194625, 1, "\u54F6"], [194626, 1, "\u5510"], [194627, 1, "\u5553"], [194628, 1, "\u5563"], [[194629, 194630], 1, "\u5584"], [194631, 1, "\u5599"], [194632, 1, "\u55AB"], [194633, 1, "\u55B3"], [194634, 1, "\u55C2"], [194635, 1, "\u5716"], [194636, 1, "\u5606"], [194637, 1, "\u5717"], [194638, 1, "\u5651"], [194639, 1, "\u5674"], [194640, 1, "\u5207"], [194641, 1, "\u58EE"], [194642, 1, "\u57CE"], [194643, 1, "\u57F4"], [194644, 1, "\u580D"], [194645, 1, "\u578B"], [194646, 1, "\u5832"], [194647, 1, "\u5831"], [194648, 1, "\u58AC"], [194649, 1, "\u{214E4}"], [194650, 1, "\u58F2"], [194651, 1, "\u58F7"], [194652, 1, "\u5906"], [194653, 1, "\u591A"], [194654, 1, "\u5922"], [194655, 1, "\u5962"], [194656, 1, "\u{216A8}"], [194657, 1, "\u{216EA}"], [194658, 1, "\u59EC"], [194659, 1, "\u5A1B"], [194660, 1, "\u5A27"], [194661, 1, "\u59D8"], [194662, 1, "\u5A66"], [194663, 1, "\u36EE"], [194664, 1, "\u36FC"], [194665, 1, "\u5B08"], [[194666, 194667], 1, "\u5B3E"], [194668, 1, "\u{219C8}"], [194669, 1, "\u5BC3"], [194670, 1, "\u5BD8"], [194671, 1, "\u5BE7"], [194672, 1, "\u5BF3"], [194673, 1, "\u{21B18}"], [194674, 1, "\u5BFF"], [194675, 1, "\u5C06"], [194676, 1, "\u5F53"], [194677, 1, "\u5C22"], [194678, 1, "\u3781"], [194679, 1, "\u5C60"], [194680, 1, "\u5C6E"], [194681, 1, "\u5CC0"], [194682, 1, "\u5C8D"], [194683, 1, "\u{21DE4}"], [194684, 1, "\u5D43"], [194685, 1, "\u{21DE6}"], [194686, 1, "\u5D6E"], [194687, 1, "\u5D6B"], [194688, 1, "\u5D7C"], [194689, 1, "\u5DE1"], [194690, 1, "\u5DE2"], [194691, 1, "\u382F"], [194692, 1, "\u5DFD"], [194693, 1, "\u5E28"], [194694, 1, "\u5E3D"], [194695, 1, "\u5E69"], [194696, 1, "\u3862"], [194697, 1, "\u{22183}"], [194698, 1, "\u387C"], [194699, 1, "\u5EB0"], [194700, 1, "\u5EB3"], [194701, 1, "\u5EB6"], [194702, 1, "\u5ECA"], [194703, 1, "\u{2A392}"], [194704, 1, "\u5EFE"], [[194705, 194706], 1, "\u{22331}"], [194707, 1, "\u8201"], [[194708, 194709], 1, "\u5F22"], [194710, 1, "\u38C7"], [194711, 1, "\u{232B8}"], [194712, 1, "\u{261DA}"], [194713, 1, "\u5F62"], [194714, 1, "\u5F6B"], [194715, 1, "\u38E3"], [194716, 1, "\u5F9A"], [194717, 1, "\u5FCD"], [194718, 1, "\u5FD7"], [194719, 1, "\u5FF9"], [194720, 1, "\u6081"], [194721, 1, "\u393A"], [194722, 1, "\u391C"], [194723, 1, "\u6094"], [194724, 1, "\u{226D4}"], [194725, 1, "\u60C7"], [194726, 1, "\u6148"], [194727, 1, "\u614C"], [194728, 1, "\u614E"], [194729, 1, "\u614C"], [194730, 1, "\u617A"], [194731, 1, "\u618E"], [194732, 1, "\u61B2"], [194733, 1, "\u61A4"], [194734, 1, "\u61AF"], [194735, 1, "\u61DE"], [194736, 1, "\u61F2"], [194737, 1, "\u61F6"], [194738, 1, "\u6210"], [194739, 1, "\u621B"], [194740, 1, "\u625D"], [194741, 1, "\u62B1"], [194742, 1, "\u62D4"], [194743, 1, "\u6350"], [194744, 1, "\u{22B0C}"], [194745, 1, "\u633D"], [194746, 1, "\u62FC"], [194747, 1, "\u6368"], [194748, 1, "\u6383"], [194749, 1, "\u63E4"], [194750, 1, "\u{22BF1}"], [194751, 1, "\u6422"], [194752, 1, "\u63C5"], [194753, 1, "\u63A9"], [194754, 1, "\u3A2E"], [194755, 1, "\u6469"], [194756, 1, "\u647E"], [194757, 1, "\u649D"], [194758, 1, "\u6477"], [194759, 1, "\u3A6C"], [194760, 1, "\u654F"], [194761, 1, "\u656C"], [194762, 1, "\u{2300A}"], [194763, 1, "\u65E3"], [194764, 1, "\u66F8"], [194765, 1, "\u6649"], [194766, 1, "\u3B19"], [194767, 1, "\u6691"], [194768, 1, "\u3B08"], [194769, 1, "\u3AE4"], [194770, 1, "\u5192"], [194771, 1, "\u5195"], [194772, 1, "\u6700"], [194773, 1, "\u669C"], [194774, 1, "\u80AD"], [194775, 1, "\u43D9"], [194776, 1, "\u6717"], [194777, 1, "\u671B"], [194778, 1, "\u6721"], [194779, 1, "\u675E"], [194780, 1, "\u6753"], [194781, 1, "\u{233C3}"], [194782, 1, "\u3B49"], [194783, 1, "\u67FA"], [194784, 1, "\u6785"], [194785, 1, "\u6852"], [194786, 1, "\u6885"], [194787, 1, "\u{2346D}"], [194788, 1, "\u688E"], [194789, 1, "\u681F"], [194790, 1, "\u6914"], [194791, 1, "\u3B9D"], [194792, 1, "\u6942"], [194793, 1, "\u69A3"], [194794, 1, "\u69EA"], [194795, 1, "\u6AA8"], [194796, 1, "\u{236A3}"], [194797, 1, "\u6ADB"], [194798, 1, "\u3C18"], [194799, 1, "\u6B21"], [194800, 1, "\u{238A7}"], [194801, 1, "\u6B54"], [194802, 1, "\u3C4E"], [194803, 1, "\u6B72"], [194804, 1, "\u6B9F"], [194805, 1, "\u6BBA"], [194806, 1, "\u6BBB"], [194807, 1, "\u{23A8D}"], [194808, 1, "\u{21D0B}"], [194809, 1, "\u{23AFA}"], [194810, 1, "\u6C4E"], [194811, 1, "\u{23CBC}"], [194812, 1, "\u6CBF"], [194813, 1, "\u6CCD"], [194814, 1, "\u6C67"], [194815, 1, "\u6D16"], [194816, 1, "\u6D3E"], [194817, 1, "\u6D77"], [194818, 1, "\u6D41"], [194819, 1, "\u6D69"], [194820, 1, "\u6D78"], [194821, 1, "\u6D85"], [194822, 1, "\u{23D1E}"], [194823, 1, "\u6D34"], [194824, 1, "\u6E2F"], [194825, 1, "\u6E6E"], [194826, 1, "\u3D33"], [194827, 1, "\u6ECB"], [194828, 1, "\u6EC7"], [194829, 1, "\u{23ED1}"], [194830, 1, "\u6DF9"], [194831, 1, "\u6F6E"], [194832, 1, "\u{23F5E}"], [194833, 1, "\u{23F8E}"], [194834, 1, "\u6FC6"], [194835, 1, "\u7039"], [194836, 1, "\u701E"], [194837, 1, "\u701B"], [194838, 1, "\u3D96"], [194839, 1, "\u704A"], [194840, 1, "\u707D"], [194841, 1, "\u7077"], [194842, 1, "\u70AD"], [194843, 1, "\u{20525}"], [194844, 1, "\u7145"], [194845, 1, "\u{24263}"], [194846, 1, "\u719C"], [194847, 1, "\u{243AB}"], [194848, 1, "\u7228"], [194849, 1, "\u7235"], [194850, 1, "\u7250"], [194851, 1, "\u{24608}"], [194852, 1, "\u7280"], [194853, 1, "\u7295"], [194854, 1, "\u{24735}"], [194855, 1, "\u{24814}"], [194856, 1, "\u737A"], [194857, 1, "\u738B"], [194858, 1, "\u3EAC"], [194859, 1, "\u73A5"], [[194860, 194861], 1, "\u3EB8"], [194862, 1, "\u7447"], [194863, 1, "\u745C"], [194864, 1, "\u7471"], [194865, 1, "\u7485"], [194866, 1, "\u74CA"], [194867, 1, "\u3F1B"], [194868, 1, "\u7524"], [194869, 1, "\u{24C36}"], [194870, 1, "\u753E"], [194871, 1, "\u{24C92}"], [194872, 1, "\u7570"], [194873, 1, "\u{2219F}"], [194874, 1, "\u7610"], [194875, 1, "\u{24FA1}"], [194876, 1, "\u{24FB8}"], [194877, 1, "\u{25044}"], [194878, 1, "\u3FFC"], [194879, 1, "\u4008"], [194880, 1, "\u76F4"], [194881, 1, "\u{250F3}"], [194882, 1, "\u{250F2}"], [194883, 1, "\u{25119}"], [194884, 1, "\u{25133}"], [194885, 1, "\u771E"], [[194886, 194887], 1, "\u771F"], [194888, 1, "\u774A"], [194889, 1, "\u4039"], [194890, 1, "\u778B"], [194891, 1, "\u4046"], [194892, 1, "\u4096"], [194893, 1, "\u{2541D}"], [194894, 1, "\u784E"], [194895, 1, "\u788C"], [194896, 1, "\u78CC"], [194897, 1, "\u40E3"], [194898, 1, "\u{25626}"], [194899, 1, "\u7956"], [194900, 1, "\u{2569A}"], [194901, 1, "\u{256C5}"], [194902, 1, "\u798F"], [194903, 1, "\u79EB"], [194904, 1, "\u412F"], [194905, 1, "\u7A40"], [194906, 1, "\u7A4A"], [194907, 1, "\u7A4F"], [194908, 1, "\u{2597C}"], [[194909, 194910], 1, "\u{25AA7}"], [194911, 1, "\u7AEE"], [194912, 1, "\u4202"], [194913, 1, "\u{25BAB}"], [194914, 1, "\u7BC6"], [194915, 1, "\u7BC9"], [194916, 1, "\u4227"], [194917, 1, "\u{25C80}"], [194918, 1, "\u7CD2"], [194919, 1, "\u42A0"], [194920, 1, "\u7CE8"], [194921, 1, "\u7CE3"], [194922, 1, "\u7D00"], [194923, 1, "\u{25F86}"], [194924, 1, "\u7D63"], [194925, 1, "\u4301"], [194926, 1, "\u7DC7"], [194927, 1, "\u7E02"], [194928, 1, "\u7E45"], [194929, 1, "\u4334"], [194930, 1, "\u{26228}"], [194931, 1, "\u{26247}"], [194932, 1, "\u4359"], [194933, 1, "\u{262D9}"], [194934, 1, "\u7F7A"], [194935, 1, "\u{2633E}"], [194936, 1, "\u7F95"], [194937, 1, "\u7FFA"], [194938, 1, "\u8005"], [194939, 1, "\u{264DA}"], [194940, 1, "\u{26523}"], [194941, 1, "\u8060"], [194942, 1, "\u{265A8}"], [194943, 1, "\u8070"], [194944, 1, "\u{2335F}"], [194945, 1, "\u43D5"], [194946, 1, "\u80B2"], [194947, 1, "\u8103"], [194948, 1, "\u440B"], [194949, 1, "\u813E"], [194950, 1, "\u5AB5"], [194951, 1, "\u{267A7}"], [194952, 1, "\u{267B5}"], [194953, 1, "\u{23393}"], [194954, 1, "\u{2339C}"], [194955, 1, "\u8201"], [194956, 1, "\u8204"], [194957, 1, "\u8F9E"], [194958, 1, "\u446B"], [194959, 1, "\u8291"], [194960, 1, "\u828B"], [194961, 1, "\u829D"], [194962, 1, "\u52B3"], [194963, 1, "\u82B1"], [194964, 1, "\u82B3"], [194965, 1, "\u82BD"], [194966, 1, "\u82E6"], [194967, 1, "\u{26B3C}"], [194968, 1, "\u82E5"], [194969, 1, "\u831D"], [194970, 1, "\u8363"], [194971, 1, "\u83AD"], [194972, 1, "\u8323"], [194973, 1, "\u83BD"], [194974, 1, "\u83E7"], [194975, 1, "\u8457"], [194976, 1, "\u8353"], [194977, 1, "\u83CA"], [194978, 1, "\u83CC"], [194979, 1, "\u83DC"], [194980, 1, "\u{26C36}"], [194981, 1, "\u{26D6B}"], [194982, 1, "\u{26CD5}"], [194983, 1, "\u452B"], [194984, 1, "\u84F1"], [194985, 1, "\u84F3"], [194986, 1, "\u8516"], [194987, 1, "\u{273CA}"], [194988, 1, "\u8564"], [194989, 1, "\u{26F2C}"], [194990, 1, "\u455D"], [194991, 1, "\u4561"], [194992, 1, "\u{26FB1}"], [194993, 1, "\u{270D2}"], [194994, 1, "\u456B"], [194995, 1, "\u8650"], [194996, 1, "\u865C"], [194997, 1, "\u8667"], [194998, 1, "\u8669"], [194999, 1, "\u86A9"], [195e3, 1, "\u8688"], [195001, 1, "\u870E"], [195002, 1, "\u86E2"], [195003, 1, "\u8779"], [195004, 1, "\u8728"], [195005, 1, "\u876B"], [195006, 1, "\u8786"], [195007, 1, "\u45D7"], [195008, 1, "\u87E1"], [195009, 1, "\u8801"], [195010, 1, "\u45F9"], [195011, 1, "\u8860"], [195012, 1, "\u8863"], [195013, 1, "\u{27667}"], [195014, 1, "\u88D7"], [195015, 1, "\u88DE"], [195016, 1, "\u4635"], [195017, 1, "\u88FA"], [195018, 1, "\u34BB"], [195019, 1, "\u{278AE}"], [195020, 1, "\u{27966}"], [195021, 1, "\u46BE"], [195022, 1, "\u46C7"], [195023, 1, "\u8AA0"], [195024, 1, "\u8AED"], [195025, 1, "\u8B8A"], [195026, 1, "\u8C55"], [195027, 1, "\u{27CA8}"], [195028, 1, "\u8CAB"], [195029, 1, "\u8CC1"], [195030, 1, "\u8D1B"], [195031, 1, "\u8D77"], [195032, 1, "\u{27F2F}"], [195033, 1, "\u{20804}"], [195034, 1, "\u8DCB"], [195035, 1, "\u8DBC"], [195036, 1, "\u8DF0"], [195037, 1, "\u{208DE}"], [195038, 1, "\u8ED4"], [195039, 1, "\u8F38"], [195040, 1, "\u{285D2}"], [195041, 1, "\u{285ED}"], [195042, 1, "\u9094"], [195043, 1, "\u90F1"], [195044, 1, "\u9111"], [195045, 1, "\u{2872E}"], [195046, 1, "\u911B"], [195047, 1, "\u9238"], [195048, 1, "\u92D7"], [195049, 1, "\u92D8"], [195050, 1, "\u927C"], [195051, 1, "\u93F9"], [195052, 1, "\u9415"], [195053, 1, "\u{28BFA}"], [195054, 1, "\u958B"], [195055, 1, "\u4995"], [195056, 1, "\u95B7"], [195057, 1, "\u{28D77}"], [195058, 1, "\u49E6"], [195059, 1, "\u96C3"], [195060, 1, "\u5DB2"], [195061, 1, "\u9723"], [195062, 1, "\u{29145}"], [195063, 1, "\u{2921A}"], [195064, 1, "\u4A6E"], [195065, 1, "\u4A76"], [195066, 1, "\u97E0"], [195067, 1, "\u{2940A}"], [195068, 1, "\u4AB2"], [195069, 1, "\u{29496}"], [[195070, 195071], 1, "\u980B"], [195072, 1, "\u9829"], [195073, 1, "\u{295B6}"], [195074, 1, "\u98E2"], [195075, 1, "\u4B33"], [195076, 1, "\u9929"], [195077, 1, "\u99A7"], [195078, 1, "\u99C2"], [195079, 1, "\u99FE"], [195080, 1, "\u4BCE"], [195081, 1, "\u{29B30}"], [195082, 1, "\u9B12"], [195083, 1, "\u9C40"], [195084, 1, "\u9CFD"], [195085, 1, "\u4CCE"], [195086, 1, "\u4CED"], [195087, 1, "\u9D67"], [195088, 1, "\u{2A0CE}"], [195089, 1, "\u4CF8"], [195090, 1, "\u{2A105}"], [195091, 1, "\u{2A20E}"], [195092, 1, "\u{2A291}"], [195093, 1, "\u9EBB"], [195094, 1, "\u4D56"], [195095, 1, "\u9EF9"], [195096, 1, "\u9EFE"], [195097, 1, "\u9F05"], [195098, 1, "\u9F0F"], [195099, 1, "\u9F16"], [195100, 1, "\u9F3B"], [195101, 1, "\u{2A600}"], [[195102, 196605], 3], [[196606, 196607], 3], [[196608, 201546], 2], [[201547, 201551], 3], [[201552, 205743], 2], [[205744, 262141], 3], [[262142, 262143], 3], [[262144, 327677], 3], [[327678, 327679], 3], [[327680, 393213], 3], [[393214, 393215], 3], [[393216, 458749], 3], [[458750, 458751], 3], [[458752, 524285], 3], [[524286, 524287], 3], [[524288, 589821], 3], [[589822, 589823], 3], [[589824, 655357], 3], [[655358, 655359], 3], [[655360, 720893], 3], [[720894, 720895], 3], [[720896, 786429], 3], [[786430, 786431], 3], [[786432, 851965], 3], [[851966, 851967], 3], [[851968, 917501], 3], [[917502, 917503], 3], [917504, 3], [917505, 3], [[917506, 917535], 3], [[917536, 917631], 3], [[917632, 917759], 3], [[917760, 917999], 7], [[918e3, 983037], 3], [[983038, 983039], 3], [[983040, 1048573], 3], [[1048574, 1048575], 3], [[1048576, 1114109], 3], [[1114110, 1114111], 3]]; + } +}); + +// node_modules/tr46/lib/statusMapping.js +var require_statusMapping = __commonJS({ + "node_modules/tr46/lib/statusMapping.js"(exports2, module2) { + "use strict"; + module2.exports.STATUS_MAPPING = { + mapped: 1, + valid: 2, + disallowed: 3, + deviation: 6, + ignored: 7 + }; + } +}); + +// node_modules/tr46/index.js +var require_tr46 = __commonJS({ + "node_modules/tr46/index.js"(exports2, module2) { + "use strict"; + var punycode = require_punycode(); + var regexes = require_regexes(); + var mappingTable = require_mappingTable(); + var { STATUS_MAPPING } = require_statusMapping(); + function containsNonASCII(str) { + return /[^\x00-\x7F]/u.test(str); + } + function findStatus(val) { + let start = 0; + let end = mappingTable.length - 1; + while (start <= end) { + const mid = Math.floor((start + end) / 2); + const target = mappingTable[mid]; + const min = Array.isArray(target[0]) ? target[0][0] : target[0]; + const max = Array.isArray(target[0]) ? target[0][1] : target[0]; + if (min <= val && max >= val) { + return target.slice(1); + } else if (min > val) { + end = mid - 1; + } else { + start = mid + 1; + } + } + return null; + } + function mapChars(domainName, { transitionalProcessing }) { + let processed = ""; + for (const ch of domainName) { + const [status, mapping] = findStatus(ch.codePointAt(0)); + switch (status) { + case STATUS_MAPPING.disallowed: + processed += ch; + break; + case STATUS_MAPPING.ignored: + break; + case STATUS_MAPPING.mapped: + if (transitionalProcessing && ch === "\u1E9E") { + processed += "ss"; + } else { + processed += mapping; + } + break; + case STATUS_MAPPING.deviation: + if (transitionalProcessing) { + processed += mapping; + } else { + processed += ch; + } + break; + case STATUS_MAPPING.valid: + processed += ch; + break; + } + } + return processed; + } + function validateLabel(label, { + checkHyphens, + checkBidi, + checkJoiners, + transitionalProcessing, + useSTD3ASCIIRules, + isBidi + }) { + if (label.length === 0) { + return true; + } + if (label.normalize("NFC") !== label) { + return false; + } + const codePoints = Array.from(label); + if (checkHyphens) { + if (codePoints[2] === "-" && codePoints[3] === "-" || (label.startsWith("-") || label.endsWith("-"))) { + return false; + } + } + if (!checkHyphens) { + if (label.startsWith("xn--")) { + return false; + } + } + if (label.includes(".")) { + return false; + } + if (regexes.combiningMarks.test(codePoints[0])) { + return false; + } + for (const ch of codePoints) { + const codePoint = ch.codePointAt(0); + const [status] = findStatus(codePoint); + if (transitionalProcessing) { + if (status !== STATUS_MAPPING.valid) { + return false; + } + } else if (status !== STATUS_MAPPING.valid && status !== STATUS_MAPPING.deviation) { + return false; + } + if (useSTD3ASCIIRules && codePoint <= 127) { + if (!/^(?:[a-z]|[0-9]|-)$/u.test(ch)) { + return false; + } + } + } + if (checkJoiners) { + let last = 0; + for (const [i4, ch] of codePoints.entries()) { + if (ch === "\u200C" || ch === "\u200D") { + if (i4 > 0) { + if (regexes.combiningClassVirama.test(codePoints[i4 - 1])) { + continue; + } + if (ch === "\u200C") { + const next = codePoints.indexOf("\u200C", i4 + 1); + const test = next < 0 ? codePoints.slice(last) : codePoints.slice(last, next); + if (regexes.validZWNJ.test(test.join(""))) { + last = i4 + 1; + continue; + } + } + } + return false; + } + } + } + if (checkBidi && isBidi) { + let rtl; + if (regexes.bidiS1LTR.test(codePoints[0])) { + rtl = false; + } else if (regexes.bidiS1RTL.test(codePoints[0])) { + rtl = true; + } else { + return false; + } + if (rtl) { + if (!regexes.bidiS2.test(label) || !regexes.bidiS3.test(label) || regexes.bidiS4EN.test(label) && regexes.bidiS4AN.test(label)) { + return false; + } + } else if (!regexes.bidiS5.test(label) || !regexes.bidiS6.test(label)) { + return false; + } + } + return true; + } + function isBidiDomain(labels) { + const domain = labels.map((label) => { + if (label.startsWith("xn--")) { + try { + return punycode.decode(label.substring(4)); + } catch { + return ""; + } + } + return label; + }).join("."); + return regexes.bidiDomain.test(domain); + } + function processing(domainName, options) { + let string = mapChars(domainName, options); + string = string.normalize("NFC"); + const labels = string.split("."); + const isBidi = isBidiDomain(labels); + let error2 = false; + for (const [i4, origLabel] of labels.entries()) { + let label = origLabel; + let transitionalProcessingForThisLabel = options.transitionalProcessing; + if (label.startsWith("xn--")) { + if (containsNonASCII(label)) { + error2 = true; + continue; + } + try { + label = punycode.decode(label.substring(4)); + } catch { + if (!options.ignoreInvalidPunycode) { + error2 = true; + continue; + } + } + labels[i4] = label; + if (label === "" || !containsNonASCII(label)) { + error2 = true; + } + transitionalProcessingForThisLabel = false; + } + if (error2) { + continue; + } + const validation = validateLabel(label, { + ...options, + transitionalProcessing: transitionalProcessingForThisLabel, + isBidi + }); + if (!validation) { + error2 = true; + } + } + return { + string: labels.join("."), + error: error2 + }; + } + function toASCII(domainName, { + checkHyphens = false, + checkBidi = false, + checkJoiners = false, + useSTD3ASCIIRules = false, + verifyDNSLength = false, + transitionalProcessing = false, + ignoreInvalidPunycode = false + } = {}) { + const result = processing(domainName, { + checkHyphens, + checkBidi, + checkJoiners, + useSTD3ASCIIRules, + transitionalProcessing, + ignoreInvalidPunycode + }); + let labels = result.string.split("."); + labels = labels.map((l4) => { + if (containsNonASCII(l4)) { + try { + return `xn--${punycode.encode(l4)}`; + } catch { + result.error = true; + } + } + return l4; + }); + if (verifyDNSLength) { + const total = labels.join(".").length; + if (total > 253 || total === 0) { + result.error = true; + } + for (let i4 = 0; i4 < labels.length; ++i4) { + if (labels[i4].length > 63 || labels[i4].length === 0) { + result.error = true; + break; + } + } + } + if (result.error) { + return null; + } + return labels.join("."); + } + function toUnicode(domainName, { + checkHyphens = false, + checkBidi = false, + checkJoiners = false, + useSTD3ASCIIRules = false, + transitionalProcessing = false, + ignoreInvalidPunycode = false + } = {}) { + const result = processing(domainName, { + checkHyphens, + checkBidi, + checkJoiners, + useSTD3ASCIIRules, + transitionalProcessing, + ignoreInvalidPunycode + }); + return { + domain: result.string, + error: result.error + }; + } + module2.exports = { + toASCII, + toUnicode + }; + } +}); + +// node_modules/whatwg-url/lib/infra.js +var require_infra = __commonJS({ + "node_modules/whatwg-url/lib/infra.js"(exports2, module2) { + "use strict"; + function isASCIIDigit(c4) { + return c4 >= 48 && c4 <= 57; + } + function isASCIIAlpha(c4) { + return c4 >= 65 && c4 <= 90 || c4 >= 97 && c4 <= 122; + } + function isASCIIAlphanumeric(c4) { + return isASCIIAlpha(c4) || isASCIIDigit(c4); + } + function isASCIIHex(c4) { + return isASCIIDigit(c4) || c4 >= 65 && c4 <= 70 || c4 >= 97 && c4 <= 102; + } + module2.exports = { + isASCIIDigit, + isASCIIAlpha, + isASCIIAlphanumeric, + isASCIIHex + }; + } +}); + +// node_modules/whatwg-url/lib/encoding.js +var require_encoding2 = __commonJS({ + "node_modules/whatwg-url/lib/encoding.js"(exports2, module2) { + "use strict"; + var utf8Encoder = new TextEncoder(); + var utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true }); + function utf8Encode(string) { + return utf8Encoder.encode(string); + } + function utf8DecodeWithoutBOM(bytes) { + return utf8Decoder.decode(bytes); + } + module2.exports = { + utf8Encode, + utf8DecodeWithoutBOM + }; + } +}); + +// node_modules/whatwg-url/lib/percent-encoding.js +var require_percent_encoding = __commonJS({ + "node_modules/whatwg-url/lib/percent-encoding.js"(exports2, module2) { + "use strict"; + var { isASCIIHex } = require_infra(); + var { utf8Encode } = require_encoding2(); + function p4(char) { + return char.codePointAt(0); + } + function percentEncode(c4) { + let hex = c4.toString(16).toUpperCase(); + if (hex.length === 1) { + hex = `0${hex}`; + } + return `%${hex}`; + } + function percentDecodeBytes(input) { + const output = new Uint8Array(input.byteLength); + let outputIndex = 0; + for (let i4 = 0; i4 < input.byteLength; ++i4) { + const byte = input[i4]; + if (byte !== 37) { + output[outputIndex++] = byte; + } else if (byte === 37 && (!isASCIIHex(input[i4 + 1]) || !isASCIIHex(input[i4 + 2]))) { + output[outputIndex++] = byte; + } else { + const bytePoint = parseInt(String.fromCodePoint(input[i4 + 1], input[i4 + 2]), 16); + output[outputIndex++] = bytePoint; + i4 += 2; + } + } + return output.slice(0, outputIndex); + } + function percentDecodeString(input) { + const bytes = utf8Encode(input); + return percentDecodeBytes(bytes); + } + function isC0ControlPercentEncode(c4) { + return c4 <= 31 || c4 > 126; + } + var extraFragmentPercentEncodeSet = /* @__PURE__ */ new Set([p4(" "), p4('"'), p4("<"), p4(">"), p4("`")]); + function isFragmentPercentEncode(c4) { + return isC0ControlPercentEncode(c4) || extraFragmentPercentEncodeSet.has(c4); + } + var extraQueryPercentEncodeSet = /* @__PURE__ */ new Set([p4(" "), p4('"'), p4("#"), p4("<"), p4(">")]); + function isQueryPercentEncode(c4) { + return isC0ControlPercentEncode(c4) || extraQueryPercentEncodeSet.has(c4); + } + function isSpecialQueryPercentEncode(c4) { + return isQueryPercentEncode(c4) || c4 === p4("'"); + } + var extraPathPercentEncodeSet = /* @__PURE__ */ new Set([p4("?"), p4("`"), p4("{"), p4("}"), p4("^")]); + function isPathPercentEncode(c4) { + return isQueryPercentEncode(c4) || extraPathPercentEncodeSet.has(c4); + } + var extraUserinfoPercentEncodeSet = /* @__PURE__ */ new Set([p4("/"), p4(":"), p4(";"), p4("="), p4("@"), p4("["), p4("\\"), p4("]"), p4("|")]); + function isUserinfoPercentEncode(c4) { + return isPathPercentEncode(c4) || extraUserinfoPercentEncodeSet.has(c4); + } + var extraComponentPercentEncodeSet = /* @__PURE__ */ new Set([p4("$"), p4("%"), p4("&"), p4("+"), p4(",")]); + function isComponentPercentEncode(c4) { + return isUserinfoPercentEncode(c4) || extraComponentPercentEncodeSet.has(c4); + } + var extraURLEncodedPercentEncodeSet = /* @__PURE__ */ new Set([p4("!"), p4("'"), p4("("), p4(")"), p4("~")]); + function isURLEncodedPercentEncode(c4) { + return isComponentPercentEncode(c4) || extraURLEncodedPercentEncodeSet.has(c4); + } + function utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate) { + const bytes = utf8Encode(codePoint); + let output = ""; + for (const byte of bytes) { + if (!percentEncodePredicate(byte)) { + output += String.fromCharCode(byte); + } else { + output += percentEncode(byte); + } + } + return output; + } + function utf8PercentEncodeCodePoint(codePoint, percentEncodePredicate) { + return utf8PercentEncodeCodePointInternal(String.fromCodePoint(codePoint), percentEncodePredicate); + } + function utf8PercentEncodeString(input, percentEncodePredicate, spaceAsPlus = false) { + let output = ""; + for (const codePoint of input) { + if (spaceAsPlus && codePoint === " ") { + output += "+"; + } else { + output += utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate); + } + } + return output; + } + module2.exports = { + isC0ControlPercentEncode, + isFragmentPercentEncode, + isQueryPercentEncode, + isSpecialQueryPercentEncode, + isPathPercentEncode, + isUserinfoPercentEncode, + isURLEncodedPercentEncode, + percentDecodeString, + percentDecodeBytes, + utf8PercentEncodeString, + utf8PercentEncodeCodePoint + }; + } +}); + +// node_modules/whatwg-url/lib/url-state-machine.js +var require_url_state_machine = __commonJS({ + "node_modules/whatwg-url/lib/url-state-machine.js"(exports2, module2) { + "use strict"; + var tr46 = require_tr46(); + var infra = require_infra(); + var { utf8DecodeWithoutBOM } = require_encoding2(); + var { + percentDecodeString, + utf8PercentEncodeCodePoint, + utf8PercentEncodeString, + isC0ControlPercentEncode, + isFragmentPercentEncode, + isQueryPercentEncode, + isSpecialQueryPercentEncode, + isPathPercentEncode, + isUserinfoPercentEncode + } = require_percent_encoding(); + function p4(char) { + return char.codePointAt(0); + } + var specialSchemes = { + ftp: 21, + file: null, + http: 80, + https: 443, + ws: 80, + wss: 443 + }; + var failure = /* @__PURE__ */ Symbol("failure"); + function countSymbols(str) { + return [...str].length; + } + function at(input, idx) { + const c4 = input[idx]; + return isNaN(c4) ? void 0 : String.fromCodePoint(c4); + } + function isSingleDot(buffer) { + return buffer === "." || buffer.toLowerCase() === "%2e"; + } + function isDoubleDot(buffer) { + buffer = buffer.toLowerCase(); + return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; + } + function isWindowsDriveLetterCodePoints(cp1, cp2) { + return infra.isASCIIAlpha(cp1) && (cp2 === p4(":") || cp2 === p4("|")); + } + function isWindowsDriveLetterString(string) { + return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); + } + function isNormalizedWindowsDriveLetterString(string) { + return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; + } + function containsForbiddenHostCodePoint(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u) !== -1; + } + function containsForbiddenDomainCodePoint(string) { + return containsForbiddenHostCodePoint(string) || string.search(/[\u0000-\u001F]|%|\u007F/u) !== -1; + } + function isSpecialScheme(scheme) { + return specialSchemes[scheme] !== void 0; + } + function isSpecial(url) { + return isSpecialScheme(url.scheme); + } + function isNotSpecial(url) { + return !isSpecialScheme(url.scheme); + } + function defaultPort(scheme) { + return specialSchemes[scheme]; + } + function parseIPv4Number(input) { + if (input === "") { + return failure; + } + let R = 10; + if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { + input = input.substring(2); + R = 16; + } else if (input.length >= 2 && input.charAt(0) === "0") { + input = input.substring(1); + R = 8; + } + if (input === "") { + return 0; + } + let regex = /[^0-7]/u; + if (R === 10) { + regex = /[^0-9]/u; + } + if (R === 16) { + regex = /[^0-9A-Fa-f]/u; + } + if (regex.test(input)) { + return failure; + } + return parseInt(input, R); + } + function parseIPv4(input) { + const parts = input.split("."); + if (parts[parts.length - 1] === "") { + if (parts.length > 1) { + parts.pop(); + } + } + if (parts.length > 4) { + return failure; + } + const numbers = []; + for (const part of parts) { + const n4 = parseIPv4Number(part); + if (n4 === failure) { + return failure; + } + numbers.push(n4); + } + for (let i4 = 0; i4 < numbers.length - 1; ++i4) { + if (numbers[i4] > 255) { + return failure; + } + } + if (numbers[numbers.length - 1] >= 256 ** (5 - numbers.length)) { + return failure; + } + let ipv4 = numbers.pop(); + let counter = 0; + for (const n4 of numbers) { + ipv4 += n4 * 256 ** (3 - counter); + ++counter; + } + return ipv4; + } + function serializeIPv4(address) { + let output = ""; + let n4 = address; + for (let i4 = 1; i4 <= 4; ++i4) { + output = String(n4 % 256) + output; + if (i4 !== 4) { + output = `.${output}`; + } + n4 = Math.floor(n4 / 256); + } + return output; + } + function parseIPv6(input) { + const address = [0, 0, 0, 0, 0, 0, 0, 0]; + let pieceIndex = 0; + let compress = null; + let pointer = 0; + input = Array.from(input, (c4) => c4.codePointAt(0)); + if (input[pointer] === p4(":")) { + if (input[pointer + 1] !== p4(":")) { + return failure; + } + pointer += 2; + ++pieceIndex; + compress = pieceIndex; + } + while (pointer < input.length) { + if (pieceIndex === 8) { + return failure; + } + if (input[pointer] === p4(":")) { + if (compress !== null) { + return failure; + } + ++pointer; + ++pieceIndex; + compress = pieceIndex; + continue; + } + let value = 0; + let length = 0; + while (length < 4 && infra.isASCIIHex(input[pointer])) { + value = value * 16 + parseInt(at(input, pointer), 16); + ++pointer; + ++length; + } + if (input[pointer] === p4(".")) { + if (length === 0) { + return failure; + } + pointer -= length; + if (pieceIndex > 6) { + return failure; + } + let numbersSeen = 0; + while (input[pointer] !== void 0) { + let ipv4Piece = null; + if (numbersSeen > 0) { + if (input[pointer] === p4(".") && numbersSeen < 4) { + ++pointer; + } else { + return failure; + } + } + if (!infra.isASCIIDigit(input[pointer])) { + return failure; + } + while (infra.isASCIIDigit(input[pointer])) { + const number = parseInt(at(input, pointer)); + if (ipv4Piece === null) { + ipv4Piece = number; + } else if (ipv4Piece === 0) { + return failure; + } else { + ipv4Piece = ipv4Piece * 10 + number; + } + if (ipv4Piece > 255) { + return failure; + } + ++pointer; + } + address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; + ++numbersSeen; + if (numbersSeen === 2 || numbersSeen === 4) { + ++pieceIndex; + } + } + if (numbersSeen !== 4) { + return failure; + } + break; + } else if (input[pointer] === p4(":")) { + ++pointer; + if (input[pointer] === void 0) { + return failure; + } + } else if (input[pointer] !== void 0) { + return failure; + } + address[pieceIndex] = value; + ++pieceIndex; + } + if (compress !== null) { + let swaps = pieceIndex - compress; + pieceIndex = 7; + while (pieceIndex !== 0 && swaps > 0) { + const temp = address[compress + swaps - 1]; + address[compress + swaps - 1] = address[pieceIndex]; + address[pieceIndex] = temp; + --pieceIndex; + --swaps; + } + } else if (compress === null && pieceIndex !== 8) { + return failure; + } + return address; + } + function serializeIPv6(address) { + let output = ""; + const compress = findTheIPv6AddressCompressedPieceIndex(address); + let ignore0 = false; + for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { + if (ignore0 && address[pieceIndex] === 0) { + continue; + } else if (ignore0) { + ignore0 = false; + } + if (compress === pieceIndex) { + const separator = pieceIndex === 0 ? "::" : ":"; + output += separator; + ignore0 = true; + continue; + } + output += address[pieceIndex].toString(16); + if (pieceIndex !== 7) { + output += ":"; + } + } + return output; + } + function parseHost(input, isOpaque = false) { + if (input[0] === "[") { + if (input[input.length - 1] !== "]") { + return failure; + } + return parseIPv6(input.substring(1, input.length - 1)); + } + if (isOpaque) { + return parseOpaqueHost(input); + } + const domain = utf8DecodeWithoutBOM(percentDecodeString(input)); + const asciiDomain = domainToASCII(domain); + if (asciiDomain === failure) { + return failure; + } + if (endsInANumber(asciiDomain)) { + return parseIPv4(asciiDomain); + } + return asciiDomain; + } + function endsInANumber(input) { + const parts = input.split("."); + if (parts[parts.length - 1] === "") { + if (parts.length === 1) { + return false; + } + parts.pop(); + } + const last = parts[parts.length - 1]; + if (parseIPv4Number(last) !== failure) { + return true; + } + if (/^[0-9]+$/u.test(last)) { + return true; + } + return false; + } + function parseOpaqueHost(input) { + if (containsForbiddenHostCodePoint(input)) { + return failure; + } + return utf8PercentEncodeString(input, isC0ControlPercentEncode); + } + function findTheIPv6AddressCompressedPieceIndex(address) { + let longestIndex = null; + let longestSize = 1; + let foundIndex = null; + let foundSize = 0; + for (let pieceIndex = 0; pieceIndex < address.length; ++pieceIndex) { + if (address[pieceIndex] !== 0) { + if (foundSize > longestSize) { + longestIndex = foundIndex; + longestSize = foundSize; + } + foundIndex = null; + foundSize = 0; + } else { + if (foundIndex === null) { + foundIndex = pieceIndex; + } + ++foundSize; + } + } + if (foundSize > longestSize) { + return foundIndex; + } + return longestIndex; + } + function serializeHost(host) { + if (typeof host === "number") { + return serializeIPv4(host); + } + if (host instanceof Array) { + return `[${serializeIPv6(host)}]`; + } + return host; + } + function domainToASCII(domain, beStrict = false) { + const result = tr46.toASCII(domain, { + checkHyphens: beStrict, + checkBidi: true, + checkJoiners: true, + useSTD3ASCIIRules: beStrict, + transitionalProcessing: false, + verifyDNSLength: beStrict, + ignoreInvalidPunycode: false + }); + if (result === null) { + return failure; + } + if (!beStrict) { + if (result === "") { + return failure; + } + if (containsForbiddenDomainCodePoint(result)) { + return failure; + } + } + return result; + } + function trimControlChars(string) { + let start = 0; + let end = string.length; + for (; start < end; ++start) { + if (string.charCodeAt(start) > 32) { + break; + } + } + for (; end > start; --end) { + if (string.charCodeAt(end - 1) > 32) { + break; + } + } + return string.substring(start, end); + } + function trimTabAndNewline(url) { + return url.replace(/\u0009|\u000A|\u000D/ug, ""); + } + function shortenPath(url) { + const { path } = url; + if (path.length === 0) { + return; + } + if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { + return; + } + path.pop(); + } + function includesCredentials(url) { + return url.username !== "" || url.password !== ""; + } + function cannotHaveAUsernamePasswordPort(url) { + return url.host === null || url.host === "" || url.scheme === "file"; + } + function hasAnOpaquePath(url) { + return typeof url.path === "string"; + } + function isNormalizedWindowsDriveLetter(string) { + return /^[A-Za-z]:$/u.test(string); + } + function URLStateMachine(input, base, encodingOverride, url, stateOverride) { + this.pointer = 0; + this.input = input; + this.base = base || null; + this.encodingOverride = encodingOverride || "utf-8"; + this.stateOverride = stateOverride; + this.url = url; + this.failure = false; + this.parseError = false; + if (!this.url) { + this.url = { + scheme: "", + username: "", + password: "", + host: null, + port: null, + path: [], + query: null, + fragment: null + }; + const res2 = trimControlChars(this.input); + if (res2 !== this.input) { + this.parseError = true; + } + this.input = res2; + } + const res = trimTabAndNewline(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + this.state = stateOverride || "scheme start"; + this.buffer = ""; + this.atFlag = false; + this.arrFlag = false; + this.passwordTokenSeenFlag = false; + this.input = Array.from(this.input, (c4) => c4.codePointAt(0)); + for (; this.pointer <= this.input.length; ++this.pointer) { + const c4 = this.input[this.pointer]; + const cStr = isNaN(c4) ? void 0 : String.fromCodePoint(c4); + const ret = this[`parse ${this.state}`](c4, cStr); + if (!ret) { + break; + } else if (ret === failure) { + this.failure = true; + break; + } + } + } + URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c4, cStr) { + if (infra.isASCIIAlpha(c4)) { + this.buffer += cStr.toLowerCase(); + this.state = "scheme"; + } else if (!this.stateOverride) { + this.state = "no scheme"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + return true; + }; + URLStateMachine.prototype["parse scheme"] = function parseScheme(c4, cStr) { + if (infra.isASCIIAlphanumeric(c4) || c4 === p4("+") || c4 === p4("-") || c4 === p4(".")) { + this.buffer += cStr.toLowerCase(); + } else if (c4 === p4(":")) { + if (this.stateOverride) { + if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { + return false; + } + if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { + return false; + } + if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { + return false; + } + if (this.url.scheme === "file" && this.url.host === "") { + return false; + } + } + this.url.scheme = this.buffer; + if (this.stateOverride) { + if (this.url.port === defaultPort(this.url.scheme)) { + this.url.port = null; + } + return false; + } + this.buffer = ""; + if (this.url.scheme === "file") { + if (this.input[this.pointer + 1] !== p4("/") || this.input[this.pointer + 2] !== p4("/")) { + this.parseError = true; + } + this.state = "file"; + } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { + this.state = "special relative or authority"; + } else if (isSpecial(this.url)) { + this.state = "special authority slashes"; + } else if (this.input[this.pointer + 1] === p4("/")) { + this.state = "path or authority"; + ++this.pointer; + } else { + this.url.path = ""; + this.state = "opaque path"; + } + } else if (!this.stateOverride) { + this.buffer = ""; + this.state = "no scheme"; + this.pointer = -1; + } else { + this.parseError = true; + return failure; + } + return true; + }; + URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c4) { + if (this.base === null || hasAnOpaquePath(this.base) && c4 !== p4("#")) { + return failure; + } else if (hasAnOpaquePath(this.base) && c4 === p4("#")) { + this.url.scheme = this.base.scheme; + this.url.path = this.base.path; + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else if (this.base.scheme === "file") { + this.state = "file"; + --this.pointer; + } else { + this.state = "relative"; + --this.pointer; + } + return true; + }; + URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c4) { + if (c4 === p4("/") && this.input[this.pointer + 1] === p4("/")) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "relative"; + --this.pointer; + } + return true; + }; + URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c4) { + if (c4 === p4("/")) { + this.state = "authority"; + } else { + this.state = "path"; + --this.pointer; + } + return true; + }; + URLStateMachine.prototype["parse relative"] = function parseRelative(c4) { + this.url.scheme = this.base.scheme; + if (c4 === p4("/")) { + this.state = "relative slash"; + } else if (isSpecial(this.url) && c4 === p4("\\")) { + this.parseError = true; + this.state = "relative slash"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + if (c4 === p4("?")) { + this.url.query = ""; + this.state = "query"; + } else if (c4 === p4("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (!isNaN(c4)) { + this.url.query = null; + this.url.path.pop(); + this.state = "path"; + --this.pointer; + } + } + return true; + }; + URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c4) { + if (isSpecial(this.url) && (c4 === p4("/") || c4 === p4("\\"))) { + if (c4 === p4("\\")) { + this.parseError = true; + } + this.state = "special authority ignore slashes"; + } else if (c4 === p4("/")) { + this.state = "authority"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.state = "path"; + --this.pointer; + } + return true; + }; + URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c4) { + if (c4 === p4("/") && this.input[this.pointer + 1] === p4("/")) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "special authority ignore slashes"; + --this.pointer; + } + return true; + }; + URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c4) { + if (c4 !== p4("/") && c4 !== p4("\\")) { + this.state = "authority"; + --this.pointer; + } else { + this.parseError = true; + } + return true; + }; + URLStateMachine.prototype["parse authority"] = function parseAuthority(c4, cStr) { + if (c4 === p4("@")) { + this.parseError = true; + if (this.atFlag) { + this.buffer = `%40${this.buffer}`; + } + this.atFlag = true; + const len = countSymbols(this.buffer); + for (let pointer = 0; pointer < len; ++pointer) { + const codePoint = this.buffer.codePointAt(pointer); + if (codePoint === p4(":") && !this.passwordTokenSeenFlag) { + this.passwordTokenSeenFlag = true; + continue; + } + const encodedCodePoints = utf8PercentEncodeCodePoint(codePoint, isUserinfoPercentEncode); + if (this.passwordTokenSeenFlag) { + this.url.password += encodedCodePoints; + } else { + this.url.username += encodedCodePoints; + } + } + this.buffer = ""; + } else if (isNaN(c4) || c4 === p4("/") || c4 === p4("?") || c4 === p4("#") || isSpecial(this.url) && c4 === p4("\\")) { + if (this.atFlag && this.buffer === "") { + this.parseError = true; + return failure; + } + this.pointer -= countSymbols(this.buffer) + 1; + this.buffer = ""; + this.state = "host"; + } else { + this.buffer += cStr; + } + return true; + }; + URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype["parse host"] = function parseHostName(c4, cStr) { + if (this.stateOverride && this.url.scheme === "file") { + --this.pointer; + this.state = "file host"; + } else if (c4 === p4(":") && !this.arrFlag) { + if (this.buffer === "") { + this.parseError = true; + return failure; + } + if (this.stateOverride === "hostname") { + return false; + } + const host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + this.url.host = host; + this.buffer = ""; + this.state = "port"; + } else if (isNaN(c4) || c4 === p4("/") || c4 === p4("?") || c4 === p4("#") || isSpecial(this.url) && c4 === p4("\\")) { + --this.pointer; + if (isSpecial(this.url) && this.buffer === "") { + this.parseError = true; + return failure; + } else if (this.stateOverride && this.buffer === "" && (includesCredentials(this.url) || this.url.port !== null)) { + this.parseError = true; + return false; + } + const host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + this.url.host = host; + this.buffer = ""; + this.state = "path start"; + if (this.stateOverride) { + return false; + } + } else { + if (c4 === p4("[")) { + this.arrFlag = true; + } else if (c4 === p4("]")) { + this.arrFlag = false; + } + this.buffer += cStr; + } + return true; + }; + URLStateMachine.prototype["parse port"] = function parsePort(c4, cStr) { + if (infra.isASCIIDigit(c4)) { + this.buffer += cStr; + } else if (isNaN(c4) || c4 === p4("/") || c4 === p4("?") || c4 === p4("#") || isSpecial(this.url) && c4 === p4("\\") || this.stateOverride) { + if (this.buffer !== "") { + const port = parseInt(this.buffer); + if (port > 2 ** 16 - 1) { + this.parseError = true; + return failure; + } + this.url.port = port === defaultPort(this.url.scheme) ? null : port; + this.buffer = ""; + } + if (this.stateOverride) { + return false; + } + this.state = "path start"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + return true; + }; + var fileOtherwiseCodePoints = /* @__PURE__ */ new Set([p4("/"), p4("\\"), p4("?"), p4("#")]); + function startsWithWindowsDriveLetter(input, pointer) { + const length = input.length - pointer; + return length >= 2 && isWindowsDriveLetterCodePoints(input[pointer], input[pointer + 1]) && (length === 2 || fileOtherwiseCodePoints.has(input[pointer + 2])); + } + URLStateMachine.prototype["parse file"] = function parseFile(c4) { + this.url.scheme = "file"; + this.url.host = ""; + if (c4 === p4("/") || c4 === p4("\\")) { + if (c4 === p4("\\")) { + this.parseError = true; + } + this.state = "file slash"; + } else if (this.base !== null && this.base.scheme === "file") { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + if (c4 === p4("?")) { + this.url.query = ""; + this.state = "query"; + } else if (c4 === p4("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (!isNaN(c4)) { + this.url.query = null; + if (!startsWithWindowsDriveLetter(this.input, this.pointer)) { + shortenPath(this.url); + } else { + this.parseError = true; + this.url.path = []; + } + this.state = "path"; + --this.pointer; + } + } else { + this.state = "path"; + --this.pointer; + } + return true; + }; + URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c4) { + if (c4 === p4("/") || c4 === p4("\\")) { + if (c4 === p4("\\")) { + this.parseError = true; + } + this.state = "file host"; + } else { + if (this.base !== null && this.base.scheme === "file") { + if (!startsWithWindowsDriveLetter(this.input, this.pointer) && isNormalizedWindowsDriveLetterString(this.base.path[0])) { + this.url.path.push(this.base.path[0]); + } + this.url.host = this.base.host; + } + this.state = "path"; + --this.pointer; + } + return true; + }; + URLStateMachine.prototype["parse file host"] = function parseFileHost(c4, cStr) { + if (isNaN(c4) || c4 === p4("/") || c4 === p4("\\") || c4 === p4("?") || c4 === p4("#")) { + --this.pointer; + if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { + this.parseError = true; + this.state = "path"; + } else if (this.buffer === "") { + this.url.host = ""; + if (this.stateOverride) { + return false; + } + this.state = "path start"; + } else { + let host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + if (host === "localhost") { + host = ""; + } + this.url.host = host; + if (this.stateOverride) { + return false; + } + this.buffer = ""; + this.state = "path start"; + } + } else { + this.buffer += cStr; + } + return true; + }; + URLStateMachine.prototype["parse path start"] = function parsePathStart(c4) { + if (isSpecial(this.url)) { + if (c4 === p4("\\")) { + this.parseError = true; + } + this.state = "path"; + if (c4 !== p4("/") && c4 !== p4("\\")) { + --this.pointer; + } + } else if (!this.stateOverride && c4 === p4("?")) { + this.url.query = ""; + this.state = "query"; + } else if (!this.stateOverride && c4 === p4("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (c4 !== void 0) { + this.state = "path"; + if (c4 !== p4("/")) { + --this.pointer; + } + } else if (this.stateOverride && this.url.host === null) { + this.url.path.push(""); + } + return true; + }; + URLStateMachine.prototype["parse path"] = function parsePath(c4) { + if (isNaN(c4) || c4 === p4("/") || isSpecial(this.url) && c4 === p4("\\") || !this.stateOverride && (c4 === p4("?") || c4 === p4("#"))) { + if (isSpecial(this.url) && c4 === p4("\\")) { + this.parseError = true; + } + if (isDoubleDot(this.buffer)) { + shortenPath(this.url); + if (c4 !== p4("/") && !(isSpecial(this.url) && c4 === p4("\\"))) { + this.url.path.push(""); + } + } else if (isSingleDot(this.buffer) && c4 !== p4("/") && !(isSpecial(this.url) && c4 === p4("\\"))) { + this.url.path.push(""); + } else if (!isSingleDot(this.buffer)) { + if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { + this.buffer = `${this.buffer[0]}:`; + } + this.url.path.push(this.buffer); + } + this.buffer = ""; + if (c4 === p4("?")) { + this.url.query = ""; + this.state = "query"; + } + if (c4 === p4("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + if (c4 === p4("%") && (!infra.isASCIIHex(this.input[this.pointer + 1]) || !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + this.buffer += utf8PercentEncodeCodePoint(c4, isPathPercentEncode); + } + return true; + }; + URLStateMachine.prototype["parse opaque path"] = function parseOpaquePath(c4) { + if (c4 === p4("?")) { + this.url.query = ""; + this.state = "query"; + } else if (c4 === p4("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (c4 === p4(" ")) { + const remaining = this.input[this.pointer + 1]; + if (remaining === p4("?") || remaining === p4("#")) { + this.url.path += "%20"; + } else { + this.url.path += " "; + } + } else { + if (!isNaN(c4) && c4 !== p4("%")) { + this.parseError = true; + } + if (c4 === p4("%") && (!infra.isASCIIHex(this.input[this.pointer + 1]) || !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + if (!isNaN(c4)) { + this.url.path += utf8PercentEncodeCodePoint(c4, isC0ControlPercentEncode); + } + } + return true; + }; + URLStateMachine.prototype["parse query"] = function parseQuery(c4, cStr) { + if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { + this.encodingOverride = "utf-8"; + } + if (!this.stateOverride && c4 === p4("#") || isNaN(c4)) { + const queryPercentEncodePredicate = isSpecial(this.url) ? isSpecialQueryPercentEncode : isQueryPercentEncode; + this.url.query += utf8PercentEncodeString(this.buffer, queryPercentEncodePredicate); + this.buffer = ""; + if (c4 === p4("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else if (!isNaN(c4)) { + if (c4 === p4("%") && (!infra.isASCIIHex(this.input[this.pointer + 1]) || !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + this.buffer += cStr; + } + return true; + }; + URLStateMachine.prototype["parse fragment"] = function parseFragment(c4) { + if (!isNaN(c4)) { + if (c4 === p4("%") && (!infra.isASCIIHex(this.input[this.pointer + 1]) || !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + this.url.fragment += utf8PercentEncodeCodePoint(c4, isFragmentPercentEncode); + } + return true; + }; + function serializeURL(url, excludeFragment) { + let output = `${url.scheme}:`; + if (url.host !== null) { + output += "//"; + if (url.username !== "" || url.password !== "") { + output += url.username; + if (url.password !== "") { + output += `:${url.password}`; + } + output += "@"; + } + output += serializeHost(url.host); + if (url.port !== null) { + output += `:${url.port}`; + } + } + if (url.host === null && !hasAnOpaquePath(url) && url.path.length > 1 && url.path[0] === "") { + output += "/."; + } + output += serializePath(url); + if (url.query !== null) { + output += `?${url.query}`; + } + if (!excludeFragment && url.fragment !== null) { + output += `#${url.fragment}`; + } + return output; + } + function serializeOrigin(tuple) { + let result = `${tuple.scheme}://`; + result += serializeHost(tuple.host); + if (tuple.port !== null) { + result += `:${tuple.port}`; + } + return result; + } + function serializePath(url) { + if (hasAnOpaquePath(url)) { + return url.path; + } + let output = ""; + for (const segment of url.path) { + output += `/${segment}`; + } + return output; + } + module2.exports.serializeURL = serializeURL; + module2.exports.serializePath = serializePath; + module2.exports.serializeURLOrigin = function(url) { + switch (url.scheme) { + case "blob": { + const pathURL = module2.exports.parseURL(serializePath(url)); + if (pathURL === null) { + return "null"; + } + if (pathURL.scheme !== "http" && pathURL.scheme !== "https") { + return "null"; + } + return module2.exports.serializeURLOrigin(pathURL); + } + case "ftp": + case "http": + case "https": + case "ws": + case "wss": + return serializeOrigin({ + scheme: url.scheme, + host: url.host, + port: url.port + }); + case "file": + return "null"; + default: + return "null"; + } + }; + module2.exports.basicURLParse = function(input, options) { + if (options === void 0) { + options = {}; + } + const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); + if (usm.failure) { + return null; + } + return usm.url; + }; + module2.exports.setTheUsername = function(url, username) { + url.username = utf8PercentEncodeString(username, isUserinfoPercentEncode); + }; + module2.exports.setThePassword = function(url, password) { + url.password = utf8PercentEncodeString(password, isUserinfoPercentEncode); + }; + module2.exports.serializeHost = serializeHost; + module2.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; + module2.exports.hasAnOpaquePath = hasAnOpaquePath; + module2.exports.serializeInteger = function(integer) { + return String(integer); + }; + module2.exports.parseURL = function(input, options) { + if (options === void 0) { + options = {}; + } + return module2.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); + }; + } +}); + +// node_modules/whatwg-url/lib/urlencoded.js +var require_urlencoded2 = __commonJS({ + "node_modules/whatwg-url/lib/urlencoded.js"(exports2, module2) { + "use strict"; + var { utf8Encode, utf8DecodeWithoutBOM } = require_encoding2(); + var { percentDecodeBytes, utf8PercentEncodeString, isURLEncodedPercentEncode } = require_percent_encoding(); + function p4(char) { + return char.codePointAt(0); + } + function parseUrlencoded(input) { + const sequences = strictlySplitByteSequence(input, p4("&")); + const output = []; + for (const bytes of sequences) { + if (bytes.length === 0) { + continue; + } + let name, value; + const indexOfEqual = bytes.indexOf(p4("=")); + if (indexOfEqual >= 0) { + name = bytes.slice(0, indexOfEqual); + value = bytes.slice(indexOfEqual + 1); + } else { + name = bytes; + value = new Uint8Array(0); + } + name = replaceByteInByteSequence(name, 43, 32); + value = replaceByteInByteSequence(value, 43, 32); + const nameString = utf8DecodeWithoutBOM(percentDecodeBytes(name)); + const valueString = utf8DecodeWithoutBOM(percentDecodeBytes(value)); + output.push([nameString, valueString]); + } + return output; + } + function parseUrlencodedString(input) { + return parseUrlencoded(utf8Encode(input)); + } + function serializeUrlencoded(tuples) { + let output = ""; + for (const [i4, tuple] of tuples.entries()) { + const name = utf8PercentEncodeString(tuple[0], isURLEncodedPercentEncode, true); + const value = utf8PercentEncodeString(tuple[1], isURLEncodedPercentEncode, true); + if (i4 !== 0) { + output += "&"; + } + output += `${name}=${value}`; + } + return output; + } + function strictlySplitByteSequence(buf, cp) { + const list2 = []; + let last = 0; + let i4 = buf.indexOf(cp); + while (i4 >= 0) { + list2.push(buf.slice(last, i4)); + last = i4 + 1; + i4 = buf.indexOf(cp, last); + } + if (last !== buf.length) { + list2.push(buf.slice(last)); + } + return list2; + } + function replaceByteInByteSequence(buf, from, to) { + let i4 = buf.indexOf(from); + while (i4 >= 0) { + buf[i4] = to; + i4 = buf.indexOf(from, i4 + 1); + } + return buf; + } + module2.exports = { + parseUrlencodedString, + serializeUrlencoded + }; + } +}); + +// node_modules/whatwg-url/lib/Function.js +var require_Function = __commonJS({ + "node_modules/whatwg-url/lib/Function.js"(exports2) { + "use strict"; + var conversions = require_lib4(); + var utils = require_utils5(); + exports2.convert = (globalObject, value, { context = "The provided value" } = {}) => { + if (typeof value !== "function") { + throw new globalObject.TypeError(context + " is not a function"); + } + function invokeTheCallbackFunction(...args2) { + const thisArg = utils.tryWrapperForImpl(this); + let callResult; + for (let i4 = 0; i4 < args2.length; i4++) { + args2[i4] = utils.tryWrapperForImpl(args2[i4]); + } + callResult = Reflect.apply(value, thisArg, args2); + callResult = conversions["any"](callResult, { context, globals: globalObject }); + return callResult; + } + invokeTheCallbackFunction.construct = (...args2) => { + for (let i4 = 0; i4 < args2.length; i4++) { + args2[i4] = utils.tryWrapperForImpl(args2[i4]); + } + let callResult = Reflect.construct(value, args2); + callResult = conversions["any"](callResult, { context, globals: globalObject }); + return callResult; + }; + invokeTheCallbackFunction[utils.wrapperSymbol] = value; + invokeTheCallbackFunction.objectReference = value; + return invokeTheCallbackFunction; + }; + } +}); + +// node_modules/whatwg-url/lib/URLSearchParams-impl.js +var require_URLSearchParams_impl = __commonJS({ + "node_modules/whatwg-url/lib/URLSearchParams-impl.js"(exports2) { + "use strict"; + var urlencoded = require_urlencoded2(); + exports2.implementation = class URLSearchParamsImpl { + constructor(globalObject, constructorArgs, { doNotStripQMark = false }) { + let init = constructorArgs[0]; + this._list = []; + this._url = null; + if (!doNotStripQMark && typeof init === "string" && init[0] === "?") { + init = init.slice(1); + } + if (Array.isArray(init)) { + for (const pair of init) { + if (pair.length !== 2) { + throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not contain exactly two elements."); + } + this._list.push([pair[0], pair[1]]); + } + } else if (typeof init === "object" && Object.getPrototypeOf(init) === null) { + for (const name of Object.keys(init)) { + const value = init[name]; + this._list.push([name, value]); + } + } else { + this._list = urlencoded.parseUrlencodedString(init); + } + } + _updateSteps() { + if (this._url !== null) { + let serializedQuery = urlencoded.serializeUrlencoded(this._list); + if (serializedQuery === "") { + serializedQuery = null; + } + this._url._url.query = serializedQuery; + } + } + get size() { + return this._list.length; + } + append(name, value) { + this._list.push([name, value]); + this._updateSteps(); + } + delete(name, value) { + let i4 = 0; + while (i4 < this._list.length) { + if (this._list[i4][0] === name && (value === void 0 || this._list[i4][1] === value)) { + this._list.splice(i4, 1); + } else { + i4++; + } + } + this._updateSteps(); + } + get(name) { + for (const tuple of this._list) { + if (tuple[0] === name) { + return tuple[1]; + } + } + return null; + } + getAll(name) { + const output = []; + for (const tuple of this._list) { + if (tuple[0] === name) { + output.push(tuple[1]); + } + } + return output; + } + has(name, value) { + for (const tuple of this._list) { + if (tuple[0] === name && (value === void 0 || tuple[1] === value)) { + return true; + } + } + return false; + } + set(name, value) { + let found = false; + let i4 = 0; + while (i4 < this._list.length) { + if (this._list[i4][0] === name) { + if (found) { + this._list.splice(i4, 1); + } else { + found = true; + this._list[i4][1] = value; + i4++; + } + } else { + i4++; + } + } + if (!found) { + this._list.push([name, value]); + } + this._updateSteps(); + } + sort() { + this._list.sort((a4, b4) => { + if (a4[0] < b4[0]) { + return -1; + } + if (a4[0] > b4[0]) { + return 1; + } + return 0; + }); + this._updateSteps(); + } + [Symbol.iterator]() { + return this._list[Symbol.iterator](); + } + toString() { + return urlencoded.serializeUrlencoded(this._list); + } + }; + } +}); + +// node_modules/whatwg-url/lib/URLSearchParams.js +var require_URLSearchParams = __commonJS({ + "node_modules/whatwg-url/lib/URLSearchParams.js"(exports2) { + "use strict"; + var conversions = require_lib4(); + var utils = require_utils5(); + var Function2 = require_Function(); + var newObjectInRealm = utils.newObjectInRealm; + var implSymbol = utils.implSymbol; + var ctorRegistrySymbol = utils.ctorRegistrySymbol; + var interfaceName = "URLSearchParams"; + exports2.is = (value) => { + return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + }; + exports2.isImpl = (value) => { + return utils.isObject(value) && value instanceof Impl.implementation; + }; + exports2.convert = (globalObject, value, { context = "The provided value" } = {}) => { + if (exports2.is(value)) { + return utils.implForWrapper(value); + } + throw new globalObject.TypeError(`${context} is not of type 'URLSearchParams'.`); + }; + exports2.createDefaultIterator = (globalObject, target, kind) => { + const ctorRegistry = globalObject[ctorRegistrySymbol]; + const iteratorPrototype = ctorRegistry["URLSearchParams Iterator"]; + const iterator = Object.create(iteratorPrototype); + Object.defineProperty(iterator, utils.iterInternalSymbol, { + value: { target, kind, index: 0 }, + configurable: true + }); + return iterator; + }; + function makeWrapper(globalObject, newTarget) { + let proto; + if (newTarget !== void 0) { + proto = newTarget.prototype; + } + if (!utils.isObject(proto)) { + proto = globalObject[ctorRegistrySymbol]["URLSearchParams"].prototype; + } + return Object.create(proto); + } + exports2.create = (globalObject, constructorArgs, privateData) => { + const wrapper = makeWrapper(globalObject); + return exports2.setup(wrapper, globalObject, constructorArgs, privateData); + }; + exports2.createImpl = (globalObject, constructorArgs, privateData) => { + const wrapper = exports2.create(globalObject, constructorArgs, privateData); + return utils.implForWrapper(wrapper); + }; + exports2._internalSetup = (wrapper, globalObject) => { + }; + exports2.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { + privateData.wrapper = wrapper; + exports2._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: new Impl.implementation(globalObject, constructorArgs, privateData), + configurable: true + }); + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper; + }; + exports2.new = (globalObject, newTarget) => { + const wrapper = makeWrapper(globalObject, newTarget); + exports2._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: Object.create(Impl.implementation.prototype), + configurable: true + }); + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper[implSymbol]; + }; + var exposed = /* @__PURE__ */ new Set(["Window", "Worker"]); + exports2.install = (globalObject, globalNames) => { + if (!globalNames.some((globalName) => exposed.has(globalName))) { + return; + } + const ctorRegistry = utils.initCtorRegistry(globalObject); + class URLSearchParams2 { + constructor() { + const args2 = []; + { + let curArg = arguments[0]; + if (curArg !== void 0) { + if (utils.isObject(curArg)) { + if (curArg[Symbol.iterator] !== void 0) { + if (!utils.isObject(curArg)) { + throw new globalObject.TypeError( + "Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object." + ); + } else { + const V = []; + const tmp = curArg; + for (let nextItem of tmp) { + if (!utils.isObject(nextItem)) { + throw new globalObject.TypeError( + "Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object." + ); + } else { + const V2 = []; + const tmp2 = nextItem; + for (let nextItem2 of tmp2) { + nextItem2 = conversions["USVString"](nextItem2, { + context: "Failed to construct 'URLSearchParams': parameter 1 sequence's element's element", + globals: globalObject + }); + V2.push(nextItem2); + } + nextItem = V2; + } + V.push(nextItem); + } + curArg = V; + } + } else { + if (!utils.isObject(curArg)) { + throw new globalObject.TypeError( + "Failed to construct 'URLSearchParams': parameter 1 record is not an object." + ); + } else { + const result = /* @__PURE__ */ Object.create(null); + for (const key of Reflect.ownKeys(curArg)) { + const desc = Object.getOwnPropertyDescriptor(curArg, key); + if (desc && desc.enumerable) { + let typedKey = key; + typedKey = conversions["USVString"](typedKey, { + context: "Failed to construct 'URLSearchParams': parameter 1 record's key", + globals: globalObject + }); + let typedValue = curArg[key]; + typedValue = conversions["USVString"](typedValue, { + context: "Failed to construct 'URLSearchParams': parameter 1 record's value", + globals: globalObject + }); + result[typedKey] = typedValue; + } + } + curArg = result; + } + } + } else { + curArg = conversions["USVString"](curArg, { + context: "Failed to construct 'URLSearchParams': parameter 1", + globals: globalObject + }); + } + } else { + curArg = ""; + } + args2.push(curArg); + } + return exports2.setup(Object.create(new.target.prototype), globalObject, args2); + } + append(name, value) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError( + "'append' called on an object that is not a valid instance of URLSearchParams." + ); + } + if (arguments.length < 2) { + throw new globalObject.TypeError( + `Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.` + ); + } + const args2 = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'append' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args2.push(curArg); + } + { + let curArg = arguments[1]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'append' on 'URLSearchParams': parameter 2", + globals: globalObject + }); + args2.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].append(...args2)); + } + delete(name) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError( + "'delete' called on an object that is not a valid instance of URLSearchParams." + ); + } + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args2 = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'delete' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args2.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== void 0) { + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'delete' on 'URLSearchParams': parameter 2", + globals: globalObject + }); + } + args2.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].delete(...args2)); + } + get(name) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'get' called on an object that is not a valid instance of URLSearchParams."); + } + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args2 = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'get' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args2.push(curArg); + } + return esValue[implSymbol].get(...args2); + } + getAll(name) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError( + "'getAll' called on an object that is not a valid instance of URLSearchParams." + ); + } + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args2 = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'getAll' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args2.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].getAll(...args2)); + } + has(name) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'has' called on an object that is not a valid instance of URLSearchParams."); + } + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args2 = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'has' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args2.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== void 0) { + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'has' on 'URLSearchParams': parameter 2", + globals: globalObject + }); + } + args2.push(curArg); + } + return esValue[implSymbol].has(...args2); + } + set(name, value) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'set' called on an object that is not a valid instance of URLSearchParams."); + } + if (arguments.length < 2) { + throw new globalObject.TypeError( + `Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.` + ); + } + const args2 = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'set' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args2.push(curArg); + } + { + let curArg = arguments[1]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'set' on 'URLSearchParams': parameter 2", + globals: globalObject + }); + args2.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].set(...args2)); + } + sort() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams."); + } + return utils.tryWrapperForImpl(esValue[implSymbol].sort()); + } + toString() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError( + "'toString' called on an object that is not a valid instance of URLSearchParams." + ); + } + return esValue[implSymbol].toString(); + } + keys() { + if (!exports2.is(this)) { + throw new globalObject.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams."); + } + return exports2.createDefaultIterator(globalObject, this, "key"); + } + values() { + if (!exports2.is(this)) { + throw new globalObject.TypeError( + "'values' called on an object that is not a valid instance of URLSearchParams." + ); + } + return exports2.createDefaultIterator(globalObject, this, "value"); + } + entries() { + if (!exports2.is(this)) { + throw new globalObject.TypeError( + "'entries' called on an object that is not a valid instance of URLSearchParams." + ); + } + return exports2.createDefaultIterator(globalObject, this, "key+value"); + } + forEach(callback) { + if (!exports2.is(this)) { + throw new globalObject.TypeError( + "'forEach' called on an object that is not a valid instance of URLSearchParams." + ); + } + if (arguments.length < 1) { + throw new globalObject.TypeError( + "Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present." + ); + } + callback = Function2.convert(globalObject, callback, { + context: "Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1" + }); + const thisArg = arguments[1]; + let pairs = Array.from(this[implSymbol]); + let i4 = 0; + while (i4 < pairs.length) { + const [key, value] = pairs[i4].map(utils.tryWrapperForImpl); + callback.call(thisArg, value, key, this); + pairs = Array.from(this[implSymbol]); + i4++; + } + } + get size() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError( + "'get size' called on an object that is not a valid instance of URLSearchParams." + ); + } + return esValue[implSymbol]["size"]; + } + } + Object.defineProperties(URLSearchParams2.prototype, { + append: { enumerable: true }, + delete: { enumerable: true }, + get: { enumerable: true }, + getAll: { enumerable: true }, + has: { enumerable: true }, + set: { enumerable: true }, + sort: { enumerable: true }, + toString: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true }, + forEach: { enumerable: true }, + size: { enumerable: true }, + [Symbol.toStringTag]: { value: "URLSearchParams", configurable: true }, + [Symbol.iterator]: { value: URLSearchParams2.prototype.entries, configurable: true, writable: true } + }); + ctorRegistry[interfaceName] = URLSearchParams2; + ctorRegistry["URLSearchParams Iterator"] = Object.create(ctorRegistry["%IteratorPrototype%"], { + [Symbol.toStringTag]: { + configurable: true, + value: "URLSearchParams Iterator" + } + }); + utils.define(ctorRegistry["URLSearchParams Iterator"], { + next() { + const internal = this && this[utils.iterInternalSymbol]; + if (!internal) { + throw new globalObject.TypeError("next() called on a value that is not a URLSearchParams iterator object"); + } + const { target, kind, index } = internal; + const values = Array.from(target[implSymbol]); + const len = values.length; + if (index >= len) { + return newObjectInRealm(globalObject, { value: void 0, done: true }); + } + const pair = values[index]; + internal.index = index + 1; + return newObjectInRealm(globalObject, utils.iteratorResult(pair.map(utils.tryWrapperForImpl), kind)); + } + }); + Object.defineProperty(globalObject, interfaceName, { + configurable: true, + writable: true, + value: URLSearchParams2 + }); + }; + var Impl = require_URLSearchParams_impl(); + } +}); + +// node_modules/whatwg-url/lib/URL-impl.js +var require_URL_impl = __commonJS({ + "node_modules/whatwg-url/lib/URL-impl.js"(exports2) { + "use strict"; + var usm = require_url_state_machine(); + var urlencoded = require_urlencoded2(); + var URLSearchParams2 = require_URLSearchParams(); + exports2.implementation = class URLImpl { + // Unlike the spec, we duplicate some code between the constructor and canParse, because we want to give useful error + // messages in the constructor that distinguish between the different causes of failure. + constructor(globalObject, [url, base]) { + let parsedBase = null; + if (base !== void 0) { + parsedBase = usm.basicURLParse(base); + if (parsedBase === null) { + throw new TypeError(`Invalid base URL: ${base}`); + } + } + const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); + if (parsedURL === null) { + throw new TypeError(`Invalid URL: ${url}`); + } + const query = parsedURL.query !== null ? parsedURL.query : ""; + this._url = parsedURL; + this._query = URLSearchParams2.createImpl(globalObject, [query], { doNotStripQMark: true }); + this._query._url = this; + } + static parse(globalObject, input, base) { + try { + return new URLImpl(globalObject, [input, base]); + } catch { + return null; + } + } + static canParse(url, base) { + let parsedBase = null; + if (base !== void 0) { + parsedBase = usm.basicURLParse(base); + if (parsedBase === null) { + return false; + } + } + const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); + if (parsedURL === null) { + return false; + } + return true; + } + get href() { + return usm.serializeURL(this._url); + } + set href(v4) { + const parsedURL = usm.basicURLParse(v4); + if (parsedURL === null) { + throw new TypeError(`Invalid URL: ${v4}`); + } + this._url = parsedURL; + this._query._list.splice(0); + const { query } = parsedURL; + if (query !== null) { + this._query._list = urlencoded.parseUrlencodedString(query); + } + } + get origin() { + return usm.serializeURLOrigin(this._url); + } + get protocol() { + return `${this._url.scheme}:`; + } + set protocol(v4) { + usm.basicURLParse(`${v4}:`, { url: this._url, stateOverride: "scheme start" }); + } + get username() { + return this._url.username; + } + set username(v4) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + usm.setTheUsername(this._url, v4); + } + get password() { + return this._url.password; + } + set password(v4) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + usm.setThePassword(this._url, v4); + } + get host() { + const url = this._url; + if (url.host === null) { + return ""; + } + if (url.port === null) { + return usm.serializeHost(url.host); + } + return `${usm.serializeHost(url.host)}:${usm.serializeInteger(url.port)}`; + } + set host(v4) { + if (usm.hasAnOpaquePath(this._url)) { + return; + } + usm.basicURLParse(v4, { url: this._url, stateOverride: "host" }); + } + get hostname() { + if (this._url.host === null) { + return ""; + } + return usm.serializeHost(this._url.host); + } + set hostname(v4) { + if (usm.hasAnOpaquePath(this._url)) { + return; + } + usm.basicURLParse(v4, { url: this._url, stateOverride: "hostname" }); + } + get port() { + if (this._url.port === null) { + return ""; + } + return usm.serializeInteger(this._url.port); + } + set port(v4) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + if (v4 === "") { + this._url.port = null; + } else { + usm.basicURLParse(v4, { url: this._url, stateOverride: "port" }); + } + } + get pathname() { + return usm.serializePath(this._url); + } + set pathname(v4) { + if (usm.hasAnOpaquePath(this._url)) { + return; + } + this._url.path = []; + usm.basicURLParse(v4, { url: this._url, stateOverride: "path start" }); + } + get search() { + if (this._url.query === null || this._url.query === "") { + return ""; + } + return `?${this._url.query}`; + } + set search(v4) { + const url = this._url; + if (v4 === "") { + url.query = null; + this._query._list = []; + return; + } + const input = v4[0] === "?" ? v4.substring(1) : v4; + url.query = ""; + usm.basicURLParse(input, { url, stateOverride: "query" }); + this._query._list = urlencoded.parseUrlencodedString(input); + } + get searchParams() { + return this._query; + } + get hash() { + if (this._url.fragment === null || this._url.fragment === "") { + return ""; + } + return `#${this._url.fragment}`; + } + set hash(v4) { + if (v4 === "") { + this._url.fragment = null; + return; + } + const input = v4[0] === "#" ? v4.substring(1) : v4; + this._url.fragment = ""; + usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); + } + toJSON() { + return this.href; + } + }; + } +}); + +// node_modules/whatwg-url/lib/URL.js +var require_URL = __commonJS({ + "node_modules/whatwg-url/lib/URL.js"(exports2) { + "use strict"; + var conversions = require_lib4(); + var utils = require_utils5(); + var implSymbol = utils.implSymbol; + var ctorRegistrySymbol = utils.ctorRegistrySymbol; + var interfaceName = "URL"; + exports2.is = (value) => { + return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + }; + exports2.isImpl = (value) => { + return utils.isObject(value) && value instanceof Impl.implementation; + }; + exports2.convert = (globalObject, value, { context = "The provided value" } = {}) => { + if (exports2.is(value)) { + return utils.implForWrapper(value); + } + throw new globalObject.TypeError(`${context} is not of type 'URL'.`); + }; + function makeWrapper(globalObject, newTarget) { + let proto; + if (newTarget !== void 0) { + proto = newTarget.prototype; + } + if (!utils.isObject(proto)) { + proto = globalObject[ctorRegistrySymbol]["URL"].prototype; + } + return Object.create(proto); + } + exports2.create = (globalObject, constructorArgs, privateData) => { + const wrapper = makeWrapper(globalObject); + return exports2.setup(wrapper, globalObject, constructorArgs, privateData); + }; + exports2.createImpl = (globalObject, constructorArgs, privateData) => { + const wrapper = exports2.create(globalObject, constructorArgs, privateData); + return utils.implForWrapper(wrapper); + }; + exports2._internalSetup = (wrapper, globalObject) => { + }; + exports2.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { + privateData.wrapper = wrapper; + exports2._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: new Impl.implementation(globalObject, constructorArgs, privateData), + configurable: true + }); + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper; + }; + exports2.new = (globalObject, newTarget) => { + const wrapper = makeWrapper(globalObject, newTarget); + exports2._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: Object.create(Impl.implementation.prototype), + configurable: true + }); + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper[implSymbol]; + }; + var exposed = /* @__PURE__ */ new Set(["Window", "Worker"]); + exports2.install = (globalObject, globalNames) => { + if (!globalNames.some((globalName) => exposed.has(globalName))) { + return; + } + const ctorRegistry = utils.initCtorRegistry(globalObject); + class URL2 { + constructor(url) { + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.` + ); + } + const args2 = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to construct 'URL': parameter 1", + globals: globalObject + }); + args2.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== void 0) { + curArg = conversions["USVString"](curArg, { + context: "Failed to construct 'URL': parameter 2", + globals: globalObject + }); + } + args2.push(curArg); + } + return exports2.setup(Object.create(new.target.prototype), globalObject, args2); + } + toJSON() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'toJSON' called on an object that is not a valid instance of URL."); + } + return esValue[implSymbol].toJSON(); + } + get href() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'get href' called on an object that is not a valid instance of URL."); + } + return esValue[implSymbol]["href"]; + } + set href(V) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'set href' called on an object that is not a valid instance of URL."); + } + V = conversions["USVString"](V, { + context: "Failed to set the 'href' property on 'URL': The provided value", + globals: globalObject + }); + esValue[implSymbol]["href"] = V; + } + toString() { + const esValue = this; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'toString' called on an object that is not a valid instance of URL."); + } + return esValue[implSymbol]["href"]; + } + get origin() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'get origin' called on an object that is not a valid instance of URL."); + } + return esValue[implSymbol]["origin"]; + } + get protocol() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'get protocol' called on an object that is not a valid instance of URL."); + } + return esValue[implSymbol]["protocol"]; + } + set protocol(V) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'set protocol' called on an object that is not a valid instance of URL."); + } + V = conversions["USVString"](V, { + context: "Failed to set the 'protocol' property on 'URL': The provided value", + globals: globalObject + }); + esValue[implSymbol]["protocol"] = V; + } + get username() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'get username' called on an object that is not a valid instance of URL."); + } + return esValue[implSymbol]["username"]; + } + set username(V) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'set username' called on an object that is not a valid instance of URL."); + } + V = conversions["USVString"](V, { + context: "Failed to set the 'username' property on 'URL': The provided value", + globals: globalObject + }); + esValue[implSymbol]["username"] = V; + } + get password() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'get password' called on an object that is not a valid instance of URL."); + } + return esValue[implSymbol]["password"]; + } + set password(V) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'set password' called on an object that is not a valid instance of URL."); + } + V = conversions["USVString"](V, { + context: "Failed to set the 'password' property on 'URL': The provided value", + globals: globalObject + }); + esValue[implSymbol]["password"] = V; + } + get host() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'get host' called on an object that is not a valid instance of URL."); + } + return esValue[implSymbol]["host"]; + } + set host(V) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'set host' called on an object that is not a valid instance of URL."); + } + V = conversions["USVString"](V, { + context: "Failed to set the 'host' property on 'URL': The provided value", + globals: globalObject + }); + esValue[implSymbol]["host"] = V; + } + get hostname() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'get hostname' called on an object that is not a valid instance of URL."); + } + return esValue[implSymbol]["hostname"]; + } + set hostname(V) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'set hostname' called on an object that is not a valid instance of URL."); + } + V = conversions["USVString"](V, { + context: "Failed to set the 'hostname' property on 'URL': The provided value", + globals: globalObject + }); + esValue[implSymbol]["hostname"] = V; + } + get port() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'get port' called on an object that is not a valid instance of URL."); + } + return esValue[implSymbol]["port"]; + } + set port(V) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'set port' called on an object that is not a valid instance of URL."); + } + V = conversions["USVString"](V, { + context: "Failed to set the 'port' property on 'URL': The provided value", + globals: globalObject + }); + esValue[implSymbol]["port"] = V; + } + get pathname() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'get pathname' called on an object that is not a valid instance of URL."); + } + return esValue[implSymbol]["pathname"]; + } + set pathname(V) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'set pathname' called on an object that is not a valid instance of URL."); + } + V = conversions["USVString"](V, { + context: "Failed to set the 'pathname' property on 'URL': The provided value", + globals: globalObject + }); + esValue[implSymbol]["pathname"] = V; + } + get search() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'get search' called on an object that is not a valid instance of URL."); + } + return esValue[implSymbol]["search"]; + } + set search(V) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'set search' called on an object that is not a valid instance of URL."); + } + V = conversions["USVString"](V, { + context: "Failed to set the 'search' property on 'URL': The provided value", + globals: globalObject + }); + esValue[implSymbol]["search"] = V; + } + get searchParams() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'get searchParams' called on an object that is not a valid instance of URL."); + } + return utils.getSameObject(this, "searchParams", () => { + return utils.tryWrapperForImpl(esValue[implSymbol]["searchParams"]); + }); + } + get hash() { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'get hash' called on an object that is not a valid instance of URL."); + } + return esValue[implSymbol]["hash"]; + } + set hash(V) { + const esValue = this !== null && this !== void 0 ? this : globalObject; + if (!exports2.is(esValue)) { + throw new globalObject.TypeError("'set hash' called on an object that is not a valid instance of URL."); + } + V = conversions["USVString"](V, { + context: "Failed to set the 'hash' property on 'URL': The provided value", + globals: globalObject + }); + esValue[implSymbol]["hash"] = V; + } + static parse(url) { + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'parse' on 'URL': 1 argument required, but only ${arguments.length} present.` + ); + } + const args2 = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'parse' on 'URL': parameter 1", + globals: globalObject + }); + args2.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== void 0) { + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'parse' on 'URL': parameter 2", + globals: globalObject + }); + } + args2.push(curArg); + } + return utils.tryWrapperForImpl(Impl.implementation.parse(globalObject, ...args2)); + } + static canParse(url) { + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.` + ); + } + const args2 = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'canParse' on 'URL': parameter 1", + globals: globalObject + }); + args2.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== void 0) { + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'canParse' on 'URL': parameter 2", + globals: globalObject + }); + } + args2.push(curArg); + } + return Impl.implementation.canParse(...args2); + } + } + Object.defineProperties(URL2.prototype, { + toJSON: { enumerable: true }, + href: { enumerable: true }, + toString: { enumerable: true }, + origin: { enumerable: true }, + protocol: { enumerable: true }, + username: { enumerable: true }, + password: { enumerable: true }, + host: { enumerable: true }, + hostname: { enumerable: true }, + port: { enumerable: true }, + pathname: { enumerable: true }, + search: { enumerable: true }, + searchParams: { enumerable: true }, + hash: { enumerable: true }, + [Symbol.toStringTag]: { value: "URL", configurable: true } + }); + Object.defineProperties(URL2, { parse: { enumerable: true }, canParse: { enumerable: true } }); + ctorRegistry[interfaceName] = URL2; + Object.defineProperty(globalObject, interfaceName, { + configurable: true, + writable: true, + value: URL2 + }); + if (globalNames.includes("Window")) { + Object.defineProperty(globalObject, "webkitURL", { + configurable: true, + writable: true, + value: URL2 + }); + } + }; + var Impl = require_URL_impl(); + } +}); + +// node_modules/whatwg-url/webidl2js-wrapper.js +var require_webidl2js_wrapper = __commonJS({ + "node_modules/whatwg-url/webidl2js-wrapper.js"(exports2) { + "use strict"; + var URL2 = require_URL(); + var URLSearchParams2 = require_URLSearchParams(); + exports2.URL = URL2; + exports2.URLSearchParams = URLSearchParams2; + } +}); + +// node_modules/whatwg-url/index.js +var require_whatwg_url = __commonJS({ + "node_modules/whatwg-url/index.js"(exports2) { + "use strict"; + var { URL: URL2, URLSearchParams: URLSearchParams2 } = require_webidl2js_wrapper(); + var urlStateMachine = require_url_state_machine(); + var percentEncoding = require_percent_encoding(); + var sharedGlobalObject = { Array, Object, Promise, String, TypeError }; + URL2.install(sharedGlobalObject, ["Window"]); + URLSearchParams2.install(sharedGlobalObject, ["Window"]); + exports2.URL = sharedGlobalObject.URL; + exports2.URLSearchParams = sharedGlobalObject.URLSearchParams; + exports2.parseURL = urlStateMachine.parseURL; + exports2.basicURLParse = urlStateMachine.basicURLParse; + exports2.serializeURL = urlStateMachine.serializeURL; + exports2.serializePath = urlStateMachine.serializePath; + exports2.serializeHost = urlStateMachine.serializeHost; + exports2.serializeInteger = urlStateMachine.serializeInteger; + exports2.serializeURLOrigin = urlStateMachine.serializeURLOrigin; + exports2.setTheUsername = urlStateMachine.setTheUsername; + exports2.setThePassword = urlStateMachine.setThePassword; + exports2.cannotHaveAUsernamePasswordPort = urlStateMachine.cannotHaveAUsernamePasswordPort; + exports2.hasAnOpaquePath = urlStateMachine.hasAnOpaquePath; + exports2.percentDecodeString = percentEncoding.percentDecodeString; + exports2.percentDecodeBytes = percentEncoding.percentDecodeBytes; + } +}); + +// node_modules/mongodb-connection-string-url/lib/redact.js +var require_redact = __commonJS({ + "node_modules/mongodb-connection-string-url/lib/redact.js"(exports2) { + "use strict"; + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + var desc = Object.getOwnPropertyDescriptor(m4, k4); + if (!desc || ("get" in desc ? !m4.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m4[k4]; + } }; + } + Object.defineProperty(o4, k22, desc); + }) : (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + o4[k22] = m4[k4]; + })); + var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o4, v4) { + Object.defineProperty(o4, "default", { enumerable: true, value: v4 }); + }) : function(o4, v4) { + o4["default"] = v4; + }); + var __importStar2 = exports2 && exports2.__importStar || function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k4 in mod) if (k4 !== "default" && Object.prototype.hasOwnProperty.call(mod, k4)) __createBinding2(result, mod, k4); + } + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.redactConnectionString = exports2.redactValidConnectionString = void 0; + var index_1 = __importStar2(require_lib5()); + function redactValidConnectionString(inputUrl, options) { + var _a2, _b; + const url = inputUrl.clone(); + const replacementString = (_a2 = options === null || options === void 0 ? void 0 : options.replacementString) !== null && _a2 !== void 0 ? _a2 : "_credentials_"; + const redactUsernames = (_b = options === null || options === void 0 ? void 0 : options.redactUsernames) !== null && _b !== void 0 ? _b : true; + if ((url.username || url.password) && redactUsernames) { + url.username = replacementString; + url.password = ""; + } else if (url.password) { + url.password = replacementString; + } + if (url.searchParams.has("authMechanismProperties")) { + const props = new index_1.CommaAndColonSeparatedRecord(url.searchParams.get("authMechanismProperties")); + if (props.get("AWS_SESSION_TOKEN")) { + props.set("AWS_SESSION_TOKEN", replacementString); + url.searchParams.set("authMechanismProperties", props.toString()); + } + } + if (url.searchParams.has("tlsCertificateKeyFilePassword")) { + url.searchParams.set("tlsCertificateKeyFilePassword", replacementString); + } + if (url.searchParams.has("proxyUsername") && redactUsernames) { + url.searchParams.set("proxyUsername", replacementString); + } + if (url.searchParams.has("proxyPassword")) { + url.searchParams.set("proxyPassword", replacementString); + } + return url; + } + exports2.redactValidConnectionString = redactValidConnectionString; + function redactConnectionString(uri, options) { + var _a2, _b; + const replacementString = (_a2 = options === null || options === void 0 ? void 0 : options.replacementString) !== null && _a2 !== void 0 ? _a2 : ""; + const redactUsernames = (_b = options === null || options === void 0 ? void 0 : options.redactUsernames) !== null && _b !== void 0 ? _b : true; + let parsed; + try { + parsed = new index_1.default(uri); + } catch (_c4) { + } + if (parsed) { + options = { ...options, replacementString: "___credentials___" }; + return parsed.redact(options).toString().replace(/___credentials___/g, replacementString); + } + const R = replacementString; + const replacements = [ + (uri2) => uri2.replace(redactUsernames ? /(\/\/)(.*)(@)/g : /(\/\/[^@]*:)(.*)(@)/g, `$1${R}$3`), + (uri2) => uri2.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi, `$1${R}`), + (uri2) => uri2.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi, `$1${R}`), + (uri2) => redactUsernames ? uri2.replace(/(proxyUsername=)([^&]+)/gi, `$1${R}`) : uri2, + (uri2) => uri2.replace(/(proxyPassword=)([^&]+)/gi, `$1${R}`) + ]; + for (const replacer of replacements) { + uri = replacer(uri); + } + return uri; + } + exports2.redactConnectionString = redactConnectionString; + } +}); + +// node_modules/mongodb-connection-string-url/lib/index.js +var require_lib5 = __commonJS({ + "node_modules/mongodb-connection-string-url/lib/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.CommaAndColonSeparatedRecord = exports2.ConnectionString = exports2.redactConnectionString = void 0; + var whatwg_url_1 = require_whatwg_url(); + var redact_1 = require_redact(); + Object.defineProperty(exports2, "redactConnectionString", { enumerable: true, get: function() { + return redact_1.redactConnectionString; + } }); + var DUMMY_HOSTNAME = "__this_is_a_placeholder__"; + function connectionStringHasValidScheme(connectionString) { + return connectionString.startsWith("mongodb://") || connectionString.startsWith("mongodb+srv://"); + } + var HOSTS_REGEX = /^(?[^/]+):\/\/(?:(?[^:@]*)(?::(?[^@]*))?@)?(?(?!:)[^/?@]*)(?.*)/; + var CaseInsensitiveMap = class extends Map { + delete(name) { + return super.delete(this._normalizeKey(name)); + } + get(name) { + return super.get(this._normalizeKey(name)); + } + has(name) { + return super.has(this._normalizeKey(name)); + } + set(name, value) { + return super.set(this._normalizeKey(name), value); + } + _normalizeKey(name) { + name = `${name}`; + for (const key of this.keys()) { + if (key.toLowerCase() === name.toLowerCase()) { + name = key; + break; + } + } + return name; + } + }; + function caseInsenstiveURLSearchParams(Ctor) { + return class CaseInsenstiveURLSearchParams extends Ctor { + append(name, value) { + return super.append(this._normalizeKey(name), value); + } + delete(name) { + return super.delete(this._normalizeKey(name)); + } + get(name) { + return super.get(this._normalizeKey(name)); + } + getAll(name) { + return super.getAll(this._normalizeKey(name)); + } + has(name) { + return super.has(this._normalizeKey(name)); + } + set(name, value) { + return super.set(this._normalizeKey(name), value); + } + keys() { + return super.keys(); + } + values() { + return super.values(); + } + entries() { + return super.entries(); + } + [Symbol.iterator]() { + return super[Symbol.iterator](); + } + _normalizeKey(name) { + return CaseInsensitiveMap.prototype._normalizeKey.call(this, name); + } + }; + } + var URLWithoutHost = class extends whatwg_url_1.URL { + }; + var MongoParseError = class extends Error { + get name() { + return "MongoParseError"; + } + }; + var ConnectionString = class _ConnectionString extends URLWithoutHost { + constructor(uri, options = {}) { + var _a2; + const { looseValidation } = options; + if (!looseValidation && !connectionStringHasValidScheme(uri)) { + throw new MongoParseError('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"'); + } + const match = uri.match(HOSTS_REGEX); + if (!match) { + throw new MongoParseError(`Invalid connection string "${uri}"`); + } + const { protocol, username, password, hosts, rest } = (_a2 = match.groups) !== null && _a2 !== void 0 ? _a2 : {}; + if (!looseValidation) { + if (!protocol || !hosts) { + throw new MongoParseError(`Protocol and host list are required in "${uri}"`); + } + try { + decodeURIComponent(username !== null && username !== void 0 ? username : ""); + decodeURIComponent(password !== null && password !== void 0 ? password : ""); + } catch (err) { + throw new MongoParseError(err.message); + } + const illegalCharacters = /[:/?#[\]@]/gi; + if (username === null || username === void 0 ? void 0 : username.match(illegalCharacters)) { + throw new MongoParseError(`Username contains unescaped characters ${username}`); + } + if (!username || !password) { + const uriWithoutProtocol = uri.replace(`${protocol}://`, ""); + if (uriWithoutProtocol.startsWith("@") || uriWithoutProtocol.startsWith(":")) { + throw new MongoParseError("URI contained empty userinfo section"); + } + } + if (password === null || password === void 0 ? void 0 : password.match(illegalCharacters)) { + throw new MongoParseError("Password contains unescaped characters"); + } + } + let authString = ""; + if (typeof username === "string") + authString += username; + if (typeof password === "string") + authString += `:${password}`; + if (authString) + authString += "@"; + try { + super(`${protocol.toLowerCase()}://${authString}${DUMMY_HOSTNAME}${rest}`); + } catch (err) { + if (looseValidation) { + new _ConnectionString(uri, { + ...options, + looseValidation: false + }); + } + if (typeof err.message === "string") { + err.message = err.message.replace(DUMMY_HOSTNAME, hosts); + } + throw err; + } + this._hosts = hosts.split(","); + if (!looseValidation) { + if (this.isSRV && this.hosts.length !== 1) { + throw new MongoParseError("mongodb+srv URI cannot have multiple service names"); + } + if (this.isSRV && this.hosts.some((host) => host.includes(":"))) { + throw new MongoParseError("mongodb+srv URI cannot have port number"); + } + } + if (!this.pathname) { + this.pathname = "/"; + } + Object.setPrototypeOf(this.searchParams, caseInsenstiveURLSearchParams(this.searchParams.constructor).prototype); + } + get host() { + return DUMMY_HOSTNAME; + } + set host(_ignored) { + throw new Error("No single host for connection string"); + } + get hostname() { + return DUMMY_HOSTNAME; + } + set hostname(_ignored) { + throw new Error("No single host for connection string"); + } + get port() { + return ""; + } + set port(_ignored) { + throw new Error("No single host for connection string"); + } + get href() { + return this.toString(); + } + set href(_ignored) { + throw new Error("Cannot set href for connection strings"); + } + get isSRV() { + return this.protocol.includes("srv"); + } + get hosts() { + return this._hosts; + } + set hosts(list2) { + this._hosts = list2; + } + toString() { + return super.toString().replace(DUMMY_HOSTNAME, this.hosts.join(",")); + } + clone() { + return new _ConnectionString(this.toString(), { + looseValidation: true + }); + } + redact(options) { + return (0, redact_1.redactValidConnectionString)(this, options); + } + typedSearchParams() { + const sametype = false; + return this.searchParams; + } + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { + const { href, origin, protocol, username, password, hosts, pathname, search, searchParams, hash } = this; + return { href, origin, protocol, username, password, hosts, pathname, search, searchParams, hash }; + } + }; + exports2.ConnectionString = ConnectionString; + var CommaAndColonSeparatedRecord = class extends CaseInsensitiveMap { + constructor(from) { + super(); + for (const entry of (from !== null && from !== void 0 ? from : "").split(",")) { + if (!entry) + continue; + const colonIndex = entry.indexOf(":"); + if (colonIndex === -1) { + this.set(entry, ""); + } else { + this.set(entry.slice(0, colonIndex), entry.slice(colonIndex + 1)); + } + } + } + toString() { + return [...this].map((entry) => entry.join(":")).join(","); + } + }; + exports2.CommaAndColonSeparatedRecord = CommaAndColonSeparatedRecord; + exports2.default = ConnectionString; + } +}); + +// node_modules/mongodb/lib/cmap/commands.js +var require_commands = __commonJS({ + "node_modules/mongodb/lib/cmap/commands.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OpCompressedRequest = exports2.OpMsgResponse = exports2.OpMsgRequest = exports2.DocumentSequence = exports2.OpReply = exports2.OpQueryRequest = void 0; + var BSON = require_bson2(); + var error_1 = require_error(); + var compression_1 = require_compression(); + var constants_1 = require_constants(); + var _requestId = 0; + var OPTS_TAILABLE_CURSOR = 2; + var OPTS_SECONDARY = 4; + var OPTS_OPLOG_REPLAY = 8; + var OPTS_NO_CURSOR_TIMEOUT = 16; + var OPTS_AWAIT_DATA = 32; + var OPTS_EXHAUST = 64; + var OPTS_PARTIAL = 128; + var CURSOR_NOT_FOUND = 1; + var QUERY_FAILURE = 2; + var SHARD_CONFIG_STALE = 4; + var AWAIT_CAPABLE = 8; + var encodeUTF8Into = BSON.BSON.onDemand.ByteUtils.encodeUTF8Into; + var OpQueryRequest = class _OpQueryRequest { + constructor(databaseName, query, options) { + this.moreToCome = false; + const ns = `${databaseName}.$cmd`; + if (typeof databaseName !== "string") { + throw new error_1.MongoRuntimeError("Database name must be a string for a query"); + } + if (query == null) + throw new error_1.MongoRuntimeError("A query document must be specified for query"); + if (ns.indexOf("\0") !== -1) { + throw new error_1.MongoRuntimeError("Namespace cannot contain a null character"); + } + this.databaseName = databaseName; + this.query = query; + this.ns = ns; + this.numberToSkip = options.numberToSkip || 0; + this.numberToReturn = options.numberToReturn || 0; + this.returnFieldSelector = options.returnFieldSelector || void 0; + this.requestId = options.requestId ?? _OpQueryRequest.getRequestId(); + this.pre32Limit = options.pre32Limit; + this.serializeFunctions = typeof options.serializeFunctions === "boolean" ? options.serializeFunctions : false; + this.ignoreUndefined = typeof options.ignoreUndefined === "boolean" ? options.ignoreUndefined : false; + this.maxBsonSize = options.maxBsonSize || 1024 * 1024 * 16; + this.checkKeys = typeof options.checkKeys === "boolean" ? options.checkKeys : false; + this.batchSize = this.numberToReturn; + this.tailable = false; + this.secondaryOk = typeof options.secondaryOk === "boolean" ? options.secondaryOk : false; + this.oplogReplay = false; + this.noCursorTimeout = false; + this.awaitData = false; + this.exhaust = false; + this.partial = false; + } + /** Assign next request Id. */ + incRequestId() { + this.requestId = _requestId++; + } + /** Peek next request Id. */ + nextRequestId() { + return _requestId + 1; + } + /** Increment then return next request Id. */ + static getRequestId() { + return ++_requestId; + } + // Uses a single allocated buffer for the process, avoiding multiple memory allocations + toBin() { + const buffers = []; + let projection = null; + let flags = 0; + if (this.tailable) { + flags |= OPTS_TAILABLE_CURSOR; + } + if (this.secondaryOk) { + flags |= OPTS_SECONDARY; + } + if (this.oplogReplay) { + flags |= OPTS_OPLOG_REPLAY; + } + if (this.noCursorTimeout) { + flags |= OPTS_NO_CURSOR_TIMEOUT; + } + if (this.awaitData) { + flags |= OPTS_AWAIT_DATA; + } + if (this.exhaust) { + flags |= OPTS_EXHAUST; + } + if (this.partial) { + flags |= OPTS_PARTIAL; + } + if (this.batchSize !== this.numberToReturn) + this.numberToReturn = this.batchSize; + const header = Buffer.alloc( + 4 * 4 + // Header + 4 + // Flags + Buffer.byteLength(this.ns) + 1 + // namespace + 4 + // numberToSkip + 4 + // numberToReturn + ); + buffers.push(header); + const query = BSON.serialize(this.query, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + buffers.push(query); + if (this.returnFieldSelector && Object.keys(this.returnFieldSelector).length > 0) { + projection = BSON.serialize(this.returnFieldSelector, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + buffers.push(projection); + } + const totalLength = header.length + query.length + (projection ? projection.length : 0); + let index = 4; + header[3] = totalLength >> 24 & 255; + header[2] = totalLength >> 16 & 255; + header[1] = totalLength >> 8 & 255; + header[0] = totalLength & 255; + header[index + 3] = this.requestId >> 24 & 255; + header[index + 2] = this.requestId >> 16 & 255; + header[index + 1] = this.requestId >> 8 & 255; + header[index] = this.requestId & 255; + index = index + 4; + header[index + 3] = 0 >> 24 & 255; + header[index + 2] = 0 >> 16 & 255; + header[index + 1] = 0 >> 8 & 255; + header[index] = 0 & 255; + index = index + 4; + header[index + 3] = constants_1.OP_QUERY >> 24 & 255; + header[index + 2] = constants_1.OP_QUERY >> 16 & 255; + header[index + 1] = constants_1.OP_QUERY >> 8 & 255; + header[index] = constants_1.OP_QUERY & 255; + index = index + 4; + header[index + 3] = flags >> 24 & 255; + header[index + 2] = flags >> 16 & 255; + header[index + 1] = flags >> 8 & 255; + header[index] = flags & 255; + index = index + 4; + index = index + header.write(this.ns, index, "utf8") + 1; + header[index - 1] = 0; + header[index + 3] = this.numberToSkip >> 24 & 255; + header[index + 2] = this.numberToSkip >> 16 & 255; + header[index + 1] = this.numberToSkip >> 8 & 255; + header[index] = this.numberToSkip & 255; + index = index + 4; + header[index + 3] = this.numberToReturn >> 24 & 255; + header[index + 2] = this.numberToReturn >> 16 & 255; + header[index + 1] = this.numberToReturn >> 8 & 255; + header[index] = this.numberToReturn & 255; + index = index + 4; + return buffers; + } + }; + exports2.OpQueryRequest = OpQueryRequest; + var OpReply = class { + constructor(message2, msgHeader, msgBody, opts) { + this.index = 0; + this.sections = []; + this.moreToCome = false; + this.parsed = false; + this.raw = message2; + this.data = msgBody; + this.opts = opts ?? { + useBigInt64: false, + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false + }; + this.length = msgHeader.length; + this.requestId = msgHeader.requestId; + this.responseTo = msgHeader.responseTo; + this.opCode = msgHeader.opCode; + this.fromCompressed = msgHeader.fromCompressed; + this.useBigInt64 = typeof this.opts.useBigInt64 === "boolean" ? this.opts.useBigInt64 : false; + this.promoteLongs = typeof this.opts.promoteLongs === "boolean" ? this.opts.promoteLongs : true; + this.promoteValues = typeof this.opts.promoteValues === "boolean" ? this.opts.promoteValues : true; + this.promoteBuffers = typeof this.opts.promoteBuffers === "boolean" ? this.opts.promoteBuffers : false; + this.bsonRegExp = typeof this.opts.bsonRegExp === "boolean" ? this.opts.bsonRegExp : false; + } + isParsed() { + return this.parsed; + } + parse() { + if (this.parsed) + return this.sections[0]; + this.index = 20; + this.responseFlags = this.data.readInt32LE(0); + this.cursorId = new BSON.Long(this.data.readInt32LE(4), this.data.readInt32LE(8)); + this.startingFrom = this.data.readInt32LE(12); + this.numberReturned = this.data.readInt32LE(16); + if (this.numberReturned < 0 || this.numberReturned > 2 ** 32 - 1) { + throw new RangeError(`OP_REPLY numberReturned is an invalid array length ${this.numberReturned}`); + } + this.cursorNotFound = (this.responseFlags & CURSOR_NOT_FOUND) !== 0; + this.queryFailure = (this.responseFlags & QUERY_FAILURE) !== 0; + this.shardConfigStale = (this.responseFlags & SHARD_CONFIG_STALE) !== 0; + this.awaitCapable = (this.responseFlags & AWAIT_CAPABLE) !== 0; + for (let i4 = 0; i4 < this.numberReturned; i4++) { + const bsonSize = this.data[this.index] | this.data[this.index + 1] << 8 | this.data[this.index + 2] << 16 | this.data[this.index + 3] << 24; + const section = this.data.subarray(this.index, this.index + bsonSize); + this.sections.push(section); + this.index = this.index + bsonSize; + } + this.parsed = true; + return this.sections[0]; + } + }; + exports2.OpReply = OpReply; + var OPTS_CHECKSUM_PRESENT = 1; + var OPTS_MORE_TO_COME = 2; + var OPTS_EXHAUST_ALLOWED = 1 << 16; + var DocumentSequence = class { + /** + * Create a new document sequence for the provided field. + * @param field - The field it will replace. + */ + constructor(field, documents) { + this.field = field; + this.documents = []; + this.chunks = []; + this.serializedDocumentsLength = 0; + const buffer = Buffer.allocUnsafe(1 + 4 + this.field.length + 1); + buffer[0] = 1; + encodeUTF8Into(buffer, `${this.field}\0`, 5); + this.chunks.push(buffer); + this.header = buffer; + if (documents) { + for (const doc of documents) { + this.push(doc, BSON.serialize(doc)); + } + } + } + /** + * Push a document to the document sequence. Will serialize the document + * as well and return the current serialized length of all documents. + * @param document - The document to add. + * @param buffer - The serialized document in raw BSON. + * @returns The new total document sequence length. + */ + push(document2, buffer) { + this.serializedDocumentsLength += buffer.length; + this.documents.push(document2); + this.chunks.push(buffer); + this.header?.writeInt32LE(4 + this.field.length + 1 + this.serializedDocumentsLength, 1); + return this.serializedDocumentsLength + this.header.length; + } + /** + * Get the fully serialized bytes for the document sequence section. + * @returns The section bytes. + */ + toBin() { + return Buffer.concat(this.chunks); + } + }; + exports2.DocumentSequence = DocumentSequence; + var OpMsgRequest = class _OpMsgRequest { + constructor(databaseName, command, options) { + if (command == null) + throw new error_1.MongoInvalidArgumentError("Query document must be specified for query"); + this.databaseName = databaseName; + this.command = command; + this.command.$db = databaseName; + this.options = options ?? {}; + this.requestId = options.requestId ? options.requestId : _OpMsgRequest.getRequestId(); + this.serializeFunctions = typeof options.serializeFunctions === "boolean" ? options.serializeFunctions : false; + this.ignoreUndefined = typeof options.ignoreUndefined === "boolean" ? options.ignoreUndefined : false; + this.checkKeys = typeof options.checkKeys === "boolean" ? options.checkKeys : false; + this.maxBsonSize = options.maxBsonSize || 1024 * 1024 * 16; + this.checksumPresent = false; + this.moreToCome = options.moreToCome ?? command.writeConcern?.w === 0; + this.exhaustAllowed = typeof options.exhaustAllowed === "boolean" ? options.exhaustAllowed : false; + } + toBin() { + const buffers = []; + let flags = 0; + if (this.checksumPresent) { + flags |= OPTS_CHECKSUM_PRESENT; + } + if (this.moreToCome) { + flags |= OPTS_MORE_TO_COME; + } + if (this.exhaustAllowed) { + flags |= OPTS_EXHAUST_ALLOWED; + } + const header = Buffer.alloc( + 4 * 4 + // Header + 4 + // Flags + ); + buffers.push(header); + let totalLength = header.length; + const command = this.command; + totalLength += this.makeSections(buffers, command); + header.writeInt32LE(totalLength, 0); + header.writeInt32LE(this.requestId, 4); + header.writeInt32LE(0, 8); + header.writeInt32LE(constants_1.OP_MSG, 12); + header.writeUInt32LE(flags, 16); + return buffers; + } + /** + * Add the sections to the OP_MSG request's buffers and returns the length. + */ + makeSections(buffers, document2) { + const sequencesBuffer = this.extractDocumentSequences(document2); + const payloadTypeBuffer = Buffer.allocUnsafe(1); + payloadTypeBuffer[0] = 0; + const documentBuffer = this.serializeBson(document2); + buffers.push(payloadTypeBuffer); + buffers.push(documentBuffer); + buffers.push(sequencesBuffer); + return payloadTypeBuffer.length + documentBuffer.length + sequencesBuffer.length; + } + /** + * Extracts the document sequences from the command document and returns + * a buffer to be added as multiple sections after the initial type 0 + * section in the message. + */ + extractDocumentSequences(document2) { + const chunks = []; + for (const [key, value] of Object.entries(document2)) { + if (value instanceof DocumentSequence) { + chunks.push(value.toBin()); + delete document2[key]; + } + } + if (chunks.length > 0) { + return Buffer.concat(chunks); + } + return Buffer.alloc(0); + } + serializeBson(document2) { + return BSON.serialize(document2, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + } + static getRequestId() { + _requestId = _requestId + 1 & 2147483647; + return _requestId; + } + }; + exports2.OpMsgRequest = OpMsgRequest; + var OpMsgResponse = class { + constructor(message2, msgHeader, msgBody, opts) { + this.index = 0; + this.sections = []; + this.parsed = false; + this.raw = message2; + this.data = msgBody; + this.opts = opts ?? { + useBigInt64: false, + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false + }; + this.length = msgHeader.length; + this.requestId = msgHeader.requestId; + this.responseTo = msgHeader.responseTo; + this.opCode = msgHeader.opCode; + this.fromCompressed = msgHeader.fromCompressed; + this.responseFlags = msgBody.readInt32LE(0); + this.checksumPresent = (this.responseFlags & OPTS_CHECKSUM_PRESENT) !== 0; + this.moreToCome = (this.responseFlags & OPTS_MORE_TO_COME) !== 0; + this.exhaustAllowed = (this.responseFlags & OPTS_EXHAUST_ALLOWED) !== 0; + this.useBigInt64 = typeof this.opts.useBigInt64 === "boolean" ? this.opts.useBigInt64 : false; + this.promoteLongs = typeof this.opts.promoteLongs === "boolean" ? this.opts.promoteLongs : true; + this.promoteValues = typeof this.opts.promoteValues === "boolean" ? this.opts.promoteValues : true; + this.promoteBuffers = typeof this.opts.promoteBuffers === "boolean" ? this.opts.promoteBuffers : false; + this.bsonRegExp = typeof this.opts.bsonRegExp === "boolean" ? this.opts.bsonRegExp : false; + } + isParsed() { + return this.parsed; + } + parse() { + if (this.parsed) + return this.sections[0]; + this.index = 4; + while (this.index < this.data.length) { + const payloadType = this.data.readUInt8(this.index++); + if (payloadType === 0) { + const bsonSize = this.data.readUInt32LE(this.index); + const bin = this.data.subarray(this.index, this.index + bsonSize); + this.sections.push(bin); + this.index += bsonSize; + } else if (payloadType === 1) { + throw new error_1.MongoRuntimeError("OP_MSG Payload Type 1 detected unsupported protocol"); + } + } + this.parsed = true; + return this.sections[0]; + } + }; + exports2.OpMsgResponse = OpMsgResponse; + var MESSAGE_HEADER_SIZE = 16; + var COMPRESSION_DETAILS_SIZE = 9; + var OpCompressedRequest = class { + constructor(command, options) { + this.command = command; + this.options = { + zlibCompressionLevel: options.zlibCompressionLevel, + agreedCompressor: options.agreedCompressor + }; + } + // Return whether a command contains an uncompressible command term + // Will return true if command contains no uncompressible command terms + static canCompress(command) { + const commandDoc = command instanceof OpMsgRequest ? command.command : command.query; + const commandName = Object.keys(commandDoc)[0]; + return !compression_1.uncompressibleCommands.has(commandName); + } + async toBin() { + const concatenatedOriginalCommandBuffer = Buffer.concat(this.command.toBin()); + const messageToBeCompressed = concatenatedOriginalCommandBuffer.slice(MESSAGE_HEADER_SIZE); + const originalCommandOpCode = concatenatedOriginalCommandBuffer.readInt32LE(12); + const compressedMessage = await (0, compression_1.compress)(this.options, messageToBeCompressed); + const msgHeader = Buffer.alloc(MESSAGE_HEADER_SIZE); + msgHeader.writeInt32LE(MESSAGE_HEADER_SIZE + COMPRESSION_DETAILS_SIZE + compressedMessage.length, 0); + msgHeader.writeInt32LE(this.command.requestId, 4); + msgHeader.writeInt32LE(0, 8); + msgHeader.writeInt32LE(constants_1.OP_COMPRESSED, 12); + const compressionDetails = Buffer.alloc(COMPRESSION_DETAILS_SIZE); + compressionDetails.writeInt32LE(originalCommandOpCode, 0); + compressionDetails.writeInt32LE(messageToBeCompressed.length, 4); + compressionDetails.writeUInt8(compression_1.Compressor[this.options.agreedCompressor], 8); + return [msgHeader, compressionDetails, compressedMessage]; + } + }; + exports2.OpCompressedRequest = OpCompressedRequest; + } +}); + +// node_modules/mongodb/lib/cmap/wire_protocol/compression.js +var require_compression = __commonJS({ + "node_modules/mongodb/lib/cmap/wire_protocol/compression.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.uncompressibleCommands = exports2.Compressor = void 0; + exports2.compress = compress; + exports2.decompress = decompress; + exports2.compressCommand = compressCommand; + exports2.decompressResponse = decompressResponse; + var util_1 = require("util"); + var zlib = require("zlib"); + var constants_1 = require_constants2(); + var deps_1 = require_deps(); + var error_1 = require_error(); + var commands_1 = require_commands(); + var constants_2 = require_constants(); + exports2.Compressor = Object.freeze({ + none: 0, + snappy: 1, + zlib: 2, + zstd: 3 + }); + exports2.uncompressibleCommands = /* @__PURE__ */ new Set([ + constants_1.LEGACY_HELLO_COMMAND, + "saslStart", + "saslContinue", + "getnonce", + "authenticate", + "createUser", + "updateUser", + "copydbSaslStart", + "copydbgetnonce", + "copydb" + ]); + var ZSTD_COMPRESSION_LEVEL = 3; + var zlibInflate = (0, util_1.promisify)(zlib.inflate.bind(zlib)); + var zlibDeflate = (0, util_1.promisify)(zlib.deflate.bind(zlib)); + var zstd; + var Snappy = null; + function loadSnappy() { + if (Snappy == null) { + const snappyImport = (0, deps_1.getSnappy)(); + if ("kModuleError" in snappyImport) { + throw snappyImport.kModuleError; + } + Snappy = snappyImport; + } + return Snappy; + } + async function compress(options, dataToBeCompressed) { + const zlibOptions = {}; + switch (options.agreedCompressor) { + case "snappy": { + Snappy ??= loadSnappy(); + return await Snappy.compress(dataToBeCompressed); + } + case "zstd": { + loadZstd(); + if ("kModuleError" in zstd) { + throw zstd["kModuleError"]; + } + return await zstd.compress(dataToBeCompressed, ZSTD_COMPRESSION_LEVEL); + } + case "zlib": { + if (options.zlibCompressionLevel) { + zlibOptions.level = options.zlibCompressionLevel; + } + return await zlibDeflate(dataToBeCompressed, zlibOptions); + } + default: { + throw new error_1.MongoInvalidArgumentError(`Unknown compressor ${options.agreedCompressor} failed to compress`); + } + } + } + async function decompress(compressorID, compressedData) { + if (compressorID !== exports2.Compressor.snappy && compressorID !== exports2.Compressor.zstd && compressorID !== exports2.Compressor.zlib && compressorID !== exports2.Compressor.none) { + throw new error_1.MongoDecompressionError(`Server sent message compressed using an unsupported compressor. (Received compressor ID ${compressorID})`); + } + switch (compressorID) { + case exports2.Compressor.snappy: { + Snappy ??= loadSnappy(); + return await Snappy.uncompress(compressedData, { asBuffer: true }); + } + case exports2.Compressor.zstd: { + loadZstd(); + if ("kModuleError" in zstd) { + throw zstd["kModuleError"]; + } + return await zstd.decompress(compressedData); + } + case exports2.Compressor.zlib: { + return await zlibInflate(compressedData); + } + default: { + return compressedData; + } + } + } + function loadZstd() { + if (!zstd) { + zstd = (0, deps_1.getZstdLibrary)(); + } + } + var MESSAGE_HEADER_SIZE = 16; + async function compressCommand(command, description) { + const finalCommand = description.agreedCompressor === "none" || !commands_1.OpCompressedRequest.canCompress(command) ? command : new commands_1.OpCompressedRequest(command, { + agreedCompressor: description.agreedCompressor ?? "none", + zlibCompressionLevel: description.zlibCompressionLevel ?? 0 + }); + const data2 = await finalCommand.toBin(); + return Buffer.concat(data2); + } + async function decompressResponse(message2) { + const messageHeader = { + length: message2.readInt32LE(0), + requestId: message2.readInt32LE(4), + responseTo: message2.readInt32LE(8), + opCode: message2.readInt32LE(12) + }; + if (messageHeader.opCode !== constants_2.OP_COMPRESSED) { + const ResponseType2 = messageHeader.opCode === constants_2.OP_MSG ? commands_1.OpMsgResponse : commands_1.OpReply; + const messageBody2 = message2.subarray(MESSAGE_HEADER_SIZE); + return new ResponseType2(message2, messageHeader, messageBody2); + } + const header = { + ...messageHeader, + fromCompressed: true, + opCode: message2.readInt32LE(MESSAGE_HEADER_SIZE), + length: message2.readInt32LE(MESSAGE_HEADER_SIZE + 4) + }; + const compressorID = message2[MESSAGE_HEADER_SIZE + 8]; + const compressedBuffer = message2.slice(MESSAGE_HEADER_SIZE + 9); + const ResponseType = header.opCode === constants_2.OP_MSG ? commands_1.OpMsgResponse : commands_1.OpReply; + const messageBody = await decompress(compressorID, compressedBuffer); + if (messageBody.length !== header.length) { + throw new error_1.MongoDecompressionError("Message body and message header must be the same length"); + } + return new ResponseType(message2, header, messageBody); + } + } +}); + +// node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.js +var require_crypto_callbacks = __commonJS({ + "node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hmacSha256Hook = exports2.hmacSha512Hook = exports2.aes256CtrDecryptHook = exports2.aes256CtrEncryptHook = exports2.aes256CbcDecryptHook = exports2.aes256CbcEncryptHook = void 0; + exports2.makeAES256Hook = makeAES256Hook; + exports2.randomHook = randomHook; + exports2.sha256Hook = sha256Hook; + exports2.makeHmacHook = makeHmacHook; + exports2.signRsaSha256Hook = signRsaSha256Hook; + var crypto2 = require("crypto"); + function makeAES256Hook(method, mode) { + return function(key, iv, input, output) { + let result; + try { + const cipher = crypto2[method](mode, key, iv); + cipher.setAutoPadding(false); + result = cipher.update(input); + const final = cipher.final(); + if (final.length > 0) { + result = Buffer.concat([result, final]); + } + } catch (e4) { + return e4; + } + result.copy(output); + return result.length; + }; + } + function randomHook(buffer, count) { + try { + crypto2.randomFillSync(buffer, 0, count); + } catch (e4) { + return e4; + } + return count; + } + function sha256Hook(input, output) { + let result; + try { + result = crypto2.createHash("sha256").update(input).digest(); + } catch (e4) { + return e4; + } + result.copy(output); + return result.length; + } + function makeHmacHook(algorithm) { + return (key, input, output) => { + let result; + try { + result = crypto2.createHmac(algorithm, key).update(input).digest(); + } catch (e4) { + return e4; + } + result.copy(output); + return result.length; + }; + } + function signRsaSha256Hook(key, input, output) { + let result; + try { + const signer = crypto2.createSign("sha256WithRSAEncryption"); + const privateKey = Buffer.from(`-----BEGIN PRIVATE KEY----- +${key.toString("base64")} +-----END PRIVATE KEY----- +`); + result = signer.update(input).end().sign(privateKey); + } catch (e4) { + return e4; + } + result.copy(output); + return result.length; + } + exports2.aes256CbcEncryptHook = makeAES256Hook("createCipheriv", "aes-256-cbc"); + exports2.aes256CbcDecryptHook = makeAES256Hook("createDecipheriv", "aes-256-cbc"); + exports2.aes256CtrEncryptHook = makeAES256Hook("createCipheriv", "aes-256-ctr"); + exports2.aes256CtrDecryptHook = makeAES256Hook("createDecipheriv", "aes-256-ctr"); + exports2.hmacSha512Hook = makeHmacHook("sha512"); + exports2.hmacSha256Hook = makeHmacHook("sha256"); + } +}); + +// node_modules/mongodb/lib/client-side-encryption/errors.js +var require_errors = __commonJS({ + "node_modules/mongodb/lib/client-side-encryption/errors.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MongoCryptKMSRequestNetworkTimeoutError = exports2.MongoCryptAzureKMSRequestError = exports2.MongoCryptCreateEncryptedCollectionError = exports2.MongoCryptCreateDataKeyError = exports2.MongoCryptInvalidArgumentError = exports2.MongoCryptError = void 0; + var error_1 = require_error(); + var MongoCryptError = class extends error_1.MongoError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, options = {}) { + super(message2, options); + } + get name() { + return "MongoCryptError"; + } + }; + exports2.MongoCryptError = MongoCryptError; + var MongoCryptInvalidArgumentError = class extends MongoCryptError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2) { + super(message2); + } + get name() { + return "MongoCryptInvalidArgumentError"; + } + }; + exports2.MongoCryptInvalidArgumentError = MongoCryptInvalidArgumentError; + var MongoCryptCreateDataKeyError = class extends MongoCryptError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(encryptedFields, { cause }) { + super(`Unable to complete creating data keys: ${cause.message}`, { cause }); + this.encryptedFields = encryptedFields; + } + get name() { + return "MongoCryptCreateDataKeyError"; + } + }; + exports2.MongoCryptCreateDataKeyError = MongoCryptCreateDataKeyError; + var MongoCryptCreateEncryptedCollectionError = class extends MongoCryptError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(encryptedFields, { cause }) { + super(`Unable to create collection: ${cause.message}`, { cause }); + this.encryptedFields = encryptedFields; + } + get name() { + return "MongoCryptCreateEncryptedCollectionError"; + } + }; + exports2.MongoCryptCreateEncryptedCollectionError = MongoCryptCreateEncryptedCollectionError; + var MongoCryptAzureKMSRequestError = class extends MongoCryptError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, body) { + super(message2); + this.body = body; + } + get name() { + return "MongoCryptAzureKMSRequestError"; + } + }; + exports2.MongoCryptAzureKMSRequestError = MongoCryptAzureKMSRequestError; + var MongoCryptKMSRequestNetworkTimeoutError = class extends MongoCryptError { + get name() { + return "MongoCryptKMSRequestNetworkTimeoutError"; + } + }; + exports2.MongoCryptKMSRequestNetworkTimeoutError = MongoCryptKMSRequestNetworkTimeoutError; + } +}); + +// node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.js +var require_aws_temporary_credentials = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.LegacyAWSTemporaryCredentialProvider = exports2.AWSSDKCredentialProvider = exports2.AWSTemporaryCredentialProvider = void 0; + var deps_1 = require_deps(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var AWS_RELATIVE_URI = "http://169.254.170.2"; + var AWS_EC2_URI = "http://169.254.169.254"; + var AWS_EC2_PATH = "/latest/meta-data/iam/security-credentials"; + var AWSTemporaryCredentialProvider = class _AWSTemporaryCredentialProvider { + static get awsSDK() { + _AWSTemporaryCredentialProvider._awsSDK ??= (0, deps_1.getAwsCredentialProvider)(); + return _AWSTemporaryCredentialProvider._awsSDK; + } + static get isAWSSDKInstalled() { + return !("kModuleError" in _AWSTemporaryCredentialProvider.awsSDK); + } + }; + exports2.AWSTemporaryCredentialProvider = AWSTemporaryCredentialProvider; + var AWSSDKCredentialProvider = class extends AWSTemporaryCredentialProvider { + /** + * Create the SDK credentials provider. + * @param credentialsProvider - The credentials provider. + */ + constructor(credentialsProvider) { + super(); + if (credentialsProvider) { + this._provider = credentialsProvider; + } + } + /** + * The AWS SDK caches credentials automatically and handles refresh when the credentials have expired. + * To ensure this occurs, we need to cache the `provider` returned by the AWS sdk and re-use it when fetching credentials. + */ + get provider() { + if ("kModuleError" in AWSTemporaryCredentialProvider.awsSDK) { + throw AWSTemporaryCredentialProvider.awsSDK.kModuleError; + } + if (this._provider) { + return this._provider; + } + let { AWS_STS_REGIONAL_ENDPOINTS = "", AWS_REGION = "" } = process.env; + AWS_STS_REGIONAL_ENDPOINTS = AWS_STS_REGIONAL_ENDPOINTS.toLowerCase(); + AWS_REGION = AWS_REGION.toLowerCase(); + const awsRegionSettingsExist = AWS_REGION.length !== 0 && AWS_STS_REGIONAL_ENDPOINTS.length !== 0; + const LEGACY_REGIONS = /* @__PURE__ */ new Set([ + "ap-northeast-1", + "ap-south-1", + "ap-southeast-1", + "ap-southeast-2", + "aws-global", + "ca-central-1", + "eu-central-1", + "eu-north-1", + "eu-west-1", + "eu-west-2", + "eu-west-3", + "sa-east-1", + "us-east-1", + "us-east-2", + "us-west-1", + "us-west-2" + ]); + const useRegionalSts = AWS_STS_REGIONAL_ENDPOINTS === "regional" || AWS_STS_REGIONAL_ENDPOINTS === "legacy" && !LEGACY_REGIONS.has(AWS_REGION); + this._provider = awsRegionSettingsExist && useRegionalSts ? AWSTemporaryCredentialProvider.awsSDK.fromNodeProviderChain({ + clientConfig: { region: AWS_REGION } + }) : AWSTemporaryCredentialProvider.awsSDK.fromNodeProviderChain(); + return this._provider; + } + async getCredentials() { + try { + const creds = await this.provider(); + return { + AccessKeyId: creds.accessKeyId, + SecretAccessKey: creds.secretAccessKey, + Token: creds.sessionToken, + Expiration: creds.expiration + }; + } catch (error2) { + throw new error_1.MongoAWSError(error2.message, { cause: error2 }); + } + } + }; + exports2.AWSSDKCredentialProvider = AWSSDKCredentialProvider; + var LegacyAWSTemporaryCredentialProvider = class extends AWSTemporaryCredentialProvider { + async getCredentials() { + if (process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI) { + return await (0, utils_1.request)(`${AWS_RELATIVE_URI}${process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI}`); + } + const token = await (0, utils_1.request)(`${AWS_EC2_URI}/latest/api/token`, { + method: "PUT", + json: false, + headers: { "X-aws-ec2-metadata-token-ttl-seconds": 30 } + }); + const roleName = await (0, utils_1.request)(`${AWS_EC2_URI}/${AWS_EC2_PATH}`, { + json: false, + headers: { "X-aws-ec2-metadata-token": token } + }); + const creds = await (0, utils_1.request)(`${AWS_EC2_URI}/${AWS_EC2_PATH}/${roleName}`, { + headers: { "X-aws-ec2-metadata-token": token } + }); + return creds; + } + }; + exports2.LegacyAWSTemporaryCredentialProvider = LegacyAWSTemporaryCredentialProvider; + } +}); + +// node_modules/mongodb/lib/client-side-encryption/providers/aws.js +var require_aws = __commonJS({ + "node_modules/mongodb/lib/client-side-encryption/providers/aws.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.loadAWSCredentials = loadAWSCredentials; + var aws_temporary_credentials_1 = require_aws_temporary_credentials(); + async function loadAWSCredentials(kmsProviders, provider) { + const credentialProvider = new aws_temporary_credentials_1.AWSSDKCredentialProvider(provider); + const { SecretAccessKey = "", AccessKeyId = "", Token } = await credentialProvider.getCredentials(); + const aws = { + secretAccessKey: SecretAccessKey, + accessKeyId: AccessKeyId + }; + Token != null && (aws.sessionToken = Token); + return { ...kmsProviders, aws }; + } + } +}); + +// node_modules/mongodb/lib/client-side-encryption/providers/azure.js +var require_azure = __commonJS({ + "node_modules/mongodb/lib/client-side-encryption/providers/azure.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.tokenCache = exports2.AzureCredentialCache = exports2.AZURE_BASE_URL = void 0; + exports2.addAzureParams = addAzureParams; + exports2.prepareRequest = prepareRequest; + exports2.fetchAzureKMSToken = fetchAzureKMSToken; + exports2.loadAzureCredentials = loadAzureCredentials; + var error_1 = require_error(); + var utils_1 = require_utils3(); + var errors_1 = require_errors(); + var MINIMUM_TOKEN_REFRESH_IN_MILLISECONDS = 6e3; + exports2.AZURE_BASE_URL = "http://169.254.169.254/metadata/identity/oauth2/token?"; + var AzureCredentialCache = class { + constructor() { + this.cachedToken = null; + } + async getToken() { + if (this.cachedToken == null || this.needsRefresh(this.cachedToken)) { + this.cachedToken = await this._getToken(); + } + return { accessToken: this.cachedToken.accessToken }; + } + needsRefresh(token) { + const timeUntilExpirationMS = token.expiresOnTimestamp - Date.now(); + return timeUntilExpirationMS <= MINIMUM_TOKEN_REFRESH_IN_MILLISECONDS; + } + /** + * exposed for testing + */ + resetCache() { + this.cachedToken = null; + } + /** + * exposed for testing + */ + _getToken() { + return fetchAzureKMSToken(); + } + }; + exports2.AzureCredentialCache = AzureCredentialCache; + exports2.tokenCache = new AzureCredentialCache(); + async function parseResponse(response) { + const { status, body: rawBody } = response; + const body = (() => { + try { + return JSON.parse(rawBody); + } catch { + throw new errors_1.MongoCryptAzureKMSRequestError("Malformed JSON body in GET request."); + } + })(); + if (status !== 200) { + throw new errors_1.MongoCryptAzureKMSRequestError("Unable to complete request.", body); + } + if (!body.access_token) { + throw new errors_1.MongoCryptAzureKMSRequestError("Malformed response body - missing field `access_token`."); + } + if (!body.expires_in) { + throw new errors_1.MongoCryptAzureKMSRequestError("Malformed response body - missing field `expires_in`."); + } + const expiresInMS = Number(body.expires_in) * 1e3; + if (Number.isNaN(expiresInMS)) { + throw new errors_1.MongoCryptAzureKMSRequestError("Malformed response body - unable to parse int from `expires_in` field."); + } + return { + accessToken: body.access_token, + expiresOnTimestamp: Date.now() + expiresInMS + }; + } + function addAzureParams(url, resource, username) { + url.searchParams.append("api-version", "2018-02-01"); + url.searchParams.append("resource", resource); + if (username) { + url.searchParams.append("client_id", username); + } + return url; + } + function prepareRequest(options) { + const url = new URL(options.url?.toString() ?? exports2.AZURE_BASE_URL); + addAzureParams(url, "https://vault.azure.net"); + const headers = { ...options.headers, "Content-Type": "application/json", Metadata: true }; + return { headers, url }; + } + async function fetchAzureKMSToken(options = {}) { + const { headers, url } = prepareRequest(options); + try { + const response = await (0, utils_1.get)(url, { headers }); + return await parseResponse(response); + } catch (error2) { + if (error2 instanceof error_1.MongoNetworkTimeoutError) { + throw new errors_1.MongoCryptAzureKMSRequestError(`[Azure KMS] ${error2.message}`); + } + throw error2; + } + } + async function loadAzureCredentials(kmsProviders) { + const azure = await exports2.tokenCache.getToken(); + return { ...kmsProviders, azure }; + } + } +}); + +// node_modules/mongodb/lib/client-side-encryption/providers/gcp.js +var require_gcp = __commonJS({ + "node_modules/mongodb/lib/client-side-encryption/providers/gcp.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.loadGCPCredentials = loadGCPCredentials; + var deps_1 = require_deps(); + async function loadGCPCredentials(kmsProviders) { + const gcpMetadata = (0, deps_1.getGcpMetadata)(); + if ("kModuleError" in gcpMetadata) { + return kmsProviders; + } + const { access_token: accessToken } = await gcpMetadata.instance({ + property: "service-accounts/default/token" + }); + return { ...kmsProviders, gcp: { accessToken } }; + } + } +}); + +// node_modules/mongodb/lib/client-side-encryption/providers/index.js +var require_providers2 = __commonJS({ + "node_modules/mongodb/lib/client-side-encryption/providers/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isEmptyCredentials = isEmptyCredentials; + exports2.refreshKMSCredentials = refreshKMSCredentials; + var aws_1 = require_aws(); + var azure_1 = require_azure(); + var gcp_1 = require_gcp(); + function isEmptyCredentials(providerName, kmsProviders) { + const provider = kmsProviders[providerName]; + if (provider == null) { + return false; + } + return typeof provider === "object" && Object.keys(provider).length === 0; + } + async function refreshKMSCredentials(kmsProviders, credentialProviders) { + let finalKMSProviders = kmsProviders; + if (isEmptyCredentials("aws", kmsProviders)) { + finalKMSProviders = await (0, aws_1.loadAWSCredentials)(finalKMSProviders, credentialProviders?.aws); + } + if (isEmptyCredentials("gcp", kmsProviders)) { + finalKMSProviders = await (0, gcp_1.loadGCPCredentials)(finalKMSProviders); + } + if (isEmptyCredentials("azure", kmsProviders)) { + finalKMSProviders = await (0, azure_1.loadAzureCredentials)(finalKMSProviders); + } + return finalKMSProviders; + } + } +}); + +// node_modules/mongodb/lib/client-side-encryption/state_machine.js +var require_state_machine = __commonJS({ + "node_modules/mongodb/lib/client-side-encryption/state_machine.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StateMachine = void 0; + var fs = require("fs/promises"); + var net = require("net"); + var tls = require("tls"); + var bson_1 = require_bson2(); + var abstract_cursor_1 = require_abstract_cursor(); + var deps_1 = require_deps(); + var error_1 = require_error(); + var timeout_1 = require_timeout(); + var utils_1 = require_utils3(); + var client_encryption_1 = require_client_encryption(); + var errors_1 = require_errors(); + var socks = null; + function loadSocks() { + if (socks == null) { + const socksImport = (0, deps_1.getSocks)(); + if ("kModuleError" in socksImport) { + throw socksImport.kModuleError; + } + socks = socksImport; + } + return socks; + } + var MONGOCRYPT_CTX_ERROR = 0; + var MONGOCRYPT_CTX_NEED_MONGO_COLLINFO = 1; + var MONGOCRYPT_CTX_NEED_MONGO_MARKINGS = 2; + var MONGOCRYPT_CTX_NEED_MONGO_KEYS = 3; + var MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS = 7; + var MONGOCRYPT_CTX_NEED_KMS = 4; + var MONGOCRYPT_CTX_READY = 5; + var MONGOCRYPT_CTX_DONE = 6; + var HTTPS_PORT = 443; + var stateToString = /* @__PURE__ */ new Map([ + [MONGOCRYPT_CTX_ERROR, "MONGOCRYPT_CTX_ERROR"], + [MONGOCRYPT_CTX_NEED_MONGO_COLLINFO, "MONGOCRYPT_CTX_NEED_MONGO_COLLINFO"], + [MONGOCRYPT_CTX_NEED_MONGO_MARKINGS, "MONGOCRYPT_CTX_NEED_MONGO_MARKINGS"], + [MONGOCRYPT_CTX_NEED_MONGO_KEYS, "MONGOCRYPT_CTX_NEED_MONGO_KEYS"], + [MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS, "MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS"], + [MONGOCRYPT_CTX_NEED_KMS, "MONGOCRYPT_CTX_NEED_KMS"], + [MONGOCRYPT_CTX_READY, "MONGOCRYPT_CTX_READY"], + [MONGOCRYPT_CTX_DONE, "MONGOCRYPT_CTX_DONE"] + ]); + var INSECURE_TLS_OPTIONS = [ + "tlsInsecure", + "tlsAllowInvalidCertificates", + "tlsAllowInvalidHostnames" + ]; + function debug(msg) { + if (process.env.MONGODB_CRYPT_DEBUG) { + console.error(msg); + } + } + var EMPTY_V; + var StateMachine = class { + constructor(options, bsonOptions = (0, bson_1.pluckBSONSerializeOptions)(options)) { + this.options = options; + this.bsonOptions = bsonOptions; + } + /** + * Executes the state machine according to the specification + */ + async execute(executor, context, options) { + const keyVaultNamespace = executor._keyVaultNamespace; + const keyVaultClient = executor._keyVaultClient; + const metaDataClient = executor._metaDataClient; + const mongocryptdClient = executor._mongocryptdClient; + const mongocryptdManager = executor._mongocryptdManager; + let result = null; + const getStatus = () => context.status; + const getState = () => context.state; + while (getState() !== MONGOCRYPT_CTX_DONE && getState() !== MONGOCRYPT_CTX_ERROR) { + options.signal?.throwIfAborted(); + debug(`[context#${context.id}] ${stateToString.get(getState()) || getState()}`); + switch (getState()) { + case MONGOCRYPT_CTX_NEED_MONGO_COLLINFO: { + const filter = (0, bson_1.deserialize)(context.nextMongoOperation()); + if (!metaDataClient) { + throw new errors_1.MongoCryptError("unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_COLLINFO but metadata client is undefined"); + } + const collInfoCursor = this.fetchCollectionInfo(metaDataClient, context.ns, filter, options); + for await (const collInfo of collInfoCursor) { + context.addMongoOperationResponse((0, bson_1.serialize)(collInfo)); + if (getState() === MONGOCRYPT_CTX_ERROR) + break; + } + if (getState() === MONGOCRYPT_CTX_ERROR) + break; + context.finishMongoOperation(); + break; + } + case MONGOCRYPT_CTX_NEED_MONGO_MARKINGS: { + const command = context.nextMongoOperation(); + if (getState() === MONGOCRYPT_CTX_ERROR) + break; + if (!mongocryptdClient) { + throw new errors_1.MongoCryptError("unreachable state machine state: entered MONGOCRYPT_CTX_NEED_MONGO_MARKINGS but mongocryptdClient is undefined"); + } + const markedCommand = mongocryptdManager ? await mongocryptdManager.withRespawn(this.markCommand.bind(this, mongocryptdClient, context.ns, command, options)) : await this.markCommand(mongocryptdClient, context.ns, command, options); + context.addMongoOperationResponse(markedCommand); + context.finishMongoOperation(); + break; + } + case MONGOCRYPT_CTX_NEED_MONGO_KEYS: { + const filter = context.nextMongoOperation(); + const keys = await this.fetchKeys(keyVaultClient, keyVaultNamespace, filter, options); + if (keys.length === 0) { + result = EMPTY_V ??= (0, bson_1.serialize)({ v: [] }); + } + for (const key of keys) { + context.addMongoOperationResponse((0, bson_1.serialize)(key)); + } + context.finishMongoOperation(); + break; + } + case MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS: { + const kmsProviders = await executor.askForKMSCredentials(); + context.provideKMSProviders((0, bson_1.serialize)(kmsProviders)); + break; + } + case MONGOCRYPT_CTX_NEED_KMS: { + await Promise.all(this.requests(context, options)); + context.finishKMSRequests(); + break; + } + case MONGOCRYPT_CTX_READY: { + const finalizedContext = context.finalize(); + if (getState() === MONGOCRYPT_CTX_ERROR) { + const message2 = getStatus().message || "Finalization error"; + throw new errors_1.MongoCryptError(message2); + } + result = finalizedContext; + break; + } + default: + throw new errors_1.MongoCryptError(`Unknown state: ${getState()}`); + } + } + if (getState() === MONGOCRYPT_CTX_ERROR || result == null) { + const message2 = getStatus().message; + if (!message2) { + debug(`unidentifiable error in MongoCrypt - received an error status from \`libmongocrypt\` but received no error message.`); + } + throw new errors_1.MongoCryptError(message2 ?? "unidentifiable error in MongoCrypt - received an error status from `libmongocrypt` but received no error message."); + } + return result; + } + /** + * Handles the request to the KMS service. Exposed for testing purposes. Do not directly invoke. + * @param kmsContext - A C++ KMS context returned from the bindings + * @returns A promise that resolves when the KMS reply has be fully parsed + */ + async kmsRequest(request, options) { + const parsedUrl = request.endpoint.split(":"); + const port = parsedUrl[1] != null ? Number.parseInt(parsedUrl[1], 10) : HTTPS_PORT; + const socketOptions = { + host: parsedUrl[0], + servername: parsedUrl[0], + port, + ...(0, client_encryption_1.autoSelectSocketOptions)(this.options.socketOptions || {}) + }; + const message2 = request.message; + const buffer = new utils_1.BufferPool(); + let netSocket; + let socket; + function destroySockets() { + for (const sock of [socket, netSocket]) { + if (sock) { + sock.destroy(); + } + } + } + function onerror(cause) { + return new errors_1.MongoCryptError("KMS request failed", { cause }); + } + function onclose() { + return new errors_1.MongoCryptError("KMS request closed"); + } + const tlsOptions = this.options.tlsOptions; + if (tlsOptions) { + const kmsProvider = request.kmsProvider; + const providerTlsOptions = tlsOptions[kmsProvider]; + if (providerTlsOptions) { + const error2 = this.validateTlsOptions(kmsProvider, providerTlsOptions); + if (error2) { + throw error2; + } + try { + await this.setTlsOptions(providerTlsOptions, socketOptions); + } catch (err) { + throw onerror(err); + } + } + } + let abortListener; + try { + if (this.options.proxyOptions && this.options.proxyOptions.proxyHost) { + netSocket = new net.Socket(); + const { promise: willConnect, reject: rejectOnNetSocketError, resolve: resolveOnNetSocketConnect } = (0, utils_1.promiseWithResolvers)(); + netSocket.once("error", (err) => rejectOnNetSocketError(onerror(err))).once("close", () => rejectOnNetSocketError(onclose())).once("connect", () => resolveOnNetSocketConnect()); + const netSocketOptions = { + ...socketOptions, + host: this.options.proxyOptions.proxyHost, + port: this.options.proxyOptions.proxyPort || 1080 + }; + netSocket.connect(netSocketOptions); + await willConnect; + try { + socks ??= loadSocks(); + socketOptions.socket = (await socks.SocksClient.createConnection({ + existing_socket: netSocket, + command: "connect", + destination: { host: socketOptions.host, port: socketOptions.port }, + proxy: { + // host and port are ignored because we pass existing_socket + host: "iLoveJavaScript", + port: 0, + type: 5, + userId: this.options.proxyOptions.proxyUsername, + password: this.options.proxyOptions.proxyPassword + } + })).socket; + } catch (err) { + throw onerror(err); + } + } + socket = tls.connect(socketOptions, () => { + socket.write(message2); + }); + const { promise: willResolveKmsRequest, reject: rejectOnTlsSocketError, resolve } = (0, utils_1.promiseWithResolvers)(); + abortListener = (0, utils_1.addAbortListener)(options?.signal, function() { + destroySockets(); + rejectOnTlsSocketError(this.reason); + }); + socket.once("error", (err) => rejectOnTlsSocketError(onerror(err))).once("close", () => rejectOnTlsSocketError(onclose())).on("data", (data2) => { + buffer.append(data2); + while (request.bytesNeeded > 0 && buffer.length) { + const bytesNeeded = Math.min(request.bytesNeeded, buffer.length); + request.addResponse(buffer.read(bytesNeeded)); + } + if (request.bytesNeeded <= 0) { + resolve(); + } + }); + await (options?.timeoutContext?.csotEnabled() ? Promise.all([ + willResolveKmsRequest, + timeout_1.Timeout.expires(options.timeoutContext?.remainingTimeMS) + ]) : willResolveKmsRequest); + } catch (error2) { + if (error2 instanceof timeout_1.TimeoutError) + throw new error_1.MongoOperationTimeoutError("KMS request timed out"); + throw error2; + } finally { + destroySockets(); + abortListener?.[utils_1.kDispose](); + } + } + *requests(context, options) { + for (let request = context.nextKMSRequest(); request != null; request = context.nextKMSRequest()) { + yield this.kmsRequest(request, options); + } + } + /** + * Validates the provided TLS options are secure. + * + * @param kmsProvider - The KMS provider name. + * @param tlsOptions - The client TLS options for the provider. + * + * @returns An error if any option is invalid. + */ + validateTlsOptions(kmsProvider, tlsOptions) { + const tlsOptionNames = Object.keys(tlsOptions); + for (const option of INSECURE_TLS_OPTIONS) { + if (tlsOptionNames.includes(option)) { + return new errors_1.MongoCryptError(`Insecure TLS options prohibited for ${kmsProvider}: ${option}`); + } + } + } + /** + * Sets only the valid secure TLS options. + * + * @param tlsOptions - The client TLS options for the provider. + * @param options - The existing connection options. + */ + async setTlsOptions(tlsOptions, options) { + if (tlsOptions.secureContext) { + options.secureContext = tlsOptions.secureContext; + } + if (tlsOptions.tlsCertificateKeyFile) { + const cert = await fs.readFile(tlsOptions.tlsCertificateKeyFile); + options.cert = options.key = cert; + } + if (tlsOptions.tlsCAFile) { + options.ca = await fs.readFile(tlsOptions.tlsCAFile); + } + if (tlsOptions.tlsCertificateKeyFilePassword) { + options.passphrase = tlsOptions.tlsCertificateKeyFilePassword; + } + } + /** + * Fetches collection info for a provided namespace, when libmongocrypt + * enters the `MONGOCRYPT_CTX_NEED_MONGO_COLLINFO` state. The result is + * used to inform libmongocrypt of the schema associated with this + * namespace. Exposed for testing purposes. Do not directly invoke. + * + * @param client - A MongoClient connected to the topology + * @param ns - The namespace to list collections from + * @param filter - A filter for the listCollections command + * @param callback - Invoked with the info of the requested collection, or with an error + */ + fetchCollectionInfo(client, ns, filter, options) { + const { db } = utils_1.MongoDBCollectionNamespace.fromString(ns); + const cursor2 = client.db(db).listCollections(filter, { + promoteLongs: false, + promoteValues: false, + timeoutContext: options?.timeoutContext && new abstract_cursor_1.CursorTimeoutContext(options?.timeoutContext, /* @__PURE__ */ Symbol()), + signal: options?.signal, + nameOnly: false + }); + return cursor2; + } + /** + * Calls to the mongocryptd to provide markings for a command. + * Exposed for testing purposes. Do not directly invoke. + * @param client - A MongoClient connected to a mongocryptd + * @param ns - The namespace (database.collection) the command is being executed on + * @param command - The command to execute. + * @param callback - Invoked with the serialized and marked bson command, or with an error + */ + async markCommand(client, ns, command, options) { + const { db } = utils_1.MongoDBCollectionNamespace.fromString(ns); + const bsonOptions = { promoteLongs: false, promoteValues: false }; + const rawCommand = (0, bson_1.deserialize)(command, bsonOptions); + const commandOptions = { + timeoutMS: void 0, + signal: void 0 + }; + if (options?.timeoutContext?.csotEnabled()) { + commandOptions.timeoutMS = options.timeoutContext.remainingTimeMS; + } + if (options?.signal) { + commandOptions.signal = options.signal; + } + const response = await client.db(db).command(rawCommand, { + ...bsonOptions, + ...commandOptions + }); + return (0, bson_1.serialize)(response, this.bsonOptions); + } + /** + * Requests keys from the keyVault collection on the topology. + * Exposed for testing purposes. Do not directly invoke. + * @param client - A MongoClient connected to the topology + * @param keyVaultNamespace - The namespace (database.collection) of the keyVault Collection + * @param filter - The filter for the find query against the keyVault Collection + * @param callback - Invoked with the found keys, or with an error + */ + fetchKeys(client, keyVaultNamespace, filter, options) { + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(keyVaultNamespace); + const commandOptions = { + timeoutContext: void 0, + signal: void 0 + }; + if (options?.timeoutContext != null) { + commandOptions.timeoutContext = new abstract_cursor_1.CursorTimeoutContext(options.timeoutContext, /* @__PURE__ */ Symbol()); + } + if (options?.signal != null) { + commandOptions.signal = options.signal; + } + return client.db(dbName).collection(collectionName, { readConcern: { level: "majority" } }).find((0, bson_1.deserialize)(filter), commandOptions).toArray(); + } + }; + exports2.StateMachine = StateMachine; + } +}); + +// node_modules/mongodb/lib/client-side-encryption/client_encryption.js +var require_client_encryption = __commonJS({ + "node_modules/mongodb/lib/client-side-encryption/client_encryption.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ClientEncryption = void 0; + exports2.autoSelectSocketOptions = autoSelectSocketOptions; + var bson_1 = require_bson2(); + var deps_1 = require_deps(); + var timeout_1 = require_timeout(); + var utils_1 = require_utils3(); + var cryptoCallbacks = require_crypto_callbacks(); + var errors_1 = require_errors(); + var index_1 = require_providers2(); + var state_machine_1 = require_state_machine(); + var ClientEncryption = class _ClientEncryption { + /** @internal */ + static getMongoCrypt() { + const encryption = (0, deps_1.getMongoDBClientEncryption)(); + if ("kModuleError" in encryption) { + throw encryption.kModuleError; + } + return encryption.MongoCrypt; + } + /** + * Create a new encryption instance + * + * @example + * ```ts + * new ClientEncryption(mongoClient, { + * keyVaultNamespace: 'client.encryption', + * kmsProviders: { + * local: { + * key: masterKey // The master key used for encryption/decryption. A 96-byte long Buffer + * } + * } + * }); + * ``` + * + * @example + * ```ts + * new ClientEncryption(mongoClient, { + * keyVaultNamespace: 'client.encryption', + * kmsProviders: { + * aws: { + * accessKeyId: AWS_ACCESS_KEY, + * secretAccessKey: AWS_SECRET_KEY + * } + * } + * }); + * ``` + */ + constructor(client, options) { + this._client = client; + this._proxyOptions = options.proxyOptions ?? {}; + this._tlsOptions = options.tlsOptions ?? {}; + this._kmsProviders = options.kmsProviders || {}; + const { timeoutMS } = (0, utils_1.resolveTimeoutOptions)(client, options); + this._timeoutMS = timeoutMS; + this._credentialProviders = options.credentialProviders; + if (options.credentialProviders?.aws && !(0, index_1.isEmptyCredentials)("aws", this._kmsProviders)) { + throw new errors_1.MongoCryptInvalidArgumentError("Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching"); + } + if (options.keyVaultNamespace == null) { + throw new errors_1.MongoCryptInvalidArgumentError("Missing required option `keyVaultNamespace`"); + } + const mongoCryptOptions = { + ...options, + cryptoCallbacks, + kmsProviders: !Buffer.isBuffer(this._kmsProviders) ? (0, bson_1.serialize)(this._kmsProviders) : this._kmsProviders + }; + this._keyVaultNamespace = options.keyVaultNamespace; + this._keyVaultClient = options.keyVaultClient || client; + const MongoCrypt = _ClientEncryption.getMongoCrypt(); + this._mongoCrypt = new MongoCrypt(mongoCryptOptions); + } + /** + * Creates a data key used for explicit encryption and inserts it into the key vault namespace + * + * @example + * ```ts + * // Using async/await to create a local key + * const dataKeyId = await clientEncryption.createDataKey('local'); + * ``` + * + * @example + * ```ts + * // Using async/await to create an aws key + * const dataKeyId = await clientEncryption.createDataKey('aws', { + * masterKey: { + * region: 'us-east-1', + * key: 'xxxxxxxxxxxxxx' // CMK ARN here + * } + * }); + * ``` + * + * @example + * ```ts + * // Using async/await to create an aws key with a keyAltName + * const dataKeyId = await clientEncryption.createDataKey('aws', { + * masterKey: { + * region: 'us-east-1', + * key: 'xxxxxxxxxxxxxx' // CMK ARN here + * }, + * keyAltNames: [ 'mySpecialKey' ] + * }); + * ``` + */ + async createDataKey(provider, options = {}) { + if (options.keyAltNames && !Array.isArray(options.keyAltNames)) { + throw new errors_1.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but was of type ${typeof options.keyAltNames}.`); + } + let keyAltNames = void 0; + if (options.keyAltNames && options.keyAltNames.length > 0) { + keyAltNames = options.keyAltNames.map((keyAltName, i4) => { + if (typeof keyAltName !== "string") { + throw new errors_1.MongoCryptInvalidArgumentError(`Option "keyAltNames" must be an array of strings, but item at index ${i4} was of type ${typeof keyAltName}`); + } + return (0, bson_1.serialize)({ keyAltName }); + }); + } + let keyMaterial = void 0; + if (options.keyMaterial) { + keyMaterial = (0, bson_1.serialize)({ keyMaterial: options.keyMaterial }); + } + const dataKeyBson = (0, bson_1.serialize)({ + provider, + ...options.masterKey + }); + const context = this._mongoCrypt.makeDataKeyContext(dataKeyBson, { + keyAltNames, + keyMaterial + }); + const stateMachine = new state_machine_1.StateMachine({ + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: autoSelectSocketOptions(this._client.s.options) + }); + const timeoutContext = options?.timeoutContext ?? timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS })); + const dataKey = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext })); + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + const { insertedId } = await this._keyVaultClient.db(dbName).collection(collectionName).insertOne(dataKey, { + writeConcern: { w: "majority" }, + timeoutMS: timeoutContext?.csotEnabled() ? timeoutContext?.getRemainingTimeMSOrThrow() : void 0 + }); + return insertedId; + } + /** + * Searches the keyvault for any data keys matching the provided filter. If there are matches, rewrapManyDataKey then attempts to re-wrap the data keys using the provided options. + * + * If no matches are found, then no bulk write is performed. + * + * @example + * ```ts + * // rewrapping all data data keys (using a filter that matches all documents) + * const filter = {}; + * + * const result = await clientEncryption.rewrapManyDataKey(filter); + * if (result.bulkWriteResult != null) { + * // keys were re-wrapped, results will be available in the bulkWrite object. + * } + * ``` + * + * @example + * ```ts + * // attempting to rewrap all data keys with no matches + * const filter = { _id: new Binary() } // assume _id matches no documents in the database + * const result = await clientEncryption.rewrapManyDataKey(filter); + * + * if (result.bulkWriteResult == null) { + * // no keys matched, `bulkWriteResult` does not exist on the result object + * } + * ``` + */ + async rewrapManyDataKey(filter, options) { + let keyEncryptionKeyBson = void 0; + if (options) { + const keyEncryptionKey = Object.assign({ provider: options.provider }, options.masterKey); + keyEncryptionKeyBson = (0, bson_1.serialize)(keyEncryptionKey); + } + const filterBson = (0, bson_1.serialize)(filter); + const context = this._mongoCrypt.makeRewrapManyDataKeyContext(filterBson, keyEncryptionKeyBson); + const stateMachine = new state_machine_1.StateMachine({ + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: autoSelectSocketOptions(this._client.s.options) + }); + const timeoutContext = timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS })); + const { v: dataKeys } = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext })); + if (dataKeys.length === 0) { + return {}; + } + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + const replacements = dataKeys.map((key) => ({ + updateOne: { + filter: { _id: key._id }, + update: { + $set: { + masterKey: key.masterKey, + keyMaterial: key.keyMaterial + }, + $currentDate: { + updateDate: true + } + } + } + })); + const result = await this._keyVaultClient.db(dbName).collection(collectionName).bulkWrite(replacements, { + writeConcern: { w: "majority" }, + timeoutMS: timeoutContext.csotEnabled() ? timeoutContext?.remainingTimeMS : void 0 + }); + return { bulkWriteResult: result }; + } + /** + * Deletes the key with the provided id from the keyvault, if it exists. + * + * @example + * ```ts + * // delete a key by _id + * const id = new Binary(); // id is a bson binary subtype 4 object + * const { deletedCount } = await clientEncryption.deleteKey(id); + * + * if (deletedCount != null && deletedCount > 0) { + * // successful deletion + * } + * ``` + * + */ + async deleteKey(_id) { + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + return await this._keyVaultClient.db(dbName).collection(collectionName).deleteOne({ _id }, { writeConcern: { w: "majority" }, timeoutMS: this._timeoutMS }); + } + /** + * Finds all the keys currently stored in the keyvault. + * + * This method will not throw. + * + * @returns a FindCursor over all keys in the keyvault. + * @example + * ```ts + * // fetching all keys + * const keys = await clientEncryption.getKeys().toArray(); + * ``` + */ + getKeys() { + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + return this._keyVaultClient.db(dbName).collection(collectionName).find({}, { readConcern: { level: "majority" }, timeoutMS: this._timeoutMS }); + } + /** + * Finds a key in the keyvault with the specified _id. + * + * Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the id. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // getting a key by id + * const id = new Binary(); // id is a bson binary subtype 4 object + * const key = await clientEncryption.getKey(id); + * if (!key) { + * // key is null if there was no matching key + * } + * ``` + */ + async getKey(_id) { + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + return await this._keyVaultClient.db(dbName).collection(collectionName).findOne({ _id }, { readConcern: { level: "majority" }, timeoutMS: this._timeoutMS }); + } + /** + * Finds a key in the keyvault which has the specified keyAltName. + * + * @param keyAltName - a keyAltName to search for a key + * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the keyAltName. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // get a key by alt name + * const keyAltName = 'keyAltName'; + * const key = await clientEncryption.getKeyByAltName(keyAltName); + * if (!key) { + * // key is null if there is no matching key + * } + * ``` + */ + async getKeyByAltName(keyAltName) { + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + return await this._keyVaultClient.db(dbName).collection(collectionName).findOne({ keyAltNames: keyAltName }, { readConcern: { level: "majority" }, timeoutMS: this._timeoutMS }); + } + /** + * Adds a keyAltName to a key identified by the provided _id. + * + * This method resolves to/returns the *old* key value (prior to adding the new altKeyName). + * + * @param _id - The id of the document to update. + * @param keyAltName - a keyAltName to search for a key + * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the id. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // adding an keyAltName to a data key + * const id = new Binary(); // id is a bson binary subtype 4 object + * const keyAltName = 'keyAltName'; + * const oldKey = await clientEncryption.addKeyAltName(id, keyAltName); + * if (!oldKey) { + * // null is returned if there is no matching document with an id matching the supplied id + * } + * ``` + */ + async addKeyAltName(_id, keyAltName) { + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + const value = await this._keyVaultClient.db(dbName).collection(collectionName).findOneAndUpdate({ _id }, { $addToSet: { keyAltNames: keyAltName } }, { writeConcern: { w: "majority" }, returnDocument: "before", timeoutMS: this._timeoutMS }); + return value; + } + /** + * Adds a keyAltName to a key identified by the provided _id. + * + * This method resolves to/returns the *old* key value (prior to removing the new altKeyName). + * + * If the removed keyAltName is the last keyAltName for that key, the `altKeyNames` property is unset from the document. + * + * @param _id - The id of the document to update. + * @param keyAltName - a keyAltName to search for a key + * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents + * match the id. The promise rejects with an error if an error is thrown. + * @example + * ```ts + * // removing a key alt name from a data key + * const id = new Binary(); // id is a bson binary subtype 4 object + * const keyAltName = 'keyAltName'; + * const oldKey = await clientEncryption.removeKeyAltName(id, keyAltName); + * + * if (!oldKey) { + * // null is returned if there is no matching document with an id matching the supplied id + * } + * ``` + */ + async removeKeyAltName(_id, keyAltName) { + const { db: dbName, collection: collectionName } = utils_1.MongoDBCollectionNamespace.fromString(this._keyVaultNamespace); + const pipeline = [ + { + $set: { + keyAltNames: { + $cond: [ + { + $eq: ["$keyAltNames", [keyAltName]] + }, + "$$REMOVE", + { + $filter: { + input: "$keyAltNames", + cond: { + $ne: ["$$this", keyAltName] + } + } + } + ] + } + } + } + ]; + const value = await this._keyVaultClient.db(dbName).collection(collectionName).findOneAndUpdate({ _id }, pipeline, { + writeConcern: { w: "majority" }, + returnDocument: "before", + timeoutMS: this._timeoutMS + }); + return value; + } + /** + * A convenience method for creating an encrypted collection. + * This method will create data keys for any encryptedFields that do not have a `keyId` defined + * and then create a new collection with the full set of encryptedFields. + * + * @param db - A Node.js driver Db object with which to create the collection + * @param name - The name of the collection to be created + * @param options - Options for createDataKey and for createCollection + * @returns created collection and generated encryptedFields + * @throws MongoCryptCreateDataKeyError - If part way through the process a createDataKey invocation fails, an error will be rejected that has the partial `encryptedFields` that were created. + * @throws MongoCryptCreateEncryptedCollectionError - If creating the collection fails, an error will be rejected that has the entire `encryptedFields` that were created. + */ + async createEncryptedCollection(db, name, options) { + const { provider, masterKey, createCollectionOptions: { encryptedFields: { ...encryptedFields }, ...createCollectionOptions } } = options; + const timeoutContext = this._timeoutMS != null ? timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS })) : void 0; + if (Array.isArray(encryptedFields.fields)) { + const createDataKeyPromises = encryptedFields.fields.map(async (field) => field == null || typeof field !== "object" || field.keyId != null ? field : { + ...field, + keyId: await this.createDataKey(provider, { + masterKey, + // clone the timeoutContext + // in order to avoid sharing the same timeout for server selection and connection checkout across different concurrent operations + timeoutContext: timeoutContext?.csotEnabled() ? timeoutContext?.clone() : void 0 + }) + }); + const createDataKeyResolutions = await Promise.allSettled(createDataKeyPromises); + encryptedFields.fields = createDataKeyResolutions.map((resolution, index) => resolution.status === "fulfilled" ? resolution.value : encryptedFields.fields[index]); + const rejection = createDataKeyResolutions.find((result) => result.status === "rejected"); + if (rejection != null) { + throw new errors_1.MongoCryptCreateDataKeyError(encryptedFields, { cause: rejection.reason }); + } + } + try { + const collection = await db.createCollection(name, { + ...createCollectionOptions, + encryptedFields, + timeoutMS: timeoutContext?.csotEnabled() ? timeoutContext?.getRemainingTimeMSOrThrow() : void 0 + }); + return { collection, encryptedFields }; + } catch (cause) { + throw new errors_1.MongoCryptCreateEncryptedCollectionError(encryptedFields, { cause }); + } + } + /** + * Explicitly encrypt a provided value. Note that either `options.keyId` or `options.keyAltName` must + * be specified. Specifying both `options.keyId` and `options.keyAltName` is considered an error. + * + * @param value - The value that you wish to serialize. Must be of a type that can be serialized into BSON + * @param options - + * @returns a Promise that either resolves with the encrypted value, or rejects with an error. + * + * @example + * ```ts + * // Encryption with async/await api + * async function encryptMyData(value) { + * const keyId = await clientEncryption.createDataKey('local'); + * return clientEncryption.encrypt(value, { keyId, algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' }); + * } + * ``` + * + * @example + * ```ts + * // Encryption using a keyAltName + * async function encryptMyData(value) { + * await clientEncryption.createDataKey('local', { keyAltNames: 'mySpecialKey' }); + * return clientEncryption.encrypt(value, { keyAltName: 'mySpecialKey', algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' }); + * } + * ``` + */ + async encrypt(value, options) { + return await this._encrypt(value, false, options); + } + /** + * Encrypts a Match Expression or Aggregate Expression to query a range index. + * + * Only supported when queryType is "range" and algorithm is "Range". + * + * @param expression - a BSON document of one of the following forms: + * 1. A Match Expression of this form: + * `{$and: [{: {$gt: }}, {: {$lt: }}]}` + * 2. An Aggregate Expression of this form: + * `{$and: [{$gt: [, ]}, {$lt: [, ]}]}` + * + * `$gt` may also be `$gte`. `$lt` may also be `$lte`. + * + * @param options - + * @returns Returns a Promise that either resolves with the encrypted value or rejects with an error. + */ + async encryptExpression(expression, options) { + return await this._encrypt(expression, true, options); + } + /** + * Explicitly decrypt a provided encrypted value + * + * @param value - An encrypted value + * @returns a Promise that either resolves with the decrypted value, or rejects with an error + * + * @example + * ```ts + * // Decrypting value with async/await API + * async function decryptMyValue(value) { + * return clientEncryption.decrypt(value); + * } + * ``` + */ + async decrypt(value) { + const valueBuffer = (0, bson_1.serialize)({ v: value }); + const context = this._mongoCrypt.makeExplicitDecryptionContext(valueBuffer); + const stateMachine = new state_machine_1.StateMachine({ + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: autoSelectSocketOptions(this._client.s.options) + }); + const timeoutContext = this._timeoutMS != null ? timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS })) : void 0; + const { v: v4 } = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext })); + return v4; + } + /** + * @internal + * Ask the user for KMS credentials. + * + * This returns anything that looks like the kmsProviders original input + * option. It can be empty, and any provider specified here will override + * the original ones. + */ + async askForKMSCredentials() { + return await (0, index_1.refreshKMSCredentials)(this._kmsProviders, this._credentialProviders); + } + static get libmongocryptVersion() { + return _ClientEncryption.getMongoCrypt().libmongocryptVersion; + } + /** + * @internal + * A helper that perform explicit encryption of values and expressions. + * Explicitly encrypt a provided value. Note that either `options.keyId` or `options.keyAltName` must + * be specified. Specifying both `options.keyId` and `options.keyAltName` is considered an error. + * + * @param value - The value that you wish to encrypt. Must be of a type that can be serialized into BSON + * @param expressionMode - a boolean that indicates whether or not to encrypt the value as an expression + * @param options - options to pass to encrypt + * @returns the raw result of the call to stateMachine.execute(). When expressionMode is set to true, the return + * value will be a bson document. When false, the value will be a BSON Binary. + * + */ + async _encrypt(value, expressionMode, options) { + const { algorithm, keyId, keyAltName, contentionFactor, queryType, rangeOptions, textOptions } = options; + const contextOptions = { + expressionMode, + algorithm + }; + if (keyId) { + contextOptions.keyId = keyId.buffer; + } + if (keyAltName) { + if (keyId) { + throw new errors_1.MongoCryptInvalidArgumentError(`"options" cannot contain both "keyId" and "keyAltName"`); + } + if (typeof keyAltName !== "string") { + throw new errors_1.MongoCryptInvalidArgumentError(`"options.keyAltName" must be of type string, but was of type ${typeof keyAltName}`); + } + contextOptions.keyAltName = (0, bson_1.serialize)({ keyAltName }); + } + if (typeof contentionFactor === "number" || typeof contentionFactor === "bigint") { + contextOptions.contentionFactor = contentionFactor; + } + if (typeof queryType === "string") { + contextOptions.queryType = queryType; + } + if (typeof rangeOptions === "object") { + contextOptions.rangeOptions = (0, bson_1.serialize)(rangeOptions); + } + if (typeof textOptions === "object") { + contextOptions.textOptions = (0, bson_1.serialize)(textOptions); + } + const valueBuffer = (0, bson_1.serialize)({ v: value }); + const stateMachine = new state_machine_1.StateMachine({ + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: autoSelectSocketOptions(this._client.s.options) + }); + const context = this._mongoCrypt.makeExplicitEncryptionContext(valueBuffer, contextOptions); + const timeoutContext = this._timeoutMS != null ? timeout_1.TimeoutContext.create((0, utils_1.resolveTimeoutOptions)(this._client, { timeoutMS: this._timeoutMS })) : void 0; + const { v: v4 } = (0, bson_1.deserialize)(await stateMachine.execute(this, context, { timeoutContext })); + return v4; + } + }; + exports2.ClientEncryption = ClientEncryption; + function autoSelectSocketOptions(baseOptions) { + const options = { autoSelectFamily: true }; + if ("autoSelectFamily" in baseOptions) { + options.autoSelectFamily = baseOptions.autoSelectFamily; + } + if ("autoSelectFamilyAttemptTimeout" in baseOptions) { + options.autoSelectFamilyAttemptTimeout = baseOptions.autoSelectFamilyAttemptTimeout; + } + return options; + } + } +}); + +// node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.js +var require_mongocryptd_manager = __commonJS({ + "node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MongocryptdManager = void 0; + var error_1 = require_error(); + var MongocryptdManager = class _MongocryptdManager { + constructor(extraOptions = {}) { + this.spawnPath = ""; + this.spawnArgs = []; + this.uri = typeof extraOptions.mongocryptdURI === "string" && extraOptions.mongocryptdURI.length > 0 ? extraOptions.mongocryptdURI : _MongocryptdManager.DEFAULT_MONGOCRYPTD_URI; + this.bypassSpawn = !!extraOptions.mongocryptdBypassSpawn; + if (Object.hasOwn(extraOptions, "mongocryptdSpawnPath") && extraOptions.mongocryptdSpawnPath) { + this.spawnPath = extraOptions.mongocryptdSpawnPath; + } + if (Object.hasOwn(extraOptions, "mongocryptdSpawnArgs") && Array.isArray(extraOptions.mongocryptdSpawnArgs)) { + this.spawnArgs = this.spawnArgs.concat(extraOptions.mongocryptdSpawnArgs); + } + if (this.spawnArgs.filter((arg) => typeof arg === "string").every((arg) => arg.indexOf("--idleShutdownTimeoutSecs") < 0)) { + this.spawnArgs.push("--idleShutdownTimeoutSecs", "60"); + } + } + /** + * Will check to see if a mongocryptd is up. If it is not up, it will attempt + * to spawn a mongocryptd in a detached process, and then wait for it to be up. + */ + async spawn() { + const cmdName = this.spawnPath || "mongocryptd"; + const { spawn } = require("child_process"); + this._child = spawn(cmdName, this.spawnArgs, { + stdio: "ignore", + detached: true + }); + this._child.on("error", () => { + }); + this._child.unref(); + } + /** + * @returns the result of `fn` or rejects with an error. + */ + async withRespawn(fn2) { + try { + const result2 = await fn2(); + return result2; + } catch (err) { + const shouldSpawn = err instanceof error_1.MongoNetworkTimeoutError && !this.bypassSpawn; + if (!shouldSpawn) { + throw err; + } + } + await this.spawn(); + const result = await fn2(); + return result; + } + }; + exports2.MongocryptdManager = MongocryptdManager; + MongocryptdManager.DEFAULT_MONGOCRYPTD_URI = "mongodb://localhost:27020"; + } +}); + +// node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js +var require_auto_encrypter = __commonJS({ + "node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js"(exports2) { + "use strict"; + var _a2; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AutoEncrypter = exports2.AutoEncryptionLoggerLevel = void 0; + var net = require("net"); + var bson_1 = require_bson2(); + var constants_1 = require_constants2(); + var deps_1 = require_deps(); + var error_1 = require_error(); + var mongo_client_1 = require_mongo_client(); + var utils_1 = require_utils3(); + var client_encryption_1 = require_client_encryption(); + var cryptoCallbacks = require_crypto_callbacks(); + var errors_1 = require_errors(); + var mongocryptd_manager_1 = require_mongocryptd_manager(); + var providers_1 = require_providers2(); + var state_machine_1 = require_state_machine(); + exports2.AutoEncryptionLoggerLevel = Object.freeze({ + FatalError: 0, + Error: 1, + Warning: 2, + Info: 3, + Trace: 4 + }); + var AutoEncrypter = class _AutoEncrypter { + /** @internal */ + static getMongoCrypt() { + const encryption = (0, deps_1.getMongoDBClientEncryption)(); + if ("kModuleError" in encryption) { + throw encryption.kModuleError; + } + return encryption.MongoCrypt; + } + /** + * Create an AutoEncrypter + * + * **Note**: Do not instantiate this class directly. Rather, supply the relevant options to a MongoClient + * + * **Note**: Supplying `options.schemaMap` provides more security than relying on JSON Schemas obtained from the server. + * It protects against a malicious server advertising a false JSON Schema, which could trick the client into sending unencrypted data that should be encrypted. + * Schemas supplied in the schemaMap only apply to configuring automatic encryption for Client-Side Field Level Encryption. + * Other validation rules in the JSON schema will not be enforced by the driver and will result in an error. + * + * @example Create an AutoEncrypter that makes use of mongocryptd + * ```ts + * // Enabling autoEncryption via a MongoClient using mongocryptd + * const { MongoClient } = require('mongodb'); + * const client = new MongoClient(URL, { + * autoEncryption: { + * kmsProviders: { + * aws: { + * accessKeyId: AWS_ACCESS_KEY, + * secretAccessKey: AWS_SECRET_KEY + * } + * } + * } + * }); + * ``` + * + * await client.connect(); + * // From here on, the client will be encrypting / decrypting automatically + * @example Create an AutoEncrypter that makes use of libmongocrypt's CSFLE shared library + * ```ts + * // Enabling autoEncryption via a MongoClient using CSFLE shared library + * const { MongoClient } = require('mongodb'); + * const client = new MongoClient(URL, { + * autoEncryption: { + * kmsProviders: { + * aws: {} + * }, + * extraOptions: { + * cryptSharedLibPath: '/path/to/local/crypt/shared/lib', + * cryptSharedLibRequired: true + * } + * } + * }); + * ``` + * + * await client.connect(); + * // From here on, the client will be encrypting / decrypting automatically + */ + constructor(client, options) { + this[_a2] = false; + this._client = client; + this._bypassEncryption = options.bypassAutoEncryption === true; + this._keyVaultNamespace = options.keyVaultNamespace || "admin.datakeys"; + this._keyVaultClient = options.keyVaultClient || client; + this._metaDataClient = options.metadataClient || client; + this._proxyOptions = options.proxyOptions || {}; + this._tlsOptions = options.tlsOptions || {}; + this._kmsProviders = options.kmsProviders || {}; + this._credentialProviders = options.credentialProviders; + if (options.credentialProviders?.aws && !(0, providers_1.isEmptyCredentials)("aws", this._kmsProviders)) { + throw new errors_1.MongoCryptInvalidArgumentError("Can only provide a custom AWS credential provider when the state machine is configured for automatic AWS credential fetching"); + } + const mongoCryptOptions = { + enableMultipleCollinfo: true, + cryptoCallbacks + }; + if (options.schemaMap) { + mongoCryptOptions.schemaMap = Buffer.isBuffer(options.schemaMap) ? options.schemaMap : (0, bson_1.serialize)(options.schemaMap); + } + if (options.encryptedFieldsMap) { + mongoCryptOptions.encryptedFieldsMap = Buffer.isBuffer(options.encryptedFieldsMap) ? options.encryptedFieldsMap : (0, bson_1.serialize)(options.encryptedFieldsMap); + } + mongoCryptOptions.kmsProviders = !Buffer.isBuffer(this._kmsProviders) ? (0, bson_1.serialize)(this._kmsProviders) : this._kmsProviders; + if (options.options?.logger) { + mongoCryptOptions.logger = options.options.logger; + } + if (options.extraOptions && options.extraOptions.cryptSharedLibPath) { + mongoCryptOptions.cryptSharedLibPath = options.extraOptions.cryptSharedLibPath; + } + if (options.bypassQueryAnalysis) { + mongoCryptOptions.bypassQueryAnalysis = options.bypassQueryAnalysis; + } + if (options.keyExpirationMS != null) { + mongoCryptOptions.keyExpirationMS = options.keyExpirationMS; + } + this._bypassMongocryptdAndCryptShared = this._bypassEncryption || !!options.bypassQueryAnalysis; + if (options.extraOptions && options.extraOptions.cryptSharedLibSearchPaths) { + mongoCryptOptions.cryptSharedLibSearchPaths = options.extraOptions.cryptSharedLibSearchPaths; + } else if (!this._bypassMongocryptdAndCryptShared) { + mongoCryptOptions.cryptSharedLibSearchPaths = ["$SYSTEM"]; + } + const MongoCrypt = _AutoEncrypter.getMongoCrypt(); + this._mongocrypt = new MongoCrypt(mongoCryptOptions); + this._contextCounter = 0; + if (options.extraOptions && options.extraOptions.cryptSharedLibRequired && !this.cryptSharedLibVersionInfo) { + throw new errors_1.MongoCryptInvalidArgumentError("`cryptSharedLibRequired` set but no crypt_shared library loaded"); + } + if (!this._bypassMongocryptdAndCryptShared && !this.cryptSharedLibVersionInfo) { + this._mongocryptdManager = new mongocryptd_manager_1.MongocryptdManager(options.extraOptions); + const clientOptions = { + serverSelectionTimeoutMS: 1e4 + }; + if ((options.extraOptions == null || typeof options.extraOptions.mongocryptdURI !== "string") && !net.getDefaultAutoSelectFamily) { + clientOptions.family = 4; + } + if (net.getDefaultAutoSelectFamily) { + Object.assign(clientOptions, (0, client_encryption_1.autoSelectSocketOptions)(this._client.s?.options ?? {})); + } + this._mongocryptdClient = new mongo_client_1.MongoClient(this._mongocryptdManager.uri, clientOptions); + } + } + /** + * Initializes the auto encrypter by spawning a mongocryptd and connecting to it. + * + * This function is a no-op when bypassSpawn is set or the crypt shared library is used. + */ + async init() { + if (this._bypassMongocryptdAndCryptShared || this.cryptSharedLibVersionInfo) { + return; + } + if (!this._mongocryptdManager) { + throw new error_1.MongoRuntimeError("Reached impossible state: mongocryptdManager is undefined when neither bypassSpawn nor the shared lib are specified."); + } + if (!this._mongocryptdClient) { + throw new error_1.MongoRuntimeError("Reached impossible state: mongocryptdClient is undefined when neither bypassSpawn nor the shared lib are specified."); + } + if (!this._mongocryptdManager.bypassSpawn) { + await this._mongocryptdManager.spawn(); + } + try { + const client = await this._mongocryptdClient.connect(); + return client; + } catch (error2) { + throw new error_1.MongoRuntimeError("Unable to connect to `mongocryptd`, please make sure it is running or in your PATH for auto-spawn", { cause: error2 }); + } + } + /** + * Cleans up the `_mongocryptdClient`, if present. + */ + async close() { + await this._mongocryptdClient?.close(); + } + /** + * Encrypt a command for a given namespace. + */ + async encrypt(ns, cmd, options = {}) { + options.signal?.throwIfAborted(); + if (this._bypassEncryption) { + return cmd; + } + const commandBuffer = Buffer.isBuffer(cmd) ? cmd : (0, bson_1.serialize)(cmd, options); + const context = this._mongocrypt.makeEncryptionContext(utils_1.MongoDBCollectionNamespace.fromString(ns).db, commandBuffer); + context.id = this._contextCounter++; + context.ns = ns; + context.document = cmd; + const stateMachine = new state_machine_1.StateMachine({ + promoteValues: false, + promoteLongs: false, + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: (0, client_encryption_1.autoSelectSocketOptions)(this._client.s.options) + }); + return (0, bson_1.deserialize)(await stateMachine.execute(this, context, options), { + promoteValues: false, + promoteLongs: false + }); + } + /** + * Decrypt a command response + */ + async decrypt(response, options = {}) { + options.signal?.throwIfAborted(); + const context = this._mongocrypt.makeDecryptionContext(response); + context.id = this._contextCounter++; + const stateMachine = new state_machine_1.StateMachine({ + ...options, + proxyOptions: this._proxyOptions, + tlsOptions: this._tlsOptions, + socketOptions: (0, client_encryption_1.autoSelectSocketOptions)(this._client.s.options) + }); + return await stateMachine.execute(this, context, options); + } + /** + * Ask the user for KMS credentials. + * + * This returns anything that looks like the kmsProviders original input + * option. It can be empty, and any provider specified here will override + * the original ones. + */ + async askForKMSCredentials() { + return await (0, providers_1.refreshKMSCredentials)(this._kmsProviders, this._credentialProviders); + } + /** + * Return the current libmongocrypt's CSFLE shared library version + * as `{ version: bigint, versionStr: string }`, or `null` if no CSFLE + * shared library was loaded. + */ + get cryptSharedLibVersionInfo() { + return this._mongocrypt.cryptSharedLibVersionInfo; + } + static get libmongocryptVersion() { + return _AutoEncrypter.getMongoCrypt().libmongocryptVersion; + } + }; + exports2.AutoEncrypter = AutoEncrypter; + _a2 = constants_1.kDecorateResult; + } +}); + +// node_modules/mongodb/lib/encrypter.js +var require_encrypter = __commonJS({ + "node_modules/mongodb/lib/encrypter.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Encrypter = void 0; + var auto_encrypter_1 = require_auto_encrypter(); + var constants_1 = require_constants2(); + var deps_1 = require_deps(); + var error_1 = require_error(); + var mongo_client_1 = require_mongo_client(); + var Encrypter = class { + constructor(client, uri, options) { + if (typeof options.autoEncryption !== "object") { + throw new error_1.MongoInvalidArgumentError('Option "autoEncryption" must be specified'); + } + this.internalClient = null; + this.bypassAutoEncryption = !!options.autoEncryption.bypassAutoEncryption; + this.needsConnecting = false; + if (options.maxPoolSize === 0 && options.autoEncryption.keyVaultClient == null) { + options.autoEncryption.keyVaultClient = client; + } else if (options.autoEncryption.keyVaultClient == null) { + options.autoEncryption.keyVaultClient = this.getInternalClient(client, uri, options); + } + if (this.bypassAutoEncryption) { + options.autoEncryption.metadataClient = void 0; + } else if (options.maxPoolSize === 0) { + options.autoEncryption.metadataClient = client; + } else { + options.autoEncryption.metadataClient = this.getInternalClient(client, uri, options); + } + if (options.proxyHost) { + options.autoEncryption.proxyOptions = { + proxyHost: options.proxyHost, + proxyPort: options.proxyPort, + proxyUsername: options.proxyUsername, + proxyPassword: options.proxyPassword + }; + } + this.autoEncrypter = new auto_encrypter_1.AutoEncrypter(client, options.autoEncryption); + } + getInternalClient(client, uri, options) { + let internalClient = this.internalClient; + if (internalClient == null) { + const clonedOptions = {}; + for (const key of [ + ...Object.getOwnPropertyNames(options), + ...Object.getOwnPropertySymbols(options) + ]) { + if (["autoEncryption", "minPoolSize", "servers", "caseTranslate", "dbName"].includes(key)) + continue; + Reflect.set(clonedOptions, key, Reflect.get(options, key)); + } + clonedOptions.minPoolSize = 0; + internalClient = new mongo_client_1.MongoClient(uri, clonedOptions); + this.internalClient = internalClient; + for (const eventName of constants_1.MONGO_CLIENT_EVENTS) { + for (const listener of client.listeners(eventName)) { + internalClient.on(eventName, listener); + } + } + client.on("newListener", (eventName, listener) => { + internalClient?.on(eventName, listener); + }); + this.needsConnecting = true; + } + return internalClient; + } + async connectInternalClient() { + const internalClient = this.internalClient; + if (this.needsConnecting && internalClient != null) { + this.needsConnecting = false; + await internalClient.connect(); + } + } + async close(client) { + let error2; + try { + await this.autoEncrypter.close(); + } catch (autoEncrypterError) { + error2 = autoEncrypterError; + } + const internalClient = this.internalClient; + if (internalClient != null && client !== internalClient) { + return await internalClient.close(); + } + if (error2 != null) { + throw error2; + } + } + static checkForMongoCrypt() { + const mongodbClientEncryption = (0, deps_1.getMongoDBClientEncryption)(); + if ("kModuleError" in mongodbClientEncryption) { + throw new error_1.MongoMissingDependencyError("Auto-encryption requested, but the module is not installed. Please add `mongodb-client-encryption` as a dependency of your project", { + cause: mongodbClientEncryption["kModuleError"], + dependencyName: "mongodb-client-encryption" + }); + } + } + }; + exports2.Encrypter = Encrypter; + } +}); + +// node_modules/mongodb/lib/cmap/metrics.js +var require_metrics = __commonJS({ + "node_modules/mongodb/lib/cmap/metrics.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ConnectionPoolMetrics = void 0; + var ConnectionPoolMetrics = class _ConnectionPoolMetrics { + constructor() { + this.txnConnections = 0; + this.cursorConnections = 0; + this.otherConnections = 0; + } + /** + * Mark a connection as pinned for a specific operation. + */ + markPinned(pinType) { + if (pinType === _ConnectionPoolMetrics.TXN) { + this.txnConnections += 1; + } else if (pinType === _ConnectionPoolMetrics.CURSOR) { + this.cursorConnections += 1; + } else { + this.otherConnections += 1; + } + } + /** + * Unmark a connection as pinned for an operation. + */ + markUnpinned(pinType) { + if (pinType === _ConnectionPoolMetrics.TXN) { + this.txnConnections -= 1; + } else if (pinType === _ConnectionPoolMetrics.CURSOR) { + this.cursorConnections -= 1; + } else { + this.otherConnections -= 1; + } + } + /** + * Return information about the cmap metrics as a string. + */ + info(maxPoolSize) { + return `Timed out while checking out a connection from connection pool: maxPoolSize: ${maxPoolSize}, connections in use by cursors: ${this.cursorConnections}, connections in use by transactions: ${this.txnConnections}, connections in use by other operations: ${this.otherConnections}`; + } + /** + * Reset the metrics to the initial values. + */ + reset() { + this.txnConnections = 0; + this.cursorConnections = 0; + this.otherConnections = 0; + } + }; + exports2.ConnectionPoolMetrics = ConnectionPoolMetrics; + ConnectionPoolMetrics.TXN = "txn"; + ConnectionPoolMetrics.CURSOR = "cursor"; + ConnectionPoolMetrics.OTHER = "other"; + } +}); + +// node_modules/mongodb/lib/transactions.js +var require_transactions = __commonJS({ + "node_modules/mongodb/lib/transactions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Transaction = exports2.TxnState = void 0; + exports2.isTransactionCommand = isTransactionCommand; + var error_1 = require_error(); + var read_concern_1 = require_read_concern(); + var read_preference_1 = require_read_preference(); + var write_concern_1 = require_write_concern(); + exports2.TxnState = Object.freeze({ + NO_TRANSACTION: "NO_TRANSACTION", + STARTING_TRANSACTION: "STARTING_TRANSACTION", + TRANSACTION_IN_PROGRESS: "TRANSACTION_IN_PROGRESS", + TRANSACTION_COMMITTED: "TRANSACTION_COMMITTED", + TRANSACTION_COMMITTED_EMPTY: "TRANSACTION_COMMITTED_EMPTY", + TRANSACTION_ABORTED: "TRANSACTION_ABORTED" + }); + var stateMachine = { + [exports2.TxnState.NO_TRANSACTION]: [exports2.TxnState.NO_TRANSACTION, exports2.TxnState.STARTING_TRANSACTION], + [exports2.TxnState.STARTING_TRANSACTION]: [ + exports2.TxnState.TRANSACTION_IN_PROGRESS, + exports2.TxnState.TRANSACTION_COMMITTED, + exports2.TxnState.TRANSACTION_COMMITTED_EMPTY, + exports2.TxnState.TRANSACTION_ABORTED + ], + [exports2.TxnState.TRANSACTION_IN_PROGRESS]: [ + exports2.TxnState.TRANSACTION_IN_PROGRESS, + exports2.TxnState.TRANSACTION_COMMITTED, + exports2.TxnState.TRANSACTION_ABORTED + ], + [exports2.TxnState.TRANSACTION_COMMITTED]: [ + exports2.TxnState.TRANSACTION_COMMITTED, + exports2.TxnState.TRANSACTION_COMMITTED_EMPTY, + exports2.TxnState.STARTING_TRANSACTION, + exports2.TxnState.NO_TRANSACTION + ], + [exports2.TxnState.TRANSACTION_ABORTED]: [exports2.TxnState.STARTING_TRANSACTION, exports2.TxnState.NO_TRANSACTION], + [exports2.TxnState.TRANSACTION_COMMITTED_EMPTY]: [ + exports2.TxnState.TRANSACTION_COMMITTED_EMPTY, + exports2.TxnState.NO_TRANSACTION + ] + }; + var ACTIVE_STATES = /* @__PURE__ */ new Set([ + exports2.TxnState.STARTING_TRANSACTION, + exports2.TxnState.TRANSACTION_IN_PROGRESS + ]); + var COMMITTED_STATES = /* @__PURE__ */ new Set([ + exports2.TxnState.TRANSACTION_COMMITTED, + exports2.TxnState.TRANSACTION_COMMITTED_EMPTY, + exports2.TxnState.TRANSACTION_ABORTED + ]); + var Transaction = class { + /** Create a transaction @internal */ + constructor(options) { + options = options ?? {}; + this.state = exports2.TxnState.NO_TRANSACTION; + this.options = {}; + const writeConcern = write_concern_1.WriteConcern.fromOptions(options); + if (writeConcern) { + if (writeConcern.w === 0) { + throw new error_1.MongoTransactionError("Transactions do not support unacknowledged write concern"); + } + this.options.writeConcern = writeConcern; + } + if (options.readConcern) { + this.options.readConcern = read_concern_1.ReadConcern.fromOptions(options); + } + if (options.readPreference) { + this.options.readPreference = read_preference_1.ReadPreference.fromOptions(options); + } + if (options.maxCommitTimeMS) { + this.options.maxTimeMS = options.maxCommitTimeMS; + } + this._pinnedServer = void 0; + this._recoveryToken = void 0; + } + /** @internal */ + get server() { + return this._pinnedServer; + } + /** @deprecated - Will be made internal in a future major release. */ + get recoveryToken() { + return this._recoveryToken; + } + /** @deprecated - Will be made internal in a future major release. */ + get isPinned() { + return !!this.server; + } + /** + * @deprecated - Will be made internal in a future major release. + * @returns Whether the transaction has started + */ + get isStarting() { + return this.state === exports2.TxnState.STARTING_TRANSACTION; + } + /** + * @deprecated - Will be made internal in a future major release. + * @returns Whether this session is presently in a transaction + */ + get isActive() { + return ACTIVE_STATES.has(this.state); + } + /** @deprecated - Will be made internal in a future major release. */ + get isCommitted() { + return COMMITTED_STATES.has(this.state); + } + /** + * Transition the transaction in the state machine + * @internal + * @param nextState - The new state to transition to + */ + transition(nextState) { + const nextStates = stateMachine[this.state]; + if (nextStates && nextStates.includes(nextState)) { + this.state = nextState; + if (this.state === exports2.TxnState.NO_TRANSACTION || this.state === exports2.TxnState.STARTING_TRANSACTION || this.state === exports2.TxnState.TRANSACTION_ABORTED) { + this.unpinServer(); + } + return; + } + throw new error_1.MongoRuntimeError(`Attempted illegal state transition from [${this.state}] to [${nextState}]`); + } + /** @internal */ + pinServer(server) { + if (this.isActive) { + this._pinnedServer = server; + } + } + /** @internal */ + unpinServer() { + this._pinnedServer = void 0; + } + }; + exports2.Transaction = Transaction; + function isTransactionCommand(command) { + return !!(command.commitTransaction || command.abortTransaction); + } + } +}); + +// node_modules/mongodb/lib/sessions.js +var require_sessions = __commonJS({ + "node_modules/mongodb/lib/sessions.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ServerSessionPool = exports2.ServerSession = exports2.ClientSession = void 0; + exports2.maybeClearPinnedConnection = maybeClearPinnedConnection; + exports2.applySession = applySession; + exports2.updateSessionFromResponse = updateSessionFromResponse; + var bson_1 = require_bson2(); + var metrics_1 = require_metrics(); + var constants_1 = require_constants2(); + var error_1 = require_error(); + var mongo_types_1 = require_mongo_types(); + var execute_operation_1 = require_execute_operation(); + var run_command_1 = require_run_command(); + var read_concern_1 = require_read_concern(); + var read_preference_1 = require_read_preference(); + var resource_management_1 = require_resource_management(); + var common_1 = require_common(); + var timeout_1 = require_timeout(); + var transactions_1 = require_transactions(); + var utils_1 = require_utils3(); + var write_concern_1 = require_write_concern(); + var ClientSession = class _ClientSession extends mongo_types_1.TypedEventEmitter { + /** + * Create a client session. + * @internal + * @param client - The current client + * @param sessionPool - The server session pool (Internal Class) + * @param options - Optional settings + * @param clientOptions - Optional settings provided when creating a MongoClient + */ + constructor(client, sessionPool, options, clientOptions) { + super(); + this.timeoutContext = null; + this.on("error", utils_1.noop); + if (client == null) { + throw new error_1.MongoRuntimeError("ClientSession requires a MongoClient"); + } + if (sessionPool == null || !(sessionPool instanceof ServerSessionPool)) { + throw new error_1.MongoRuntimeError("ClientSession requires a ServerSessionPool"); + } + options = options ?? {}; + this.snapshotEnabled = options.snapshot === true; + if (options.causalConsistency === true && this.snapshotEnabled) { + throw new error_1.MongoInvalidArgumentError('Properties "causalConsistency" and "snapshot" are mutually exclusive'); + } + this.client = client; + this.sessionPool = sessionPool; + this.hasEnded = false; + this.clientOptions = clientOptions; + this.timeoutMS = options.defaultTimeoutMS ?? client.s.options?.timeoutMS; + this.explicit = !!options.explicit; + this._serverSession = this.explicit ? this.sessionPool.acquire() : null; + this.txnNumberIncrement = 0; + const defaultCausalConsistencyValue = this.explicit && options.snapshot !== true; + this.supports = { + // if we can enable causal consistency, do so by default + causalConsistency: options.causalConsistency ?? defaultCausalConsistencyValue + }; + this.clusterTime = options.initialClusterTime; + this.operationTime = void 0; + this.owner = options.owner; + this.defaultTransactionOptions = { ...options.defaultTransactionOptions }; + this.transaction = new transactions_1.Transaction(); + } + /** The server id associated with this session */ + get id() { + return this.serverSession?.id; + } + get serverSession() { + let serverSession = this._serverSession; + if (serverSession == null) { + if (this.explicit) { + throw new error_1.MongoRuntimeError("Unexpected null serverSession for an explicit session"); + } + if (this.hasEnded) { + throw new error_1.MongoRuntimeError("Unexpected null serverSession for an ended implicit session"); + } + serverSession = this.sessionPool.acquire(); + this._serverSession = serverSession; + } + return serverSession; + } + get loadBalanced() { + return this.client.topology?.description.type === common_1.TopologyType.LoadBalanced; + } + /** @internal */ + pin(conn) { + if (this.pinnedConnection) { + throw TypeError("Cannot pin multiple connections to the same session"); + } + this.pinnedConnection = conn; + conn.emit(constants_1.PINNED, this.inTransaction() ? metrics_1.ConnectionPoolMetrics.TXN : metrics_1.ConnectionPoolMetrics.CURSOR); + } + /** @internal */ + unpin(options) { + if (this.loadBalanced) { + return maybeClearPinnedConnection(this, options); + } + this.transaction.unpinServer(); + } + get isPinned() { + return this.loadBalanced ? !!this.pinnedConnection : this.transaction.isPinned; + } + /** + * Frees any client-side resources held by the current session. If a session is in a transaction, + * the transaction is aborted. + * + * Does not end the session on the server. + * + * @param options - Optional settings. Currently reserved for future use + */ + async endSession(options) { + try { + if (this.inTransaction()) { + await this.abortTransaction({ ...options, throwTimeout: true }); + } + } catch (error2) { + if (error2.name === "MongoOperationTimeoutError") + throw error2; + (0, utils_1.squashError)(error2); + } finally { + if (!this.hasEnded) { + const serverSession = this.serverSession; + if (serverSession != null) { + this.sessionPool.release(serverSession); + this._serverSession = new ServerSession(serverSession); + } + this.hasEnded = true; + this.emit("ended", this); + } + maybeClearPinnedConnection(this, { force: true, ...options }); + } + } + /** @internal */ + async asyncDispose() { + await this.endSession({ force: true }); + } + /** + * Advances the operationTime for a ClientSession. + * + * @param operationTime - the `BSON.Timestamp` of the operation type it is desired to advance to + */ + advanceOperationTime(operationTime) { + if (this.operationTime == null) { + this.operationTime = operationTime; + return; + } + if (operationTime.greaterThan(this.operationTime)) { + this.operationTime = operationTime; + } + } + /** + * Advances the clusterTime for a ClientSession to the provided clusterTime of another ClientSession + * + * @param clusterTime - the $clusterTime returned by the server from another session in the form of a document containing the `BSON.Timestamp` clusterTime and signature + */ + advanceClusterTime(clusterTime) { + if (!clusterTime || typeof clusterTime !== "object") { + throw new error_1.MongoInvalidArgumentError("input cluster time must be an object"); + } + if (!clusterTime.clusterTime || clusterTime.clusterTime._bsontype !== "Timestamp") { + throw new error_1.MongoInvalidArgumentError('input cluster time "clusterTime" property must be a valid BSON Timestamp'); + } + if (!clusterTime.signature || clusterTime.signature.hash?._bsontype !== "Binary" || typeof clusterTime.signature.keyId !== "bigint" && typeof clusterTime.signature.keyId !== "number" && clusterTime.signature.keyId?._bsontype !== "Long") { + throw new error_1.MongoInvalidArgumentError('input cluster time must have a valid "signature" property with BSON Binary hash and BSON Long keyId'); + } + (0, common_1._advanceClusterTime)(this, clusterTime); + } + /** + * Used to determine if this session equals another + * + * @param session - The session to compare to + */ + equals(session) { + if (!(session instanceof _ClientSession)) { + return false; + } + if (this.id == null || session.id == null) { + return false; + } + return utils_1.ByteUtils.equals(this.id.id.buffer, session.id.id.buffer); + } + /** + * Increment the transaction number on the internal ServerSession + * + * @privateRemarks + * This helper increments a value stored on the client session that will be + * added to the serverSession's txnNumber upon applying it to a command. + * This is because the serverSession is lazily acquired after a connection is obtained + */ + incrementTransactionNumber() { + this.txnNumberIncrement += 1; + } + /** @returns whether this session is currently in a transaction or not */ + inTransaction() { + return this.transaction.isActive; + } + /** + * Starts a new transaction with the given options. + * + * @remarks + * **IMPORTANT**: Running operations in parallel is not supported during a transaction. The use of `Promise.all`, + * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is + * undefined behaviour. + * + * @param options - Options for the transaction + */ + startTransaction(options) { + if (this.snapshotEnabled) { + throw new error_1.MongoCompatibilityError("Transactions are not supported in snapshot sessions"); + } + if (this.inTransaction()) { + throw new error_1.MongoTransactionError("Transaction already in progress"); + } + if (this.isPinned && this.transaction.isCommitted) { + this.unpin(); + } + this.commitAttempted = false; + this.incrementTransactionNumber(); + this.transaction = new transactions_1.Transaction({ + readConcern: options?.readConcern ?? this.defaultTransactionOptions.readConcern ?? this.clientOptions?.readConcern, + writeConcern: options?.writeConcern ?? this.defaultTransactionOptions.writeConcern ?? this.clientOptions?.writeConcern, + readPreference: options?.readPreference ?? this.defaultTransactionOptions.readPreference ?? this.clientOptions?.readPreference, + maxCommitTimeMS: options?.maxCommitTimeMS ?? this.defaultTransactionOptions.maxCommitTimeMS + }); + this.transaction.transition(transactions_1.TxnState.STARTING_TRANSACTION); + } + /** + * Commits the currently active transaction in this session. + * + * @param options - Optional options, can be used to override `defaultTimeoutMS`. + */ + async commitTransaction(options) { + if (this.transaction.state === transactions_1.TxnState.NO_TRANSACTION) { + throw new error_1.MongoTransactionError("No transaction started"); + } + if (this.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION || this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY) { + this.transaction.transition(transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY); + return; + } + if (this.transaction.state === transactions_1.TxnState.TRANSACTION_ABORTED) { + throw new error_1.MongoTransactionError("Cannot call commitTransaction after calling abortTransaction"); + } + const command = { commitTransaction: 1 }; + const timeoutMS = typeof options?.timeoutMS === "number" ? options.timeoutMS : typeof this.timeoutMS === "number" ? this.timeoutMS : null; + const wc = this.transaction.options.writeConcern ?? this.clientOptions?.writeConcern; + if (wc != null) { + if (timeoutMS == null && this.timeoutContext == null) { + write_concern_1.WriteConcern.apply(command, { wtimeoutMS: 1e4, w: "majority", ...wc }); + } else { + const wcKeys = Object.keys(wc); + if (wcKeys.length > 2 || !wcKeys.includes("wtimeoutMS") && !wcKeys.includes("wTimeoutMS")) + write_concern_1.WriteConcern.apply(command, { ...wc, wtimeoutMS: void 0 }); + } + } + if (this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED || this.commitAttempted) { + if (timeoutMS == null && this.timeoutContext == null) { + write_concern_1.WriteConcern.apply(command, { wtimeoutMS: 1e4, ...wc, w: "majority" }); + } else { + write_concern_1.WriteConcern.apply(command, { w: "majority", ...wc, wtimeoutMS: void 0 }); + } + } + if (typeof this.transaction.options.maxTimeMS === "number") { + command.maxTimeMS = this.transaction.options.maxTimeMS; + } + if (this.transaction.recoveryToken) { + command.recoveryToken = this.transaction.recoveryToken; + } + const operation2 = new run_command_1.RunCommandOperation(new utils_1.MongoDBNamespace("admin"), command, { + session: this, + readPreference: read_preference_1.ReadPreference.primary, + bypassPinningCheck: true + }); + const timeoutContext = this.timeoutContext ?? (typeof timeoutMS === "number" ? timeout_1.TimeoutContext.create({ + serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS, + socketTimeoutMS: this.clientOptions.socketTimeoutMS, + timeoutMS + }) : null); + try { + await (0, execute_operation_1.executeOperation)(this.client, operation2, timeoutContext); + this.commitAttempted = void 0; + return; + } catch (firstCommitError) { + this.commitAttempted = true; + if (firstCommitError instanceof error_1.MongoError && (0, error_1.isRetryableWriteError)(firstCommitError)) { + write_concern_1.WriteConcern.apply(command, { wtimeoutMS: 1e4, ...wc, w: "majority" }); + this.unpin({ force: true }); + try { + await (0, execute_operation_1.executeOperation)(this.client, new run_command_1.RunCommandOperation(new utils_1.MongoDBNamespace("admin"), command, { + session: this, + readPreference: read_preference_1.ReadPreference.primary, + bypassPinningCheck: true + }), timeoutContext); + return; + } catch (retryCommitError) { + if (shouldAddUnknownTransactionCommitResultLabel(retryCommitError)) { + retryCommitError.addErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult); + } + if (shouldUnpinAfterCommitError(retryCommitError)) { + this.unpin({ error: retryCommitError }); + } + throw retryCommitError; + } + } + if (shouldAddUnknownTransactionCommitResultLabel(firstCommitError)) { + firstCommitError.addErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult); + } + if (shouldUnpinAfterCommitError(firstCommitError)) { + this.unpin({ error: firstCommitError }); + } + throw firstCommitError; + } finally { + this.transaction.transition(transactions_1.TxnState.TRANSACTION_COMMITTED); + } + } + async abortTransaction(options) { + if (this.transaction.state === transactions_1.TxnState.NO_TRANSACTION) { + throw new error_1.MongoTransactionError("No transaction started"); + } + if (this.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION) { + this.transaction.transition(transactions_1.TxnState.TRANSACTION_ABORTED); + return; + } + if (this.transaction.state === transactions_1.TxnState.TRANSACTION_ABORTED) { + throw new error_1.MongoTransactionError("Cannot call abortTransaction twice"); + } + if (this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED || this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY) { + throw new error_1.MongoTransactionError("Cannot call abortTransaction after calling commitTransaction"); + } + const command = { abortTransaction: 1 }; + const timeoutMS = typeof options?.timeoutMS === "number" ? options.timeoutMS : this.timeoutContext?.csotEnabled() ? this.timeoutContext.timeoutMS : typeof this.timeoutMS === "number" ? this.timeoutMS : null; + const timeoutContext = timeoutMS != null ? timeout_1.TimeoutContext.create({ + timeoutMS, + serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS, + socketTimeoutMS: this.clientOptions.socketTimeoutMS + }) : null; + const wc = this.transaction.options.writeConcern ?? this.clientOptions?.writeConcern; + if (wc != null && timeoutMS == null) { + write_concern_1.WriteConcern.apply(command, { wtimeoutMS: 1e4, w: "majority", ...wc }); + } + if (this.transaction.recoveryToken) { + command.recoveryToken = this.transaction.recoveryToken; + } + const operation2 = new run_command_1.RunCommandOperation(new utils_1.MongoDBNamespace("admin"), command, { + session: this, + readPreference: read_preference_1.ReadPreference.primary, + bypassPinningCheck: true + }); + try { + await (0, execute_operation_1.executeOperation)(this.client, operation2, timeoutContext); + this.unpin(); + return; + } catch (firstAbortError) { + this.unpin(); + if (firstAbortError.name === "MongoRuntimeError") + throw firstAbortError; + if (options?.throwTimeout && firstAbortError.name === "MongoOperationTimeoutError") { + throw firstAbortError; + } + if (firstAbortError instanceof error_1.MongoError && (0, error_1.isRetryableWriteError)(firstAbortError)) { + try { + await (0, execute_operation_1.executeOperation)(this.client, operation2, timeoutContext); + return; + } catch (secondAbortError) { + if (secondAbortError.name === "MongoRuntimeError") + throw secondAbortError; + if (options?.throwTimeout && secondAbortError.name === "MongoOperationTimeoutError") { + throw secondAbortError; + } + } + } + } finally { + this.transaction.transition(transactions_1.TxnState.TRANSACTION_ABORTED); + if (this.loadBalanced) { + maybeClearPinnedConnection(this, { force: false }); + } + } + } + /** + * This is here to ensure that ClientSession is never serialized to BSON. + */ + toBSON() { + throw new error_1.MongoRuntimeError("ClientSession cannot be serialized to BSON."); + } + /** + * Starts a transaction and runs a provided function, ensuring the commitTransaction is always attempted when all operations run in the function have completed. + * + * **IMPORTANT:** This method requires the function passed in to return a Promise. That promise must be made by `await`-ing all operations in such a way that rejections are propagated to the returned promise. + * + * **IMPORTANT:** Running operations in parallel is not supported during a transaction. The use of `Promise.all`, + * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is + * undefined behaviour. + * + * **IMPORTANT:** When running an operation inside a `withTransaction` callback, if it is not + * provided the explicit session in its options, it will not be part of the transaction and it will not respect timeoutMS. + * + * + * @remarks + * - If all operations successfully complete and the `commitTransaction` operation is successful, then the provided function will return the result of the provided function. + * - If the transaction is unable to complete or an error is thrown from within the provided function, then the provided function will throw an error. + * - If the transaction is manually aborted within the provided function it will not throw. + * - If the driver needs to attempt to retry the operations, the provided function may be called multiple times. + * + * Checkout a descriptive example here: + * @see https://www.mongodb.com/blog/post/quick-start-nodejs--mongodb--how-to-implement-transactions + * + * If a command inside withTransaction fails: + * - It may cause the transaction on the server to be aborted. + * - This situation is normally handled transparently by the driver. + * - However, if the application catches such an error and does not rethrow it, the driver will not be able to determine whether the transaction was aborted or not. + * - The driver will then retry the transaction indefinitely. + * + * To avoid this situation, the application must not silently handle errors within the provided function. + * If the application needs to handle errors within, it must await all operations such that if an operation is rejected it becomes the rejection of the callback function passed into withTransaction. + * + * @param fn - callback to run within a transaction + * @param options - optional settings for the transaction + * @returns A raw command response or undefined + */ + async withTransaction(fn2, options) { + const MAX_TIMEOUT = 12e4; + const timeoutMS = options?.timeoutMS ?? this.timeoutMS ?? null; + this.timeoutContext = timeoutMS != null ? timeout_1.TimeoutContext.create({ + timeoutMS, + serverSelectionTimeoutMS: this.clientOptions.serverSelectionTimeoutMS, + socketTimeoutMS: this.clientOptions.socketTimeoutMS + }) : null; + const startTime = this.timeoutContext?.csotEnabled() ? this.timeoutContext.start : (0, utils_1.now)(); + let committed = false; + let result; + try { + while (!committed) { + this.startTransaction(options); + try { + const promise = fn2(this); + if (!(0, utils_1.isPromiseLike)(promise)) { + throw new error_1.MongoInvalidArgumentError("Function provided to `withTransaction` must return a Promise"); + } + result = await promise; + if (this.transaction.state === transactions_1.TxnState.NO_TRANSACTION || this.transaction.state === transactions_1.TxnState.TRANSACTION_COMMITTED || this.transaction.state === transactions_1.TxnState.TRANSACTION_ABORTED) { + return result; + } + } catch (fnError) { + if (!(fnError instanceof error_1.MongoError) || fnError instanceof error_1.MongoInvalidArgumentError) { + await this.abortTransaction(); + throw fnError; + } + if (this.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION || this.transaction.state === transactions_1.TxnState.TRANSACTION_IN_PROGRESS) { + await this.abortTransaction(); + } + if (fnError.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError) && (this.timeoutContext != null || (0, utils_1.now)() - startTime < MAX_TIMEOUT)) { + continue; + } + throw fnError; + } + while (!committed) { + try { + await this.commitTransaction(); + committed = true; + } catch (commitError) { + if (!isMaxTimeMSExpiredError(commitError) && commitError.hasErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult) && (this.timeoutContext != null || (0, utils_1.now)() - startTime < MAX_TIMEOUT)) { + continue; + } + if (commitError.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError) && (this.timeoutContext != null || (0, utils_1.now)() - startTime < MAX_TIMEOUT)) { + break; + } + throw commitError; + } + } + } + return result; + } finally { + this.timeoutContext = null; + } + } + }; + exports2.ClientSession = ClientSession; + (0, resource_management_1.configureResourceManagement)(ClientSession.prototype); + var NON_DETERMINISTIC_WRITE_CONCERN_ERRORS = /* @__PURE__ */ new Set([ + "CannotSatisfyWriteConcern", + "UnknownReplWriteConcern", + "UnsatisfiableWriteConcern" + ]); + function shouldUnpinAfterCommitError(commitError) { + if (commitError instanceof error_1.MongoError) { + if ((0, error_1.isRetryableWriteError)(commitError) || commitError instanceof error_1.MongoWriteConcernError || isMaxTimeMSExpiredError(commitError)) { + if (isUnknownTransactionCommitResult(commitError)) { + return true; + } + } else if (commitError.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + return true; + } + } + return false; + } + function shouldAddUnknownTransactionCommitResultLabel(commitError) { + let ok = (0, error_1.isRetryableWriteError)(commitError); + ok ||= commitError instanceof error_1.MongoWriteConcernError; + ok ||= isMaxTimeMSExpiredError(commitError); + ok &&= isUnknownTransactionCommitResult(commitError); + return ok; + } + function isUnknownTransactionCommitResult(err) { + const isNonDeterministicWriteConcernError = err instanceof error_1.MongoServerError && err.codeName && NON_DETERMINISTIC_WRITE_CONCERN_ERRORS.has(err.codeName); + return isMaxTimeMSExpiredError(err) || !isNonDeterministicWriteConcernError && err.code !== error_1.MONGODB_ERROR_CODES.UnsatisfiableWriteConcern && err.code !== error_1.MONGODB_ERROR_CODES.UnknownReplWriteConcern; + } + function maybeClearPinnedConnection(session, options) { + const conn = session.pinnedConnection; + const error2 = options?.error; + if (session.inTransaction() && error2 && error2 instanceof error_1.MongoError && error2.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + return; + } + const topology = session.client.topology; + if (conn && topology != null) { + const servers = Array.from(topology.s.servers.values()); + const loadBalancer = servers[0]; + if (options?.error == null || options?.force) { + loadBalancer.pool.checkIn(conn); + session.pinnedConnection = void 0; + conn.emit(constants_1.UNPINNED, session.transaction.state !== transactions_1.TxnState.NO_TRANSACTION ? metrics_1.ConnectionPoolMetrics.TXN : metrics_1.ConnectionPoolMetrics.CURSOR); + if (options?.forceClear) { + loadBalancer.pool.clear({ serviceId: conn.serviceId }); + } + } + } + } + function isMaxTimeMSExpiredError(err) { + if (err == null || !(err instanceof error_1.MongoServerError)) { + return false; + } + return err.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired || err.writeConcernError?.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired; + } + var ServerSession = class { + /** @internal */ + constructor(cloned) { + if (cloned != null) { + const idBytes = Buffer.allocUnsafe(16); + idBytes.set(cloned.id.id.buffer); + this.id = { id: new bson_1.Binary(idBytes, cloned.id.id.sub_type) }; + this.lastUse = cloned.lastUse; + this.txnNumber = cloned.txnNumber; + this.isDirty = cloned.isDirty; + return; + } + this.id = { id: new bson_1.Binary((0, utils_1.uuidV4)(), bson_1.Binary.SUBTYPE_UUID) }; + this.lastUse = (0, utils_1.now)(); + this.txnNumber = 0; + this.isDirty = false; + } + /** + * Determines if the server session has timed out. + * + * @param sessionTimeoutMinutes - The server's "logicalSessionTimeoutMinutes" + */ + hasTimedOut(sessionTimeoutMinutes) { + const idleTimeMinutes = Math.round((0, utils_1.calculateDurationInMs)(this.lastUse) % 864e5 % 36e5 / 6e4); + return idleTimeMinutes > sessionTimeoutMinutes - 1; + } + }; + exports2.ServerSession = ServerSession; + var ServerSessionPool = class { + constructor(client) { + if (client == null) { + throw new error_1.MongoRuntimeError("ServerSessionPool requires a MongoClient"); + } + this.client = client; + this.sessions = new utils_1.List(); + } + /** + * Acquire a Server Session from the pool. + * Iterates through each session in the pool, removing any stale sessions + * along the way. The first non-stale session found is removed from the + * pool and returned. If no non-stale session is found, a new ServerSession is created. + */ + acquire() { + const sessionTimeoutMinutes = this.client.topology?.logicalSessionTimeoutMinutes ?? 10; + let session = null; + while (this.sessions.length > 0) { + const potentialSession = this.sessions.shift(); + if (potentialSession != null && (!!this.client.topology?.loadBalanced || !potentialSession.hasTimedOut(sessionTimeoutMinutes))) { + session = potentialSession; + break; + } + } + if (session == null) { + session = new ServerSession(); + } + return session; + } + /** + * Release a session to the session pool + * Adds the session back to the session pool if the session has not timed out yet. + * This method also removes any stale sessions from the pool. + * + * @param session - The session to release to the pool + */ + release(session) { + const sessionTimeoutMinutes = this.client.topology?.logicalSessionTimeoutMinutes ?? 10; + if (this.client.topology?.loadBalanced && !sessionTimeoutMinutes) { + this.sessions.unshift(session); + } + if (!sessionTimeoutMinutes) { + return; + } + this.sessions.prune((session2) => session2.hasTimedOut(sessionTimeoutMinutes)); + if (!session.hasTimedOut(sessionTimeoutMinutes)) { + if (session.isDirty) { + return; + } + this.sessions.unshift(session); + } + } + }; + exports2.ServerSessionPool = ServerSessionPool; + function applySession(session, command, options) { + if (session.hasEnded) { + return new error_1.MongoExpiredSessionError(); + } + const serverSession = session.serverSession; + if (serverSession == null) { + return new error_1.MongoRuntimeError("Unable to acquire server session"); + } + if (options.writeConcern?.w === 0) { + if (session && session.explicit) { + return new error_1.MongoAPIError("Cannot have explicit session with unacknowledged writes"); + } + return; + } + serverSession.lastUse = (0, utils_1.now)(); + command.lsid = serverSession.id; + const inTxnOrTxnCommand = session.inTransaction() || (0, transactions_1.isTransactionCommand)(command); + const isRetryableWrite = !!options.willRetryWrite; + if (isRetryableWrite || inTxnOrTxnCommand) { + serverSession.txnNumber += session.txnNumberIncrement; + session.txnNumberIncrement = 0; + command.txnNumber = bson_1.Long.fromNumber(serverSession.txnNumber); + } + if (!inTxnOrTxnCommand) { + if (session.transaction.state !== transactions_1.TxnState.NO_TRANSACTION) { + session.transaction.transition(transactions_1.TxnState.NO_TRANSACTION); + } + if (session.supports.causalConsistency && session.operationTime && (0, utils_1.commandSupportsReadConcern)(command)) { + command.readConcern = command.readConcern || {}; + Object.assign(command.readConcern, { afterClusterTime: session.operationTime }); + } else if (session.snapshotEnabled) { + command.readConcern = command.readConcern || { level: read_concern_1.ReadConcernLevel.snapshot }; + if (session.snapshotTime != null) { + Object.assign(command.readConcern, { atClusterTime: session.snapshotTime }); + } + } + return; + } + command.autocommit = false; + if (session.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION) { + session.transaction.transition(transactions_1.TxnState.TRANSACTION_IN_PROGRESS); + command.startTransaction = true; + const readConcern = session.transaction.options.readConcern || session?.clientOptions?.readConcern; + if (readConcern) { + command.readConcern = readConcern; + } + if (session.supports.causalConsistency && session.operationTime) { + command.readConcern = command.readConcern || {}; + Object.assign(command.readConcern, { afterClusterTime: session.operationTime }); + } + } + return; + } + function updateSessionFromResponse(session, document2) { + if (document2.$clusterTime) { + (0, common_1._advanceClusterTime)(session, document2.$clusterTime); + } + if (document2.operationTime && session && session.supports.causalConsistency) { + session.advanceOperationTime(document2.operationTime); + } + if (document2.recoveryToken && session && session.inTransaction()) { + session.transaction._recoveryToken = document2.recoveryToken; + } + if (session?.snapshotEnabled && session.snapshotTime == null) { + const atClusterTime = document2.atClusterTime; + if (atClusterTime) { + session.snapshotTime = atClusterTime; + } + } + } + } +}); + +// node_modules/mongodb/lib/cmap/command_monitoring_events.js +var require_command_monitoring_events = __commonJS({ + "node_modules/mongodb/lib/cmap/command_monitoring_events.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SENSITIVE_COMMANDS = exports2.CommandFailedEvent = exports2.CommandSucceededEvent = exports2.CommandStartedEvent = void 0; + var constants_1 = require_constants2(); + var utils_1 = require_utils3(); + var commands_1 = require_commands(); + var CommandStartedEvent = class { + /** + * Create a started event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + */ + constructor(connection, command, serverConnectionId) { + this.name = constants_1.COMMAND_STARTED; + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + if (exports2.SENSITIVE_COMMANDS.has(commandName)) { + this.commandObj = {}; + this.commandObj[commandName] = true; + } + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + this.requestId = command.requestId; + this.databaseName = command.databaseName; + this.commandName = commandName; + this.command = maybeRedact(commandName, cmd, cmd); + this.serverConnectionId = serverConnectionId; + } + /* @internal */ + get hasServiceId() { + return !!this.serviceId; + } + }; + exports2.CommandStartedEvent = CommandStartedEvent; + var CommandSucceededEvent = class { + /** + * Create a succeeded event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + * @param reply - the reply for this command from the server + * @param started - a high resolution tuple timestamp of when the command was first sent, to calculate duration + */ + constructor(connection, command, reply, started, serverConnectionId) { + this.name = constants_1.COMMAND_SUCCEEDED; + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + this.requestId = command.requestId; + this.commandName = commandName; + this.duration = (0, utils_1.calculateDurationInMs)(started); + this.reply = maybeRedact(commandName, cmd, extractReply(reply)); + this.serverConnectionId = serverConnectionId; + this.databaseName = command.databaseName; + } + /* @internal */ + get hasServiceId() { + return !!this.serviceId; + } + }; + exports2.CommandSucceededEvent = CommandSucceededEvent; + var CommandFailedEvent = class { + /** + * Create a failure event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + * @param error - the generated error or a server error response + * @param started - a high resolution tuple timestamp of when the command was first sent, to calculate duration + */ + constructor(connection, command, error2, started, serverConnectionId) { + this.name = constants_1.COMMAND_FAILED; + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + this.requestId = command.requestId; + this.commandName = commandName; + this.duration = (0, utils_1.calculateDurationInMs)(started); + this.failure = maybeRedact(commandName, cmd, error2); + this.serverConnectionId = serverConnectionId; + this.databaseName = command.databaseName; + } + /* @internal */ + get hasServiceId() { + return !!this.serviceId; + } + }; + exports2.CommandFailedEvent = CommandFailedEvent; + exports2.SENSITIVE_COMMANDS = /* @__PURE__ */ new Set([ + "authenticate", + "saslStart", + "saslContinue", + "getnonce", + "createUser", + "updateUser", + "copydbgetnonce", + "copydbsaslstart", + "copydb" + ]); + var HELLO_COMMANDS = /* @__PURE__ */ new Set(["hello", constants_1.LEGACY_HELLO_COMMAND, constants_1.LEGACY_HELLO_COMMAND_CAMEL_CASE]); + var extractCommandName = (commandDoc) => Object.keys(commandDoc)[0]; + var collectionName = (command) => command.ns.split(".")[1]; + var maybeRedact = (commandName, commandDoc, result) => exports2.SENSITIVE_COMMANDS.has(commandName) || HELLO_COMMANDS.has(commandName) && commandDoc.speculativeAuthenticate ? {} : result; + var LEGACY_FIND_QUERY_MAP = { + $query: "filter", + $orderby: "sort", + $hint: "hint", + $comment: "comment", + $maxScan: "maxScan", + $max: "max", + $min: "min", + $returnKey: "returnKey", + $showDiskLoc: "showRecordId", + $maxTimeMS: "maxTimeMS", + $snapshot: "snapshot" + }; + var LEGACY_FIND_OPTIONS_MAP = { + numberToSkip: "skip", + numberToReturn: "batchSize", + returnFieldSelector: "projection" + }; + function extractCommand(command) { + if (command instanceof commands_1.OpMsgRequest) { + const cmd = { ...command.command }; + if (cmd.ops instanceof commands_1.DocumentSequence) { + cmd.ops = cmd.ops.documents; + } + if (cmd.nsInfo instanceof commands_1.DocumentSequence) { + cmd.nsInfo = cmd.nsInfo.documents; + } + return cmd; + } + if (command.query?.$query) { + let result; + if (command.ns === "admin.$cmd") { + result = Object.assign({}, command.query.$query); + } else { + result = { find: collectionName(command) }; + Object.keys(LEGACY_FIND_QUERY_MAP).forEach((key) => { + if (command.query[key] != null) { + result[LEGACY_FIND_QUERY_MAP[key]] = { ...command.query[key] }; + } + }); + } + Object.keys(LEGACY_FIND_OPTIONS_MAP).forEach((key) => { + const legacyKey = key; + if (command[legacyKey] != null) { + result[LEGACY_FIND_OPTIONS_MAP[legacyKey]] = command[legacyKey]; + } + }); + return result; + } + let clonedQuery = {}; + const clonedCommand = { ...command }; + if (command.query) { + clonedQuery = { ...command.query }; + clonedCommand.query = clonedQuery; + } + return command.query ? clonedQuery : clonedCommand; + } + function extractReply(reply) { + if (!reply) { + return reply; + } + return reply.result ? reply.result : reply; + } + function extractConnectionDetails(connection) { + let connectionId; + if ("id" in connection) { + connectionId = connection.id; + } + return { + address: connection.address, + serviceId: connection.serviceId, + connectionId + }; + } + } +}); + +// node_modules/mongodb/lib/sdam/server_description.js +var require_server_description = __commonJS({ + "node_modules/mongodb/lib/sdam/server_description.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ServerDescription = void 0; + exports2.parseServerType = parseServerType; + exports2.compareTopologyVersion = compareTopologyVersion; + var bson_1 = require_bson2(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var common_1 = require_common(); + var WRITABLE_SERVER_TYPES = /* @__PURE__ */ new Set([ + common_1.ServerType.RSPrimary, + common_1.ServerType.Standalone, + common_1.ServerType.Mongos, + common_1.ServerType.LoadBalancer + ]); + var DATA_BEARING_SERVER_TYPES = /* @__PURE__ */ new Set([ + common_1.ServerType.RSPrimary, + common_1.ServerType.RSSecondary, + common_1.ServerType.Mongos, + common_1.ServerType.Standalone, + common_1.ServerType.LoadBalancer + ]); + var ServerDescription = class { + /** + * Create a ServerDescription + * @internal + * + * @param address - The address of the server + * @param hello - An optional hello response for this server + */ + constructor(address, hello, options = {}) { + if (address == null || address === "") { + throw new error_1.MongoRuntimeError("ServerDescription must be provided with a non-empty address"); + } + this.address = typeof address === "string" ? utils_1.HostAddress.fromString(address).toString() : address.toString(); + this.type = parseServerType(hello, options); + this.hosts = hello?.hosts?.map((host) => host.toLowerCase()) ?? []; + this.passives = hello?.passives?.map((host) => host.toLowerCase()) ?? []; + this.arbiters = hello?.arbiters?.map((host) => host.toLowerCase()) ?? []; + this.tags = hello?.tags ?? {}; + this.minWireVersion = hello?.minWireVersion ?? 0; + this.maxWireVersion = hello?.maxWireVersion ?? 0; + this.roundTripTime = options?.roundTripTime ?? -1; + this.minRoundTripTime = options?.minRoundTripTime ?? 0; + this.lastUpdateTime = (0, utils_1.now)(); + this.lastWriteDate = hello?.lastWrite?.lastWriteDate ?? 0; + this.error = options.error ?? null; + this.error?.stack; + this.topologyVersion = this.error?.topologyVersion ?? hello?.topologyVersion ?? null; + this.setName = hello?.setName ?? null; + this.setVersion = hello?.setVersion ?? null; + this.electionId = hello?.electionId ?? null; + this.logicalSessionTimeoutMinutes = hello?.logicalSessionTimeoutMinutes ?? null; + this.maxMessageSizeBytes = hello?.maxMessageSizeBytes ?? null; + this.maxWriteBatchSize = hello?.maxWriteBatchSize ?? null; + this.maxBsonObjectSize = hello?.maxBsonObjectSize ?? null; + this.primary = hello?.primary ?? null; + this.me = hello?.me?.toLowerCase() ?? null; + this.$clusterTime = hello?.$clusterTime ?? null; + this.iscryptd = Boolean(hello?.iscryptd); + } + get hostAddress() { + return utils_1.HostAddress.fromString(this.address); + } + get allHosts() { + return this.hosts.concat(this.arbiters).concat(this.passives); + } + /** Is this server available for reads*/ + get isReadable() { + return this.type === common_1.ServerType.RSSecondary || this.isWritable; + } + /** Is this server data bearing */ + get isDataBearing() { + return DATA_BEARING_SERVER_TYPES.has(this.type); + } + /** Is this server available for writes */ + get isWritable() { + return WRITABLE_SERVER_TYPES.has(this.type); + } + get host() { + const chopLength = `:${this.port}`.length; + return this.address.slice(0, -chopLength); + } + get port() { + const port = this.address.split(":").pop(); + return port ? Number.parseInt(port, 10) : 27017; + } + /** + * Determines if another `ServerDescription` is equal to this one per the rules defined in the SDAM specification. + * @see https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md + */ + equals(other) { + const topologyVersionsEqual = this.topologyVersion === other?.topologyVersion || compareTopologyVersion(this.topologyVersion, other?.topologyVersion) === 0; + const electionIdsEqual = this.electionId != null && other?.electionId != null ? (0, utils_1.compareObjectId)(this.electionId, other.electionId) === 0 : this.electionId === other?.electionId; + return other != null && other.iscryptd === this.iscryptd && (0, utils_1.errorStrictEqual)(this.error, other.error) && this.type === other.type && this.minWireVersion === other.minWireVersion && (0, utils_1.arrayStrictEqual)(this.hosts, other.hosts) && tagsStrictEqual(this.tags, other.tags) && this.setName === other.setName && this.setVersion === other.setVersion && electionIdsEqual && this.primary === other.primary && this.logicalSessionTimeoutMinutes === other.logicalSessionTimeoutMinutes && topologyVersionsEqual; + } + }; + exports2.ServerDescription = ServerDescription; + function parseServerType(hello, options) { + if (options?.loadBalanced) { + return common_1.ServerType.LoadBalancer; + } + if (!hello || !hello.ok) { + return common_1.ServerType.Unknown; + } + if (hello.isreplicaset) { + return common_1.ServerType.RSGhost; + } + if (hello.msg && hello.msg === "isdbgrid") { + return common_1.ServerType.Mongos; + } + if (hello.setName) { + if (hello.hidden) { + return common_1.ServerType.RSOther; + } else if (hello.isWritablePrimary) { + return common_1.ServerType.RSPrimary; + } else if (hello.secondary) { + return common_1.ServerType.RSSecondary; + } else if (hello.arbiterOnly) { + return common_1.ServerType.RSArbiter; + } else { + return common_1.ServerType.RSOther; + } + } + return common_1.ServerType.Standalone; + } + function tagsStrictEqual(tags, tags2) { + const tagsKeys = Object.keys(tags); + const tags2Keys = Object.keys(tags2); + return tagsKeys.length === tags2Keys.length && tagsKeys.every((key) => tags2[key] === tags[key]); + } + function compareTopologyVersion(currentTv, newTv) { + if (currentTv == null || newTv == null) { + return -1; + } + if (!currentTv.processId.equals(newTv.processId)) { + return -1; + } + const currentCounter = typeof currentTv.counter === "bigint" ? bson_1.Long.fromBigInt(currentTv.counter) : bson_1.Long.isLong(currentTv.counter) ? currentTv.counter : bson_1.Long.fromNumber(currentTv.counter); + const newCounter = typeof newTv.counter === "bigint" ? bson_1.Long.fromBigInt(newTv.counter) : bson_1.Long.isLong(newTv.counter) ? newTv.counter : bson_1.Long.fromNumber(newTv.counter); + return currentCounter.compare(newCounter); + } + } +}); + +// node_modules/mongodb/lib/cmap/stream_description.js +var require_stream_description = __commonJS({ + "node_modules/mongodb/lib/cmap/stream_description.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.StreamDescription = void 0; + var bson_1 = require_bson2(); + var common_1 = require_common(); + var server_description_1 = require_server_description(); + var RESPONSE_FIELDS = [ + "minWireVersion", + "maxWireVersion", + "maxBsonObjectSize", + "maxMessageSizeBytes", + "maxWriteBatchSize", + "logicalSessionTimeoutMinutes" + ]; + var StreamDescription = class { + constructor(address, options) { + this.hello = null; + this.address = address; + this.type = common_1.ServerType.Unknown; + this.minWireVersion = void 0; + this.maxWireVersion = void 0; + this.maxBsonObjectSize = 16777216; + this.maxMessageSizeBytes = 48e6; + this.maxWriteBatchSize = 1e5; + this.logicalSessionTimeoutMinutes = options?.logicalSessionTimeoutMinutes; + this.loadBalanced = !!options?.loadBalanced; + this.compressors = options && options.compressors && Array.isArray(options.compressors) ? options.compressors : []; + this.serverConnectionId = null; + } + receiveResponse(response) { + if (response == null) { + return; + } + this.hello = response; + this.type = (0, server_description_1.parseServerType)(response); + if ("connectionId" in response) { + this.serverConnectionId = this.parseServerConnectionID(response.connectionId); + } else { + this.serverConnectionId = null; + } + for (const field of RESPONSE_FIELDS) { + if (response[field] != null) { + this[field] = response[field]; + } + if ("__nodejs_mock_server__" in response) { + this.__nodejs_mock_server__ = response["__nodejs_mock_server__"]; + } + } + if (response.compression) { + this.compressor = this.compressors.filter((c4) => response.compression?.includes(c4))[0]; + } + } + /* @internal */ + parseServerConnectionID(serverConnectionId) { + return bson_1.Long.isLong(serverConnectionId) ? serverConnectionId.toBigInt() : ( + // @ts-expect-error: Doubles are coercible to number + BigInt(serverConnectionId) + ); + } + }; + exports2.StreamDescription = StreamDescription; + } +}); + +// node_modules/mongodb/lib/cmap/wire_protocol/on_data.js +var require_on_data = __commonJS({ + "node_modules/mongodb/lib/cmap/wire_protocol/on_data.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.onData = onData; + var utils_1 = require_utils3(); + function onData(emitter, { timeoutContext, signal }) { + signal?.throwIfAborted(); + const unconsumedEvents = new utils_1.List(); + const unconsumedPromises = new utils_1.List(); + let error2 = null; + let finished = false; + const iterator = { + next() { + const value = unconsumedEvents.shift(); + if (value != null) { + return Promise.resolve({ value, done: false }); + } + if (error2 != null) { + const p4 = Promise.reject(error2); + error2 = null; + return p4; + } + if (finished) + return closeHandler(); + const { promise, resolve, reject } = (0, utils_1.promiseWithResolvers)(); + unconsumedPromises.push({ resolve, reject }); + return promise; + }, + return() { + return closeHandler(); + }, + throw(err) { + errorHandler(err); + return Promise.resolve({ value: void 0, done: true }); + }, + [Symbol.asyncIterator]() { + return this; + }, + // Note this should currently not be used, but is required by the AsyncGenerator interface. + async [Symbol.asyncDispose]() { + await closeHandler(); + } + }; + emitter.on("data", eventHandler); + emitter.on("error", errorHandler); + const abortListener = (0, utils_1.addAbortListener)(signal, function() { + errorHandler(this.reason); + }); + const timeoutForSocketRead = timeoutContext?.timeoutForSocketRead; + timeoutForSocketRead?.throwIfExpired(); + timeoutForSocketRead?.then(void 0, errorHandler); + return iterator; + function eventHandler(value) { + const promise = unconsumedPromises.shift(); + if (promise != null) + promise.resolve({ value, done: false }); + else + unconsumedEvents.push(value); + } + function errorHandler(err) { + const promise = unconsumedPromises.shift(); + if (promise != null) + promise.reject(err); + else + error2 = err; + void closeHandler(); + } + function closeHandler() { + emitter.off("data", eventHandler); + emitter.off("error", errorHandler); + abortListener?.[utils_1.kDispose](); + finished = true; + timeoutForSocketRead?.clear(); + const doneResult = { value: void 0, done: finished }; + for (const promise of unconsumedPromises) { + promise.resolve(doneResult); + } + return Promise.resolve(doneResult); + } + } + } +}); + +// node_modules/mongodb/lib/sdam/topology_description.js +var require_topology_description = __commonJS({ + "node_modules/mongodb/lib/sdam/topology_description.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.TopologyDescription = void 0; + var bson_1 = require_bson2(); + var WIRE_CONSTANTS = require_constants(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var common_1 = require_common(); + var server_description_1 = require_server_description(); + var MIN_SUPPORTED_SERVER_VERSION = WIRE_CONSTANTS.MIN_SUPPORTED_SERVER_VERSION; + var MAX_SUPPORTED_SERVER_VERSION = WIRE_CONSTANTS.MAX_SUPPORTED_SERVER_VERSION; + var MIN_SUPPORTED_WIRE_VERSION = WIRE_CONSTANTS.MIN_SUPPORTED_WIRE_VERSION; + var MAX_SUPPORTED_WIRE_VERSION = WIRE_CONSTANTS.MAX_SUPPORTED_WIRE_VERSION; + var MONGOS_OR_UNKNOWN = /* @__PURE__ */ new Set([common_1.ServerType.Mongos, common_1.ServerType.Unknown]); + var MONGOS_OR_STANDALONE = /* @__PURE__ */ new Set([common_1.ServerType.Mongos, common_1.ServerType.Standalone]); + var NON_PRIMARY_RS_MEMBERS = /* @__PURE__ */ new Set([ + common_1.ServerType.RSSecondary, + common_1.ServerType.RSArbiter, + common_1.ServerType.RSOther + ]); + var TopologyDescription = class _TopologyDescription { + /** + * Create a TopologyDescription + */ + constructor(topologyType, serverDescriptions = null, setName = null, maxSetVersion = null, maxElectionId = null, commonWireVersion = null, options = null) { + options = options ?? {}; + this.type = topologyType ?? common_1.TopologyType.Unknown; + this.servers = serverDescriptions ?? /* @__PURE__ */ new Map(); + this.stale = false; + this.compatible = true; + this.heartbeatFrequencyMS = options.heartbeatFrequencyMS ?? 0; + this.localThresholdMS = options.localThresholdMS ?? 15; + this.setName = setName ?? null; + this.maxElectionId = maxElectionId ?? null; + this.maxSetVersion = maxSetVersion ?? null; + this.commonWireVersion = commonWireVersion ?? 0; + for (const serverDescription of this.servers.values()) { + if (serverDescription.type === common_1.ServerType.Unknown || serverDescription.type === common_1.ServerType.LoadBalancer) { + continue; + } + if (serverDescription.minWireVersion > MAX_SUPPORTED_WIRE_VERSION) { + this.compatible = false; + this.compatibilityError = `Server at ${serverDescription.address} requires wire version ${serverDescription.minWireVersion}, but this version of the driver only supports up to ${MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${MAX_SUPPORTED_SERVER_VERSION})`; + } + if (serverDescription.maxWireVersion < MIN_SUPPORTED_WIRE_VERSION) { + this.compatible = false; + this.compatibilityError = `Server at ${serverDescription.address} reports wire version ${serverDescription.maxWireVersion}, but this version of the driver requires at least ${MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${MIN_SUPPORTED_SERVER_VERSION}).`; + break; + } + } + this.logicalSessionTimeoutMinutes = null; + for (const [, server] of this.servers) { + if (server.isReadable) { + if (server.logicalSessionTimeoutMinutes == null) { + this.logicalSessionTimeoutMinutes = null; + break; + } + if (this.logicalSessionTimeoutMinutes == null) { + this.logicalSessionTimeoutMinutes = server.logicalSessionTimeoutMinutes; + continue; + } + this.logicalSessionTimeoutMinutes = Math.min(this.logicalSessionTimeoutMinutes, server.logicalSessionTimeoutMinutes); + } + } + } + /** + * Returns a new TopologyDescription based on the SrvPollingEvent + * @internal + */ + updateFromSrvPollingEvent(ev, srvMaxHosts = 0) { + const incomingHostnames = ev.hostnames(); + const currentHostnames = new Set(this.servers.keys()); + const hostnamesToAdd = new Set(incomingHostnames); + const hostnamesToRemove = /* @__PURE__ */ new Set(); + for (const hostname of currentHostnames) { + hostnamesToAdd.delete(hostname); + if (!incomingHostnames.has(hostname)) { + hostnamesToRemove.add(hostname); + } + } + if (hostnamesToAdd.size === 0 && hostnamesToRemove.size === 0) { + return this; + } + const serverDescriptions = new Map(this.servers); + for (const removedHost of hostnamesToRemove) { + serverDescriptions.delete(removedHost); + } + if (hostnamesToAdd.size > 0) { + if (srvMaxHosts === 0) { + for (const hostToAdd of hostnamesToAdd) { + serverDescriptions.set(hostToAdd, new server_description_1.ServerDescription(hostToAdd)); + } + } else if (serverDescriptions.size < srvMaxHosts) { + const selectedHosts = (0, utils_1.shuffle)(hostnamesToAdd, srvMaxHosts - serverDescriptions.size); + for (const selectedHostToAdd of selectedHosts) { + serverDescriptions.set(selectedHostToAdd, new server_description_1.ServerDescription(selectedHostToAdd)); + } + } + } + return new _TopologyDescription(this.type, serverDescriptions, this.setName, this.maxSetVersion, this.maxElectionId, this.commonWireVersion, { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS }); + } + /** + * Returns a copy of this description updated with a given ServerDescription + * @internal + */ + update(serverDescription) { + const address = serverDescription.address; + let { type: topologyType, setName, maxSetVersion, maxElectionId, commonWireVersion } = this; + const serverType = serverDescription.type; + const serverDescriptions = new Map(this.servers); + if (serverDescription.maxWireVersion !== 0) { + if (commonWireVersion == null) { + commonWireVersion = serverDescription.maxWireVersion; + } else { + commonWireVersion = Math.min(commonWireVersion, serverDescription.maxWireVersion); + } + } + if (typeof serverDescription.setName === "string" && typeof setName === "string" && serverDescription.setName !== setName) { + if (topologyType === common_1.TopologyType.Single) { + serverDescription = new server_description_1.ServerDescription(address); + } else { + serverDescriptions.delete(address); + } + } + serverDescriptions.set(address, serverDescription); + if (topologyType === common_1.TopologyType.Single) { + return new _TopologyDescription(common_1.TopologyType.Single, serverDescriptions, setName, maxSetVersion, maxElectionId, commonWireVersion, { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS }); + } + if (topologyType === common_1.TopologyType.Unknown) { + if (serverType === common_1.ServerType.Standalone && this.servers.size !== 1) { + serverDescriptions.delete(address); + } else { + topologyType = topologyTypeForServerType(serverType); + } + } + if (topologyType === common_1.TopologyType.Sharded) { + if (!MONGOS_OR_UNKNOWN.has(serverType)) { + serverDescriptions.delete(address); + } + } + if (topologyType === common_1.TopologyType.ReplicaSetNoPrimary) { + if (MONGOS_OR_STANDALONE.has(serverType)) { + serverDescriptions.delete(address); + } + if (serverType === common_1.ServerType.RSPrimary) { + const result = updateRsFromPrimary(serverDescriptions, serverDescription, setName, maxSetVersion, maxElectionId); + topologyType = result[0]; + setName = result[1]; + maxSetVersion = result[2]; + maxElectionId = result[3]; + } else if (NON_PRIMARY_RS_MEMBERS.has(serverType)) { + const result = updateRsNoPrimaryFromMember(serverDescriptions, serverDescription, setName); + topologyType = result[0]; + setName = result[1]; + } + } + if (topologyType === common_1.TopologyType.ReplicaSetWithPrimary) { + if (MONGOS_OR_STANDALONE.has(serverType)) { + serverDescriptions.delete(address); + topologyType = checkHasPrimary(serverDescriptions); + } else if (serverType === common_1.ServerType.RSPrimary) { + const result = updateRsFromPrimary(serverDescriptions, serverDescription, setName, maxSetVersion, maxElectionId); + topologyType = result[0]; + setName = result[1]; + maxSetVersion = result[2]; + maxElectionId = result[3]; + } else if (NON_PRIMARY_RS_MEMBERS.has(serverType)) { + topologyType = updateRsWithPrimaryFromMember(serverDescriptions, serverDescription, setName); + } else { + topologyType = checkHasPrimary(serverDescriptions); + } + } + return new _TopologyDescription(topologyType, serverDescriptions, setName, maxSetVersion, maxElectionId, commonWireVersion, { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS }); + } + get error() { + const descriptionsWithError = Array.from(this.servers.values()).filter((sd) => sd.error); + if (descriptionsWithError.length > 0) { + return descriptionsWithError[0].error; + } + return null; + } + /** + * Determines if the topology description has any known servers + */ + get hasKnownServers() { + return Array.from(this.servers.values()).some((sd) => sd.type !== common_1.ServerType.Unknown); + } + /** + * Determines if this topology description has a data-bearing server available. + */ + get hasDataBearingServers() { + return Array.from(this.servers.values()).some((sd) => sd.isDataBearing); + } + /** + * Determines if the topology has a definition for the provided address + * @internal + */ + hasServer(address) { + return this.servers.has(address); + } + /** + * Returns a JSON-serializable representation of the TopologyDescription. This is primarily + * intended for use with JSON.stringify(). + * + * This method will not throw. + */ + toJSON() { + return bson_1.EJSON.serialize(this); + } + }; + exports2.TopologyDescription = TopologyDescription; + function topologyTypeForServerType(serverType) { + switch (serverType) { + case common_1.ServerType.Standalone: + return common_1.TopologyType.Single; + case common_1.ServerType.Mongos: + return common_1.TopologyType.Sharded; + case common_1.ServerType.RSPrimary: + return common_1.TopologyType.ReplicaSetWithPrimary; + case common_1.ServerType.RSOther: + case common_1.ServerType.RSSecondary: + return common_1.TopologyType.ReplicaSetNoPrimary; + default: + return common_1.TopologyType.Unknown; + } + } + function updateRsFromPrimary(serverDescriptions, serverDescription, setName = null, maxSetVersion = null, maxElectionId = null) { + const setVersionElectionIdMismatch = (serverDescription2, maxSetVersion2, maxElectionId2) => { + return `primary marked stale due to electionId/setVersion mismatch: server setVersion: ${serverDescription2.setVersion}, server electionId: ${serverDescription2.electionId}, topology setVersion: ${maxSetVersion2}, topology electionId: ${maxElectionId2}`; + }; + setName = setName || serverDescription.setName; + if (setName !== serverDescription.setName) { + serverDescriptions.delete(serverDescription.address); + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; + } + if (serverDescription.maxWireVersion >= 17) { + const electionIdComparison = (0, utils_1.compareObjectId)(maxElectionId, serverDescription.electionId); + const maxElectionIdIsEqual = electionIdComparison === 0; + const maxElectionIdIsLess = electionIdComparison === -1; + const maxSetVersionIsLessOrEqual = (maxSetVersion ?? -1) <= (serverDescription.setVersion ?? -1); + if (maxElectionIdIsLess || maxElectionIdIsEqual && maxSetVersionIsLessOrEqual) { + maxElectionId = serverDescription.electionId; + maxSetVersion = serverDescription.setVersion; + } else { + serverDescriptions.set(serverDescription.address, new server_description_1.ServerDescription(serverDescription.address, void 0, { + error: new error_1.MongoStalePrimaryError(setVersionElectionIdMismatch(serverDescription, maxSetVersion, maxElectionId)) + })); + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; + } + } else { + const electionId = serverDescription.electionId ? serverDescription.electionId : null; + if (serverDescription.setVersion && electionId) { + if (maxSetVersion && maxElectionId) { + if (maxSetVersion > serverDescription.setVersion || (0, utils_1.compareObjectId)(maxElectionId, electionId) > 0) { + serverDescriptions.set(serverDescription.address, new server_description_1.ServerDescription(serverDescription.address, void 0, { + error: new error_1.MongoStalePrimaryError(setVersionElectionIdMismatch(serverDescription, maxSetVersion, maxElectionId)) + })); + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; + } + } + maxElectionId = serverDescription.electionId; + } + if (serverDescription.setVersion != null && (maxSetVersion == null || serverDescription.setVersion > maxSetVersion)) { + maxSetVersion = serverDescription.setVersion; + } + } + for (const [address, server] of serverDescriptions) { + if (server.type === common_1.ServerType.RSPrimary && server.address !== serverDescription.address) { + serverDescriptions.set(address, new server_description_1.ServerDescription(server.address, void 0, { + error: new error_1.MongoStalePrimaryError("primary marked stale due to discovery of newer primary") + })); + break; + } + } + serverDescription.allHosts.forEach((address) => { + if (!serverDescriptions.has(address)) { + serverDescriptions.set(address, new server_description_1.ServerDescription(address)); + } + }); + const currentAddresses = Array.from(serverDescriptions.keys()); + const responseAddresses = serverDescription.allHosts; + currentAddresses.filter((addr) => responseAddresses.indexOf(addr) === -1).forEach((address) => { + serverDescriptions.delete(address); + }); + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; + } + function updateRsWithPrimaryFromMember(serverDescriptions, serverDescription, setName = null) { + if (setName == null) { + throw new error_1.MongoRuntimeError('Argument "setName" is required if connected to a replica set'); + } + if (setName !== serverDescription.setName || serverDescription.me && serverDescription.address !== serverDescription.me) { + serverDescriptions.delete(serverDescription.address); + } + return checkHasPrimary(serverDescriptions); + } + function updateRsNoPrimaryFromMember(serverDescriptions, serverDescription, setName = null) { + const topologyType = common_1.TopologyType.ReplicaSetNoPrimary; + setName = setName ?? serverDescription.setName; + if (setName !== serverDescription.setName) { + serverDescriptions.delete(serverDescription.address); + return [topologyType, setName]; + } + serverDescription.allHosts.forEach((address) => { + if (!serverDescriptions.has(address)) { + serverDescriptions.set(address, new server_description_1.ServerDescription(address)); + } + }); + if (serverDescription.me && serverDescription.address !== serverDescription.me) { + serverDescriptions.delete(serverDescription.address); + } + return [topologyType, setName]; + } + function checkHasPrimary(serverDescriptions) { + for (const serverDescription of serverDescriptions.values()) { + if (serverDescription.type === common_1.ServerType.RSPrimary) { + return common_1.TopologyType.ReplicaSetWithPrimary; + } + } + return common_1.TopologyType.ReplicaSetNoPrimary; + } + } +}); + +// node_modules/mongodb/lib/cmap/wire_protocol/shared.js +var require_shared = __commonJS({ + "node_modules/mongodb/lib/cmap/wire_protocol/shared.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getReadPreference = getReadPreference; + exports2.isSharded = isSharded; + var error_1 = require_error(); + var read_preference_1 = require_read_preference(); + var common_1 = require_common(); + var topology_description_1 = require_topology_description(); + function getReadPreference(options) { + let readPreference = options?.readPreference ?? read_preference_1.ReadPreference.primary; + if (typeof readPreference === "string") { + readPreference = read_preference_1.ReadPreference.fromString(readPreference); + } + if (!(readPreference instanceof read_preference_1.ReadPreference)) { + throw new error_1.MongoInvalidArgumentError('Option "readPreference" must be a ReadPreference instance'); + } + return readPreference; + } + function isSharded(topologyOrServer) { + if (topologyOrServer == null) { + return false; + } + if (topologyOrServer.description && topologyOrServer.description.type === common_1.ServerType.Mongos) { + return true; + } + if (topologyOrServer.description && topologyOrServer.description instanceof topology_description_1.TopologyDescription) { + const servers = Array.from(topologyOrServer.description.servers.values()); + return servers.some((server) => server.type === common_1.ServerType.Mongos); + } + return false; + } + } +}); + +// node_modules/mongodb/lib/cmap/connection.js +var require_connection = __commonJS({ + "node_modules/mongodb/lib/cmap/connection.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.CryptoConnection = exports2.SizedMessageTransform = exports2.Connection = void 0; + exports2.hasSessionSupport = hasSessionSupport; + var stream_1 = require("stream"); + var timers_1 = require("timers"); + var bson_1 = require_bson2(); + var constants_1 = require_constants2(); + var error_1 = require_error(); + var mongo_logger_1 = require_mongo_logger(); + var mongo_types_1 = require_mongo_types(); + var read_preference_1 = require_read_preference(); + var common_1 = require_common(); + var sessions_1 = require_sessions(); + var timeout_1 = require_timeout(); + var utils_1 = require_utils3(); + var command_monitoring_events_1 = require_command_monitoring_events(); + var commands_1 = require_commands(); + var stream_description_1 = require_stream_description(); + var compression_1 = require_compression(); + var on_data_1 = require_on_data(); + var responses_1 = require_responses(); + var shared_1 = require_shared(); + function hasSessionSupport(conn) { + const description = conn.description; + return description.logicalSessionTimeoutMinutes != null; + } + function streamIdentifier(stream, options) { + if (options.proxyHost) { + return options.hostAddress.toString(); + } + const { remoteAddress, remotePort } = stream; + if (typeof remoteAddress === "string" && typeof remotePort === "number") { + return utils_1.HostAddress.fromHostPort(remoteAddress, remotePort).toString(); + } + return (0, utils_1.uuidV4)().toString("hex"); + } + var Connection = class _Connection extends mongo_types_1.TypedEventEmitter { + constructor(stream, options) { + super(); + this.lastHelloMS = -1; + this.helloOk = false; + this.delayedTimeoutId = null; + this.closed = false; + this.clusterTime = null; + this.error = null; + this.dataEvents = null; + this.on("error", utils_1.noop); + this.socket = stream; + this.id = options.id; + this.address = streamIdentifier(stream, options); + this.socketTimeoutMS = options.socketTimeoutMS ?? 0; + this.monitorCommands = options.monitorCommands; + this.serverApi = options.serverApi; + this.mongoLogger = options.mongoLogger; + this.established = false; + this.description = new stream_description_1.StreamDescription(this.address, options); + this.generation = options.generation; + this.lastUseTime = (0, utils_1.now)(); + this.messageStream = this.socket.on("error", this.onSocketError.bind(this)).pipe(new SizedMessageTransform({ connection: this })).on("error", this.onTransformError.bind(this)); + this.socket.on("close", this.onClose.bind(this)); + this.socket.on("timeout", this.onTimeout.bind(this)); + this.messageStream.pause(); + } + get hello() { + return this.description.hello; + } + // the `connect` method stores the result of the handshake hello on the connection + set hello(response) { + this.description.receiveResponse(response); + Object.freeze(this.description); + } + get serviceId() { + return this.hello?.serviceId; + } + get loadBalanced() { + return this.description.loadBalanced; + } + get idleTime() { + return (0, utils_1.calculateDurationInMs)(this.lastUseTime); + } + get hasSessionSupport() { + return this.description.logicalSessionTimeoutMinutes != null; + } + get supportsOpMsg() { + return this.description != null && // TODO(NODE-6672,NODE-6287): This guard is primarily for maxWireVersion = 0 + (0, utils_1.maxWireVersion)(this) >= 6 && !this.description.__nodejs_mock_server__; + } + get shouldEmitAndLogCommand() { + return (this.monitorCommands || this.established && !this.authContext?.reauthenticating && this.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.COMMAND, mongo_logger_1.SeverityLevel.DEBUG)) ?? false; + } + markAvailable() { + this.lastUseTime = (0, utils_1.now)(); + } + onSocketError(cause) { + this.onError(new error_1.MongoNetworkError(cause.message, { cause })); + } + onTransformError(error2) { + this.onError(error2); + } + onError(error2) { + this.cleanup(error2); + } + onClose() { + const message2 = `connection ${this.id} to ${this.address} closed`; + this.cleanup(new error_1.MongoNetworkError(message2)); + } + onTimeout() { + this.delayedTimeoutId = (0, timers_1.setTimeout)(() => { + const message2 = `connection ${this.id} to ${this.address} timed out`; + const beforeHandshake = this.hello == null; + this.cleanup(new error_1.MongoNetworkTimeoutError(message2, { beforeHandshake })); + }, 1).unref(); + } + destroy() { + if (this.closed) { + return; + } + this.removeAllListeners(_Connection.PINNED); + this.removeAllListeners(_Connection.UNPINNED); + const message2 = `connection ${this.id} to ${this.address} closed`; + this.cleanup(new error_1.MongoNetworkError(message2)); + } + /** + * A method that cleans up the connection. When `force` is true, this method + * forcibly destroys the socket. + * + * If an error is provided, any in-flight operations will be closed with the error. + * + * This method does nothing if the connection is already closed. + */ + cleanup(error2) { + if (this.closed) { + return; + } + this.socket.destroy(); + this.error = error2; + this.dataEvents?.throw(error2).then(void 0, utils_1.squashError); + this.closed = true; + this.emit(_Connection.CLOSE); + } + prepareCommand(db, command, options) { + let cmd = { ...command }; + const readPreference = (0, shared_1.getReadPreference)(options); + const session = options?.session; + let clusterTime = this.clusterTime; + if (this.serverApi) { + const { version, strict, deprecationErrors } = this.serverApi; + cmd.apiVersion = version; + if (strict != null) + cmd.apiStrict = strict; + if (deprecationErrors != null) + cmd.apiDeprecationErrors = deprecationErrors; + } + if (this.hasSessionSupport && session) { + if (session.clusterTime && clusterTime && session.clusterTime.clusterTime.greaterThan(clusterTime.clusterTime)) { + clusterTime = session.clusterTime; + } + const sessionError = (0, sessions_1.applySession)(session, cmd, options); + if (sessionError) + throw sessionError; + } else if (session?.explicit) { + throw new error_1.MongoCompatibilityError("Current topology does not support sessions"); + } + if (clusterTime) { + cmd.$clusterTime = clusterTime; + } + if (this.description.type !== common_1.ServerType.Standalone) { + if (!(0, shared_1.isSharded)(this) && !this.description.loadBalanced && this.supportsOpMsg && options.directConnection === true && readPreference?.mode === "primary") { + cmd.$readPreference = read_preference_1.ReadPreference.primaryPreferred.toJSON(); + } else if ((0, shared_1.isSharded)(this) && !this.supportsOpMsg && readPreference?.mode !== "primary") { + cmd = { + $query: cmd, + $readPreference: readPreference.toJSON() + }; + } else if (readPreference?.mode !== "primary") { + cmd.$readPreference = readPreference.toJSON(); + } + } + const commandOptions = { + numberToSkip: 0, + numberToReturn: -1, + checkKeys: false, + // This value is not overridable + secondaryOk: readPreference.secondaryOk(), + ...options + }; + options.timeoutContext?.addMaxTimeMSToCommand(cmd, options); + const message2 = this.supportsOpMsg ? new commands_1.OpMsgRequest(db, cmd, commandOptions) : new commands_1.OpQueryRequest(db, cmd, commandOptions); + return message2; + } + async *sendWire(message2, options, responseType) { + this.throwIfAborted(); + const timeout = options.socketTimeoutMS ?? options?.timeoutContext?.getSocketTimeoutMS() ?? this.socketTimeoutMS; + this.socket.setTimeout(timeout); + try { + await this.writeCommand(message2, { + agreedCompressor: this.description.compressor ?? "none", + zlibCompressionLevel: this.description.zlibCompressionLevel, + timeoutContext: options.timeoutContext, + signal: options.signal + }); + if (options.noResponse || message2.moreToCome) { + yield responses_1.MongoDBResponse.empty; + return; + } + this.throwIfAborted(); + if (options.timeoutContext?.csotEnabled() && options.timeoutContext.minRoundTripTime != null && options.timeoutContext.remainingTimeMS < options.timeoutContext.minRoundTripTime) { + throw new error_1.MongoOperationTimeoutError("Server roundtrip time is greater than the time remaining"); + } + for await (const response of this.readMany(options)) { + this.socket.setTimeout(0); + const bson = response.parse(); + const document2 = (responseType ?? responses_1.MongoDBResponse).make(bson); + yield document2; + this.throwIfAborted(); + this.socket.setTimeout(timeout); + } + } finally { + this.socket.setTimeout(0); + } + } + async *sendCommand(ns, command, options, responseType) { + options?.signal?.throwIfAborted(); + const message2 = this.prepareCommand(ns.db, command, options); + let started = 0; + if (this.shouldEmitAndLogCommand) { + started = (0, utils_1.now)(); + this.emitAndLogCommand(this.monitorCommands, _Connection.COMMAND_STARTED, message2.databaseName, this.established, new command_monitoring_events_1.CommandStartedEvent(this, message2, this.description.serverConnectionId)); + } + const bsonOptions = options.documentsReturnedIn == null || !options.raw ? options : { + ...options, + raw: false, + fieldsAsRaw: { [options.documentsReturnedIn]: true } + }; + let document2 = void 0; + let object = void 0; + try { + this.throwIfAborted(); + for await (document2 of this.sendWire(message2, options, responseType)) { + object = void 0; + if (options.session != null) { + (0, sessions_1.updateSessionFromResponse)(options.session, document2); + } + if (document2.$clusterTime) { + this.clusterTime = document2.$clusterTime; + this.emit(_Connection.CLUSTER_TIME_RECEIVED, document2.$clusterTime); + } + if (document2.ok === 0) { + if (options.timeoutContext?.csotEnabled() && document2.isMaxTimeExpiredError) { + throw new error_1.MongoOperationTimeoutError("Server reported a timeout error", { + cause: new error_1.MongoServerError(object ??= document2.toObject(bsonOptions)) + }); + } + throw new error_1.MongoServerError(object ??= document2.toObject(bsonOptions)); + } + if (this.shouldEmitAndLogCommand) { + this.emitAndLogCommand(this.monitorCommands, _Connection.COMMAND_SUCCEEDED, message2.databaseName, this.established, new command_monitoring_events_1.CommandSucceededEvent(this, message2, options.noResponse ? void 0 : message2.moreToCome ? { ok: 1 } : object ??= document2.toObject(bsonOptions), started, this.description.serverConnectionId)); + } + if (responseType == null) { + yield object ??= document2.toObject(bsonOptions); + } else { + yield document2; + } + this.throwIfAborted(); + } + } catch (error2) { + if (this.shouldEmitAndLogCommand) { + this.emitAndLogCommand(this.monitorCommands, _Connection.COMMAND_FAILED, message2.databaseName, this.established, new command_monitoring_events_1.CommandFailedEvent(this, message2, error2, started, this.description.serverConnectionId)); + } + throw error2; + } + } + async command(ns, command, options = {}, responseType) { + this.throwIfAborted(); + options.signal?.throwIfAborted(); + for await (const document2 of this.sendCommand(ns, command, options, responseType)) { + if (options.timeoutContext?.csotEnabled()) { + if (responses_1.MongoDBResponse.is(document2)) { + if (document2.isMaxTimeExpiredError) { + throw new error_1.MongoOperationTimeoutError("Server reported a timeout error", { + cause: new error_1.MongoServerError(document2.toObject()) + }); + } + } else { + if (Array.isArray(document2?.writeErrors) && document2.writeErrors.some((error2) => error2?.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired) || document2?.writeConcernError?.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired) { + throw new error_1.MongoOperationTimeoutError("Server reported a timeout error", { + cause: new error_1.MongoServerError(document2) + }); + } + } + } + return document2; + } + throw new error_1.MongoUnexpectedServerResponseError("Unable to get response from server"); + } + exhaustCommand(ns, command, options, replyListener) { + const exhaustLoop = async () => { + this.throwIfAborted(); + for await (const reply of this.sendCommand(ns, command, options)) { + replyListener(void 0, reply); + this.throwIfAborted(); + } + throw new error_1.MongoUnexpectedServerResponseError("Server ended moreToCome unexpectedly"); + }; + exhaustLoop().then(void 0, replyListener); + } + throwIfAborted() { + if (this.error) + throw this.error; + } + /** + * @internal + * + * Writes an OP_MSG or OP_QUERY request to the socket, optionally compressing the command. This method + * waits until the socket's buffer has emptied (the Nodejs socket `drain` event has fired). + */ + async writeCommand(command, options) { + const finalCommand = options.agreedCompressor === "none" || !commands_1.OpCompressedRequest.canCompress(command) ? command : new commands_1.OpCompressedRequest(command, { + agreedCompressor: options.agreedCompressor ?? "none", + zlibCompressionLevel: options.zlibCompressionLevel ?? 0 + }); + const buffer = Buffer.concat(await finalCommand.toBin()); + if (options.timeoutContext?.csotEnabled()) { + if (options.timeoutContext.minRoundTripTime != null && options.timeoutContext.remainingTimeMS < options.timeoutContext.minRoundTripTime) { + throw new error_1.MongoOperationTimeoutError("Server roundtrip time is greater than the time remaining"); + } + } + if (this.socket.write(buffer)) + return; + const drainEvent = (0, utils_1.once)(this.socket, "drain", options); + const timeout = options?.timeoutContext?.timeoutForSocketWrite; + const drained = timeout ? Promise.race([drainEvent, timeout]) : drainEvent; + try { + return await drained; + } catch (writeError) { + if (timeout_1.TimeoutError.is(writeError)) { + const timeoutError = new error_1.MongoOperationTimeoutError("Timed out at socket write"); + this.onError(timeoutError); + throw timeoutError; + } else if (writeError === options.signal?.reason) { + this.onError(writeError); + } + throw writeError; + } finally { + timeout?.clear(); + } + } + /** + * @internal + * + * Returns an async generator that yields full wire protocol messages from the underlying socket. This function + * yields messages until `moreToCome` is false or not present in a response, or the caller cancels the request + * by calling `return` on the generator. + * + * Note that `for-await` loops call `return` automatically when the loop is exited. + */ + async *readMany(options) { + try { + this.dataEvents = (0, on_data_1.onData)(this.messageStream, options); + this.messageStream.resume(); + for await (const message2 of this.dataEvents) { + const response = await (0, compression_1.decompressResponse)(message2); + yield response; + if (!response.moreToCome) { + return; + } + } + } catch (readError) { + if (timeout_1.TimeoutError.is(readError)) { + const timeoutError = new error_1.MongoOperationTimeoutError(`Timed out during socket read (${readError.duration}ms)`); + this.dataEvents = null; + this.onError(timeoutError); + throw timeoutError; + } else if (readError === options.signal?.reason) { + this.onError(readError); + } + throw readError; + } finally { + this.dataEvents = null; + this.messageStream.pause(); + } + } + }; + exports2.Connection = Connection; + Connection.COMMAND_STARTED = constants_1.COMMAND_STARTED; + Connection.COMMAND_SUCCEEDED = constants_1.COMMAND_SUCCEEDED; + Connection.COMMAND_FAILED = constants_1.COMMAND_FAILED; + Connection.CLUSTER_TIME_RECEIVED = constants_1.CLUSTER_TIME_RECEIVED; + Connection.CLOSE = constants_1.CLOSE; + Connection.PINNED = constants_1.PINNED; + Connection.UNPINNED = constants_1.UNPINNED; + var SizedMessageTransform = class extends stream_1.Transform { + constructor({ connection }) { + super({ writableObjectMode: false, readableObjectMode: true }); + this.bufferPool = new utils_1.BufferPool(); + this.connection = connection; + } + _transform(chunk, encoding, callback) { + if (this.connection.delayedTimeoutId != null) { + (0, timers_1.clearTimeout)(this.connection.delayedTimeoutId); + this.connection.delayedTimeoutId = null; + } + this.bufferPool.append(chunk); + while (this.bufferPool.length) { + const sizeOfMessage = this.bufferPool.getInt32(); + if (sizeOfMessage == null) { + break; + } + if (sizeOfMessage < 0) { + return callback(new error_1.MongoParseError(`Message size cannot be negative: ${sizeOfMessage}`)); + } + if (sizeOfMessage > this.bufferPool.length) { + break; + } + const message2 = this.bufferPool.read(sizeOfMessage); + if (!this.push(message2)) { + return callback(new error_1.MongoRuntimeError(`SizedMessageTransform does not support backpressure`)); + } + } + callback(); + } + }; + exports2.SizedMessageTransform = SizedMessageTransform; + var CryptoConnection = class extends Connection { + constructor(stream, options) { + super(stream, options); + this.autoEncrypter = options.autoEncrypter; + } + async command(ns, cmd, options, responseType) { + const { autoEncrypter } = this; + if (!autoEncrypter) { + throw new error_1.MongoMissingDependencyError("No AutoEncrypter available for encryption", { + dependencyName: "n/a" + }); + } + const serverWireVersion = (0, utils_1.maxWireVersion)(this); + if (serverWireVersion === 0) { + return await super.command(ns, cmd, options, responseType); + } + const sort = cmd.find || cmd.findAndModify ? cmd.sort : null; + const indexKeys = cmd.createIndexes ? cmd.indexes.map((index) => index.key) : null; + const encrypted = await autoEncrypter.encrypt(ns.toString(), cmd, options); + if (sort != null && (cmd.find || cmd.findAndModify)) { + encrypted.sort = sort; + } + if (indexKeys != null && cmd.createIndexes) { + for (const [offset, index] of indexKeys.entries()) { + encrypted.indexes[offset].key = index; + } + } + const encryptedResponse = await super.command( + ns, + encrypted, + options, + // Eventually we want to require `responseType` which means we would satisfy `T` as the return type. + // In the meantime, we want encryptedResponse to always be _at least_ a MongoDBResponse if not a more specific subclass + // So that we can ensure we have access to the on-demand APIs for decorate response + responseType ?? responses_1.MongoDBResponse + ); + const result = await autoEncrypter.decrypt(encryptedResponse.toBytes(), options); + const decryptedResponse = responseType?.make(result) ?? (0, bson_1.deserialize)(result, options); + if (autoEncrypter[constants_1.kDecorateResult]) { + if (responseType == null) { + (0, utils_1.decorateDecryptionResult)(decryptedResponse, encryptedResponse.toObject(), true); + } else if (decryptedResponse instanceof responses_1.CursorResponse) { + decryptedResponse.encryptedResponse = encryptedResponse; + } + } + return decryptedResponse; + } + }; + exports2.CryptoConnection = CryptoConnection; + } +}); + +// node_modules/mongodb/lib/cmap/connect.js +var require_connect = __commonJS({ + "node_modules/mongodb/lib/cmap/connect.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.LEGAL_TCP_SOCKET_OPTIONS = exports2.LEGAL_TLS_SOCKET_OPTIONS = void 0; + exports2.connect = connect; + exports2.makeConnection = makeConnection; + exports2.performInitialHandshake = performInitialHandshake; + exports2.prepareHandshakeDocument = prepareHandshakeDocument; + exports2.makeSocket = makeSocket; + var net = require("net"); + var tls = require("tls"); + var constants_1 = require_constants2(); + var deps_1 = require_deps(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var auth_provider_1 = require_auth_provider(); + var providers_1 = require_providers(); + var connection_1 = require_connection(); + var constants_2 = require_constants(); + async function connect(options) { + let connection = null; + try { + const socket = await makeSocket(options); + connection = makeConnection(options, socket); + await performInitialHandshake(connection, options); + return connection; + } catch (error2) { + connection?.destroy(); + throw error2; + } + } + function makeConnection(options, socket) { + let ConnectionType = options.connectionType ?? connection_1.Connection; + if (options.autoEncrypter) { + ConnectionType = connection_1.CryptoConnection; + } + return new ConnectionType(socket, options); + } + function checkSupportedServer(hello, options) { + const maxWireVersion = Number(hello.maxWireVersion); + const minWireVersion = Number(hello.minWireVersion); + const serverVersionHighEnough = !Number.isNaN(maxWireVersion) && maxWireVersion >= constants_2.MIN_SUPPORTED_WIRE_VERSION; + const serverVersionLowEnough = !Number.isNaN(minWireVersion) && minWireVersion <= constants_2.MAX_SUPPORTED_WIRE_VERSION; + if (serverVersionHighEnough) { + if (serverVersionLowEnough) { + return null; + } + const message3 = `Server at ${options.hostAddress} reports minimum wire version ${JSON.stringify(hello.minWireVersion)}, but this version of the Node.js Driver requires at most ${constants_2.MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${constants_2.MAX_SUPPORTED_SERVER_VERSION})`; + return new error_1.MongoCompatibilityError(message3); + } + const message2 = `Server at ${options.hostAddress} reports maximum wire version ${JSON.stringify(hello.maxWireVersion) ?? 0}, but this version of the Node.js Driver requires at least ${constants_2.MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${constants_2.MIN_SUPPORTED_SERVER_VERSION})`; + return new error_1.MongoCompatibilityError(message2); + } + async function performInitialHandshake(conn, options) { + const credentials = options.credentials; + if (credentials) { + if (!(credentials.mechanism === providers_1.AuthMechanism.MONGODB_DEFAULT) && !options.authProviders.getOrCreateProvider(credentials.mechanism, credentials.mechanismProperties)) { + throw new error_1.MongoInvalidArgumentError(`AuthMechanism '${credentials.mechanism}' not supported`); + } + } + const authContext = new auth_provider_1.AuthContext(conn, credentials, options); + conn.authContext = authContext; + const handshakeDoc = await prepareHandshakeDocument(authContext); + const handshakeOptions = { ...options, raw: false }; + if (typeof options.connectTimeoutMS === "number") { + handshakeOptions.socketTimeoutMS = options.connectTimeoutMS; + } + const start = (/* @__PURE__ */ new Date()).getTime(); + const response = await executeHandshake(handshakeDoc, handshakeOptions); + if (!("isWritablePrimary" in response)) { + response.isWritablePrimary = response[constants_1.LEGACY_HELLO_COMMAND]; + } + if (response.helloOk) { + conn.helloOk = true; + } + const supportedServerErr = checkSupportedServer(response, options); + if (supportedServerErr) { + throw supportedServerErr; + } + if (options.loadBalanced) { + if (!response.serviceId) { + throw new error_1.MongoCompatibilityError("Driver attempted to initialize in load balancing mode, but the server does not support this mode."); + } + } + conn.hello = response; + conn.lastHelloMS = (/* @__PURE__ */ new Date()).getTime() - start; + if (!response.arbiterOnly && credentials) { + authContext.response = response; + const resolvedCredentials = credentials.resolveAuthMechanism(response); + const provider = options.authProviders.getOrCreateProvider(resolvedCredentials.mechanism, resolvedCredentials.mechanismProperties); + if (!provider) { + throw new error_1.MongoInvalidArgumentError(`No AuthProvider for ${resolvedCredentials.mechanism} defined.`); + } + try { + await provider.auth(authContext); + } catch (error2) { + if (error2 instanceof error_1.MongoError) { + error2.addErrorLabel(error_1.MongoErrorLabel.HandshakeError); + if ((0, error_1.needsRetryableWriteLabel)(error2, response.maxWireVersion, conn.description.type)) { + error2.addErrorLabel(error_1.MongoErrorLabel.RetryableWriteError); + } + } + throw error2; + } + } + conn.established = true; + async function executeHandshake(handshakeDoc2, handshakeOptions2) { + try { + const handshakeResponse = await conn.command((0, utils_1.ns)("admin.$cmd"), handshakeDoc2, handshakeOptions2); + return handshakeResponse; + } catch (error2) { + if (error2 instanceof error_1.MongoError) { + error2.addErrorLabel(error_1.MongoErrorLabel.HandshakeError); + } + throw error2; + } + } + } + async function prepareHandshakeDocument(authContext) { + const options = authContext.options; + const compressors = options.compressors ? options.compressors : []; + const { serverApi } = authContext.connection; + const clientMetadata = await options.extendedMetadata; + const handshakeDoc = { + [serverApi?.version || options.loadBalanced === true ? "hello" : constants_1.LEGACY_HELLO_COMMAND]: 1, + helloOk: true, + client: clientMetadata, + compression: compressors + }; + if (options.loadBalanced === true) { + handshakeDoc.loadBalanced = true; + } + const credentials = authContext.credentials; + if (credentials) { + if (credentials.mechanism === providers_1.AuthMechanism.MONGODB_DEFAULT && credentials.username) { + handshakeDoc.saslSupportedMechs = `${credentials.source}.${credentials.username}`; + const provider2 = authContext.options.authProviders.getOrCreateProvider(providers_1.AuthMechanism.MONGODB_SCRAM_SHA256, credentials.mechanismProperties); + if (!provider2) { + throw new error_1.MongoInvalidArgumentError(`No AuthProvider for ${providers_1.AuthMechanism.MONGODB_SCRAM_SHA256} defined.`); + } + return await provider2.prepare(handshakeDoc, authContext); + } + const provider = authContext.options.authProviders.getOrCreateProvider(credentials.mechanism, credentials.mechanismProperties); + if (!provider) { + throw new error_1.MongoInvalidArgumentError(`No AuthProvider for ${credentials.mechanism} defined.`); + } + return await provider.prepare(handshakeDoc, authContext); + } + return handshakeDoc; + } + exports2.LEGAL_TLS_SOCKET_OPTIONS = [ + "allowPartialTrustChain", + "ALPNProtocols", + "ca", + "cert", + "checkServerIdentity", + "ciphers", + "crl", + "ecdhCurve", + "key", + "minDHSize", + "passphrase", + "pfx", + "rejectUnauthorized", + "secureContext", + "secureProtocol", + "servername", + "session" + ]; + exports2.LEGAL_TCP_SOCKET_OPTIONS = [ + "autoSelectFamily", + "autoSelectFamilyAttemptTimeout", + "keepAliveInitialDelay", + "family", + "hints", + "localAddress", + "localPort", + "lookup" + ]; + function parseConnectOptions(options) { + const hostAddress = options.hostAddress; + if (!hostAddress) + throw new error_1.MongoInvalidArgumentError('Option "hostAddress" is required'); + const result = {}; + for (const name of exports2.LEGAL_TCP_SOCKET_OPTIONS) { + if (options[name] != null) { + result[name] = options[name]; + } + } + result.keepAliveInitialDelay ??= 12e4; + result.keepAlive = true; + result.noDelay = options.noDelay ?? true; + if (typeof hostAddress.socketPath === "string") { + result.path = hostAddress.socketPath; + return result; + } else if (typeof hostAddress.host === "string") { + result.host = hostAddress.host; + result.port = hostAddress.port; + return result; + } else { + throw new error_1.MongoRuntimeError(`Unexpected HostAddress ${JSON.stringify(hostAddress)}`); + } + } + function parseSslOptions(options) { + const result = parseConnectOptions(options); + for (const name of exports2.LEGAL_TLS_SOCKET_OPTIONS) { + if (options[name] != null) { + result[name] = options[name]; + } + } + if (options.existingSocket) { + result.socket = options.existingSocket; + } + if (result.servername == null && result.host && !net.isIP(result.host)) { + result.servername = result.host; + } + return result; + } + async function makeSocket(options) { + const useTLS = options.tls ?? false; + const connectTimeoutMS = options.connectTimeoutMS ?? 3e4; + const existingSocket = options.existingSocket; + let socket; + if (options.proxyHost != null) { + return await makeSocks5Connection({ + ...options, + connectTimeoutMS + // Should always be present for Socks5 + }); + } + if (useTLS) { + const tlsSocket = tls.connect(parseSslOptions(options)); + if (typeof tlsSocket.disableRenegotiation === "function") { + tlsSocket.disableRenegotiation(); + } + socket = tlsSocket; + } else if (existingSocket) { + socket = existingSocket; + } else { + socket = net.createConnection(parseConnectOptions(options)); + } + socket.setTimeout(connectTimeoutMS); + let cancellationHandler = null; + const { promise: connectedSocket, resolve, reject } = (0, utils_1.promiseWithResolvers)(); + if (existingSocket) { + resolve(socket); + } else { + const start = performance.now(); + const connectEvent = useTLS ? "secureConnect" : "connect"; + socket.once(connectEvent, () => resolve(socket)).once("error", (cause) => reject(new error_1.MongoNetworkError(error_1.MongoError.buildErrorMessage(cause), { cause }))).once("timeout", () => { + reject(new error_1.MongoNetworkTimeoutError(`Socket '${connectEvent}' timed out after ${performance.now() - start | 0}ms (connectTimeoutMS: ${connectTimeoutMS})`)); + }).once("close", () => reject(new error_1.MongoNetworkError(`Socket closed after ${performance.now() - start | 0} during connection establishment`))); + if (options.cancellationToken != null) { + cancellationHandler = () => reject(new error_1.MongoNetworkError(`Socket connection establishment was cancelled after ${performance.now() - start | 0}`)); + options.cancellationToken.once("cancel", cancellationHandler); + } + } + try { + socket = await connectedSocket; + return socket; + } catch (error2) { + socket.destroy(); + throw error2; + } finally { + socket.setTimeout(0); + if (cancellationHandler != null) { + options.cancellationToken?.removeListener("cancel", cancellationHandler); + } + } + } + var socks = null; + function loadSocks() { + if (socks == null) { + const socksImport = (0, deps_1.getSocks)(); + if ("kModuleError" in socksImport) { + throw socksImport.kModuleError; + } + socks = socksImport; + } + return socks; + } + async function makeSocks5Connection(options) { + const hostAddress = utils_1.HostAddress.fromHostPort( + options.proxyHost ?? "", + // proxyHost is guaranteed to set here + options.proxyPort ?? 1080 + ); + const rawSocket = await makeSocket({ + ...options, + hostAddress, + tls: false, + proxyHost: void 0 + }); + const destination = parseConnectOptions(options); + if (typeof destination.host !== "string" || typeof destination.port !== "number") { + throw new error_1.MongoInvalidArgumentError("Can only make Socks5 connections to TCP hosts"); + } + socks ??= loadSocks(); + let existingSocket; + try { + const connection = await socks.SocksClient.createConnection({ + existing_socket: rawSocket, + timeout: options.connectTimeoutMS, + command: "connect", + destination: { + host: destination.host, + port: destination.port + }, + proxy: { + // host and port are ignored because we pass existing_socket + host: "iLoveJavaScript", + port: 0, + type: 5, + userId: options.proxyUsername || void 0, + password: options.proxyPassword || void 0 + } + }); + existingSocket = connection.socket; + } catch (cause) { + throw new error_1.MongoNetworkError(error_1.MongoError.buildErrorMessage(cause), { cause }); + } + return await makeSocket({ ...options, existingSocket, proxyHost: void 0 }); + } + } +}); + +// node_modules/mongodb/lib/sdam/events.js +var require_events = __commonJS({ + "node_modules/mongodb/lib/sdam/events.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ServerHeartbeatFailedEvent = exports2.ServerHeartbeatSucceededEvent = exports2.ServerHeartbeatStartedEvent = exports2.TopologyClosedEvent = exports2.TopologyOpeningEvent = exports2.TopologyDescriptionChangedEvent = exports2.ServerClosedEvent = exports2.ServerOpeningEvent = exports2.ServerDescriptionChangedEvent = void 0; + var constants_1 = require_constants2(); + var ServerDescriptionChangedEvent = class { + /** @internal */ + constructor(topologyId, address, previousDescription, newDescription) { + this.name = constants_1.SERVER_DESCRIPTION_CHANGED; + this.topologyId = topologyId; + this.address = address; + this.previousDescription = previousDescription; + this.newDescription = newDescription; + } + }; + exports2.ServerDescriptionChangedEvent = ServerDescriptionChangedEvent; + var ServerOpeningEvent = class { + /** @internal */ + constructor(topologyId, address) { + this.name = constants_1.SERVER_OPENING; + this.topologyId = topologyId; + this.address = address; + } + }; + exports2.ServerOpeningEvent = ServerOpeningEvent; + var ServerClosedEvent = class { + /** @internal */ + constructor(topologyId, address) { + this.name = constants_1.SERVER_CLOSED; + this.topologyId = topologyId; + this.address = address; + } + }; + exports2.ServerClosedEvent = ServerClosedEvent; + var TopologyDescriptionChangedEvent = class { + /** @internal */ + constructor(topologyId, previousDescription, newDescription) { + this.name = constants_1.TOPOLOGY_DESCRIPTION_CHANGED; + this.topologyId = topologyId; + this.previousDescription = previousDescription; + this.newDescription = newDescription; + } + }; + exports2.TopologyDescriptionChangedEvent = TopologyDescriptionChangedEvent; + var TopologyOpeningEvent = class { + /** @internal */ + constructor(topologyId) { + this.name = constants_1.TOPOLOGY_OPENING; + this.topologyId = topologyId; + } + }; + exports2.TopologyOpeningEvent = TopologyOpeningEvent; + var TopologyClosedEvent = class { + /** @internal */ + constructor(topologyId) { + this.name = constants_1.TOPOLOGY_CLOSED; + this.topologyId = topologyId; + } + }; + exports2.TopologyClosedEvent = TopologyClosedEvent; + var ServerHeartbeatStartedEvent = class { + /** @internal */ + constructor(connectionId, awaited) { + this.name = constants_1.SERVER_HEARTBEAT_STARTED; + this.connectionId = connectionId; + this.awaited = awaited; + } + }; + exports2.ServerHeartbeatStartedEvent = ServerHeartbeatStartedEvent; + var ServerHeartbeatSucceededEvent = class { + /** @internal */ + constructor(connectionId, duration, reply, awaited) { + this.name = constants_1.SERVER_HEARTBEAT_SUCCEEDED; + this.connectionId = connectionId; + this.duration = duration; + this.reply = reply ?? {}; + this.awaited = awaited; + } + }; + exports2.ServerHeartbeatSucceededEvent = ServerHeartbeatSucceededEvent; + var ServerHeartbeatFailedEvent = class { + /** @internal */ + constructor(connectionId, duration, failure, awaited) { + this.name = constants_1.SERVER_HEARTBEAT_FAILED; + this.connectionId = connectionId; + this.duration = duration; + this.failure = failure; + this.awaited = awaited; + } + }; + exports2.ServerHeartbeatFailedEvent = ServerHeartbeatFailedEvent; + } +}); + +// node_modules/mongodb/lib/cmap/connection_pool_events.js +var require_connection_pool_events = __commonJS({ + "node_modules/mongodb/lib/cmap/connection_pool_events.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ConnectionPoolClearedEvent = exports2.ConnectionCheckedInEvent = exports2.ConnectionCheckedOutEvent = exports2.ConnectionCheckOutFailedEvent = exports2.ConnectionCheckOutStartedEvent = exports2.ConnectionClosedEvent = exports2.ConnectionReadyEvent = exports2.ConnectionCreatedEvent = exports2.ConnectionPoolClosedEvent = exports2.ConnectionPoolReadyEvent = exports2.ConnectionPoolCreatedEvent = exports2.ConnectionPoolMonitoringEvent = void 0; + var constants_1 = require_constants2(); + var utils_1 = require_utils3(); + var ConnectionPoolMonitoringEvent = class { + /** @internal */ + constructor(pool) { + this.time = /* @__PURE__ */ new Date(); + this.address = pool.address; + } + }; + exports2.ConnectionPoolMonitoringEvent = ConnectionPoolMonitoringEvent; + var ConnectionPoolCreatedEvent = class extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool) { + super(pool); + this.name = constants_1.CONNECTION_POOL_CREATED; + const { maxConnecting, maxPoolSize, minPoolSize, maxIdleTimeMS, waitQueueTimeoutMS } = pool.options; + this.options = { maxConnecting, maxPoolSize, minPoolSize, maxIdleTimeMS, waitQueueTimeoutMS }; + } + }; + exports2.ConnectionPoolCreatedEvent = ConnectionPoolCreatedEvent; + var ConnectionPoolReadyEvent = class extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool) { + super(pool); + this.name = constants_1.CONNECTION_POOL_READY; + } + }; + exports2.ConnectionPoolReadyEvent = ConnectionPoolReadyEvent; + var ConnectionPoolClosedEvent = class extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool) { + super(pool); + this.name = constants_1.CONNECTION_POOL_CLOSED; + } + }; + exports2.ConnectionPoolClosedEvent = ConnectionPoolClosedEvent; + var ConnectionCreatedEvent = class extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection) { + super(pool); + this.name = constants_1.CONNECTION_CREATED; + this.connectionId = connection.id; + } + }; + exports2.ConnectionCreatedEvent = ConnectionCreatedEvent; + var ConnectionReadyEvent = class extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection, connectionCreatedEventTime) { + super(pool); + this.name = constants_1.CONNECTION_READY; + this.durationMS = (0, utils_1.now)() - connectionCreatedEventTime; + this.connectionId = connection.id; + } + }; + exports2.ConnectionReadyEvent = ConnectionReadyEvent; + var ConnectionClosedEvent = class extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection, reason, error2) { + super(pool); + this.name = constants_1.CONNECTION_CLOSED; + this.connectionId = connection.id; + this.reason = reason; + this.serviceId = connection.serviceId; + this.error = error2 ?? null; + } + }; + exports2.ConnectionClosedEvent = ConnectionClosedEvent; + var ConnectionCheckOutStartedEvent = class extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool) { + super(pool); + this.name = constants_1.CONNECTION_CHECK_OUT_STARTED; + } + }; + exports2.ConnectionCheckOutStartedEvent = ConnectionCheckOutStartedEvent; + var ConnectionCheckOutFailedEvent = class extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, reason, checkoutTime, error2) { + super(pool); + this.name = constants_1.CONNECTION_CHECK_OUT_FAILED; + this.durationMS = (0, utils_1.now)() - checkoutTime; + this.reason = reason; + this.error = error2; + } + }; + exports2.ConnectionCheckOutFailedEvent = ConnectionCheckOutFailedEvent; + var ConnectionCheckedOutEvent = class extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection, checkoutTime) { + super(pool); + this.name = constants_1.CONNECTION_CHECKED_OUT; + this.durationMS = (0, utils_1.now)() - checkoutTime; + this.connectionId = connection.id; + } + }; + exports2.ConnectionCheckedOutEvent = ConnectionCheckedOutEvent; + var ConnectionCheckedInEvent = class extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection) { + super(pool); + this.name = constants_1.CONNECTION_CHECKED_IN; + this.connectionId = connection.id; + } + }; + exports2.ConnectionCheckedInEvent = ConnectionCheckedInEvent; + var ConnectionPoolClearedEvent = class extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, options = {}) { + super(pool); + this.name = constants_1.CONNECTION_POOL_CLEARED; + this.serviceId = options.serviceId; + this.interruptInUseConnections = options.interruptInUseConnections; + } + }; + exports2.ConnectionPoolClearedEvent = ConnectionPoolClearedEvent; + } +}); + +// node_modules/mongodb/lib/cmap/errors.js +var require_errors2 = __commonJS({ + "node_modules/mongodb/lib/cmap/errors.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.WaitQueueTimeoutError = exports2.PoolClearedOnNetworkError = exports2.PoolClearedError = exports2.PoolClosedError = void 0; + var error_1 = require_error(); + var PoolClosedError = class extends error_1.MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(pool) { + super("Attempted to check out a connection from closed connection pool"); + this.address = pool.address; + } + get name() { + return "MongoPoolClosedError"; + } + }; + exports2.PoolClosedError = PoolClosedError; + var PoolClearedError = class extends error_1.MongoNetworkError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(pool, message2) { + const errorMessage = message2 ? message2 : `Connection pool for ${pool.address} was cleared because another operation failed with: "${pool.serverError?.message}"`; + super(errorMessage, pool.serverError ? { cause: pool.serverError } : void 0); + this.address = pool.address; + this.addErrorLabel(error_1.MongoErrorLabel.PoolRequstedRetry); + } + get name() { + return "MongoPoolClearedError"; + } + }; + exports2.PoolClearedError = PoolClearedError; + var PoolClearedOnNetworkError = class extends PoolClearedError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(pool) { + super(pool, `Connection to ${pool.address} interrupted due to server monitor timeout`); + } + get name() { + return "PoolClearedOnNetworkError"; + } + }; + exports2.PoolClearedOnNetworkError = PoolClearedOnNetworkError; + var WaitQueueTimeoutError = class extends error_1.MongoDriverError { + /** + * **Do not use this constructor!** + * + * Meant for internal use only. + * + * @remarks + * This class is only meant to be constructed within the driver. This constructor is + * not subject to semantic versioning compatibility guarantees and may change at any time. + * + * @public + **/ + constructor(message2, address) { + super(message2); + this.address = address; + } + get name() { + return "MongoWaitQueueTimeoutError"; + } + }; + exports2.WaitQueueTimeoutError = WaitQueueTimeoutError; + } +}); + +// node_modules/mongodb/lib/cmap/connection_pool.js +var require_connection_pool = __commonJS({ + "node_modules/mongodb/lib/cmap/connection_pool.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ConnectionPool = exports2.PoolState = void 0; + var timers_1 = require("timers"); + var constants_1 = require_constants2(); + var error_1 = require_error(); + var mongo_types_1 = require_mongo_types(); + var timeout_1 = require_timeout(); + var utils_1 = require_utils3(); + var connect_1 = require_connect(); + var connection_1 = require_connection(); + var connection_pool_events_1 = require_connection_pool_events(); + var errors_1 = require_errors2(); + var metrics_1 = require_metrics(); + exports2.PoolState = Object.freeze({ + paused: "paused", + ready: "ready", + closed: "closed" + }); + var ConnectionPool = class _ConnectionPool extends mongo_types_1.TypedEventEmitter { + constructor(server, options) { + super(); + this.on("error", utils_1.noop); + this.options = Object.freeze({ + connectionType: connection_1.Connection, + ...options, + maxPoolSize: options.maxPoolSize ?? 100, + minPoolSize: options.minPoolSize ?? 0, + maxConnecting: options.maxConnecting ?? 2, + maxIdleTimeMS: options.maxIdleTimeMS ?? 0, + waitQueueTimeoutMS: options.waitQueueTimeoutMS ?? 0, + minPoolSizeCheckFrequencyMS: options.minPoolSizeCheckFrequencyMS ?? 100, + autoEncrypter: options.autoEncrypter + }); + if (this.options.minPoolSize > this.options.maxPoolSize) { + throw new error_1.MongoInvalidArgumentError("Connection pool minimum size must not be greater than maximum pool size"); + } + this.poolState = exports2.PoolState.paused; + this.server = server; + this.connections = new utils_1.List(); + this.pending = 0; + this.checkedOut = /* @__PURE__ */ new Set(); + this.minPoolSizeTimer = void 0; + this.generation = 0; + this.serviceGenerations = /* @__PURE__ */ new Map(); + this.connectionCounter = (0, utils_1.makeCounter)(1); + this.cancellationToken = new mongo_types_1.CancellationToken(); + this.cancellationToken.setMaxListeners(Infinity); + this.waitQueue = new utils_1.List(); + this.metrics = new metrics_1.ConnectionPoolMetrics(); + this.processingWaitQueue = false; + this.mongoLogger = this.server.topology.client?.mongoLogger; + this.component = "connection"; + process.nextTick(() => { + this.emitAndLog(_ConnectionPool.CONNECTION_POOL_CREATED, new connection_pool_events_1.ConnectionPoolCreatedEvent(this)); + }); + } + /** The address of the endpoint the pool is connected to */ + get address() { + return this.options.hostAddress.toString(); + } + /** + * Check if the pool has been closed + * + * TODO(NODE-3263): We can remove this property once shell no longer needs it + */ + get closed() { + return this.poolState === exports2.PoolState.closed; + } + /** An integer expressing how many total connections (available + pending + in use) the pool currently has */ + get totalConnectionCount() { + return this.availableConnectionCount + this.pendingConnectionCount + this.currentCheckedOutCount; + } + /** An integer expressing how many connections are currently available in the pool. */ + get availableConnectionCount() { + return this.connections.length; + } + get pendingConnectionCount() { + return this.pending; + } + get currentCheckedOutCount() { + return this.checkedOut.size; + } + get waitQueueSize() { + return this.waitQueue.length; + } + get loadBalanced() { + return this.options.loadBalanced; + } + get serverError() { + return this.server.description.error; + } + /** + * This is exposed ONLY for use in mongosh, to enable + * killing all connections if a user quits the shell with + * operations in progress. + * + * This property may be removed as a part of NODE-3263. + */ + get checkedOutConnections() { + return this.checkedOut; + } + /** + * Get the metrics information for the pool when a wait queue timeout occurs. + */ + waitQueueErrorMetrics() { + return this.metrics.info(this.options.maxPoolSize); + } + /** + * Set the pool state to "ready" + */ + ready() { + if (this.poolState !== exports2.PoolState.paused) { + return; + } + this.poolState = exports2.PoolState.ready; + this.emitAndLog(_ConnectionPool.CONNECTION_POOL_READY, new connection_pool_events_1.ConnectionPoolReadyEvent(this)); + (0, timers_1.clearTimeout)(this.minPoolSizeTimer); + this.ensureMinPoolSize(); + } + /** + * Check a connection out of this pool. The connection will continue to be tracked, but no reference to it + * will be held by the pool. This means that if a connection is checked out it MUST be checked back in or + * explicitly destroyed by the new owner. + */ + async checkOut(options) { + const checkoutTime = (0, utils_1.now)(); + this.emitAndLog(_ConnectionPool.CONNECTION_CHECK_OUT_STARTED, new connection_pool_events_1.ConnectionCheckOutStartedEvent(this)); + const { promise, resolve, reject } = (0, utils_1.promiseWithResolvers)(); + const timeout = options.timeoutContext.connectionCheckoutTimeout; + const waitQueueMember = { + resolve, + reject, + cancelled: false, + checkoutTime + }; + const abortListener = (0, utils_1.addAbortListener)(options.signal, function() { + waitQueueMember.cancelled = true; + reject(this.reason); + }); + this.waitQueue.push(waitQueueMember); + process.nextTick(() => this.processWaitQueue()); + try { + timeout?.throwIfExpired(); + return await (timeout ? Promise.race([promise, timeout]) : promise); + } catch (error2) { + if (timeout_1.TimeoutError.is(error2)) { + timeout?.clear(); + waitQueueMember.cancelled = true; + this.emitAndLog(_ConnectionPool.CONNECTION_CHECK_OUT_FAILED, new connection_pool_events_1.ConnectionCheckOutFailedEvent(this, "timeout", waitQueueMember.checkoutTime)); + const timeoutError = new errors_1.WaitQueueTimeoutError(this.loadBalanced ? this.waitQueueErrorMetrics() : "Timed out while checking out a connection from connection pool", this.address); + if (options.timeoutContext.csotEnabled()) { + throw new error_1.MongoOperationTimeoutError("Timed out during connection checkout", { + cause: timeoutError + }); + } + throw timeoutError; + } + throw error2; + } finally { + abortListener?.[utils_1.kDispose](); + timeout?.clear(); + } + } + /** + * Check a connection into the pool. + * + * @param connection - The connection to check in + */ + checkIn(connection) { + if (!this.checkedOut.has(connection)) { + return; + } + const poolClosed = this.closed; + const stale = this.connectionIsStale(connection); + const willDestroy = !!(poolClosed || stale || connection.closed); + if (!willDestroy) { + connection.markAvailable(); + this.connections.unshift(connection); + } + this.checkedOut.delete(connection); + this.emitAndLog(_ConnectionPool.CONNECTION_CHECKED_IN, new connection_pool_events_1.ConnectionCheckedInEvent(this, connection)); + if (willDestroy) { + const reason = connection.closed ? "error" : poolClosed ? "poolClosed" : "stale"; + this.destroyConnection(connection, reason); + } + process.nextTick(() => this.processWaitQueue()); + } + /** + * Clear the pool + * + * Pool reset is handled by incrementing the pool's generation count. Any existing connection of a + * previous generation will eventually be pruned during subsequent checkouts. + */ + clear(options = {}) { + if (this.closed) { + return; + } + if (this.loadBalanced) { + const { serviceId } = options; + if (!serviceId) { + throw new error_1.MongoRuntimeError("ConnectionPool.clear() called in load balanced mode with no serviceId."); + } + const sid = serviceId.toHexString(); + const generation = this.serviceGenerations.get(sid); + if (generation == null) { + throw new error_1.MongoRuntimeError("Service generations are required in load balancer mode."); + } else { + this.serviceGenerations.set(sid, generation + 1); + } + this.emitAndLog(_ConnectionPool.CONNECTION_POOL_CLEARED, new connection_pool_events_1.ConnectionPoolClearedEvent(this, { serviceId })); + return; + } + const interruptInUseConnections = options.interruptInUseConnections ?? false; + const oldGeneration = this.generation; + this.generation += 1; + const alreadyPaused = this.poolState === exports2.PoolState.paused; + this.poolState = exports2.PoolState.paused; + this.clearMinPoolSizeTimer(); + if (!alreadyPaused) { + this.emitAndLog(_ConnectionPool.CONNECTION_POOL_CLEARED, new connection_pool_events_1.ConnectionPoolClearedEvent(this, { + interruptInUseConnections + })); + } + if (interruptInUseConnections) { + process.nextTick(() => this.interruptInUseConnections(oldGeneration)); + } + this.processWaitQueue(); + } + /** + * Closes all stale in-use connections in the pool with a resumable PoolClearedOnNetworkError. + * + * Only connections where `connection.generation <= minGeneration` are killed. + */ + interruptInUseConnections(minGeneration) { + for (const connection of this.checkedOut) { + if (connection.generation <= minGeneration) { + connection.onError(new errors_1.PoolClearedOnNetworkError(this)); + } + } + } + /** For MongoClient.close() procedures */ + closeCheckedOutConnections() { + for (const conn of this.checkedOut) { + conn.onError(new error_1.MongoClientClosedError()); + } + } + /** Close the pool */ + close() { + if (this.closed) { + return; + } + this.cancellationToken.emit("cancel"); + if (typeof this.connectionCounter.return === "function") { + this.connectionCounter.return(void 0); + } + this.poolState = exports2.PoolState.closed; + this.clearMinPoolSizeTimer(); + this.processWaitQueue(); + for (const conn of this.connections) { + this.emitAndLog(_ConnectionPool.CONNECTION_CLOSED, new connection_pool_events_1.ConnectionClosedEvent(this, conn, "poolClosed")); + conn.destroy(); + } + this.connections.clear(); + this.emitAndLog(_ConnectionPool.CONNECTION_POOL_CLOSED, new connection_pool_events_1.ConnectionPoolClosedEvent(this)); + } + /** + * @internal + * Reauthenticate a connection + */ + async reauthenticate(connection) { + const authContext = connection.authContext; + if (!authContext) { + throw new error_1.MongoRuntimeError("No auth context found on connection."); + } + const credentials = authContext.credentials; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError("Connection is missing credentials when asked to reauthenticate"); + } + const resolvedCredentials = credentials.resolveAuthMechanism(connection.hello); + const provider = this.server.topology.client.s.authProviders.getOrCreateProvider(resolvedCredentials.mechanism, resolvedCredentials.mechanismProperties); + if (!provider) { + throw new error_1.MongoMissingCredentialsError(`Reauthenticate failed due to no auth provider for ${credentials.mechanism}`); + } + await provider.reauth(authContext); + return; + } + /** Clear the min pool size timer */ + clearMinPoolSizeTimer() { + const minPoolSizeTimer = this.minPoolSizeTimer; + if (minPoolSizeTimer) { + (0, timers_1.clearTimeout)(minPoolSizeTimer); + } + } + destroyConnection(connection, reason) { + this.emitAndLog(_ConnectionPool.CONNECTION_CLOSED, new connection_pool_events_1.ConnectionClosedEvent(this, connection, reason)); + connection.destroy(); + } + connectionIsStale(connection) { + const serviceId = connection.serviceId; + if (this.loadBalanced && serviceId) { + const sid = serviceId.toHexString(); + const generation = this.serviceGenerations.get(sid); + return connection.generation !== generation; + } + return connection.generation !== this.generation; + } + connectionIsIdle(connection) { + return !!(this.options.maxIdleTimeMS && connection.idleTime > this.options.maxIdleTimeMS); + } + /** + * Destroys a connection if the connection is perished. + * + * @returns `true` if the connection was destroyed, `false` otherwise. + */ + destroyConnectionIfPerished(connection) { + const isStale = this.connectionIsStale(connection); + const isIdle = this.connectionIsIdle(connection); + if (!isStale && !isIdle && !connection.closed) { + return false; + } + const reason = connection.closed ? "error" : isStale ? "stale" : "idle"; + this.destroyConnection(connection, reason); + return true; + } + createConnection(callback) { + const connectOptions = { + ...this.options, + id: this.connectionCounter.next().value, + generation: this.generation, + cancellationToken: this.cancellationToken, + mongoLogger: this.mongoLogger, + authProviders: this.server.topology.client.s.authProviders, + extendedMetadata: this.server.topology.client.options.extendedMetadata + }; + this.pending++; + const connectionCreatedTime = (0, utils_1.now)(); + this.emitAndLog(_ConnectionPool.CONNECTION_CREATED, new connection_pool_events_1.ConnectionCreatedEvent(this, { id: connectOptions.id })); + (0, connect_1.connect)(connectOptions).then((connection) => { + if (this.poolState !== exports2.PoolState.ready) { + this.pending--; + connection.destroy(); + callback(this.closed ? new errors_1.PoolClosedError(this) : new errors_1.PoolClearedError(this)); + return; + } + for (const event of [...constants_1.APM_EVENTS, connection_1.Connection.CLUSTER_TIME_RECEIVED]) { + connection.on(event, (e4) => this.emit(event, e4)); + } + if (this.loadBalanced) { + connection.on(connection_1.Connection.PINNED, (pinType) => this.metrics.markPinned(pinType)); + connection.on(connection_1.Connection.UNPINNED, (pinType) => this.metrics.markUnpinned(pinType)); + const serviceId = connection.serviceId; + if (serviceId) { + let generation; + const sid = serviceId.toHexString(); + if (generation = this.serviceGenerations.get(sid)) { + connection.generation = generation; + } else { + this.serviceGenerations.set(sid, 0); + connection.generation = 0; + } + } + } + connection.markAvailable(); + this.emitAndLog(_ConnectionPool.CONNECTION_READY, new connection_pool_events_1.ConnectionReadyEvent(this, connection, connectionCreatedTime)); + this.pending--; + callback(void 0, connection); + }, (error2) => { + this.pending--; + this.server.handleError(error2); + this.emitAndLog(_ConnectionPool.CONNECTION_CLOSED, new connection_pool_events_1.ConnectionClosedEvent( + this, + { id: connectOptions.id, serviceId: void 0 }, + "error", + // TODO(NODE-5192): Remove this cast + error2 + )); + if (error2 instanceof error_1.MongoNetworkError || error2 instanceof error_1.MongoServerError) { + error2.connectionGeneration = connectOptions.generation; + } + callback(error2 ?? new error_1.MongoRuntimeError("Connection creation failed without error")); + }); + } + ensureMinPoolSize() { + const minPoolSize = this.options.minPoolSize; + if (this.poolState !== exports2.PoolState.ready) { + return; + } + this.connections.prune((connection) => this.destroyConnectionIfPerished(connection)); + if (this.totalConnectionCount < minPoolSize && this.pendingConnectionCount < this.options.maxConnecting) { + this.createConnection((err, connection) => { + if (!err && connection) { + this.connections.push(connection); + process.nextTick(() => this.processWaitQueue()); + } + if (this.poolState === exports2.PoolState.ready) { + (0, timers_1.clearTimeout)(this.minPoolSizeTimer); + this.minPoolSizeTimer = (0, timers_1.setTimeout)(() => this.ensureMinPoolSize(), this.options.minPoolSizeCheckFrequencyMS); + } + }); + } else { + (0, timers_1.clearTimeout)(this.minPoolSizeTimer); + this.minPoolSizeTimer = (0, timers_1.setTimeout)(() => this.ensureMinPoolSize(), this.options.minPoolSizeCheckFrequencyMS); + } + } + processWaitQueue() { + if (this.processingWaitQueue) { + return; + } + this.processingWaitQueue = true; + while (this.waitQueueSize) { + const waitQueueMember = this.waitQueue.first(); + if (!waitQueueMember) { + this.waitQueue.shift(); + continue; + } + if (waitQueueMember.cancelled) { + this.waitQueue.shift(); + continue; + } + if (this.poolState !== exports2.PoolState.ready) { + const reason = this.closed ? "poolClosed" : "connectionError"; + const error2 = this.closed ? new errors_1.PoolClosedError(this) : new errors_1.PoolClearedError(this); + this.emitAndLog(_ConnectionPool.CONNECTION_CHECK_OUT_FAILED, new connection_pool_events_1.ConnectionCheckOutFailedEvent(this, reason, waitQueueMember.checkoutTime, error2)); + this.waitQueue.shift(); + waitQueueMember.reject(error2); + continue; + } + if (!this.availableConnectionCount) { + break; + } + const connection = this.connections.shift(); + if (!connection) { + break; + } + if (!this.destroyConnectionIfPerished(connection)) { + this.checkedOut.add(connection); + this.emitAndLog(_ConnectionPool.CONNECTION_CHECKED_OUT, new connection_pool_events_1.ConnectionCheckedOutEvent(this, connection, waitQueueMember.checkoutTime)); + this.waitQueue.shift(); + waitQueueMember.resolve(connection); + } + } + const { maxPoolSize, maxConnecting } = this.options; + while (this.waitQueueSize > 0 && this.pendingConnectionCount < maxConnecting && (maxPoolSize === 0 || this.totalConnectionCount < maxPoolSize)) { + const waitQueueMember = this.waitQueue.shift(); + if (!waitQueueMember || waitQueueMember.cancelled) { + continue; + } + this.createConnection((err, connection) => { + if (waitQueueMember.cancelled) { + if (!err && connection) { + this.connections.push(connection); + } + } else { + if (err) { + this.emitAndLog( + _ConnectionPool.CONNECTION_CHECK_OUT_FAILED, + // TODO(NODE-5192): Remove this cast + new connection_pool_events_1.ConnectionCheckOutFailedEvent(this, "connectionError", waitQueueMember.checkoutTime, err) + ); + waitQueueMember.reject(err); + } else if (connection) { + this.checkedOut.add(connection); + this.emitAndLog(_ConnectionPool.CONNECTION_CHECKED_OUT, new connection_pool_events_1.ConnectionCheckedOutEvent(this, connection, waitQueueMember.checkoutTime)); + waitQueueMember.resolve(connection); + } + } + process.nextTick(() => this.processWaitQueue()); + }); + } + this.processingWaitQueue = false; + } + }; + exports2.ConnectionPool = ConnectionPool; + ConnectionPool.CONNECTION_POOL_CREATED = constants_1.CONNECTION_POOL_CREATED; + ConnectionPool.CONNECTION_POOL_CLOSED = constants_1.CONNECTION_POOL_CLOSED; + ConnectionPool.CONNECTION_POOL_CLEARED = constants_1.CONNECTION_POOL_CLEARED; + ConnectionPool.CONNECTION_POOL_READY = constants_1.CONNECTION_POOL_READY; + ConnectionPool.CONNECTION_CREATED = constants_1.CONNECTION_CREATED; + ConnectionPool.CONNECTION_READY = constants_1.CONNECTION_READY; + ConnectionPool.CONNECTION_CLOSED = constants_1.CONNECTION_CLOSED; + ConnectionPool.CONNECTION_CHECK_OUT_STARTED = constants_1.CONNECTION_CHECK_OUT_STARTED; + ConnectionPool.CONNECTION_CHECK_OUT_FAILED = constants_1.CONNECTION_CHECK_OUT_FAILED; + ConnectionPool.CONNECTION_CHECKED_OUT = constants_1.CONNECTION_CHECKED_OUT; + ConnectionPool.CONNECTION_CHECKED_IN = constants_1.CONNECTION_CHECKED_IN; + } +}); + +// node_modules/mongodb/lib/sdam/server.js +var require_server = __commonJS({ + "node_modules/mongodb/lib/sdam/server.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Server = void 0; + var connection_1 = require_connection(); + var connection_pool_1 = require_connection_pool(); + var errors_1 = require_errors2(); + var constants_1 = require_constants2(); + var error_1 = require_error(); + var mongo_types_1 = require_mongo_types(); + var aggregate_1 = require_aggregate(); + var transactions_1 = require_transactions(); + var utils_1 = require_utils3(); + var write_concern_1 = require_write_concern(); + var common_1 = require_common(); + var monitor_1 = require_monitor(); + var server_description_1 = require_server_description(); + var server_selection_1 = require_server_selection(); + var stateTransition = (0, utils_1.makeStateMachine)({ + [common_1.STATE_CLOSED]: [common_1.STATE_CLOSED, common_1.STATE_CONNECTING], + [common_1.STATE_CONNECTING]: [common_1.STATE_CONNECTING, common_1.STATE_CLOSING, common_1.STATE_CONNECTED, common_1.STATE_CLOSED], + [common_1.STATE_CONNECTED]: [common_1.STATE_CONNECTED, common_1.STATE_CLOSING, common_1.STATE_CLOSED], + [common_1.STATE_CLOSING]: [common_1.STATE_CLOSING, common_1.STATE_CLOSED] + }); + var Server = class _Server extends mongo_types_1.TypedEventEmitter { + /** + * Create a server + */ + constructor(topology, description, options) { + super(); + this.on("error", utils_1.noop); + this.serverApi = options.serverApi; + const poolOptions = { hostAddress: description.hostAddress, ...options }; + this.topology = topology; + this.pool = new connection_pool_1.ConnectionPool(this, poolOptions); + this.s = { + description, + options, + state: common_1.STATE_CLOSED, + operationCount: 0 + }; + for (const event of [...constants_1.CMAP_EVENTS, ...constants_1.APM_EVENTS]) { + this.pool.on(event, (e4) => this.emit(event, e4)); + } + this.pool.on(connection_1.Connection.CLUSTER_TIME_RECEIVED, (clusterTime) => { + this.clusterTime = clusterTime; + }); + if (this.loadBalanced) { + this.monitor = null; + return; + } + this.monitor = new monitor_1.Monitor(this, this.s.options); + for (const event of constants_1.HEARTBEAT_EVENTS) { + this.monitor.on(event, (e4) => this.emit(event, e4)); + } + this.monitor.on("resetServer", (error2) => markServerUnknown(this, error2)); + this.monitor.on(_Server.SERVER_HEARTBEAT_SUCCEEDED, (event) => { + this.emit(_Server.DESCRIPTION_RECEIVED, new server_description_1.ServerDescription(this.description.hostAddress, event.reply, { + roundTripTime: this.monitor?.roundTripTime, + minRoundTripTime: this.monitor?.minRoundTripTime + })); + if (this.s.state === common_1.STATE_CONNECTING) { + stateTransition(this, common_1.STATE_CONNECTED); + this.emit(_Server.CONNECT, this); + } + }); + } + get clusterTime() { + return this.topology.clusterTime; + } + set clusterTime(clusterTime) { + this.topology.clusterTime = clusterTime; + } + get description() { + return this.s.description; + } + get name() { + return this.s.description.address; + } + get autoEncrypter() { + if (this.s.options && this.s.options.autoEncrypter) { + return this.s.options.autoEncrypter; + } + return; + } + get loadBalanced() { + return this.topology.description.type === common_1.TopologyType.LoadBalanced; + } + /** + * Initiate server connect + */ + connect() { + if (this.s.state !== common_1.STATE_CLOSED) { + return; + } + stateTransition(this, common_1.STATE_CONNECTING); + if (!this.loadBalanced) { + this.monitor?.connect(); + } else { + stateTransition(this, common_1.STATE_CONNECTED); + this.emit(_Server.CONNECT, this); + } + } + closeCheckedOutConnections() { + return this.pool.closeCheckedOutConnections(); + } + /** Destroy the server connection */ + close() { + if (this.s.state === common_1.STATE_CLOSED) { + return; + } + stateTransition(this, common_1.STATE_CLOSING); + if (!this.loadBalanced) { + this.monitor?.close(); + } + this.pool.close(); + stateTransition(this, common_1.STATE_CLOSED); + this.emit("closed"); + } + /** + * Immediately schedule monitoring of this server. If there already an attempt being made + * this will be a no-op. + */ + requestCheck() { + if (!this.loadBalanced) { + this.monitor?.requestCheck(); + } + } + async command(operation2, timeoutContext) { + if (this.s.state === common_1.STATE_CLOSING || this.s.state === common_1.STATE_CLOSED) { + throw new error_1.MongoServerClosedError(); + } + const session = operation2.session; + let conn = session?.pinnedConnection; + this.incrementOperationCount(); + if (conn == null) { + try { + conn = await this.pool.checkOut({ timeoutContext, signal: operation2.options.signal }); + } catch (checkoutError) { + this.decrementOperationCount(); + if (!(checkoutError instanceof errors_1.PoolClearedError)) + this.handleError(checkoutError); + throw checkoutError; + } + } + let reauthPromise = null; + const cleanup = () => { + this.decrementOperationCount(); + if (session?.pinnedConnection !== conn) { + if (reauthPromise != null) { + const checkBackIn = () => { + this.pool.checkIn(conn); + }; + void reauthPromise.then(checkBackIn, checkBackIn); + } else { + this.pool.checkIn(conn); + } + } + }; + let cmd; + try { + cmd = operation2.buildCommand(conn, session); + } catch (e4) { + cleanup(); + throw e4; + } + const options = operation2.buildOptions(timeoutContext); + const ns = operation2.ns; + if (this.loadBalanced && isPinnableCommand(cmd, session) && !session?.pinnedConnection) { + session?.pin(conn); + } + options.directConnection = this.topology.s.options.directConnection; + const omitReadPreference = operation2 instanceof aggregate_1.AggregateOperation && operation2.hasWriteStage && (0, utils_1.maxWireVersion)(conn) < server_selection_1.MIN_SECONDARY_WRITE_WIRE_VERSION; + if (omitReadPreference) { + delete options.readPreference; + } + if (this.description.iscryptd) { + options.omitMaxTimeMS = true; + } + try { + try { + const res = await conn.command(ns, cmd, options, operation2.SERVER_COMMAND_RESPONSE_TYPE); + (0, write_concern_1.throwIfWriteConcernError)(res); + return res; + } catch (commandError) { + throw this.decorateCommandError(conn, cmd, options, commandError); + } + } catch (operationError) { + if (operationError instanceof error_1.MongoError && operationError.code === error_1.MONGODB_ERROR_CODES.Reauthenticate) { + reauthPromise = this.pool.reauthenticate(conn); + reauthPromise.then(void 0, (error2) => { + reauthPromise = null; + (0, utils_1.squashError)(error2); + }); + await (0, utils_1.abortable)(reauthPromise, options); + reauthPromise = null; + try { + const res = await conn.command(ns, cmd, options, operation2.SERVER_COMMAND_RESPONSE_TYPE); + (0, write_concern_1.throwIfWriteConcernError)(res); + return res; + } catch (commandError) { + throw this.decorateCommandError(conn, cmd, options, commandError); + } + } else { + throw operationError; + } + } finally { + cleanup(); + } + } + /** + * Handle SDAM error + * @internal + */ + handleError(error2, connection) { + if (!(error2 instanceof error_1.MongoError)) { + return; + } + const isStaleError = error2.connectionGeneration && error2.connectionGeneration < this.pool.generation; + if (isStaleError) { + return; + } + const isNetworkNonTimeoutError = error2 instanceof error_1.MongoNetworkError && !(error2 instanceof error_1.MongoNetworkTimeoutError); + const isNetworkTimeoutBeforeHandshakeError = error2 instanceof error_1.MongoNetworkError && error2.beforeHandshake; + const isAuthHandshakeError = error2.hasErrorLabel(error_1.MongoErrorLabel.HandshakeError); + if (isNetworkNonTimeoutError || isNetworkTimeoutBeforeHandshakeError || isAuthHandshakeError) { + if (!this.loadBalanced) { + error2.addErrorLabel(error_1.MongoErrorLabel.ResetPool); + markServerUnknown(this, error2); + } else if (connection) { + this.pool.clear({ serviceId: connection.serviceId }); + } + } else { + if ((0, error_1.isSDAMUnrecoverableError)(error2)) { + if (shouldHandleStateChangeError(this, error2)) { + const shouldClearPool = (0, error_1.isNodeShuttingDownError)(error2); + if (this.loadBalanced && connection && shouldClearPool) { + this.pool.clear({ serviceId: connection.serviceId }); + } + if (!this.loadBalanced) { + if (shouldClearPool) { + error2.addErrorLabel(error_1.MongoErrorLabel.ResetPool); + } + markServerUnknown(this, error2); + process.nextTick(() => this.requestCheck()); + } + } + } + } + } + /** + * Ensure that error is properly decorated and internal state is updated before throwing + * @internal + */ + decorateCommandError(connection, cmd, options, error2) { + if (typeof error2 !== "object" || error2 == null || !("name" in error2)) { + throw new error_1.MongoRuntimeError("An unexpected error type: " + typeof error2); + } + if (error2.name === "AbortError" && "cause" in error2 && error2.cause instanceof error_1.MongoError) { + error2 = error2.cause; + } + if (!(error2 instanceof error_1.MongoError)) { + return error2; + } + if (connectionIsStale(this.pool, connection)) { + return error2; + } + const session = options?.session; + if (error2 instanceof error_1.MongoNetworkError) { + if (session && !session.hasEnded && session.serverSession) { + session.serverSession.isDirty = true; + } + if (inActiveTransaction(session, cmd) && !error2.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + error2.addErrorLabel(error_1.MongoErrorLabel.TransientTransactionError); + } + if ((isRetryableWritesEnabled(this.topology) || (0, transactions_1.isTransactionCommand)(cmd)) && (0, utils_1.supportsRetryableWrites)(this) && !inActiveTransaction(session, cmd)) { + error2.addErrorLabel(error_1.MongoErrorLabel.RetryableWriteError); + } + } else { + if ((isRetryableWritesEnabled(this.topology) || (0, transactions_1.isTransactionCommand)(cmd)) && (0, error_1.needsRetryableWriteLabel)(error2, (0, utils_1.maxWireVersion)(this), this.description.type) && !inActiveTransaction(session, cmd)) { + error2.addErrorLabel(error_1.MongoErrorLabel.RetryableWriteError); + } + } + if (session && session.isPinned && error2.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + session.unpin({ force: true }); + } + this.handleError(error2, connection); + return error2; + } + /** + * Decrement the operation count, returning the new count. + */ + decrementOperationCount() { + return this.s.operationCount -= 1; + } + /** + * Increment the operation count, returning the new count. + */ + incrementOperationCount() { + return this.s.operationCount += 1; + } + }; + exports2.Server = Server; + Server.SERVER_HEARTBEAT_STARTED = constants_1.SERVER_HEARTBEAT_STARTED; + Server.SERVER_HEARTBEAT_SUCCEEDED = constants_1.SERVER_HEARTBEAT_SUCCEEDED; + Server.SERVER_HEARTBEAT_FAILED = constants_1.SERVER_HEARTBEAT_FAILED; + Server.CONNECT = constants_1.CONNECT; + Server.DESCRIPTION_RECEIVED = constants_1.DESCRIPTION_RECEIVED; + Server.CLOSED = constants_1.CLOSED; + Server.ENDED = constants_1.ENDED; + function markServerUnknown(server, error2) { + if (server.loadBalanced) { + return; + } + if (error2 instanceof error_1.MongoNetworkError && !(error2 instanceof error_1.MongoNetworkTimeoutError)) { + server.monitor?.reset(); + } + server.emit(Server.DESCRIPTION_RECEIVED, new server_description_1.ServerDescription(server.description.hostAddress, void 0, { error: error2 })); + } + function isPinnableCommand(cmd, session) { + if (session) { + return session.inTransaction() || session.transaction.isCommitted && "commitTransaction" in cmd || "aggregate" in cmd || "find" in cmd || "getMore" in cmd || "listCollections" in cmd || "listIndexes" in cmd || "bulkWrite" in cmd; + } + return false; + } + function connectionIsStale(pool, connection) { + if (connection.serviceId) { + return connection.generation !== pool.serviceGenerations.get(connection.serviceId.toHexString()); + } + return connection.generation !== pool.generation; + } + function shouldHandleStateChangeError(server, err) { + const etv = err.topologyVersion; + const stv = server.description.topologyVersion; + return (0, server_description_1.compareTopologyVersion)(stv, etv) < 0; + } + function inActiveTransaction(session, cmd) { + return session && session.inTransaction() && !(0, transactions_1.isTransactionCommand)(cmd); + } + function isRetryableWritesEnabled(topology) { + return topology.s.options.retryWrites !== false; + } + } +}); + +// node_modules/mongodb/lib/sdam/monitor.js +var require_monitor = __commonJS({ + "node_modules/mongodb/lib/sdam/monitor.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RTTSampler = exports2.MonitorInterval = exports2.RTTPinger = exports2.Monitor = exports2.ServerMonitoringMode = void 0; + var timers_1 = require("timers"); + var bson_1 = require_bson2(); + var connect_1 = require_connect(); + var client_metadata_1 = require_client_metadata(); + var constants_1 = require_constants2(); + var error_1 = require_error(); + var mongo_logger_1 = require_mongo_logger(); + var mongo_types_1 = require_mongo_types(); + var utils_1 = require_utils3(); + var common_1 = require_common(); + var events_1 = require_events(); + var server_1 = require_server(); + var STATE_IDLE = "idle"; + var STATE_MONITORING = "monitoring"; + var stateTransition = (0, utils_1.makeStateMachine)({ + [common_1.STATE_CLOSING]: [common_1.STATE_CLOSING, STATE_IDLE, common_1.STATE_CLOSED], + [common_1.STATE_CLOSED]: [common_1.STATE_CLOSED, STATE_MONITORING], + [STATE_IDLE]: [STATE_IDLE, STATE_MONITORING, common_1.STATE_CLOSING], + [STATE_MONITORING]: [STATE_MONITORING, STATE_IDLE, common_1.STATE_CLOSING] + }); + var INVALID_REQUEST_CHECK_STATES = /* @__PURE__ */ new Set([common_1.STATE_CLOSING, common_1.STATE_CLOSED, STATE_MONITORING]); + function isInCloseState(monitor) { + return monitor.s.state === common_1.STATE_CLOSED || monitor.s.state === common_1.STATE_CLOSING; + } + exports2.ServerMonitoringMode = Object.freeze({ + auto: "auto", + poll: "poll", + stream: "stream" + }); + var Monitor = class extends mongo_types_1.TypedEventEmitter { + constructor(server, options) { + super(); + this.component = mongo_logger_1.MongoLoggableComponent.TOPOLOGY; + this.on("error", utils_1.noop); + this.server = server; + this.connection = null; + this.cancellationToken = new mongo_types_1.CancellationToken(); + this.cancellationToken.setMaxListeners(Infinity); + this.monitorId = void 0; + this.s = { + state: common_1.STATE_CLOSED + }; + this.address = server.description.address; + this.options = Object.freeze({ + connectTimeoutMS: options.connectTimeoutMS ?? 1e4, + heartbeatFrequencyMS: options.heartbeatFrequencyMS ?? 1e4, + minHeartbeatFrequencyMS: options.minHeartbeatFrequencyMS ?? 500, + serverMonitoringMode: options.serverMonitoringMode + }); + this.isRunningInFaasEnv = (0, client_metadata_1.getFAASEnv)() != null; + this.mongoLogger = this.server.topology.client?.mongoLogger; + this.rttSampler = new RTTSampler(10); + const cancellationToken = this.cancellationToken; + const connectOptions = { + id: "", + generation: server.pool.generation, + cancellationToken, + hostAddress: server.description.hostAddress, + ...options, + // force BSON serialization options + raw: false, + useBigInt64: false, + promoteLongs: true, + promoteValues: true, + promoteBuffers: true + }; + delete connectOptions.credentials; + if (connectOptions.autoEncrypter) { + delete connectOptions.autoEncrypter; + } + this.connectOptions = Object.freeze(connectOptions); + } + connect() { + if (this.s.state !== common_1.STATE_CLOSED) { + return; + } + const heartbeatFrequencyMS = this.options.heartbeatFrequencyMS; + const minHeartbeatFrequencyMS = this.options.minHeartbeatFrequencyMS; + this.monitorId = new MonitorInterval(monitorServer(this), { + heartbeatFrequencyMS, + minHeartbeatFrequencyMS, + immediate: true + }); + } + requestCheck() { + if (INVALID_REQUEST_CHECK_STATES.has(this.s.state)) { + return; + } + this.monitorId?.wake(); + } + reset() { + const topologyVersion = this.server.description.topologyVersion; + if (isInCloseState(this) || topologyVersion == null) { + return; + } + stateTransition(this, common_1.STATE_CLOSING); + resetMonitorState(this); + stateTransition(this, STATE_IDLE); + const heartbeatFrequencyMS = this.options.heartbeatFrequencyMS; + const minHeartbeatFrequencyMS = this.options.minHeartbeatFrequencyMS; + this.monitorId = new MonitorInterval(monitorServer(this), { + heartbeatFrequencyMS, + minHeartbeatFrequencyMS + }); + } + close() { + if (isInCloseState(this)) { + return; + } + stateTransition(this, common_1.STATE_CLOSING); + resetMonitorState(this); + this.emit("close"); + stateTransition(this, common_1.STATE_CLOSED); + } + get roundTripTime() { + return this.rttSampler.average(); + } + get minRoundTripTime() { + return this.rttSampler.min(); + } + get latestRtt() { + return this.rttSampler.last; + } + addRttSample(rtt) { + this.rttSampler.addSample(rtt); + } + clearRttSamples() { + this.rttSampler.clear(); + } + }; + exports2.Monitor = Monitor; + function resetMonitorState(monitor) { + monitor.monitorId?.stop(); + monitor.monitorId = void 0; + monitor.rttPinger?.close(); + monitor.rttPinger = void 0; + monitor.cancellationToken.emit("cancel"); + monitor.connection?.destroy(); + monitor.connection = null; + monitor.clearRttSamples(); + } + function useStreamingProtocol(monitor, topologyVersion) { + if (topologyVersion == null) + return false; + const serverMonitoringMode = monitor.options.serverMonitoringMode; + if (serverMonitoringMode === exports2.ServerMonitoringMode.poll) + return false; + if (serverMonitoringMode === exports2.ServerMonitoringMode.stream) + return true; + if (monitor.isRunningInFaasEnv) + return false; + return true; + } + function checkServer(monitor, callback) { + let start; + let awaited; + const topologyVersion = monitor.server.description.topologyVersion; + const isAwaitable = useStreamingProtocol(monitor, topologyVersion); + monitor.emitAndLogHeartbeat(server_1.Server.SERVER_HEARTBEAT_STARTED, monitor.server.topology.s.id, void 0, new events_1.ServerHeartbeatStartedEvent(monitor.address, isAwaitable)); + function onHeartbeatFailed(err) { + monitor.connection?.destroy(); + monitor.connection = null; + monitor.emitAndLogHeartbeat(server_1.Server.SERVER_HEARTBEAT_FAILED, monitor.server.topology.s.id, void 0, new events_1.ServerHeartbeatFailedEvent(monitor.address, (0, utils_1.calculateDurationInMs)(start), err, awaited)); + const error2 = !(err instanceof error_1.MongoError) ? new error_1.MongoError(error_1.MongoError.buildErrorMessage(err), { cause: err }) : err; + error2.addErrorLabel(error_1.MongoErrorLabel.ResetPool); + if (error2 instanceof error_1.MongoNetworkTimeoutError) { + error2.addErrorLabel(error_1.MongoErrorLabel.InterruptInUseConnections); + } + monitor.emit("resetServer", error2); + callback(err); + } + function onHeartbeatSucceeded(hello) { + if (!("isWritablePrimary" in hello)) { + hello.isWritablePrimary = hello[constants_1.LEGACY_HELLO_COMMAND]; + } + const duration = isAwaitable && monitor.rttPinger ? monitor.rttPinger.latestRtt ?? (0, utils_1.calculateDurationInMs)(start) : (0, utils_1.calculateDurationInMs)(start); + monitor.addRttSample(duration); + monitor.emitAndLogHeartbeat(server_1.Server.SERVER_HEARTBEAT_SUCCEEDED, monitor.server.topology.s.id, hello.connectionId, new events_1.ServerHeartbeatSucceededEvent(monitor.address, duration, hello, isAwaitable)); + if (isAwaitable) { + monitor.emitAndLogHeartbeat(server_1.Server.SERVER_HEARTBEAT_STARTED, monitor.server.topology.s.id, void 0, new events_1.ServerHeartbeatStartedEvent(monitor.address, true)); + start = (0, utils_1.now)(); + } else { + monitor.rttPinger?.close(); + monitor.rttPinger = void 0; + callback(void 0, hello); + } + } + const { connection } = monitor; + if (connection && !connection.closed) { + const { serverApi, helloOk } = connection; + const connectTimeoutMS = monitor.options.connectTimeoutMS; + const maxAwaitTimeMS = monitor.options.heartbeatFrequencyMS; + const cmd = { + [serverApi?.version || helloOk ? "hello" : constants_1.LEGACY_HELLO_COMMAND]: 1, + ...isAwaitable && topologyVersion ? { maxAwaitTimeMS, topologyVersion: makeTopologyVersion(topologyVersion) } : {} + }; + const options = isAwaitable ? { + socketTimeoutMS: connectTimeoutMS ? connectTimeoutMS + maxAwaitTimeMS : 0, + exhaustAllowed: true + } : { socketTimeoutMS: connectTimeoutMS }; + if (isAwaitable && monitor.rttPinger == null) { + monitor.rttPinger = new RTTPinger(monitor); + } + start = (0, utils_1.now)(); + if (isAwaitable) { + awaited = true; + return connection.exhaustCommand((0, utils_1.ns)("admin.$cmd"), cmd, options, (error2, hello) => { + if (error2) + return onHeartbeatFailed(error2); + return onHeartbeatSucceeded(hello); + }); + } + awaited = false; + connection.command((0, utils_1.ns)("admin.$cmd"), cmd, options).then(onHeartbeatSucceeded, onHeartbeatFailed); + return; + } + (async () => { + const socket = await (0, connect_1.makeSocket)(monitor.connectOptions); + const connection2 = (0, connect_1.makeConnection)(monitor.connectOptions, socket); + start = (0, utils_1.now)(); + try { + await (0, connect_1.performInitialHandshake)(connection2, monitor.connectOptions); + return connection2; + } catch (error2) { + connection2.destroy(); + throw error2; + } + })().then((connection2) => { + if (isInCloseState(monitor)) { + connection2.destroy(); + return; + } + const duration = (0, utils_1.calculateDurationInMs)(start); + monitor.addRttSample(duration); + monitor.connection = connection2; + monitor.emitAndLogHeartbeat(server_1.Server.SERVER_HEARTBEAT_SUCCEEDED, monitor.server.topology.s.id, connection2.hello?.connectionId, new events_1.ServerHeartbeatSucceededEvent(monitor.address, duration, connection2.hello, useStreamingProtocol(monitor, connection2.hello?.topologyVersion))); + callback(void 0, connection2.hello); + }, (error2) => { + monitor.connection = null; + awaited = false; + onHeartbeatFailed(error2); + }); + } + function monitorServer(monitor) { + return (callback) => { + if (monitor.s.state === STATE_MONITORING) { + process.nextTick(callback); + return; + } + stateTransition(monitor, STATE_MONITORING); + function done() { + if (!isInCloseState(monitor)) { + stateTransition(monitor, STATE_IDLE); + } + callback(); + } + checkServer(monitor, (err, hello) => { + if (err) { + if (monitor.server.description.type === common_1.ServerType.Unknown) { + return done(); + } + } + if (useStreamingProtocol(monitor, hello?.topologyVersion)) { + (0, timers_1.setTimeout)(() => { + if (!isInCloseState(monitor)) { + monitor.monitorId?.wake(); + } + }, 0); + } + done(); + }); + }; + } + function makeTopologyVersion(tv) { + return { + processId: tv.processId, + // tests mock counter as just number, but in a real situation counter should always be a Long + // TODO(NODE-2674): Preserve int64 sent from MongoDB + counter: bson_1.Long.isLong(tv.counter) ? tv.counter : bson_1.Long.fromNumber(tv.counter) + }; + } + var RTTPinger = class { + constructor(monitor) { + this.connection = void 0; + this.cancellationToken = monitor.cancellationToken; + this.closed = false; + this.monitor = monitor; + this.latestRtt = monitor.latestRtt ?? void 0; + const heartbeatFrequencyMS = monitor.options.heartbeatFrequencyMS; + this.monitorId = (0, timers_1.setTimeout)(() => this.measureRoundTripTime(), heartbeatFrequencyMS); + } + get roundTripTime() { + return this.monitor.roundTripTime; + } + get minRoundTripTime() { + return this.monitor.minRoundTripTime; + } + close() { + this.closed = true; + (0, timers_1.clearTimeout)(this.monitorId); + this.connection?.destroy(); + this.connection = void 0; + } + measureAndReschedule(start, conn) { + if (this.closed) { + conn?.destroy(); + return; + } + if (this.connection == null) { + this.connection = conn; + } + this.latestRtt = (0, utils_1.calculateDurationInMs)(start); + this.monitorId = (0, timers_1.setTimeout)(() => this.measureRoundTripTime(), this.monitor.options.heartbeatFrequencyMS); + } + measureRoundTripTime() { + const start = (0, utils_1.now)(); + if (this.closed) { + return; + } + const connection = this.connection; + if (connection == null) { + (0, connect_1.connect)(this.monitor.connectOptions).then((connection2) => { + this.measureAndReschedule(start, connection2); + }, () => { + this.connection = void 0; + }); + return; + } + const commandName = connection.serverApi?.version || connection.helloOk ? "hello" : constants_1.LEGACY_HELLO_COMMAND; + connection.command((0, utils_1.ns)("admin.$cmd"), { [commandName]: 1 }, void 0).then(() => this.measureAndReschedule(start), () => { + this.connection?.destroy(); + this.connection = void 0; + return; + }); + } + }; + exports2.RTTPinger = RTTPinger; + var MonitorInterval = class { + constructor(fn2, options = {}) { + this.isExpeditedCallToFnScheduled = false; + this.stopped = false; + this.isExecutionInProgress = false; + this.hasExecutedOnce = false; + this._executeAndReschedule = () => { + if (this.stopped) + return; + if (this.timerId) { + (0, timers_1.clearTimeout)(this.timerId); + } + this.isExpeditedCallToFnScheduled = false; + this.isExecutionInProgress = true; + this.fn(() => { + this.lastExecutionEnded = (0, utils_1.now)(); + this.isExecutionInProgress = false; + this._reschedule(this.heartbeatFrequencyMS); + }); + }; + this.fn = fn2; + this.lastExecutionEnded = -Infinity; + this.heartbeatFrequencyMS = options.heartbeatFrequencyMS ?? 1e3; + this.minHeartbeatFrequencyMS = options.minHeartbeatFrequencyMS ?? 500; + if (options.immediate) { + this._executeAndReschedule(); + } else { + this._reschedule(void 0); + } + } + wake() { + const currentTime = (0, utils_1.now)(); + const timeSinceLastCall = currentTime - this.lastExecutionEnded; + if (timeSinceLastCall < 0) { + return this._executeAndReschedule(); + } + if (this.isExecutionInProgress) { + return; + } + if (this.isExpeditedCallToFnScheduled) { + return; + } + if (timeSinceLastCall < this.minHeartbeatFrequencyMS) { + this.isExpeditedCallToFnScheduled = true; + this._reschedule(this.minHeartbeatFrequencyMS - timeSinceLastCall); + return; + } + this._executeAndReschedule(); + } + stop() { + this.stopped = true; + if (this.timerId) { + (0, timers_1.clearTimeout)(this.timerId); + this.timerId = void 0; + } + this.lastExecutionEnded = -Infinity; + this.isExpeditedCallToFnScheduled = false; + } + toString() { + return JSON.stringify(this); + } + toJSON() { + const currentTime = (0, utils_1.now)(); + const timeSinceLastCall = currentTime - this.lastExecutionEnded; + return { + timerId: this.timerId != null ? "set" : "cleared", + lastCallTime: this.lastExecutionEnded, + isExpeditedCheckScheduled: this.isExpeditedCallToFnScheduled, + stopped: this.stopped, + heartbeatFrequencyMS: this.heartbeatFrequencyMS, + minHeartbeatFrequencyMS: this.minHeartbeatFrequencyMS, + currentTime, + timeSinceLastCall + }; + } + _reschedule(ms) { + if (this.stopped) + return; + if (this.timerId) { + (0, timers_1.clearTimeout)(this.timerId); + } + this.timerId = (0, timers_1.setTimeout)(this._executeAndReschedule, ms || this.heartbeatFrequencyMS); + } + }; + exports2.MonitorInterval = MonitorInterval; + var RTTSampler = class { + constructor(windowSize = 10) { + this.rttSamples = new Float64Array(windowSize); + this.length = 0; + this.writeIndex = 0; + } + /** + * Adds an rtt sample to the end of the circular buffer + * When `windowSize` samples have been collected, `addSample` overwrites the least recently added + * sample + */ + addSample(sample) { + this.rttSamples[this.writeIndex++] = sample; + if (this.length < this.rttSamples.length) { + this.length++; + } + this.writeIndex %= this.rttSamples.length; + } + /** + * When \< 2 samples have been collected, returns 0 + * Otherwise computes the minimum value samples contained in the buffer + */ + min() { + if (this.length < 2) + return 0; + let min = this.rttSamples[0]; + for (let i4 = 1; i4 < this.length; i4++) { + if (this.rttSamples[i4] < min) + min = this.rttSamples[i4]; + } + return min; + } + /** + * Returns mean of samples contained in the buffer + */ + average() { + if (this.length === 0) + return 0; + let sum = 0; + for (let i4 = 0; i4 < this.length; i4++) { + sum += this.rttSamples[i4]; + } + return sum / this.length; + } + /** + * Returns most recently inserted element in the buffer + * Returns null if the buffer is empty + * */ + get last() { + if (this.length === 0) + return null; + return this.rttSamples[this.writeIndex === 0 ? this.length - 1 : this.writeIndex - 1]; + } + /** + * Clear the buffer + * NOTE: this does not overwrite the data held in the internal array, just the pointers into + * this array + */ + clear() { + this.length = 0; + this.writeIndex = 0; + } + }; + exports2.RTTSampler = RTTSampler; + } +}); + +// node_modules/mongodb/lib/connection_string.js +var require_connection_string = __commonJS({ + "node_modules/mongodb/lib/connection_string.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DEFAULT_OPTIONS = exports2.OPTIONS = void 0; + exports2.resolveSRVRecord = resolveSRVRecord; + exports2.parseOptions = parseOptions; + var dns = require("dns"); + var mongodb_connection_string_url_1 = require_lib5(); + var url_1 = require("url"); + var mongo_credentials_1 = require_mongo_credentials(); + var providers_1 = require_providers(); + var compression_1 = require_compression(); + var encrypter_1 = require_encrypter(); + var error_1 = require_error(); + var mongo_client_1 = require_mongo_client(); + var mongo_logger_1 = require_mongo_logger(); + var read_concern_1 = require_read_concern(); + var read_preference_1 = require_read_preference(); + var monitor_1 = require_monitor(); + var utils_1 = require_utils3(); + var write_concern_1 = require_write_concern(); + var VALID_TXT_RECORDS = ["authSource", "replicaSet", "loadBalanced"]; + var LB_SINGLE_HOST_ERROR = "loadBalanced option only supported with a single host in the URI"; + var LB_REPLICA_SET_ERROR = "loadBalanced option not supported with a replicaSet option"; + var LB_DIRECT_CONNECTION_ERROR = "loadBalanced option not supported when directConnection is provided"; + function retryDNSTimeoutFor(api) { + return async function dnsReqRetryTimeout(lookupAddress) { + try { + return await dns.promises[api](lookupAddress); + } catch (firstDNSError) { + if (firstDNSError.code === dns.TIMEOUT) { + return await dns.promises[api](lookupAddress); + } else { + throw firstDNSError; + } + } + }; + } + var resolveSrv = retryDNSTimeoutFor("resolveSrv"); + var resolveTxt = retryDNSTimeoutFor("resolveTxt"); + async function resolveSRVRecord(options) { + if (typeof options.srvHost !== "string") { + throw new error_1.MongoAPIError('Option "srvHost" must not be empty'); + } + const lookupAddress = options.srvHost; + const txtResolutionPromise = resolveTxt(lookupAddress); + txtResolutionPromise.then(void 0, utils_1.squashError); + const hostname = `_${options.srvServiceName}._tcp.${lookupAddress}`; + const addresses = await resolveSrv(hostname); + if (addresses.length === 0) { + throw new error_1.MongoAPIError("No addresses found at host"); + } + for (const { name } of addresses) { + (0, utils_1.checkParentDomainMatch)(name, lookupAddress); + } + const hostAddresses = addresses.map((r4) => utils_1.HostAddress.fromString(`${r4.name}:${r4.port ?? 27017}`)); + validateLoadBalancedOptions(hostAddresses, options, true); + let record; + try { + record = await txtResolutionPromise; + } catch (error2) { + if (error2.code !== "ENODATA" && error2.code !== "ENOTFOUND") { + throw error2; + } + return hostAddresses; + } + if (record.length > 1) { + throw new error_1.MongoParseError("Multiple text records not allowed"); + } + const txtRecordOptions = new url_1.URLSearchParams(record[0].join("")); + const txtRecordOptionKeys = [...txtRecordOptions.keys()]; + if (txtRecordOptionKeys.some((key) => !VALID_TXT_RECORDS.includes(key))) { + throw new error_1.MongoParseError(`Text record may only set any of: ${VALID_TXT_RECORDS.join(", ")}`); + } + if (VALID_TXT_RECORDS.some((option) => txtRecordOptions.get(option) === "")) { + throw new error_1.MongoParseError("Cannot have empty URI params in DNS TXT Record"); + } + const source = txtRecordOptions.get("authSource") ?? void 0; + const replicaSet = txtRecordOptions.get("replicaSet") ?? void 0; + const loadBalanced = txtRecordOptions.get("loadBalanced") ?? void 0; + if (!options.userSpecifiedAuthSource && source && options.credentials && !providers_1.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(options.credentials.mechanism)) { + options.credentials = mongo_credentials_1.MongoCredentials.merge(options.credentials, { source }); + } + if (!options.userSpecifiedReplicaSet && replicaSet) { + options.replicaSet = replicaSet; + } + if (loadBalanced === "true") { + options.loadBalanced = true; + } + if (options.replicaSet && options.srvMaxHosts > 0) { + throw new error_1.MongoParseError("Cannot combine replicaSet option with srvMaxHosts"); + } + validateLoadBalancedOptions(hostAddresses, options, true); + return hostAddresses; + } + function checkTLSOptions(allOptions) { + if (!allOptions) + return; + const check = (a4, b4) => { + if (allOptions.has(a4) && allOptions.has(b4)) { + throw new error_1.MongoAPIError(`The '${a4}' option cannot be used with the '${b4}' option`); + } + }; + check("tlsInsecure", "tlsAllowInvalidCertificates"); + check("tlsInsecure", "tlsAllowInvalidHostnames"); + } + function getBoolean(name, value) { + if (typeof value === "boolean") + return value; + switch (value) { + case "true": + return true; + case "false": + return false; + default: + throw new error_1.MongoParseError(`${name} must be either "true" or "false"`); + } + } + function getIntFromOptions(name, value) { + const parsedInt = (0, utils_1.parseInteger)(value); + if (parsedInt != null) { + return parsedInt; + } + throw new error_1.MongoParseError(`Expected ${name} to be stringified int value, got: ${value}`); + } + function getUIntFromOptions(name, value) { + const parsedValue = getIntFromOptions(name, value); + if (parsedValue < 0) { + throw new error_1.MongoParseError(`${name} can only be a positive int value, got: ${value}`); + } + return parsedValue; + } + function* entriesFromString(value) { + if (value === "") { + return; + } + const keyValuePairs = value.split(","); + for (const keyValue of keyValuePairs) { + const [key, value2] = keyValue.split(/:(.*)/); + if (value2 == null) { + throw new error_1.MongoParseError("Cannot have undefined values in key value pairs"); + } + yield [key, value2]; + } + } + var CaseInsensitiveMap = class extends Map { + constructor(entries = []) { + super(entries.map(([k4, v4]) => [k4.toLowerCase(), v4])); + } + has(k4) { + return super.has(k4.toLowerCase()); + } + get(k4) { + return super.get(k4.toLowerCase()); + } + set(k4, v4) { + return super.set(k4.toLowerCase(), v4); + } + delete(k4) { + return super.delete(k4.toLowerCase()); + } + }; + function parseOptions(uri, mongoClient = void 0, options = {}) { + if (mongoClient != null && !(mongoClient instanceof mongo_client_1.MongoClient)) { + options = mongoClient; + mongoClient = void 0; + } + if (options.useBigInt64 && typeof options.promoteLongs === "boolean" && !options.promoteLongs) { + throw new error_1.MongoAPIError("Must request either bigint or Long for int64 deserialization"); + } + if (options.useBigInt64 && typeof options.promoteValues === "boolean" && !options.promoteValues) { + throw new error_1.MongoAPIError("Must request either bigint or Long for int64 deserialization"); + } + const url = new mongodb_connection_string_url_1.default(uri); + const { hosts, isSRV } = url; + const mongoOptions = /* @__PURE__ */ Object.create(null); + mongoOptions.hosts = isSRV ? [] : hosts.map(utils_1.HostAddress.fromString); + const urlOptions = new CaseInsensitiveMap(); + if (url.pathname !== "/" && url.pathname !== "") { + const dbName = decodeURIComponent(url.pathname[0] === "/" ? url.pathname.slice(1) : url.pathname); + if (dbName) { + urlOptions.set("dbName", [dbName]); + } + } + if (url.username !== "") { + const auth = { + username: decodeURIComponent(url.username) + }; + if (typeof url.password === "string") { + auth.password = decodeURIComponent(url.password); + } + urlOptions.set("auth", [auth]); + } + for (const key of url.searchParams.keys()) { + const values = url.searchParams.getAll(key); + const isReadPreferenceTags = /readPreferenceTags/i.test(key); + if (!isReadPreferenceTags && values.length > 1) { + throw new error_1.MongoInvalidArgumentError(`URI option "${key}" cannot appear more than once in the connection string`); + } + if (!isReadPreferenceTags && values.includes("")) { + throw new error_1.MongoAPIError(`URI option "${key}" cannot be specified with no value`); + } + if (!urlOptions.has(key)) { + urlOptions.set(key, values); + } + } + const objectOptions = new CaseInsensitiveMap(Object.entries(options).filter(([, v4]) => v4 != null)); + if (urlOptions.has("serverApi")) { + throw new error_1.MongoParseError("URI cannot contain `serverApi`, it can only be passed to the client"); + } + const uriMechanismProperties = urlOptions.get("authMechanismProperties"); + if (uriMechanismProperties) { + for (const property of uriMechanismProperties) { + if (/(^|,)ALLOWED_HOSTS:/.test(property)) { + throw new error_1.MongoParseError("Auth mechanism property ALLOWED_HOSTS is not allowed in the connection string."); + } + } + } + if (objectOptions.has("loadBalanced")) { + throw new error_1.MongoParseError("loadBalanced is only a valid option in the URI"); + } + const allProvidedOptions = new CaseInsensitiveMap(); + const allProvidedKeys = /* @__PURE__ */ new Set([...urlOptions.keys(), ...objectOptions.keys()]); + for (const key of allProvidedKeys) { + const values = []; + const objectOptionValue = objectOptions.get(key); + if (objectOptionValue != null) { + values.push(objectOptionValue); + } + const urlValues = urlOptions.get(key) ?? []; + values.push(...urlValues); + allProvidedOptions.set(key, values); + } + if (allProvidedOptions.has("tls") || allProvidedOptions.has("ssl")) { + const tlsAndSslOpts = (allProvidedOptions.get("tls") || []).concat(allProvidedOptions.get("ssl") || []).map(getBoolean.bind(null, "tls/ssl")); + if (new Set(tlsAndSslOpts).size !== 1) { + throw new error_1.MongoParseError("All values of tls/ssl must be the same."); + } + } + checkTLSOptions(allProvidedOptions); + const unsupportedOptions = (0, utils_1.setDifference)(allProvidedKeys, Array.from(Object.keys(exports2.OPTIONS)).map((s4) => s4.toLowerCase())); + if (unsupportedOptions.size !== 0) { + const optionWord = unsupportedOptions.size > 1 ? "options" : "option"; + const isOrAre = unsupportedOptions.size > 1 ? "are" : "is"; + throw new error_1.MongoParseError(`${optionWord} ${Array.from(unsupportedOptions).join(", ")} ${isOrAre} not supported`); + } + for (const [key, descriptor] of Object.entries(exports2.OPTIONS)) { + const values = allProvidedOptions.get(key); + if (!values || values.length === 0) { + if (exports2.DEFAULT_OPTIONS.has(key)) { + setOption(mongoOptions, key, descriptor, [exports2.DEFAULT_OPTIONS.get(key)]); + } + } else { + const { deprecated } = descriptor; + if (deprecated) { + const deprecatedMsg = typeof deprecated === "string" ? `: ${deprecated}` : ""; + (0, utils_1.emitWarning)(`${key} is a deprecated option${deprecatedMsg}`); + } + setOption(mongoOptions, key, descriptor, values); + } + } + if (mongoOptions.credentials) { + const isGssapi = mongoOptions.credentials.mechanism === providers_1.AuthMechanism.MONGODB_GSSAPI; + const isX509 = mongoOptions.credentials.mechanism === providers_1.AuthMechanism.MONGODB_X509; + const isAws = mongoOptions.credentials.mechanism === providers_1.AuthMechanism.MONGODB_AWS; + const isOidc = mongoOptions.credentials.mechanism === providers_1.AuthMechanism.MONGODB_OIDC; + if ((isGssapi || isX509) && allProvidedOptions.has("authSource") && mongoOptions.credentials.source !== "$external") { + throw new error_1.MongoParseError(`authMechanism ${mongoOptions.credentials.mechanism} requires an authSource of '$external'`); + } + if (!(isGssapi || isX509 || isAws || isOidc) && mongoOptions.dbName && !allProvidedOptions.has("authSource")) { + mongoOptions.credentials = mongo_credentials_1.MongoCredentials.merge(mongoOptions.credentials, { + source: mongoOptions.dbName + }); + } + if (isAws && mongoOptions.credentials.username && !mongoOptions.credentials.password) { + throw new error_1.MongoMissingCredentialsError(`When using ${mongoOptions.credentials.mechanism} password must be set when a username is specified`); + } + mongoOptions.credentials.validate(); + if (mongoOptions.credentials.password === "" && mongoOptions.credentials.username === "" && mongoOptions.credentials.mechanism === providers_1.AuthMechanism.MONGODB_DEFAULT && Object.keys(mongoOptions.credentials.mechanismProperties).length === 0) { + delete mongoOptions.credentials; + } + } + if (!mongoOptions.dbName) { + mongoOptions.dbName = "test"; + } + validateLoadBalancedOptions(hosts, mongoOptions, isSRV); + if (mongoClient && mongoOptions.autoEncryption) { + encrypter_1.Encrypter.checkForMongoCrypt(); + mongoOptions.encrypter = new encrypter_1.Encrypter(mongoClient, uri, options); + mongoOptions.autoEncrypter = mongoOptions.encrypter.autoEncrypter; + } + mongoOptions.userSpecifiedAuthSource = objectOptions.has("authSource") || urlOptions.has("authSource"); + mongoOptions.userSpecifiedReplicaSet = objectOptions.has("replicaSet") || urlOptions.has("replicaSet"); + if (isSRV) { + mongoOptions.srvHost = hosts[0]; + if (mongoOptions.directConnection) { + throw new error_1.MongoAPIError("SRV URI does not support directConnection"); + } + if (mongoOptions.srvMaxHosts > 0 && typeof mongoOptions.replicaSet === "string") { + throw new error_1.MongoParseError("Cannot use srvMaxHosts option with replicaSet"); + } + const noUserSpecifiedTLS = !objectOptions.has("tls") && !urlOptions.has("tls"); + const noUserSpecifiedSSL = !objectOptions.has("ssl") && !urlOptions.has("ssl"); + if (noUserSpecifiedTLS && noUserSpecifiedSSL) { + mongoOptions.tls = true; + } + } else { + const userSpecifiedSrvOptions = urlOptions.has("srvMaxHosts") || objectOptions.has("srvMaxHosts") || urlOptions.has("srvServiceName") || objectOptions.has("srvServiceName"); + if (userSpecifiedSrvOptions) { + throw new error_1.MongoParseError("Cannot use srvMaxHosts or srvServiceName with a non-srv connection string"); + } + } + if (mongoOptions.directConnection && mongoOptions.hosts.length !== 1) { + throw new error_1.MongoParseError("directConnection option requires exactly one host"); + } + if (!mongoOptions.proxyHost && (mongoOptions.proxyPort || mongoOptions.proxyUsername || mongoOptions.proxyPassword)) { + throw new error_1.MongoParseError("Must specify proxyHost if other proxy options are passed"); + } + if (mongoOptions.proxyUsername && !mongoOptions.proxyPassword || !mongoOptions.proxyUsername && mongoOptions.proxyPassword) { + throw new error_1.MongoParseError("Can only specify both of proxy username/password or neither"); + } + const proxyOptions = ["proxyHost", "proxyPort", "proxyUsername", "proxyPassword"].map((key) => urlOptions.get(key) ?? []); + if (proxyOptions.some((options2) => options2.length > 1)) { + throw new error_1.MongoParseError("Proxy options cannot be specified multiple times in the connection string"); + } + mongoOptions.mongoLoggerOptions = mongo_logger_1.MongoLogger.resolveOptions({ + MONGODB_LOG_COMMAND: process.env.MONGODB_LOG_COMMAND, + MONGODB_LOG_TOPOLOGY: process.env.MONGODB_LOG_TOPOLOGY, + MONGODB_LOG_SERVER_SELECTION: process.env.MONGODB_LOG_SERVER_SELECTION, + MONGODB_LOG_CONNECTION: process.env.MONGODB_LOG_CONNECTION, + MONGODB_LOG_CLIENT: process.env.MONGODB_LOG_CLIENT, + MONGODB_LOG_ALL: process.env.MONGODB_LOG_ALL, + MONGODB_LOG_MAX_DOCUMENT_LENGTH: process.env.MONGODB_LOG_MAX_DOCUMENT_LENGTH, + MONGODB_LOG_PATH: process.env.MONGODB_LOG_PATH + }, { + mongodbLogPath: mongoOptions.mongodbLogPath, + mongodbLogComponentSeverities: mongoOptions.mongodbLogComponentSeverities, + mongodbLogMaxDocumentLength: mongoOptions.mongodbLogMaxDocumentLength + }); + return mongoOptions; + } + function validateLoadBalancedOptions(hosts, mongoOptions, isSrv) { + if (mongoOptions.loadBalanced) { + if (hosts.length > 1) { + throw new error_1.MongoParseError(LB_SINGLE_HOST_ERROR); + } + if (mongoOptions.replicaSet) { + throw new error_1.MongoParseError(LB_REPLICA_SET_ERROR); + } + if (mongoOptions.directConnection) { + throw new error_1.MongoParseError(LB_DIRECT_CONNECTION_ERROR); + } + if (isSrv && mongoOptions.srvMaxHosts > 0) { + throw new error_1.MongoParseError("Cannot limit srv hosts with loadBalanced enabled"); + } + } + return; + } + function setOption(mongoOptions, key, descriptor, values) { + const { target, type, transform } = descriptor; + const name = target ?? key; + switch (type) { + case "boolean": + mongoOptions[name] = getBoolean(name, values[0]); + break; + case "int": + mongoOptions[name] = getIntFromOptions(name, values[0]); + break; + case "uint": + mongoOptions[name] = getUIntFromOptions(name, values[0]); + break; + case "string": + if (values[0] == null) { + break; + } + mongoOptions[name] = String(values[0]); + break; + case "record": + if (!(0, utils_1.isRecord)(values[0])) { + throw new error_1.MongoParseError(`${name} must be an object`); + } + mongoOptions[name] = values[0]; + break; + case "any": + mongoOptions[name] = values[0]; + break; + default: { + if (!transform) { + throw new error_1.MongoParseError("Descriptors missing a type must define a transform"); + } + const transformValue = transform({ name, options: mongoOptions, values }); + mongoOptions[name] = transformValue; + break; + } + } + } + exports2.OPTIONS = { + appName: { + type: "string" + }, + auth: { + target: "credentials", + transform({ name, options, values: [value] }) { + if (!(0, utils_1.isRecord)(value, ["username", "password"])) { + throw new error_1.MongoParseError(`${name} must be an object with 'username' and 'password' properties`); + } + return mongo_credentials_1.MongoCredentials.merge(options.credentials, { + username: value.username, + password: value.password + }); + } + }, + authMechanism: { + target: "credentials", + transform({ options, values: [value] }) { + const mechanisms = Object.values(providers_1.AuthMechanism); + const [mechanism] = mechanisms.filter((m4) => m4.match(RegExp(String.raw`\b${value}\b`, "i"))); + if (!mechanism) { + throw new error_1.MongoParseError(`authMechanism one of ${mechanisms}, got ${value}`); + } + let source = options.credentials?.source; + if (mechanism === providers_1.AuthMechanism.MONGODB_PLAIN || providers_1.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(mechanism)) { + source = "$external"; + } + let password = options.credentials?.password; + if (mechanism === providers_1.AuthMechanism.MONGODB_X509 && password === "") { + password = void 0; + } + return mongo_credentials_1.MongoCredentials.merge(options.credentials, { + mechanism, + source, + password + }); + } + }, + // Note that if the authMechanismProperties contain a TOKEN_RESOURCE that has a + // comma in it, it MUST be supplied as a MongoClient option instead of in the + // connection string. + authMechanismProperties: { + target: "credentials", + transform({ options, values }) { + let mechanismProperties = /* @__PURE__ */ Object.create(null); + for (const optionValue of values) { + if (typeof optionValue === "string") { + for (const [key, value] of entriesFromString(optionValue)) { + try { + mechanismProperties[key] = getBoolean(key, value); + } catch { + mechanismProperties[key] = value; + } + } + } else { + if (!(0, utils_1.isRecord)(optionValue)) { + throw new error_1.MongoParseError("AuthMechanismProperties must be an object"); + } + mechanismProperties = { ...optionValue }; + } + } + return mongo_credentials_1.MongoCredentials.merge(options.credentials, { + mechanismProperties + }); + } + }, + authSource: { + target: "credentials", + transform({ options, values: [value] }) { + const source = String(value); + return mongo_credentials_1.MongoCredentials.merge(options.credentials, { source }); + } + }, + autoEncryption: { + type: "record" + }, + autoSelectFamily: { + type: "boolean", + default: true + }, + autoSelectFamilyAttemptTimeout: { + type: "uint" + }, + bsonRegExp: { + type: "boolean" + }, + serverApi: { + target: "serverApi", + transform({ values: [version] }) { + const serverApiToValidate = typeof version === "string" ? { version } : version; + const versionToValidate = serverApiToValidate && serverApiToValidate.version; + if (!versionToValidate) { + throw new error_1.MongoParseError(`Invalid \`serverApi\` property; must specify a version from the following enum: ["${Object.values(mongo_client_1.ServerApiVersion).join('", "')}"]`); + } + if (!Object.values(mongo_client_1.ServerApiVersion).some((v4) => v4 === versionToValidate)) { + throw new error_1.MongoParseError(`Invalid server API version=${versionToValidate}; must be in the following enum: ["${Object.values(mongo_client_1.ServerApiVersion).join('", "')}"]`); + } + return serverApiToValidate; + } + }, + checkKeys: { + type: "boolean" + }, + compressors: { + default: "none", + target: "compressors", + transform({ values }) { + const compressionList = /* @__PURE__ */ new Set(); + for (const compVal of values) { + const compValArray = typeof compVal === "string" ? compVal.split(",") : compVal; + if (!Array.isArray(compValArray)) { + throw new error_1.MongoInvalidArgumentError("compressors must be an array or a comma-delimited list of strings"); + } + for (const c4 of compValArray) { + if (Object.keys(compression_1.Compressor).includes(String(c4))) { + compressionList.add(String(c4)); + } else { + throw new error_1.MongoInvalidArgumentError(`${c4} is not a valid compression mechanism. Must be one of: ${Object.keys(compression_1.Compressor)}.`); + } + } + } + return [...compressionList]; + } + }, + connectTimeoutMS: { + default: 3e4, + type: "uint" + }, + dbName: { + type: "string" + }, + directConnection: { + default: false, + type: "boolean" + }, + driverInfo: { + default: {}, + type: "record" + }, + enableUtf8Validation: { type: "boolean", default: true }, + family: { + transform({ name, values: [value] }) { + const transformValue = getIntFromOptions(name, value); + if (transformValue === 4 || transformValue === 6) { + return transformValue; + } + throw new error_1.MongoParseError(`Option 'family' must be 4 or 6 got ${transformValue}.`); + } + }, + fieldsAsRaw: { + type: "record" + }, + forceServerObjectId: { + default: false, + type: "boolean" + }, + fsync: { + deprecated: "Please use journal instead", + target: "writeConcern", + transform({ name, options, values: [value] }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + fsync: getBoolean(name, value) + } + }); + if (!wc) + throw new error_1.MongoParseError(`Unable to make a writeConcern from fsync=${value}`); + return wc; + } + }, + heartbeatFrequencyMS: { + default: 1e4, + type: "uint" + }, + ignoreUndefined: { + type: "boolean" + }, + j: { + deprecated: "Please use journal instead", + target: "writeConcern", + transform({ name, options, values: [value] }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + journal: getBoolean(name, value) + } + }); + if (!wc) + throw new error_1.MongoParseError(`Unable to make a writeConcern from journal=${value}`); + return wc; + } + }, + journal: { + target: "writeConcern", + transform({ name, options, values: [value] }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + journal: getBoolean(name, value) + } + }); + if (!wc) + throw new error_1.MongoParseError(`Unable to make a writeConcern from journal=${value}`); + return wc; + } + }, + loadBalanced: { + default: false, + type: "boolean" + }, + localThresholdMS: { + default: 15, + type: "uint" + }, + maxConnecting: { + default: 2, + transform({ name, values: [value] }) { + const maxConnecting = getUIntFromOptions(name, value); + if (maxConnecting === 0) { + throw new error_1.MongoInvalidArgumentError("maxConnecting must be > 0 if specified"); + } + return maxConnecting; + } + }, + maxIdleTimeMS: { + default: 0, + type: "uint" + }, + maxPoolSize: { + default: 100, + type: "uint" + }, + maxStalenessSeconds: { + target: "readPreference", + transform({ name, options, values: [value] }) { + const maxStalenessSeconds = getUIntFromOptions(name, value); + if (options.readPreference) { + return read_preference_1.ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, maxStalenessSeconds } + }); + } else { + return new read_preference_1.ReadPreference("secondary", void 0, { maxStalenessSeconds }); + } + } + }, + minInternalBufferSize: { + type: "uint" + }, + minPoolSize: { + default: 0, + type: "uint" + }, + minHeartbeatFrequencyMS: { + default: 500, + type: "uint" + }, + monitorCommands: { + default: false, + type: "boolean" + }, + name: { + target: "driverInfo", + transform({ values: [value], options }) { + return { ...options.driverInfo, name: String(value) }; + } + }, + noDelay: { + default: true, + type: "boolean" + }, + pkFactory: { + default: utils_1.DEFAULT_PK_FACTORY, + transform({ values: [value] }) { + if ((0, utils_1.isRecord)(value, ["createPk"]) && typeof value.createPk === "function") { + return value; + } + throw new error_1.MongoParseError(`Option pkFactory must be an object with a createPk function, got ${value}`); + } + }, + promoteBuffers: { + type: "boolean" + }, + promoteLongs: { + type: "boolean" + }, + promoteValues: { + type: "boolean" + }, + useBigInt64: { + type: "boolean" + }, + proxyHost: { + type: "string" + }, + proxyPassword: { + type: "string" + }, + proxyPort: { + type: "uint" + }, + proxyUsername: { + type: "string" + }, + raw: { + default: false, + type: "boolean" + }, + readConcern: { + transform({ values: [value], options }) { + if (value instanceof read_concern_1.ReadConcern || (0, utils_1.isRecord)(value, ["level"])) { + return read_concern_1.ReadConcern.fromOptions({ ...options.readConcern, ...value }); + } + throw new error_1.MongoParseError(`ReadConcern must be an object, got ${JSON.stringify(value)}`); + } + }, + readConcernLevel: { + target: "readConcern", + transform({ values: [level], options }) { + return read_concern_1.ReadConcern.fromOptions({ + ...options.readConcern, + level + }); + } + }, + readPreference: { + default: read_preference_1.ReadPreference.primary, + transform({ values: [value], options }) { + if (value instanceof read_preference_1.ReadPreference) { + return read_preference_1.ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, ...value }, + ...value + }); + } + if ((0, utils_1.isRecord)(value, ["mode"])) { + const rp = read_preference_1.ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, ...value }, + ...value + }); + if (rp) + return rp; + else + throw new error_1.MongoParseError(`Cannot make read preference from ${JSON.stringify(value)}`); + } + if (typeof value === "string") { + const rpOpts = { + hedge: options.readPreference?.hedge, + maxStalenessSeconds: options.readPreference?.maxStalenessSeconds + }; + return new read_preference_1.ReadPreference(value, options.readPreference?.tags, rpOpts); + } + throw new error_1.MongoParseError(`Unknown ReadPreference value: ${value}`); + } + }, + readPreferenceTags: { + target: "readPreference", + transform({ values, options }) { + const tags = Array.isArray(values[0]) ? values[0] : values; + const readPreferenceTags = []; + for (const tag2 of tags) { + const readPreferenceTag = /* @__PURE__ */ Object.create(null); + if (typeof tag2 === "string") { + for (const [k4, v4] of entriesFromString(tag2)) { + readPreferenceTag[k4] = v4; + } + } + if ((0, utils_1.isRecord)(tag2)) { + for (const [k4, v4] of Object.entries(tag2)) { + readPreferenceTag[k4] = v4; + } + } + readPreferenceTags.push(readPreferenceTag); + } + return read_preference_1.ReadPreference.fromOptions({ + readPreference: options.readPreference, + readPreferenceTags + }); + } + }, + replicaSet: { + type: "string" + }, + retryReads: { + default: true, + type: "boolean" + }, + retryWrites: { + default: true, + type: "boolean" + }, + serializeFunctions: { + type: "boolean" + }, + serverMonitoringMode: { + default: "auto", + transform({ values: [value] }) { + if (!Object.values(monitor_1.ServerMonitoringMode).includes(value)) { + throw new error_1.MongoParseError("serverMonitoringMode must be one of `auto`, `poll`, or `stream`"); + } + return value; + } + }, + serverSelectionTimeoutMS: { + default: 3e4, + type: "uint" + }, + servername: { + type: "string" + }, + socketTimeoutMS: { + // TODO(NODE-6491): deprecated: 'Please use timeoutMS instead', + default: 0, + type: "uint" + }, + srvMaxHosts: { + type: "uint", + default: 0 + }, + srvServiceName: { + type: "string", + default: "mongodb" + }, + ssl: { + target: "tls", + type: "boolean" + }, + timeoutMS: { + type: "uint" + }, + tls: { + type: "boolean" + }, + tlsAllowInvalidCertificates: { + target: "rejectUnauthorized", + transform({ name, values: [value] }) { + return !getBoolean(name, value); + } + }, + tlsAllowInvalidHostnames: { + target: "checkServerIdentity", + transform({ name, values: [value] }) { + return getBoolean(name, value) ? () => void 0 : void 0; + } + }, + tlsCAFile: { + type: "string" + }, + tlsCRLFile: { + type: "string" + }, + tlsCertificateKeyFile: { + type: "string" + }, + tlsCertificateKeyFilePassword: { + target: "passphrase", + type: "any" + }, + tlsInsecure: { + transform({ name, options, values: [value] }) { + const tlsInsecure = getBoolean(name, value); + if (tlsInsecure) { + options.checkServerIdentity = () => void 0; + options.rejectUnauthorized = false; + } else { + options.checkServerIdentity = options.tlsAllowInvalidHostnames ? () => void 0 : void 0; + options.rejectUnauthorized = options.tlsAllowInvalidCertificates ? false : true; + } + return tlsInsecure; + } + }, + w: { + target: "writeConcern", + transform({ values: [value], options }) { + return write_concern_1.WriteConcern.fromOptions({ writeConcern: { ...options.writeConcern, w: value } }); + } + }, + waitQueueTimeoutMS: { + // TODO(NODE-6491): deprecated: 'Please use timeoutMS instead', + default: 0, + type: "uint" + }, + writeConcern: { + target: "writeConcern", + transform({ values: [value], options }) { + if ((0, utils_1.isRecord)(value) || value instanceof write_concern_1.WriteConcern) { + return write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + ...value + } + }); + } else if (value === "majority" || typeof value === "number") { + return write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + w: value + } + }); + } + throw new error_1.MongoParseError(`Invalid WriteConcern cannot parse: ${JSON.stringify(value)}`); + } + }, + wtimeout: { + deprecated: "Please use wtimeoutMS instead", + target: "writeConcern", + transform({ values: [value], options }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + wtimeout: getUIntFromOptions("wtimeout", value) + } + }); + if (wc) + return wc; + throw new error_1.MongoParseError(`Cannot make WriteConcern from wtimeout`); + } + }, + wtimeoutMS: { + target: "writeConcern", + transform({ values: [value], options }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + wtimeoutMS: getUIntFromOptions("wtimeoutMS", value) + } + }); + if (wc) + return wc; + throw new error_1.MongoParseError(`Cannot make WriteConcern from wtimeout`); + } + }, + zlibCompressionLevel: { + default: 0, + type: "int" + }, + mongodbLogPath: { + transform({ values: [value] }) { + if (!(typeof value === "string" && ["stderr", "stdout"].includes(value) || value && typeof value === "object" && "write" in value && typeof value.write === "function")) { + throw new error_1.MongoAPIError(`Option 'mongodbLogPath' must be of type 'stderr' | 'stdout' | MongoDBLogWritable`); + } + return value; + } + }, + mongodbLogComponentSeverities: { + transform({ values: [value] }) { + if (typeof value !== "object" || !value) { + throw new error_1.MongoAPIError(`Option 'mongodbLogComponentSeverities' must be a non-null object`); + } + for (const [k4, v4] of Object.entries(value)) { + if (typeof v4 !== "string" || typeof k4 !== "string") { + throw new error_1.MongoAPIError(`User input for option 'mongodbLogComponentSeverities' object cannot include a non-string key or value`); + } + if (!Object.values(mongo_logger_1.MongoLoggableComponent).some((val) => val === k4) && k4 !== "default") { + throw new error_1.MongoAPIError(`User input for option 'mongodbLogComponentSeverities' contains invalid key: ${k4}`); + } + if (!Object.values(mongo_logger_1.SeverityLevel).some((val) => val === v4)) { + throw new error_1.MongoAPIError(`Option 'mongodbLogComponentSeverities' does not support ${v4} as a value for ${k4}`); + } + } + return value; + } + }, + mongodbLogMaxDocumentLength: { type: "uint" }, + // Custom types for modifying core behavior + connectionType: { type: "any" }, + srvPoller: { type: "any" }, + // Accepted Node.js Options + allowPartialTrustChain: { type: "any" }, + minDHSize: { type: "any" }, + pskCallback: { type: "any" }, + secureContext: { type: "any" }, + enableTrace: { type: "any" }, + requestCert: { type: "any" }, + rejectUnauthorized: { type: "any" }, + checkServerIdentity: { type: "any" }, + keepAliveInitialDelay: { type: "any" }, + ALPNProtocols: { type: "any" }, + SNICallback: { type: "any" }, + session: { type: "any" }, + requestOCSP: { type: "any" }, + localAddress: { type: "any" }, + localPort: { type: "any" }, + hints: { type: "any" }, + lookup: { type: "any" }, + ca: { type: "any" }, + cert: { type: "any" }, + ciphers: { type: "any" }, + crl: { type: "any" }, + ecdhCurve: { type: "any" }, + key: { type: "any" }, + passphrase: { type: "any" }, + pfx: { type: "any" }, + secureProtocol: { type: "any" }, + index: { type: "any" }, + // Legacy options from v3 era + useNewUrlParser: { + type: "boolean", + deprecated: "useNewUrlParser has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version" + }, + useUnifiedTopology: { + type: "boolean", + deprecated: "useUnifiedTopology has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version" + }, + __skipPingOnConnect: { type: "boolean" } + }; + exports2.DEFAULT_OPTIONS = new CaseInsensitiveMap(Object.entries(exports2.OPTIONS).filter(([, descriptor]) => descriptor.default != null).map(([k4, d4]) => [k4, d4.default])); + } +}); + +// node_modules/mongodb/lib/operations/list_collections.js +var require_list_collections = __commonJS({ + "node_modules/mongodb/lib/operations/list_collections.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ListCollectionsOperation = void 0; + var responses_1 = require_responses(); + var utils_1 = require_utils3(); + var command_1 = require_command(); + var operation_1 = require_operation(); + var ListCollectionsOperation = class extends command_1.CommandOperation { + constructor(db, filter, options) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.CursorResponse; + this.options = { ...options }; + delete this.options.writeConcern; + this.db = db; + this.filter = filter; + this.nameOnly = !!this.options.nameOnly; + this.authorizedCollections = !!this.options.authorizedCollections; + if (typeof this.options.batchSize === "number") { + this.batchSize = this.options.batchSize; + } + this.SERVER_COMMAND_RESPONSE_TYPE = this.explain ? responses_1.ExplainedCursorResponse : responses_1.CursorResponse; + } + get commandName() { + return "listCollections"; + } + buildCommandDocument(connection) { + const command = { + listCollections: 1, + filter: this.filter, + cursor: this.batchSize ? { batchSize: this.batchSize } : {}, + nameOnly: this.nameOnly, + authorizedCollections: this.authorizedCollections + }; + if ((0, utils_1.maxWireVersion)(connection) >= 9 && this.options.comment !== void 0) { + command.comment = this.options.comment; + } + return command; + } + handleOk(response) { + return response; + } + }; + exports2.ListCollectionsOperation = ListCollectionsOperation; + (0, operation_1.defineAspects)(ListCollectionsOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.CURSOR_CREATING, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + } +}); + +// node_modules/mongodb/lib/cursor/list_collections_cursor.js +var require_list_collections_cursor = __commonJS({ + "node_modules/mongodb/lib/cursor/list_collections_cursor.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ListCollectionsCursor = void 0; + var execute_operation_1 = require_execute_operation(); + var list_collections_1 = require_list_collections(); + var abstract_cursor_1 = require_abstract_cursor(); + var ListCollectionsCursor = class _ListCollectionsCursor extends abstract_cursor_1.AbstractCursor { + constructor(db, filter, options) { + super(db.client, db.s.namespace, options); + this.parent = db; + this.filter = filter; + this.options = options; + } + clone() { + return new _ListCollectionsCursor(this.parent, this.filter, { + ...this.options, + ...this.cursorOptions + }); + } + /** @internal */ + async _initialize(session) { + const operation2 = new list_collections_1.ListCollectionsOperation(this.parent, this.filter, { + ...this.cursorOptions, + ...this.options, + session, + signal: this.signal + }); + const response = await (0, execute_operation_1.executeOperation)(this.parent.client, operation2, this.timeoutContext); + return { server: operation2.server, session, response }; + } + }; + exports2.ListCollectionsCursor = ListCollectionsCursor; + } +}); + +// node_modules/mongodb/lib/cursor/run_command_cursor.js +var require_run_command_cursor = __commonJS({ + "node_modules/mongodb/lib/cursor/run_command_cursor.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RunCommandCursor = void 0; + var error_1 = require_error(); + var execute_operation_1 = require_execute_operation(); + var get_more_1 = require_get_more(); + var run_command_1 = require_run_command(); + var utils_1 = require_utils3(); + var abstract_cursor_1 = require_abstract_cursor(); + var RunCommandCursor = class extends abstract_cursor_1.AbstractCursor { + /** + * Controls the `getMore.comment` field + * @param comment - any BSON value + */ + setComment(comment) { + this.getMoreOptions.comment = comment; + return this; + } + /** + * Controls the `getMore.maxTimeMS` field. Only valid when cursor is tailable await + * @param maxTimeMS - the number of milliseconds to wait for new data + */ + setMaxTimeMS(maxTimeMS) { + this.getMoreOptions.maxAwaitTimeMS = maxTimeMS; + return this; + } + /** + * Controls the `getMore.batchSize` field + * @param batchSize - the number documents to return in the `nextBatch` + */ + setBatchSize(batchSize) { + this.getMoreOptions.batchSize = batchSize; + return this; + } + /** Unsupported for RunCommandCursor */ + clone() { + throw new error_1.MongoAPIError("Clone not supported, create a new cursor with db.runCursorCommand"); + } + /** Unsupported for RunCommandCursor: readConcern must be configured directly on command document */ + withReadConcern(_) { + throw new error_1.MongoAPIError("RunCommandCursor does not support readConcern it must be attached to the command being run"); + } + /** Unsupported for RunCommandCursor: various cursor flags must be configured directly on command document */ + addCursorFlag(_, __) { + throw new error_1.MongoAPIError("RunCommandCursor does not support cursor flags, they must be attached to the command being run"); + } + /** + * Unsupported for RunCommandCursor: maxTimeMS must be configured directly on command document + */ + maxTimeMS(_) { + throw new error_1.MongoAPIError("maxTimeMS must be configured on the command document directly, to configure getMore.maxTimeMS use cursor.setMaxTimeMS()"); + } + /** Unsupported for RunCommandCursor: batchSize must be configured directly on command document */ + batchSize(_) { + throw new error_1.MongoAPIError("batchSize must be configured on the command document directly, to configure getMore.batchSize use cursor.setBatchSize()"); + } + /** @internal */ + constructor(db, command, options = {}) { + super(db.client, (0, utils_1.ns)(db.namespace), options); + this.getMoreOptions = {}; + this.db = db; + this.command = Object.freeze({ ...command }); + } + /** @internal */ + async _initialize(session) { + const operation2 = new run_command_1.RunCursorCommandOperation(this.db.s.namespace, this.command, { + ...this.cursorOptions, + session, + readPreference: this.cursorOptions.readPreference + }); + const response = await (0, execute_operation_1.executeOperation)(this.client, operation2, this.timeoutContext); + return { + server: operation2.server, + session, + response + }; + } + /** @internal */ + async getMore(_batchSize) { + if (!this.session) { + throw new error_1.MongoRuntimeError("Unexpected null session. A cursor creating command should have set this"); + } + const getMoreOperation = new get_more_1.GetMoreOperation(this.namespace, this.id, this.server, { + ...this.cursorOptions, + session: this.session, + ...this.getMoreOptions + }); + return await (0, execute_operation_1.executeOperation)(this.client, getMoreOperation, this.timeoutContext); + } + }; + exports2.RunCommandCursor = RunCommandCursor; + } +}); + +// node_modules/mongodb/lib/operations/indexes.js +var require_indexes = __commonJS({ + "node_modules/mongodb/lib/operations/indexes.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ListIndexesOperation = exports2.DropIndexOperation = exports2.CreateIndexesOperation = void 0; + var responses_1 = require_responses(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var command_1 = require_command(); + var operation_1 = require_operation(); + var VALID_INDEX_OPTIONS = /* @__PURE__ */ new Set([ + "background", + "unique", + "name", + "partialFilterExpression", + "sparse", + "hidden", + "expireAfterSeconds", + "storageEngine", + "collation", + "version", + // text indexes + "weights", + "default_language", + "language_override", + "textIndexVersion", + // 2d-sphere indexes + "2dsphereIndexVersion", + // 2d indexes + "bits", + "min", + "max", + // geoHaystack Indexes + "bucketSize", + // wildcard indexes + "wildcardProjection" + ]); + function isIndexDirection(x4) { + return typeof x4 === "number" || x4 === "2d" || x4 === "2dsphere" || x4 === "text" || x4 === "geoHaystack"; + } + function isSingleIndexTuple(t4) { + return Array.isArray(t4) && t4.length === 2 && isIndexDirection(t4[1]); + } + function constructIndexDescriptionMap(indexSpec) { + const key = /* @__PURE__ */ new Map(); + const indexSpecs = !Array.isArray(indexSpec) || isSingleIndexTuple(indexSpec) ? [indexSpec] : indexSpec; + for (const spec of indexSpecs) { + if (typeof spec === "string") { + key.set(spec, 1); + } else if (Array.isArray(spec)) { + key.set(spec[0], spec[1] ?? 1); + } else if (spec instanceof Map) { + for (const [property, value] of spec) { + key.set(property, value); + } + } else if ((0, utils_1.isObject)(spec)) { + for (const [property, value] of Object.entries(spec)) { + key.set(property, value); + } + } + } + return key; + } + function resolveIndexDescription(description) { + const validProvidedOptions = Object.entries(description).filter(([optionName]) => VALID_INDEX_OPTIONS.has(optionName)); + return Object.fromEntries( + // we support the `version` option, but the `createIndexes` command expects it to be the `v` + validProvidedOptions.map(([name, value]) => name === "version" ? ["v", value] : [name, value]) + ); + } + var CreateIndexesOperation = class _CreateIndexesOperation extends command_1.CommandOperation { + constructor(parent, collectionName, indexes, options) { + super(parent, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options ?? {}; + this.options.collation = void 0; + this.collectionName = collectionName; + this.indexes = indexes.map((userIndex) => { + const key = userIndex.key instanceof Map ? userIndex.key : new Map(Object.entries(userIndex.key)); + const name = userIndex.name ?? Array.from(key).flat().join("_"); + const validIndexOptions = resolveIndexDescription(userIndex); + return { + ...validIndexOptions, + name, + key + }; + }); + this.ns = parent.s.namespace; + } + static fromIndexDescriptionArray(parent, collectionName, indexes, options) { + return new _CreateIndexesOperation(parent, collectionName, indexes, options); + } + static fromIndexSpecification(parent, collectionName, indexSpec, options = {}) { + const key = constructIndexDescriptionMap(indexSpec); + const description = { ...options, key }; + return new _CreateIndexesOperation(parent, collectionName, [description], options); + } + get commandName() { + return "createIndexes"; + } + buildCommandDocument(connection) { + const options = this.options; + const indexes = this.indexes; + const serverWireVersion = (0, utils_1.maxWireVersion)(connection); + const cmd = { createIndexes: this.collectionName, indexes }; + if (options.commitQuorum != null) { + if (serverWireVersion < 9) { + throw new error_1.MongoCompatibilityError("Option `commitQuorum` for `createIndexes` not supported on servers < 4.4"); + } + cmd.commitQuorum = options.commitQuorum; + } + return cmd; + } + handleOk(_response) { + const indexNames = this.indexes.map((index) => index.name || ""); + return indexNames; + } + }; + exports2.CreateIndexesOperation = CreateIndexesOperation; + var DropIndexOperation = class extends command_1.CommandOperation { + constructor(collection, indexName, options) { + super(collection, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options ?? {}; + this.collection = collection; + this.indexName = indexName; + this.ns = collection.fullNamespace; + } + get commandName() { + return "dropIndexes"; + } + buildCommandDocument(_connection) { + return { dropIndexes: this.collection.collectionName, index: this.indexName }; + } + }; + exports2.DropIndexOperation = DropIndexOperation; + var ListIndexesOperation = class extends command_1.CommandOperation { + constructor(collection, options) { + super(collection, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.CursorResponse; + this.options = { ...options }; + delete this.options.writeConcern; + this.collectionNamespace = collection.s.namespace; + } + get commandName() { + return "listIndexes"; + } + buildCommandDocument(connection) { + const serverWireVersion = (0, utils_1.maxWireVersion)(connection); + const cursor2 = this.options.batchSize ? { batchSize: this.options.batchSize } : {}; + const command = { listIndexes: this.collectionNamespace.collection, cursor: cursor2 }; + if (serverWireVersion >= 9 && this.options.comment !== void 0) { + command.comment = this.options.comment; + } + return command; + } + handleOk(response) { + return response; + } + }; + exports2.ListIndexesOperation = ListIndexesOperation; + (0, operation_1.defineAspects)(ListIndexesOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.CURSOR_CREATING, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + (0, operation_1.defineAspects)(CreateIndexesOperation, [operation_1.Aspect.WRITE_OPERATION, operation_1.Aspect.SUPPORTS_RAW_DATA]); + (0, operation_1.defineAspects)(DropIndexOperation, [operation_1.Aspect.WRITE_OPERATION, operation_1.Aspect.SUPPORTS_RAW_DATA]); + } +}); + +// node_modules/mongodb/lib/operations/create_collection.js +var require_create_collection = __commonJS({ + "node_modules/mongodb/lib/operations/create_collection.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.CreateCollectionOperation = void 0; + exports2.createCollections = createCollections; + var constants_1 = require_constants(); + var responses_1 = require_responses(); + var collection_1 = require_collection2(); + var error_1 = require_error(); + var timeout_1 = require_timeout(); + var utils_1 = require_utils3(); + var command_1 = require_command(); + var execute_operation_1 = require_execute_operation(); + var indexes_1 = require_indexes(); + var operation_1 = require_operation(); + var ILLEGAL_COMMAND_FIELDS = /* @__PURE__ */ new Set([ + "w", + "wtimeout", + "timeoutMS", + "j", + "fsync", + "autoIndexId", + "pkFactory", + "raw", + "readPreference", + "session", + "readConcern", + "writeConcern", + "raw", + "fieldsAsRaw", + "useBigInt64", + "promoteLongs", + "promoteValues", + "promoteBuffers", + "bsonRegExp", + "serializeFunctions", + "ignoreUndefined", + "enableUtf8Validation" + ]); + var INVALID_QE_VERSION = "Driver support of Queryable Encryption is incompatible with server. Upgrade server to use Queryable Encryption."; + var CreateCollectionOperation = class extends command_1.CommandOperation { + constructor(db, name, options = {}) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.db = db; + this.name = name; + } + get commandName() { + return "create"; + } + buildCommandDocument(_connection, _session) { + const isOptionValid = ([k4, v4]) => v4 != null && typeof v4 !== "function" && !ILLEGAL_COMMAND_FIELDS.has(k4); + return { + create: this.name, + ...Object.fromEntries(Object.entries(this.options).filter(isOptionValid)) + }; + } + handleOk(_response) { + return new collection_1.Collection(this.db, this.name, this.options); + } + }; + exports2.CreateCollectionOperation = CreateCollectionOperation; + async function createCollections(db, name, options) { + const timeoutContext = timeout_1.TimeoutContext.create({ + session: options.session, + serverSelectionTimeoutMS: db.client.s.options.serverSelectionTimeoutMS, + waitQueueTimeoutMS: db.client.s.options.waitQueueTimeoutMS, + timeoutMS: options.timeoutMS + }); + const encryptedFields = options.encryptedFields ?? db.client.s.options.autoEncryption?.encryptedFieldsMap?.[`${db.databaseName}.${name}`]; + if (encryptedFields) { + class CreateSupportingFLEv2CollectionOperation extends CreateCollectionOperation { + buildCommandDocument(connection, session) { + if (!connection.description.loadBalanced && (0, utils_1.maxWireVersion)(connection) < constants_1.MIN_SUPPORTED_QE_WIRE_VERSION) { + throw new error_1.MongoCompatibilityError(`${INVALID_QE_VERSION} The minimum server version required is ${constants_1.MIN_SUPPORTED_QE_SERVER_VERSION}`); + } + return super.buildCommandDocument(connection, session); + } + } + const escCollection = encryptedFields.escCollection ?? `enxcol_.${name}.esc`; + const ecocCollection = encryptedFields.ecocCollection ?? `enxcol_.${name}.ecoc`; + for (const collectionName of [escCollection, ecocCollection]) { + const createOp = new CreateSupportingFLEv2CollectionOperation(db, collectionName, { + clusteredIndex: { + key: { _id: 1 }, + unique: true + }, + session: options.session + }); + await (0, execute_operation_1.executeOperation)(db.client, createOp, timeoutContext); + } + if (!options.encryptedFields) { + options = { ...options, encryptedFields }; + } + } + const coll = await (0, execute_operation_1.executeOperation)(db.client, new CreateCollectionOperation(db, name, options), timeoutContext); + if (encryptedFields) { + const createIndexOp = indexes_1.CreateIndexesOperation.fromIndexSpecification(db, name, { __safeContent__: 1 }, { session: options.session }); + await (0, execute_operation_1.executeOperation)(db.client, createIndexOp, timeoutContext); + } + return coll; + } + (0, operation_1.defineAspects)(CreateCollectionOperation, [operation_1.Aspect.WRITE_OPERATION]); + } +}); + +// node_modules/mongodb/lib/operations/drop.js +var require_drop = __commonJS({ + "node_modules/mongodb/lib/operations/drop.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DropDatabaseOperation = exports2.DropCollectionOperation = void 0; + exports2.dropCollections = dropCollections; + var __1 = require_lib6(); + var responses_1 = require_responses(); + var abstract_cursor_1 = require_abstract_cursor(); + var error_1 = require_error(); + var timeout_1 = require_timeout(); + var command_1 = require_command(); + var execute_operation_1 = require_execute_operation(); + var operation_1 = require_operation(); + var DropCollectionOperation = class extends command_1.CommandOperation { + constructor(db, name, options = {}) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.name = name; + } + get commandName() { + return "drop"; + } + buildCommandDocument(_connection, _session) { + return { drop: this.name }; + } + handleOk(_response) { + return true; + } + }; + exports2.DropCollectionOperation = DropCollectionOperation; + async function dropCollections(db, name, options) { + const timeoutContext = timeout_1.TimeoutContext.create({ + session: options.session, + serverSelectionTimeoutMS: db.client.s.options.serverSelectionTimeoutMS, + waitQueueTimeoutMS: db.client.s.options.waitQueueTimeoutMS, + timeoutMS: options.timeoutMS + }); + const encryptedFieldsMap = db.client.s.options.autoEncryption?.encryptedFieldsMap; + let encryptedFields = options.encryptedFields ?? encryptedFieldsMap?.[`${db.databaseName}.${name}`]; + if (!encryptedFields && encryptedFieldsMap) { + const listCollectionsResult = await db.listCollections({ name }, { + nameOnly: false, + session: options.session, + timeoutContext: new abstract_cursor_1.CursorTimeoutContext(timeoutContext, /* @__PURE__ */ Symbol()) + }).toArray(); + encryptedFields = listCollectionsResult?.[0]?.options?.encryptedFields; + } + if (encryptedFields) { + const escCollection = encryptedFields.escCollection || `enxcol_.${name}.esc`; + const ecocCollection = encryptedFields.ecocCollection || `enxcol_.${name}.ecoc`; + for (const collectionName of [escCollection, ecocCollection]) { + const dropOp = new DropCollectionOperation(db, collectionName, options); + try { + await (0, execute_operation_1.executeOperation)(db.client, dropOp, timeoutContext); + } catch (err) { + if (!(err instanceof __1.MongoServerError) || err.code !== error_1.MONGODB_ERROR_CODES.NamespaceNotFound) { + throw err; + } + } + } + } + return await (0, execute_operation_1.executeOperation)(db.client, new DropCollectionOperation(db, name, options), timeoutContext); + } + var DropDatabaseOperation = class extends command_1.CommandOperation { + constructor(db, options) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + } + get commandName() { + return "dropDatabase"; + } + buildCommandDocument(_connection, _session) { + return { dropDatabase: 1 }; + } + handleOk(_response) { + return true; + } + }; + exports2.DropDatabaseOperation = DropDatabaseOperation; + (0, operation_1.defineAspects)(DropCollectionOperation, [operation_1.Aspect.WRITE_OPERATION]); + (0, operation_1.defineAspects)(DropDatabaseOperation, [operation_1.Aspect.WRITE_OPERATION]); + } +}); + +// node_modules/mongodb/lib/operations/profiling_level.js +var require_profiling_level = __commonJS({ + "node_modules/mongodb/lib/operations/profiling_level.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ProfilingLevelOperation = void 0; + var bson_1 = require_bson2(); + var responses_1 = require_responses(); + var error_1 = require_error(); + var command_1 = require_command(); + var ProfilingLevelResponse = class extends responses_1.MongoDBResponse { + get was() { + return this.get("was", bson_1.BSONType.int, true); + } + }; + var ProfilingLevelOperation = class extends command_1.CommandOperation { + constructor(db, options) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = ProfilingLevelResponse; + this.options = options; + } + get commandName() { + return "profile"; + } + buildCommandDocument(_connection) { + return { profile: -1 }; + } + handleOk(response) { + if (response.ok === 1) { + const was = response.was; + if (was === 0) + return "off"; + if (was === 1) + return "slow_only"; + if (was === 2) + return "all"; + throw new error_1.MongoUnexpectedServerResponseError(`Illegal profiling level value ${was}`); + } else { + throw new error_1.MongoUnexpectedServerResponseError("Error with profile command"); + } + } + }; + exports2.ProfilingLevelOperation = ProfilingLevelOperation; + } +}); + +// node_modules/mongodb/lib/operations/rename.js +var require_rename = __commonJS({ + "node_modules/mongodb/lib/operations/rename.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RenameOperation = void 0; + var responses_1 = require_responses(); + var collection_1 = require_collection2(); + var utils_1 = require_utils3(); + var command_1 = require_command(); + var operation_1 = require_operation(); + var RenameOperation = class extends command_1.CommandOperation { + constructor(collection, newName, options) { + super(collection, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.collection = collection; + this.newName = newName; + this.options = options; + this.ns = new utils_1.MongoDBNamespace("admin", "$cmd"); + } + get commandName() { + return "renameCollection"; + } + buildCommandDocument(_connection, _session) { + const renameCollection = this.collection.namespace; + const to = this.collection.s.namespace.withCollection(this.newName).toString(); + const dropTarget = typeof this.options.dropTarget === "boolean" ? this.options.dropTarget : false; + return { + renameCollection, + to, + dropTarget + }; + } + handleOk(_response) { + return new collection_1.Collection(this.collection.db, this.newName, this.collection.s.options); + } + }; + exports2.RenameOperation = RenameOperation; + (0, operation_1.defineAspects)(RenameOperation, [operation_1.Aspect.WRITE_OPERATION]); + } +}); + +// node_modules/mongodb/lib/operations/set_profiling_level.js +var require_set_profiling_level = __commonJS({ + "node_modules/mongodb/lib/operations/set_profiling_level.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SetProfilingLevelOperation = exports2.ProfilingLevel = void 0; + var responses_1 = require_responses(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var command_1 = require_command(); + var levelValues = /* @__PURE__ */ new Set(["off", "slow_only", "all"]); + exports2.ProfilingLevel = Object.freeze({ + off: "off", + slowOnly: "slow_only", + all: "all" + }); + var SetProfilingLevelOperation = class extends command_1.CommandOperation { + constructor(db, level, options) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + switch (level) { + case exports2.ProfilingLevel.off: + this.profile = 0; + break; + case exports2.ProfilingLevel.slowOnly: + this.profile = 1; + break; + case exports2.ProfilingLevel.all: + this.profile = 2; + break; + default: + this.profile = 0; + break; + } + this.level = level; + } + get commandName() { + return "profile"; + } + buildCommandDocument(_connection) { + const level = this.level; + if (!levelValues.has(level)) { + throw new error_1.MongoInvalidArgumentError(`Profiling level must be one of "${(0, utils_1.enumToString)(exports2.ProfilingLevel)}"`); + } + return { profile: this.profile }; + } + handleOk(_response) { + return this.level; + } + }; + exports2.SetProfilingLevelOperation = SetProfilingLevelOperation; + } +}); + +// node_modules/mongodb/lib/operations/stats.js +var require_stats = __commonJS({ + "node_modules/mongodb/lib/operations/stats.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DbStatsOperation = void 0; + var responses_1 = require_responses(); + var command_1 = require_command(); + var operation_1 = require_operation(); + var DbStatsOperation = class extends command_1.CommandOperation { + constructor(db, options) { + super(db, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + } + get commandName() { + return "dbStats"; + } + buildCommandDocument(_connection) { + const command = { dbStats: true }; + if (this.options.scale != null) { + command.scale = this.options.scale; + } + return command; + } + }; + exports2.DbStatsOperation = DbStatsOperation; + (0, operation_1.defineAspects)(DbStatsOperation, [operation_1.Aspect.READ_OPERATION]); + } +}); + +// node_modules/mongodb/lib/db.js +var require_db2 = __commonJS({ + "node_modules/mongodb/lib/db.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Db = void 0; + var admin_1 = require_admin(); + var bson_1 = require_bson2(); + var change_stream_1 = require_change_stream(); + var collection_1 = require_collection2(); + var CONSTANTS = require_constants2(); + var aggregation_cursor_1 = require_aggregation_cursor(); + var list_collections_cursor_1 = require_list_collections_cursor(); + var run_command_cursor_1 = require_run_command_cursor(); + var error_1 = require_error(); + var create_collection_1 = require_create_collection(); + var drop_1 = require_drop(); + var execute_operation_1 = require_execute_operation(); + var indexes_1 = require_indexes(); + var profiling_level_1 = require_profiling_level(); + var remove_user_1 = require_remove_user(); + var rename_1 = require_rename(); + var run_command_1 = require_run_command(); + var set_profiling_level_1 = require_set_profiling_level(); + var stats_1 = require_stats(); + var read_concern_1 = require_read_concern(); + var read_preference_1 = require_read_preference(); + var utils_1 = require_utils3(); + var write_concern_1 = require_write_concern(); + var DB_OPTIONS_ALLOW_LIST = [ + "writeConcern", + "readPreference", + "readPreferenceTags", + "native_parser", + "forceServerObjectId", + "pkFactory", + "serializeFunctions", + "raw", + "authSource", + "ignoreUndefined", + "readConcern", + "retryMiliSeconds", + "numberOfRetries", + "useBigInt64", + "promoteBuffers", + "promoteLongs", + "bsonRegExp", + "enableUtf8Validation", + "promoteValues", + "compression", + "retryWrites", + "timeoutMS" + ]; + var Db = class { + /** + * Creates a new Db instance. + * + * Db name cannot contain a dot, the server may apply more restrictions when an operation is run. + * + * @param client - The MongoClient for the database. + * @param databaseName - The name of the database this instance represents. + * @param options - Optional settings for Db construction. + */ + constructor(client, databaseName, options) { + options = options ?? {}; + options = (0, utils_1.filterOptions)(options, DB_OPTIONS_ALLOW_LIST); + if (typeof databaseName === "string" && databaseName.includes(".")) { + throw new error_1.MongoInvalidArgumentError(`Database names cannot contain the character '.'`); + } + this.s = { + // Options + options, + // Unpack read preference + readPreference: read_preference_1.ReadPreference.fromOptions(options), + // Merge bson options + bsonOptions: (0, bson_1.resolveBSONOptions)(options, client), + // Set up the primary key factory or fallback to ObjectId + pkFactory: options?.pkFactory ?? utils_1.DEFAULT_PK_FACTORY, + // ReadConcern + readConcern: read_concern_1.ReadConcern.fromOptions(options), + writeConcern: write_concern_1.WriteConcern.fromOptions(options), + // Namespace + namespace: new utils_1.MongoDBNamespace(databaseName) + }; + this.client = client; + } + get databaseName() { + return this.s.namespace.db; + } + // Options + get options() { + return this.s.options; + } + /** + * Check if a secondary can be used (because the read preference is *not* set to primary) + */ + get secondaryOk() { + return this.s.readPreference?.preference !== "primary" || false; + } + get readConcern() { + return this.s.readConcern; + } + /** + * The current readPreference of the Db. If not explicitly defined for + * this Db, will be inherited from the parent MongoClient + */ + get readPreference() { + if (this.s.readPreference == null) { + return this.client.readPreference; + } + return this.s.readPreference; + } + get bsonOptions() { + return this.s.bsonOptions; + } + // get the write Concern + get writeConcern() { + return this.s.writeConcern; + } + get namespace() { + return this.s.namespace.toString(); + } + get timeoutMS() { + return this.s.options?.timeoutMS; + } + /** + * Create a new collection on a server with the specified options. Use this to create capped collections. + * More information about command options available at https://www.mongodb.com/docs/manual/reference/command/create/ + * + * Collection namespace validation is performed server-side. + * + * @param name - The name of the collection to create + * @param options - Optional settings for the command + */ + async createCollection(name, options) { + options = (0, utils_1.resolveOptions)(this, options); + return await (0, create_collection_1.createCollections)(this, name, options); + } + /** + * Execute a command + * + * @remarks + * This command does not inherit options from the MongoClient. + * + * The driver will ensure the following fields are attached to the command sent to the server: + * - `lsid` - sourced from an implicit session or options.session + * - `$readPreference` - defaults to primary or can be configured by options.readPreference + * - `$db` - sourced from the name of this database + * + * If the client has a serverApi setting: + * - `apiVersion` + * - `apiStrict` + * - `apiDeprecationErrors` + * + * When in a transaction: + * - `readConcern` - sourced from readConcern set on the TransactionOptions + * - `writeConcern` - sourced from writeConcern set on the TransactionOptions + * + * Attaching any of the above fields to the command will have no effect as the driver will overwrite the value. + * + * @param command - The command to run + * @param options - Optional settings for the command + */ + async command(command, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new run_command_1.RunCommandOperation(this.s.namespace, command, (0, utils_1.resolveOptions)(void 0, { + ...(0, bson_1.resolveBSONOptions)(options), + timeoutMS: options?.timeoutMS ?? this.timeoutMS, + session: options?.session, + readPreference: options?.readPreference, + signal: options?.signal + }))); + } + /** + * Execute an aggregation framework pipeline against the database. + * + * @param pipeline - An array of aggregation stages to be executed + * @param options - Optional settings for the command + */ + aggregate(pipeline = [], options) { + return new aggregation_cursor_1.AggregationCursor(this.client, this.s.namespace, pipeline, (0, utils_1.resolveOptions)(this, options)); + } + /** Return the Admin db instance */ + admin() { + return new admin_1.Admin(this); + } + /** + * Returns a reference to a MongoDB Collection. If it does not exist it will be created implicitly. + * + * Collection namespace validation is performed server-side. + * + * @param name - the collection name we wish to access. + * @returns return the new Collection instance + */ + collection(name, options = {}) { + if (typeof options === "function") { + throw new error_1.MongoInvalidArgumentError("The callback form of this helper has been removed."); + } + return new collection_1.Collection(this, name, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Get all the db statistics. + * + * @param options - Optional settings for the command + */ + async stats(options) { + return await (0, execute_operation_1.executeOperation)(this.client, new stats_1.DbStatsOperation(this, (0, utils_1.resolveOptions)(this, options))); + } + listCollections(filter = {}, options = {}) { + return new list_collections_cursor_1.ListCollectionsCursor(this, filter, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Rename a collection. + * + * @remarks + * This operation does not inherit options from the MongoClient. + * + * @param fromCollection - Name of current collection to rename + * @param toCollection - New name of of the collection + * @param options - Optional settings for the command + */ + async renameCollection(fromCollection, toCollection, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new rename_1.RenameOperation(this.collection(fromCollection), toCollection, (0, utils_1.resolveOptions)(void 0, { + ...options, + new_collection: true, + readPreference: read_preference_1.ReadPreference.primary + }))); + } + /** + * Drop a collection from the database, removing it permanently. New accesses will create a new collection. + * + * @param name - Name of collection to drop + * @param options - Optional settings for the command + */ + async dropCollection(name, options) { + options = (0, utils_1.resolveOptions)(this, options); + return await (0, drop_1.dropCollections)(this, name, options); + } + /** + * Drop a database, removing it permanently from the server. + * + * @param options - Optional settings for the command + */ + async dropDatabase(options) { + return await (0, execute_operation_1.executeOperation)(this.client, new drop_1.DropDatabaseOperation(this, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Fetch all collections for the current db. + * + * @param options - Optional settings for the command + */ + async collections(options) { + options = (0, utils_1.resolveOptions)(this, options); + const collections = await this.listCollections({}, { ...options, nameOnly: true }).toArray(); + return collections.filter( + // Filter collections removing any illegal ones + ({ name }) => !name.includes("$") + ).map(({ name }) => new collection_1.Collection(this, name, this.s.options)); + } + /** + * Creates an index on the db and collection. + * + * @param name - Name of the collection to create the index on. + * @param indexSpec - Specify the field to index, or an index specification + * @param options - Optional settings for the command + */ + async createIndex(name, indexSpec, options) { + const indexes = await (0, execute_operation_1.executeOperation)(this.client, indexes_1.CreateIndexesOperation.fromIndexSpecification(this, name, indexSpec, options)); + return indexes[0]; + } + /** + * Remove a user from a database + * + * @param username - The username to remove + * @param options - Optional settings for the command + */ + async removeUser(username, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new remove_user_1.RemoveUserOperation(this, username, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Set the current profiling level of MongoDB + * + * @param level - The new profiling level (off, slow_only, all). + * @param options - Optional settings for the command + */ + async setProfilingLevel(level, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new set_profiling_level_1.SetProfilingLevelOperation(this, level, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Retrieve the current profiling Level for MongoDB + * + * @param options - Optional settings for the command + */ + async profilingLevel(options) { + return await (0, execute_operation_1.executeOperation)(this.client, new profiling_level_1.ProfilingLevelOperation(this, (0, utils_1.resolveOptions)(this, options))); + } + async indexInformation(name, options) { + return await this.collection(name).indexInformation((0, utils_1.resolveOptions)(this, options)); + } + /** + * Create a new Change Stream, watching for new changes (insertions, updates, + * replacements, deletions, and invalidations) in this database. Will ignore all + * changes to system collections. + * + * @remarks + * watch() accepts two generic arguments for distinct use cases: + * - The first is to provide the schema that may be defined for all the collections within this database + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * + * @remarks + * When `timeoutMS` is configured for a change stream, it will have different behaviour depending + * on whether the change stream is in iterator mode or emitter mode. In both cases, a change + * stream will time out if it does not receive a change event within `timeoutMS` of the last change + * event. + * + * Note that if a change stream is consistently timing out when watching a collection, database or + * client that is being changed, then this may be due to the server timing out before it can finish + * processing the existing oplog. To address this, restart the change stream with a higher + * `timeoutMS`. + * + * If the change stream times out the initial aggregate operation to establish the change stream on + * the server, then the client will close the change stream. If the getMore calls to the server + * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError + * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in + * emitter mode. + * + * To determine whether or not the change stream is still open following a timeout, check the + * {@link ChangeStream.closed} getter. + * + * @example + * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream. + * The next call can just be retried after this succeeds. + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * try { + * await changeStream.next(); + * } catch (e) { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * await changeStream.next(); + * } + * throw e; + * } + * ``` + * + * @example + * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will + * emit an error event that returns a MongoOperationTimeoutError, but will not close the change + * stream unless the resume attempt fails. There is no need to re-establish change listeners as + * this will automatically continue emitting change events once the resume attempt completes. + * + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * changeStream.on('change', console.log); + * changeStream.on('error', e => { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * // do nothing + * } else { + * changeStream.close(); + * } + * }); + * ``` + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TSchema - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch(pipeline = [], options = {}) { + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + return new change_stream_1.ChangeStream(this, pipeline, (0, utils_1.resolveOptions)(this, options)); + } + /** + * A low level cursor API providing basic driver functionality: + * - ClientSession management + * - ReadPreference for server selection + * - Running getMores automatically when a local batch is exhausted + * + * @param command - The command that will start a cursor on the server. + * @param options - Configurations for running the command, bson options will apply to getMores + */ + runCursorCommand(command, options) { + return new run_command_cursor_1.RunCommandCursor(this, command, options); + } + }; + exports2.Db = Db; + Db.SYSTEM_NAMESPACE_COLLECTION = CONSTANTS.SYSTEM_NAMESPACE_COLLECTION; + Db.SYSTEM_INDEX_COLLECTION = CONSTANTS.SYSTEM_INDEX_COLLECTION; + Db.SYSTEM_PROFILE_COLLECTION = CONSTANTS.SYSTEM_PROFILE_COLLECTION; + Db.SYSTEM_USER_COLLECTION = CONSTANTS.SYSTEM_USER_COLLECTION; + Db.SYSTEM_COMMAND_COLLECTION = CONSTANTS.SYSTEM_COMMAND_COLLECTION; + Db.SYSTEM_JS_COLLECTION = CONSTANTS.SYSTEM_JS_COLLECTION; + } +}); + +// node_modules/mongodb/lib/cmap/auth/mongodb_aws.js +var require_mongodb_aws = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/mongodb_aws.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MongoDBAWS = void 0; + var BSON = require_bson2(); + var deps_1 = require_deps(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var auth_provider_1 = require_auth_provider(); + var aws_temporary_credentials_1 = require_aws_temporary_credentials(); + var mongo_credentials_1 = require_mongo_credentials(); + var providers_1 = require_providers(); + var ASCII_N = 110; + var bsonOptions = { + useBigInt64: false, + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false + }; + var MongoDBAWS = class extends auth_provider_1.AuthProvider { + constructor(credentialProvider) { + super(); + this.credentialProvider = credentialProvider; + this.credentialFetcher = aws_temporary_credentials_1.AWSTemporaryCredentialProvider.isAWSSDKInstalled ? new aws_temporary_credentials_1.AWSSDKCredentialProvider(credentialProvider) : new aws_temporary_credentials_1.LegacyAWSTemporaryCredentialProvider(); + } + async auth(authContext) { + const { connection } = authContext; + if (!authContext.credentials) { + throw new error_1.MongoMissingCredentialsError("AuthContext must provide credentials."); + } + if ("kModuleError" in deps_1.aws4) { + throw deps_1.aws4["kModuleError"]; + } + const { sign } = deps_1.aws4; + if ((0, utils_1.maxWireVersion)(connection) < 9) { + throw new error_1.MongoCompatibilityError("MONGODB-AWS authentication requires MongoDB version 4.4 or later"); + } + if (!authContext.credentials.username) { + authContext.credentials = await makeTempCredentials(authContext.credentials, this.credentialFetcher); + } + const { credentials } = authContext; + const accessKeyId = credentials.username; + const secretAccessKey = credentials.password; + const sessionToken = credentials.mechanismProperties.AWS_SESSION_TOKEN; + const awsCredentials = accessKeyId && secretAccessKey && sessionToken ? { accessKeyId, secretAccessKey, sessionToken } : accessKeyId && secretAccessKey ? { accessKeyId, secretAccessKey } : void 0; + const db = credentials.source; + const nonce = await (0, utils_1.randomBytes)(32); + const saslStart = { + saslStart: 1, + mechanism: "MONGODB-AWS", + payload: BSON.serialize({ r: nonce, p: ASCII_N }, bsonOptions) + }; + const saslStartResponse = await connection.command((0, utils_1.ns)(`${db}.$cmd`), saslStart, void 0); + const serverResponse = BSON.deserialize(saslStartResponse.payload.buffer, bsonOptions); + const host = serverResponse.h; + const serverNonce = serverResponse.s.buffer; + if (serverNonce.length !== 64) { + throw new error_1.MongoRuntimeError(`Invalid server nonce length ${serverNonce.length}, expected 64`); + } + if (!utils_1.ByteUtils.equals(serverNonce.subarray(0, nonce.byteLength), nonce)) { + throw new error_1.MongoRuntimeError("Server nonce does not begin with client nonce"); + } + if (host.length < 1 || host.length > 255 || host.indexOf("..") !== -1) { + throw new error_1.MongoRuntimeError(`Server returned an invalid host: "${host}"`); + } + const body = "Action=GetCallerIdentity&Version=2011-06-15"; + const options = sign({ + method: "POST", + host, + region: deriveRegion(serverResponse.h), + service: "sts", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + "Content-Length": body.length, + "X-MongoDB-Server-Nonce": utils_1.ByteUtils.toBase64(serverNonce), + "X-MongoDB-GS2-CB-Flag": "n" + }, + path: "/", + body + }, awsCredentials); + const payload2 = { + a: options.headers.Authorization, + d: options.headers["X-Amz-Date"] + }; + if (sessionToken) { + payload2.t = sessionToken; + } + const saslContinue = { + saslContinue: 1, + conversationId: saslStartResponse.conversationId, + payload: BSON.serialize(payload2, bsonOptions) + }; + await connection.command((0, utils_1.ns)(`${db}.$cmd`), saslContinue, void 0); + } + }; + exports2.MongoDBAWS = MongoDBAWS; + async function makeTempCredentials(credentials, awsCredentialFetcher) { + function makeMongoCredentialsFromAWSTemp(creds) { + if (!creds.AccessKeyId || !creds.SecretAccessKey) { + throw new error_1.MongoMissingCredentialsError("Could not obtain temporary MONGODB-AWS credentials"); + } + return new mongo_credentials_1.MongoCredentials({ + username: creds.AccessKeyId, + password: creds.SecretAccessKey, + source: credentials.source, + mechanism: providers_1.AuthMechanism.MONGODB_AWS, + mechanismProperties: { + AWS_SESSION_TOKEN: creds.Token + } + }); + } + const temporaryCredentials = await awsCredentialFetcher.getCredentials(); + return makeMongoCredentialsFromAWSTemp(temporaryCredentials); + } + function deriveRegion(host) { + const parts = host.split("."); + if (parts.length === 1 || parts[1] === "amazonaws") { + return "us-east-1"; + } + return parts[1]; + } + } +}); + +// node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.js +var require_command_builders = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.finishCommandDocument = finishCommandDocument; + exports2.startCommandDocument = startCommandDocument; + var bson_1 = require_bson2(); + var providers_1 = require_providers(); + function finishCommandDocument(token, conversationId) { + if (conversationId != null) { + return { + saslContinue: 1, + conversationId, + payload: new bson_1.Binary(bson_1.BSON.serialize({ jwt: token })) + }; + } + return { + saslStart: 1, + mechanism: providers_1.AuthMechanism.MONGODB_OIDC, + payload: new bson_1.Binary(bson_1.BSON.serialize({ jwt: token })) + }; + } + function startCommandDocument(credentials) { + const payload2 = {}; + if (credentials.username) { + payload2.n = credentials.username; + } + return { + saslStart: 1, + autoAuthorize: 1, + mechanism: providers_1.AuthMechanism.MONGODB_OIDC, + payload: new bson_1.Binary(bson_1.BSON.serialize(payload2)) + }; + } + } +}); + +// node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js +var require_callback_workflow = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.CallbackWorkflow = exports2.AUTOMATED_TIMEOUT_MS = exports2.HUMAN_TIMEOUT_MS = void 0; + var promises_1 = require("timers/promises"); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var command_builders_1 = require_command_builders(); + exports2.HUMAN_TIMEOUT_MS = 3e5; + exports2.AUTOMATED_TIMEOUT_MS = 6e4; + var RESULT_PROPERTIES = ["accessToken", "expiresInSeconds", "refreshToken"]; + var CALLBACK_RESULT_ERROR = "User provided OIDC callbacks must return a valid object with an accessToken."; + var THROTTLE_MS = 100; + var CallbackWorkflow = class { + /** + * Instantiate the callback workflow. + */ + constructor(cache4, callback) { + this.cache = cache4; + this.callback = this.withLock(callback); + this.lastExecutionTime = Date.now() - THROTTLE_MS; + } + /** + * Get the document to add for speculative authentication. This also needs + * to add a db field from the credentials source. + */ + async speculativeAuth(connection, credentials) { + if (this.cache.hasAccessToken) { + const accessToken = this.cache.getAccessToken(); + connection.accessToken = accessToken; + const document2 = (0, command_builders_1.finishCommandDocument)(accessToken); + document2.db = credentials.source; + return { speculativeAuthenticate: document2 }; + } + return {}; + } + /** + * Reauthenticate the callback workflow. For this we invalidated the access token + * in the cache and run the authentication steps again. No initial handshake needs + * to be sent. + */ + async reauthenticate(connection, credentials) { + if (this.cache.hasAccessToken) { + if (connection.accessToken === this.cache.getAccessToken()) { + this.cache.removeAccessToken(); + delete connection.accessToken; + } else { + connection.accessToken = this.cache.getAccessToken(); + } + } + await this.execute(connection, credentials); + } + /** + * Starts the callback authentication process. If there is a speculative + * authentication document from the initial handshake, then we will use that + * value to get the issuer, otherwise we will send the saslStart command. + */ + async startAuthentication(connection, credentials, response) { + let result; + if (response?.speculativeAuthenticate) { + result = response.speculativeAuthenticate; + } else { + result = await connection.command((0, utils_1.ns)(credentials.source), (0, command_builders_1.startCommandDocument)(credentials), void 0); + } + return result; + } + /** + * Finishes the callback authentication process. + */ + async finishAuthentication(connection, credentials, token, conversationId) { + await connection.command((0, utils_1.ns)(credentials.source), (0, command_builders_1.finishCommandDocument)(token, conversationId), void 0); + } + /** + * Executes the callback and validates the output. + */ + async executeAndValidateCallback(params) { + const result = await this.callback(params); + if (isCallbackResultInvalid(result)) { + throw new error_1.MongoMissingCredentialsError(CALLBACK_RESULT_ERROR); + } + return result; + } + /** + * Ensure the callback is only executed one at a time and throttles the calls + * to every 100ms. + */ + withLock(callback) { + let lock = Promise.resolve(); + return async (params) => { + await lock; + lock = lock.catch(() => null).then(async () => { + const difference = Date.now() - this.lastExecutionTime; + if (difference <= THROTTLE_MS) { + await (0, promises_1.setTimeout)(THROTTLE_MS - difference, { signal: params.timeoutContext }); + } + this.lastExecutionTime = Date.now(); + return await callback(params); + }); + return await lock; + }; + } + }; + exports2.CallbackWorkflow = CallbackWorkflow; + function isCallbackResultInvalid(tokenResult) { + if (tokenResult == null || typeof tokenResult !== "object") + return true; + if (!("accessToken" in tokenResult)) + return true; + return !Object.getOwnPropertyNames(tokenResult).every((prop) => RESULT_PROPERTIES.includes(prop)); + } + } +}); + +// node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js +var require_automated_callback_workflow = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AutomatedCallbackWorkflow = void 0; + var error_1 = require_error(); + var timeout_1 = require_timeout(); + var mongodb_oidc_1 = require_mongodb_oidc(); + var callback_workflow_1 = require_callback_workflow(); + var AutomatedCallbackWorkflow = class extends callback_workflow_1.CallbackWorkflow { + /** + * Instantiate the human callback workflow. + */ + constructor(cache4, callback) { + super(cache4, callback); + } + /** + * Execute the OIDC callback workflow. + */ + async execute(connection, credentials) { + if (this.cache.hasAccessToken) { + const token = this.cache.getAccessToken(); + if (!connection.accessToken) { + connection.accessToken = token; + } + try { + return await this.finishAuthentication(connection, credentials, token); + } catch (error2) { + if (error2 instanceof error_1.MongoError && error2.code === error_1.MONGODB_ERROR_CODES.AuthenticationFailed) { + this.cache.removeAccessToken(); + return await this.execute(connection, credentials); + } else { + throw error2; + } + } + } + const response = await this.fetchAccessToken(credentials); + this.cache.put(response); + connection.accessToken = response.accessToken; + await this.finishAuthentication(connection, credentials, response.accessToken); + } + /** + * Fetches the access token using the callback. + */ + async fetchAccessToken(credentials) { + const controller = new AbortController(); + const params = { + timeoutContext: controller.signal, + version: mongodb_oidc_1.OIDC_VERSION + }; + if (credentials.username) { + params.username = credentials.username; + } + if (credentials.mechanismProperties.TOKEN_RESOURCE) { + params.tokenAudience = credentials.mechanismProperties.TOKEN_RESOURCE; + } + const timeout = timeout_1.Timeout.expires(callback_workflow_1.AUTOMATED_TIMEOUT_MS); + try { + return await Promise.race([this.executeAndValidateCallback(params), timeout]); + } catch (error2) { + if (timeout_1.TimeoutError.is(error2)) { + controller.abort(); + throw new error_1.MongoOIDCError(`OIDC callback timed out after ${callback_workflow_1.AUTOMATED_TIMEOUT_MS}ms.`); + } + throw error2; + } finally { + timeout.clear(); + } + } + }; + exports2.AutomatedCallbackWorkflow = AutomatedCallbackWorkflow; + } +}); + +// node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js +var require_azure_machine_workflow = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.callback = void 0; + var azure_1 = require_azure(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var AZURE_HEADERS = Object.freeze({ Metadata: "true", Accept: "application/json" }); + var ENDPOINT_RESULT_ERROR = "Azure endpoint did not return a value with only access_token and expires_in properties"; + var TOKEN_RESOURCE_MISSING_ERROR = "TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is azure."; + var callback = async (params) => { + const tokenAudience = params.tokenAudience; + const username = params.username; + if (!tokenAudience) { + throw new error_1.MongoAzureError(TOKEN_RESOURCE_MISSING_ERROR); + } + const response = await getAzureTokenData(tokenAudience, username); + if (!isEndpointResultValid(response)) { + throw new error_1.MongoAzureError(ENDPOINT_RESULT_ERROR); + } + return response; + }; + exports2.callback = callback; + async function getAzureTokenData(tokenAudience, username) { + const url = new URL(azure_1.AZURE_BASE_URL); + (0, azure_1.addAzureParams)(url, tokenAudience, username); + const response = await (0, utils_1.get)(url, { + headers: AZURE_HEADERS + }); + if (response.status !== 200) { + throw new error_1.MongoAzureError(`Status code ${response.status} returned from the Azure endpoint. Response body: ${response.body}`); + } + const result = JSON.parse(response.body); + return { + accessToken: result.access_token, + expiresInSeconds: Number(result.expires_in) + }; + } + function isEndpointResultValid(token) { + if (token == null || typeof token !== "object") + return false; + return "accessToken" in token && typeof token.accessToken === "string" && "expiresInSeconds" in token && typeof token.expiresInSeconds === "number"; + } + } +}); + +// node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js +var require_gcp_machine_workflow = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.callback = void 0; + var error_1 = require_error(); + var utils_1 = require_utils3(); + var GCP_BASE_URL = "http://metadata/computeMetadata/v1/instance/service-accounts/default/identity"; + var GCP_HEADERS = Object.freeze({ "Metadata-Flavor": "Google" }); + var TOKEN_RESOURCE_MISSING_ERROR = "TOKEN_RESOURCE must be set in the auth mechanism properties when ENVIRONMENT is gcp."; + var callback = async (params) => { + const tokenAudience = params.tokenAudience; + if (!tokenAudience) { + throw new error_1.MongoGCPError(TOKEN_RESOURCE_MISSING_ERROR); + } + return await getGcpTokenData(tokenAudience); + }; + exports2.callback = callback; + async function getGcpTokenData(tokenAudience) { + const url = new URL(GCP_BASE_URL); + url.searchParams.append("audience", tokenAudience); + const response = await (0, utils_1.get)(url, { + headers: GCP_HEADERS + }); + if (response.status !== 200) { + throw new error_1.MongoGCPError(`Status code ${response.status} returned from the GCP endpoint. Response body: ${response.body}`); + } + return { accessToken: response.body }; + } + } +}); + +// node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.js +var require_k8s_machine_workflow = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.callback = void 0; + var promises_1 = require("fs/promises"); + var FALLBACK_FILENAME = "/var/run/secrets/kubernetes.io/serviceaccount/token"; + var AZURE_FILENAME = "AZURE_FEDERATED_TOKEN_FILE"; + var AWS_FILENAME = "AWS_WEB_IDENTITY_TOKEN_FILE"; + var callback = async () => { + let filename; + if (process.env[AZURE_FILENAME]) { + filename = process.env[AZURE_FILENAME]; + } else if (process.env[AWS_FILENAME]) { + filename = process.env[AWS_FILENAME]; + } else { + filename = FALLBACK_FILENAME; + } + const token = await (0, promises_1.readFile)(filename, "utf8"); + return { accessToken: token }; + }; + exports2.callback = callback; + } +}); + +// node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.js +var require_token_cache = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.TokenCache = void 0; + var error_1 = require_error(); + var MongoOIDCError = class extends error_1.MongoDriverError { + }; + var TokenCache = class { + get hasAccessToken() { + return !!this.accessToken; + } + get hasRefreshToken() { + return !!this.refreshToken; + } + get hasIdpInfo() { + return !!this.idpInfo; + } + getAccessToken() { + if (!this.accessToken) { + throw new MongoOIDCError("Attempted to get an access token when none exists."); + } + return this.accessToken; + } + getRefreshToken() { + if (!this.refreshToken) { + throw new MongoOIDCError("Attempted to get a refresh token when none exists."); + } + return this.refreshToken; + } + getIdpInfo() { + if (!this.idpInfo) { + throw new MongoOIDCError("Attempted to get IDP information when none exists."); + } + return this.idpInfo; + } + put(response, idpInfo) { + this.accessToken = response.accessToken; + this.refreshToken = response.refreshToken; + this.expiresInSeconds = response.expiresInSeconds; + if (idpInfo) { + this.idpInfo = idpInfo; + } + } + removeAccessToken() { + this.accessToken = void 0; + } + removeRefreshToken() { + this.refreshToken = void 0; + } + }; + exports2.TokenCache = TokenCache; + } +}); + +// node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js +var require_token_machine_workflow = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.callback = void 0; + var fs = require("fs"); + var error_1 = require_error(); + var TOKEN_MISSING_ERROR = "OIDC_TOKEN_FILE must be set in the environment."; + var callback = async () => { + const tokenFile = process.env.OIDC_TOKEN_FILE; + if (!tokenFile) { + throw new error_1.MongoAWSError(TOKEN_MISSING_ERROR); + } + const token = await fs.promises.readFile(tokenFile, "utf8"); + return { accessToken: token }; + }; + exports2.callback = callback; + } +}); + +// node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js +var require_mongodb_oidc = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MongoDBOIDC = exports2.OIDC_WORKFLOWS = exports2.OIDC_VERSION = void 0; + var error_1 = require_error(); + var auth_provider_1 = require_auth_provider(); + var automated_callback_workflow_1 = require_automated_callback_workflow(); + var azure_machine_workflow_1 = require_azure_machine_workflow(); + var gcp_machine_workflow_1 = require_gcp_machine_workflow(); + var k8s_machine_workflow_1 = require_k8s_machine_workflow(); + var token_cache_1 = require_token_cache(); + var token_machine_workflow_1 = require_token_machine_workflow(); + var MISSING_CREDENTIALS_ERROR = "AuthContext must provide credentials."; + exports2.OIDC_VERSION = 1; + exports2.OIDC_WORKFLOWS = /* @__PURE__ */ new Map(); + exports2.OIDC_WORKFLOWS.set("test", () => new automated_callback_workflow_1.AutomatedCallbackWorkflow(new token_cache_1.TokenCache(), token_machine_workflow_1.callback)); + exports2.OIDC_WORKFLOWS.set("azure", () => new automated_callback_workflow_1.AutomatedCallbackWorkflow(new token_cache_1.TokenCache(), azure_machine_workflow_1.callback)); + exports2.OIDC_WORKFLOWS.set("gcp", () => new automated_callback_workflow_1.AutomatedCallbackWorkflow(new token_cache_1.TokenCache(), gcp_machine_workflow_1.callback)); + exports2.OIDC_WORKFLOWS.set("k8s", () => new automated_callback_workflow_1.AutomatedCallbackWorkflow(new token_cache_1.TokenCache(), k8s_machine_workflow_1.callback)); + var MongoDBOIDC = class extends auth_provider_1.AuthProvider { + /** + * Instantiate the auth provider. + */ + constructor(workflow) { + super(); + if (!workflow) { + throw new error_1.MongoInvalidArgumentError("No workflow provided to the OIDC auth provider."); + } + this.workflow = workflow; + } + /** + * Authenticate using OIDC + */ + async auth(authContext) { + const { connection, reauthenticating, response } = authContext; + if (response?.speculativeAuthenticate?.done && !reauthenticating) { + return; + } + const credentials = getCredentials(authContext); + if (reauthenticating) { + await this.workflow.reauthenticate(connection, credentials); + } else { + await this.workflow.execute(connection, credentials, response); + } + } + /** + * Add the speculative auth for the initial handshake. + */ + async prepare(handshakeDoc, authContext) { + const { connection } = authContext; + const credentials = getCredentials(authContext); + const result = await this.workflow.speculativeAuth(connection, credentials); + return { ...handshakeDoc, ...result }; + } + }; + exports2.MongoDBOIDC = MongoDBOIDC; + function getCredentials(authContext) { + const { credentials } = authContext; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError(MISSING_CREDENTIALS_ERROR); + } + return credentials; + } + } +}); + +// node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.js +var require_human_callback_workflow = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.HumanCallbackWorkflow = void 0; + var bson_1 = require_bson2(); + var error_1 = require_error(); + var timeout_1 = require_timeout(); + var mongodb_oidc_1 = require_mongodb_oidc(); + var callback_workflow_1 = require_callback_workflow(); + var HumanCallbackWorkflow = class extends callback_workflow_1.CallbackWorkflow { + /** + * Instantiate the human callback workflow. + */ + constructor(cache4, callback) { + super(cache4, callback); + } + /** + * Execute the OIDC human callback workflow. + */ + async execute(connection, credentials) { + if (this.cache.hasAccessToken) { + const token = this.cache.getAccessToken(); + connection.accessToken = token; + try { + return await this.finishAuthentication(connection, credentials, token); + } catch (error2) { + if (error2 instanceof error_1.MongoError && error2.code === error_1.MONGODB_ERROR_CODES.AuthenticationFailed) { + this.cache.removeAccessToken(); + delete connection.accessToken; + return await this.execute(connection, credentials); + } else { + throw error2; + } + } + } + if (this.cache.hasRefreshToken) { + const refreshToken = this.cache.getRefreshToken(); + const result = await this.fetchAccessToken(this.cache.getIdpInfo(), credentials, refreshToken); + this.cache.put(result); + connection.accessToken = result.accessToken; + try { + return await this.finishAuthentication(connection, credentials, result.accessToken); + } catch (error2) { + if (error2 instanceof error_1.MongoError && error2.code === error_1.MONGODB_ERROR_CODES.AuthenticationFailed) { + this.cache.removeRefreshToken(); + delete connection.accessToken; + return await this.execute(connection, credentials); + } else { + throw error2; + } + } + } + const startResponse = await this.startAuthentication(connection, credentials); + const conversationId = startResponse.conversationId; + const idpInfo = bson_1.BSON.deserialize(startResponse.payload.buffer); + const callbackResponse = await this.fetchAccessToken(idpInfo, credentials); + this.cache.put(callbackResponse, idpInfo); + connection.accessToken = callbackResponse.accessToken; + return await this.finishAuthentication(connection, credentials, callbackResponse.accessToken, conversationId); + } + /** + * Fetches an access token using the callback. + */ + async fetchAccessToken(idpInfo, credentials, refreshToken) { + const controller = new AbortController(); + const params = { + timeoutContext: controller.signal, + version: mongodb_oidc_1.OIDC_VERSION, + idpInfo + }; + if (credentials.username) { + params.username = credentials.username; + } + if (refreshToken) { + params.refreshToken = refreshToken; + } + const timeout = timeout_1.Timeout.expires(callback_workflow_1.HUMAN_TIMEOUT_MS); + try { + return await Promise.race([this.executeAndValidateCallback(params), timeout]); + } catch (error2) { + if (timeout_1.TimeoutError.is(error2)) { + controller.abort(); + throw new error_1.MongoOIDCError(`OIDC callback timed out after ${callback_workflow_1.HUMAN_TIMEOUT_MS}ms.`); + } + throw error2; + } finally { + timeout.clear(); + } + } + }; + exports2.HumanCallbackWorkflow = HumanCallbackWorkflow; + } +}); + +// node_modules/mongodb/lib/cmap/auth/plain.js +var require_plain = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/plain.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Plain = void 0; + var bson_1 = require_bson2(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var auth_provider_1 = require_auth_provider(); + var Plain = class extends auth_provider_1.AuthProvider { + async auth(authContext) { + const { connection, credentials } = authContext; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError("AuthContext must provide credentials."); + } + const { username, password } = credentials; + const payload2 = new bson_1.Binary(Buffer.from(`\0${username}\0${password}`)); + const command = { + saslStart: 1, + mechanism: "PLAIN", + payload: payload2, + autoAuthorize: 1 + }; + await connection.command((0, utils_1.ns)("$external.$cmd"), command, void 0); + } + }; + exports2.Plain = Plain; + } +}); + +// node_modules/@mongodb-js/saslprep/dist/index.js +var require_dist = __commonJS({ + "node_modules/@mongodb-js/saslprep/dist/index.js"(exports2, module2) { + "use strict"; + var getCodePoint = (character) => character.codePointAt(0); + var first = (x4) => x4[0]; + var last = (x4) => x4[x4.length - 1]; + function toCodePoints(input) { + const codepoints = []; + const size = input.length; + for (let i4 = 0; i4 < size; i4 += 1) { + const before = input.charCodeAt(i4); + if (before >= 55296 && before <= 56319 && size > i4 + 1) { + const next = input.charCodeAt(i4 + 1); + if (next >= 56320 && next <= 57343) { + codepoints.push((before - 55296) * 1024 + next - 56320 + 65536); + i4 += 1; + continue; + } + } + codepoints.push(before); + } + return codepoints; + } + function saslprep({ unassigned_code_points, commonly_mapped_to_nothing, non_ASCII_space_characters, prohibited_characters, bidirectional_r_al, bidirectional_l }, input, opts = {}) { + const mapping2space = non_ASCII_space_characters; + const mapping2nothing = commonly_mapped_to_nothing; + if (typeof input !== "string") { + throw new TypeError("Expected string."); + } + if (input.length === 0) { + return ""; + } + const mapped_input = toCodePoints(input).map((character) => mapping2space.get(character) ? 32 : character).filter((character) => !mapping2nothing.get(character)); + const normalized_input = String.fromCodePoint.apply(null, mapped_input).normalize("NFKC"); + const normalized_map = toCodePoints(normalized_input); + const hasProhibited = normalized_map.some((character) => prohibited_characters.get(character)); + if (hasProhibited) { + throw new Error("Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3"); + } + if (opts.allowUnassigned !== true) { + const hasUnassigned = normalized_map.some((character) => unassigned_code_points.get(character)); + if (hasUnassigned) { + throw new Error("Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5"); + } + } + const hasBidiRAL = normalized_map.some((character) => bidirectional_r_al.get(character)); + const hasBidiL = normalized_map.some((character) => bidirectional_l.get(character)); + if (hasBidiRAL && hasBidiL) { + throw new Error("String must not contain RandALCat and LCat at the same time, see https://tools.ietf.org/html/rfc3454#section-6"); + } + const isFirstBidiRAL = bidirectional_r_al.get(getCodePoint(first(normalized_input))); + const isLastBidiRAL = bidirectional_r_al.get(getCodePoint(last(normalized_input))); + if (hasBidiRAL && !(isFirstBidiRAL && isLastBidiRAL)) { + throw new Error("Bidirectional RandALCat character must be the first and the last character of the string, see https://tools.ietf.org/html/rfc3454#section-6"); + } + return normalized_input; + } + saslprep.saslprep = saslprep; + saslprep.default = saslprep; + module2.exports = saslprep; + } +}); + +// node_modules/memory-pager/index.js +var require_memory_pager = __commonJS({ + "node_modules/memory-pager/index.js"(exports2, module2) { + module2.exports = Pager; + function Pager(pageSize, opts) { + if (!(this instanceof Pager)) return new Pager(pageSize, opts); + this.length = 0; + this.updates = []; + this.path = new Uint16Array(4); + this.pages = new Array(32768); + this.maxPages = this.pages.length; + this.level = 0; + this.pageSize = pageSize || 1024; + this.deduplicate = opts ? opts.deduplicate : null; + this.zeros = this.deduplicate ? alloc2(this.deduplicate.length) : null; + } + Pager.prototype.updated = function(page) { + while (this.deduplicate && page.buffer[page.deduplicate] === this.deduplicate[page.deduplicate]) { + page.deduplicate++; + if (page.deduplicate === this.deduplicate.length) { + page.deduplicate = 0; + if (page.buffer.equals && page.buffer.equals(this.deduplicate)) page.buffer = this.deduplicate; + break; + } + } + if (page.updated || !this.updates) return; + page.updated = true; + this.updates.push(page); + }; + Pager.prototype.lastUpdate = function() { + if (!this.updates || !this.updates.length) return null; + var page = this.updates.pop(); + page.updated = false; + return page; + }; + Pager.prototype._array = function(i4, noAllocate) { + if (i4 >= this.maxPages) { + if (noAllocate) return; + grow(this, i4); + } + factor(i4, this.path); + var arr = this.pages; + for (var j4 = this.level; j4 > 0; j4--) { + var p4 = this.path[j4]; + var next = arr[p4]; + if (!next) { + if (noAllocate) return; + next = arr[p4] = new Array(32768); + } + arr = next; + } + return arr; + }; + Pager.prototype.get = function(i4, noAllocate) { + var arr = this._array(i4, noAllocate); + var first = this.path[0]; + var page = arr && arr[first]; + if (!page && !noAllocate) { + page = arr[first] = new Page(i4, alloc2(this.pageSize)); + if (i4 >= this.length) this.length = i4 + 1; + } + if (page && page.buffer === this.deduplicate && this.deduplicate && !noAllocate) { + page.buffer = copy(page.buffer); + page.deduplicate = 0; + } + return page; + }; + Pager.prototype.set = function(i4, buf) { + var arr = this._array(i4, false); + var first = this.path[0]; + if (i4 >= this.length) this.length = i4 + 1; + if (!buf || this.zeros && buf.equals && buf.equals(this.zeros)) { + arr[first] = void 0; + return; + } + if (this.deduplicate && buf.equals && buf.equals(this.deduplicate)) { + buf = this.deduplicate; + } + var page = arr[first]; + var b4 = truncate(buf, this.pageSize); + if (page) page.buffer = b4; + else arr[first] = new Page(i4, b4); + }; + Pager.prototype.toBuffer = function() { + var list2 = new Array(this.length); + var empty = alloc2(this.pageSize); + var ptr = 0; + while (ptr < list2.length) { + var arr = this._array(ptr, true); + for (var i4 = 0; i4 < 32768 && ptr < list2.length; i4++) { + list2[ptr++] = arr && arr[i4] ? arr[i4].buffer : empty; + } + } + return Buffer.concat(list2); + }; + function grow(pager, index) { + while (pager.maxPages < index) { + var old = pager.pages; + pager.pages = new Array(32768); + pager.pages[0] = old; + pager.level++; + pager.maxPages *= 32768; + } + } + function truncate(buf, len) { + if (buf.length === len) return buf; + if (buf.length > len) return buf.slice(0, len); + var cpy = alloc2(len); + buf.copy(cpy); + return cpy; + } + function alloc2(size) { + if (Buffer.alloc) return Buffer.alloc(size); + var buf = new Buffer(size); + buf.fill(0); + return buf; + } + function copy(buf) { + var cpy = Buffer.allocUnsafe ? Buffer.allocUnsafe(buf.length) : new Buffer(buf.length); + buf.copy(cpy); + return cpy; + } + function Page(i4, buf) { + this.offset = i4 * buf.length; + this.buffer = buf; + this.updated = false; + this.deduplicate = 0; + } + function factor(n4, out) { + n4 = (n4 - (out[0] = n4 & 32767)) / 32768; + n4 = (n4 - (out[1] = n4 & 32767)) / 32768; + out[3] = (n4 - (out[2] = n4 & 32767)) / 32768 & 32767; + } + } +}); + +// node_modules/sparse-bitfield/index.js +var require_sparse_bitfield = __commonJS({ + "node_modules/sparse-bitfield/index.js"(exports2, module2) { + var pager = require_memory_pager(); + module2.exports = Bitfield; + function Bitfield(opts) { + if (!(this instanceof Bitfield)) return new Bitfield(opts); + if (!opts) opts = {}; + if (Buffer.isBuffer(opts)) opts = { buffer: opts }; + this.pageOffset = opts.pageOffset || 0; + this.pageSize = opts.pageSize || 1024; + this.pages = opts.pages || pager(this.pageSize); + this.byteLength = this.pages.length * this.pageSize; + this.length = 8 * this.byteLength; + if (!powerOfTwo(this.pageSize)) throw new Error("The page size should be a power of two"); + this._trackUpdates = !!opts.trackUpdates; + this._pageMask = this.pageSize - 1; + if (opts.buffer) { + for (var i4 = 0; i4 < opts.buffer.length; i4 += this.pageSize) { + this.pages.set(i4 / this.pageSize, opts.buffer.slice(i4, i4 + this.pageSize)); + } + this.byteLength = opts.buffer.length; + this.length = 8 * this.byteLength; + } + } + Bitfield.prototype.get = function(i4) { + var o4 = i4 & 7; + var j4 = (i4 - o4) / 8; + return !!(this.getByte(j4) & 128 >> o4); + }; + Bitfield.prototype.getByte = function(i4) { + var o4 = i4 & this._pageMask; + var j4 = (i4 - o4) / this.pageSize; + var page = this.pages.get(j4, true); + return page ? page.buffer[o4 + this.pageOffset] : 0; + }; + Bitfield.prototype.set = function(i4, v4) { + var o4 = i4 & 7; + var j4 = (i4 - o4) / 8; + var b4 = this.getByte(j4); + return this.setByte(j4, v4 ? b4 | 128 >> o4 : b4 & (255 ^ 128 >> o4)); + }; + Bitfield.prototype.toBuffer = function() { + var all = alloc2(this.pages.length * this.pageSize); + for (var i4 = 0; i4 < this.pages.length; i4++) { + var next = this.pages.get(i4, true); + var allOffset = i4 * this.pageSize; + if (next) next.buffer.copy(all, allOffset, this.pageOffset, this.pageOffset + this.pageSize); + } + return all; + }; + Bitfield.prototype.setByte = function(i4, b4) { + var o4 = i4 & this._pageMask; + var j4 = (i4 - o4) / this.pageSize; + var page = this.pages.get(j4, false); + o4 += this.pageOffset; + if (page.buffer[o4] === b4) return false; + page.buffer[o4] = b4; + if (i4 >= this.byteLength) { + this.byteLength = i4 + 1; + this.length = this.byteLength * 8; + } + if (this._trackUpdates) this.pages.updated(page); + return true; + }; + function alloc2(n4) { + if (Buffer.alloc) return Buffer.alloc(n4); + var b4 = new Buffer(n4); + b4.fill(0); + return b4; + } + function powerOfTwo(x4) { + return !(x4 & x4 - 1); + } + } +}); + +// node_modules/@mongodb-js/saslprep/dist/memory-code-points.js +var require_memory_code_points = __commonJS({ + "node_modules/@mongodb-js/saslprep/dist/memory-code-points.js"(exports2) { + "use strict"; + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createMemoryCodePoints = createMemoryCodePoints; + var sparse_bitfield_1 = __importDefault2(require_sparse_bitfield()); + function createMemoryCodePoints(data2) { + let offset = 0; + function read() { + const size = data2.readUInt32BE(offset); + offset += 4; + const codepoints = data2.slice(offset, offset + size); + offset += size; + return (0, sparse_bitfield_1.default)({ buffer: codepoints }); + } + const unassigned_code_points = read(); + const commonly_mapped_to_nothing = read(); + const non_ASCII_space_characters = read(); + const prohibited_characters = read(); + const bidirectional_r_al = read(); + const bidirectional_l = read(); + return { + unassigned_code_points, + commonly_mapped_to_nothing, + non_ASCII_space_characters, + prohibited_characters, + bidirectional_r_al, + bidirectional_l + }; + } + } +}); + +// node_modules/@mongodb-js/saslprep/dist/code-points-data.js +var require_code_points_data = __commonJS({ + "node_modules/@mongodb-js/saslprep/dist/code-points-data.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var zlib_1 = require("zlib"); + exports2.default = (0, zlib_1.gunzipSync)(Buffer.from("H4sIAAAAAAACA+3dTYgcaRkA4LemO9Mhxm0FITnE9Cwr4jHgwgZ22B6YywqCJ0HQg5CL4sGTuOjCtGSF4CkHEW856MlTQHD3EJnWkU0Owh5VxE3LHlYQdNxd2U6mU59UV/d09fw4M2EySSXPAzNdP1/9fX/99bzVNZEN4jisRDulVFnQmLxm1aXF9Id/2/xMxNJ4XZlg576yuYlGt9gupV6xoFf8jhu9YvulVrFlp5XSx+lfvYhORGPXvqIRWSxERKtIm8bKFd10WNfKDS5Fo9jJWrq2+M2IlW+8uHgl/+BsROfPF4v5L7148Ur68Sha6dqZpYiVVy8tvLCWXo80Sf/lS89dGX2wHGvpzoXVn75/YWH5wmqe8uika82ViJXTy83Ve2k5Urozm38wm4/ls6t5uT6yfsTSJ7J3T0VKt8c5ExEXI8aFkH729c3eT+7EC6ca8cVULZUiYacX0R5PNWNxlh9L1y90q5kyzrpyy+9WcvOV6URntqw7La9sNVstXyczWVaWYbaaTYqzOHpr7pyiNT3/YzKuT63Z/FqKZlFTiuXtFM2vVOtIq7jiyKJbWZaOWD0euz0yoV2Z7kY0xq2x0YhfzVpmM5px9nTEH7JZ0ot5u39p0ma75Z472/s/H+2yr2inYyuq7fMvJivH2rM72N/Z3lyL31F2b1ya1P0zn816k2KP6JU9UzseucdQH5YqVeH/lFajSN2udg+TLJ9rksNxlvV2lki19rXKI43TPLejFu4ov7k3nMbhyhfY3Xb37f8BAGCf0eMTOH5szf154KmnNgKcnLb+Fzi2AfXktbN7fJelwTAiO/W5uQ2KINXRYu+znqo/WTAdLadURHmy3qciazd3bra4T3w16/f7t7Ms9U5gfJu10955sx1r3vmhBAAAAAAAgId20J1iZbDowNvIjuH427Gr5l/eiC+8OplZON8sVjx/qr9y+Pj+YRItT+NqAM+kkZs3AAAAAID6yfx1FwCAI97/dCh1/ub6SA0AAAAAAAAAgNoT/wcAAAAAAACA+hP/BwAAAAAAAID6E/8HAAAAAAAAgPoT/wcAAAAAAACA+hP/BwAAAAAAAID6E/8HAAAAAAAAgPoT/wcAAAAAAACA+hP/BwAAAAAAAID6E/8HAAAAAAAAgPoT/wcAAAAAAACA+hutp5SiQpYAAAAAAAAAQO2MIpZiT804flnAE2fhwjOeAZXr76kOAAAAAAAA8FjNf4N/l0NE3U/vuVQskLpSd4/Yh2xu9xTu0tFeeNYsLI2f/VMdNxTzj6Je9E/+6pp6Nn3awW3A54goe4Bss6v+PGsjQGMAAAAAAOBp5XEgwH6e7J7rwEQHRb/XvAMAAAAAAAA8yzoDeQDwVGjIAgAAAAAAAACoPfF/AAAAAAAAAKg/8X8AAAAAAAAAqD/xfwAAAAAAAACoP/F/AAAAAAAAAKg/8X8AAAAAAAAAqD/xfwAAAAAAAACoP/F/AAAAAAAAAKg/8X8AAAAAAAAAqD/xfwAAAAAAAACoP/F/AAAAAAAAAKg/8X8AAAAAAAAAqL/GSkSkClkCAAAAAAAAALXTSAAAAAAAAABA3Y1kAQAAAAAAAADUX8RSXZ9dsHC9+M8Fg2Ex/em1lAZpEBGttcrVjZqLEa+k0XpKw9mG4zWx4ukPUMhkAQAAAAAAABzBqbSe3//rXOS9HxGdo4TqR2XkutCdBu+LaPZw/lBbO7cbHnh2C7N7AIo4evEznllqLqWUp/LnYOtpM2bnOH66wI1+9GO4sOuISwv/TOlumu56FDv3NZhc4mR9v7zYIrafr40j/Cccvj9Xns3t3mu99E7qxUv3bqS0/ouNH/08++RGemfQ+nsx/5uNXsQPGulynPvv3ZTW37zd+1ovrqaYpP/122X6Xpx779Z3zr/3YOPKW1lkaRDf31pPaf3j/msRsVGkL+d/f+/m4sJsPm1cfSsr16e8m9Ldj/KsnyIuR3nXw83Is3EhxLd/2V773ks3m/cj/THKUummdP9qKhIOImuOU0Xjwb3y+oqt735rpTetVbF9n8R4x9crRfO77TKqVOZpDclv5bfK18lMnk+q0K18UpxF/RrGXE0Zxtqx3tWSj+vxbL4XaasfKb0dRbtLW73JsfPGg177H+OmGKlfvS1msllt7JEJm9XOJqXR+Fkfo1H66uy5H1v3Xx5+uJmGLw9jro2u7Loj4PnuR6+f+e3d261+eazNhzrL7X83MohoHpS4PddV8ki1it61//pw1g7z6p1U/26Nm2llST57B5rUvuG0XqSU/rPd7jYrqWcbd+beJQ77BgPMDwn37/8BAGCf0eMTOH4cPlufv9VGgJOzqf8Fjm1APXkd7B7f5dF57GPMaWy/MTvjvNvtXj6h8W2+GXvnzXaseeeHEgAAAAAAAB7aQXeKlcGiadBoEOeLb2dtpGOL2MyOtf391a3P/zD96c3JzIP3t4oV797vrh8+vn+YRL5bBuj/AQAAAABqJvfHXQAAHkX82zfXAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACeAgkAAAAAAAAAqLuRLAAAAAAAAACA2hv9D1iu/VAYaAYA", "base64")); + } +}); + +// node_modules/@mongodb-js/saslprep/dist/node.js +var require_node2 = __commonJS({ + "node_modules/@mongodb-js/saslprep/dist/node.js"(exports2, module2) { + "use strict"; + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + var index_1 = __importDefault2(require_dist()); + var memory_code_points_1 = require_memory_code_points(); + var code_points_data_1 = __importDefault2(require_code_points_data()); + var codePoints = (0, memory_code_points_1.createMemoryCodePoints)(code_points_data_1.default); + function saslprep(input, opts) { + return (0, index_1.default)(codePoints, input, opts); + } + saslprep.saslprep = saslprep; + saslprep.default = saslprep; + module2.exports = saslprep; + } +}); + +// node_modules/mongodb/lib/cmap/auth/scram.js +var require_scram = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/scram.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ScramSHA256 = exports2.ScramSHA1 = void 0; + var saslprep_1 = require_node2(); + var crypto2 = require("crypto"); + var bson_1 = require_bson2(); + var error_1 = require_error(); + var utils_1 = require_utils3(); + var auth_provider_1 = require_auth_provider(); + var providers_1 = require_providers(); + var ScramSHA = class extends auth_provider_1.AuthProvider { + constructor(cryptoMethod) { + super(); + this.cryptoMethod = cryptoMethod || "sha1"; + } + async prepare(handshakeDoc, authContext) { + const cryptoMethod = this.cryptoMethod; + const credentials = authContext.credentials; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError("AuthContext must provide credentials."); + } + const nonce = await (0, utils_1.randomBytes)(24); + authContext.nonce = nonce; + const request = { + ...handshakeDoc, + speculativeAuthenticate: { + ...makeFirstMessage(cryptoMethod, credentials, nonce), + db: credentials.source + } + }; + return request; + } + async auth(authContext) { + const { reauthenticating, response } = authContext; + if (response?.speculativeAuthenticate && !reauthenticating) { + return await continueScramConversation(this.cryptoMethod, response.speculativeAuthenticate, authContext); + } + return await executeScram(this.cryptoMethod, authContext); + } + }; + function cleanUsername(username) { + return username.replace("=", "=3D").replace(",", "=2C"); + } + function clientFirstMessageBare(username, nonce) { + return Buffer.concat([ + Buffer.from("n=", "utf8"), + Buffer.from(username, "utf8"), + Buffer.from(",r=", "utf8"), + Buffer.from(nonce.toString("base64"), "utf8") + ]); + } + function makeFirstMessage(cryptoMethod, credentials, nonce) { + const username = cleanUsername(credentials.username); + const mechanism = cryptoMethod === "sha1" ? providers_1.AuthMechanism.MONGODB_SCRAM_SHA1 : providers_1.AuthMechanism.MONGODB_SCRAM_SHA256; + return { + saslStart: 1, + mechanism, + payload: new bson_1.Binary(Buffer.concat([Buffer.from("n,,", "utf8"), clientFirstMessageBare(username, nonce)])), + autoAuthorize: 1, + options: { skipEmptyExchange: true } + }; + } + async function executeScram(cryptoMethod, authContext) { + const { connection, credentials } = authContext; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError("AuthContext must provide credentials."); + } + if (!authContext.nonce) { + throw new error_1.MongoInvalidArgumentError("AuthContext must contain a valid nonce property"); + } + const nonce = authContext.nonce; + const db = credentials.source; + const saslStartCmd = makeFirstMessage(cryptoMethod, credentials, nonce); + const response = await connection.command((0, utils_1.ns)(`${db}.$cmd`), saslStartCmd, void 0); + await continueScramConversation(cryptoMethod, response, authContext); + } + async function continueScramConversation(cryptoMethod, response, authContext) { + const connection = authContext.connection; + const credentials = authContext.credentials; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError("AuthContext must provide credentials."); + } + if (!authContext.nonce) { + throw new error_1.MongoInvalidArgumentError("Unable to continue SCRAM without valid nonce"); + } + const nonce = authContext.nonce; + const db = credentials.source; + const username = cleanUsername(credentials.username); + const password = credentials.password; + const processedPassword = cryptoMethod === "sha256" ? (0, saslprep_1.saslprep)(password) : passwordDigest(username, password); + const payload2 = Buffer.isBuffer(response.payload) ? new bson_1.Binary(response.payload) : response.payload; + const dict = parsePayload(payload2); + const iterations = parseInt(dict.i, 10); + if (iterations && iterations < 4096) { + throw new error_1.MongoRuntimeError(`Server returned an invalid iteration count ${iterations}`); + } + const salt = dict.s; + const rnonce = dict.r; + if (rnonce.startsWith("nonce")) { + throw new error_1.MongoRuntimeError(`Server returned an invalid nonce: ${rnonce}`); + } + const withoutProof = `c=biws,r=${rnonce}`; + const saltedPassword = HI(processedPassword, Buffer.from(salt, "base64"), iterations, cryptoMethod); + const clientKey = HMAC(cryptoMethod, saltedPassword, "Client Key"); + const serverKey = HMAC(cryptoMethod, saltedPassword, "Server Key"); + const storedKey = H2(cryptoMethod, clientKey); + const authMessage = [ + clientFirstMessageBare(username, nonce), + payload2.toString("utf8"), + withoutProof + ].join(","); + const clientSignature = HMAC(cryptoMethod, storedKey, authMessage); + const clientProof = `p=${xor(clientKey, clientSignature)}`; + const clientFinal = [withoutProof, clientProof].join(","); + const serverSignature = HMAC(cryptoMethod, serverKey, authMessage); + const saslContinueCmd = { + saslContinue: 1, + conversationId: response.conversationId, + payload: new bson_1.Binary(Buffer.from(clientFinal)) + }; + const r4 = await connection.command((0, utils_1.ns)(`${db}.$cmd`), saslContinueCmd, void 0); + const parsedResponse = parsePayload(r4.payload); + if (!compareDigest(Buffer.from(parsedResponse.v, "base64"), serverSignature)) { + throw new error_1.MongoRuntimeError("Server returned an invalid signature"); + } + if (r4.done !== false) { + return; + } + const retrySaslContinueCmd = { + saslContinue: 1, + conversationId: r4.conversationId, + payload: Buffer.alloc(0) + }; + await connection.command((0, utils_1.ns)(`${db}.$cmd`), retrySaslContinueCmd, void 0); + } + function parsePayload(payload2) { + const payloadStr = payload2.toString("utf8"); + const dict = {}; + const parts = payloadStr.split(","); + for (let i4 = 0; i4 < parts.length; i4++) { + const valueParts = (parts[i4].match(/^([^=]*)=(.*)$/) ?? []).slice(1); + dict[valueParts[0]] = valueParts[1]; + } + return dict; + } + function passwordDigest(username, password) { + if (typeof username !== "string") { + throw new error_1.MongoInvalidArgumentError("Username must be a string"); + } + if (typeof password !== "string") { + throw new error_1.MongoInvalidArgumentError("Password must be a string"); + } + if (password.length === 0) { + throw new error_1.MongoInvalidArgumentError("Password cannot be empty"); + } + let md5; + try { + md5 = crypto2.createHash("md5"); + } catch (err) { + if (crypto2.getFips()) { + throw new Error("Auth mechanism SCRAM-SHA-1 is not supported in FIPS mode"); + } + throw err; + } + md5.update(`${username}:mongo:${password}`, "utf8"); + return md5.digest("hex"); + } + function xor(a4, b4) { + if (!Buffer.isBuffer(a4)) { + a4 = Buffer.from(a4); + } + if (!Buffer.isBuffer(b4)) { + b4 = Buffer.from(b4); + } + const length = Math.max(a4.length, b4.length); + const res = []; + for (let i4 = 0; i4 < length; i4 += 1) { + res.push(a4[i4] ^ b4[i4]); + } + return Buffer.from(res).toString("base64"); + } + function H2(method, text) { + return crypto2.createHash(method).update(text).digest(); + } + function HMAC(method, key, text) { + return crypto2.createHmac(method, key).update(text).digest(); + } + var _hiCache = {}; + var _hiCacheCount = 0; + function _hiCachePurge() { + _hiCache = {}; + _hiCacheCount = 0; + } + var hiLengthMap = { + sha256: 32, + sha1: 20 + }; + function HI(data2, salt, iterations, cryptoMethod) { + const key = [data2, salt.toString("base64"), iterations].join("_"); + if (_hiCache[key] != null) { + return _hiCache[key]; + } + const saltedData = crypto2.pbkdf2Sync(data2, salt, iterations, hiLengthMap[cryptoMethod], cryptoMethod); + if (_hiCacheCount >= 200) { + _hiCachePurge(); + } + _hiCache[key] = saltedData; + _hiCacheCount += 1; + return saltedData; + } + function compareDigest(lhs, rhs) { + if (lhs.length !== rhs.length) { + return false; + } + if (typeof crypto2.timingSafeEqual === "function") { + return crypto2.timingSafeEqual(lhs, rhs); + } + let result = 0; + for (let i4 = 0; i4 < lhs.length; i4++) { + result |= lhs[i4] ^ rhs[i4]; + } + return result === 0; + } + var ScramSHA1 = class extends ScramSHA { + constructor() { + super("sha1"); + } + }; + exports2.ScramSHA1 = ScramSHA1; + var ScramSHA256 = class extends ScramSHA { + constructor() { + super("sha256"); + } + }; + exports2.ScramSHA256 = ScramSHA256; + } +}); + +// node_modules/mongodb/lib/cmap/auth/x509.js +var require_x509 = __commonJS({ + "node_modules/mongodb/lib/cmap/auth/x509.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.X509 = void 0; + var error_1 = require_error(); + var utils_1 = require_utils3(); + var auth_provider_1 = require_auth_provider(); + var X509 = class extends auth_provider_1.AuthProvider { + async prepare(handshakeDoc, authContext) { + const { credentials } = authContext; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError("AuthContext must provide credentials."); + } + return { ...handshakeDoc, speculativeAuthenticate: x509AuthenticateCommand(credentials) }; + } + async auth(authContext) { + const connection = authContext.connection; + const credentials = authContext.credentials; + if (!credentials) { + throw new error_1.MongoMissingCredentialsError("AuthContext must provide credentials."); + } + const response = authContext.response; + if (response?.speculativeAuthenticate) { + return; + } + await connection.command((0, utils_1.ns)("$external.$cmd"), x509AuthenticateCommand(credentials), void 0); + } + }; + exports2.X509 = X509; + function x509AuthenticateCommand(credentials) { + const command = { authenticate: 1, mechanism: "MONGODB-X509" }; + if (credentials.username) { + command.user = credentials.username; + } + return command; + } + } +}); + +// node_modules/mongodb/lib/mongo_client_auth_providers.js +var require_mongo_client_auth_providers = __commonJS({ + "node_modules/mongodb/lib/mongo_client_auth_providers.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MongoClientAuthProviders = void 0; + var gssapi_1 = require_gssapi(); + var mongodb_aws_1 = require_mongodb_aws(); + var mongodb_oidc_1 = require_mongodb_oidc(); + var automated_callback_workflow_1 = require_automated_callback_workflow(); + var human_callback_workflow_1 = require_human_callback_workflow(); + var token_cache_1 = require_token_cache(); + var plain_1 = require_plain(); + var providers_1 = require_providers(); + var scram_1 = require_scram(); + var x509_1 = require_x509(); + var error_1 = require_error(); + var AUTH_PROVIDERS = /* @__PURE__ */ new Map([ + [ + providers_1.AuthMechanism.MONGODB_AWS, + ({ AWS_CREDENTIAL_PROVIDER }) => new mongodb_aws_1.MongoDBAWS(AWS_CREDENTIAL_PROVIDER) + ], + [ + providers_1.AuthMechanism.MONGODB_CR, + () => { + throw new error_1.MongoInvalidArgumentError("MONGODB-CR is no longer a supported auth mechanism in MongoDB 4.0+"); + } + ], + [providers_1.AuthMechanism.MONGODB_GSSAPI, () => new gssapi_1.GSSAPI()], + [providers_1.AuthMechanism.MONGODB_OIDC, (properties) => new mongodb_oidc_1.MongoDBOIDC(getWorkflow(properties))], + [providers_1.AuthMechanism.MONGODB_PLAIN, () => new plain_1.Plain()], + [providers_1.AuthMechanism.MONGODB_SCRAM_SHA1, () => new scram_1.ScramSHA1()], + [providers_1.AuthMechanism.MONGODB_SCRAM_SHA256, () => new scram_1.ScramSHA256()], + [providers_1.AuthMechanism.MONGODB_X509, () => new x509_1.X509()] + ]); + var MongoClientAuthProviders = class { + constructor() { + this.existingProviders = /* @__PURE__ */ new Map(); + } + /** + * Get or create an authentication provider based on the provided mechanism. + * We don't want to create all providers at once, as some providers may not be used. + * @param name - The name of the provider to get or create. + * @param credentials - The credentials. + * @returns The provider. + * @throws MongoInvalidArgumentError if the mechanism is not supported. + * @internal + */ + getOrCreateProvider(name, authMechanismProperties) { + const authProvider = this.existingProviders.get(name); + if (authProvider) { + return authProvider; + } + const providerFunction = AUTH_PROVIDERS.get(name); + if (!providerFunction) { + throw new error_1.MongoInvalidArgumentError(`authMechanism ${name} not supported`); + } + const provider = providerFunction(authMechanismProperties); + this.existingProviders.set(name, provider); + return provider; + } + }; + exports2.MongoClientAuthProviders = MongoClientAuthProviders; + function getWorkflow(authMechanismProperties) { + if (authMechanismProperties.OIDC_HUMAN_CALLBACK) { + return new human_callback_workflow_1.HumanCallbackWorkflow(new token_cache_1.TokenCache(), authMechanismProperties.OIDC_HUMAN_CALLBACK); + } else if (authMechanismProperties.OIDC_CALLBACK) { + return new automated_callback_workflow_1.AutomatedCallbackWorkflow(new token_cache_1.TokenCache(), authMechanismProperties.OIDC_CALLBACK); + } else { + const environment = authMechanismProperties.ENVIRONMENT; + const workflow = mongodb_oidc_1.OIDC_WORKFLOWS.get(environment)?.(); + if (!workflow) { + throw new error_1.MongoInvalidArgumentError(`Could not load workflow for environment ${authMechanismProperties.ENVIRONMENT}`); + } + return workflow; + } + } + } +}); + +// node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.js +var require_client_bulk_write = __commonJS({ + "node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ClientBulkWriteOperation = void 0; + var responses_1 = require_responses(); + var utils_1 = require_utils3(); + var command_1 = require_command(); + var operation_1 = require_operation(); + var ClientBulkWriteOperation = class extends command_1.CommandOperation { + get commandName() { + return "bulkWrite"; + } + constructor(commandBuilder, options) { + super(void 0, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.ClientBulkWriteCursorResponse; + this.commandBuilder = commandBuilder; + this.options = options; + this.ns = new utils_1.MongoDBNamespace("admin", "$cmd"); + } + resetBatch() { + return this.commandBuilder.resetBatch(); + } + get canRetryWrite() { + return this.commandBuilder.isBatchRetryable; + } + handleOk(response) { + return response; + } + buildCommandDocument(connection, _session) { + const command = this.commandBuilder.buildBatch(connection.description.maxMessageSizeBytes, connection.description.maxWriteBatchSize, connection.description.maxBsonObjectSize); + if (!this.canRetryWrite) { + this.options.willRetryWrite = false; + } + return command; + } + }; + exports2.ClientBulkWriteOperation = ClientBulkWriteOperation; + (0, operation_1.defineAspects)(ClientBulkWriteOperation, [ + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.SKIP_COLLATION, + operation_1.Aspect.CURSOR_CREATING, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.COMMAND_BATCHING, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + } +}); + +// node_modules/mongodb/lib/cursor/client_bulk_write_cursor.js +var require_client_bulk_write_cursor = __commonJS({ + "node_modules/mongodb/lib/cursor/client_bulk_write_cursor.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ClientBulkWriteCursor = void 0; + var client_bulk_write_1 = require_client_bulk_write(); + var execute_operation_1 = require_execute_operation(); + var utils_1 = require_utils3(); + var abstract_cursor_1 = require_abstract_cursor(); + var ClientBulkWriteCursor = class _ClientBulkWriteCursor extends abstract_cursor_1.AbstractCursor { + /** @internal */ + constructor(client, commandBuilder, options = {}) { + super(client, new utils_1.MongoDBNamespace("admin", "$cmd"), options); + this.commandBuilder = commandBuilder; + this.clientBulkWriteOptions = options; + } + /** + * We need a way to get the top level cursor response fields for + * generating the bulk write result, so we expose this here. + */ + get response() { + if (this.cursorResponse) + return this.cursorResponse; + return null; + } + get operations() { + return this.commandBuilder.lastOperations; + } + clone() { + const clonedOptions = (0, utils_1.mergeOptions)({}, this.clientBulkWriteOptions); + delete clonedOptions.session; + return new _ClientBulkWriteCursor(this.client, this.commandBuilder, { + ...clonedOptions + }); + } + /** @internal */ + async _initialize(session) { + const clientBulkWriteOperation = new client_bulk_write_1.ClientBulkWriteOperation(this.commandBuilder, { + ...this.clientBulkWriteOptions, + ...this.cursorOptions, + session + }); + const response = await (0, execute_operation_1.executeOperation)(this.client, clientBulkWriteOperation, this.timeoutContext); + this.cursorResponse = response; + return { server: clientBulkWriteOperation.server, session, response }; + } + }; + exports2.ClientBulkWriteCursor = ClientBulkWriteCursor; + } +}); + +// node_modules/mongodb/lib/operations/client_bulk_write/command_builder.js +var require_command_builder = __commonJS({ + "node_modules/mongodb/lib/operations/client_bulk_write/command_builder.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.buildReplaceOneOperation = exports2.buildUpdateManyOperation = exports2.buildUpdateOneOperation = exports2.buildDeleteManyOperation = exports2.buildDeleteOneOperation = exports2.buildInsertOneOperation = exports2.ClientBulkWriteCommandBuilder = void 0; + exports2.buildOperation = buildOperation; + var bson_1 = require_bson2(); + var commands_1 = require_commands(); + var error_1 = require_error(); + var sort_1 = require_sort(); + var utils_1 = require_utils3(); + var MESSAGE_OVERHEAD_BYTES = 1e3; + var ClientBulkWriteCommandBuilder = class { + /** + * Create the command builder. + * @param models - The client write models. + */ + constructor(models, options, pkFactory) { + this.models = models; + this.options = options; + this.pkFactory = pkFactory ?? utils_1.DEFAULT_PK_FACTORY; + this.currentModelIndex = 0; + this.previousModelIndex = 0; + this.lastOperations = []; + this.isBatchRetryable = true; + } + /** + * Gets the errorsOnly value for the command, which is the inverse of the + * user provided verboseResults option. Defaults to true. + */ + get errorsOnly() { + if ("verboseResults" in this.options) { + return !this.options.verboseResults; + } + return true; + } + /** + * Determines if there is another batch to process. + * @returns True if not all batches have been built. + */ + hasNextBatch() { + return this.currentModelIndex < this.models.length; + } + /** + * When we need to retry a command we need to set the current + * model index back to its previous value. + */ + resetBatch() { + this.currentModelIndex = this.previousModelIndex; + return true; + } + /** + * Build a single batch of a client bulk write command. + * @param maxMessageSizeBytes - The max message size in bytes. + * @param maxWriteBatchSize - The max write batch size. + * @returns The client bulk write command. + */ + buildBatch(maxMessageSizeBytes, maxWriteBatchSize, maxBsonObjectSize) { + this.isBatchRetryable = true; + let commandLength = 0; + let currentNamespaceIndex = 0; + const command = this.baseCommand(); + const namespaces = /* @__PURE__ */ new Map(); + this.previousModelIndex = this.currentModelIndex; + while (this.currentModelIndex < this.models.length) { + const model = this.models[this.currentModelIndex]; + const ns = model.namespace; + const nsIndex = namespaces.get(ns); + if (model.name === "deleteMany" || model.name === "updateMany") { + this.isBatchRetryable = false; + } + if (nsIndex != null) { + const operation2 = buildOperation(model, nsIndex, this.pkFactory, this.options); + let operationBuffer; + try { + operationBuffer = bson_1.BSON.serialize(operation2); + } catch (cause) { + throw new error_1.MongoInvalidArgumentError(`Could not serialize operation to BSON`, { cause }); + } + validateBufferSize("ops", operationBuffer, maxBsonObjectSize); + if (commandLength + operationBuffer.length < maxMessageSizeBytes && command.ops.documents.length < maxWriteBatchSize) { + commandLength = MESSAGE_OVERHEAD_BYTES + command.ops.push(operation2, operationBuffer); + this.currentModelIndex++; + } else { + break; + } + } else { + namespaces.set(ns, currentNamespaceIndex); + const nsInfo = { ns }; + const operation2 = buildOperation(model, currentNamespaceIndex, this.pkFactory, this.options); + let nsInfoBuffer; + let operationBuffer; + try { + nsInfoBuffer = bson_1.BSON.serialize(nsInfo); + operationBuffer = bson_1.BSON.serialize(operation2); + } catch (cause) { + throw new error_1.MongoInvalidArgumentError(`Could not serialize ns info to BSON`, { cause }); + } + validateBufferSize("nsInfo", nsInfoBuffer, maxBsonObjectSize); + validateBufferSize("ops", operationBuffer, maxBsonObjectSize); + if (commandLength + nsInfoBuffer.length + operationBuffer.length < maxMessageSizeBytes && command.ops.documents.length < maxWriteBatchSize) { + commandLength = MESSAGE_OVERHEAD_BYTES + command.nsInfo.push(nsInfo, nsInfoBuffer) + command.ops.push(operation2, operationBuffer); + currentNamespaceIndex++; + this.currentModelIndex++; + } else { + break; + } + } + } + this.lastOperations = command.ops.documents; + return command; + } + baseCommand() { + const command = { + bulkWrite: 1, + errorsOnly: this.errorsOnly, + ordered: this.options.ordered ?? true, + ops: new commands_1.DocumentSequence("ops"), + nsInfo: new commands_1.DocumentSequence("nsInfo") + }; + if (this.options.bypassDocumentValidation != null) { + command.bypassDocumentValidation = this.options.bypassDocumentValidation; + } + if (this.options.let) { + command.let = this.options.let; + } + if (this.options.comment !== void 0) { + command.comment = this.options.comment; + } + return command; + } + }; + exports2.ClientBulkWriteCommandBuilder = ClientBulkWriteCommandBuilder; + function validateBufferSize(name, buffer, maxBsonObjectSize) { + if (buffer.length > maxBsonObjectSize) { + throw new error_1.MongoInvalidArgumentError(`Client bulk write operation ${name} of length ${buffer.length} exceeds the max bson object size of ${maxBsonObjectSize}`); + } + } + var buildInsertOneOperation = (model, index, pkFactory) => { + const document2 = { + insert: index, + document: model.document + }; + document2.document._id = model.document._id ?? pkFactory.createPk(); + return document2; + }; + exports2.buildInsertOneOperation = buildInsertOneOperation; + var buildDeleteOneOperation = (model, index) => { + return createDeleteOperation(model, index, false); + }; + exports2.buildDeleteOneOperation = buildDeleteOneOperation; + var buildDeleteManyOperation = (model, index) => { + return createDeleteOperation(model, index, true); + }; + exports2.buildDeleteManyOperation = buildDeleteManyOperation; + function createDeleteOperation(model, index, multi) { + const document2 = { + delete: index, + multi, + filter: model.filter + }; + if (model.hint) { + document2.hint = model.hint; + } + if (model.collation) { + document2.collation = model.collation; + } + return document2; + } + var buildUpdateOneOperation = (model, index, options) => { + return createUpdateOperation(model, index, false, options); + }; + exports2.buildUpdateOneOperation = buildUpdateOneOperation; + var buildUpdateManyOperation = (model, index, options) => { + return createUpdateOperation(model, index, true, options); + }; + exports2.buildUpdateManyOperation = buildUpdateManyOperation; + function validateUpdate(update, options) { + if (!(0, utils_1.hasAtomicOperators)(update, options)) { + throw new error_1.MongoAPIError("Client bulk write update models must only contain atomic modifiers (start with $) and must not be empty."); + } + } + function createUpdateOperation(model, index, multi, options) { + validateUpdate(model.update, options); + const document2 = { + update: index, + multi, + filter: model.filter, + updateMods: model.update + }; + if (model.hint) { + document2.hint = model.hint; + } + if (model.upsert) { + document2.upsert = model.upsert; + } + if (model.arrayFilters) { + document2.arrayFilters = model.arrayFilters; + } + if (model.collation) { + document2.collation = model.collation; + } + if (!multi && "sort" in model && model.sort != null) { + document2.sort = (0, sort_1.formatSort)(model.sort); + } + return document2; + } + var buildReplaceOneOperation = (model, index) => { + if ((0, utils_1.hasAtomicOperators)(model.replacement)) { + throw new error_1.MongoAPIError("Client bulk write replace models must not contain atomic modifiers (start with $) and must not be empty."); + } + const document2 = { + update: index, + multi: false, + filter: model.filter, + updateMods: model.replacement + }; + if (model.hint) { + document2.hint = model.hint; + } + if (model.upsert) { + document2.upsert = model.upsert; + } + if (model.collation) { + document2.collation = model.collation; + } + if (model.sort != null) { + document2.sort = (0, sort_1.formatSort)(model.sort); + } + return document2; + }; + exports2.buildReplaceOneOperation = buildReplaceOneOperation; + function buildOperation(model, index, pkFactory, options) { + switch (model.name) { + case "insertOne": + return (0, exports2.buildInsertOneOperation)(model, index, pkFactory); + case "deleteOne": + return (0, exports2.buildDeleteOneOperation)(model, index); + case "deleteMany": + return (0, exports2.buildDeleteManyOperation)(model, index); + case "updateOne": + return (0, exports2.buildUpdateOneOperation)(model, index, options); + case "updateMany": + return (0, exports2.buildUpdateManyOperation)(model, index, options); + case "replaceOne": + return (0, exports2.buildReplaceOneOperation)(model, index); + } + } + } +}); + +// node_modules/mongodb/lib/operations/client_bulk_write/results_merger.js +var require_results_merger = __commonJS({ + "node_modules/mongodb/lib/operations/client_bulk_write/results_merger.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ClientBulkWriteResultsMerger = void 0; + var __1 = require_lib6(); + var error_1 = require_error(); + var UNACKNOWLEDGED = { + acknowledged: false, + insertedCount: 0, + upsertedCount: 0, + matchedCount: 0, + modifiedCount: 0, + deletedCount: 0, + insertResults: void 0, + updateResults: void 0, + deleteResults: void 0 + }; + var ClientBulkWriteResultsMerger = class { + /** + * @returns The standard unacknowledged bulk write result. + */ + static unacknowledged() { + return UNACKNOWLEDGED; + } + /** + * Instantiate the merger. + * @param options - The options. + */ + constructor(options) { + this.options = options; + this.currentBatchOffset = 0; + this.writeConcernErrors = []; + this.writeErrors = /* @__PURE__ */ new Map(); + this.result = { + acknowledged: true, + insertedCount: 0, + upsertedCount: 0, + matchedCount: 0, + modifiedCount: 0, + deletedCount: 0, + insertResults: void 0, + updateResults: void 0, + deleteResults: void 0 + }; + if (options.verboseResults) { + this.result.insertResults = /* @__PURE__ */ new Map(); + this.result.updateResults = /* @__PURE__ */ new Map(); + this.result.deleteResults = /* @__PURE__ */ new Map(); + } + } + /** + * Get the bulk write result object. + */ + get bulkWriteResult() { + return { + acknowledged: this.result.acknowledged, + insertedCount: this.result.insertedCount, + upsertedCount: this.result.upsertedCount, + matchedCount: this.result.matchedCount, + modifiedCount: this.result.modifiedCount, + deletedCount: this.result.deletedCount, + insertResults: this.result.insertResults, + updateResults: this.result.updateResults, + deleteResults: this.result.deleteResults + }; + } + /** + * Merge the results in the cursor to the existing result. + * @param currentBatchOffset - The offset index to the original models. + * @param response - The cursor response. + * @param documents - The documents in the cursor. + * @returns The current result. + */ + async merge(cursor2) { + let writeConcernErrorResult; + try { + for await (const document2 of cursor2) { + if (document2.ok === 1) { + if (this.options.verboseResults) { + this.processDocument(cursor2, document2); + } + } else { + if (this.options.ordered) { + const error2 = new error_1.MongoClientBulkWriteError({ + message: "Mongo client ordered bulk write encountered a write error." + }); + error2.writeErrors.set(document2.idx + this.currentBatchOffset, { + code: document2.code, + message: document2.errmsg + }); + error2.partialResult = this.result; + throw error2; + } else { + this.writeErrors.set(document2.idx + this.currentBatchOffset, { + code: document2.code, + message: document2.errmsg + }); + } + } + } + } catch (error2) { + if (error2 instanceof __1.MongoWriteConcernError) { + const result = error2.result; + writeConcernErrorResult = { + insertedCount: result.nInserted, + upsertedCount: result.nUpserted, + matchedCount: result.nMatched, + modifiedCount: result.nModified, + deletedCount: result.nDeleted, + writeConcernError: result.writeConcernError + }; + if (this.options.verboseResults && result.cursor.firstBatch) { + for (const document2 of result.cursor.firstBatch) { + if (document2.ok === 1) { + this.processDocument(cursor2, document2); + } + } + } + } else { + throw error2; + } + } finally { + if (cursor2.response) { + const response = cursor2.response; + this.incrementCounts(response); + } + this.currentBatchOffset += cursor2.operations.length; + } + if (writeConcernErrorResult) { + const writeConcernError = writeConcernErrorResult.writeConcernError; + this.incrementCounts(writeConcernErrorResult); + this.writeConcernErrors.push({ + code: writeConcernError.code, + message: writeConcernError.errmsg + }); + } + return this.result; + } + /** + * Process an individual document in the results. + * @param cursor - The cursor. + * @param document - The document to process. + */ + processDocument(cursor2, document2) { + const operation2 = cursor2.operations[document2.idx]; + if ("insert" in operation2) { + this.result.insertResults?.set(document2.idx + this.currentBatchOffset, { + insertedId: operation2.document._id + }); + } + if ("update" in operation2) { + const result = { + matchedCount: document2.n, + modifiedCount: document2.nModified ?? 0, + // Check if the bulk did actually upsert. + didUpsert: document2.upserted != null + }; + if (document2.upserted) { + result.upsertedId = document2.upserted._id; + } + this.result.updateResults?.set(document2.idx + this.currentBatchOffset, result); + } + if ("delete" in operation2) { + this.result.deleteResults?.set(document2.idx + this.currentBatchOffset, { + deletedCount: document2.n + }); + } + } + /** + * Increment the result counts. + * @param document - The document with the results. + */ + incrementCounts(document2) { + this.result.insertedCount += document2.insertedCount; + this.result.upsertedCount += document2.upsertedCount; + this.result.matchedCount += document2.matchedCount; + this.result.modifiedCount += document2.modifiedCount; + this.result.deletedCount += document2.deletedCount; + } + }; + exports2.ClientBulkWriteResultsMerger = ClientBulkWriteResultsMerger; + } +}); + +// node_modules/mongodb/lib/operations/client_bulk_write/executor.js +var require_executor = __commonJS({ + "node_modules/mongodb/lib/operations/client_bulk_write/executor.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ClientBulkWriteExecutor = void 0; + var abstract_cursor_1 = require_abstract_cursor(); + var client_bulk_write_cursor_1 = require_client_bulk_write_cursor(); + var error_1 = require_error(); + var timeout_1 = require_timeout(); + var utils_1 = require_utils3(); + var write_concern_1 = require_write_concern(); + var execute_operation_1 = require_execute_operation(); + var client_bulk_write_1 = require_client_bulk_write(); + var command_builder_1 = require_command_builder(); + var results_merger_1 = require_results_merger(); + var ClientBulkWriteExecutor = class { + /** + * Instantiate the executor. + * @param client - The mongo client. + * @param operations - The user supplied bulk write models. + * @param options - The bulk write options. + */ + constructor(client, operations, options) { + if (operations.length === 0) { + throw new error_1.MongoClientBulkWriteExecutionError("No client bulk write models were provided."); + } + this.client = client; + this.operations = operations; + this.options = { + ordered: true, + bypassDocumentValidation: false, + verboseResults: false, + ...options + }; + if (!this.options.writeConcern) { + this.options.writeConcern = write_concern_1.WriteConcern.fromOptions(this.client.s.options); + } + if (this.options.writeConcern?.w === 0) { + if (this.options.verboseResults) { + throw new error_1.MongoInvalidArgumentError("Cannot request unacknowledged write concern and verbose results"); + } + if (this.options.ordered) { + throw new error_1.MongoInvalidArgumentError("Cannot request unacknowledged write concern and ordered writes"); + } + } + } + /** + * Execute the client bulk write. Will split commands into batches and exhaust the cursors + * for each, then merge the results into one. + * @returns The result. + */ + async execute() { + const pkFactory = this.client.s.options.pkFactory; + const commandBuilder = new command_builder_1.ClientBulkWriteCommandBuilder(this.operations, this.options, pkFactory); + const resolvedOptions = (0, utils_1.resolveTimeoutOptions)(this.client, this.options); + const context = timeout_1.TimeoutContext.create(resolvedOptions); + if (this.options.writeConcern?.w === 0) { + while (commandBuilder.hasNextBatch()) { + const operation2 = new client_bulk_write_1.ClientBulkWriteOperation(commandBuilder, this.options); + await (0, execute_operation_1.executeOperation)(this.client, operation2, context); + } + return results_merger_1.ClientBulkWriteResultsMerger.unacknowledged(); + } else { + const resultsMerger = new results_merger_1.ClientBulkWriteResultsMerger(this.options); + while (commandBuilder.hasNextBatch()) { + const cursorContext = new abstract_cursor_1.CursorTimeoutContext(context, /* @__PURE__ */ Symbol()); + const options = { + ...this.options, + timeoutContext: cursorContext, + ...resolvedOptions.timeoutMS != null && { timeoutMode: abstract_cursor_1.CursorTimeoutMode.LIFETIME } + }; + const cursor2 = new client_bulk_write_cursor_1.ClientBulkWriteCursor(this.client, commandBuilder, options); + try { + await resultsMerger.merge(cursor2); + } catch (error2) { + if (error2 instanceof error_1.MongoServerError && !(error2 instanceof error_1.MongoClientBulkWriteError)) { + const bulkWriteError = new error_1.MongoClientBulkWriteError({ + message: "Mongo client bulk write encountered an error during execution" + }); + bulkWriteError.cause = error2; + bulkWriteError.partialResult = resultsMerger.bulkWriteResult; + throw bulkWriteError; + } else { + throw error2; + } + } + } + if (resultsMerger.writeConcernErrors.length > 0 || resultsMerger.writeErrors.size > 0) { + const error2 = new error_1.MongoClientBulkWriteError({ + message: "Mongo client bulk write encountered errors during execution." + }); + error2.writeConcernErrors = resultsMerger.writeConcernErrors; + error2.writeErrors = resultsMerger.writeErrors; + error2.partialResult = resultsMerger.bulkWriteResult; + throw error2; + } + return resultsMerger.bulkWriteResult; + } + } + }; + exports2.ClientBulkWriteExecutor = ClientBulkWriteExecutor; + } +}); + +// node_modules/mongodb/lib/sdam/server_selection_events.js +var require_server_selection_events = __commonJS({ + "node_modules/mongodb/lib/sdam/server_selection_events.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.WaitingForSuitableServerEvent = exports2.ServerSelectionSucceededEvent = exports2.ServerSelectionFailedEvent = exports2.ServerSelectionStartedEvent = exports2.ServerSelectionEvent = void 0; + var utils_1 = require_utils3(); + var constants_1 = require_constants2(); + var ServerSelectionEvent = class { + /** @internal */ + constructor(selector, topologyDescription, operation2) { + this.selector = selector; + this.operation = operation2; + this.topologyDescription = topologyDescription; + } + }; + exports2.ServerSelectionEvent = ServerSelectionEvent; + var ServerSelectionStartedEvent = class extends ServerSelectionEvent { + /** @internal */ + constructor(selector, topologyDescription, operation2) { + super(selector, topologyDescription, operation2); + this.name = constants_1.SERVER_SELECTION_STARTED; + this.message = "Server selection started"; + } + }; + exports2.ServerSelectionStartedEvent = ServerSelectionStartedEvent; + var ServerSelectionFailedEvent = class extends ServerSelectionEvent { + /** @internal */ + constructor(selector, topologyDescription, error2, operation2) { + super(selector, topologyDescription, operation2); + this.name = constants_1.SERVER_SELECTION_FAILED; + this.message = "Server selection failed"; + this.failure = error2; + } + }; + exports2.ServerSelectionFailedEvent = ServerSelectionFailedEvent; + var ServerSelectionSucceededEvent = class extends ServerSelectionEvent { + /** @internal */ + constructor(selector, topologyDescription, address, operation2) { + super(selector, topologyDescription, operation2); + this.name = constants_1.SERVER_SELECTION_SUCCEEDED; + this.message = "Server selection succeeded"; + const { host, port } = utils_1.HostAddress.fromString(address).toHostPort(); + this.serverHost = host; + this.serverPort = port; + } + }; + exports2.ServerSelectionSucceededEvent = ServerSelectionSucceededEvent; + var WaitingForSuitableServerEvent = class extends ServerSelectionEvent { + /** @internal */ + constructor(selector, topologyDescription, remainingTimeMS, operation2) { + super(selector, topologyDescription, operation2); + this.name = constants_1.WAITING_FOR_SUITABLE_SERVER; + this.message = "Waiting for suitable server to become available"; + this.remainingTimeMS = remainingTimeMS; + } + }; + exports2.WaitingForSuitableServerEvent = WaitingForSuitableServerEvent; + } +}); + +// node_modules/mongodb/lib/sdam/srv_polling.js +var require_srv_polling = __commonJS({ + "node_modules/mongodb/lib/sdam/srv_polling.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SrvPoller = exports2.SrvPollingEvent = void 0; + var dns = require("dns"); + var timers_1 = require("timers"); + var error_1 = require_error(); + var mongo_types_1 = require_mongo_types(); + var utils_1 = require_utils3(); + var SrvPollingEvent = class { + constructor(srvRecords) { + this.srvRecords = srvRecords; + } + hostnames() { + return new Set(this.srvRecords.map((r4) => utils_1.HostAddress.fromSrvRecord(r4).toString())); + } + }; + exports2.SrvPollingEvent = SrvPollingEvent; + var SrvPoller = class _SrvPoller extends mongo_types_1.TypedEventEmitter { + constructor(options) { + super(); + this.on("error", utils_1.noop); + if (!options || !options.srvHost) { + throw new error_1.MongoRuntimeError("Options for SrvPoller must exist and include srvHost"); + } + this.srvHost = options.srvHost; + this.srvMaxHosts = options.srvMaxHosts ?? 0; + this.srvServiceName = options.srvServiceName ?? "mongodb"; + this.rescanSrvIntervalMS = 6e4; + this.heartbeatFrequencyMS = options.heartbeatFrequencyMS ?? 1e4; + this.haMode = false; + this.generation = 0; + this._timeout = void 0; + } + get srvAddress() { + return `_${this.srvServiceName}._tcp.${this.srvHost}`; + } + get intervalMS() { + return this.haMode ? this.heartbeatFrequencyMS : this.rescanSrvIntervalMS; + } + start() { + if (!this._timeout) { + this.schedule(); + } + } + stop() { + if (this._timeout) { + (0, timers_1.clearTimeout)(this._timeout); + this.generation += 1; + this._timeout = void 0; + } + } + // TODO(NODE-4994): implement new logging logic for SrvPoller failures + schedule() { + if (this._timeout) { + (0, timers_1.clearTimeout)(this._timeout); + } + this._timeout = (0, timers_1.setTimeout)(() => { + this._poll().then(void 0, utils_1.squashError); + }, this.intervalMS); + } + success(srvRecords) { + this.haMode = false; + this.schedule(); + this.emit(_SrvPoller.SRV_RECORD_DISCOVERY, new SrvPollingEvent(srvRecords)); + } + failure() { + this.haMode = true; + this.schedule(); + } + async _poll() { + const generation = this.generation; + let srvRecords; + try { + srvRecords = await dns.promises.resolveSrv(this.srvAddress); + } catch { + this.failure(); + return; + } + if (generation !== this.generation) { + return; + } + const finalAddresses = []; + for (const record of srvRecords) { + try { + (0, utils_1.checkParentDomainMatch)(record.name, this.srvHost); + finalAddresses.push(record); + } catch (error2) { + (0, utils_1.squashError)(error2); + } + } + if (!finalAddresses.length) { + this.failure(); + return; + } + this.success(finalAddresses); + } + }; + exports2.SrvPoller = SrvPoller; + SrvPoller.SRV_RECORD_DISCOVERY = "srvRecordDiscovery"; + } +}); + +// node_modules/mongodb/lib/sdam/topology.js +var require_topology = __commonJS({ + "node_modules/mongodb/lib/sdam/topology.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ServerCapabilities = exports2.Topology = void 0; + var connection_string_1 = require_connection_string(); + var constants_1 = require_constants2(); + var error_1 = require_error(); + var mongo_logger_1 = require_mongo_logger(); + var mongo_types_1 = require_mongo_types(); + var read_preference_1 = require_read_preference(); + var timeout_1 = require_timeout(); + var utils_1 = require_utils3(); + var common_1 = require_common(); + var events_1 = require_events(); + var server_1 = require_server(); + var server_description_1 = require_server_description(); + var server_selection_1 = require_server_selection(); + var server_selection_events_1 = require_server_selection_events(); + var srv_polling_1 = require_srv_polling(); + var topology_description_1 = require_topology_description(); + var globalTopologyCounter = 0; + var stateTransition = (0, utils_1.makeStateMachine)({ + [common_1.STATE_CLOSED]: [common_1.STATE_CLOSED, common_1.STATE_CONNECTING], + [common_1.STATE_CONNECTING]: [common_1.STATE_CONNECTING, common_1.STATE_CLOSING, common_1.STATE_CONNECTED, common_1.STATE_CLOSED], + [common_1.STATE_CONNECTED]: [common_1.STATE_CONNECTED, common_1.STATE_CLOSING, common_1.STATE_CLOSED], + [common_1.STATE_CLOSING]: [common_1.STATE_CLOSING, common_1.STATE_CLOSED] + }); + var Topology = class _Topology extends mongo_types_1.TypedEventEmitter { + /** + * @param seedlist - a list of HostAddress instances to connect to + */ + constructor(client, seeds, options) { + super(); + this.on("error", utils_1.noop); + this.client = client; + options = options ?? { + hosts: [utils_1.HostAddress.fromString("localhost:27017")], + ...Object.fromEntries(connection_string_1.DEFAULT_OPTIONS.entries()) + }; + if (typeof seeds === "string") { + seeds = [utils_1.HostAddress.fromString(seeds)]; + } else if (!Array.isArray(seeds)) { + seeds = [seeds]; + } + const seedlist = []; + for (const seed of seeds) { + if (typeof seed === "string") { + seedlist.push(utils_1.HostAddress.fromString(seed)); + } else if (seed instanceof utils_1.HostAddress) { + seedlist.push(seed); + } else { + throw new error_1.MongoRuntimeError(`Topology cannot be constructed from ${JSON.stringify(seed)}`); + } + } + const topologyType = topologyTypeFromOptions(options); + const topologyId = globalTopologyCounter++; + const selectedHosts = options.srvMaxHosts == null || options.srvMaxHosts === 0 || options.srvMaxHosts >= seedlist.length ? seedlist : (0, utils_1.shuffle)(seedlist, options.srvMaxHosts); + const serverDescriptions = /* @__PURE__ */ new Map(); + for (const hostAddress of selectedHosts) { + serverDescriptions.set(hostAddress.toString(), new server_description_1.ServerDescription(hostAddress)); + } + this.waitQueue = new utils_1.List(); + this.s = { + // the id of this topology + id: topologyId, + // passed in options + options, + // initial seedlist of servers to connect to + seedlist, + // initial state + state: common_1.STATE_CLOSED, + // the topology description + description: new topology_description_1.TopologyDescription(topologyType, serverDescriptions, options.replicaSet, void 0, void 0, void 0, options), + serverSelectionTimeoutMS: options.serverSelectionTimeoutMS, + heartbeatFrequencyMS: options.heartbeatFrequencyMS, + minHeartbeatFrequencyMS: options.minHeartbeatFrequencyMS, + // a map of server instances to normalized addresses + servers: /* @__PURE__ */ new Map(), + credentials: options?.credentials, + clusterTime: void 0, + detectShardedTopology: (ev) => this.detectShardedTopology(ev), + detectSrvRecords: (ev) => this.detectSrvRecords(ev) + }; + this.mongoLogger = client.mongoLogger; + this.component = "topology"; + if (options.srvHost && !options.loadBalanced) { + this.s.srvPoller = options.srvPoller ?? new srv_polling_1.SrvPoller({ + heartbeatFrequencyMS: this.s.heartbeatFrequencyMS, + srvHost: options.srvHost, + srvMaxHosts: options.srvMaxHosts, + srvServiceName: options.srvServiceName + }); + this.on(_Topology.TOPOLOGY_DESCRIPTION_CHANGED, this.s.detectShardedTopology); + } + this.connectionLock = void 0; + } + detectShardedTopology(event) { + const previousType = event.previousDescription.type; + const newType = event.newDescription.type; + const transitionToSharded = previousType !== common_1.TopologyType.Sharded && newType === common_1.TopologyType.Sharded; + const srvListeners = this.s.srvPoller?.listeners(srv_polling_1.SrvPoller.SRV_RECORD_DISCOVERY); + const listeningToSrvPolling = !!srvListeners?.includes(this.s.detectSrvRecords); + if (transitionToSharded && !listeningToSrvPolling) { + this.s.srvPoller?.on(srv_polling_1.SrvPoller.SRV_RECORD_DISCOVERY, this.s.detectSrvRecords); + this.s.srvPoller?.start(); + } + } + detectSrvRecords(ev) { + const previousTopologyDescription = this.s.description; + this.s.description = this.s.description.updateFromSrvPollingEvent(ev, this.s.options.srvMaxHosts); + if (this.s.description === previousTopologyDescription) { + return; + } + updateServers(this); + this.emitAndLog(_Topology.TOPOLOGY_DESCRIPTION_CHANGED, new events_1.TopologyDescriptionChangedEvent(this.s.id, previousTopologyDescription, this.s.description)); + } + /** + * @returns A `TopologyDescription` for this topology + */ + get description() { + return this.s.description; + } + get loadBalanced() { + return this.s.options.loadBalanced; + } + get serverApi() { + return this.s.options.serverApi; + } + get capabilities() { + return new ServerCapabilities(this.lastHello()); + } + /** Initiate server connect */ + async connect(options) { + this.connectionLock ??= this._connect(options); + try { + await this.connectionLock; + return this; + } finally { + this.connectionLock = void 0; + } + } + async _connect(options) { + options = options ?? {}; + if (this.s.state === common_1.STATE_CONNECTED) { + return this; + } + stateTransition(this, common_1.STATE_CONNECTING); + this.emitAndLog(_Topology.TOPOLOGY_OPENING, new events_1.TopologyOpeningEvent(this.s.id)); + this.emitAndLog(_Topology.TOPOLOGY_DESCRIPTION_CHANGED, new events_1.TopologyDescriptionChangedEvent( + this.s.id, + new topology_description_1.TopologyDescription(common_1.TopologyType.Unknown), + // initial is always Unknown + this.s.description + )); + const serverDescriptions = Array.from(this.s.description.servers.values()); + this.s.servers = new Map(serverDescriptions.map((serverDescription) => [ + serverDescription.address, + createAndConnectServer(this, serverDescription) + ])); + if (this.s.options.loadBalanced) { + for (const description of serverDescriptions) { + const newDescription = new server_description_1.ServerDescription(description.hostAddress, void 0, { + loadBalanced: this.s.options.loadBalanced + }); + this.serverUpdateHandler(newDescription); + } + } + const serverSelectionTimeoutMS = this.client.s.options.serverSelectionTimeoutMS; + const readPreference = options.readPreference ?? read_preference_1.ReadPreference.primary; + const timeoutContext = timeout_1.TimeoutContext.create({ + // TODO(NODE-6448): auto-connect ignores timeoutMS; potential future feature + timeoutMS: void 0, + serverSelectionTimeoutMS, + waitQueueTimeoutMS: this.client.s.options.waitQueueTimeoutMS + }); + const selectServerOptions = { + operationName: "handshake", + ...options, + timeoutContext + }; + try { + const server = await this.selectServer((0, server_selection_1.readPreferenceServerSelector)(readPreference), selectServerOptions); + const skipPingOnConnect = this.s.options.__skipPingOnConnect === true; + if (!skipPingOnConnect && this.s.credentials) { + const connection = await server.pool.checkOut({ timeoutContext }); + server.pool.checkIn(connection); + stateTransition(this, common_1.STATE_CONNECTED); + this.emit(_Topology.OPEN, this); + this.emit(_Topology.CONNECT, this); + return this; + } + stateTransition(this, common_1.STATE_CONNECTED); + this.emit(_Topology.OPEN, this); + this.emit(_Topology.CONNECT, this); + return this; + } catch (error2) { + this.close(); + throw error2; + } + } + closeCheckedOutConnections() { + for (const server of this.s.servers.values()) { + return server.closeCheckedOutConnections(); + } + } + /** Close this topology */ + close() { + if (this.s.state === common_1.STATE_CLOSED || this.s.state === common_1.STATE_CLOSING) { + return; + } + for (const server of this.s.servers.values()) { + closeServer(server, this); + } + this.s.servers.clear(); + stateTransition(this, common_1.STATE_CLOSING); + drainWaitQueue(this.waitQueue, new error_1.MongoTopologyClosedError()); + if (this.s.srvPoller) { + this.s.srvPoller.stop(); + this.s.srvPoller.removeListener(srv_polling_1.SrvPoller.SRV_RECORD_DISCOVERY, this.s.detectSrvRecords); + } + this.removeListener(_Topology.TOPOLOGY_DESCRIPTION_CHANGED, this.s.detectShardedTopology); + stateTransition(this, common_1.STATE_CLOSED); + this.emitAndLog(_Topology.TOPOLOGY_CLOSED, new events_1.TopologyClosedEvent(this.s.id)); + } + /** + * Selects a server according to the selection predicate provided + * + * @param selector - An optional selector to select servers by, defaults to a random selection within a latency window + * @param options - Optional settings related to server selection + * @param callback - The callback used to indicate success or failure + * @returns An instance of a `Server` meeting the criteria of the predicate provided + */ + async selectServer(selector, options) { + let serverSelector; + if (typeof selector !== "function") { + if (typeof selector === "string") { + serverSelector = (0, server_selection_1.readPreferenceServerSelector)(read_preference_1.ReadPreference.fromString(selector)); + } else { + let readPreference; + if (selector instanceof read_preference_1.ReadPreference) { + readPreference = selector; + } else { + read_preference_1.ReadPreference.translate(options); + readPreference = options.readPreference || read_preference_1.ReadPreference.primary; + } + serverSelector = (0, server_selection_1.readPreferenceServerSelector)(readPreference); + } + } else { + serverSelector = selector; + } + options = { serverSelectionTimeoutMS: this.s.serverSelectionTimeoutMS, ...options }; + if (this.client.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.DEBUG)) { + this.client.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.ServerSelectionStartedEvent(selector, this.description, options.operationName)); + } + let timeout; + if (options.timeoutContext) + timeout = options.timeoutContext.serverSelectionTimeout; + else { + timeout = timeout_1.Timeout.expires(options.serverSelectionTimeoutMS ?? 0); + } + const isSharded = this.description.type === common_1.TopologyType.Sharded; + const session = options.session; + const transaction = session && session.transaction; + if (isSharded && transaction && transaction.server) { + if (this.client.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.DEBUG)) { + this.client.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.ServerSelectionSucceededEvent(selector, this.description, transaction.server.pool.address, options.operationName)); + } + if (options.timeoutContext?.clearServerSelectionTimeout) + timeout?.clear(); + return transaction.server; + } + const { promise: serverPromise, resolve, reject } = (0, utils_1.promiseWithResolvers)(); + const waitQueueMember = { + serverSelector, + topologyDescription: this.description, + mongoLogger: this.client.mongoLogger, + transaction, + resolve, + reject, + cancelled: false, + startTime: (0, utils_1.now)(), + operationName: options.operationName, + waitingLogged: false, + previousServer: options.previousServer + }; + const abortListener = (0, utils_1.addAbortListener)(options.signal, function() { + waitQueueMember.cancelled = true; + reject(this.reason); + }); + this.waitQueue.push(waitQueueMember); + processWaitQueue(this); + try { + timeout?.throwIfExpired(); + const server = await (timeout ? Promise.race([serverPromise, timeout]) : serverPromise); + if (options.timeoutContext?.csotEnabled() && server.description.minRoundTripTime !== 0) { + options.timeoutContext.minRoundTripTime = server.description.minRoundTripTime; + } + return server; + } catch (error2) { + if (timeout_1.TimeoutError.is(error2)) { + waitQueueMember.cancelled = true; + const timeoutError = new error_1.MongoServerSelectionError(`Server selection timed out after ${timeout?.duration} ms`, this.description); + if (this.client.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.DEBUG)) { + this.client.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.ServerSelectionFailedEvent(selector, this.description, timeoutError, options.operationName)); + } + if (options.timeoutContext?.csotEnabled()) { + throw new error_1.MongoOperationTimeoutError("Timed out during server selection", { + cause: timeoutError + }); + } + throw timeoutError; + } + throw error2; + } finally { + abortListener?.[utils_1.kDispose](); + if (options.timeoutContext?.clearServerSelectionTimeout) + timeout?.clear(); + } + } + /** + * Update the internal TopologyDescription with a ServerDescription + * + * @param serverDescription - The server to update in the internal list of server descriptions + */ + serverUpdateHandler(serverDescription) { + if (!this.s.description.hasServer(serverDescription.address)) { + return; + } + if (isStaleServerDescription(this.s.description, serverDescription)) { + return; + } + const previousTopologyDescription = this.s.description; + const previousServerDescription = this.s.description.servers.get(serverDescription.address); + if (!previousServerDescription) { + return; + } + const clusterTime = serverDescription.$clusterTime; + if (clusterTime) { + (0, common_1._advanceClusterTime)(this, clusterTime); + } + const equalDescriptions = previousServerDescription && previousServerDescription.equals(serverDescription); + this.s.description = this.s.description.update(serverDescription); + if (this.s.description.compatibilityError) { + this.emit(_Topology.ERROR, new error_1.MongoCompatibilityError(this.s.description.compatibilityError)); + return; + } + if (!equalDescriptions) { + const newDescription = this.s.description.servers.get(serverDescription.address); + if (newDescription) { + this.emit(_Topology.SERVER_DESCRIPTION_CHANGED, new events_1.ServerDescriptionChangedEvent(this.s.id, serverDescription.address, previousServerDescription, newDescription)); + } + } + updateServers(this, serverDescription); + if (this.waitQueue.length > 0) { + processWaitQueue(this); + } + if (!equalDescriptions) { + this.emitAndLog(_Topology.TOPOLOGY_DESCRIPTION_CHANGED, new events_1.TopologyDescriptionChangedEvent(this.s.id, previousTopologyDescription, this.s.description)); + } + } + auth(credentials, callback) { + if (typeof credentials === "function") + callback = credentials, credentials = void 0; + if (typeof callback === "function") + callback(void 0, true); + } + get clientMetadata() { + return this.s.options.metadata; + } + isConnected() { + return this.s.state === common_1.STATE_CONNECTED; + } + isDestroyed() { + return this.s.state === common_1.STATE_CLOSED; + } + // NOTE: There are many places in code where we explicitly check the last hello + // to do feature support detection. This should be done any other way, but for + // now we will just return the first hello seen, which should suffice. + lastHello() { + const serverDescriptions = Array.from(this.description.servers.values()); + if (serverDescriptions.length === 0) + return {}; + const sd = serverDescriptions.filter((sd2) => sd2.type !== common_1.ServerType.Unknown)[0]; + const result = sd || { maxWireVersion: this.description.commonWireVersion }; + return result; + } + get commonWireVersion() { + return this.description.commonWireVersion; + } + get logicalSessionTimeoutMinutes() { + return this.description.logicalSessionTimeoutMinutes; + } + get clusterTime() { + return this.s.clusterTime; + } + set clusterTime(clusterTime) { + this.s.clusterTime = clusterTime; + } + }; + exports2.Topology = Topology; + Topology.SERVER_OPENING = constants_1.SERVER_OPENING; + Topology.SERVER_CLOSED = constants_1.SERVER_CLOSED; + Topology.SERVER_DESCRIPTION_CHANGED = constants_1.SERVER_DESCRIPTION_CHANGED; + Topology.TOPOLOGY_OPENING = constants_1.TOPOLOGY_OPENING; + Topology.TOPOLOGY_CLOSED = constants_1.TOPOLOGY_CLOSED; + Topology.TOPOLOGY_DESCRIPTION_CHANGED = constants_1.TOPOLOGY_DESCRIPTION_CHANGED; + Topology.ERROR = constants_1.ERROR; + Topology.OPEN = constants_1.OPEN; + Topology.CONNECT = constants_1.CONNECT; + Topology.CLOSE = constants_1.CLOSE; + Topology.TIMEOUT = constants_1.TIMEOUT; + function closeServer(server, topology) { + for (const event of constants_1.LOCAL_SERVER_EVENTS) { + server.removeAllListeners(event); + } + server.close(); + topology.emitAndLog(Topology.SERVER_CLOSED, new events_1.ServerClosedEvent(topology.s.id, server.description.address)); + for (const event of constants_1.SERVER_RELAY_EVENTS) { + server.removeAllListeners(event); + } + } + function topologyTypeFromOptions(options) { + if (options?.directConnection) { + return common_1.TopologyType.Single; + } + if (options?.replicaSet) { + return common_1.TopologyType.ReplicaSetNoPrimary; + } + if (options?.loadBalanced) { + return common_1.TopologyType.LoadBalanced; + } + return common_1.TopologyType.Unknown; + } + function createAndConnectServer(topology, serverDescription) { + topology.emitAndLog(Topology.SERVER_OPENING, new events_1.ServerOpeningEvent(topology.s.id, serverDescription.address)); + const server = new server_1.Server(topology, serverDescription, topology.s.options); + for (const event of constants_1.SERVER_RELAY_EVENTS) { + server.on(event, (e4) => topology.emit(event, e4)); + } + server.on(server_1.Server.DESCRIPTION_RECEIVED, (description) => topology.serverUpdateHandler(description)); + server.connect(); + return server; + } + function updateServers(topology, incomingServerDescription) { + if (incomingServerDescription && topology.s.servers.has(incomingServerDescription.address)) { + const server = topology.s.servers.get(incomingServerDescription.address); + if (server) { + server.s.description = incomingServerDescription; + if (incomingServerDescription.error instanceof error_1.MongoError && incomingServerDescription.error.hasErrorLabel(error_1.MongoErrorLabel.ResetPool)) { + const interruptInUseConnections = incomingServerDescription.error.hasErrorLabel(error_1.MongoErrorLabel.InterruptInUseConnections); + server.pool.clear({ interruptInUseConnections }); + } else if (incomingServerDescription.error == null) { + const newTopologyType = topology.s.description.type; + const shouldMarkPoolReady = incomingServerDescription.isDataBearing || incomingServerDescription.type !== common_1.ServerType.Unknown && newTopologyType === common_1.TopologyType.Single; + if (shouldMarkPoolReady) { + server.pool.ready(); + } + } + } + } + for (const serverDescription of topology.description.servers.values()) { + if (!topology.s.servers.has(serverDescription.address)) { + const server = createAndConnectServer(topology, serverDescription); + topology.s.servers.set(serverDescription.address, server); + } + } + for (const entry of topology.s.servers) { + const serverAddress = entry[0]; + if (topology.description.hasServer(serverAddress)) { + continue; + } + if (!topology.s.servers.has(serverAddress)) { + continue; + } + const server = topology.s.servers.get(serverAddress); + topology.s.servers.delete(serverAddress); + if (server) { + closeServer(server, topology); + } + } + } + function drainWaitQueue(queue, drainError) { + while (queue.length) { + const waitQueueMember = queue.shift(); + if (!waitQueueMember) { + continue; + } + if (!waitQueueMember.cancelled) { + if (waitQueueMember.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.DEBUG)) { + waitQueueMember.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.ServerSelectionFailedEvent(waitQueueMember.serverSelector, waitQueueMember.topologyDescription, drainError, waitQueueMember.operationName)); + } + waitQueueMember.reject(drainError); + } + } + } + function processWaitQueue(topology) { + if (topology.s.state === common_1.STATE_CLOSED) { + drainWaitQueue(topology.waitQueue, new error_1.MongoTopologyClosedError()); + return; + } + const isSharded = topology.description.type === common_1.TopologyType.Sharded; + const serverDescriptions = Array.from(topology.description.servers.values()); + const membersToProcess = topology.waitQueue.length; + for (let i4 = 0; i4 < membersToProcess; ++i4) { + const waitQueueMember = topology.waitQueue.shift(); + if (!waitQueueMember) { + continue; + } + if (waitQueueMember.cancelled) { + continue; + } + let selectedDescriptions; + try { + const serverSelector = waitQueueMember.serverSelector; + const previousServer = waitQueueMember.previousServer; + selectedDescriptions = serverSelector ? serverSelector(topology.description, serverDescriptions, previousServer ? [previousServer] : []) : serverDescriptions; + } catch (selectorError) { + if (topology.client.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.DEBUG)) { + topology.client.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.ServerSelectionFailedEvent(waitQueueMember.serverSelector, topology.description, selectorError, waitQueueMember.operationName)); + } + waitQueueMember.reject(selectorError); + continue; + } + let selectedServer; + if (selectedDescriptions.length === 0) { + if (!waitQueueMember.waitingLogged) { + if (topology.client.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.INFORMATIONAL)) { + topology.client.mongoLogger?.info(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.WaitingForSuitableServerEvent(waitQueueMember.serverSelector, topology.description, topology.s.serverSelectionTimeoutMS !== 0 ? topology.s.serverSelectionTimeoutMS - ((0, utils_1.now)() - waitQueueMember.startTime) : -1, waitQueueMember.operationName)); + } + waitQueueMember.waitingLogged = true; + } + topology.waitQueue.push(waitQueueMember); + continue; + } else if (selectedDescriptions.length === 1) { + selectedServer = topology.s.servers.get(selectedDescriptions[0].address); + } else { + const descriptions = (0, utils_1.shuffle)(selectedDescriptions, 2); + const server1 = topology.s.servers.get(descriptions[0].address); + const server2 = topology.s.servers.get(descriptions[1].address); + selectedServer = server1 && server2 && server1.s.operationCount < server2.s.operationCount ? server1 : server2; + } + if (!selectedServer) { + const serverSelectionError = new error_1.MongoServerSelectionError("server selection returned a server description but the server was not found in the topology", topology.description); + if (topology.client.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.DEBUG)) { + topology.client.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.ServerSelectionFailedEvent(waitQueueMember.serverSelector, topology.description, serverSelectionError, waitQueueMember.operationName)); + } + waitQueueMember.reject(serverSelectionError); + return; + } + const transaction = waitQueueMember.transaction; + if (isSharded && transaction && transaction.isActive && selectedServer) { + transaction.pinServer(selectedServer); + } + if (topology.client.mongoLogger?.willLog(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, mongo_logger_1.SeverityLevel.DEBUG)) { + topology.client.mongoLogger?.debug(mongo_logger_1.MongoLoggableComponent.SERVER_SELECTION, new server_selection_events_1.ServerSelectionSucceededEvent(waitQueueMember.serverSelector, waitQueueMember.topologyDescription, selectedServer.pool.address, waitQueueMember.operationName)); + } + waitQueueMember.resolve(selectedServer); + } + if (topology.waitQueue.length > 0) { + for (const [, server] of topology.s.servers) { + process.nextTick(function scheduleServerCheck() { + return server.requestCheck(); + }); + } + } + } + function isStaleServerDescription(topologyDescription, incomingServerDescription) { + const currentServerDescription = topologyDescription.servers.get(incomingServerDescription.address); + const currentTopologyVersion = currentServerDescription?.topologyVersion; + return (0, server_description_1.compareTopologyVersion)(currentTopologyVersion, incomingServerDescription.topologyVersion) > 0; + } + var ServerCapabilities = class { + constructor(hello) { + this.minWireVersion = hello.minWireVersion || 0; + this.maxWireVersion = hello.maxWireVersion || 0; + } + get hasAggregationCursor() { + return true; + } + get hasWriteCommands() { + return true; + } + get hasTextSearch() { + return true; + } + get hasAuthCommands() { + return true; + } + get hasListCollectionsCommand() { + return true; + } + get hasListIndexesCommand() { + return true; + } + get supportsSnapshotReads() { + return this.maxWireVersion >= 13; + } + get commandsTakeWriteConcern() { + return true; + } + get commandsTakeCollation() { + return true; + } + }; + exports2.ServerCapabilities = ServerCapabilities; + } +}); + +// node_modules/mongodb/lib/mongo_client.js +var require_mongo_client = __commonJS({ + "node_modules/mongodb/lib/mongo_client.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MongoClient = exports2.ServerApiVersion = void 0; + var fs_1 = require("fs"); + var bson_1 = require_bson2(); + var change_stream_1 = require_change_stream(); + var mongo_credentials_1 = require_mongo_credentials(); + var providers_1 = require_providers(); + var client_metadata_1 = require_client_metadata(); + var responses_1 = require_responses(); + var connection_string_1 = require_connection_string(); + var constants_1 = require_constants2(); + var db_1 = require_db2(); + var error_1 = require_error(); + var mongo_client_auth_providers_1 = require_mongo_client_auth_providers(); + var mongo_logger_1 = require_mongo_logger(); + var mongo_types_1 = require_mongo_types(); + var executor_1 = require_executor(); + var execute_operation_1 = require_execute_operation(); + var operation_1 = require_operation(); + var read_preference_1 = require_read_preference(); + var resource_management_1 = require_resource_management(); + var server_selection_1 = require_server_selection(); + var topology_1 = require_topology(); + var sessions_1 = require_sessions(); + var utils_1 = require_utils3(); + exports2.ServerApiVersion = Object.freeze({ + v1: "1" + }); + var MongoClient = class extends mongo_types_1.TypedEventEmitter { + constructor(url, options) { + super(); + this.driverInfoList = []; + this.on("error", utils_1.noop); + this.options = (0, connection_string_1.parseOptions)(url, this, options); + this.appendMetadata(this.options.driverInfo); + const shouldSetLogger = Object.values(this.options.mongoLoggerOptions.componentSeverities).some((value) => value !== mongo_logger_1.SeverityLevel.OFF); + this.mongoLogger = shouldSetLogger ? new mongo_logger_1.MongoLogger(this.options.mongoLoggerOptions) : void 0; + const client = this; + this.s = { + url, + bsonOptions: (0, bson_1.resolveBSONOptions)(this.options), + namespace: (0, utils_1.ns)("admin"), + hasBeenClosed: false, + sessionPool: new sessions_1.ServerSessionPool(this), + activeSessions: /* @__PURE__ */ new Set(), + activeCursors: /* @__PURE__ */ new Set(), + authProviders: new mongo_client_auth_providers_1.MongoClientAuthProviders(), + get options() { + return client.options; + }, + get readConcern() { + return client.options.readConcern; + }, + get writeConcern() { + return client.options.writeConcern; + }, + get readPreference() { + return client.options.readPreference; + }, + get isMongoClient() { + return true; + } + }; + this.checkForNonGenuineHosts(); + } + /** @internal */ + async asyncDispose() { + await this.close(); + } + /** + * Append metadata to the client metadata after instantiation. + * @param driverInfo - Information about the application or library. + */ + appendMetadata(driverInfo) { + const isDuplicateDriverInfo = this.driverInfoList.some((info) => (0, client_metadata_1.isDriverInfoEqual)(info, driverInfo)); + if (isDuplicateDriverInfo) + return; + this.driverInfoList.push(driverInfo); + this.options.metadata = (0, client_metadata_1.makeClientMetadata)(this.driverInfoList, this.options); + this.options.extendedMetadata = (0, client_metadata_1.addContainerMetadata)(this.options.metadata).then(void 0, utils_1.squashError).then((result) => result ?? {}); + } + /** @internal */ + checkForNonGenuineHosts() { + const documentDBHostnames = this.options.hosts.filter((hostAddress) => (0, utils_1.isHostMatch)(utils_1.DOCUMENT_DB_CHECK, hostAddress.host)); + const srvHostIsDocumentDB = (0, utils_1.isHostMatch)(utils_1.DOCUMENT_DB_CHECK, this.options.srvHost); + const cosmosDBHostnames = this.options.hosts.filter((hostAddress) => (0, utils_1.isHostMatch)(utils_1.COSMOS_DB_CHECK, hostAddress.host)); + const srvHostIsCosmosDB = (0, utils_1.isHostMatch)(utils_1.COSMOS_DB_CHECK, this.options.srvHost); + if (documentDBHostnames.length !== 0 || srvHostIsDocumentDB) { + this.mongoLogger?.info("client", utils_1.DOCUMENT_DB_MSG); + } else if (cosmosDBHostnames.length !== 0 || srvHostIsCosmosDB) { + this.mongoLogger?.info("client", utils_1.COSMOS_DB_MSG); + } + } + get serverApi() { + return this.options.serverApi && Object.freeze({ ...this.options.serverApi }); + } + /** + * Intended for APM use only + * @internal + */ + get monitorCommands() { + return this.options.monitorCommands; + } + set monitorCommands(value) { + this.options.monitorCommands = value; + } + /** @internal */ + get autoEncrypter() { + return this.options.autoEncrypter; + } + get readConcern() { + return this.s.readConcern; + } + get writeConcern() { + return this.s.writeConcern; + } + get readPreference() { + return this.s.readPreference; + } + get bsonOptions() { + return this.s.bsonOptions; + } + get timeoutMS() { + return this.s.options.timeoutMS; + } + /** + * Executes a client bulk write operation, available on server 8.0+. + * @param models - The client bulk write models. + * @param options - The client bulk write options. + * @returns A ClientBulkWriteResult for acknowledged writes and ok: 1 for unacknowledged writes. + */ + async bulkWrite(models, options) { + if (this.autoEncrypter) { + throw new error_1.MongoInvalidArgumentError("MongoClient bulkWrite does not currently support automatic encryption."); + } + return await new executor_1.ClientBulkWriteExecutor(this, models, (0, utils_1.resolveOptions)(this, options)).execute(); + } + /** + * Connect to MongoDB using a url + * + * @remarks + * Calling `connect` is optional since the first operation you perform will call `connect` if it's needed. + * `timeoutMS` will bound the time any operation can take before throwing a timeout error. + * However, when the operation being run is automatically connecting your `MongoClient` the `timeoutMS` will not apply to the time taken to connect the MongoClient. + * This means the time to setup the `MongoClient` does not count against `timeoutMS`. + * If you are using `timeoutMS` we recommend connecting your client explicitly in advance of any operation to avoid this inconsistent execution time. + * + * @remarks + * The driver will look up corresponding SRV and TXT records if the connection string starts with `mongodb+srv://`. + * If those look ups throw a DNS Timeout error, the driver will retry the look up once. + * + * @see docs.mongodb.org/manual/reference/connection-string/ + */ + async connect() { + if (this.connectionLock) { + return await this.connectionLock; + } + try { + this.connectionLock = this._connect(); + await this.connectionLock; + } finally { + this.connectionLock = void 0; + } + return this; + } + /** + * Create a topology to open the connection, must be locked to avoid topology leaks in concurrency scenario. + * Locking is enforced by the connect method. + * + * @internal + */ + async _connect() { + if (this.topology && this.topology.isConnected()) { + return this; + } + const options = this.options; + if (options.tls) { + if (typeof options.tlsCAFile === "string") { + options.ca ??= await fs_1.promises.readFile(options.tlsCAFile); + } + if (typeof options.tlsCRLFile === "string") { + options.crl ??= await fs_1.promises.readFile(options.tlsCRLFile); + } + if (typeof options.tlsCertificateKeyFile === "string") { + if (!options.key || !options.cert) { + const contents = await fs_1.promises.readFile(options.tlsCertificateKeyFile); + options.key ??= contents; + options.cert ??= contents; + } + } + } + if (typeof options.srvHost === "string") { + const hosts = await (0, connection_string_1.resolveSRVRecord)(options); + for (const [index, host] of hosts.entries()) { + options.hosts[index] = host; + } + } + if (options.credentials?.mechanism === providers_1.AuthMechanism.MONGODB_OIDC) { + const allowedHosts = options.credentials?.mechanismProperties?.ALLOWED_HOSTS || mongo_credentials_1.DEFAULT_ALLOWED_HOSTS; + const isServiceAuth = !!options.credentials?.mechanismProperties?.ENVIRONMENT; + if (!isServiceAuth) { + for (const host of options.hosts) { + if (!(0, utils_1.hostMatchesWildcards)(host.toHostPort().host, allowedHosts)) { + throw new error_1.MongoInvalidArgumentError(`Host '${host}' is not valid for OIDC authentication with ALLOWED_HOSTS of '${allowedHosts.join(",")}'`); + } + } + } + } + this.topology = new topology_1.Topology(this, options.hosts, options); + this.topology.once(topology_1.Topology.OPEN, () => this.emit("open", this)); + for (const event of constants_1.MONGO_CLIENT_EVENTS) { + this.topology.on(event, (...args2) => this.emit(event, ...args2)); + } + const topologyConnect = async () => { + try { + await this.topology?.connect(options); + } catch (error2) { + this.topology?.close(); + throw error2; + } + }; + if (this.autoEncrypter) { + await this.autoEncrypter?.init(); + await topologyConnect(); + await options.encrypter.connectInternalClient(); + } else { + await topologyConnect(); + } + return this; + } + /** + * Cleans up resources managed by the MongoClient. + * + * The close method clears and closes all resources whose lifetimes are managed by the MongoClient. + * Please refer to the `MongoClient` class documentation for a high level overview of the client's key features and responsibilities. + * + * **However,** the close method does not handle the cleanup of resources explicitly created by the user. + * Any user-created driver resource with its own `close()` method should be explicitly closed by the user before calling MongoClient.close(). + * This method is written as a "best effort" attempt to leave behind the least amount of resources server-side when possible. + * + * The following list defines ideal preconditions and consequent pitfalls if they are not met. + * The MongoClient, ClientSession, Cursors and ChangeStreams all support [explicit resource management](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html). + * By using explicit resource management to manage the lifetime of driver resources instead of manually managing their lifetimes, the pitfalls outlined below can be avoided. + * + * The close method performs the following in the order listed: + * - Client-side: + * - **Close in-use connections**: Any connections that are currently waiting on a response from the server will be closed. + * This is performed _first_ to avoid reaching the next step (server-side clean up) and having no available connections to check out. + * - _Ideal_: All operations have been awaited or cancelled, and the outcomes, regardless of success or failure, have been processed before closing the client servicing the operation. + * - _Pitfall_: When `client.close()` is called and all connections are in use, after closing them, the client must create new connections for cleanup operations, which comes at the cost of new TLS/TCP handshakes and authentication steps. + * - Server-side: + * - **Close active cursors**: All cursors that haven't been completed will have a `killCursor` operation sent to the server they were initialized on, freeing the server-side resource. + * - _Ideal_: Cursors are explicitly closed or completed before `client.close()` is called. + * - _Pitfall_: `killCursors` may have to build a new connection if the in-use closure ended all pooled connections. + * - **End active sessions**: In-use sessions created with `client.startSession()` or `client.withSession()` or implicitly by the driver will have their `.endSession()` method called. + * Contrary to the name of the method, `endSession()` returns the session to the client's pool of sessions rather than end them on the server. + * - _Ideal_: Transaction outcomes are awaited and their corresponding explicit sessions are ended before `client.close()` is called. + * - _Pitfall_: **This step aborts in-progress transactions**. It is advisable to observe the outcome of a transaction before closing your client. + * - **End all pooled sessions**: The `endSessions` command with all session IDs the client has pooled is sent to the server to inform the cluster it can clean them up. + * - _Ideal_: No user intervention is expected. + * - _Pitfall_: None. + * + * The remaining shutdown is of the MongoClient resources that are intended to be entirely internal but is documented here as their existence relates to the JS event loop. + * + * - Client-side (again): + * - **Stop all server monitoring**: Connections kept live for detecting cluster changes and roundtrip time measurements are shutdown. + * - **Close all pooled connections**: Each server node in the cluster has a corresponding connection pool and all connections in the pool are closed. Any operations waiting to check out a connection will have an error thrown instead of a connection returned. + * - **Clear out server selection queue**: Any operations that are in the process of waiting for a server to be selected will have an error thrown instead of a server returned. + * - **Close encryption-related resources**: An internal MongoClient created for communicating with `mongocryptd` or other encryption purposes is closed. (Using this same method of course!) + * + * After the close method completes there should be no MongoClient related resources [ref-ed in Node.js' event loop](https://docs.libuv.org/en/v1.x/handle.html#reference-counting). + * This should allow Node.js to exit gracefully if MongoClient resources were the only active handles in the event loop. + * + * @param _force - currently an unused flag that has no effect. Defaults to `false`. + */ + async close(_force = false) { + if (this.closeLock) { + return await this.closeLock; + } + try { + this.closeLock = this._close(); + await this.closeLock; + } finally { + this.closeLock = void 0; + } + } + /* @internal */ + async _close() { + Object.defineProperty(this.s, "hasBeenClosed", { + value: true, + enumerable: true, + configurable: false, + writable: false + }); + this.topology?.closeCheckedOutConnections(); + const activeCursorCloses = Array.from(this.s.activeCursors, (cursor2) => cursor2.close()); + this.s.activeCursors.clear(); + await Promise.all(activeCursorCloses); + const activeSessionEnds = Array.from(this.s.activeSessions, (session) => session.endSession()); + this.s.activeSessions.clear(); + await Promise.all(activeSessionEnds); + if (this.topology == null) { + return; + } + const selector = (0, server_selection_1.readPreferenceServerSelector)(read_preference_1.ReadPreference.primaryPreferred); + const topologyDescription = this.topology.description; + const serverDescriptions = Array.from(topologyDescription.servers.values()); + const servers = selector(topologyDescription, serverDescriptions); + if (servers.length !== 0) { + const endSessions = Array.from(this.s.sessionPool.sessions, ({ id }) => id); + if (endSessions.length !== 0) { + try { + class EndSessionsOperation extends operation_1.AbstractOperation { + constructor() { + super(...arguments); + this.ns = utils_1.MongoDBNamespace.fromString("admin.$cmd"); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + } + buildCommand(_connection, _session) { + return { + endSessions + }; + } + buildOptions(timeoutContext) { + return { + timeoutContext, + readPreference: read_preference_1.ReadPreference.primaryPreferred, + noResponse: true + }; + } + get commandName() { + return "endSessions"; + } + } + await (0, execute_operation_1.executeOperation)(this, new EndSessionsOperation()); + } catch (error2) { + (0, utils_1.squashError)(error2); + } + } + } + const topology = this.topology; + this.topology = void 0; + topology.close(); + const { encrypter } = this.options; + if (encrypter) { + await encrypter.close(this); + } + } + /** + * Create a new Db instance sharing the current socket connections. + * + * @param dbName - The name of the database we want to use. If not provided, use database name from connection string. + * @param options - Optional settings for Db construction + */ + db(dbName, options) { + options = options ?? {}; + if (!dbName) { + dbName = this.s.options.dbName; + } + const finalOptions = Object.assign({}, this.options, options); + const db = new db_1.Db(this, dbName, finalOptions); + return db; + } + /** + * Connect to MongoDB using a url + * + * @remarks + * Calling `connect` is optional since the first operation you perform will call `connect` if it's needed. + * `timeoutMS` will bound the time any operation can take before throwing a timeout error. + * However, when the operation being run is automatically connecting your `MongoClient` the `timeoutMS` will not apply to the time taken to connect the MongoClient. + * This means the time to setup the `MongoClient` does not count against `timeoutMS`. + * If you are using `timeoutMS` we recommend connecting your client explicitly in advance of any operation to avoid this inconsistent execution time. + * + * @remarks + * The programmatically provided options take precedence over the URI options. + * + * @remarks + * The driver will look up corresponding SRV and TXT records if the connection string starts with `mongodb+srv://`. + * If those look ups throw a DNS Timeout error, the driver will retry the look up once. + * + * @see https://www.mongodb.com/docs/manual/reference/connection-string/ + */ + static async connect(url, options) { + const client = new this(url, options); + return await client.connect(); + } + /** + * Creates a new ClientSession. When using the returned session in an operation + * a corresponding ServerSession will be created. + * + * @remarks + * A ClientSession instance may only be passed to operations being performed on the same + * MongoClient it was started from. + */ + startSession(options) { + const session = new sessions_1.ClientSession(this, this.s.sessionPool, { explicit: true, ...options }, this.options); + this.s.activeSessions.add(session); + session.once("ended", () => { + this.s.activeSessions.delete(session); + }); + return session; + } + async withSession(optionsOrExecutor, executor) { + const options = { + // Always define an owner + owner: /* @__PURE__ */ Symbol(), + // If it's an object inherit the options + ...typeof optionsOrExecutor === "object" ? optionsOrExecutor : {} + }; + const withSessionCallback = typeof optionsOrExecutor === "function" ? optionsOrExecutor : executor; + if (withSessionCallback == null) { + throw new error_1.MongoInvalidArgumentError("Missing required callback parameter"); + } + const session = this.startSession(options); + try { + return await withSessionCallback(session); + } finally { + try { + await session.endSession(); + } catch (error2) { + (0, utils_1.squashError)(error2); + } + } + } + /** + * Create a new Change Stream, watching for new changes (insertions, updates, + * replacements, deletions, and invalidations) in this cluster. Will ignore all + * changes to system collections, as well as the local, admin, and config databases. + * + * @remarks + * watch() accepts two generic arguments for distinct use cases: + * - The first is to provide the schema that may be defined for all the data within the current cluster + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * + * @remarks + * When `timeoutMS` is configured for a change stream, it will have different behaviour depending + * on whether the change stream is in iterator mode or emitter mode. In both cases, a change + * stream will time out if it does not receive a change event within `timeoutMS` of the last change + * event. + * + * Note that if a change stream is consistently timing out when watching a collection, database or + * client that is being changed, then this may be due to the server timing out before it can finish + * processing the existing oplog. To address this, restart the change stream with a higher + * `timeoutMS`. + * + * If the change stream times out the initial aggregate operation to establish the change stream on + * the server, then the client will close the change stream. If the getMore calls to the server + * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError + * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in + * emitter mode. + * + * To determine whether or not the change stream is still open following a timeout, check the + * {@link ChangeStream.closed} getter. + * + * @example + * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream. + * The next call can just be retried after this succeeds. + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * try { + * await changeStream.next(); + * } catch (e) { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * await changeStream.next(); + * } + * throw e; + * } + * ``` + * + * @example + * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will + * emit an error event that returns a MongoOperationTimeoutError, but will not close the change + * stream unless the resume attempt fails. There is no need to re-establish change listeners as + * this will automatically continue emitting change events once the resume attempt completes. + * + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * changeStream.on('change', console.log); + * changeStream.on('error', e => { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * // do nothing + * } else { + * changeStream.close(); + * } + * }); + * ``` + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TSchema - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch(pipeline = [], options = {}) { + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + return new change_stream_1.ChangeStream(this, pipeline, (0, utils_1.resolveOptions)(this, options)); + } + }; + exports2.MongoClient = MongoClient; + (0, resource_management_1.configureResourceManagement)(MongoClient.prototype); + } +}); + +// node_modules/mongodb/lib/resource_management.js +var require_resource_management = __commonJS({ + "node_modules/mongodb/lib/resource_management.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.configureResourceManagement = configureResourceManagement; + exports2.configureExplicitResourceManagement = configureExplicitResourceManagement; + function configureResourceManagement(target) { + Symbol.asyncDispose && Object.defineProperty(target, Symbol.asyncDispose, { + value: async function asyncDispose() { + await this.asyncDispose(); + }, + enumerable: false, + configurable: true, + writable: true + }); + } + function configureExplicitResourceManagement() { + const { MongoClient } = require_mongo_client(); + const { ClientSession } = require_sessions(); + const { AbstractCursor } = require_abstract_cursor(); + const { ChangeStream } = require_change_stream(); + configureResourceManagement(MongoClient.prototype); + configureResourceManagement(ClientSession.prototype); + configureResourceManagement(AbstractCursor.prototype); + configureResourceManagement(ChangeStream.prototype); + } + } +}); + +// node_modules/mongodb/lib/cursor/abstract_cursor.js +var require_abstract_cursor = __commonJS({ + "node_modules/mongodb/lib/cursor/abstract_cursor.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.CursorTimeoutContext = exports2.AbstractCursor = exports2.CursorTimeoutMode = exports2.CURSOR_FLAGS = void 0; + var stream_1 = require("stream"); + var bson_1 = require_bson2(); + var error_1 = require_error(); + var mongo_types_1 = require_mongo_types(); + var execute_operation_1 = require_execute_operation(); + var get_more_1 = require_get_more(); + var kill_cursors_1 = require_kill_cursors(); + var read_concern_1 = require_read_concern(); + var read_preference_1 = require_read_preference(); + var resource_management_1 = require_resource_management(); + var sessions_1 = require_sessions(); + var timeout_1 = require_timeout(); + var utils_1 = require_utils3(); + exports2.CURSOR_FLAGS = [ + "tailable", + "oplogReplay", + "noCursorTimeout", + "awaitData", + "exhaust", + "partial" + ]; + function removeActiveCursor() { + this.client.s.activeCursors.delete(this); + } + exports2.CursorTimeoutMode = Object.freeze({ + ITERATION: "iteration", + LIFETIME: "cursorLifetime" + }); + var AbstractCursor = class extends mongo_types_1.TypedEventEmitter { + /** @internal */ + constructor(client, namespace, options = {}) { + super(); + this.documents = null; + this.hasEmittedClose = false; + this.on("error", utils_1.noop); + if (!client.s.isMongoClient) { + throw new error_1.MongoRuntimeError("Cursor must be constructed with MongoClient"); + } + this.cursorClient = client; + this.cursorNamespace = namespace; + this.cursorId = null; + this.initialized = false; + this.isClosed = false; + this.isKilled = false; + this.cursorOptions = { + readPreference: options.readPreference && options.readPreference instanceof read_preference_1.ReadPreference ? options.readPreference : read_preference_1.ReadPreference.primary, + ...(0, bson_1.pluckBSONSerializeOptions)(options), + timeoutMS: options?.timeoutContext?.csotEnabled() ? options.timeoutContext.timeoutMS : options.timeoutMS, + tailable: options.tailable, + awaitData: options.awaitData + }; + if (this.cursorOptions.timeoutMS != null) { + if (options.timeoutMode == null) { + if (options.tailable) { + if (options.awaitData) { + if (options.maxAwaitTimeMS != null && options.maxAwaitTimeMS >= this.cursorOptions.timeoutMS) + throw new error_1.MongoInvalidArgumentError("Cannot specify maxAwaitTimeMS >= timeoutMS for a tailable awaitData cursor"); + } + this.cursorOptions.timeoutMode = exports2.CursorTimeoutMode.ITERATION; + } else { + this.cursorOptions.timeoutMode = exports2.CursorTimeoutMode.LIFETIME; + } + } else { + if (options.tailable && options.timeoutMode === exports2.CursorTimeoutMode.LIFETIME) { + throw new error_1.MongoInvalidArgumentError("Cannot set tailable cursor's timeoutMode to LIFETIME"); + } + this.cursorOptions.timeoutMode = options.timeoutMode; + } + } else { + if (options.timeoutMode != null) + throw new error_1.MongoInvalidArgumentError("Cannot set timeoutMode without setting timeoutMS"); + } + this.cursorOptions.omitMaxTimeMS = this.cursorOptions.timeoutMS != null && (this.cursorOptions.timeoutMode === exports2.CursorTimeoutMode.ITERATION && !this.cursorOptions.tailable || this.cursorOptions.tailable && !this.cursorOptions.awaitData); + const readConcern = read_concern_1.ReadConcern.fromOptions(options); + if (readConcern) { + this.cursorOptions.readConcern = readConcern; + } + if (typeof options.batchSize === "number") { + this.cursorOptions.batchSize = options.batchSize; + } + if (options.comment !== void 0) { + this.cursorOptions.comment = options.comment; + } + if (typeof options.maxTimeMS === "number") { + this.cursorOptions.maxTimeMS = options.maxTimeMS; + } + if (typeof options.maxAwaitTimeMS === "number") { + this.cursorOptions.maxAwaitTimeMS = options.maxAwaitTimeMS; + } + this.cursorSession = options.session ?? null; + this.deserializationOptions = { + ...this.cursorOptions, + validation: { + utf8: options?.enableUtf8Validation === false ? false : true + } + }; + this.timeoutContext = options.timeoutContext; + this.signal = options.signal; + this.abortListener = (0, utils_1.addAbortListener)(this.signal, () => void this.close().then(void 0, utils_1.squashError)); + this.trackCursor(); + } + /** + * The cursor has no id until it receives a response from the initial cursor creating command. + * + * It is non-zero for as long as the database has an open cursor. + * + * The initiating command may receive a zero id if the entire result is in the `firstBatch`. + */ + get id() { + return this.cursorId ?? void 0; + } + /** @internal */ + get isDead() { + return (this.cursorId?.isZero() ?? false) || this.isClosed || this.isKilled; + } + /** @internal */ + get client() { + return this.cursorClient; + } + /** @internal */ + get server() { + return this.selectedServer; + } + get namespace() { + return this.cursorNamespace; + } + get readPreference() { + return this.cursorOptions.readPreference; + } + get readConcern() { + return this.cursorOptions.readConcern; + } + /** @internal */ + get session() { + return this.cursorSession; + } + set session(clientSession) { + this.cursorSession = clientSession; + } + /** + * The cursor is closed and all remaining locally buffered documents have been iterated. + */ + get closed() { + return this.isClosed && (this.documents?.length ?? 0) === 0; + } + /** + * A `killCursors` command was attempted on this cursor. + * This is performed if the cursor id is non zero. + */ + get killed() { + return this.isKilled; + } + get loadBalanced() { + return !!this.cursorClient.topology?.loadBalanced; + } + /** @internal */ + async asyncDispose() { + await this.close(); + } + /** Adds cursor to client's tracking so it will be closed by MongoClient.close() */ + trackCursor() { + this.cursorClient.s.activeCursors.add(this); + if (!this.listeners("close").includes(removeActiveCursor)) { + this.once("close", removeActiveCursor); + } + } + /** Returns current buffered documents length */ + bufferedCount() { + return this.documents?.length ?? 0; + } + /** Returns current buffered documents */ + readBufferedDocuments(number) { + const bufferedDocs = []; + const documentsToRead = Math.min(number ?? this.documents?.length ?? 0, this.documents?.length ?? 0); + for (let count = 0; count < documentsToRead; count++) { + const document2 = this.documents?.shift(this.deserializationOptions); + if (document2 != null) { + bufferedDocs.push(document2); + } + } + return bufferedDocs; + } + async *[Symbol.asyncIterator]() { + this.signal?.throwIfAborted(); + if (this.closed) { + return; + } + try { + while (true) { + if (this.isKilled) { + return; + } + if (this.closed) { + return; + } + if (this.cursorId != null && this.isDead && (this.documents?.length ?? 0) === 0) { + return; + } + const document2 = await this.next(); + if (document2 === null) { + return; + } + yield document2; + this.signal?.throwIfAborted(); + } + } finally { + if (!this.isClosed) { + try { + await this.close(); + } catch (error2) { + (0, utils_1.squashError)(error2); + } + } + } + } + stream(options) { + const readable = new ReadableCursorStream(this); + const abortListener = (0, utils_1.addAbortListener)(this.signal, function() { + readable.destroy(this.reason); + }); + readable.once("end", () => { + abortListener?.[utils_1.kDispose](); + }); + if (options?.transform) { + const transform = options.transform; + const transformedStream = readable.pipe(new stream_1.Transform({ + objectMode: true, + highWaterMark: 1, + transform(chunk, _, callback) { + try { + const transformed = transform(chunk); + callback(void 0, transformed); + } catch (err) { + callback(err); + } + } + })); + readable.on("error", (err) => transformedStream.emit("error", err)); + return transformedStream; + } + return readable; + } + async hasNext() { + this.signal?.throwIfAborted(); + if (this.cursorId === bson_1.Long.ZERO) { + return false; + } + if (this.cursorOptions.timeoutMode === exports2.CursorTimeoutMode.ITERATION && this.cursorId != null) { + this.timeoutContext?.refresh(); + } + try { + do { + if ((this.documents?.length ?? 0) !== 0) { + return true; + } + await this.fetchBatch(); + } while (!this.isDead || (this.documents?.length ?? 0) !== 0); + } finally { + if (this.cursorOptions.timeoutMode === exports2.CursorTimeoutMode.ITERATION) { + this.timeoutContext?.clear(); + } + } + return false; + } + /** Get the next available document from the cursor, returns null if no more documents are available. */ + async next() { + this.signal?.throwIfAborted(); + if (this.cursorId === bson_1.Long.ZERO) { + throw new error_1.MongoCursorExhaustedError(); + } + if (this.cursorOptions.timeoutMode === exports2.CursorTimeoutMode.ITERATION && this.cursorId != null) { + this.timeoutContext?.refresh(); + } + try { + do { + const doc = this.documents?.shift(this.deserializationOptions); + if (doc != null) { + if (this.transform != null) + return await this.transformDocument(doc); + return doc; + } + await this.fetchBatch(); + } while (!this.isDead || (this.documents?.length ?? 0) !== 0); + } finally { + if (this.cursorOptions.timeoutMode === exports2.CursorTimeoutMode.ITERATION) { + this.timeoutContext?.clear(); + } + } + return null; + } + /** + * Try to get the next available document from the cursor or `null` if an empty batch is returned + */ + async tryNext() { + this.signal?.throwIfAborted(); + if (this.cursorId === bson_1.Long.ZERO) { + throw new error_1.MongoCursorExhaustedError(); + } + if (this.cursorOptions.timeoutMode === exports2.CursorTimeoutMode.ITERATION && this.cursorId != null) { + this.timeoutContext?.refresh(); + } + try { + let doc = this.documents?.shift(this.deserializationOptions); + if (doc != null) { + if (this.transform != null) + return await this.transformDocument(doc); + return doc; + } + await this.fetchBatch(); + doc = this.documents?.shift(this.deserializationOptions); + if (doc != null) { + if (this.transform != null) + return await this.transformDocument(doc); + return doc; + } + } finally { + if (this.cursorOptions.timeoutMode === exports2.CursorTimeoutMode.ITERATION) { + this.timeoutContext?.clear(); + } + } + return null; + } + /** + * Iterates over all the documents for this cursor using the iterator, callback pattern. + * + * If the iterator returns `false`, iteration will stop. + * + * @param iterator - The iteration callback. + * @deprecated - Will be removed in a future release. Use for await...of instead. + */ + async forEach(iterator) { + this.signal?.throwIfAborted(); + if (typeof iterator !== "function") { + throw new error_1.MongoInvalidArgumentError('Argument "iterator" must be a function'); + } + for await (const document2 of this) { + const result = iterator(document2); + if (result === false) { + break; + } + } + } + /** + * Frees any client-side resources used by the cursor. + */ + async close(options) { + await this.cleanup(options?.timeoutMS); + } + /** + * Returns an array of documents. The caller is responsible for making sure that there + * is enough memory to store the results. Note that the array only contains partial + * results when this cursor had been previously accessed. In that case, + * cursor.rewind() can be used to reset the cursor. + */ + async toArray() { + this.signal?.throwIfAborted(); + const array = []; + for await (const document2 of this) { + array.push(document2); + const docs = this.readBufferedDocuments(); + if (this.transform != null) { + for (const doc of docs) { + array.push(await this.transformDocument(doc)); + } + } else { + array.push(...docs); + } + } + return array; + } + /** + * Add a cursor flag to the cursor + * + * @param flag - The flag to set, must be one of following ['tailable', 'oplogReplay', 'noCursorTimeout', 'awaitData', 'partial' -. + * @param value - The flag boolean value. + */ + addCursorFlag(flag, value) { + this.throwIfInitialized(); + if (!exports2.CURSOR_FLAGS.includes(flag)) { + throw new error_1.MongoInvalidArgumentError(`Flag ${flag} is not one of ${exports2.CURSOR_FLAGS}`); + } + if (typeof value !== "boolean") { + throw new error_1.MongoInvalidArgumentError(`Flag ${flag} must be a boolean value`); + } + this.cursorOptions[flag] = value; + return this; + } + /** + * Map all documents using the provided function + * If there is a transform set on the cursor, that will be called first and the result passed to + * this function's transform. + * + * @remarks + * + * **Note** Cursors use `null` internally to indicate that there are no more documents in the cursor. Providing a mapping + * function that maps values to `null` will result in the cursor closing itself before it has finished iterating + * all documents. This will **not** result in a memory leak, just surprising behavior. For example: + * + * ```typescript + * const cursor = collection.find({}); + * cursor.map(() => null); + * + * const documents = await cursor.toArray(); + * // documents is always [], regardless of how many documents are in the collection. + * ``` + * + * Other falsey values are allowed: + * + * ```typescript + * const cursor = collection.find({}); + * cursor.map(() => ''); + * + * const documents = await cursor.toArray(); + * // documents is now an array of empty strings + * ``` + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling map, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: FindCursor = coll.find(); + * const mappedCursor: FindCursor = cursor.map(doc => Object.keys(doc).length); + * const keyCounts: number[] = await mappedCursor.toArray(); // cursor.toArray() still returns Document[] + * ``` + * @param transform - The mapping transformation method. + */ + map(transform) { + this.throwIfInitialized(); + const oldTransform = this.transform; + if (oldTransform) { + this.transform = (doc) => { + return transform(oldTransform(doc)); + }; + } else { + this.transform = transform; + } + return this; + } + /** + * Set the ReadPreference for the cursor. + * + * @param readPreference - The new read preference for the cursor. + */ + withReadPreference(readPreference) { + this.throwIfInitialized(); + if (readPreference instanceof read_preference_1.ReadPreference) { + this.cursorOptions.readPreference = readPreference; + } else if (typeof readPreference === "string") { + this.cursorOptions.readPreference = read_preference_1.ReadPreference.fromString(readPreference); + } else { + throw new error_1.MongoInvalidArgumentError(`Invalid read preference: ${readPreference}`); + } + return this; + } + /** + * Set the ReadPreference for the cursor. + * + * @param readPreference - The new read preference for the cursor. + */ + withReadConcern(readConcern) { + this.throwIfInitialized(); + const resolvedReadConcern = read_concern_1.ReadConcern.fromOptions({ readConcern }); + if (resolvedReadConcern) { + this.cursorOptions.readConcern = resolvedReadConcern; + } + return this; + } + /** + * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher) + * + * @param value - Number of milliseconds to wait before aborting the query. + */ + maxTimeMS(value) { + this.throwIfInitialized(); + if (typeof value !== "number") { + throw new error_1.MongoInvalidArgumentError("Argument for maxTimeMS must be a number"); + } + this.cursorOptions.maxTimeMS = value; + return this; + } + /** + * Set the batch size for the cursor. + * + * @param value - The number of documents to return per batch. See {@link https://www.mongodb.com/docs/manual/reference/command/find/|find command documentation}. + */ + batchSize(value) { + this.throwIfInitialized(); + if (this.cursorOptions.tailable) { + throw new error_1.MongoTailableCursorError("Tailable cursor does not support batchSize"); + } + if (typeof value !== "number") { + throw new error_1.MongoInvalidArgumentError('Operation "batchSize" requires an integer'); + } + this.cursorOptions.batchSize = value; + return this; + } + /** + * Rewind this cursor to its uninitialized state. Any options that are present on the cursor will + * remain in effect. Iterating this cursor will cause new queries to be sent to the server, even + * if the resultant data has already been retrieved by this cursor. + */ + rewind() { + if (this.timeoutContext && this.timeoutContext.owner !== this) { + throw new error_1.MongoAPIError(`Cannot rewind cursor that does not own its timeout context.`); + } + if (!this.initialized) { + return; + } + this.cursorId = null; + this.documents?.clear(); + this.timeoutContext?.clear(); + this.timeoutContext = void 0; + this.isClosed = false; + this.isKilled = false; + this.initialized = false; + this.hasEmittedClose = false; + this.trackCursor(); + if (this.cursorSession?.explicit === false) { + if (!this.cursorSession.hasEnded) { + this.cursorSession.endSession().then(void 0, utils_1.squashError); + } + this.cursorSession = null; + } + } + /** @internal */ + async getMore(batchSize) { + if (this.cursorId == null) { + throw new error_1.MongoRuntimeError("Unexpected null cursor id. A cursor creating command should have set this"); + } + if (this.selectedServer == null) { + throw new error_1.MongoRuntimeError("Unexpected null selectedServer. A cursor creating command should have set this"); + } + if (this.cursorSession == null) { + throw new error_1.MongoRuntimeError("Unexpected null session. A cursor creating command should have set this"); + } + const getMoreOptions = { + ...this.cursorOptions, + session: this.cursorSession, + batchSize + }; + const getMoreOperation = new get_more_1.GetMoreOperation(this.cursorNamespace, this.cursorId, this.selectedServer, getMoreOptions); + return await (0, execute_operation_1.executeOperation)(this.cursorClient, getMoreOperation, this.timeoutContext); + } + /** + * @internal + * + * This function is exposed for the unified test runner's createChangeStream + * operation. We cannot refactor to use the abstract _initialize method without + * a significant refactor. + */ + async cursorInit() { + if (this.cursorOptions.timeoutMS != null) { + this.timeoutContext ??= new CursorTimeoutContext(timeout_1.TimeoutContext.create({ + serverSelectionTimeoutMS: this.client.s.options.serverSelectionTimeoutMS, + timeoutMS: this.cursorOptions.timeoutMS + }), this); + } + try { + this.cursorSession ??= this.cursorClient.startSession({ owner: this, explicit: false }); + const state2 = await this._initialize(this.cursorSession); + this.cursorOptions.omitMaxTimeMS = this.cursorOptions.timeoutMS != null; + const response = state2.response; + this.selectedServer = state2.server; + this.cursorId = response.id; + this.cursorNamespace = response.ns ?? this.namespace; + this.documents = response; + this.initialized = true; + } catch (error2) { + this.initialized = true; + await this.cleanup(void 0, error2); + throw error2; + } + if (this.isDead) { + await this.cleanup(); + } + return; + } + /** @internal Attempt to obtain more documents */ + async fetchBatch() { + if (this.isClosed) { + return; + } + if (this.isDead) { + await this.cleanup(); + return; + } + if (this.cursorId == null) { + await this.cursorInit(); + if ((this.documents?.length ?? 0) !== 0 || this.isDead) + return; + } + const batchSize = this.cursorOptions.batchSize || 1e3; + try { + const response = await this.getMore(batchSize); + this.cursorId = response.id; + this.documents = response; + } catch (error2) { + try { + await this.cleanup(void 0, error2); + } catch (cleanupError) { + (0, utils_1.squashError)(cleanupError); + } + throw error2; + } + if (this.isDead) { + await this.cleanup(); + } + } + /** @internal */ + async cleanup(timeoutMS, error2) { + this.abortListener?.[utils_1.kDispose](); + this.isClosed = true; + const timeoutContextForKillCursors = () => { + if (timeoutMS != null) { + this.timeoutContext?.clear(); + return new CursorTimeoutContext(timeout_1.TimeoutContext.create({ + serverSelectionTimeoutMS: this.client.s.options.serverSelectionTimeoutMS, + timeoutMS + }), this); + } else { + return this.timeoutContext?.refreshed(); + } + }; + const withEmitClose = async (fn2) => { + try { + await fn2(); + } finally { + this.emitClose(); + } + }; + const close = async () => { + const session = this.cursorSession; + if (!session) + return; + try { + if (!this.isKilled && this.cursorId && !this.cursorId.isZero() && this.cursorNamespace && this.selectedServer && !session.hasEnded) { + this.isKilled = true; + const cursorId = this.cursorId; + this.cursorId = bson_1.Long.ZERO; + await (0, execute_operation_1.executeOperation)(this.cursorClient, new kill_cursors_1.KillCursorsOperation(cursorId, this.cursorNamespace, this.selectedServer, { + session + }), timeoutContextForKillCursors()); + } + } catch (error3) { + (0, utils_1.squashError)(error3); + } finally { + if (session.owner === this) { + await session.endSession({ error: error2 }); + } + if (!session.inTransaction()) { + (0, sessions_1.maybeClearPinnedConnection)(session, { error: error2 }); + } + } + }; + await withEmitClose(close); + } + /** @internal */ + emitClose() { + try { + if (!this.hasEmittedClose && ((this.documents?.length ?? 0) === 0 || this.isClosed)) { + this.emit("close"); + } + } finally { + this.hasEmittedClose = true; + } + } + /** @internal */ + async transformDocument(document2) { + if (this.transform == null) + return document2; + try { + const transformedDocument = this.transform(document2); + if (transformedDocument === null) { + const TRANSFORM_TO_NULL_ERROR = "Cursor returned a `null` document, but the cursor is not exhausted. Mapping documents to `null` is not supported in the cursor transform."; + throw new error_1.MongoAPIError(TRANSFORM_TO_NULL_ERROR); + } + return transformedDocument; + } catch (transformError) { + try { + await this.close(); + } catch (closeError) { + (0, utils_1.squashError)(closeError); + } + throw transformError; + } + } + /** @internal */ + throwIfInitialized() { + if (this.initialized) + throw new error_1.MongoCursorInUseError(); + } + }; + exports2.AbstractCursor = AbstractCursor; + AbstractCursor.CLOSE = "close"; + var ReadableCursorStream = class extends stream_1.Readable { + constructor(cursor2) { + super({ + objectMode: true, + autoDestroy: false, + highWaterMark: 1 + }); + this._readInProgress = false; + this._cursor = cursor2; + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _read(size) { + if (!this._readInProgress) { + this._readInProgress = true; + this._readNext(); + } + } + _destroy(error2, callback) { + this._cursor.close().then(() => callback(error2), (closeError) => callback(closeError)); + } + _readNext() { + if (this._cursor.id === bson_1.Long.ZERO) { + this.push(null); + return; + } + this._cursor.next().then( + // result from next() + (result) => { + if (result == null) { + this.push(null); + } else if (this.destroyed) { + this._cursor.close().then(void 0, utils_1.squashError); + } else { + if (this.push(result)) { + return this._readNext(); + } + this._readInProgress = false; + } + }, + // error from next() + (err) => { + if (err.message.match(/server is closed/)) { + this._cursor.close().then(void 0, utils_1.squashError); + return this.push(null); + } + if (err.message.match(/operation was interrupted/)) { + return this.push(null); + } + return this.destroy(err); + } + ).catch((error2) => { + this._readInProgress = false; + this.destroy(error2); + }); + } + }; + (0, resource_management_1.configureResourceManagement)(AbstractCursor.prototype); + var CursorTimeoutContext = class _CursorTimeoutContext extends timeout_1.TimeoutContext { + constructor(timeoutContext, owner) { + super(); + this.timeoutContext = timeoutContext; + this.owner = owner; + } + get serverSelectionTimeout() { + return this.timeoutContext.serverSelectionTimeout; + } + get connectionCheckoutTimeout() { + return this.timeoutContext.connectionCheckoutTimeout; + } + get clearServerSelectionTimeout() { + return this.timeoutContext.clearServerSelectionTimeout; + } + get timeoutForSocketWrite() { + return this.timeoutContext.timeoutForSocketWrite; + } + get timeoutForSocketRead() { + return this.timeoutContext.timeoutForSocketRead; + } + csotEnabled() { + return this.timeoutContext.csotEnabled(); + } + refresh() { + if (typeof this.owner !== "symbol") + return this.timeoutContext.refresh(); + } + clear() { + if (typeof this.owner !== "symbol") + return this.timeoutContext.clear(); + } + get maxTimeMS() { + return this.timeoutContext.maxTimeMS; + } + get timeoutMS() { + return this.timeoutContext.csotEnabled() ? this.timeoutContext.timeoutMS : null; + } + refreshed() { + return new _CursorTimeoutContext(this.timeoutContext.refreshed(), this.owner); + } + addMaxTimeMSToCommand(command, options) { + this.timeoutContext.addMaxTimeMSToCommand(command, options); + } + getSocketTimeoutMS() { + return this.timeoutContext.getSocketTimeoutMS(); + } + }; + exports2.CursorTimeoutContext = CursorTimeoutContext; + } +}); + +// node_modules/mongodb/lib/cursor/explainable_cursor.js +var require_explainable_cursor = __commonJS({ + "node_modules/mongodb/lib/cursor/explainable_cursor.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ExplainableCursor = void 0; + var abstract_cursor_1 = require_abstract_cursor(); + var ExplainableCursor = class extends abstract_cursor_1.AbstractCursor { + resolveExplainTimeoutOptions(verbosity, options) { + let explain; + let timeout; + if (verbosity == null && options == null) { + explain = void 0; + timeout = void 0; + } else if (verbosity != null && options == null) { + explain = typeof verbosity !== "object" ? verbosity : "verbosity" in verbosity ? verbosity : void 0; + timeout = typeof verbosity === "object" && "timeoutMS" in verbosity ? verbosity : void 0; + } else { + explain = verbosity; + timeout = options; + } + return { timeout, explain }; + } + }; + exports2.ExplainableCursor = ExplainableCursor; + } +}); + +// node_modules/mongodb/lib/cursor/aggregation_cursor.js +var require_aggregation_cursor = __commonJS({ + "node_modules/mongodb/lib/cursor/aggregation_cursor.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AggregationCursor = void 0; + var error_1 = require_error(); + var explain_1 = require_explain(); + var aggregate_1 = require_aggregate(); + var execute_operation_1 = require_execute_operation(); + var utils_1 = require_utils3(); + var abstract_cursor_1 = require_abstract_cursor(); + var explainable_cursor_1 = require_explainable_cursor(); + var AggregationCursor = class _AggregationCursor extends explainable_cursor_1.ExplainableCursor { + /** @internal */ + constructor(client, namespace, pipeline = [], options = {}) { + super(client, namespace, options); + this.pipeline = pipeline; + this.aggregateOptions = options; + const lastStage = this.pipeline[this.pipeline.length - 1]; + if (this.cursorOptions.timeoutMS != null && this.cursorOptions.timeoutMode === abstract_cursor_1.CursorTimeoutMode.ITERATION && (lastStage?.$merge != null || lastStage?.$out != null)) + throw new error_1.MongoAPIError("Cannot use $out or $merge stage with ITERATION timeoutMode"); + } + clone() { + const clonedOptions = (0, utils_1.mergeOptions)({}, this.aggregateOptions); + delete clonedOptions.session; + return new _AggregationCursor(this.client, this.namespace, this.pipeline, { + ...clonedOptions + }); + } + map(transform) { + return super.map(transform); + } + /** @internal */ + async _initialize(session) { + const options = { + ...this.aggregateOptions, + ...this.cursorOptions, + session, + signal: this.signal + }; + if (options.explain) { + try { + (0, explain_1.validateExplainTimeoutOptions)(options, explain_1.Explain.fromOptions(options)); + } catch { + throw new error_1.MongoAPIError("timeoutMS cannot be used with explain when explain is specified in aggregateOptions"); + } + } + const aggregateOperation = new aggregate_1.AggregateOperation(this.namespace, this.pipeline, options); + const response = await (0, execute_operation_1.executeOperation)(this.client, aggregateOperation, this.timeoutContext); + return { server: aggregateOperation.server, session, response }; + } + async explain(verbosity, options) { + const { explain, timeout } = this.resolveExplainTimeoutOptions(verbosity, options); + return (await (0, execute_operation_1.executeOperation)(this.client, new aggregate_1.AggregateOperation(this.namespace, this.pipeline, { + ...this.aggregateOptions, + // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + ...timeout, + explain: explain ?? true + }))).shift(this.deserializationOptions); + } + addStage(stage) { + this.throwIfInitialized(); + if (this.cursorOptions.timeoutMS != null && this.cursorOptions.timeoutMode === abstract_cursor_1.CursorTimeoutMode.ITERATION && (stage.$out != null || stage.$merge != null)) { + throw new error_1.MongoAPIError("Cannot use $out or $merge stage with ITERATION timeoutMode"); + } + this.pipeline.push(stage); + return this; + } + group($group) { + return this.addStage({ $group }); + } + /** Add a limit stage to the aggregation pipeline */ + limit($limit) { + return this.addStage({ $limit }); + } + /** Add a match stage to the aggregation pipeline */ + match($match) { + return this.addStage({ $match }); + } + /** Add an out stage to the aggregation pipeline */ + out($out) { + return this.addStage({ $out }); + } + /** + * Add a project stage to the aggregation pipeline + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * By default chaining a projection to your cursor changes the returned type to the generic {@link Document} type. + * You should specify a parameterized type to have assertions on your final results. + * + * @example + * ```typescript + * // Best way + * const docs: AggregationCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true }); + * // Flexible way + * const docs: AggregationCursor = cursor.project({ _id: 0, a: true }); + * ``` + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling project, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: AggregationCursor<{ a: number; b: string }> = coll.aggregate([]); + * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true }); + * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray(); + * + * // or always use chaining and save the final cursor + * + * const cursor = coll.aggregate().project<{ a: string }>({ + * _id: 0, + * a: { $convert: { input: '$a', to: 'string' } + * }}); + * ``` + */ + project($project) { + return this.addStage({ $project }); + } + /** Add a lookup stage to the aggregation pipeline */ + lookup($lookup) { + return this.addStage({ $lookup }); + } + /** Add a redact stage to the aggregation pipeline */ + redact($redact) { + return this.addStage({ $redact }); + } + /** Add a skip stage to the aggregation pipeline */ + skip($skip) { + return this.addStage({ $skip }); + } + /** Add a sort stage to the aggregation pipeline */ + sort($sort) { + return this.addStage({ $sort }); + } + /** Add a unwind stage to the aggregation pipeline */ + unwind($unwind) { + return this.addStage({ $unwind }); + } + /** Add a geoNear stage to the aggregation pipeline */ + geoNear($geoNear) { + return this.addStage({ $geoNear }); + } + }; + exports2.AggregationCursor = AggregationCursor; + } +}); + +// node_modules/mongodb/lib/operations/count.js +var require_count = __commonJS({ + "node_modules/mongodb/lib/operations/count.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.CountOperation = void 0; + var responses_1 = require_responses(); + var command_1 = require_command(); + var operation_1 = require_operation(); + var CountOperation = class extends command_1.CommandOperation { + constructor(namespace, filter, options) { + super({ s: { namespace } }, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.collectionName = namespace.collection; + this.query = filter; + } + get commandName() { + return "count"; + } + buildCommandDocument(_connection, _session) { + const options = this.options; + const cmd = { + count: this.collectionName, + query: this.query + }; + if (typeof options.limit === "number") { + cmd.limit = options.limit; + } + if (typeof options.skip === "number") { + cmd.skip = options.skip; + } + if (options.hint != null) { + cmd.hint = options.hint; + } + if (typeof options.maxTimeMS === "number") { + cmd.maxTimeMS = options.maxTimeMS; + } + return cmd; + } + handleOk(response) { + return response.getNumber("n") ?? 0; + } + }; + exports2.CountOperation = CountOperation; + (0, operation_1.defineAspects)(CountOperation, [operation_1.Aspect.READ_OPERATION, operation_1.Aspect.RETRYABLE, operation_1.Aspect.SUPPORTS_RAW_DATA]); + } +}); + +// node_modules/mongodb/lib/operations/find.js +var require_find = __commonJS({ + "node_modules/mongodb/lib/operations/find.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.FindOperation = void 0; + var responses_1 = require_responses(); + var error_1 = require_error(); + var sort_1 = require_sort(); + var utils_1 = require_utils3(); + var command_1 = require_command(); + var operation_1 = require_operation(); + var FindOperation = class extends command_1.CommandOperation { + constructor(ns, filter = {}, options = {}) { + super(void 0, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.CursorResponse; + this.options = { ...options }; + delete this.options.writeConcern; + this.ns = ns; + if (typeof filter !== "object" || Array.isArray(filter)) { + throw new error_1.MongoInvalidArgumentError("Query filter must be a plain object or ObjectId"); + } + this.filter = filter != null && filter._bsontype === "ObjectId" ? { _id: filter } : filter; + this.SERVER_COMMAND_RESPONSE_TYPE = this.explain ? responses_1.ExplainedCursorResponse : responses_1.CursorResponse; + } + get commandName() { + return "find"; + } + buildOptions(timeoutContext) { + return { + ...this.options, + ...this.bsonOptions, + documentsReturnedIn: "firstBatch", + session: this.session, + timeoutContext + }; + } + handleOk(response) { + return response; + } + buildCommandDocument() { + return makeFindCommand(this.ns, this.filter, this.options); + } + }; + exports2.FindOperation = FindOperation; + function makeFindCommand(ns, filter, options) { + const findCommand = { + find: ns.collection, + filter + }; + if (options.sort) { + findCommand.sort = (0, sort_1.formatSort)(options.sort); + } + if (options.projection) { + let projection = options.projection; + if (projection && Array.isArray(projection)) { + projection = projection.length ? projection.reduce((result, field) => { + result[field] = 1; + return result; + }, {}) : { _id: 1 }; + } + findCommand.projection = projection; + } + if (options.hint) { + findCommand.hint = (0, utils_1.normalizeHintField)(options.hint); + } + if (typeof options.skip === "number") { + findCommand.skip = options.skip; + } + if (typeof options.limit === "number") { + if (options.limit < 0) { + findCommand.limit = -options.limit; + findCommand.singleBatch = true; + } else { + findCommand.limit = options.limit; + } + } + if (typeof options.batchSize === "number") { + if (options.batchSize < 0) { + findCommand.limit = -options.batchSize; + } else { + if (options.batchSize === options.limit) { + findCommand.batchSize = options.batchSize + 1; + } else { + findCommand.batchSize = options.batchSize; + } + } + } + if (typeof options.singleBatch === "boolean") { + findCommand.singleBatch = options.singleBatch; + } + if (options.comment !== void 0) { + findCommand.comment = options.comment; + } + if (options.max) { + findCommand.max = options.max; + } + if (options.min) { + findCommand.min = options.min; + } + if (typeof options.returnKey === "boolean") { + findCommand.returnKey = options.returnKey; + } + if (typeof options.showRecordId === "boolean") { + findCommand.showRecordId = options.showRecordId; + } + if (typeof options.tailable === "boolean") { + findCommand.tailable = options.tailable; + } + if (typeof options.oplogReplay === "boolean") { + findCommand.oplogReplay = options.oplogReplay; + } + if (typeof options.timeout === "boolean") { + findCommand.noCursorTimeout = !options.timeout; + } else if (typeof options.noCursorTimeout === "boolean") { + findCommand.noCursorTimeout = options.noCursorTimeout; + } + if (typeof options.awaitData === "boolean") { + findCommand.awaitData = options.awaitData; + } + if (typeof options.allowPartialResults === "boolean") { + findCommand.allowPartialResults = options.allowPartialResults; + } + if (typeof options.allowDiskUse === "boolean") { + findCommand.allowDiskUse = options.allowDiskUse; + } + if (options.let) { + findCommand.let = options.let; + } + return findCommand; + } + (0, operation_1.defineAspects)(FindOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.CURSOR_CREATING, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + } +}); + +// node_modules/mongodb/lib/cursor/find_cursor.js +var require_find_cursor = __commonJS({ + "node_modules/mongodb/lib/cursor/find_cursor.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.FindCursor = exports2.FLAGS = void 0; + var responses_1 = require_responses(); + var error_1 = require_error(); + var explain_1 = require_explain(); + var count_1 = require_count(); + var execute_operation_1 = require_execute_operation(); + var find_1 = require_find(); + var sort_1 = require_sort(); + var utils_1 = require_utils3(); + var explainable_cursor_1 = require_explainable_cursor(); + exports2.FLAGS = [ + "tailable", + "oplogReplay", + "noCursorTimeout", + "awaitData", + "exhaust", + "partial" + ]; + var FindCursor = class _FindCursor extends explainable_cursor_1.ExplainableCursor { + /** @internal */ + constructor(client, namespace, filter = {}, options = {}) { + super(client, namespace, options); + this.numReturned = 0; + this.cursorFilter = filter; + this.findOptions = options; + if (options.sort != null) { + this.findOptions.sort = (0, sort_1.formatSort)(options.sort); + } + } + clone() { + const clonedOptions = (0, utils_1.mergeOptions)({}, this.findOptions); + delete clonedOptions.session; + return new _FindCursor(this.client, this.namespace, this.cursorFilter, { + ...clonedOptions + }); + } + map(transform) { + return super.map(transform); + } + /** @internal */ + async _initialize(session) { + const options = { + ...this.findOptions, + // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + session, + signal: this.signal + }; + if (options.explain) { + try { + (0, explain_1.validateExplainTimeoutOptions)(options, explain_1.Explain.fromOptions(options)); + } catch { + throw new error_1.MongoAPIError("timeoutMS cannot be used with explain when explain is specified in findOptions"); + } + } + const findOperation = new find_1.FindOperation(this.namespace, this.cursorFilter, options); + const response = await (0, execute_operation_1.executeOperation)(this.client, findOperation, this.timeoutContext); + this.numReturned = response.batchSize; + return { server: findOperation.server, session, response }; + } + /** @internal */ + async getMore(batchSize) { + const numReturned = this.numReturned; + if (numReturned) { + const limit = this.findOptions.limit; + batchSize = limit && limit > 0 && numReturned + batchSize > limit ? limit - numReturned : batchSize; + if (batchSize <= 0) { + try { + await this.close(); + } catch (error2) { + (0, utils_1.squashError)(error2); + } + return responses_1.CursorResponse.emptyGetMore; + } + } + const response = await super.getMore(batchSize); + this.numReturned = this.numReturned + response.batchSize; + return response; + } + /** + * Get the count of documents for this cursor + * @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead + */ + async count(options) { + (0, utils_1.emitWarningOnce)("cursor.count is deprecated and will be removed in the next major version, please use `collection.estimatedDocumentCount` or `collection.countDocuments` instead "); + if (typeof options === "boolean") { + throw new error_1.MongoInvalidArgumentError("Invalid first parameter to count"); + } + return await (0, execute_operation_1.executeOperation)(this.client, new count_1.CountOperation(this.namespace, this.cursorFilter, { + ...this.findOptions, + // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + ...options + })); + } + async explain(verbosity, options) { + const { explain, timeout } = this.resolveExplainTimeoutOptions(verbosity, options); + return (await (0, execute_operation_1.executeOperation)(this.client, new find_1.FindOperation(this.namespace, this.cursorFilter, { + ...this.findOptions, + // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + ...timeout, + explain: explain ?? true + }))).shift(this.deserializationOptions); + } + /** Set the cursor query */ + filter(filter) { + this.throwIfInitialized(); + this.cursorFilter = filter; + return this; + } + /** + * Set the cursor hint + * + * @param hint - If specified, then the query system will only consider plans using the hinted index. + */ + hint(hint) { + this.throwIfInitialized(); + this.findOptions.hint = hint; + return this; + } + /** + * Set the cursor min + * + * @param min - Specify a $min value to specify the inclusive lower bound for a specific index in order to constrain the results of find(). The $min specifies the lower bound for all keys of a specific index in order. + */ + min(min) { + this.throwIfInitialized(); + this.findOptions.min = min; + return this; + } + /** + * Set the cursor max + * + * @param max - Specify a $max value to specify the exclusive upper bound for a specific index in order to constrain the results of find(). The $max specifies the upper bound for all keys of a specific index in order. + */ + max(max) { + this.throwIfInitialized(); + this.findOptions.max = max; + return this; + } + /** + * Set the cursor returnKey. + * If set to true, modifies the cursor to only return the index field or fields for the results of the query, rather than documents. + * If set to true and the query does not use an index to perform the read operation, the returned documents will not contain any fields. + * + * @param value - the returnKey value. + */ + returnKey(value) { + this.throwIfInitialized(); + this.findOptions.returnKey = value; + return this; + } + /** + * Modifies the output of a query by adding a field $recordId to matching documents. $recordId is the internal key which uniquely identifies a document in a collection. + * + * @param value - The $showDiskLoc option has now been deprecated and replaced with the showRecordId field. $showDiskLoc will still be accepted for OP_QUERY stye find. + */ + showRecordId(value) { + this.throwIfInitialized(); + this.findOptions.showRecordId = value; + return this; + } + /** + * Add a query modifier to the cursor query + * + * @param name - The query modifier (must start with $, such as $orderby etc) + * @param value - The modifier value. + */ + addQueryModifier(name, value) { + this.throwIfInitialized(); + if (name[0] !== "$") { + throw new error_1.MongoInvalidArgumentError(`${name} is not a valid query modifier`); + } + const field = name.substr(1); + switch (field) { + case "comment": + this.findOptions.comment = value; + break; + case "explain": + this.findOptions.explain = value; + break; + case "hint": + this.findOptions.hint = value; + break; + case "max": + this.findOptions.max = value; + break; + case "maxTimeMS": + this.findOptions.maxTimeMS = value; + break; + case "min": + this.findOptions.min = value; + break; + case "orderby": + this.findOptions.sort = (0, sort_1.formatSort)(value); + break; + case "query": + this.cursorFilter = value; + break; + case "returnKey": + this.findOptions.returnKey = value; + break; + case "showDiskLoc": + this.findOptions.showRecordId = value; + break; + default: + throw new error_1.MongoInvalidArgumentError(`Invalid query modifier: ${name}`); + } + return this; + } + /** + * Add a comment to the cursor query allowing for tracking the comment in the log. + * + * @param value - The comment attached to this query. + */ + comment(value) { + this.throwIfInitialized(); + this.findOptions.comment = value; + return this; + } + /** + * Set a maxAwaitTimeMS on a tailing cursor query to allow to customize the timeout value for the option awaitData (Only supported on MongoDB 3.2 or higher, ignored otherwise) + * + * @param value - Number of milliseconds to wait before aborting the tailed query. + */ + maxAwaitTimeMS(value) { + this.throwIfInitialized(); + if (typeof value !== "number") { + throw new error_1.MongoInvalidArgumentError("Argument for maxAwaitTimeMS must be a number"); + } + this.findOptions.maxAwaitTimeMS = value; + return this; + } + /** + * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher) + * + * @param value - Number of milliseconds to wait before aborting the query. + */ + maxTimeMS(value) { + this.throwIfInitialized(); + if (typeof value !== "number") { + throw new error_1.MongoInvalidArgumentError("Argument for maxTimeMS must be a number"); + } + this.findOptions.maxTimeMS = value; + return this; + } + /** + * Add a project stage to the aggregation pipeline + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * By default chaining a projection to your cursor changes the returned type to the generic + * {@link Document} type. + * You should specify a parameterized type to have assertions on your final results. + * + * @example + * ```typescript + * // Best way + * const docs: FindCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true }); + * // Flexible way + * const docs: FindCursor = cursor.project({ _id: 0, a: true }); + * ``` + * + * @remarks + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling project, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: FindCursor<{ a: number; b: string }> = coll.find(); + * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true }); + * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray(); + * + * // or always use chaining and save the final cursor + * + * const cursor = coll.find().project<{ a: string }>({ + * _id: 0, + * a: { $convert: { input: '$a', to: 'string' } + * }}); + * ``` + */ + project(value) { + this.throwIfInitialized(); + this.findOptions.projection = value; + return this; + } + /** + * Sets the sort order of the cursor query. + * + * @param sort - The key or keys set for the sort. + * @param direction - The direction of the sorting (1 or -1). + */ + sort(sort, direction) { + this.throwIfInitialized(); + if (this.findOptions.tailable) { + throw new error_1.MongoTailableCursorError("Tailable cursor does not support sorting"); + } + this.findOptions.sort = (0, sort_1.formatSort)(sort, direction); + return this; + } + /** + * Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher) + * + * @remarks + * {@link https://www.mongodb.com/docs/manual/reference/command/find/#find-cmd-allowdiskuse | find command allowDiskUse documentation} + */ + allowDiskUse(allow = true) { + this.throwIfInitialized(); + if (!this.findOptions.sort) { + throw new error_1.MongoInvalidArgumentError('Option "allowDiskUse" requires a sort specification'); + } + if (!allow) { + this.findOptions.allowDiskUse = false; + return this; + } + this.findOptions.allowDiskUse = true; + return this; + } + /** + * Set the collation options for the cursor. + * + * @param value - The cursor collation options (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). + */ + collation(value) { + this.throwIfInitialized(); + this.findOptions.collation = value; + return this; + } + /** + * Set the limit for the cursor. + * + * @param value - The limit for the cursor query. + */ + limit(value) { + this.throwIfInitialized(); + if (this.findOptions.tailable) { + throw new error_1.MongoTailableCursorError("Tailable cursor does not support limit"); + } + if (typeof value !== "number") { + throw new error_1.MongoInvalidArgumentError('Operation "limit" requires an integer'); + } + this.findOptions.limit = value; + return this; + } + /** + * Set the skip for the cursor. + * + * @param value - The skip for the cursor query. + */ + skip(value) { + this.throwIfInitialized(); + if (this.findOptions.tailable) { + throw new error_1.MongoTailableCursorError("Tailable cursor does not support skip"); + } + if (typeof value !== "number") { + throw new error_1.MongoInvalidArgumentError('Operation "skip" requires an integer'); + } + this.findOptions.skip = value; + return this; + } + }; + exports2.FindCursor = FindCursor; + } +}); + +// node_modules/mongodb/lib/cursor/list_indexes_cursor.js +var require_list_indexes_cursor = __commonJS({ + "node_modules/mongodb/lib/cursor/list_indexes_cursor.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ListIndexesCursor = void 0; + var execute_operation_1 = require_execute_operation(); + var indexes_1 = require_indexes(); + var abstract_cursor_1 = require_abstract_cursor(); + var ListIndexesCursor = class _ListIndexesCursor extends abstract_cursor_1.AbstractCursor { + constructor(collection, options) { + super(collection.client, collection.s.namespace, options); + this.parent = collection; + this.options = options; + } + clone() { + return new _ListIndexesCursor(this.parent, { + ...this.options, + ...this.cursorOptions + }); + } + /** @internal */ + async _initialize(session) { + const operation2 = new indexes_1.ListIndexesOperation(this.parent, { + ...this.cursorOptions, + ...this.options, + session + }); + const response = await (0, execute_operation_1.executeOperation)(this.parent.client, operation2, this.timeoutContext); + return { server: operation2.server, session, response }; + } + }; + exports2.ListIndexesCursor = ListIndexesCursor; + } +}); + +// node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js +var require_list_search_indexes_cursor = __commonJS({ + "node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ListSearchIndexesCursor = void 0; + var aggregation_cursor_1 = require_aggregation_cursor(); + var ListSearchIndexesCursor = class extends aggregation_cursor_1.AggregationCursor { + /** @internal */ + constructor({ fullNamespace: ns, client }, name, options = {}) { + const pipeline = name == null ? [{ $listSearchIndexes: {} }] : [{ $listSearchIndexes: { name } }]; + super(client, ns, pipeline, options); + } + }; + exports2.ListSearchIndexesCursor = ListSearchIndexesCursor; + } +}); + +// node_modules/mongodb/lib/operations/distinct.js +var require_distinct = __commonJS({ + "node_modules/mongodb/lib/operations/distinct.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DistinctOperation = void 0; + var responses_1 = require_responses(); + var command_1 = require_command(); + var operation_1 = require_operation(); + var DistinctOperation = class extends command_1.CommandOperation { + /** + * Construct a Distinct operation. + * + * @param collection - Collection instance. + * @param key - Field of the document to find distinct values for. + * @param query - The query for filtering the set of documents to which we apply the distinct filter. + * @param options - Optional settings. See Collection.prototype.distinct for a list of options. + */ + constructor(collection, key, query, options) { + super(collection, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options ?? {}; + this.collection = collection; + this.key = key; + this.query = query; + } + get commandName() { + return "distinct"; + } + buildCommandDocument(_connection) { + const command = { + distinct: this.collection.collectionName, + key: this.key, + query: this.query + }; + if (this.options.comment !== void 0) { + command.comment = this.options.comment; + } + if (this.options.hint != null) { + command.hint = this.options.hint; + } + return command; + } + handleOk(response) { + if (this.explain) { + return response.toObject(this.bsonOptions); + } + return response.toObject(this.bsonOptions).values; + } + }; + exports2.DistinctOperation = DistinctOperation; + (0, operation_1.defineAspects)(DistinctOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + } +}); + +// node_modules/mongodb/lib/operations/estimated_document_count.js +var require_estimated_document_count = __commonJS({ + "node_modules/mongodb/lib/operations/estimated_document_count.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.EstimatedDocumentCountOperation = void 0; + var responses_1 = require_responses(); + var command_1 = require_command(); + var operation_1 = require_operation(); + var EstimatedDocumentCountOperation = class extends command_1.CommandOperation { + constructor(collection, options = {}) { + super(collection, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.collectionName = collection.collectionName; + } + get commandName() { + return "count"; + } + buildCommandDocument(_connection, _session) { + const cmd = { count: this.collectionName }; + if (typeof this.options.maxTimeMS === "number") { + cmd.maxTimeMS = this.options.maxTimeMS; + } + if (this.options.comment !== void 0) { + cmd.comment = this.options.comment; + } + return cmd; + } + handleOk(response) { + return response.getNumber("n") ?? 0; + } + }; + exports2.EstimatedDocumentCountOperation = EstimatedDocumentCountOperation; + (0, operation_1.defineAspects)(EstimatedDocumentCountOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.CURSOR_CREATING, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + } +}); + +// node_modules/mongodb/lib/operations/find_and_modify.js +var require_find_and_modify = __commonJS({ + "node_modules/mongodb/lib/operations/find_and_modify.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.FindOneAndUpdateOperation = exports2.FindOneAndReplaceOperation = exports2.FindOneAndDeleteOperation = exports2.FindAndModifyOperation = exports2.ReturnDocument = void 0; + var responses_1 = require_responses(); + var error_1 = require_error(); + var read_preference_1 = require_read_preference(); + var sort_1 = require_sort(); + var utils_1 = require_utils3(); + var command_1 = require_command(); + var operation_1 = require_operation(); + exports2.ReturnDocument = Object.freeze({ + BEFORE: "before", + AFTER: "after" + }); + function configureFindAndModifyCmdBaseUpdateOpts(cmdBase, options) { + cmdBase.new = options.returnDocument === exports2.ReturnDocument.AFTER; + cmdBase.upsert = options.upsert === true; + if (options.bypassDocumentValidation === true) { + cmdBase.bypassDocumentValidation = options.bypassDocumentValidation; + } + return cmdBase; + } + var FindAndModifyOperation = class extends command_1.CommandOperation { + constructor(collection, query, options) { + super(collection, options); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.options = options; + this.readPreference = read_preference_1.ReadPreference.primary; + this.collection = collection; + this.query = query; + } + get commandName() { + return "findAndModify"; + } + buildCommandDocument(connection, _session) { + const options = this.options; + const command = { + findAndModify: this.collection.collectionName, + query: this.query, + remove: false, + new: false, + upsert: false + }; + options.includeResultMetadata ??= false; + const sort = (0, sort_1.formatSort)(options.sort); + if (sort) { + command.sort = sort; + } + if (options.projection) { + command.fields = options.projection; + } + if (options.maxTimeMS) { + command.maxTimeMS = options.maxTimeMS; + } + if (options.writeConcern) { + command.writeConcern = options.writeConcern; + } + if (options.let) { + command.let = options.let; + } + if (options.comment !== void 0) { + command.comment = options.comment; + } + (0, utils_1.decorateWithCollation)(command, options); + if (options.hint) { + const unacknowledgedWrite = this.writeConcern?.w === 0; + if (unacknowledgedWrite && (0, utils_1.maxWireVersion)(connection) < 9) { + throw new error_1.MongoCompatibilityError("hint for the findAndModify command is only supported on MongoDB 4.4+"); + } + command.hint = options.hint; + } + return command; + } + handleOk(response) { + const result = super.handleOk(response); + return this.options.includeResultMetadata ? result : result.value ?? null; + } + }; + exports2.FindAndModifyOperation = FindAndModifyOperation; + var FindOneAndDeleteOperation = class extends FindAndModifyOperation { + constructor(collection, filter, options) { + if (filter == null || typeof filter !== "object") { + throw new error_1.MongoInvalidArgumentError('Argument "filter" must be an object'); + } + super(collection, filter, options); + } + buildCommandDocument(connection, session) { + const document2 = super.buildCommandDocument(connection, session); + document2.remove = true; + return document2; + } + }; + exports2.FindOneAndDeleteOperation = FindOneAndDeleteOperation; + var FindOneAndReplaceOperation = class extends FindAndModifyOperation { + constructor(collection, filter, replacement, options) { + if (filter == null || typeof filter !== "object") { + throw new error_1.MongoInvalidArgumentError('Argument "filter" must be an object'); + } + if (replacement == null || typeof replacement !== "object") { + throw new error_1.MongoInvalidArgumentError('Argument "replacement" must be an object'); + } + if ((0, utils_1.hasAtomicOperators)(replacement)) { + throw new error_1.MongoInvalidArgumentError("Replacement document must not contain atomic operators"); + } + super(collection, filter, options); + this.replacement = replacement; + } + buildCommandDocument(connection, session) { + const document2 = super.buildCommandDocument(connection, session); + document2.update = this.replacement; + configureFindAndModifyCmdBaseUpdateOpts(document2, this.options); + return document2; + } + }; + exports2.FindOneAndReplaceOperation = FindOneAndReplaceOperation; + var FindOneAndUpdateOperation = class extends FindAndModifyOperation { + constructor(collection, filter, update, options) { + if (filter == null || typeof filter !== "object") { + throw new error_1.MongoInvalidArgumentError('Argument "filter" must be an object'); + } + if (update == null || typeof update !== "object") { + throw new error_1.MongoInvalidArgumentError('Argument "update" must be an object'); + } + if (!(0, utils_1.hasAtomicOperators)(update, options)) { + throw new error_1.MongoInvalidArgumentError("Update document requires atomic operators"); + } + super(collection, filter, options); + this.update = update; + this.options = options; + } + buildCommandDocument(connection, session) { + const document2 = super.buildCommandDocument(connection, session); + document2.update = this.update; + configureFindAndModifyCmdBaseUpdateOpts(document2, this.options); + if (this.options.arrayFilters) { + document2.arrayFilters = this.options.arrayFilters; + } + return document2; + } + }; + exports2.FindOneAndUpdateOperation = FindOneAndUpdateOperation; + (0, operation_1.defineAspects)(FindAndModifyOperation, [ + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SUPPORTS_RAW_DATA + ]); + } +}); + +// node_modules/mongodb/lib/operations/search_indexes/create.js +var require_create = __commonJS({ + "node_modules/mongodb/lib/operations/search_indexes/create.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.CreateSearchIndexesOperation = void 0; + var responses_1 = require_responses(); + var operation_1 = require_operation(); + var CreateSearchIndexesOperation = class extends operation_1.AbstractOperation { + constructor(collection, descriptions) { + super(); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.collection = collection; + this.descriptions = descriptions; + this.ns = collection.fullNamespace; + } + get commandName() { + return "createSearchIndexes"; + } + buildCommand(_connection, _session) { + const namespace = this.collection.fullNamespace; + return { + createSearchIndexes: namespace.collection, + indexes: this.descriptions + }; + } + handleOk(response) { + return super.handleOk(response).indexesCreated.map((val) => val.name); + } + buildOptions(timeoutContext) { + return { session: this.session, timeoutContext }; + } + }; + exports2.CreateSearchIndexesOperation = CreateSearchIndexesOperation; + } +}); + +// node_modules/mongodb/lib/operations/search_indexes/drop.js +var require_drop2 = __commonJS({ + "node_modules/mongodb/lib/operations/search_indexes/drop.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DropSearchIndexOperation = void 0; + var responses_1 = require_responses(); + var error_1 = require_error(); + var operation_1 = require_operation(); + var DropSearchIndexOperation = class extends operation_1.AbstractOperation { + constructor(collection, name) { + super(); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.collection = collection; + this.name = name; + this.ns = collection.fullNamespace; + } + get commandName() { + return "dropSearchIndex"; + } + buildCommand(_connection, _session) { + const namespace = this.collection.fullNamespace; + const command = { + dropSearchIndex: namespace.collection + }; + if (typeof this.name === "string") { + command.name = this.name; + } + return command; + } + handleOk(_response) { + } + buildOptions(timeoutContext) { + return { session: this.session, timeoutContext }; + } + handleError(error2) { + const isNamespaceNotFoundError = error2 instanceof error_1.MongoServerError && error2.code === error_1.MONGODB_ERROR_CODES.NamespaceNotFound; + if (!isNamespaceNotFoundError) { + throw error2; + } + } + }; + exports2.DropSearchIndexOperation = DropSearchIndexOperation; + } +}); + +// node_modules/mongodb/lib/operations/search_indexes/update.js +var require_update2 = __commonJS({ + "node_modules/mongodb/lib/operations/search_indexes/update.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.UpdateSearchIndexOperation = void 0; + var responses_1 = require_responses(); + var operation_1 = require_operation(); + var UpdateSearchIndexOperation = class extends operation_1.AbstractOperation { + constructor(collection, name, definition) { + super(); + this.SERVER_COMMAND_RESPONSE_TYPE = responses_1.MongoDBResponse; + this.collection = collection; + this.name = name; + this.definition = definition; + this.ns = collection.fullNamespace; + } + get commandName() { + return "updateSearchIndex"; + } + buildCommand(_connection, _session) { + const namespace = this.collection.fullNamespace; + return { + updateSearchIndex: namespace.collection, + name: this.name, + definition: this.definition + }; + } + handleOk(_response) { + } + buildOptions(timeoutContext) { + return { session: this.session, timeoutContext }; + } + }; + exports2.UpdateSearchIndexOperation = UpdateSearchIndexOperation; + } +}); + +// node_modules/mongodb/lib/collection.js +var require_collection2 = __commonJS({ + "node_modules/mongodb/lib/collection.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Collection = void 0; + var bson_1 = require_bson2(); + var ordered_1 = require_ordered(); + var unordered_1 = require_unordered(); + var change_stream_1 = require_change_stream(); + var aggregation_cursor_1 = require_aggregation_cursor(); + var find_cursor_1 = require_find_cursor(); + var list_indexes_cursor_1 = require_list_indexes_cursor(); + var list_search_indexes_cursor_1 = require_list_search_indexes_cursor(); + var error_1 = require_error(); + var count_1 = require_count(); + var delete_1 = require_delete(); + var distinct_1 = require_distinct(); + var estimated_document_count_1 = require_estimated_document_count(); + var execute_operation_1 = require_execute_operation(); + var find_and_modify_1 = require_find_and_modify(); + var indexes_1 = require_indexes(); + var insert_1 = require_insert(); + var rename_1 = require_rename(); + var create_1 = require_create(); + var drop_1 = require_drop2(); + var update_1 = require_update2(); + var update_2 = require_update(); + var read_concern_1 = require_read_concern(); + var read_preference_1 = require_read_preference(); + var utils_1 = require_utils3(); + var write_concern_1 = require_write_concern(); + var Collection = class { + /** + * Create a new Collection instance + * @internal + */ + constructor(db, name, options) { + this.db = db; + this.s = { + db, + options, + namespace: new utils_1.MongoDBCollectionNamespace(db.databaseName, name), + pkFactory: db.options?.pkFactory ?? utils_1.DEFAULT_PK_FACTORY, + readPreference: read_preference_1.ReadPreference.fromOptions(options), + bsonOptions: (0, bson_1.resolveBSONOptions)(options, db), + readConcern: read_concern_1.ReadConcern.fromOptions(options), + writeConcern: write_concern_1.WriteConcern.fromOptions(options) + }; + this.client = db.client; + } + /** + * The name of the database this collection belongs to + */ + get dbName() { + return this.s.namespace.db; + } + /** + * The name of this collection + */ + get collectionName() { + return this.s.namespace.collection; + } + /** + * The namespace of this collection, in the format `${this.dbName}.${this.collectionName}` + */ + get namespace() { + return this.fullNamespace.toString(); + } + /** + * @internal + * + * The `MongoDBNamespace` for the collection. + */ + get fullNamespace() { + return this.s.namespace; + } + /** + * The current readConcern of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get readConcern() { + if (this.s.readConcern == null) { + return this.db.readConcern; + } + return this.s.readConcern; + } + /** + * The current readPreference of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get readPreference() { + if (this.s.readPreference == null) { + return this.db.readPreference; + } + return this.s.readPreference; + } + get bsonOptions() { + return this.s.bsonOptions; + } + /** + * The current writeConcern of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get writeConcern() { + if (this.s.writeConcern == null) { + return this.db.writeConcern; + } + return this.s.writeConcern; + } + /** The current index hint for the collection */ + get hint() { + return this.s.collectionHint; + } + set hint(v4) { + this.s.collectionHint = (0, utils_1.normalizeHintField)(v4); + } + get timeoutMS() { + return this.s.options.timeoutMS; + } + /** + * Inserts a single document into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param doc - The document to insert + * @param options - Optional settings for the command + */ + async insertOne(doc, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new insert_1.InsertOneOperation(this, doc, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Inserts an array of documents into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param docs - The documents to insert + * @param options - Optional settings for the command + */ + async insertMany(docs, options) { + if (!Array.isArray(docs)) { + throw new error_1.MongoInvalidArgumentError('Argument "docs" must be an array of documents'); + } + options = (0, utils_1.resolveOptions)(this, options ?? {}); + const acknowledged = write_concern_1.WriteConcern.fromOptions(options)?.w !== 0; + try { + const res = await this.bulkWrite(docs.map((doc) => ({ insertOne: { document: doc } })), options); + return { + acknowledged, + insertedCount: res.insertedCount, + insertedIds: res.insertedIds + }; + } catch (err) { + if (err && err.message === "Operation must be an object with an operation key") { + throw new error_1.MongoInvalidArgumentError("Collection.insertMany() cannot be called with an array that has null/undefined values"); + } + throw err; + } + } + /** + * Perform a bulkWrite operation without a fluent API + * + * Legal operation types are + * - `insertOne` + * - `replaceOne` + * - `updateOne` + * - `updateMany` + * - `deleteOne` + * - `deleteMany` + * + * If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param operations - Bulk operations to perform + * @param options - Optional settings for the command + * @throws MongoDriverError if operations is not an array + */ + async bulkWrite(operations, options) { + if (!Array.isArray(operations)) { + throw new error_1.MongoInvalidArgumentError('Argument "operations" must be an array of documents'); + } + options = (0, utils_1.resolveOptions)(this, options ?? {}); + const isConnected = this.client.topology != null; + if (!isConnected) { + await (0, execute_operation_1.autoConnect)(this.client); + } + const bulk = options.ordered === false ? this.initializeUnorderedBulkOp(options) : this.initializeOrderedBulkOp(options); + for (const operation2 of operations) { + bulk.raw(operation2); + } + return await bulk.execute({ ...options }); + } + /** + * Update a single document in a collection + * + * The value of `update` can be either: + * - UpdateFilter - A document that contains update operator expressions, + * - Document[] - an aggregation pipeline. + * + * @param filter - The filter used to select the document to update + * @param update - The modifications to apply + * @param options - Optional settings for the command + */ + async updateOne(filter, update, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new update_2.UpdateOneOperation(this.s.namespace, filter, update, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Replace a document in a collection with another document + * + * @param filter - The filter used to select the document to replace + * @param replacement - The Document that replaces the matching document + * @param options - Optional settings for the command + */ + async replaceOne(filter, replacement, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new update_2.ReplaceOneOperation(this.s.namespace, filter, replacement, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Update multiple documents in a collection + * + * The value of `update` can be either: + * - UpdateFilter - A document that contains update operator expressions, + * - Document[] - an aggregation pipeline. + * + * @param filter - The filter used to select the document to update + * @param update - The modifications to apply + * @param options - Optional settings for the command + */ + async updateMany(filter, update, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new update_2.UpdateManyOperation(this.s.namespace, filter, update, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Delete a document from a collection + * + * @param filter - The filter used to select the document to remove + * @param options - Optional settings for the command + */ + async deleteOne(filter = {}, options = {}) { + return await (0, execute_operation_1.executeOperation)(this.client, new delete_1.DeleteOneOperation(this.s.namespace, filter, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Delete multiple documents from a collection + * + * @param filter - The filter used to select the documents to remove + * @param options - Optional settings for the command + */ + async deleteMany(filter = {}, options = {}) { + return await (0, execute_operation_1.executeOperation)(this.client, new delete_1.DeleteManyOperation(this.s.namespace, filter, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Rename the collection. + * + * @remarks + * This operation does not inherit options from the Db or MongoClient. + * + * @param newName - New name of of the collection. + * @param options - Optional settings for the command + */ + async rename(newName, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new rename_1.RenameOperation(this, newName, (0, utils_1.resolveOptions)(void 0, { + ...options, + readPreference: read_preference_1.ReadPreference.PRIMARY + }))); + } + /** + * Drop the collection from the database, removing it permanently. New accesses will create a new collection. + * + * @param options - Optional settings for the command + */ + async drop(options) { + return await this.db.dropCollection(this.collectionName, options); + } + async findOne(filter = {}, options = {}) { + const { batchSize: _batchSize, noCursorTimeout: _noCursorTimeout, ...opts } = options; + opts.singleBatch = true; + const cursor2 = this.find(filter, opts).limit(1); + const result = await cursor2.next(); + await cursor2.close(); + return result; + } + find(filter = {}, options = {}) { + return new find_cursor_1.FindCursor(this.client, this.s.namespace, filter, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Returns the options of the collection. + * + * @param options - Optional settings for the command + */ + async options(options) { + options = (0, utils_1.resolveOptions)(this, options); + const [collection] = await this.db.listCollections({ name: this.collectionName }, { ...options, nameOnly: false }).toArray(); + if (collection == null || collection.options == null) { + throw new error_1.MongoAPIError(`collection ${this.namespace} not found`); + } + return collection.options; + } + /** + * Returns if the collection is a capped collection + * + * @param options - Optional settings for the command + */ + async isCapped(options) { + const { capped } = await this.options(options); + return Boolean(capped); + } + /** + * Creates an index on the db and collection collection. + * + * @param indexSpec - The field name or index specification to create an index for + * @param options - Optional settings for the command + * + * @example + * ```ts + * const collection = client.db('foo').collection('bar'); + * + * await collection.createIndex({ a: 1, b: -1 }); + * + * // Alternate syntax for { c: 1, d: -1 } that ensures order of indexes + * await collection.createIndex([ [c, 1], [d, -1] ]); + * + * // Equivalent to { e: 1 } + * await collection.createIndex('e'); + * + * // Equivalent to { f: 1, g: 1 } + * await collection.createIndex(['f', 'g']) + * + * // Equivalent to { h: 1, i: -1 } + * await collection.createIndex([ { h: 1 }, { i: -1 } ]); + * + * // Equivalent to { j: 1, k: -1, l: 2d } + * await collection.createIndex(['j', ['k', -1], { l: '2d' }]) + * ``` + */ + async createIndex(indexSpec, options) { + const indexes = await (0, execute_operation_1.executeOperation)(this.client, indexes_1.CreateIndexesOperation.fromIndexSpecification(this, this.collectionName, indexSpec, (0, utils_1.resolveOptions)(this, options))); + return indexes[0]; + } + /** + * Creates multiple indexes in the collection, this method is only supported for + * MongoDB 2.6 or higher. Earlier version of MongoDB will throw a command not supported + * error. + * + * **Note**: Unlike {@link Collection#createIndex| createIndex}, this function takes in raw index specifications. + * Index specifications are defined {@link https://www.mongodb.com/docs/manual/reference/command/createIndexes/| here}. + * + * @param indexSpecs - An array of index specifications to be created + * @param options - Optional settings for the command + * + * @example + * ```ts + * const collection = client.db('foo').collection('bar'); + * await collection.createIndexes([ + * // Simple index on field fizz + * { + * key: { fizz: 1 }, + * } + * // wildcard index + * { + * key: { '$**': 1 } + * }, + * // named index on darmok and jalad + * { + * key: { darmok: 1, jalad: -1 } + * name: 'tanagra' + * } + * ]); + * ``` + */ + async createIndexes(indexSpecs, options) { + return await (0, execute_operation_1.executeOperation)(this.client, indexes_1.CreateIndexesOperation.fromIndexDescriptionArray(this, this.collectionName, indexSpecs, (0, utils_1.resolveOptions)(this, { ...options, maxTimeMS: void 0 }))); + } + /** + * Drops an index from this collection. + * + * @param indexName - Name of the index to drop. + * @param options - Optional settings for the command + */ + async dropIndex(indexName, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new indexes_1.DropIndexOperation(this, indexName, { + ...(0, utils_1.resolveOptions)(this, options), + readPreference: read_preference_1.ReadPreference.primary + })); + } + /** + * Drops all indexes from this collection. + * + * @param options - Optional settings for the command + */ + async dropIndexes(options) { + try { + await (0, execute_operation_1.executeOperation)(this.client, new indexes_1.DropIndexOperation(this, "*", (0, utils_1.resolveOptions)(this, options))); + return true; + } catch (error2) { + if (error2 instanceof error_1.MongoOperationTimeoutError) + throw error2; + return false; + } + } + /** + * Get the list of all indexes information for the collection. + * + * @param options - Optional settings for the command + */ + listIndexes(options) { + return new list_indexes_cursor_1.ListIndexesCursor(this, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Checks if one or more indexes exist on the collection, fails on first non-existing index + * + * @param indexes - One or more index names to check. + * @param options - Optional settings for the command + */ + async indexExists(indexes, options) { + const indexNames = Array.isArray(indexes) ? indexes : [indexes]; + const allIndexes = new Set(await this.listIndexes(options).map(({ name }) => name).toArray()); + return indexNames.every((name) => allIndexes.has(name)); + } + async indexInformation(options) { + return await this.indexes({ + ...options, + full: options?.full ?? false + }); + } + /** + * Gets an estimate of the count of documents in a collection using collection metadata. + * This will always run a count command on all server versions. + * + * due to an oversight in versions 5.0.0-5.0.8 of MongoDB, the count command, + * which estimatedDocumentCount uses in its implementation, was not included in v1 of + * the Stable API, and so users of the Stable API with estimatedDocumentCount are + * recommended to upgrade their server version to 5.0.9+ or set apiStrict: false to avoid + * encountering errors. + * + * @see {@link https://www.mongodb.com/docs/manual/reference/command/count/#behavior|Count: Behavior} + * @param options - Optional settings for the command + */ + async estimatedDocumentCount(options) { + return await (0, execute_operation_1.executeOperation)(this.client, new estimated_document_count_1.EstimatedDocumentCountOperation(this, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Gets the number of documents matching the filter. + * For a fast count of the total documents in a collection see {@link Collection#estimatedDocumentCount| estimatedDocumentCount}. + * + * Due to countDocuments using the $match aggregation pipeline stage, certain query operators cannot be used in countDocuments. This includes the $where and $near query operators, among others. Details can be found in the documentation for the $match aggregation pipeline stage. + * + * **Note**: When migrating from {@link Collection#count| count} to {@link Collection#countDocuments| countDocuments} + * the following query operators must be replaced: + * + * | Operator | Replacement | + * | -------- | ----------- | + * | `$where` | [`$expr`][1] | + * | `$near` | [`$geoWithin`][2] with [`$center`][3] | + * | `$nearSphere` | [`$geoWithin`][2] with [`$centerSphere`][4] | + * + * [1]: https://www.mongodb.com/docs/manual/reference/operator/query/expr/ + * [2]: https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/ + * [3]: https://www.mongodb.com/docs/manual/reference/operator/query/center/#op._S_center + * [4]: https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/#op._S_centerSphere + * + * @param filter - The filter for the count + * @param options - Optional settings for the command + * + * @see https://www.mongodb.com/docs/manual/reference/operator/query/expr/ + * @see https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/ + * @see https://www.mongodb.com/docs/manual/reference/operator/query/center/#op._S_center + * @see https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/#op._S_centerSphere + */ + async countDocuments(filter = {}, options = {}) { + const pipeline = []; + pipeline.push({ $match: filter }); + if (typeof options.skip === "number") { + pipeline.push({ $skip: options.skip }); + } + if (typeof options.limit === "number") { + pipeline.push({ $limit: options.limit }); + } + pipeline.push({ $group: { _id: 1, n: { $sum: 1 } } }); + const cursor2 = this.aggregate(pipeline, options); + const doc = await cursor2.next(); + await cursor2.close(); + return doc?.n ?? 0; + } + async distinct(key, filter = {}, options = {}) { + return await (0, execute_operation_1.executeOperation)(this.client, new distinct_1.DistinctOperation(this, key, filter, (0, utils_1.resolveOptions)(this, options))); + } + async indexes(options) { + const indexes = await this.listIndexes(options).toArray(); + const full = options?.full ?? true; + if (full) { + return indexes; + } + const object = Object.fromEntries(indexes.map(({ name, key }) => [name, Object.entries(key)])); + return object; + } + async findOneAndDelete(filter, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new find_and_modify_1.FindOneAndDeleteOperation(this, filter, (0, utils_1.resolveOptions)(this, options))); + } + async findOneAndReplace(filter, replacement, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new find_and_modify_1.FindOneAndReplaceOperation(this, filter, replacement, (0, utils_1.resolveOptions)(this, options))); + } + async findOneAndUpdate(filter, update, options) { + return await (0, execute_operation_1.executeOperation)(this.client, new find_and_modify_1.FindOneAndUpdateOperation(this, filter, update, (0, utils_1.resolveOptions)(this, options))); + } + /** + * Execute an aggregation framework pipeline against the collection, needs MongoDB \>= 2.2 + * + * @param pipeline - An array of aggregation pipelines to execute + * @param options - Optional settings for the command + */ + aggregate(pipeline = [], options) { + if (!Array.isArray(pipeline)) { + throw new error_1.MongoInvalidArgumentError('Argument "pipeline" must be an array of aggregation stages'); + } + return new aggregation_cursor_1.AggregationCursor(this.client, this.s.namespace, pipeline, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Create a new Change Stream, watching for new changes (insertions, updates, replacements, deletions, and invalidations) in this collection. + * + * @remarks + * watch() accepts two generic arguments for distinct use cases: + * - The first is to override the schema that may be defined for this specific collection + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * @example + * By just providing the first argument I can type the change to be `ChangeStreamDocument<{ _id: number }>` + * ```ts + * collection.watch<{ _id: number }>() + * .on('change', change => console.log(change._id.toFixed(4))); + * ``` + * + * @example + * Passing a second argument provides a way to reflect the type changes caused by an advanced pipeline. + * Here, we are using a pipeline to have MongoDB filter for insert changes only and add a comment. + * No need start from scratch on the ChangeStreamInsertDocument type! + * By using an intersection we can save time and ensure defaults remain the same type! + * ```ts + * collection + * .watch & { comment: string }>([ + * { $addFields: { comment: 'big changes' } }, + * { $match: { operationType: 'insert' } } + * ]) + * .on('change', change => { + * change.comment.startsWith('big'); + * change.operationType === 'insert'; + * // No need to narrow in code because the generics did that for us! + * expectType(change.fullDocument); + * }); + * ``` + * + * @remarks + * When `timeoutMS` is configured for a change stream, it will have different behaviour depending + * on whether the change stream is in iterator mode or emitter mode. In both cases, a change + * stream will time out if it does not receive a change event within `timeoutMS` of the last change + * event. + * + * Note that if a change stream is consistently timing out when watching a collection, database or + * client that is being changed, then this may be due to the server timing out before it can finish + * processing the existing oplog. To address this, restart the change stream with a higher + * `timeoutMS`. + * + * If the change stream times out the initial aggregate operation to establish the change stream on + * the server, then the client will close the change stream. If the getMore calls to the server + * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError + * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in + * emitter mode. + * + * To determine whether or not the change stream is still open following a timeout, check the + * {@link ChangeStream.closed} getter. + * + * @example + * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream. + * The next call can just be retried after this succeeds. + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * try { + * await changeStream.next(); + * } catch (e) { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * await changeStream.next(); + * } + * throw e; + * } + * ``` + * + * @example + * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will + * emit an error event that returns a MongoOperationTimeoutError, but will not close the change + * stream unless the resume attempt fails. There is no need to re-establish change listeners as + * this will automatically continue emitting change events once the resume attempt completes. + * + * ```ts + * const changeStream = collection.watch([], { timeoutMS: 100 }); + * changeStream.on('change', console.log); + * changeStream.on('error', e => { + * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) { + * // do nothing + * } else { + * changeStream.close(); + * } + * }); + * ``` + * + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TLocal - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch(pipeline = [], options = {}) { + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + return new change_stream_1.ChangeStream(this, pipeline, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Initiate an Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order. + * + * @throws MongoNotConnectedError + * @remarks + * **NOTE:** MongoClient must be connected prior to calling this method due to a known limitation in this legacy implementation. + * However, `collection.bulkWrite()` provides an equivalent API that does not require prior connecting. + */ + initializeUnorderedBulkOp(options) { + return new unordered_1.UnorderedBulkOperation(this, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Initiate an In order bulk write operation. Operations will be serially executed in the order they are added, creating a new operation for each switch in types. + * + * @throws MongoNotConnectedError + * @remarks + * **NOTE:** MongoClient must be connected prior to calling this method due to a known limitation in this legacy implementation. + * However, `collection.bulkWrite()` provides an equivalent API that does not require prior connecting. + */ + initializeOrderedBulkOp(options) { + return new ordered_1.OrderedBulkOperation(this, (0, utils_1.resolveOptions)(this, options)); + } + /** + * An estimated count of matching documents in the db to a filter. + * + * **NOTE:** This method has been deprecated, since it does not provide an accurate count of the documents + * in a collection. To obtain an accurate count of documents in the collection, use {@link Collection#countDocuments| countDocuments}. + * To obtain an estimated count of all documents in the collection, use {@link Collection#estimatedDocumentCount| estimatedDocumentCount}. + * + * @deprecated use {@link Collection#countDocuments| countDocuments} or {@link Collection#estimatedDocumentCount| estimatedDocumentCount} instead + * + * @param filter - The filter for the count. + * @param options - Optional settings for the command + */ + async count(filter = {}, options = {}) { + return await (0, execute_operation_1.executeOperation)(this.client, new count_1.CountOperation(this.fullNamespace, filter, (0, utils_1.resolveOptions)(this, options))); + } + listSearchIndexes(indexNameOrOptions, options) { + options = typeof indexNameOrOptions === "object" ? indexNameOrOptions : options == null ? {} : options; + const indexName = indexNameOrOptions == null ? null : typeof indexNameOrOptions === "object" ? null : indexNameOrOptions; + return new list_search_indexes_cursor_1.ListSearchIndexesCursor(this, indexName, options); + } + /** + * Creates a single search index for the collection. + * + * @param description - The index description for the new search index. + * @returns A promise that resolves to the name of the new search index. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + async createSearchIndex(description) { + const [index] = await this.createSearchIndexes([description]); + return index; + } + /** + * Creates multiple search indexes for the current collection. + * + * @param descriptions - An array of `SearchIndexDescription`s for the new search indexes. + * @returns A promise that resolves to an array of the newly created search index names. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + * @returns + */ + async createSearchIndexes(descriptions) { + return await (0, execute_operation_1.executeOperation)(this.client, new create_1.CreateSearchIndexesOperation(this, descriptions)); + } + /** + * Deletes a search index by index name. + * + * @param name - The name of the search index to be deleted. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + async dropSearchIndex(name) { + return await (0, execute_operation_1.executeOperation)(this.client, new drop_1.DropSearchIndexOperation(this, name)); + } + /** + * Updates a search index by replacing the existing index definition with the provided definition. + * + * @param name - The name of the search index to update. + * @param definition - The new search index definition. + * + * @remarks Only available when used against a 7.0+ Atlas cluster. + */ + async updateSearchIndex(name, definition) { + return await (0, execute_operation_1.executeOperation)(this.client, new update_1.UpdateSearchIndexOperation(this, name, definition)); + } + }; + exports2.Collection = Collection; + } +}); + +// node_modules/mongodb/lib/cursor/change_stream_cursor.js +var require_change_stream_cursor = __commonJS({ + "node_modules/mongodb/lib/cursor/change_stream_cursor.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ChangeStreamCursor = void 0; + var change_stream_1 = require_change_stream(); + var constants_1 = require_constants2(); + var aggregate_1 = require_aggregate(); + var execute_operation_1 = require_execute_operation(); + var utils_1 = require_utils3(); + var abstract_cursor_1 = require_abstract_cursor(); + var ChangeStreamCursor = class _ChangeStreamCursor extends abstract_cursor_1.AbstractCursor { + constructor(client, namespace, pipeline = [], options = {}) { + super(client, namespace, { ...options, tailable: true, awaitData: true }); + this.pipeline = pipeline; + this.changeStreamCursorOptions = options; + this._resumeToken = null; + this.startAtOperationTime = options.startAtOperationTime ?? null; + if (options.startAfter) { + this.resumeToken = options.startAfter; + } else if (options.resumeAfter) { + this.resumeToken = options.resumeAfter; + } + } + set resumeToken(token) { + this._resumeToken = token; + this.emit(change_stream_1.ChangeStream.RESUME_TOKEN_CHANGED, token); + } + get resumeToken() { + return this._resumeToken; + } + get resumeOptions() { + const options = { + ...this.changeStreamCursorOptions + }; + for (const key of ["resumeAfter", "startAfter", "startAtOperationTime"]) { + delete options[key]; + } + if (this.resumeToken != null) { + if (this.changeStreamCursorOptions.startAfter && !this.hasReceived) { + options.startAfter = this.resumeToken; + } else { + options.resumeAfter = this.resumeToken; + } + } else if (this.startAtOperationTime != null) { + options.startAtOperationTime = this.startAtOperationTime; + } + return options; + } + cacheResumeToken(resumeToken) { + if (this.bufferedCount() === 0 && this.postBatchResumeToken) { + this.resumeToken = this.postBatchResumeToken; + } else { + this.resumeToken = resumeToken; + } + this.hasReceived = true; + } + _processBatch(response) { + const { postBatchResumeToken } = response; + if (postBatchResumeToken) { + this.postBatchResumeToken = postBatchResumeToken; + if (response.batchSize === 0) { + this.resumeToken = postBatchResumeToken; + } + } + } + clone() { + return new _ChangeStreamCursor(this.client, this.namespace, this.pipeline, { + ...this.cursorOptions + }); + } + async _initialize(session) { + const aggregateOperation = new aggregate_1.AggregateOperation(this.namespace, this.pipeline, { + ...this.cursorOptions, + ...this.changeStreamCursorOptions, + session + }); + const response = await (0, execute_operation_1.executeOperation)(session.client, aggregateOperation, this.timeoutContext); + const server = aggregateOperation.server; + this.maxWireVersion = (0, utils_1.maxWireVersion)(server); + if (this.startAtOperationTime == null && this.changeStreamCursorOptions.resumeAfter == null && this.changeStreamCursorOptions.startAfter == null) { + this.startAtOperationTime = response.operationTime; + } + this._processBatch(response); + this.emit(constants_1.INIT, response); + this.emit(constants_1.RESPONSE); + return { server, session, response }; + } + async getMore(batchSize) { + const response = await super.getMore(batchSize); + this.maxWireVersion = (0, utils_1.maxWireVersion)(this.server); + this._processBatch(response); + this.emit(change_stream_1.ChangeStream.MORE, response); + this.emit(change_stream_1.ChangeStream.RESPONSE); + return response; + } + }; + exports2.ChangeStreamCursor = ChangeStreamCursor; + } +}); + +// node_modules/mongodb/lib/change_stream.js +var require_change_stream = __commonJS({ + "node_modules/mongodb/lib/change_stream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ChangeStream = void 0; + var collection_1 = require_collection2(); + var constants_1 = require_constants2(); + var abstract_cursor_1 = require_abstract_cursor(); + var change_stream_cursor_1 = require_change_stream_cursor(); + var db_1 = require_db2(); + var error_1 = require_error(); + var mongo_client_1 = require_mongo_client(); + var mongo_types_1 = require_mongo_types(); + var resource_management_1 = require_resource_management(); + var timeout_1 = require_timeout(); + var utils_1 = require_utils3(); + var CHANGE_STREAM_OPTIONS = [ + "resumeAfter", + "startAfter", + "startAtOperationTime", + "fullDocument", + "fullDocumentBeforeChange", + "showExpandedEvents" + ]; + var CHANGE_DOMAIN_TYPES = { + COLLECTION: /* @__PURE__ */ Symbol("Collection"), + DATABASE: /* @__PURE__ */ Symbol("Database"), + CLUSTER: /* @__PURE__ */ Symbol("Cluster") + }; + var CHANGE_STREAM_EVENTS = [constants_1.RESUME_TOKEN_CHANGED, constants_1.END, constants_1.CLOSE]; + var NO_RESUME_TOKEN_ERROR = "A change stream document has been received that lacks a resume token (_id)."; + var CHANGESTREAM_CLOSED_ERROR = "ChangeStream is closed"; + var ChangeStream = class _ChangeStream extends mongo_types_1.TypedEventEmitter { + /** @internal */ + async asyncDispose() { + await this.close(); + } + /** + * @internal + * + * @param parent - The parent object that created this change stream + * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents + */ + constructor(parent, pipeline = [], options = {}) { + super(); + this.pipeline = pipeline; + this.options = { ...options }; + let serverSelectionTimeoutMS; + delete this.options.writeConcern; + if (parent instanceof collection_1.Collection) { + this.type = CHANGE_DOMAIN_TYPES.COLLECTION; + serverSelectionTimeoutMS = parent.s.db.client.options.serverSelectionTimeoutMS; + } else if (parent instanceof db_1.Db) { + this.type = CHANGE_DOMAIN_TYPES.DATABASE; + serverSelectionTimeoutMS = parent.client.options.serverSelectionTimeoutMS; + } else if (parent instanceof mongo_client_1.MongoClient) { + this.type = CHANGE_DOMAIN_TYPES.CLUSTER; + serverSelectionTimeoutMS = parent.options.serverSelectionTimeoutMS; + } else { + throw new error_1.MongoChangeStreamError("Parent provided to ChangeStream constructor must be an instance of Collection, Db, or MongoClient"); + } + this.contextOwner = /* @__PURE__ */ Symbol(); + this.parent = parent; + this.namespace = parent.s.namespace; + if (!this.options.readPreference && parent.readPreference) { + this.options.readPreference = parent.readPreference; + } + this.cursor = this._createChangeStreamCursor(options); + this.isClosed = false; + this.mode = false; + this.on("newListener", (eventName) => { + if (eventName === "change" && this.cursor && this.listenerCount("change") === 0) { + this._streamEvents(this.cursor); + } + }); + this.on("removeListener", (eventName) => { + if (eventName === "change" && this.listenerCount("change") === 0 && this.cursor) { + this.cursorStream?.removeAllListeners("data"); + } + }); + if (this.options.timeoutMS != null) { + this.timeoutContext = new timeout_1.CSOTTimeoutContext({ + timeoutMS: this.options.timeoutMS, + serverSelectionTimeoutMS + }); + } + } + /** The cached resume token that is used to resume after the most recently returned change. */ + get resumeToken() { + return this.cursor?.resumeToken; + } + /** Check if there is any document still available in the Change Stream */ + async hasNext() { + this._setIsIterator(); + this.timeoutContext?.refresh(); + try { + while (true) { + try { + const hasNext = await this.cursor.hasNext(); + return hasNext; + } catch (error2) { + try { + await this._processErrorIteratorMode(error2, this.cursor.id != null); + } catch (error3) { + if (error3 instanceof error_1.MongoOperationTimeoutError && this.cursor.id == null) { + throw error3; + } + try { + await this.close(); + } catch (error4) { + (0, utils_1.squashError)(error4); + } + throw error3; + } + } + } + } finally { + this.timeoutContext?.clear(); + } + } + /** Get the next available document from the Change Stream. */ + async next() { + this._setIsIterator(); + this.timeoutContext?.refresh(); + try { + while (true) { + try { + const change = await this.cursor.next(); + const processedChange = this._processChange(change ?? null); + return processedChange; + } catch (error2) { + try { + await this._processErrorIteratorMode(error2, this.cursor.id != null); + } catch (error3) { + if (error3 instanceof error_1.MongoOperationTimeoutError && this.cursor.id == null) { + throw error3; + } + try { + await this.close(); + } catch (error4) { + (0, utils_1.squashError)(error4); + } + throw error3; + } + } + } + } finally { + this.timeoutContext?.clear(); + } + } + /** + * Try to get the next available document from the Change Stream's cursor or `null` if an empty batch is returned + */ + async tryNext() { + this._setIsIterator(); + this.timeoutContext?.refresh(); + try { + while (true) { + try { + const change = await this.cursor.tryNext(); + if (!change) { + return null; + } + const processedChange = this._processChange(change); + return processedChange; + } catch (error2) { + try { + await this._processErrorIteratorMode(error2, this.cursor.id != null); + } catch (error3) { + if (error3 instanceof error_1.MongoOperationTimeoutError && this.cursor.id == null) + throw error3; + try { + await this.close(); + } catch (error4) { + (0, utils_1.squashError)(error4); + } + throw error3; + } + } + } + } finally { + this.timeoutContext?.clear(); + } + } + async *[Symbol.asyncIterator]() { + if (this.closed) { + return; + } + try { + while (true) { + yield await this.next(); + } + } finally { + try { + await this.close(); + } catch (error2) { + (0, utils_1.squashError)(error2); + } + } + } + /** Is the cursor closed */ + get closed() { + return this.isClosed || this.cursor.closed; + } + /** + * Frees the internal resources used by the change stream. + */ + async close() { + this.timeoutContext?.clear(); + this.timeoutContext = void 0; + this.isClosed = true; + const cursor2 = this.cursor; + try { + await cursor2.close(); + } finally { + this._endStream(); + } + } + /** + * Return a modified Readable stream including a possible transform method. + * + * NOTE: When using a Stream to process change stream events, the stream will + * NOT automatically resume in the case a resumable error is encountered. + * + * @throws MongoChangeStreamError if the underlying cursor or the change stream is closed + */ + stream(options) { + if (this.closed) { + throw new error_1.MongoChangeStreamError(CHANGESTREAM_CLOSED_ERROR); + } + this.streamOptions = options; + return this.cursor.stream(options); + } + /** @internal */ + _setIsEmitter() { + if (this.mode === "iterator") { + throw new error_1.MongoAPIError("ChangeStream cannot be used as an EventEmitter after being used as an iterator"); + } + this.mode = "emitter"; + } + /** @internal */ + _setIsIterator() { + if (this.mode === "emitter") { + throw new error_1.MongoAPIError("ChangeStream cannot be used as an iterator after being used as an EventEmitter"); + } + this.mode = "iterator"; + } + /** + * Create a new change stream cursor based on self's configuration + * @internal + */ + _createChangeStreamCursor(options) { + const changeStreamStageOptions = (0, utils_1.filterOptions)(options, CHANGE_STREAM_OPTIONS); + if (this.type === CHANGE_DOMAIN_TYPES.CLUSTER) { + changeStreamStageOptions.allChangesForCluster = true; + } + const pipeline = [{ $changeStream: changeStreamStageOptions }, ...this.pipeline]; + const client = this.type === CHANGE_DOMAIN_TYPES.CLUSTER ? this.parent : this.type === CHANGE_DOMAIN_TYPES.DATABASE ? this.parent.client : this.type === CHANGE_DOMAIN_TYPES.COLLECTION ? this.parent.client : null; + if (client == null) { + throw new error_1.MongoRuntimeError(`Changestream type should only be one of cluster, database, collection. Found ${this.type.toString()}`); + } + const changeStreamCursor = new change_stream_cursor_1.ChangeStreamCursor(client, this.namespace, pipeline, { + ...options, + timeoutContext: this.timeoutContext ? new abstract_cursor_1.CursorTimeoutContext(this.timeoutContext, this.contextOwner) : void 0 + }); + for (const event of CHANGE_STREAM_EVENTS) { + changeStreamCursor.on(event, (e4) => this.emit(event, e4)); + } + if (this.listenerCount(_ChangeStream.CHANGE) > 0) { + this._streamEvents(changeStreamCursor); + } + return changeStreamCursor; + } + /** @internal */ + _closeEmitterModeWithError(error2) { + this.emit(_ChangeStream.ERROR, error2); + this.close().then(void 0, utils_1.squashError); + } + /** @internal */ + _streamEvents(cursor2) { + this._setIsEmitter(); + const stream = this.cursorStream ?? cursor2.stream(); + this.cursorStream = stream; + stream.on("data", (change) => { + try { + const processedChange = this._processChange(change); + this.emit(_ChangeStream.CHANGE, processedChange); + } catch (error2) { + this.emit(_ChangeStream.ERROR, error2); + } + this.timeoutContext?.refresh(); + }); + stream.on("error", (error2) => this._processErrorStreamMode(error2, this.cursor.id != null)); + } + /** @internal */ + _endStream() { + this.cursorStream?.removeAllListeners("data"); + this.cursorStream?.removeAllListeners("close"); + this.cursorStream?.removeAllListeners("end"); + this.cursorStream?.destroy(); + this.cursorStream = void 0; + } + /** @internal */ + _processChange(change) { + if (this.isClosed) { + throw new error_1.MongoAPIError(CHANGESTREAM_CLOSED_ERROR); + } + if (change == null) { + throw new error_1.MongoRuntimeError(CHANGESTREAM_CLOSED_ERROR); + } + if (change && !change._id) { + throw new error_1.MongoChangeStreamError(NO_RESUME_TOKEN_ERROR); + } + this.cursor.cacheResumeToken(change._id); + this.options.startAtOperationTime = void 0; + return change; + } + /** @internal */ + _processErrorStreamMode(changeStreamError, cursorInitialized) { + if (this.isClosed) + return; + if (cursorInitialized && ((0, error_1.isResumableError)(changeStreamError, this.cursor.maxWireVersion) || changeStreamError instanceof error_1.MongoOperationTimeoutError)) { + this._endStream(); + this.cursor.close().then(() => this._resume(changeStreamError), (e4) => { + (0, utils_1.squashError)(e4); + return this._resume(changeStreamError); + }).then(() => { + if (changeStreamError instanceof error_1.MongoOperationTimeoutError) + this.emit(_ChangeStream.ERROR, changeStreamError); + }, () => this._closeEmitterModeWithError(changeStreamError)); + } else { + this._closeEmitterModeWithError(changeStreamError); + } + } + /** @internal */ + async _processErrorIteratorMode(changeStreamError, cursorInitialized) { + if (this.isClosed) { + throw new error_1.MongoAPIError(CHANGESTREAM_CLOSED_ERROR); + } + if (cursorInitialized && ((0, error_1.isResumableError)(changeStreamError, this.cursor.maxWireVersion) || changeStreamError instanceof error_1.MongoOperationTimeoutError)) { + try { + await this.cursor.close(); + } catch (error2) { + (0, utils_1.squashError)(error2); + } + await this._resume(changeStreamError); + if (changeStreamError instanceof error_1.MongoOperationTimeoutError) + throw changeStreamError; + } else { + try { + await this.close(); + } catch (error2) { + (0, utils_1.squashError)(error2); + } + throw changeStreamError; + } + } + async _resume(changeStreamError) { + this.timeoutContext?.refresh(); + const topology = (0, utils_1.getTopology)(this.parent); + try { + await topology.selectServer(this.cursor.readPreference, { + operationName: "reconnect topology in change stream", + timeoutContext: this.timeoutContext + }); + this.cursor = this._createChangeStreamCursor(this.cursor.resumeOptions); + } catch { + await this.close(); + throw changeStreamError; + } + } + }; + exports2.ChangeStream = ChangeStream; + ChangeStream.RESPONSE = constants_1.RESPONSE; + ChangeStream.MORE = constants_1.MORE; + ChangeStream.INIT = constants_1.INIT; + ChangeStream.CLOSE = constants_1.CLOSE; + ChangeStream.CHANGE = constants_1.CHANGE; + ChangeStream.END = constants_1.END; + ChangeStream.ERROR = constants_1.ERROR; + ChangeStream.RESUME_TOKEN_CHANGED = constants_1.RESUME_TOKEN_CHANGED; + (0, resource_management_1.configureResourceManagement)(ChangeStream.prototype); + } +}); + +// node_modules/mongodb/lib/gridfs/download.js +var require_download = __commonJS({ + "node_modules/mongodb/lib/gridfs/download.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.GridFSBucketReadStream = void 0; + var stream_1 = require("stream"); + var abstract_cursor_1 = require_abstract_cursor(); + var error_1 = require_error(); + var timeout_1 = require_timeout(); + var GridFSBucketReadStream = class extends stream_1.Readable { + /** + * @param chunks - Handle for chunks collection + * @param files - Handle for files collection + * @param readPreference - The read preference to use + * @param filter - The filter to use to find the file document + * @internal + */ + constructor(chunks, files, readPreference, filter, options) { + super({ emitClose: true }); + this.s = { + bytesToTrim: 0, + bytesToSkip: 0, + bytesRead: 0, + chunks, + expected: 0, + files, + filter, + init: false, + expectedEnd: 0, + options: { + start: 0, + end: 0, + ...options + }, + readPreference, + timeoutContext: options?.timeoutMS != null ? new timeout_1.CSOTTimeoutContext({ timeoutMS: options.timeoutMS, serverSelectionTimeoutMS: 0 }) : void 0 + }; + } + /** + * Reads from the cursor and pushes to the stream. + * Private Impl, do not call directly + * @internal + */ + _read() { + if (this.destroyed) + return; + waitForFile(this, () => doRead(this)); + } + /** + * Sets the 0-based offset in bytes to start streaming from. Throws + * an error if this stream has entered flowing mode + * (e.g. if you've already called `on('data')`) + * + * @param start - 0-based offset in bytes to start streaming from + */ + start(start = 0) { + throwIfInitialized(this); + this.s.options.start = start; + return this; + } + /** + * Sets the 0-based offset in bytes to start streaming from. Throws + * an error if this stream has entered flowing mode + * (e.g. if you've already called `on('data')`) + * + * @param end - Offset in bytes to stop reading at + */ + end(end = 0) { + throwIfInitialized(this); + this.s.options.end = end; + return this; + } + /** + * Marks this stream as aborted (will never push another `data` event) + * and kills the underlying cursor. Will emit the 'end' event, and then + * the 'close' event once the cursor is successfully killed. + */ + async abort() { + this.push(null); + this.destroy(); + const remainingTimeMS = this.s.timeoutContext?.getRemainingTimeMSOrThrow(); + await this.s.cursor?.close({ timeoutMS: remainingTimeMS }); + } + }; + exports2.GridFSBucketReadStream = GridFSBucketReadStream; + GridFSBucketReadStream.FILE = "file"; + function throwIfInitialized(stream) { + if (stream.s.init) { + throw new error_1.MongoGridFSStreamError("Options cannot be changed after the stream is initialized"); + } + } + function doRead(stream) { + if (stream.destroyed) + return; + if (!stream.s.cursor) + return; + if (!stream.s.file) + return; + const handleReadResult = (doc) => { + if (stream.destroyed) + return; + if (!doc) { + stream.push(null); + stream.s.cursor?.close().then(void 0, (error2) => stream.destroy(error2)); + return; + } + if (!stream.s.file) + return; + const bytesRemaining = stream.s.file.length - stream.s.bytesRead; + const expectedN = stream.s.expected++; + const expectedLength = Math.min(stream.s.file.chunkSize, bytesRemaining); + if (doc.n > expectedN) { + return stream.destroy(new error_1.MongoGridFSChunkError(`ChunkIsMissing: Got unexpected n: ${doc.n}, expected: ${expectedN}`)); + } + if (doc.n < expectedN) { + return stream.destroy(new error_1.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${doc.n}, expected: ${expectedN}`)); + } + let buf = Buffer.isBuffer(doc.data) ? doc.data : doc.data.buffer; + if (buf.byteLength !== expectedLength) { + if (bytesRemaining <= 0) { + return stream.destroy(new error_1.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${doc.n}, expected file length ${stream.s.file.length} bytes but already read ${stream.s.bytesRead} bytes`)); + } + return stream.destroy(new error_1.MongoGridFSChunkError(`ChunkIsWrongSize: Got unexpected length: ${buf.byteLength}, expected: ${expectedLength}`)); + } + stream.s.bytesRead += buf.byteLength; + if (buf.byteLength === 0) { + return stream.push(null); + } + let sliceStart = null; + let sliceEnd = null; + if (stream.s.bytesToSkip != null) { + sliceStart = stream.s.bytesToSkip; + stream.s.bytesToSkip = 0; + } + const atEndOfStream = expectedN === stream.s.expectedEnd - 1; + const bytesLeftToRead = stream.s.options.end - stream.s.bytesToSkip; + if (atEndOfStream && stream.s.bytesToTrim != null) { + sliceEnd = stream.s.file.chunkSize - stream.s.bytesToTrim; + } else if (stream.s.options.end && bytesLeftToRead < doc.data.byteLength) { + sliceEnd = bytesLeftToRead; + } + if (sliceStart != null || sliceEnd != null) { + buf = buf.slice(sliceStart || 0, sliceEnd || buf.byteLength); + } + stream.push(buf); + return; + }; + stream.s.cursor.next().then(handleReadResult, (error2) => { + if (stream.destroyed) + return; + stream.destroy(error2); + }); + } + function init(stream) { + const findOneOptions = {}; + if (stream.s.readPreference) { + findOneOptions.readPreference = stream.s.readPreference; + } + if (stream.s.options && stream.s.options.sort) { + findOneOptions.sort = stream.s.options.sort; + } + if (stream.s.options && stream.s.options.skip) { + findOneOptions.skip = stream.s.options.skip; + } + const handleReadResult = (doc) => { + if (stream.destroyed) + return; + if (!doc) { + const identifier = stream.s.filter._id ? stream.s.filter._id.toString() : stream.s.filter.filename; + const errmsg = `FileNotFound: file ${identifier} was not found`; + const err = new error_1.MongoRuntimeError(errmsg); + err.code = "ENOENT"; + return stream.destroy(err); + } + if (doc.length <= 0) { + stream.push(null); + return; + } + if (stream.destroyed) { + stream.destroy(); + return; + } + try { + stream.s.bytesToSkip = handleStartOption(stream, doc, stream.s.options); + } catch (error2) { + return stream.destroy(error2); + } + const filter = { files_id: doc._id }; + if (stream.s.options && stream.s.options.start != null) { + const skip = Math.floor(stream.s.options.start / doc.chunkSize); + if (skip > 0) { + filter["n"] = { $gte: skip }; + } + } + let remainingTimeMS2; + try { + remainingTimeMS2 = stream.s.timeoutContext?.getRemainingTimeMSOrThrow(`Download timed out after ${stream.s.timeoutContext?.timeoutMS}ms`); + } catch (error2) { + return stream.destroy(error2); + } + stream.s.cursor = stream.s.chunks.find(filter, { + timeoutMode: stream.s.options.timeoutMS != null ? abstract_cursor_1.CursorTimeoutMode.LIFETIME : void 0, + timeoutMS: remainingTimeMS2 + }).sort({ n: 1 }); + if (stream.s.readPreference) { + stream.s.cursor.withReadPreference(stream.s.readPreference); + } + stream.s.expectedEnd = Math.ceil(doc.length / doc.chunkSize); + stream.s.file = doc; + try { + stream.s.bytesToTrim = handleEndOption(stream, doc, stream.s.cursor, stream.s.options); + } catch (error2) { + return stream.destroy(error2); + } + stream.emit(GridFSBucketReadStream.FILE, doc); + return; + }; + let remainingTimeMS; + try { + remainingTimeMS = stream.s.timeoutContext?.getRemainingTimeMSOrThrow(`Download timed out after ${stream.s.timeoutContext?.timeoutMS}ms`); + } catch (error2) { + if (!stream.destroyed) + stream.destroy(error2); + return; + } + findOneOptions.timeoutMS = remainingTimeMS; + stream.s.files.findOne(stream.s.filter, findOneOptions).then(handleReadResult, (error2) => { + if (stream.destroyed) + return; + stream.destroy(error2); + }); + } + function waitForFile(stream, callback) { + if (stream.s.file) { + return callback(); + } + if (!stream.s.init) { + init(stream); + stream.s.init = true; + } + stream.once("file", () => { + callback(); + }); + } + function handleStartOption(stream, doc, options) { + if (options && options.start != null) { + if (options.start > doc.length) { + throw new error_1.MongoInvalidArgumentError(`Stream start (${options.start}) must not be more than the length of the file (${doc.length})`); + } + if (options.start < 0) { + throw new error_1.MongoInvalidArgumentError(`Stream start (${options.start}) must not be negative`); + } + if (options.end != null && options.end < options.start) { + throw new error_1.MongoInvalidArgumentError(`Stream start (${options.start}) must not be greater than stream end (${options.end})`); + } + stream.s.bytesRead = Math.floor(options.start / doc.chunkSize) * doc.chunkSize; + stream.s.expected = Math.floor(options.start / doc.chunkSize); + return options.start - stream.s.bytesRead; + } + throw new error_1.MongoInvalidArgumentError("Start option must be defined"); + } + function handleEndOption(stream, doc, cursor2, options) { + if (options && options.end != null) { + if (options.end > doc.length) { + throw new error_1.MongoInvalidArgumentError(`Stream end (${options.end}) must not be more than the length of the file (${doc.length})`); + } + if (options.start == null || options.start < 0) { + throw new error_1.MongoInvalidArgumentError(`Stream end (${options.end}) must not be negative`); + } + const start = options.start != null ? Math.floor(options.start / doc.chunkSize) : 0; + cursor2.limit(Math.ceil(options.end / doc.chunkSize) - start); + stream.s.expectedEnd = Math.ceil(options.end / doc.chunkSize); + return Math.ceil(options.end / doc.chunkSize) * doc.chunkSize - options.end; + } + throw new error_1.MongoInvalidArgumentError("End option must be defined"); + } + } +}); + +// node_modules/mongodb/lib/gridfs/upload.js +var require_upload = __commonJS({ + "node_modules/mongodb/lib/gridfs/upload.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.GridFSBucketWriteStream = void 0; + var stream_1 = require("stream"); + var bson_1 = require_bson2(); + var abstract_cursor_1 = require_abstract_cursor(); + var error_1 = require_error(); + var timeout_1 = require_timeout(); + var utils_1 = require_utils3(); + var write_concern_1 = require_write_concern(); + var GridFSBucketWriteStream = class extends stream_1.Writable { + /** + * @param bucket - Handle for this stream's corresponding bucket + * @param filename - The value of the 'filename' key in the files doc + * @param options - Optional settings. + * @internal + */ + constructor(bucket, filename, options) { + super(); + this.gridFSFile = null; + options = options ?? {}; + this.bucket = bucket; + this.chunks = bucket.s._chunksCollection; + this.filename = filename; + this.files = bucket.s._filesCollection; + this.options = options; + this.writeConcern = write_concern_1.WriteConcern.fromOptions(options) || bucket.s.options.writeConcern; + this.done = false; + this.id = options.id ? options.id : new bson_1.ObjectId(); + this.chunkSizeBytes = options.chunkSizeBytes || this.bucket.s.options.chunkSizeBytes; + this.bufToStore = Buffer.alloc(this.chunkSizeBytes); + this.length = 0; + this.n = 0; + this.pos = 0; + this.state = { + streamEnd: false, + outstandingRequests: 0, + errored: false, + aborted: false + }; + if (options.timeoutMS != null) + this.timeoutContext = new timeout_1.CSOTTimeoutContext({ + timeoutMS: options.timeoutMS, + serverSelectionTimeoutMS: (0, utils_1.resolveTimeoutOptions)(this.bucket.s.db.client, {}).serverSelectionTimeoutMS + }); + } + /** + * @internal + * + * The stream is considered constructed when the indexes are done being created + */ + _construct(callback) { + if (!this.bucket.s.calledOpenUploadStream) { + this.bucket.s.calledOpenUploadStream = true; + checkIndexes(this).then(() => { + this.bucket.s.checkedIndexes = true; + this.bucket.emit("index"); + callback(); + }, (error2) => { + if (error2 instanceof error_1.MongoOperationTimeoutError) { + return handleError(this, error2, callback); + } + (0, utils_1.squashError)(error2); + callback(); + }); + } else { + return process.nextTick(callback); + } + } + /** + * @internal + * Write a buffer to the stream. + * + * @param chunk - Buffer to write + * @param encoding - Optional encoding for the buffer + * @param callback - Function to call when the chunk was added to the buffer, or if the entire chunk was persisted to MongoDB if this chunk caused a flush. + */ + _write(chunk, encoding, callback) { + doWrite(this, chunk, encoding, callback); + } + /** @internal */ + _final(callback) { + if (this.state.streamEnd) { + return process.nextTick(callback); + } + this.state.streamEnd = true; + writeRemnant(this, callback); + } + /** + * Places this write stream into an aborted state (all future writes fail) + * and deletes all chunks that have already been written. + */ + async abort() { + if (this.state.streamEnd) { + throw new error_1.MongoAPIError("Cannot abort a stream that has already completed"); + } + if (this.state.aborted) { + throw new error_1.MongoAPIError("Cannot call abort() on a stream twice"); + } + this.state.aborted = true; + const remainingTimeMS = this.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${this.timeoutContext?.timeoutMS}ms`); + await this.chunks.deleteMany({ files_id: this.id }, { timeoutMS: remainingTimeMS }); + } + }; + exports2.GridFSBucketWriteStream = GridFSBucketWriteStream; + function handleError(stream, error2, callback) { + if (stream.state.errored) { + process.nextTick(callback); + return; + } + stream.state.errored = true; + process.nextTick(callback, error2); + } + function createChunkDoc(filesId, n4, data2) { + return { + _id: new bson_1.ObjectId(), + files_id: filesId, + n: n4, + data: data2 + }; + } + async function checkChunksIndex(stream) { + const index = { files_id: 1, n: 1 }; + let remainingTimeMS; + remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`); + let indexes; + try { + indexes = await stream.chunks.listIndexes({ + timeoutMode: remainingTimeMS != null ? abstract_cursor_1.CursorTimeoutMode.LIFETIME : void 0, + timeoutMS: remainingTimeMS + }).toArray(); + } catch (error2) { + if (error2 instanceof error_1.MongoError && error2.code === error_1.MONGODB_ERROR_CODES.NamespaceNotFound) { + indexes = []; + } else { + throw error2; + } + } + const hasChunksIndex = !!indexes.find((index2) => { + const keys = Object.keys(index2.key); + if (keys.length === 2 && index2.key.files_id === 1 && index2.key.n === 1) { + return true; + } + return false; + }); + if (!hasChunksIndex) { + remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`); + await stream.chunks.createIndex(index, { + ...stream.writeConcern, + background: true, + unique: true, + timeoutMS: remainingTimeMS + }); + } + } + function checkDone(stream, callback) { + if (stream.done) { + return process.nextTick(callback); + } + if (stream.state.streamEnd && stream.state.outstandingRequests === 0 && !stream.state.errored) { + stream.done = true; + const gridFSFile = createFilesDoc(stream.id, stream.length, stream.chunkSizeBytes, stream.filename, stream.options.contentType, stream.options.aliases, stream.options.metadata); + if (isAborted(stream, callback)) { + return; + } + const remainingTimeMS = stream.timeoutContext?.remainingTimeMS; + if (remainingTimeMS != null && remainingTimeMS <= 0) { + return handleError(stream, new error_1.MongoOperationTimeoutError(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`), callback); + } + stream.files.insertOne(gridFSFile, { writeConcern: stream.writeConcern, timeoutMS: remainingTimeMS }).then(() => { + stream.gridFSFile = gridFSFile; + callback(); + }, (error2) => { + return handleError(stream, error2, callback); + }); + return; + } + process.nextTick(callback); + } + async function checkIndexes(stream) { + let remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`); + const doc = await stream.files.findOne({}, { + projection: { _id: 1 }, + timeoutMS: remainingTimeMS + }); + if (doc != null) { + return; + } + const index = { filename: 1, uploadDate: 1 }; + let indexes; + remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`); + const listIndexesOptions = { + timeoutMode: remainingTimeMS != null ? abstract_cursor_1.CursorTimeoutMode.LIFETIME : void 0, + timeoutMS: remainingTimeMS + }; + try { + indexes = await stream.files.listIndexes(listIndexesOptions).toArray(); + } catch (error2) { + if (error2 instanceof error_1.MongoError && error2.code === error_1.MONGODB_ERROR_CODES.NamespaceNotFound) { + indexes = []; + } else { + throw error2; + } + } + const hasFileIndex = !!indexes.find((index2) => { + const keys = Object.keys(index2.key); + if (keys.length === 2 && index2.key.filename === 1 && index2.key.uploadDate === 1) { + return true; + } + return false; + }); + if (!hasFileIndex) { + remainingTimeMS = stream.timeoutContext?.getRemainingTimeMSOrThrow(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`); + await stream.files.createIndex(index, { background: false, timeoutMS: remainingTimeMS }); + } + await checkChunksIndex(stream); + } + function createFilesDoc(_id, length, chunkSize, filename, contentType, aliases, metadata) { + const ret = { + _id, + length, + chunkSize, + uploadDate: /* @__PURE__ */ new Date(), + filename + }; + if (contentType) { + ret.contentType = contentType; + } + if (aliases) { + ret.aliases = aliases; + } + if (metadata) { + ret.metadata = metadata; + } + return ret; + } + function doWrite(stream, chunk, encoding, callback) { + if (isAborted(stream, callback)) { + return; + } + const inputBuf = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding); + stream.length += inputBuf.length; + if (stream.pos + inputBuf.length < stream.chunkSizeBytes) { + inputBuf.copy(stream.bufToStore, stream.pos); + stream.pos += inputBuf.length; + process.nextTick(callback); + return; + } + let inputBufRemaining = inputBuf.length; + let spaceRemaining = stream.chunkSizeBytes - stream.pos; + let numToCopy = Math.min(spaceRemaining, inputBuf.length); + let outstandingRequests = 0; + while (inputBufRemaining > 0) { + const inputBufPos = inputBuf.length - inputBufRemaining; + inputBuf.copy(stream.bufToStore, stream.pos, inputBufPos, inputBufPos + numToCopy); + stream.pos += numToCopy; + spaceRemaining -= numToCopy; + let doc; + if (spaceRemaining === 0) { + doc = createChunkDoc(stream.id, stream.n, Buffer.from(stream.bufToStore)); + const remainingTimeMS = stream.timeoutContext?.remainingTimeMS; + if (remainingTimeMS != null && remainingTimeMS <= 0) { + return handleError(stream, new error_1.MongoOperationTimeoutError(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`), callback); + } + ++stream.state.outstandingRequests; + ++outstandingRequests; + if (isAborted(stream, callback)) { + return; + } + stream.chunks.insertOne(doc, { writeConcern: stream.writeConcern, timeoutMS: remainingTimeMS }).then(() => { + --stream.state.outstandingRequests; + --outstandingRequests; + if (!outstandingRequests) { + checkDone(stream, callback); + } + }, (error2) => { + return handleError(stream, error2, callback); + }); + spaceRemaining = stream.chunkSizeBytes; + stream.pos = 0; + ++stream.n; + } + inputBufRemaining -= numToCopy; + numToCopy = Math.min(spaceRemaining, inputBufRemaining); + } + } + function writeRemnant(stream, callback) { + if (stream.pos === 0) { + return checkDone(stream, callback); + } + const remnant = Buffer.alloc(stream.pos); + stream.bufToStore.copy(remnant, 0, 0, stream.pos); + const doc = createChunkDoc(stream.id, stream.n, remnant); + if (isAborted(stream, callback)) { + return; + } + const remainingTimeMS = stream.timeoutContext?.remainingTimeMS; + if (remainingTimeMS != null && remainingTimeMS <= 0) { + return handleError(stream, new error_1.MongoOperationTimeoutError(`Upload timed out after ${stream.timeoutContext?.timeoutMS}ms`), callback); + } + ++stream.state.outstandingRequests; + stream.chunks.insertOne(doc, { writeConcern: stream.writeConcern, timeoutMS: remainingTimeMS }).then(() => { + --stream.state.outstandingRequests; + checkDone(stream, callback); + }, (error2) => { + return handleError(stream, error2, callback); + }); + } + function isAborted(stream, callback) { + if (stream.state.aborted) { + process.nextTick(callback, new error_1.MongoAPIError("Stream has been aborted")); + return true; + } + return false; + } + } +}); + +// node_modules/mongodb/lib/gridfs/index.js +var require_gridfs = __commonJS({ + "node_modules/mongodb/lib/gridfs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.GridFSBucket = void 0; + var error_1 = require_error(); + var mongo_types_1 = require_mongo_types(); + var timeout_1 = require_timeout(); + var utils_1 = require_utils3(); + var write_concern_1 = require_write_concern(); + var download_1 = require_download(); + var upload_1 = require_upload(); + var DEFAULT_GRIDFS_BUCKET_OPTIONS = { + bucketName: "fs", + chunkSizeBytes: 255 * 1024 + }; + var GridFSBucket = class extends mongo_types_1.TypedEventEmitter { + constructor(db, options) { + super(); + this.on("error", utils_1.noop); + this.setMaxListeners(0); + const privateOptions = (0, utils_1.resolveOptions)(db, { + ...DEFAULT_GRIDFS_BUCKET_OPTIONS, + ...options, + writeConcern: write_concern_1.WriteConcern.fromOptions(options) + }); + this.s = { + db, + options: privateOptions, + _chunksCollection: db.collection(privateOptions.bucketName + ".chunks"), + _filesCollection: db.collection(privateOptions.bucketName + ".files"), + checkedIndexes: false, + calledOpenUploadStream: false + }; + } + /** + * Returns a writable stream (GridFSBucketWriteStream) for writing + * buffers to GridFS. The stream's 'id' property contains the resulting + * file's id. + * + * @param filename - The value of the 'filename' key in the files doc + * @param options - Optional settings. + */ + openUploadStream(filename, options) { + return new upload_1.GridFSBucketWriteStream(this, filename, { + timeoutMS: this.s.options.timeoutMS, + ...options + }); + } + /** + * Returns a writable stream (GridFSBucketWriteStream) for writing + * buffers to GridFS for a custom file id. The stream's 'id' property contains the resulting + * file's id. + */ + openUploadStreamWithId(id, filename, options) { + return new upload_1.GridFSBucketWriteStream(this, filename, { + timeoutMS: this.s.options.timeoutMS, + ...options, + id + }); + } + /** Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS. */ + openDownloadStream(id, options) { + return new download_1.GridFSBucketReadStream(this.s._chunksCollection, this.s._filesCollection, this.s.options.readPreference, { _id: id }, { timeoutMS: this.s.options.timeoutMS, ...options }); + } + /** + * Deletes a file with the given id + * + * @param id - The id of the file doc + */ + async delete(id, options) { + const { timeoutMS } = (0, utils_1.resolveOptions)(this.s.db, options); + let timeoutContext = void 0; + if (timeoutMS) { + timeoutContext = new timeout_1.CSOTTimeoutContext({ + timeoutMS, + serverSelectionTimeoutMS: this.s.db.client.s.options.serverSelectionTimeoutMS + }); + } + const { deletedCount } = await this.s._filesCollection.deleteOne({ _id: id }, { timeoutMS: timeoutContext?.remainingTimeMS }); + const remainingTimeMS = timeoutContext?.remainingTimeMS; + if (remainingTimeMS != null && remainingTimeMS <= 0) + throw new error_1.MongoOperationTimeoutError(`Timed out after ${timeoutMS}ms`); + await this.s._chunksCollection.deleteMany({ files_id: id }, { timeoutMS: remainingTimeMS }); + if (deletedCount === 0) { + throw new error_1.MongoRuntimeError(`File not found for id ${id}`); + } + } + /** Convenience wrapper around find on the files collection */ + find(filter = {}, options = {}) { + return this.s._filesCollection.find(filter, options); + } + /** + * Returns a readable stream (GridFSBucketReadStream) for streaming the + * file with the given name from GridFS. If there are multiple files with + * the same name, this will stream the most recent file with the given name + * (as determined by the `uploadDate` field). You can set the `revision` + * option to change this behavior. + */ + openDownloadStreamByName(filename, options) { + let sort = { uploadDate: -1 }; + let skip = void 0; + if (options && options.revision != null) { + if (options.revision >= 0) { + sort = { uploadDate: 1 }; + skip = options.revision; + } else { + skip = -options.revision - 1; + } + } + return new download_1.GridFSBucketReadStream(this.s._chunksCollection, this.s._filesCollection, this.s.options.readPreference, { filename }, { timeoutMS: this.s.options.timeoutMS, ...options, sort, skip }); + } + /** + * Renames the file with the given _id to the given string + * + * @param id - the id of the file to rename + * @param filename - new name for the file + */ + async rename(id, filename, options) { + const filter = { _id: id }; + const update = { $set: { filename } }; + const { matchedCount } = await this.s._filesCollection.updateOne(filter, update, options); + if (matchedCount === 0) { + throw new error_1.MongoRuntimeError(`File with id ${id} not found`); + } + } + /** Removes this bucket's files collection, followed by its chunks collection. */ + async drop(options) { + const { timeoutMS } = (0, utils_1.resolveOptions)(this.s.db, options); + let timeoutContext = void 0; + if (timeoutMS) { + timeoutContext = new timeout_1.CSOTTimeoutContext({ + timeoutMS, + serverSelectionTimeoutMS: this.s.db.client.s.options.serverSelectionTimeoutMS + }); + } + if (timeoutContext) { + await this.s._filesCollection.drop({ timeoutMS: timeoutContext.remainingTimeMS }); + const remainingTimeMS = timeoutContext.getRemainingTimeMSOrThrow(`Timed out after ${timeoutMS}ms`); + await this.s._chunksCollection.drop({ timeoutMS: remainingTimeMS }); + } else { + await this.s._filesCollection.drop(); + await this.s._chunksCollection.drop(); + } + } + }; + exports2.GridFSBucket = GridFSBucket; + GridFSBucket.INDEX = "index"; + } +}); + +// node_modules/mongodb/lib/index.js +var require_lib6 = __commonJS({ + "node_modules/mongodb/lib/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.MongoRuntimeError = exports2.MongoParseError = exports2.MongoOperationTimeoutError = exports2.MongoOIDCError = exports2.MongoNotConnectedError = exports2.MongoNetworkTimeoutError = exports2.MongoNetworkError = exports2.MongoMissingDependencyError = exports2.MongoMissingCredentialsError = exports2.MongoKerberosError = exports2.MongoInvalidArgumentError = exports2.MongoGridFSStreamError = exports2.MongoGridFSChunkError = exports2.MongoGCPError = exports2.MongoExpiredSessionError = exports2.MongoError = exports2.MongoDriverError = exports2.MongoDecompressionError = exports2.MongoCursorInUseError = exports2.MongoCursorExhaustedError = exports2.MongoCompatibilityError = exports2.MongoClientClosedError = exports2.MongoClientBulkWriteExecutionError = exports2.MongoClientBulkWriteError = exports2.MongoClientBulkWriteCursorError = exports2.MongoChangeStreamError = exports2.MongoBatchReExecutionError = exports2.MongoAzureError = exports2.MongoAWSError = exports2.MongoAPIError = exports2.ExplainableCursor = exports2.ChangeStreamCursor = exports2.ClientEncryption = exports2.MongoBulkWriteError = exports2.UUID = exports2.Timestamp = exports2.ObjectId = exports2.MinKey = exports2.MaxKey = exports2.Long = exports2.Int32 = exports2.Double = exports2.Decimal128 = exports2.DBRef = exports2.Code = exports2.BSONType = exports2.BSONSymbol = exports2.BSONRegExp = exports2.Binary = exports2.BSON = void 0; + exports2.CommandFailedEvent = exports2.WriteConcern = exports2.ReadPreference = exports2.ReadConcern = exports2.TopologyType = exports2.ServerType = exports2.ReadPreferenceMode = exports2.ReadConcernLevel = exports2.ProfilingLevel = exports2.ReturnDocument = exports2.SeverityLevel = exports2.MongoLoggableComponent = exports2.ServerApiVersion = exports2.ExplainVerbosity = exports2.MongoErrorLabel = exports2.CursorTimeoutMode = exports2.CURSOR_FLAGS = exports2.Compressor = exports2.AuthMechanism = exports2.GSSAPICanonicalizationValue = exports2.AutoEncryptionLoggerLevel = exports2.BatchType = exports2.UnorderedBulkOperation = exports2.OrderedBulkOperation = exports2.MongoClient = exports2.ListIndexesCursor = exports2.ListCollectionsCursor = exports2.GridFSBucketWriteStream = exports2.GridFSBucketReadStream = exports2.GridFSBucket = exports2.FindCursor = exports2.Db = exports2.Collection = exports2.ClientSession = exports2.ChangeStream = exports2.CancellationToken = exports2.AggregationCursor = exports2.Admin = exports2.AbstractCursor = exports2.configureExplicitResourceManagement = exports2.MongoWriteConcernError = exports2.MongoUnexpectedServerResponseError = exports2.MongoTransactionError = exports2.MongoTopologyClosedError = exports2.MongoTailableCursorError = exports2.MongoSystemError = exports2.MongoStalePrimaryError = exports2.MongoServerSelectionError = exports2.MongoServerError = exports2.MongoServerClosedError = void 0; + exports2.MongoClientAuthProviders = exports2.MongoCryptKMSRequestNetworkTimeoutError = exports2.MongoCryptInvalidArgumentError = exports2.MongoCryptError = exports2.MongoCryptCreateEncryptedCollectionError = exports2.MongoCryptCreateDataKeyError = exports2.MongoCryptAzureKMSRequestError = exports2.SrvPollingEvent = exports2.WaitingForSuitableServerEvent = exports2.ServerSelectionSucceededEvent = exports2.ServerSelectionStartedEvent = exports2.ServerSelectionFailedEvent = exports2.ServerSelectionEvent = exports2.TopologyOpeningEvent = exports2.TopologyDescriptionChangedEvent = exports2.TopologyClosedEvent = exports2.ServerOpeningEvent = exports2.ServerHeartbeatSucceededEvent = exports2.ServerHeartbeatStartedEvent = exports2.ServerHeartbeatFailedEvent = exports2.ServerDescriptionChangedEvent = exports2.ServerClosedEvent = exports2.ConnectionReadyEvent = exports2.ConnectionPoolReadyEvent = exports2.ConnectionPoolMonitoringEvent = exports2.ConnectionPoolCreatedEvent = exports2.ConnectionPoolClosedEvent = exports2.ConnectionPoolClearedEvent = exports2.ConnectionCreatedEvent = exports2.ConnectionClosedEvent = exports2.ConnectionCheckOutStartedEvent = exports2.ConnectionCheckOutFailedEvent = exports2.ConnectionCheckedOutEvent = exports2.ConnectionCheckedInEvent = exports2.CommandSucceededEvent = exports2.CommandStartedEvent = void 0; + var admin_1 = require_admin(); + Object.defineProperty(exports2, "Admin", { enumerable: true, get: function() { + return admin_1.Admin; + } }); + var ordered_1 = require_ordered(); + Object.defineProperty(exports2, "OrderedBulkOperation", { enumerable: true, get: function() { + return ordered_1.OrderedBulkOperation; + } }); + var unordered_1 = require_unordered(); + Object.defineProperty(exports2, "UnorderedBulkOperation", { enumerable: true, get: function() { + return unordered_1.UnorderedBulkOperation; + } }); + var change_stream_1 = require_change_stream(); + Object.defineProperty(exports2, "ChangeStream", { enumerable: true, get: function() { + return change_stream_1.ChangeStream; + } }); + var collection_1 = require_collection2(); + Object.defineProperty(exports2, "Collection", { enumerable: true, get: function() { + return collection_1.Collection; + } }); + var abstract_cursor_1 = require_abstract_cursor(); + Object.defineProperty(exports2, "AbstractCursor", { enumerable: true, get: function() { + return abstract_cursor_1.AbstractCursor; + } }); + var aggregation_cursor_1 = require_aggregation_cursor(); + Object.defineProperty(exports2, "AggregationCursor", { enumerable: true, get: function() { + return aggregation_cursor_1.AggregationCursor; + } }); + var find_cursor_1 = require_find_cursor(); + Object.defineProperty(exports2, "FindCursor", { enumerable: true, get: function() { + return find_cursor_1.FindCursor; + } }); + var list_collections_cursor_1 = require_list_collections_cursor(); + Object.defineProperty(exports2, "ListCollectionsCursor", { enumerable: true, get: function() { + return list_collections_cursor_1.ListCollectionsCursor; + } }); + var list_indexes_cursor_1 = require_list_indexes_cursor(); + Object.defineProperty(exports2, "ListIndexesCursor", { enumerable: true, get: function() { + return list_indexes_cursor_1.ListIndexesCursor; + } }); + var db_1 = require_db2(); + Object.defineProperty(exports2, "Db", { enumerable: true, get: function() { + return db_1.Db; + } }); + var gridfs_1 = require_gridfs(); + Object.defineProperty(exports2, "GridFSBucket", { enumerable: true, get: function() { + return gridfs_1.GridFSBucket; + } }); + var download_1 = require_download(); + Object.defineProperty(exports2, "GridFSBucketReadStream", { enumerable: true, get: function() { + return download_1.GridFSBucketReadStream; + } }); + var upload_1 = require_upload(); + Object.defineProperty(exports2, "GridFSBucketWriteStream", { enumerable: true, get: function() { + return upload_1.GridFSBucketWriteStream; + } }); + var mongo_client_1 = require_mongo_client(); + Object.defineProperty(exports2, "MongoClient", { enumerable: true, get: function() { + return mongo_client_1.MongoClient; + } }); + var mongo_types_1 = require_mongo_types(); + Object.defineProperty(exports2, "CancellationToken", { enumerable: true, get: function() { + return mongo_types_1.CancellationToken; + } }); + var sessions_1 = require_sessions(); + Object.defineProperty(exports2, "ClientSession", { enumerable: true, get: function() { + return sessions_1.ClientSession; + } }); + var bson_1 = require_bson2(); + Object.defineProperty(exports2, "BSON", { enumerable: true, get: function() { + return bson_1.BSON; + } }); + var bson_2 = require_bson2(); + Object.defineProperty(exports2, "Binary", { enumerable: true, get: function() { + return bson_2.Binary; + } }); + Object.defineProperty(exports2, "BSONRegExp", { enumerable: true, get: function() { + return bson_2.BSONRegExp; + } }); + Object.defineProperty(exports2, "BSONSymbol", { enumerable: true, get: function() { + return bson_2.BSONSymbol; + } }); + Object.defineProperty(exports2, "BSONType", { enumerable: true, get: function() { + return bson_2.BSONType; + } }); + Object.defineProperty(exports2, "Code", { enumerable: true, get: function() { + return bson_2.Code; + } }); + Object.defineProperty(exports2, "DBRef", { enumerable: true, get: function() { + return bson_2.DBRef; + } }); + Object.defineProperty(exports2, "Decimal128", { enumerable: true, get: function() { + return bson_2.Decimal128; + } }); + Object.defineProperty(exports2, "Double", { enumerable: true, get: function() { + return bson_2.Double; + } }); + Object.defineProperty(exports2, "Int32", { enumerable: true, get: function() { + return bson_2.Int32; + } }); + Object.defineProperty(exports2, "Long", { enumerable: true, get: function() { + return bson_2.Long; + } }); + Object.defineProperty(exports2, "MaxKey", { enumerable: true, get: function() { + return bson_2.MaxKey; + } }); + Object.defineProperty(exports2, "MinKey", { enumerable: true, get: function() { + return bson_2.MinKey; + } }); + Object.defineProperty(exports2, "ObjectId", { enumerable: true, get: function() { + return bson_2.ObjectId; + } }); + Object.defineProperty(exports2, "Timestamp", { enumerable: true, get: function() { + return bson_2.Timestamp; + } }); + Object.defineProperty(exports2, "UUID", { enumerable: true, get: function() { + return bson_2.UUID; + } }); + var common_1 = require_common2(); + Object.defineProperty(exports2, "MongoBulkWriteError", { enumerable: true, get: function() { + return common_1.MongoBulkWriteError; + } }); + var client_encryption_1 = require_client_encryption(); + Object.defineProperty(exports2, "ClientEncryption", { enumerable: true, get: function() { + return client_encryption_1.ClientEncryption; + } }); + var change_stream_cursor_1 = require_change_stream_cursor(); + Object.defineProperty(exports2, "ChangeStreamCursor", { enumerable: true, get: function() { + return change_stream_cursor_1.ChangeStreamCursor; + } }); + var explainable_cursor_1 = require_explainable_cursor(); + Object.defineProperty(exports2, "ExplainableCursor", { enumerable: true, get: function() { + return explainable_cursor_1.ExplainableCursor; + } }); + var error_1 = require_error(); + Object.defineProperty(exports2, "MongoAPIError", { enumerable: true, get: function() { + return error_1.MongoAPIError; + } }); + Object.defineProperty(exports2, "MongoAWSError", { enumerable: true, get: function() { + return error_1.MongoAWSError; + } }); + Object.defineProperty(exports2, "MongoAzureError", { enumerable: true, get: function() { + return error_1.MongoAzureError; + } }); + Object.defineProperty(exports2, "MongoBatchReExecutionError", { enumerable: true, get: function() { + return error_1.MongoBatchReExecutionError; + } }); + Object.defineProperty(exports2, "MongoChangeStreamError", { enumerable: true, get: function() { + return error_1.MongoChangeStreamError; + } }); + Object.defineProperty(exports2, "MongoClientBulkWriteCursorError", { enumerable: true, get: function() { + return error_1.MongoClientBulkWriteCursorError; + } }); + Object.defineProperty(exports2, "MongoClientBulkWriteError", { enumerable: true, get: function() { + return error_1.MongoClientBulkWriteError; + } }); + Object.defineProperty(exports2, "MongoClientBulkWriteExecutionError", { enumerable: true, get: function() { + return error_1.MongoClientBulkWriteExecutionError; + } }); + Object.defineProperty(exports2, "MongoClientClosedError", { enumerable: true, get: function() { + return error_1.MongoClientClosedError; + } }); + Object.defineProperty(exports2, "MongoCompatibilityError", { enumerable: true, get: function() { + return error_1.MongoCompatibilityError; + } }); + Object.defineProperty(exports2, "MongoCursorExhaustedError", { enumerable: true, get: function() { + return error_1.MongoCursorExhaustedError; + } }); + Object.defineProperty(exports2, "MongoCursorInUseError", { enumerable: true, get: function() { + return error_1.MongoCursorInUseError; + } }); + Object.defineProperty(exports2, "MongoDecompressionError", { enumerable: true, get: function() { + return error_1.MongoDecompressionError; + } }); + Object.defineProperty(exports2, "MongoDriverError", { enumerable: true, get: function() { + return error_1.MongoDriverError; + } }); + Object.defineProperty(exports2, "MongoError", { enumerable: true, get: function() { + return error_1.MongoError; + } }); + Object.defineProperty(exports2, "MongoExpiredSessionError", { enumerable: true, get: function() { + return error_1.MongoExpiredSessionError; + } }); + Object.defineProperty(exports2, "MongoGCPError", { enumerable: true, get: function() { + return error_1.MongoGCPError; + } }); + Object.defineProperty(exports2, "MongoGridFSChunkError", { enumerable: true, get: function() { + return error_1.MongoGridFSChunkError; + } }); + Object.defineProperty(exports2, "MongoGridFSStreamError", { enumerable: true, get: function() { + return error_1.MongoGridFSStreamError; + } }); + Object.defineProperty(exports2, "MongoInvalidArgumentError", { enumerable: true, get: function() { + return error_1.MongoInvalidArgumentError; + } }); + Object.defineProperty(exports2, "MongoKerberosError", { enumerable: true, get: function() { + return error_1.MongoKerberosError; + } }); + Object.defineProperty(exports2, "MongoMissingCredentialsError", { enumerable: true, get: function() { + return error_1.MongoMissingCredentialsError; + } }); + Object.defineProperty(exports2, "MongoMissingDependencyError", { enumerable: true, get: function() { + return error_1.MongoMissingDependencyError; + } }); + Object.defineProperty(exports2, "MongoNetworkError", { enumerable: true, get: function() { + return error_1.MongoNetworkError; + } }); + Object.defineProperty(exports2, "MongoNetworkTimeoutError", { enumerable: true, get: function() { + return error_1.MongoNetworkTimeoutError; + } }); + Object.defineProperty(exports2, "MongoNotConnectedError", { enumerable: true, get: function() { + return error_1.MongoNotConnectedError; + } }); + Object.defineProperty(exports2, "MongoOIDCError", { enumerable: true, get: function() { + return error_1.MongoOIDCError; + } }); + Object.defineProperty(exports2, "MongoOperationTimeoutError", { enumerable: true, get: function() { + return error_1.MongoOperationTimeoutError; + } }); + Object.defineProperty(exports2, "MongoParseError", { enumerable: true, get: function() { + return error_1.MongoParseError; + } }); + Object.defineProperty(exports2, "MongoRuntimeError", { enumerable: true, get: function() { + return error_1.MongoRuntimeError; + } }); + Object.defineProperty(exports2, "MongoServerClosedError", { enumerable: true, get: function() { + return error_1.MongoServerClosedError; + } }); + Object.defineProperty(exports2, "MongoServerError", { enumerable: true, get: function() { + return error_1.MongoServerError; + } }); + Object.defineProperty(exports2, "MongoServerSelectionError", { enumerable: true, get: function() { + return error_1.MongoServerSelectionError; + } }); + Object.defineProperty(exports2, "MongoStalePrimaryError", { enumerable: true, get: function() { + return error_1.MongoStalePrimaryError; + } }); + Object.defineProperty(exports2, "MongoSystemError", { enumerable: true, get: function() { + return error_1.MongoSystemError; + } }); + Object.defineProperty(exports2, "MongoTailableCursorError", { enumerable: true, get: function() { + return error_1.MongoTailableCursorError; + } }); + Object.defineProperty(exports2, "MongoTopologyClosedError", { enumerable: true, get: function() { + return error_1.MongoTopologyClosedError; + } }); + Object.defineProperty(exports2, "MongoTransactionError", { enumerable: true, get: function() { + return error_1.MongoTransactionError; + } }); + Object.defineProperty(exports2, "MongoUnexpectedServerResponseError", { enumerable: true, get: function() { + return error_1.MongoUnexpectedServerResponseError; + } }); + Object.defineProperty(exports2, "MongoWriteConcernError", { enumerable: true, get: function() { + return error_1.MongoWriteConcernError; + } }); + var resource_management_1 = require_resource_management(); + Object.defineProperty(exports2, "configureExplicitResourceManagement", { enumerable: true, get: function() { + return resource_management_1.configureExplicitResourceManagement; + } }); + var common_2 = require_common2(); + Object.defineProperty(exports2, "BatchType", { enumerable: true, get: function() { + return common_2.BatchType; + } }); + var auto_encrypter_1 = require_auto_encrypter(); + Object.defineProperty(exports2, "AutoEncryptionLoggerLevel", { enumerable: true, get: function() { + return auto_encrypter_1.AutoEncryptionLoggerLevel; + } }); + var gssapi_1 = require_gssapi(); + Object.defineProperty(exports2, "GSSAPICanonicalizationValue", { enumerable: true, get: function() { + return gssapi_1.GSSAPICanonicalizationValue; + } }); + var providers_1 = require_providers(); + Object.defineProperty(exports2, "AuthMechanism", { enumerable: true, get: function() { + return providers_1.AuthMechanism; + } }); + var compression_1 = require_compression(); + Object.defineProperty(exports2, "Compressor", { enumerable: true, get: function() { + return compression_1.Compressor; + } }); + var abstract_cursor_2 = require_abstract_cursor(); + Object.defineProperty(exports2, "CURSOR_FLAGS", { enumerable: true, get: function() { + return abstract_cursor_2.CURSOR_FLAGS; + } }); + Object.defineProperty(exports2, "CursorTimeoutMode", { enumerable: true, get: function() { + return abstract_cursor_2.CursorTimeoutMode; + } }); + var error_2 = require_error(); + Object.defineProperty(exports2, "MongoErrorLabel", { enumerable: true, get: function() { + return error_2.MongoErrorLabel; + } }); + var explain_1 = require_explain(); + Object.defineProperty(exports2, "ExplainVerbosity", { enumerable: true, get: function() { + return explain_1.ExplainVerbosity; + } }); + var mongo_client_2 = require_mongo_client(); + Object.defineProperty(exports2, "ServerApiVersion", { enumerable: true, get: function() { + return mongo_client_2.ServerApiVersion; + } }); + var mongo_logger_1 = require_mongo_logger(); + Object.defineProperty(exports2, "MongoLoggableComponent", { enumerable: true, get: function() { + return mongo_logger_1.MongoLoggableComponent; + } }); + Object.defineProperty(exports2, "SeverityLevel", { enumerable: true, get: function() { + return mongo_logger_1.SeverityLevel; + } }); + var find_and_modify_1 = require_find_and_modify(); + Object.defineProperty(exports2, "ReturnDocument", { enumerable: true, get: function() { + return find_and_modify_1.ReturnDocument; + } }); + var set_profiling_level_1 = require_set_profiling_level(); + Object.defineProperty(exports2, "ProfilingLevel", { enumerable: true, get: function() { + return set_profiling_level_1.ProfilingLevel; + } }); + var read_concern_1 = require_read_concern(); + Object.defineProperty(exports2, "ReadConcernLevel", { enumerable: true, get: function() { + return read_concern_1.ReadConcernLevel; + } }); + var read_preference_1 = require_read_preference(); + Object.defineProperty(exports2, "ReadPreferenceMode", { enumerable: true, get: function() { + return read_preference_1.ReadPreferenceMode; + } }); + var common_3 = require_common(); + Object.defineProperty(exports2, "ServerType", { enumerable: true, get: function() { + return common_3.ServerType; + } }); + Object.defineProperty(exports2, "TopologyType", { enumerable: true, get: function() { + return common_3.TopologyType; + } }); + var read_concern_2 = require_read_concern(); + Object.defineProperty(exports2, "ReadConcern", { enumerable: true, get: function() { + return read_concern_2.ReadConcern; + } }); + var read_preference_2 = require_read_preference(); + Object.defineProperty(exports2, "ReadPreference", { enumerable: true, get: function() { + return read_preference_2.ReadPreference; + } }); + var write_concern_1 = require_write_concern(); + Object.defineProperty(exports2, "WriteConcern", { enumerable: true, get: function() { + return write_concern_1.WriteConcern; + } }); + var command_monitoring_events_1 = require_command_monitoring_events(); + Object.defineProperty(exports2, "CommandFailedEvent", { enumerable: true, get: function() { + return command_monitoring_events_1.CommandFailedEvent; + } }); + Object.defineProperty(exports2, "CommandStartedEvent", { enumerable: true, get: function() { + return command_monitoring_events_1.CommandStartedEvent; + } }); + Object.defineProperty(exports2, "CommandSucceededEvent", { enumerable: true, get: function() { + return command_monitoring_events_1.CommandSucceededEvent; + } }); + var connection_pool_events_1 = require_connection_pool_events(); + Object.defineProperty(exports2, "ConnectionCheckedInEvent", { enumerable: true, get: function() { + return connection_pool_events_1.ConnectionCheckedInEvent; + } }); + Object.defineProperty(exports2, "ConnectionCheckedOutEvent", { enumerable: true, get: function() { + return connection_pool_events_1.ConnectionCheckedOutEvent; + } }); + Object.defineProperty(exports2, "ConnectionCheckOutFailedEvent", { enumerable: true, get: function() { + return connection_pool_events_1.ConnectionCheckOutFailedEvent; + } }); + Object.defineProperty(exports2, "ConnectionCheckOutStartedEvent", { enumerable: true, get: function() { + return connection_pool_events_1.ConnectionCheckOutStartedEvent; + } }); + Object.defineProperty(exports2, "ConnectionClosedEvent", { enumerable: true, get: function() { + return connection_pool_events_1.ConnectionClosedEvent; + } }); + Object.defineProperty(exports2, "ConnectionCreatedEvent", { enumerable: true, get: function() { + return connection_pool_events_1.ConnectionCreatedEvent; + } }); + Object.defineProperty(exports2, "ConnectionPoolClearedEvent", { enumerable: true, get: function() { + return connection_pool_events_1.ConnectionPoolClearedEvent; + } }); + Object.defineProperty(exports2, "ConnectionPoolClosedEvent", { enumerable: true, get: function() { + return connection_pool_events_1.ConnectionPoolClosedEvent; + } }); + Object.defineProperty(exports2, "ConnectionPoolCreatedEvent", { enumerable: true, get: function() { + return connection_pool_events_1.ConnectionPoolCreatedEvent; + } }); + Object.defineProperty(exports2, "ConnectionPoolMonitoringEvent", { enumerable: true, get: function() { + return connection_pool_events_1.ConnectionPoolMonitoringEvent; + } }); + Object.defineProperty(exports2, "ConnectionPoolReadyEvent", { enumerable: true, get: function() { + return connection_pool_events_1.ConnectionPoolReadyEvent; + } }); + Object.defineProperty(exports2, "ConnectionReadyEvent", { enumerable: true, get: function() { + return connection_pool_events_1.ConnectionReadyEvent; + } }); + var events_1 = require_events(); + Object.defineProperty(exports2, "ServerClosedEvent", { enumerable: true, get: function() { + return events_1.ServerClosedEvent; + } }); + Object.defineProperty(exports2, "ServerDescriptionChangedEvent", { enumerable: true, get: function() { + return events_1.ServerDescriptionChangedEvent; + } }); + Object.defineProperty(exports2, "ServerHeartbeatFailedEvent", { enumerable: true, get: function() { + return events_1.ServerHeartbeatFailedEvent; + } }); + Object.defineProperty(exports2, "ServerHeartbeatStartedEvent", { enumerable: true, get: function() { + return events_1.ServerHeartbeatStartedEvent; + } }); + Object.defineProperty(exports2, "ServerHeartbeatSucceededEvent", { enumerable: true, get: function() { + return events_1.ServerHeartbeatSucceededEvent; + } }); + Object.defineProperty(exports2, "ServerOpeningEvent", { enumerable: true, get: function() { + return events_1.ServerOpeningEvent; + } }); + Object.defineProperty(exports2, "TopologyClosedEvent", { enumerable: true, get: function() { + return events_1.TopologyClosedEvent; + } }); + Object.defineProperty(exports2, "TopologyDescriptionChangedEvent", { enumerable: true, get: function() { + return events_1.TopologyDescriptionChangedEvent; + } }); + Object.defineProperty(exports2, "TopologyOpeningEvent", { enumerable: true, get: function() { + return events_1.TopologyOpeningEvent; + } }); + var server_selection_events_1 = require_server_selection_events(); + Object.defineProperty(exports2, "ServerSelectionEvent", { enumerable: true, get: function() { + return server_selection_events_1.ServerSelectionEvent; + } }); + Object.defineProperty(exports2, "ServerSelectionFailedEvent", { enumerable: true, get: function() { + return server_selection_events_1.ServerSelectionFailedEvent; + } }); + Object.defineProperty(exports2, "ServerSelectionStartedEvent", { enumerable: true, get: function() { + return server_selection_events_1.ServerSelectionStartedEvent; + } }); + Object.defineProperty(exports2, "ServerSelectionSucceededEvent", { enumerable: true, get: function() { + return server_selection_events_1.ServerSelectionSucceededEvent; + } }); + Object.defineProperty(exports2, "WaitingForSuitableServerEvent", { enumerable: true, get: function() { + return server_selection_events_1.WaitingForSuitableServerEvent; + } }); + var srv_polling_1 = require_srv_polling(); + Object.defineProperty(exports2, "SrvPollingEvent", { enumerable: true, get: function() { + return srv_polling_1.SrvPollingEvent; + } }); + var errors_1 = require_errors(); + Object.defineProperty(exports2, "MongoCryptAzureKMSRequestError", { enumerable: true, get: function() { + return errors_1.MongoCryptAzureKMSRequestError; + } }); + Object.defineProperty(exports2, "MongoCryptCreateDataKeyError", { enumerable: true, get: function() { + return errors_1.MongoCryptCreateDataKeyError; + } }); + Object.defineProperty(exports2, "MongoCryptCreateEncryptedCollectionError", { enumerable: true, get: function() { + return errors_1.MongoCryptCreateEncryptedCollectionError; + } }); + Object.defineProperty(exports2, "MongoCryptError", { enumerable: true, get: function() { + return errors_1.MongoCryptError; + } }); + Object.defineProperty(exports2, "MongoCryptInvalidArgumentError", { enumerable: true, get: function() { + return errors_1.MongoCryptInvalidArgumentError; + } }); + Object.defineProperty(exports2, "MongoCryptKMSRequestNetworkTimeoutError", { enumerable: true, get: function() { + return errors_1.MongoCryptKMSRequestNetworkTimeoutError; + } }); + var mongo_client_auth_providers_1 = require_mongo_client_auth_providers(); + Object.defineProperty(exports2, "MongoClientAuthProviders", { enumerable: true, get: function() { + return mongo_client_auth_providers_1.MongoClientAuthProviders; + } }); + } +}); + +// node_modules/mongoose/lib/helpers/symbols.js +var require_symbols = __commonJS({ + "node_modules/mongoose/lib/helpers/symbols.js"(exports2) { + "use strict"; + exports2.arrayAtomicsBackupSymbol = /* @__PURE__ */ Symbol("mongoose#Array#atomicsBackup"); + exports2.arrayAtomicsSymbol = /* @__PURE__ */ Symbol("mongoose#Array#_atomics"); + exports2.arrayParentSymbol = /* @__PURE__ */ Symbol("mongoose#Array#_parent"); + exports2.arrayPathSymbol = /* @__PURE__ */ Symbol("mongoose#Array#_path"); + exports2.arraySchemaSymbol = /* @__PURE__ */ Symbol("mongoose#Array#_schema"); + exports2.documentArrayParent = /* @__PURE__ */ Symbol("mongoose#documentArrayParent"); + exports2.documentIsSelected = /* @__PURE__ */ Symbol("mongoose#Document#isSelected"); + exports2.documentIsModified = /* @__PURE__ */ Symbol("mongoose#Document#isModified"); + exports2.documentModifiedPaths = /* @__PURE__ */ Symbol("mongoose#Document#modifiedPaths"); + exports2.documentSchemaSymbol = /* @__PURE__ */ Symbol("mongoose#Document#schema"); + exports2.getSymbol = /* @__PURE__ */ Symbol("mongoose#Document#get"); + exports2.modelSymbol = /* @__PURE__ */ Symbol("mongoose#Model"); + exports2.objectIdSymbol = /* @__PURE__ */ Symbol("mongoose#ObjectId"); + exports2.populateModelSymbol = /* @__PURE__ */ Symbol("mongoose#PopulateOptions#Model"); + exports2.schemaTypeSymbol = /* @__PURE__ */ Symbol("mongoose#schemaType"); + exports2.sessionNewDocuments = /* @__PURE__ */ Symbol("mongoose#ClientSession#newDocuments"); + exports2.scopeSymbol = /* @__PURE__ */ Symbol("mongoose#Document#scope"); + exports2.validatorErrorSymbol = /* @__PURE__ */ Symbol("mongoose#validatorError"); + } +}); + +// node_modules/mongoose/lib/types/objectid.js +var require_objectid = __commonJS({ + "node_modules/mongoose/lib/types/objectid.js"(exports2, module2) { + "use strict"; + var ObjectId2 = require_bson().ObjectId; + var objectIdSymbol = require_symbols().objectIdSymbol; + Object.defineProperty(ObjectId2.prototype, "_id", { + enumerable: false, + configurable: true, + get: function() { + return this; + } + }); + if (!Object.hasOwn(ObjectId2.prototype, "valueOf")) { + ObjectId2.prototype.valueOf = function objectIdValueOf() { + return this.toString(); + }; + } + ObjectId2.prototype[objectIdSymbol] = true; + module2.exports = ObjectId2; + } +}); + +// node_modules/mongoose/lib/helpers/getConstructorName.js +var require_getConstructorName = __commonJS({ + "node_modules/mongoose/lib/helpers/getConstructorName.js"(exports2, module2) { + "use strict"; + module2.exports = function getConstructorName(val) { + if (val == null) { + return void 0; + } + if (typeof val.constructor !== "function") { + return void 0; + } + return val.constructor.name; + }; + } +}); + +// node_modules/mongoose/lib/options.js +var require_options = __commonJS({ + "node_modules/mongoose/lib/options.js"(exports2) { + "use strict"; + exports2.internalToObjectOptions = { + transform: false, + virtuals: false, + getters: false, + _skipDepopulateTopLevel: true, + depopulate: true, + flattenDecimals: false, + useProjection: false, + versionKey: true, + flattenObjectIds: false + }; + } +}); + +// node_modules/mongoose/lib/types/decimal128.js +var require_decimal128 = __commonJS({ + "node_modules/mongoose/lib/types/decimal128.js"(exports2, module2) { + "use strict"; + module2.exports = require_bson().Decimal128; + } +}); + +// node_modules/mongoose/lib/helpers/specialProperties.js +var require_specialProperties = __commonJS({ + "node_modules/mongoose/lib/helpers/specialProperties.js"(exports2, module2) { + "use strict"; + module2.exports = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]); + } +}); + +// node_modules/mongoose/lib/types/array/isMongooseArray.js +var require_isMongooseArray = __commonJS({ + "node_modules/mongoose/lib/types/array/isMongooseArray.js"(exports2) { + "use strict"; + exports2.isMongooseArray = function(mongooseArray) { + return Array.isArray(mongooseArray) && mongooseArray.isMongooseArray; + }; + } +}); + +// node_modules/mongoose/lib/helpers/isMongooseObject.js +var require_isMongooseObject = __commonJS({ + "node_modules/mongoose/lib/helpers/isMongooseObject.js"(exports2, module2) { + "use strict"; + var isMongooseArray = require_isMongooseArray().isMongooseArray; + module2.exports = function(v4) { + return v4 != null && (isMongooseArray(v4) || // Array or Document Array + v4.$__ != null || // Document + v4.isMongooseBuffer || // Buffer + v4.$isMongooseMap); + }; + } +}); + +// node_modules/mongoose/lib/helpers/getFunctionName.js +var require_getFunctionName = __commonJS({ + "node_modules/mongoose/lib/helpers/getFunctionName.js"(exports2, module2) { + "use strict"; + var functionNameRE = /^function\s*([^\s(]+)/; + module2.exports = function(fn2) { + return fn2.name || (fn2.toString().trim().match(functionNameRE) || [])[1]; + }; + } +}); + +// node_modules/mongoose/lib/helpers/isBsonType.js +var require_isBsonType = __commonJS({ + "node_modules/mongoose/lib/helpers/isBsonType.js"(exports2, module2) { + "use strict"; + function isBsonType(obj, typename) { + return obj != null && obj._bsontype === typename; + } + module2.exports = isBsonType; + } +}); + +// node_modules/mongoose/lib/helpers/isObject.js +var require_isObject = __commonJS({ + "node_modules/mongoose/lib/helpers/isObject.js"(exports2, module2) { + "use strict"; + module2.exports = function(arg) { + return Buffer.isBuffer(arg) || Object.prototype.toString.call(arg) === "[object Object]"; + }; + } +}); + +// node_modules/mongoose/lib/helpers/isPOJO.js +var require_isPOJO = __commonJS({ + "node_modules/mongoose/lib/helpers/isPOJO.js"(exports2, module2) { + "use strict"; + module2.exports = function isPOJO(arg) { + if (arg == null || typeof arg !== "object") { + return false; + } + const proto = Object.getPrototypeOf(arg); + return !proto || proto.constructor.name === "Object"; + }; + } +}); + +// node_modules/mongoose/lib/helpers/query/trusted.js +var require_trusted = __commonJS({ + "node_modules/mongoose/lib/helpers/query/trusted.js"(exports2) { + "use strict"; + var trustedSymbol = /* @__PURE__ */ Symbol("mongoose#trustedSymbol"); + exports2.trustedSymbol = trustedSymbol; + exports2.trusted = function trusted(obj) { + if (obj == null || typeof obj !== "object") { + return obj; + } + obj[trustedSymbol] = true; + return obj; + }; + } +}); + +// node_modules/mongoose/lib/helpers/clone.js +var require_clone = __commonJS({ + "node_modules/mongoose/lib/helpers/clone.js"(exports2, module2) { + "use strict"; + var Decimal = require_decimal128(); + var ObjectId2 = require_objectid(); + var specialProperties = require_specialProperties(); + var isMongooseObject = require_isMongooseObject(); + var getFunctionName = require_getFunctionName(); + var isBsonType = require_isBsonType(); + var isMongooseArray = require_isMongooseArray().isMongooseArray; + var isObject = require_isObject(); + var isPOJO = require_isPOJO(); + var symbols = require_symbols(); + var trustedSymbol = require_trusted().trustedSymbol; + var BSON = require_bson(); + function clone(obj, options, isArrayChild) { + if (obj == null) { + return obj; + } + if (isBsonType(obj, "Double")) { + return new BSON.Double(obj.value); + } + if (typeof obj === "number" || typeof obj === "string" || typeof obj === "boolean" || typeof obj === "bigint") { + return obj; + } + if (Array.isArray(obj)) { + return cloneArray(obj, options); + } + if (isMongooseObject(obj)) { + if (options) { + if (options.retainDocuments && obj.$__ != null) { + const clonedDoc = obj.$clone(); + if (obj.__index != null) { + clonedDoc.__index = obj.__index; + } + if (obj.__parentArray != null) { + clonedDoc.__parentArray = obj.__parentArray; + } + clonedDoc.$__parent = obj.$__parent; + return clonedDoc; + } + } + if (isPOJO(obj) && obj.$__ != null && obj._doc != null) { + return obj._doc; + } + let ret; + if (options && options.json && typeof obj.toJSON === "function") { + ret = obj.toJSON(options); + } else { + ret = obj.toObject(options); + } + return ret; + } + const objConstructor = obj.constructor; + if (objConstructor) { + switch (getFunctionName(objConstructor)) { + case "Object": + return cloneObject(obj, options, isArrayChild); + case "Date": + return new objConstructor(+obj); + case "RegExp": + return cloneRegExp(obj); + default: + break; + } + } + if (isBsonType(obj, "ObjectId")) { + if (options && options.flattenObjectIds) { + return obj.toJSON(); + } + return new ObjectId2(obj.id); + } + if (isBsonType(obj, "Decimal128")) { + if (options && options.flattenDecimals) { + return obj.toJSON(); + } + return Decimal.fromString(obj.toString()); + } + if (!objConstructor && isObject(obj)) { + return cloneObject(obj, options, isArrayChild); + } + if (typeof obj === "object" && obj[symbols.schemaTypeSymbol]) { + return obj.clone(); + } + if (options && options.bson && typeof obj.toBSON === "function") { + return obj; + } + if (typeof obj.valueOf === "function") { + return obj.valueOf(); + } + return cloneObject(obj, options, isArrayChild); + } + module2.exports = clone; + function cloneObject(obj, options, isArrayChild) { + const minimize = options && options.minimize; + const omitUndefined = options && options.omitUndefined; + const seen = options && options._seen; + const ret = {}; + let hasKeys; + if (seen && seen.has(obj)) { + return seen.get(obj); + } else if (seen) { + seen.set(obj, ret); + } + if (trustedSymbol in obj && options?.copyTrustedSymbol !== false) { + ret[trustedSymbol] = obj[trustedSymbol]; + } + const keys = Object.keys(obj); + const len = keys.length; + for (let i4 = 0; i4 < len; ++i4) { + const key = keys[i4]; + if (specialProperties.has(key)) { + continue; + } + const val = clone(obj[key], options, false); + if ((minimize === false || omitUndefined) && typeof val === "undefined") { + delete ret[key]; + } else if (minimize !== true || typeof val !== "undefined") { + hasKeys || (hasKeys = true); + ret[key] = val; + } + } + return minimize && !isArrayChild ? hasKeys && ret : ret; + } + function cloneArray(arr, options) { + let i4 = 0; + const len = arr.length; + let ret = null; + if (options?.retainDocuments) { + if (arr.isMongooseDocumentArray) { + ret = new (arr.$schemaType()).schema.base.Types.DocumentArray([], arr.$path(), arr.$parent(), arr.$schemaType()); + } else if (arr.isMongooseArray) { + ret = new (arr.$parent()).schema.base.Types.Array([], arr.$path(), arr.$parent(), arr.$schemaType()); + } else { + ret = new Array(len); + } + } else { + ret = new Array(len); + } + arr = isMongooseArray(arr) ? arr.__array : arr; + for (i4 = 0; i4 < len; ++i4) { + ret[i4] = clone(arr[i4], options, true); + } + return ret; + } + function cloneRegExp(regexp) { + const ret = new RegExp(regexp.source, regexp.flags); + if (ret.lastIndex !== regexp.lastIndex) { + ret.lastIndex = regexp.lastIndex; + } + return ret; + } + } +}); + +// node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js +var require_collection3 = __commonJS({ + "node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js"(exports2, module2) { + "use strict"; + var MongooseCollection = require_collection(); + var MongooseError = require_mongooseError(); + var Collection = require_lib6().Collection; + var ObjectId2 = require_objectid(); + var getConstructorName = require_getConstructorName(); + var internalToObjectOptions = require_options().internalToObjectOptions; + var stream = require("stream"); + var util = require("util"); + var formatToObjectOptions = Object.freeze({ ...internalToObjectOptions, copyTrustedSymbol: false }); + function NativeCollection(name, conn, options) { + this.collection = null; + this.Promise = options.Promise || Promise; + this.modelName = options.modelName; + delete options.modelName; + this._closed = false; + MongooseCollection.apply(this, arguments); + } + Object.setPrototypeOf(NativeCollection.prototype, MongooseCollection.prototype); + NativeCollection.prototype.onOpen = function() { + this.collection = this.conn.db.collection(this.name); + MongooseCollection.prototype.onOpen.call(this); + return this.collection; + }; + NativeCollection.prototype.onClose = function(force) { + MongooseCollection.prototype.onClose.call(this, force); + }; + NativeCollection.prototype._getCollection = function _getCollection() { + if (this.collection) { + return this.collection; + } + if (this.conn.db != null) { + this.collection = this.conn.db.collection(this.name); + return this.collection; + } + return null; + }; + var syncCollectionMethods = { watch: true, find: true, aggregate: true }; + function iter(i4) { + NativeCollection.prototype[i4] = function() { + const collection = this._getCollection(); + const args2 = Array.from(arguments); + const _this = this; + const globalDebug = _this && _this.conn && _this.conn.base && _this.conn.base.options && _this.conn.base.options.debug; + const connectionDebug = _this && _this.conn && _this.conn.options && _this.conn.options.debug; + const debug = connectionDebug == null ? globalDebug : connectionDebug; + const lastArg = arguments[arguments.length - 1]; + const opId = new ObjectId2(); + if (this.conn.$wasForceClosed) { + const error2 = new MongooseError("Connection was force closed"); + if (args2.length > 0 && typeof args2[args2.length - 1] === "function") { + args2[args2.length - 1](error2); + return; + } else { + throw error2; + } + } + let _args = args2; + let callback = null; + if (this._shouldBufferCommands() && this.buffer) { + this.conn.emit("buffer", { + _id: opId, + modelName: _this.modelName, + collectionName: _this.name, + method: i4, + args: args2 + }); + let callback2; + let _args2 = args2; + let promise = null; + let timeout = null; + if (syncCollectionMethods[i4] && typeof lastArg === "function") { + this.addQueue(i4, _args2); + callback2 = lastArg; + } else if (syncCollectionMethods[i4]) { + promise = new this.Promise((resolve, reject) => { + callback2 = function collectionOperationCallback(err, res) { + if (timeout != null) { + clearTimeout(timeout); + } + if (err != null) { + return reject(err); + } + resolve(res); + }; + _args2 = args2.concat([callback2]); + this.addQueue(i4, _args2); + }); + } else if (typeof lastArg === "function") { + callback2 = function collectionOperationCallback() { + if (timeout != null) { + clearTimeout(timeout); + } + return lastArg.apply(this, arguments); + }; + _args2 = args2.slice(0, args2.length - 1).concat([callback2]); + } else { + promise = new Promise((resolve, reject) => { + callback2 = function collectionOperationCallback(err, res) { + if (timeout != null) { + clearTimeout(timeout); + } + if (err != null) { + return reject(err); + } + resolve(res); + }; + _args2 = args2.concat([callback2]); + this.addQueue(i4, _args2); + }); + } + const bufferTimeoutMS = this._getBufferTimeoutMS(); + timeout = setTimeout(() => { + const removed = this.removeQueue(i4, _args2); + if (removed) { + const message2 = "Operation `" + this.name + "." + i4 + "()` buffering timed out after " + bufferTimeoutMS + "ms"; + const err = new MongooseError(message2); + this.conn.emit("buffer-end", { _id: opId, modelName: _this.modelName, collectionName: _this.name, method: i4, error: err }); + callback2(err); + } + }, bufferTimeoutMS); + if (!syncCollectionMethods[i4] && typeof lastArg === "function") { + this.addQueue(i4, _args2); + return; + } + return promise; + } else if (!syncCollectionMethods[i4] && typeof lastArg === "function") { + callback = function collectionOperationCallback(err, res) { + if (err != null) { + _this.conn.emit("operation-end", { _id: opId, modelName: _this.modelName, collectionName: _this.name, method: i4, error: err }); + } else { + _this.conn.emit("operation-end", { _id: opId, modelName: _this.modelName, collectionName: _this.name, method: i4, result: res }); + } + return lastArg.apply(this, arguments); + }; + _args = args2.slice(0, args2.length - 1).concat([callback]); + } + if (debug) { + if (typeof debug === "function") { + let argsToAdd = null; + if (typeof args2[args2.length - 1] == "function") { + argsToAdd = args2.slice(0, args2.length - 1); + } else { + argsToAdd = args2; + } + debug.apply( + _this, + [_this.name, i4].concat(argsToAdd) + ); + } else if (debug instanceof stream.Writable) { + this.$printToStream(_this.name, i4, args2, debug); + } else { + const color = debug.color == null ? true : debug.color; + const shell = debug.shell == null ? false : debug.shell; + this.$print(_this.name, i4, args2, color, shell); + } + } + this.conn.emit("operation-start", { _id: opId, modelName: _this.modelName, collectionName: this.name, method: i4, params: _args }); + try { + if (collection == null) { + const message2 = "Cannot call `" + this.name + "." + i4 + "()` before initial connection is complete if `bufferCommands = false`. Make sure you `await mongoose.connect()` if you have `bufferCommands = false`."; + throw new MongooseError(message2); + } + if (syncCollectionMethods[i4] && typeof lastArg === "function") { + const result = collection[i4].apply(collection, _args.slice(0, _args.length - 1)); + this.conn.emit("operation-end", { _id: opId, modelName: _this.modelName, collectionName: this.name, method: i4, result }); + return lastArg.call(this, null, result); + } + const ret = collection[i4].apply(collection, _args); + if (ret != null && typeof ret.then === "function") { + return ret.then( + (result) => { + if (typeof lastArg === "function") { + lastArg(null, result); + } else { + this.conn.emit("operation-end", { _id: opId, modelName: _this.modelName, collectionName: this.name, method: i4, result }); + } + return result; + }, + (error2) => { + if (typeof lastArg === "function") { + lastArg(error2); + return; + } else { + this.conn.emit("operation-end", { _id: opId, modelName: _this.modelName, collectionName: this.name, method: i4, error: error2 }); + } + throw error2; + } + ); + } + return ret; + } catch (error2) { + if (typeof lastArg === "function") { + return lastArg(error2); + } else { + this.conn.emit("operation-end", { _id: opId, modelName: _this.modelName, collectionName: this.name, method: i4, error: error2 }); + throw error2; + } + } + }; + } + for (const key of Object.getOwnPropertyNames(Collection.prototype)) { + const descriptor = Object.getOwnPropertyDescriptor(Collection.prototype, key); + if (descriptor.get !== void 0) { + continue; + } + if (typeof Collection.prototype[key] !== "function") { + continue; + } + iter(key); + } + NativeCollection.prototype.$print = function(name, i4, args2, color, shell) { + const moduleName = color ? "\x1B[0;36mMongoose:\x1B[0m " : "Mongoose: "; + const functionCall = [name, i4].join("."); + const _args = []; + for (let j4 = args2.length - 1; j4 >= 0; --j4) { + if (this.$format(args2[j4]) || _args.length) { + _args.unshift(this.$format(args2[j4], color, shell)); + } + } + const params = "(" + _args.join(", ") + ")"; + console.info(moduleName + functionCall + params); + }; + NativeCollection.prototype.$printToStream = function(name, i4, args2, stream2) { + const functionCall = [name, i4].join("."); + const _args = []; + for (let j4 = args2.length - 1; j4 >= 0; --j4) { + if (this.$format(args2[j4]) || _args.length) { + _args.unshift(this.$format(args2[j4])); + } + } + const params = "(" + _args.join(", ") + ")"; + stream2.write(functionCall + params, "utf8"); + }; + NativeCollection.prototype.$format = function(arg, color, shell) { + const type = typeof arg; + if (type === "function" || type === "undefined") return ""; + return format2(arg, false, color, shell); + }; + function inspectable(representation) { + const ret = { + inspect: function() { + return representation; + } + }; + if (util.inspect.custom) { + ret[util.inspect.custom] = ret.inspect; + } + return ret; + } + function map2(o4) { + return format2(o4, true); + } + function formatObjectId(x4, key) { + x4[key] = inspectable('ObjectId("' + x4[key].toHexString() + '")'); + } + function formatDate(x4, key, shell) { + if (shell) { + x4[key] = inspectable('ISODate("' + x4[key].toUTCString() + '")'); + } else { + x4[key] = inspectable('new Date("' + x4[key].toUTCString() + '")'); + } + } + function format2(obj, sub, color, shell) { + if (obj && typeof obj.toBSON === "function") { + obj = obj.toBSON(); + } + if (obj == null) { + return obj; + } + const clone = require_clone(); + let x4 = sub ? obj : clone(obj, formatToObjectOptions); + const constructorName = getConstructorName(x4); + if (constructorName === "Binary") { + x4 = "BinData(" + x4.sub_type + ', "' + x4.toString("base64") + '")'; + } else if (constructorName === "ObjectId") { + x4 = inspectable('ObjectId("' + x4.toHexString() + '")'); + } else if (constructorName === "Date") { + x4 = inspectable('new Date("' + x4.toUTCString() + '")'); + } else if (constructorName === "Object") { + const keys = Object.keys(x4); + const numKeys = keys.length; + let key; + for (let i4 = 0; i4 < numKeys; ++i4) { + key = keys[i4]; + if (x4[key]) { + let error2; + if (typeof x4[key].toBSON === "function") { + try { + x4[key] = x4[key].toBSON(); + } catch (_error) { + error2 = _error; + } + } + const _constructorName = getConstructorName(x4[key]); + if (_constructorName === "Binary") { + x4[key] = "BinData(" + x4[key].sub_type + ', "' + x4[key].buffer.toString("base64") + '")'; + } else if (_constructorName === "Object") { + x4[key] = format2(x4[key], true); + } else if (_constructorName === "ObjectId") { + formatObjectId(x4, key); + } else if (_constructorName === "Date") { + formatDate(x4, key, shell); + } else if (_constructorName === "ClientSession") { + x4[key] = inspectable('ClientSession("' + (x4[key] && x4[key].id && x4[key].id.id && x4[key].id.id.buffer || "").toString("hex") + '")'); + } else if (Array.isArray(x4[key])) { + x4[key] = x4[key].map(map2); + } else if (error2 != null) { + throw error2; + } + } + } + } + if (sub) { + return x4; + } + return util.inspect(x4, false, 10, color).replace(/\n/g, "").replace(/\s{2,}/g, " "); + } + NativeCollection.prototype.getIndexes = NativeCollection.prototype.indexInformation; + module2.exports = NativeCollection; + } +}); + +// node_modules/mongoose/lib/cursor/changeStream.js +var require_changeStream = __commonJS({ + "node_modules/mongoose/lib/cursor/changeStream.js"(exports2, module2) { + "use strict"; + var EventEmitter = require("events").EventEmitter; + var MongooseError = require_mongooseError(); + var driverChangeStreamEvents = ["close", "change", "end", "error", "resumeTokenChanged"]; + var ChangeStream = class extends EventEmitter { + constructor(changeStreamThunk, pipeline, options) { + super(); + this.driverChangeStream = null; + this.closed = false; + this.bindedEvents = false; + this.pipeline = pipeline; + this.options = options; + this.errored = false; + if (options && options.hydrate && !options.model) { + throw new Error( + "Cannot create change stream with `hydrate: true` unless calling `Model.watch()`" + ); + } + let syncError = null; + this.$driverChangeStreamPromise = new Promise((resolve, reject) => { + try { + changeStreamThunk((err, driverChangeStream) => { + if (err != null) { + this.errored = true; + this.emit("error", err); + return reject(err); + } + this.driverChangeStream = driverChangeStream; + this.emit("ready"); + resolve(); + }); + } catch (err) { + syncError = err; + this.errored = true; + this.emit("error", err); + reject(err); + } + }); + if (syncError != null) { + throw syncError; + } + } + _bindEvents() { + if (this.bindedEvents) { + return; + } + this.bindedEvents = true; + if (this.driverChangeStream == null) { + this.$driverChangeStreamPromise.then( + () => { + this.driverChangeStream.on("close", () => { + this.closed = true; + }); + driverChangeStreamEvents.forEach((ev) => { + this.driverChangeStream.on(ev, (data2) => { + if (data2 != null && data2.fullDocument != null && this.options && this.options.hydrate) { + data2.fullDocument = this.options.model.hydrate(data2.fullDocument); + } + this.emit(ev, data2); + }); + }); + }, + () => { + } + // No need to register events if opening change stream failed + ); + return; + } + this.driverChangeStream.on("close", () => { + this.closed = true; + }); + driverChangeStreamEvents.forEach((ev) => { + this.driverChangeStream.on(ev, (data2) => { + if (data2 != null && data2.fullDocument != null && this.options && this.options.hydrate) { + data2.fullDocument = this.options.model.hydrate(data2.fullDocument); + } + this.emit(ev, data2); + }); + }); + } + hasNext(cb) { + if (this.errored) { + throw new MongooseError("Cannot call hasNext() on errored ChangeStream"); + } + return this.driverChangeStream.hasNext(cb); + } + next(cb) { + if (this.errored) { + throw new MongooseError("Cannot call next() on errored ChangeStream"); + } + if (this.options && this.options.hydrate) { + if (cb != null) { + const originalCb = cb; + cb = (err, data2) => { + if (err != null) { + return originalCb(err); + } + if (data2.fullDocument != null) { + data2.fullDocument = this.options.model.hydrate(data2.fullDocument); + } + return originalCb(null, data2); + }; + } + let maybePromise = this.driverChangeStream.next(cb); + if (maybePromise && typeof maybePromise.then === "function") { + maybePromise = maybePromise.then((data2) => { + if (data2.fullDocument != null) { + data2.fullDocument = this.options.model.hydrate(data2.fullDocument); + } + return data2; + }); + } + return maybePromise; + } + return this.driverChangeStream.next(cb); + } + addListener(event, handler2) { + if (this.errored) { + throw new MongooseError("Cannot call addListener() on errored ChangeStream"); + } + this._bindEvents(); + return super.addListener(event, handler2); + } + on(event, handler2) { + if (this.errored) { + throw new MongooseError("Cannot call on() on errored ChangeStream"); + } + this._bindEvents(); + return super.on(event, handler2); + } + once(event, handler2) { + if (this.errored) { + throw new MongooseError("Cannot call once() on errored ChangeStream"); + } + this._bindEvents(); + return super.once(event, handler2); + } + _queue(cb) { + this.once("ready", () => cb()); + } + close() { + this.closed = true; + if (this.driverChangeStream) { + return this.driverChangeStream.close(); + } else { + return this.$driverChangeStreamPromise.then( + () => this.driverChangeStream.close(), + () => { + } + // No need to close if opening the change stream failed + ); + } + } + }; + module2.exports = ChangeStream; + } +}); + +// node_modules/kareem/index.js +var require_kareem = __commonJS({ + "node_modules/kareem/index.js"(exports2, module2) { + "use strict"; + function Kareem() { + this._pres = /* @__PURE__ */ new Map(); + this._posts = /* @__PURE__ */ new Map(); + } + Kareem.skipWrappedFunction = function skipWrappedFunction() { + if (!(this instanceof Kareem.skipWrappedFunction)) { + return new Kareem.skipWrappedFunction(...arguments); + } + this.args = [...arguments]; + }; + Kareem.overwriteResult = function overwriteResult() { + if (!(this instanceof Kareem.overwriteResult)) { + return new Kareem.overwriteResult(...arguments); + } + this.args = [...arguments]; + }; + Kareem.prototype.execPre = function(name, context, args2, callback) { + if (arguments.length === 3) { + callback = args2; + args2 = []; + } + const pres = this._pres.get(name) || []; + const numPres = pres.length; + const numAsyncPres = pres.numAsync || 0; + let currentPre = 0; + let asyncPresLeft = numAsyncPres; + let done = false; + const $args = args2; + let shouldSkipWrappedFunction = null; + if (!numPres) { + return nextTick(function() { + callback(null); + }); + } + function next() { + if (currentPre >= numPres) { + return; + } + const pre = pres[currentPre]; + if (pre.isAsync) { + const args3 = [ + decorateNextFn(_next), + decorateNextFn(function(error2) { + if (error2) { + if (done) { + return; + } + if (error2 instanceof Kareem.skipWrappedFunction) { + shouldSkipWrappedFunction = error2; + } else { + done = true; + return callback(error2); + } + } + if (--asyncPresLeft === 0 && currentPre >= numPres) { + return callback(shouldSkipWrappedFunction); + } + }) + ]; + callMiddlewareFunction(pre.fn, context, args3, args3[0]); + } else if (pre.fn.length > 0) { + const args3 = [decorateNextFn(_next)]; + const _args = arguments.length >= 2 ? arguments : [null].concat($args); + for (let i4 = 1; i4 < _args.length; ++i4) { + if (i4 === _args.length - 1 && typeof _args[i4] === "function") { + continue; + } + args3.push(_args[i4]); + } + callMiddlewareFunction(pre.fn, context, args3, args3[0]); + } else { + let maybePromiseLike = null; + try { + maybePromiseLike = pre.fn.call(context); + } catch (err) { + if (err != null) { + return callback(err); + } + } + if (isPromiseLike(maybePromiseLike)) { + maybePromiseLike.then(() => _next(), (err) => _next(err)); + } else { + if (++currentPre >= numPres) { + if (asyncPresLeft > 0) { + return; + } else { + return nextTick(function() { + callback(shouldSkipWrappedFunction); + }); + } + } + next(); + } + } + } + next.apply(null, [null].concat(args2)); + function _next(error2) { + if (error2) { + if (done) { + return; + } + if (error2 instanceof Kareem.skipWrappedFunction) { + shouldSkipWrappedFunction = error2; + } else { + done = true; + return callback(error2); + } + } + if (++currentPre >= numPres) { + if (asyncPresLeft > 0) { + return; + } else { + return callback(shouldSkipWrappedFunction); + } + } + next.apply(context, arguments); + } + }; + Kareem.prototype.execPreSync = function(name, context, args2) { + const pres = this._pres.get(name) || []; + const numPres = pres.length; + for (let i4 = 0; i4 < numPres; ++i4) { + pres[i4].fn.apply(context, args2 || []); + } + }; + Kareem.prototype.execPost = function(name, context, args2, options, callback) { + if (arguments.length < 5) { + callback = options; + options = null; + } + const posts = this._posts.get(name) || []; + const numPosts = posts.length; + let currentPost = 0; + let firstError = null; + if (options && options.error) { + firstError = options.error; + } + if (!numPosts) { + return nextTick(function() { + callback.apply(null, [firstError].concat(args2)); + }); + } + function next() { + const post = posts[currentPost].fn; + let numArgs = 0; + const argLength = args2.length; + const newArgs = []; + for (let i4 = 0; i4 < argLength; ++i4) { + numArgs += args2[i4] && args2[i4]._kareemIgnore ? 0 : 1; + if (!args2[i4] || !args2[i4]._kareemIgnore) { + newArgs.push(args2[i4]); + } + } + if (firstError) { + if (isErrorHandlingMiddleware(posts[currentPost], numArgs)) { + const _cb = decorateNextFn(function(error2) { + if (error2) { + if (error2 instanceof Kareem.overwriteResult) { + args2 = error2.args; + if (++currentPost >= numPosts) { + return callback.call(null, firstError); + } + return next(); + } + firstError = error2; + } + if (++currentPost >= numPosts) { + return callback.call(null, firstError); + } + next(); + }); + callMiddlewareFunction( + post, + context, + [firstError].concat(newArgs).concat([_cb]), + _cb + ); + } else { + if (++currentPost >= numPosts) { + return callback.call(null, firstError); + } + next(); + } + } else { + const _cb = decorateNextFn(function(error2) { + if (error2) { + if (error2 instanceof Kareem.overwriteResult) { + args2 = error2.args; + if (++currentPost >= numPosts) { + return callback.apply(null, [null].concat(args2)); + } + return next(); + } + firstError = error2; + return next(); + } + if (++currentPost >= numPosts) { + return callback.apply(null, [null].concat(args2)); + } + next(); + }); + if (isErrorHandlingMiddleware(posts[currentPost], numArgs)) { + if (++currentPost >= numPosts) { + return callback.apply(null, [null].concat(args2)); + } + return next(); + } + if (post.length === numArgs + 1) { + callMiddlewareFunction(post, context, newArgs.concat([_cb]), _cb); + } else { + let error2; + let maybePromiseLike; + try { + maybePromiseLike = post.apply(context, newArgs); + } catch (err) { + error2 = err; + firstError = err; + } + if (isPromiseLike(maybePromiseLike)) { + return maybePromiseLike.then( + (res) => { + _cb(res instanceof Kareem.overwriteResult ? res : null); + }, + (err) => _cb(err) + ); + } + if (maybePromiseLike instanceof Kareem.overwriteResult) { + args2 = maybePromiseLike.args; + } + if (++currentPost >= numPosts) { + return callback.apply(null, [error2].concat(args2)); + } + next(); + } + } + } + next(); + }; + Kareem.prototype.execPostSync = function(name, context, args2) { + const posts = this._posts.get(name) || []; + const numPosts = posts.length; + for (let i4 = 0; i4 < numPosts; ++i4) { + const res = posts[i4].fn.apply(context, args2 || []); + if (res instanceof Kareem.overwriteResult) { + args2 = res.args; + } + } + return args2; + }; + Kareem.prototype.createWrapperSync = function(name, fn2) { + const _this = this; + return function syncWrapper() { + _this.execPreSync(name, this, arguments); + const toReturn = fn2.apply(this, arguments); + const result = _this.execPostSync(name, this, [toReturn]); + return result[0]; + }; + }; + function _handleWrapError(instance, error2, name, context, args2, options, callback) { + if (options.useErrorHandlers) { + return instance.execPost(name, context, args2, { error: error2 }, function(error3) { + return typeof callback === "function" && callback(error3); + }); + } else { + return typeof callback === "function" && callback(error2); + } + } + Kareem.prototype.wrap = function(name, fn2, context, args2, options) { + const lastArg = args2.length > 0 ? args2[args2.length - 1] : null; + const argsWithoutCb = Array.from(args2); + typeof lastArg === "function" && argsWithoutCb.pop(); + const _this = this; + options = options || {}; + const checkForPromise = options.checkForPromise; + this.execPre(name, context, args2, function(error2) { + if (error2 && !(error2 instanceof Kareem.skipWrappedFunction)) { + const numCallbackParams = options.numCallbackParams || 0; + const errorArgs = options.contextParameter ? [context] : []; + for (let i4 = errorArgs.length; i4 < numCallbackParams; ++i4) { + errorArgs.push(null); + } + return _handleWrapError( + _this, + error2, + name, + context, + errorArgs, + options, + lastArg + ); + } + const numParameters = fn2.length; + let ret; + if (error2 instanceof Kareem.skipWrappedFunction) { + ret = error2.args[0]; + return _cb(null, ...error2.args); + } else { + try { + ret = fn2.apply(context, argsWithoutCb.concat(_cb)); + } catch (err) { + return _cb(err); + } + } + if (checkForPromise) { + if (isPromiseLike(ret)) { + return ret.then( + (res) => _cb(null, res), + (err) => _cb(err) + ); + } + if (numParameters < argsWithoutCb.length + 1) { + return _cb(null, ret); + } + } + function _cb() { + const argsWithoutError = Array.from(arguments); + argsWithoutError.shift(); + if (options.nullResultByDefault && argsWithoutError.length === 0) { + argsWithoutError.push(null); + } + if (arguments[0]) { + return _handleWrapError( + _this, + arguments[0], + name, + context, + argsWithoutError, + options, + lastArg + ); + } else { + _this.execPost(name, context, argsWithoutError, function() { + if (lastArg === null) { + return; + } + arguments[0] ? lastArg(arguments[0]) : lastArg.apply(context, arguments); + }); + } + } + }); + }; + Kareem.prototype.filter = function(fn2) { + const clone = this.clone(); + const pres = Array.from(clone._pres.keys()); + for (const name of pres) { + const hooks = this._pres.get(name).map((h4) => Object.assign({}, h4, { name })).filter(fn2); + if (hooks.length === 0) { + clone._pres.delete(name); + continue; + } + hooks.numAsync = hooks.filter((h4) => h4.isAsync).length; + clone._pres.set(name, hooks); + } + const posts = Array.from(clone._posts.keys()); + for (const name of posts) { + const hooks = this._posts.get(name).map((h4) => Object.assign({}, h4, { name })).filter(fn2); + if (hooks.length === 0) { + clone._posts.delete(name); + continue; + } + clone._posts.set(name, hooks); + } + return clone; + }; + Kareem.prototype.hasHooks = function(name) { + return this._pres.has(name) || this._posts.has(name); + }; + Kareem.prototype.createWrapper = function(name, fn2, context, options) { + const _this = this; + if (!this.hasHooks(name)) { + return function() { + nextTick(() => fn2.apply(this, arguments)); + }; + } + return function() { + const _context = context || this; + _this.wrap(name, fn2, _context, Array.from(arguments), options); + }; + }; + Kareem.prototype.pre = function(name, isAsync, fn2, error2, unshift) { + let options = {}; + if (typeof isAsync === "object" && isAsync !== null) { + options = isAsync; + isAsync = options.isAsync; + } else if (typeof arguments[1] !== "boolean") { + fn2 = isAsync; + isAsync = false; + } + const pres = this._pres.get(name) || []; + this._pres.set(name, pres); + if (isAsync) { + pres.numAsync = pres.numAsync || 0; + ++pres.numAsync; + } + if (typeof fn2 !== "function") { + throw new Error('pre() requires a function, got "' + typeof fn2 + '"'); + } + if (unshift) { + pres.unshift(Object.assign({}, options, { fn: fn2, isAsync })); + } else { + pres.push(Object.assign({}, options, { fn: fn2, isAsync })); + } + return this; + }; + Kareem.prototype.post = function(name, options, fn2, unshift) { + const posts = this._posts.get(name) || []; + if (typeof options === "function") { + unshift = !!fn2; + fn2 = options; + options = {}; + } + if (typeof fn2 !== "function") { + throw new Error('post() requires a function, got "' + typeof fn2 + '"'); + } + if (unshift) { + posts.unshift(Object.assign({}, options, { fn: fn2 })); + } else { + posts.push(Object.assign({}, options, { fn: fn2 })); + } + this._posts.set(name, posts); + return this; + }; + Kareem.prototype.clone = function() { + const n4 = new Kareem(); + for (const key of this._pres.keys()) { + const clone = this._pres.get(key).slice(); + clone.numAsync = this._pres.get(key).numAsync; + n4._pres.set(key, clone); + } + for (const key of this._posts.keys()) { + n4._posts.set(key, this._posts.get(key).slice()); + } + return n4; + }; + Kareem.prototype.merge = function(other, clone) { + clone = arguments.length === 1 ? true : clone; + const ret = clone ? this.clone() : this; + for (const key of other._pres.keys()) { + const sourcePres = ret._pres.get(key) || []; + const deduplicated = other._pres.get(key).filter((p4) => sourcePres.map((_p) => _p.fn).indexOf(p4.fn) === -1); + const combined = sourcePres.concat(deduplicated); + combined.numAsync = sourcePres.numAsync || 0; + combined.numAsync += deduplicated.filter((p4) => p4.isAsync).length; + ret._pres.set(key, combined); + } + for (const key of other._posts.keys()) { + const sourcePosts = ret._posts.get(key) || []; + const deduplicated = other._posts.get(key).filter((p4) => sourcePosts.indexOf(p4) === -1); + ret._posts.set(key, sourcePosts.concat(deduplicated)); + } + return ret; + }; + function callMiddlewareFunction(fn2, context, args2, next) { + let maybePromiseLike; + try { + maybePromiseLike = fn2.apply(context, args2); + } catch (error2) { + return next(error2); + } + if (isPromiseLike(maybePromiseLike)) { + maybePromiseLike.then(() => next(), (err) => next(err)); + } + } + function isPromiseLike(v4) { + return typeof v4 === "object" && v4 !== null && typeof v4.then === "function"; + } + function decorateNextFn(fn2) { + let called = false; + const _this = this; + return function() { + if (called) { + return; + } + called = true; + return nextTick(() => fn2.apply(_this, arguments)); + }; + } + var nextTick = typeof process === "object" && process !== null && process.nextTick || function nextTick2(cb) { + setTimeout(cb, 0); + }; + function isErrorHandlingMiddleware(post, numArgs) { + if (post.errorHandler) { + return true; + } + return post.fn.length === numArgs + 2; + } + module2.exports = Kareem; + } +}); + +// node_modules/mongoose/lib/error/messages.js +var require_messages = __commonJS({ + "node_modules/mongoose/lib/error/messages.js"(exports2, module2) { + "use strict"; + var msg = module2.exports = exports2 = {}; + msg.DocumentNotFoundError = null; + msg.general = {}; + msg.general.default = "Validator failed for path `{PATH}` with value `{VALUE}`"; + msg.general.required = "Path `{PATH}` is required."; + msg.Number = {}; + msg.Number.min = "Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN})."; + msg.Number.max = "Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX})."; + msg.Number.enum = "`{VALUE}` is not a valid enum value for path `{PATH}`."; + msg.Date = {}; + msg.Date.min = "Path `{PATH}` ({VALUE}) is before minimum allowed value ({MIN})."; + msg.Date.max = "Path `{PATH}` ({VALUE}) is after maximum allowed value ({MAX})."; + msg.String = {}; + msg.String.enum = "`{VALUE}` is not a valid enum value for path `{PATH}`."; + msg.String.match = "Path `{PATH}` is invalid ({VALUE})."; + msg.String.minlength = "Path `{PATH}` (`{VALUE}`, length {LENGTH}) is shorter than the minimum allowed length ({MINLENGTH})."; + msg.String.maxlength = "Path `{PATH}` (`{VALUE}`, length {LENGTH}) is longer than the maximum allowed length ({MAXLENGTH})."; + } +}); + +// node_modules/mongoose/lib/error/cast.js +var require_cast = __commonJS({ + "node_modules/mongoose/lib/error/cast.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var util = require("util"); + var CastError = class extends MongooseError { + constructor(type, value, path, reason, schemaType) { + if (arguments.length > 0) { + const valueType = getValueType(value); + const messageFormat = getMessageFormat(schemaType); + const msg = formatMessage(null, type, value, path, messageFormat, valueType, reason); + super(msg); + this.init(type, value, path, reason, schemaType); + } else { + super(formatMessage()); + } + } + toJSON() { + return { + stringValue: this.stringValue, + valueType: this.valueType, + kind: this.kind, + value: this.value, + path: this.path, + reason: this.reason, + name: this.name, + message: this.message + }; + } + /*! + * ignore + */ + init(type, value, path, reason, schemaType) { + this.stringValue = getStringValue(value); + this.messageFormat = getMessageFormat(schemaType); + this.kind = type; + this.value = value; + this.path = path; + this.reason = reason; + this.valueType = getValueType(value); + } + /** + * ignore + * @param {Readonly} other + * @api private + */ + copy(other) { + this.messageFormat = other.messageFormat; + this.stringValue = other.stringValue; + this.kind = other.kind; + this.value = other.value; + this.path = other.path; + this.reason = other.reason; + this.message = other.message; + this.valueType = other.valueType; + } + /*! + * ignore + */ + setModel(model) { + this.message = formatMessage( + model, + this.kind, + this.value, + this.path, + this.messageFormat, + this.valueType + ); + } + }; + Object.defineProperty(CastError.prototype, "name", { + value: "CastError" + }); + function getStringValue(value) { + let stringValue = util.inspect(value); + stringValue = stringValue.replace(/^'|'$/g, '"'); + if (!stringValue.startsWith('"')) { + stringValue = '"' + stringValue + '"'; + } + return stringValue; + } + function getValueType(value) { + if (value == null) { + return "" + value; + } + const t4 = typeof value; + if (t4 !== "object") { + return t4; + } + if (typeof value.constructor !== "function") { + return t4; + } + return value.constructor.name; + } + function getMessageFormat(schemaType) { + const messageFormat = schemaType && schemaType._castErrorMessage || null; + if (typeof messageFormat === "string" || typeof messageFormat === "function") { + return messageFormat; + } + } + function formatMessage(model, kind, value, path, messageFormat, valueType, reason) { + if (typeof messageFormat === "string") { + const stringValue = getStringValue(value); + let ret = messageFormat.replace("{KIND}", kind).replace("{VALUE}", stringValue).replace("{PATH}", path); + if (model != null) { + ret = ret.replace("{MODEL}", model.modelName); + } + return ret; + } else if (typeof messageFormat === "function") { + return messageFormat(value, path, model, kind); + } else { + const stringValue = getStringValue(value); + const valueTypeMsg = valueType ? " (type " + valueType + ")" : ""; + let ret = "Cast to " + kind + " failed for value " + stringValue + valueTypeMsg + ' at path "' + path + '"'; + if (model != null) { + ret += ' for model "' + model.modelName + '"'; + } + if (reason != null && typeof reason.constructor === "function" && reason.constructor.name !== "AssertionError" && reason.constructor.name !== "Error") { + ret += ' because of "' + reason.constructor.name + '"'; + } + return ret; + } + } + module2.exports = CastError; + } +}); + +// node_modules/mongoose/lib/error/notFound.js +var require_notFound = __commonJS({ + "node_modules/mongoose/lib/error/notFound.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var util = require("util"); + var DocumentNotFoundError = class extends MongooseError { + constructor(filter, model, numAffected, result) { + let msg; + const messages = MongooseError.messages; + if (messages.DocumentNotFoundError != null) { + msg = typeof messages.DocumentNotFoundError === "function" ? messages.DocumentNotFoundError(filter, model) : messages.DocumentNotFoundError; + } else { + msg = 'No document found for query "' + util.inspect(filter) + '" on model "' + model + '"'; + } + super(msg); + this.result = result; + this.numAffected = numAffected; + this.filter = filter; + this.query = filter; + } + }; + Object.defineProperty(DocumentNotFoundError.prototype, "name", { + value: "DocumentNotFoundError" + }); + module2.exports = DocumentNotFoundError; + } +}); + +// node_modules/mongoose/lib/helpers/error/combinePathErrors.js +var require_combinePathErrors = __commonJS({ + "node_modules/mongoose/lib/helpers/error/combinePathErrors.js"(exports2, module2) { + "use strict"; + module2.exports = function combinePathErrors(err) { + const keys = Object.keys(err.errors || {}); + const len = keys.length; + const msgs = []; + let key; + for (let i4 = 0; i4 < len; ++i4) { + key = keys[i4]; + if (err === err.errors[key]) { + continue; + } + msgs.push(key + ": " + err.errors[key].message); + } + return msgs.join(", "); + }; + } +}); + +// node_modules/mongoose/lib/error/validation.js +var require_validation = __commonJS({ + "node_modules/mongoose/lib/error/validation.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var getConstructorName = require_getConstructorName(); + var util = require("util"); + var combinePathErrors = require_combinePathErrors(); + var ValidationError = class _ValidationError extends MongooseError { + constructor(instance) { + let _message; + if (getConstructorName(instance) === "model") { + _message = instance.constructor.modelName + " validation failed"; + } else { + _message = "Validation failed"; + } + super(_message); + this.errors = {}; + this._message = _message; + if (instance) { + instance.$errors = this.errors; + } + } + /** + * Console.log helper + */ + toString() { + return this.name + ": " + combinePathErrors(this); + } + /** + * inspect helper + * @api private + */ + inspect() { + return Object.assign(new Error(this.message), this); + } + /** + * add message + * @param {String} path + * @param {String|Error} error + * @api private + */ + addError(path, error2) { + if (error2 instanceof _ValidationError) { + const { errors } = error2; + for (const errorPath of Object.keys(errors)) { + this.addError(`${path}.${errorPath}`, errors[errorPath]); + } + return; + } + this.errors[path] = error2; + this.message = this._message + ": " + combinePathErrors(this); + } + }; + if (util.inspect.custom) { + ValidationError.prototype[util.inspect.custom] = ValidationError.prototype.inspect; + } + Object.defineProperty(ValidationError.prototype, "toJSON", { + enumerable: false, + writable: false, + configurable: true, + value: function() { + return Object.assign({}, this, { name: this.name, message: this.message }); + } + }); + Object.defineProperty(ValidationError.prototype, "name", { + value: "ValidationError" + }); + module2.exports = ValidationError; + } +}); + +// node_modules/mongoose/lib/error/validator.js +var require_validator = __commonJS({ + "node_modules/mongoose/lib/error/validator.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var ValidatorError = class extends MongooseError { + constructor(properties, doc) { + let msg = properties.message; + if (!msg) { + msg = MongooseError.messages.general.default; + } + const message2 = formatMessage(msg, properties, doc); + super(message2); + properties = Object.assign({}, properties, { message: message2 }); + this.properties = properties; + this.kind = properties.type; + this.path = properties.path; + this.value = properties.value; + this.reason = properties.reason; + } + /** + * toString helper + * TODO remove? This defaults to `${this.name}: ${this.message}` + * @api private + */ + toString() { + return this.message; + } + /** + * Ensure `name` and `message` show up in toJSON output re: gh-9296 + * @api private + */ + toJSON() { + return Object.assign({ name: this.name, message: this.message }, this); + } + }; + Object.defineProperty(ValidatorError.prototype, "name", { + value: "ValidatorError" + }); + Object.defineProperty(ValidatorError.prototype, "properties", { + enumerable: false, + writable: true, + value: null + }); + ValidatorError.prototype.formatMessage = formatMessage; + function formatMessage(msg, properties, doc) { + if (typeof msg === "function") { + return msg(properties, doc); + } + const propertyNames = Object.keys(properties); + for (const propertyName of propertyNames) { + if (propertyName === "message") { + continue; + } + msg = msg.replace("{" + propertyName.toUpperCase() + "}", properties[propertyName]); + } + return msg; + } + module2.exports = ValidatorError; + } +}); + +// node_modules/mongoose/lib/error/version.js +var require_version = __commonJS({ + "node_modules/mongoose/lib/error/version.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var VersionError = class extends MongooseError { + constructor(doc, currentVersion, modifiedPaths) { + const modifiedPathsStr = modifiedPaths.join(", "); + super('No matching document found for id "' + doc._doc._id + '" version ' + currentVersion + ' modifiedPaths "' + modifiedPathsStr + '"'); + this.version = currentVersion; + this.modifiedPaths = modifiedPaths; + } + }; + Object.defineProperty(VersionError.prototype, "name", { + value: "VersionError" + }); + module2.exports = VersionError; + } +}); + +// node_modules/mongoose/lib/error/parallelSave.js +var require_parallelSave = __commonJS({ + "node_modules/mongoose/lib/error/parallelSave.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var ParallelSaveError = class extends MongooseError { + constructor(doc) { + const msg = "Can't save() the same doc multiple times in parallel. Document: "; + super(msg + doc._doc._id); + } + }; + Object.defineProperty(ParallelSaveError.prototype, "name", { + value: "ParallelSaveError" + }); + module2.exports = ParallelSaveError; + } +}); + +// node_modules/mongoose/lib/error/overwriteModel.js +var require_overwriteModel = __commonJS({ + "node_modules/mongoose/lib/error/overwriteModel.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var OverwriteModelError = class extends MongooseError { + constructor(name) { + super("Cannot overwrite `" + name + "` model once compiled."); + } + }; + Object.defineProperty(OverwriteModelError.prototype, "name", { + value: "OverwriteModelError" + }); + module2.exports = OverwriteModelError; + } +}); + +// node_modules/mongoose/lib/error/missingSchema.js +var require_missingSchema = __commonJS({ + "node_modules/mongoose/lib/error/missingSchema.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var MissingSchemaError = class extends MongooseError { + constructor(name) { + const msg = `Schema hasn't been registered for model "` + name + '".\nUse mongoose.model(name, schema)'; + super(msg); + } + }; + Object.defineProperty(MissingSchemaError.prototype, "name", { + value: "MissingSchemaError" + }); + module2.exports = MissingSchemaError; + } +}); + +// node_modules/mongoose/lib/error/bulkSaveIncompleteError.js +var require_bulkSaveIncompleteError = __commonJS({ + "node_modules/mongoose/lib/error/bulkSaveIncompleteError.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var MongooseBulkSaveIncompleteError = class extends MongooseError { + constructor(modelName, documents, bulkWriteResult) { + const matchedCount = bulkWriteResult?.matchedCount ?? 0; + const insertedCount = bulkWriteResult?.insertedCount ?? 0; + let preview = documents.map((doc) => doc._id).join(", "); + if (preview.length > 100) { + preview = preview.slice(0, 100) + "..."; + } + const numDocumentsNotUpdated = documents.length - matchedCount - insertedCount; + super(`${modelName}.bulkSave() was not able to update ${numDocumentsNotUpdated} of the given documents due to incorrect version or optimistic concurrency, document ids: ${preview}`); + this.modelName = modelName; + this.documents = documents; + this.bulkWriteResult = bulkWriteResult; + this.numDocumentsNotUpdated = numDocumentsNotUpdated; + } + }; + Object.defineProperty(MongooseBulkSaveIncompleteError.prototype, "name", { + value: "MongooseBulkSaveIncompleteError" + }); + module2.exports = MongooseBulkSaveIncompleteError; + } +}); + +// node_modules/mongoose/lib/helpers/topology/allServersUnknown.js +var require_allServersUnknown = __commonJS({ + "node_modules/mongoose/lib/helpers/topology/allServersUnknown.js"(exports2, module2) { + "use strict"; + var getConstructorName = require_getConstructorName(); + module2.exports = function allServersUnknown(topologyDescription) { + if (getConstructorName(topologyDescription) !== "TopologyDescription") { + return false; + } + const servers = Array.from(topologyDescription.servers.values()); + return servers.length > 0 && servers.every((server) => server.type === "Unknown"); + }; + } +}); + +// node_modules/mongoose/lib/helpers/topology/isAtlas.js +var require_isAtlas = __commonJS({ + "node_modules/mongoose/lib/helpers/topology/isAtlas.js"(exports2, module2) { + "use strict"; + var getConstructorName = require_getConstructorName(); + module2.exports = function isAtlas(topologyDescription) { + if (getConstructorName(topologyDescription) !== "TopologyDescription") { + return false; + } + if (topologyDescription.servers.size === 0) { + return false; + } + for (const server of topologyDescription.servers.values()) { + if (server.host.endsWith(".mongodb.net") === false || server.port !== 27017) { + return false; + } + } + return true; + }; + } +}); + +// node_modules/mongoose/lib/helpers/topology/isSSLError.js +var require_isSSLError = __commonJS({ + "node_modules/mongoose/lib/helpers/topology/isSSLError.js"(exports2, module2) { + "use strict"; + var getConstructorName = require_getConstructorName(); + var nonSSLMessage = "Client network socket disconnected before secure TLS connection was established"; + module2.exports = function isSSLError(topologyDescription) { + if (getConstructorName(topologyDescription) !== "TopologyDescription") { + return false; + } + const descriptions = Array.from(topologyDescription.servers.values()); + return descriptions.length > 0 && descriptions.every((descr) => descr.error && descr.error.message.indexOf(nonSSLMessage) !== -1); + }; + } +}); + +// node_modules/mongoose/lib/error/serverSelection.js +var require_serverSelection = __commonJS({ + "node_modules/mongoose/lib/error/serverSelection.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var allServersUnknown = require_allServersUnknown(); + var isAtlas = require_isAtlas(); + var isSSLError = require_isSSLError(); + var atlasMessage = "Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/"; + var sslMessage = "Mongoose is connecting with SSL enabled, but the server is not accepting SSL connections. Please ensure that the MongoDB server you are connecting to is configured to accept SSL connections. Learn more: https://mongoosejs.com/docs/tutorials/ssl.html"; + var MongooseServerSelectionError = class extends MongooseError { + /** + * MongooseServerSelectionError constructor + * + * @api private + */ + assimilateError(err) { + const reason = err.reason; + const isAtlasWhitelistError = isAtlas(reason) && allServersUnknown(reason) && err.message.indexOf("bad auth") === -1 && err.message.indexOf("Authentication failed") === -1; + if (isAtlasWhitelistError) { + this.message = atlasMessage; + } else if (isSSLError(reason)) { + this.message = sslMessage; + } else { + this.message = err.message; + } + for (const key in err) { + if (key !== "name") { + this[key] = err[key]; + } + } + this.cause = reason; + return this; + } + }; + Object.defineProperty(MongooseServerSelectionError.prototype, "name", { + value: "MongooseServerSelectionError" + }); + module2.exports = MongooseServerSelectionError; + } +}); + +// node_modules/mongoose/lib/error/divergentArray.js +var require_divergentArray = __commonJS({ + "node_modules/mongoose/lib/error/divergentArray.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var DivergentArrayError = class extends MongooseError { + constructor(paths) { + const msg = "For your own good, using `document.save()` to update an array which was selected using an $elemMatch projection OR populated using skip, limit, query conditions, or exclusion of the _id field when the operation results in a $pop or $set of the entire array is not supported. The following path(s) would have been modified unsafely:\n " + paths.join("\n ") + "\nUse Model.updateOne() to update these arrays instead. See https://mongoosejs.com/docs/faq.html#divergent-array-error for more information."; + super(msg); + } + }; + Object.defineProperty(DivergentArrayError.prototype, "name", { + value: "DivergentArrayError" + }); + module2.exports = DivergentArrayError; + } +}); + +// node_modules/mongoose/lib/error/strict.js +var require_strict = __commonJS({ + "node_modules/mongoose/lib/error/strict.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var StrictModeError = class extends MongooseError { + constructor(path, msg, immutable) { + msg = msg || "Field `" + path + "` is not in schema and strict mode is set to throw."; + super(msg); + this.isImmutableError = !!immutable; + this.path = path; + } + }; + Object.defineProperty(StrictModeError.prototype, "name", { + value: "StrictModeError" + }); + module2.exports = StrictModeError; + } +}); + +// node_modules/mongoose/lib/error/strictPopulate.js +var require_strictPopulate = __commonJS({ + "node_modules/mongoose/lib/error/strictPopulate.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var StrictPopulateError = class extends MongooseError { + constructor(path, msg) { + msg = msg || "Cannot populate path `" + path + "` because it is not in your schema. Set the `strictPopulate` option to false to override."; + super(msg); + this.path = path; + } + }; + Object.defineProperty(StrictPopulateError.prototype, "name", { + value: "StrictPopulateError" + }); + module2.exports = StrictPopulateError; + } +}); + +// node_modules/mongoose/lib/error/index.js +var require_error2 = __commonJS({ + "node_modules/mongoose/lib/error/index.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + module2.exports = exports2 = MongooseError; + MongooseError.messages = require_messages(); + MongooseError.Messages = MongooseError.messages; + MongooseError.CastError = require_cast(); + MongooseError.DocumentNotFoundError = require_notFound(); + MongooseError.ValidationError = require_validation(); + MongooseError.ValidatorError = require_validator(); + MongooseError.VersionError = require_version(); + MongooseError.ParallelSaveError = require_parallelSave(); + MongooseError.OverwriteModelError = require_overwriteModel(); + MongooseError.MissingSchemaError = require_missingSchema(); + MongooseError.MongooseBulkSaveIncompleteError = require_bulkSaveIncompleteError(); + MongooseError.MongooseServerSelectionError = require_serverSelection(); + MongooseError.DivergentArrayError = require_divergentArray(); + MongooseError.StrictModeError = require_strict(); + MongooseError.StrictPopulateError = require_strictPopulate(); + } +}); + +// node_modules/mongoose/lib/options/propertyOptions.js +var require_propertyOptions = __commonJS({ + "node_modules/mongoose/lib/options/propertyOptions.js"(exports2, module2) { + "use strict"; + module2.exports = Object.freeze({ + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + } +}); + +// node_modules/mongoose/lib/options/schemaTypeOptions.js +var require_schemaTypeOptions = __commonJS({ + "node_modules/mongoose/lib/options/schemaTypeOptions.js"(exports2, module2) { + "use strict"; + var clone = require_clone(); + var SchemaTypeOptions = class { + constructor(obj) { + if (obj == null) { + return this; + } + Object.assign(this, clone(obj)); + } + }; + var opts = require_propertyOptions(); + Object.defineProperty(SchemaTypeOptions.prototype, "type", opts); + Object.defineProperty(SchemaTypeOptions.prototype, "validate", opts); + Object.defineProperty(SchemaTypeOptions.prototype, "cast", opts); + Object.defineProperty(SchemaTypeOptions.prototype, "required", opts); + Object.defineProperty(SchemaTypeOptions.prototype, "default", opts); + Object.defineProperty(SchemaTypeOptions.prototype, "ref", opts); + Object.defineProperty(SchemaTypeOptions.prototype, "refPath", opts); + Object.defineProperty(SchemaTypeOptions.prototype, "select", opts); + Object.defineProperty(SchemaTypeOptions.prototype, "index", opts); + Object.defineProperty(SchemaTypeOptions.prototype, "unique", opts); + Object.defineProperty(SchemaTypeOptions.prototype, "immutable", opts); + Object.defineProperty(SchemaTypeOptions.prototype, "sparse", opts); + Object.defineProperty(SchemaTypeOptions.prototype, "text", opts); + Object.defineProperty(SchemaTypeOptions.prototype, "transform", opts); + module2.exports = SchemaTypeOptions; + } +}); + +// node_modules/mongoose/lib/cast/boolean.js +var require_boolean = __commonJS({ + "node_modules/mongoose/lib/cast/boolean.js"(exports2, module2) { + "use strict"; + var CastError = require_cast(); + module2.exports = function castBoolean(value, path) { + if (module2.exports.convertToTrue.has(value)) { + return true; + } + if (module2.exports.convertToFalse.has(value)) { + return false; + } + if (value == null) { + return value; + } + throw new CastError("boolean", value, path); + }; + module2.exports.convertToTrue = /* @__PURE__ */ new Set([true, "true", 1, "1", "yes"]); + module2.exports.convertToFalse = /* @__PURE__ */ new Set([false, "false", 0, "0", "no"]); + } +}); + +// node_modules/mongoose/lib/schema/operators/exists.js +var require_exists = __commonJS({ + "node_modules/mongoose/lib/schema/operators/exists.js"(exports2, module2) { + "use strict"; + var castBoolean = require_boolean(); + module2.exports = function(val) { + const path = this != null ? this.path : null; + return castBoolean(val, path); + }; + } +}); + +// node_modules/mongoose/lib/schema/operators/type.js +var require_type = __commonJS({ + "node_modules/mongoose/lib/schema/operators/type.js"(exports2, module2) { + "use strict"; + module2.exports = function(val) { + if (Array.isArray(val)) { + if (!val.every((v4) => typeof v4 === "number" || typeof v4 === "string")) { + throw new Error("$type array values must be strings or numbers"); + } + return val; + } + if (typeof val !== "number" && typeof val !== "string") { + throw new Error("$type parameter must be number, string, or array of numbers and strings"); + } + return val; + }; + } +}); + +// node_modules/mongoose/lib/helpers/schematype/handleImmutable.js +var require_handleImmutable = __commonJS({ + "node_modules/mongoose/lib/helpers/schematype/handleImmutable.js"(exports2, module2) { + "use strict"; + var StrictModeError = require_strict(); + module2.exports = function(schematype) { + if (schematype.$immutable) { + schematype.$immutableSetter = createImmutableSetter( + schematype.path, + schematype.options.immutable + ); + schematype.set(schematype.$immutableSetter); + } else if (schematype.$immutableSetter) { + schematype.setters = schematype.setters.filter((fn2) => fn2 !== schematype.$immutableSetter); + delete schematype.$immutableSetter; + } + }; + function createImmutableSetter(path, immutable) { + return function immutableSetter(v4, _priorVal, _doc, options) { + if (this == null || this.$__ == null) { + return v4; + } + if (this.isNew) { + return v4; + } + if (options && options.overwriteImmutable) { + return v4; + } + const _immutable = typeof immutable === "function" ? immutable.call(this, this) : immutable; + if (!_immutable) { + return v4; + } + const _value = this.$__.priorDoc != null ? this.$__.priorDoc.$__getValue(path) : this.$__getValue(path); + if (this.$__.strictMode === "throw" && v4 !== _value) { + throw new StrictModeError(path, "Path `" + path + "` is immutable and strict mode is set to throw.", true); + } + return _value; + }; + } + } +}); + +// node_modules/mongoose/lib/helpers/isAsyncFunction.js +var require_isAsyncFunction = __commonJS({ + "node_modules/mongoose/lib/helpers/isAsyncFunction.js"(exports2, module2) { + "use strict"; + module2.exports = function isAsyncFunction(v4) { + return typeof v4 === "function" && v4.constructor && v4.constructor.name === "AsyncFunction"; + }; + } +}); + +// node_modules/mongoose/lib/helpers/isSimpleValidator.js +var require_isSimpleValidator = __commonJS({ + "node_modules/mongoose/lib/helpers/isSimpleValidator.js"(exports2, module2) { + "use strict"; + module2.exports = function isSimpleValidator(obj) { + const keys = Object.keys(obj); + let result = true; + for (let i4 = 0, len = keys.length; i4 < len; ++i4) { + if (typeof obj[keys[i4]] === "object" && obj[keys[i4]] !== null) { + result = false; + break; + } + } + return result; + }; + } +}); + +// node_modules/mongoose/node_modules/ms/index.js +var require_ms2 = __commonJS({ + "node_modules/mongoose/node_modules/ms/index.js"(exports2, module2) { + var s4 = 1e3; + var m4 = s4 * 60; + var h4 = m4 * 60; + var d4 = h4 * 24; + var w4 = d4 * 7; + var y2 = d4 * 365.25; + module2.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === "string" && val.length > 0) { + return parse(val); + } else if (type === "number" && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) + ); + }; + function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n4 = parseFloat(match[1]); + var type = (match[2] || "ms").toLowerCase(); + switch (type) { + case "years": + case "year": + case "yrs": + case "yr": + case "y": + return n4 * y2; + case "weeks": + case "week": + case "w": + return n4 * w4; + case "days": + case "day": + case "d": + return n4 * d4; + case "hours": + case "hour": + case "hrs": + case "hr": + case "h": + return n4 * h4; + case "minutes": + case "minute": + case "mins": + case "min": + case "m": + return n4 * m4; + case "seconds": + case "second": + case "secs": + case "sec": + case "s": + return n4 * s4; + case "milliseconds": + case "millisecond": + case "msecs": + case "msec": + case "ms": + return n4; + default: + return void 0; + } + } + function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d4) { + return Math.round(ms / d4) + "d"; + } + if (msAbs >= h4) { + return Math.round(ms / h4) + "h"; + } + if (msAbs >= m4) { + return Math.round(ms / m4) + "m"; + } + if (msAbs >= s4) { + return Math.round(ms / s4) + "s"; + } + return ms + "ms"; + } + function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d4) { + return plural(ms, msAbs, d4, "day"); + } + if (msAbs >= h4) { + return plural(ms, msAbs, h4, "hour"); + } + if (msAbs >= m4) { + return plural(ms, msAbs, m4, "minute"); + } + if (msAbs >= s4) { + return plural(ms, msAbs, s4, "second"); + } + return ms + " ms"; + } + function plural(ms, msAbs, n4, name) { + var isPlural = msAbs >= n4 * 1.5; + return Math.round(ms / n4) + " " + name + (isPlural ? "s" : ""); + } + } +}); + +// node_modules/mpath/lib/stringToParts.js +var require_stringToParts = __commonJS({ + "node_modules/mpath/lib/stringToParts.js"(exports2, module2) { + "use strict"; + module2.exports = function stringToParts(str) { + const result = []; + let curPropertyName = ""; + let state2 = "DEFAULT"; + for (let i4 = 0; i4 < str.length; ++i4) { + if (state2 === "IN_SQUARE_BRACKETS" && !/\d/.test(str[i4]) && str[i4] !== "]") { + state2 = "DEFAULT"; + curPropertyName = result[result.length - 1] + "[" + curPropertyName; + result.splice(result.length - 1, 1); + } + if (str[i4] === "[") { + if (state2 !== "IMMEDIATELY_AFTER_SQUARE_BRACKETS") { + result.push(curPropertyName); + curPropertyName = ""; + } + state2 = "IN_SQUARE_BRACKETS"; + } else if (str[i4] === "]") { + if (state2 === "IN_SQUARE_BRACKETS") { + state2 = "IMMEDIATELY_AFTER_SQUARE_BRACKETS"; + result.push(curPropertyName); + curPropertyName = ""; + } else { + state2 = "DEFAULT"; + curPropertyName += str[i4]; + } + } else if (str[i4] === ".") { + if (state2 !== "IMMEDIATELY_AFTER_SQUARE_BRACKETS") { + result.push(curPropertyName); + curPropertyName = ""; + } + state2 = "DEFAULT"; + } else { + curPropertyName += str[i4]; + } + } + if (state2 !== "IMMEDIATELY_AFTER_SQUARE_BRACKETS") { + result.push(curPropertyName); + } + return result; + }; + } +}); + +// node_modules/mpath/lib/index.js +var require_lib7 = __commonJS({ + "node_modules/mpath/lib/index.js"(exports2) { + var stringToParts = require_stringToParts(); + var ignoreProperties = ["__proto__", "constructor", "prototype"]; + exports2.get = function(path, o4, special, map2) { + var lookup; + if ("function" == typeof special) { + if (special.length < 2) { + map2 = special; + special = void 0; + } else { + lookup = special; + special = void 0; + } + } + map2 || (map2 = K); + var parts = "string" == typeof path ? stringToParts(path) : path; + if (!Array.isArray(parts)) { + throw new TypeError("Invalid `path`. Must be either string or array"); + } + var obj = o4, part; + for (var i4 = 0; i4 < parts.length; ++i4) { + part = parts[i4]; + if (typeof parts[i4] !== "string" && typeof parts[i4] !== "number") { + throw new TypeError("Each segment of path to `get()` must be a string or number, got " + typeof parts[i4]); + } + if (Array.isArray(obj) && !/^\d+$/.test(part)) { + var paths = parts.slice(i4); + return [].concat(obj).map(function(item) { + return item ? exports2.get(paths, item, special || lookup, map2) : map2(void 0); + }); + } + if (lookup) { + obj = lookup(obj, part); + } else { + var _from = special && obj[special] ? obj[special] : obj; + obj = _from instanceof Map ? _from.get(part) : _from[part]; + } + if (!obj) return map2(obj); + } + return map2(obj); + }; + exports2.has = function(path, o4) { + var parts = typeof path === "string" ? stringToParts(path) : path; + if (!Array.isArray(parts)) { + throw new TypeError("Invalid `path`. Must be either string or array"); + } + var len = parts.length; + var cur = o4; + for (var i4 = 0; i4 < len; ++i4) { + if (typeof parts[i4] !== "string" && typeof parts[i4] !== "number") { + throw new TypeError("Each segment of path to `has()` must be a string or number, got " + typeof parts[i4]); + } + if (cur == null || typeof cur !== "object" || !(parts[i4] in cur)) { + return false; + } + cur = cur[parts[i4]]; + } + return true; + }; + exports2.unset = function(path, o4) { + var parts = typeof path === "string" ? stringToParts(path) : path; + if (!Array.isArray(parts)) { + throw new TypeError("Invalid `path`. Must be either string or array"); + } + var len = parts.length; + var cur = o4; + for (var i4 = 0; i4 < len; ++i4) { + if (cur == null || typeof cur !== "object" || !(parts[i4] in cur)) { + return false; + } + if (typeof parts[i4] !== "string" && typeof parts[i4] !== "number") { + throw new TypeError("Each segment of path to `unset()` must be a string or number, got " + typeof parts[i4]); + } + if (ignoreProperties.indexOf(parts[i4]) !== -1) { + return false; + } + if (i4 === len - 1) { + delete cur[parts[i4]]; + return true; + } + cur = cur instanceof Map ? cur.get(parts[i4]) : cur[parts[i4]]; + } + return true; + }; + exports2.set = function(path, val, o4, special, map2, _copying) { + var lookup; + if ("function" == typeof special) { + if (special.length < 2) { + map2 = special; + special = void 0; + } else { + lookup = special; + special = void 0; + } + } + map2 || (map2 = K); + var parts = "string" == typeof path ? stringToParts(path) : path; + if (!Array.isArray(parts)) { + throw new TypeError("Invalid `path`. Must be either string or array"); + } + if (null == o4) return; + for (var i4 = 0; i4 < parts.length; ++i4) { + if (typeof parts[i4] !== "string" && typeof parts[i4] !== "number") { + throw new TypeError("Each segment of path to `set()` must be a string or number, got " + typeof parts[i4]); + } + if (ignoreProperties.indexOf(parts[i4]) !== -1) { + return; + } + } + var copy = _copying || /\$/.test(path) && _copying !== false, obj = o4, part; + for (var i4 = 0, len = parts.length - 1; i4 < len; ++i4) { + part = parts[i4]; + if ("$" == part) { + if (i4 == len - 1) { + break; + } else { + continue; + } + } + if (Array.isArray(obj) && !/^\d+$/.test(part)) { + var paths = parts.slice(i4); + if (!copy && Array.isArray(val)) { + for (var j4 = 0; j4 < obj.length && j4 < val.length; ++j4) { + exports2.set(paths, val[j4], obj[j4], special || lookup, map2, copy); + } + } else { + for (var j4 = 0; j4 < obj.length; ++j4) { + exports2.set(paths, val, obj[j4], special || lookup, map2, copy); + } + } + return; + } + if (lookup) { + obj = lookup(obj, part); + } else { + var _to = special && obj[special] ? obj[special] : obj; + obj = _to instanceof Map ? _to.get(part) : _to[part]; + } + if (!obj) return; + } + part = parts[len]; + if (special && obj[special]) { + obj = obj[special]; + } + if (Array.isArray(obj) && !/^\d+$/.test(part)) { + if (!copy && Array.isArray(val)) { + _setArray(obj, val, part, lookup, special, map2); + } else { + for (var j4 = 0; j4 < obj.length; ++j4) { + var item = obj[j4]; + if (item) { + if (lookup) { + lookup(item, part, map2(val)); + } else { + if (item[special]) item = item[special]; + item[part] = map2(val); + } + } + } + } + } else { + if (lookup) { + lookup(obj, part, map2(val)); + } else if (obj instanceof Map) { + obj.set(part, map2(val)); + } else { + obj[part] = map2(val); + } + } + }; + exports2.stringToParts = stringToParts; + function _setArray(obj, val, part, lookup, special, map2) { + for (var item, j4 = 0; j4 < obj.length && j4 < val.length; ++j4) { + item = obj[j4]; + if (Array.isArray(item) && Array.isArray(val[j4])) { + _setArray(item, val[j4], part, lookup, special, map2); + } else if (item) { + if (lookup) { + lookup(item, part, map2(val[j4])); + } else { + if (item[special]) item = item[special]; + item[part] = map2(val[j4]); + } + } + } + } + function K(v4) { + return v4; + } + } +}); + +// node_modules/mpath/index.js +var require_mpath = __commonJS({ + "node_modules/mpath/index.js"(exports2, module2) { + "use strict"; + module2.exports = exports2 = require_lib7(); + } +}); + +// node_modules/mongoose/lib/options/populateOptions.js +var require_populateOptions = __commonJS({ + "node_modules/mongoose/lib/options/populateOptions.js"(exports2, module2) { + "use strict"; + var clone = require_clone(); + var PopulateOptions = class { + constructor(obj) { + this._docs = {}; + this._childDocs = []; + if (obj == null) { + return; + } + obj = clone(obj); + Object.assign(this, obj); + if (typeof obj.subPopulate === "object") { + this.populate = obj.subPopulate; + } + if (obj.perDocumentLimit != null && obj.limit != null) { + throw new Error("Can not use `limit` and `perDocumentLimit` at the same time. Path: `" + obj.path + "`."); + } + } + }; + module2.exports = PopulateOptions; + } +}); + +// node_modules/mongoose/lib/types/documentArray/isMongooseDocumentArray.js +var require_isMongooseDocumentArray = __commonJS({ + "node_modules/mongoose/lib/types/documentArray/isMongooseDocumentArray.js"(exports2) { + "use strict"; + exports2.isMongooseDocumentArray = function(mongooseDocumentArray) { + return Array.isArray(mongooseDocumentArray) && mongooseDocumentArray.isMongooseDocumentArray; + }; + } +}); + +// node_modules/mongoose/lib/helpers/promiseOrCallback.js +var require_promiseOrCallback = __commonJS({ + "node_modules/mongoose/lib/helpers/promiseOrCallback.js"(exports2, module2) { + "use strict"; + var immediate = require_immediate(); + var emittedSymbol = /* @__PURE__ */ Symbol("mongoose#emitted"); + module2.exports = function promiseOrCallback(callback, fn2, ee, Promise2) { + if (typeof callback === "function") { + try { + return fn2(function(error2) { + if (error2 != null) { + if (ee != null && ee.listeners != null && ee.listeners("error").length > 0 && !error2[emittedSymbol]) { + error2[emittedSymbol] = true; + ee.emit("error", error2); + } + try { + callback(error2); + } catch (error3) { + return immediate(() => { + throw error3; + }); + } + return; + } + callback.apply(this, arguments); + }); + } catch (error2) { + if (ee != null && ee.listeners != null && ee.listeners("error").length > 0 && !error2[emittedSymbol]) { + error2[emittedSymbol] = true; + ee.emit("error", error2); + } + return callback(error2); + } + } + Promise2 = Promise2 || global.Promise; + return new Promise2((resolve, reject) => { + fn2(function(error2, res) { + if (error2 != null) { + if (ee != null && ee.listeners != null && ee.listeners("error").length > 0 && !error2[emittedSymbol]) { + error2[emittedSymbol] = true; + ee.emit("error", error2); + } + return reject(error2); + } + if (arguments.length > 2) { + return resolve(Array.prototype.slice.call(arguments, 1)); + } + resolve(res); + }); + }); + }; + } +}); + +// node_modules/mongoose/lib/helpers/schema/merge.js +var require_merge = __commonJS({ + "node_modules/mongoose/lib/helpers/schema/merge.js"(exports2, module2) { + "use strict"; + module2.exports = function merge(s1, s22, skipConflictingPaths) { + const paths = Object.keys(s22.tree); + const pathsToAdd = {}; + for (const key of paths) { + if (skipConflictingPaths && (s1.paths[key] || s1.nested[key] || s1.singleNestedPaths[key])) { + continue; + } + pathsToAdd[key] = s22.tree[key]; + } + s1.options._isMerging = true; + s1.add(pathsToAdd, null); + delete s1.options._isMerging; + s1.callQueue = s1.callQueue.concat(s22.callQueue); + s1.method(s22.methods); + s1.static(s22.statics); + for (const [option, value] of Object.entries(s22._userProvidedOptions)) { + if (!(option in s1._userProvidedOptions)) { + s1.set(option, value); + } + } + for (const query in s22.query) { + s1.query[query] = s22.query[query]; + } + for (const virtual in s22.virtuals) { + s1.virtuals[virtual] = s22.virtuals[virtual].clone(); + } + s1._indexes = s1._indexes.concat(s22._indexes || []); + s1.s.hooks.merge(s22.s.hooks, false); + }; + } +}); + +// node_modules/mongoose/lib/stateMachine.js +var require_stateMachine = __commonJS({ + "node_modules/mongoose/lib/stateMachine.js"(exports2, module2) { + "use strict"; + var utils = require_utils6(); + var StateMachine = module2.exports = exports2 = function StateMachine2() { + }; + StateMachine.ctor = function() { + const states = [...arguments]; + const ctor = function() { + StateMachine.apply(this, arguments); + this.paths = {}; + this.states = {}; + }; + ctor.prototype = new StateMachine(); + ctor.prototype.constructor = ctor; + ctor.prototype.stateNames = states; + states.forEach(function(state2) { + ctor.prototype[state2] = function(path) { + this._changeState(path, state2); + }; + }); + return ctor; + }; + StateMachine.prototype._changeState = function _changeState(path, nextState) { + const prevState = this.paths[path]; + if (prevState === nextState) { + return; + } + const prevBucket = this.states[prevState]; + if (prevBucket) delete prevBucket[path]; + this.paths[path] = nextState; + this.states[nextState] = this.states[nextState] || {}; + this.states[nextState][path] = true; + }; + StateMachine.prototype.clear = function clear(state2) { + if (this.states[state2] == null) { + return; + } + const keys = Object.keys(this.states[state2]); + let i4 = keys.length; + let path; + while (i4--) { + path = keys[i4]; + delete this.states[state2][path]; + delete this.paths[path]; + } + }; + StateMachine.prototype.clearPath = function clearPath(path) { + const state2 = this.paths[path]; + if (!state2) { + return; + } + delete this.paths[path]; + delete this.states[state2][path]; + }; + StateMachine.prototype.getStatePaths = function getStatePaths(state2) { + if (this.states[state2] != null) { + return this.states[state2]; + } + return {}; + }; + StateMachine.prototype.some = function some() { + const _this = this; + const what = arguments.length ? arguments : this.stateNames; + return Array.prototype.some.call(what, function(state2) { + if (_this.states[state2] == null) { + return false; + } + return Object.keys(_this.states[state2]).length; + }); + }; + StateMachine.prototype._iter = function _iter(iterMethod) { + return function() { + let states = [...arguments]; + const callback = states.pop(); + if (!states.length) states = this.stateNames; + const _this = this; + const paths = states.reduce(function(paths2, state2) { + if (_this.states[state2] == null) { + return paths2; + } + return paths2.concat(Object.keys(_this.states[state2])); + }, []); + return paths[iterMethod](function(path, i4, paths2) { + return callback(path, i4, paths2); + }); + }; + }; + StateMachine.prototype.forEach = function forEach() { + this.forEach = this._iter("forEach"); + return this.forEach.apply(this, arguments); + }; + StateMachine.prototype.map = function map2() { + this.map = this._iter("map"); + return this.map.apply(this, arguments); + }; + StateMachine.prototype.clone = function clone() { + const result = new this.constructor(); + result.paths = { ...this.paths }; + for (const state2 of this.stateNames) { + if (!(state2 in this.states)) { + continue; + } + result.states[state2] = this.states[state2] == null ? this.states[state2] : { ...this.states[state2] }; + } + return result; + }; + } +}); + +// node_modules/mongoose/lib/internal.js +var require_internal2 = __commonJS({ + "node_modules/mongoose/lib/internal.js"(exports2, module2) { + "use strict"; + var StateMachine = require_stateMachine(); + var ActiveRoster = StateMachine.ctor("require", "modify", "init", "default", "ignore"); + module2.exports = exports2 = InternalCache; + function InternalCache() { + this.activePaths = new ActiveRoster(); + } + InternalCache.prototype.strictMode = true; + InternalCache.prototype.fullPath = void 0; + InternalCache.prototype.selected = void 0; + InternalCache.prototype.shardval = void 0; + InternalCache.prototype.saveError = void 0; + InternalCache.prototype.validationError = void 0; + InternalCache.prototype.adhocPaths = void 0; + InternalCache.prototype.removing = void 0; + InternalCache.prototype.inserting = void 0; + InternalCache.prototype.saving = void 0; + InternalCache.prototype.version = void 0; + InternalCache.prototype._id = void 0; + InternalCache.prototype.ownerDocument = void 0; + InternalCache.prototype.populate = void 0; + InternalCache.prototype.populated = void 0; + InternalCache.prototype.primitiveAtomics = void 0; + InternalCache.prototype.wasPopulated = false; + InternalCache.prototype.scope = void 0; + InternalCache.prototype.session = null; + InternalCache.prototype.pathsToScopes = null; + InternalCache.prototype.cachedRequired = null; + } +}); + +// node_modules/mongoose/lib/types/buffer.js +var require_buffer = __commonJS({ + "node_modules/mongoose/lib/types/buffer.js"(exports2, module2) { + "use strict"; + var Binary = require_bson().Binary; + var UUID = require_bson().UUID; + var utils = require_utils6(); + function MongooseBuffer(value, encode2, offset) { + let val = value; + if (value == null) { + val = 0; + } + let encoding; + let path; + let doc; + if (Array.isArray(encode2)) { + path = encode2[0]; + doc = encode2[1]; + } else { + encoding = encode2; + } + let buf; + if (typeof val === "number" || val instanceof Number) { + buf = Buffer.alloc(val); + } else { + buf = Buffer.from(val, encoding, offset); + } + utils.decorate(buf, MongooseBuffer.mixin); + buf.isMongooseBuffer = true; + buf[MongooseBuffer.pathSymbol] = path; + buf[parentSymbol] = doc; + buf._subtype = 0; + return buf; + } + var pathSymbol = /* @__PURE__ */ Symbol.for("mongoose#Buffer#_path"); + var parentSymbol = /* @__PURE__ */ Symbol.for("mongoose#Buffer#_parent"); + MongooseBuffer.pathSymbol = pathSymbol; + MongooseBuffer.mixin = { + /** + * Default subtype for the Binary representing this Buffer + * + * @api private + * @property _subtype + * @memberOf MongooseBuffer.mixin + * @static + */ + _subtype: void 0, + /** + * Marks this buffer as modified. + * + * @api private + * @method _markModified + * @memberOf MongooseBuffer.mixin + * @static + */ + _markModified: function() { + const parent = this[parentSymbol]; + if (parent) { + parent.markModified(this[MongooseBuffer.pathSymbol]); + } + return this; + }, + /** + * Writes the buffer. + * + * @api public + * @method write + * @memberOf MongooseBuffer.mixin + * @static + */ + write: function() { + const written = Buffer.prototype.write.apply(this, arguments); + if (written > 0) { + this._markModified(); + } + return written; + }, + /** + * Copies the buffer. + * + * #### Note: + * + * `Buffer#copy` does not mark `target` as modified so you must copy from a `MongooseBuffer` for it to work as expected. This is a work around since `copy` modifies the target, not this. + * + * @return {Number} The number of bytes copied. + * @param {Buffer} target + * @method copy + * @memberOf MongooseBuffer.mixin + * @static + */ + copy: function(target) { + const ret = Buffer.prototype.copy.apply(this, arguments); + if (target && target.isMongooseBuffer) { + target._markModified(); + } + return ret; + } + }; + utils.each( + [ + // node < 0.5 + "writeUInt8", + "writeUInt16", + "writeUInt32", + "writeInt8", + "writeInt16", + "writeInt32", + "writeFloat", + "writeDouble", + "fill", + "utf8Write", + "binaryWrite", + "asciiWrite", + "set", + // node >= 0.5 + "writeUInt16LE", + "writeUInt16BE", + "writeUInt32LE", + "writeUInt32BE", + "writeInt16LE", + "writeInt16BE", + "writeInt32LE", + "writeInt32BE", + "writeFloatLE", + "writeFloatBE", + "writeDoubleLE", + "writeDoubleBE" + ], + function(method) { + if (!Buffer.prototype[method]) { + return; + } + MongooseBuffer.mixin[method] = function() { + const ret = Buffer.prototype[method].apply(this, arguments); + this._markModified(); + return ret; + }; + } + ); + MongooseBuffer.mixin.toObject = function(options) { + const subtype = typeof options === "number" ? options : this._subtype || 0; + return new Binary(Buffer.from(this), subtype); + }; + MongooseBuffer.mixin.$toObject = MongooseBuffer.mixin.toObject; + MongooseBuffer.mixin.toBSON = function() { + return new Binary(this, this._subtype || 0); + }; + MongooseBuffer.mixin.toUUID = function() { + if (this._subtype !== 4) { + throw new Error("Cannot convert a Buffer with subtype " + this._subtype + " to a UUID"); + } + return new UUID(this); + }; + MongooseBuffer.mixin.equals = function(other) { + if (!Buffer.isBuffer(other)) { + return false; + } + if (this.length !== other.length) { + return false; + } + for (let i4 = 0; i4 < this.length; ++i4) { + if (this[i4] !== other[i4]) { + return false; + } + } + return true; + }; + MongooseBuffer.mixin.subtype = function(subtype) { + if (typeof subtype !== "number") { + throw new TypeError("Invalid subtype. Expected a number"); + } + if (this._subtype !== subtype) { + this._markModified(); + } + this._subtype = subtype; + }; + MongooseBuffer.Binary = Binary; + module2.exports = MongooseBuffer; + } +}); + +// node_modules/mongoose/lib/schema/symbols.js +var require_symbols2 = __commonJS({ + "node_modules/mongoose/lib/schema/symbols.js"(exports2) { + "use strict"; + exports2.schemaMixedSymbol = /* @__PURE__ */ Symbol.for("mongoose:schema_mixed"); + exports2.builtInMiddleware = /* @__PURE__ */ Symbol.for("mongoose:built-in-middleware"); + } +}); + +// node_modules/mongoose/lib/schema/mixed.js +var require_mixed = __commonJS({ + "node_modules/mongoose/lib/schema/mixed.js"(exports2, module2) { + "use strict"; + var SchemaType = require_schemaType(); + var symbols = require_symbols2(); + var isObject = require_isObject(); + var utils = require_utils6(); + function SchemaMixed(path, options, _schemaOptions, parentSchema) { + if (options && options.default) { + const def = options.default; + if (Array.isArray(def) && def.length === 0) { + options.default = Array; + } else if (!options.shared && isObject(def) && Object.keys(def).length === 0) { + options.default = function() { + return {}; + }; + } + } + SchemaType.call(this, path, options, "Mixed", parentSchema); + this[symbols.schemaMixedSymbol] = true; + } + SchemaMixed.schemaName = "Mixed"; + SchemaMixed.defaultOptions = {}; + SchemaMixed.prototype = Object.create(SchemaType.prototype); + SchemaMixed.prototype.constructor = SchemaMixed; + SchemaMixed.get = SchemaType.get; + SchemaMixed.set = SchemaType.set; + SchemaMixed.setters = []; + SchemaMixed.prototype.cast = function(val) { + if (val instanceof Error) { + return utils.errorToPOJO(val); + } + return val; + }; + SchemaMixed.prototype.castForQuery = function($cond, val) { + return val; + }; + SchemaMixed.prototype.toJSONSchema = function toJSONSchema(_options) { + return {}; + }; + module2.exports = SchemaMixed; + } +}); + +// node_modules/mongoose/lib/modifiedPathsSnapshot.js +var require_modifiedPathsSnapshot = __commonJS({ + "node_modules/mongoose/lib/modifiedPathsSnapshot.js"(exports2, module2) { + "use strict"; + module2.exports = class ModifiedPathsSnapshot { + constructor(subdocSnapshot, activePaths, version) { + this.subdocSnapshot = subdocSnapshot; + this.activePaths = activePaths; + this.version = version; + } + }; + } +}); + +// node_modules/mongoose/lib/error/objectExpected.js +var require_objectExpected = __commonJS({ + "node_modules/mongoose/lib/error/objectExpected.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var ObjectExpectedError = class extends MongooseError { + constructor(path, val) { + const typeDescription = Array.isArray(val) ? "array" : "primitive value"; + super("Tried to set nested object field `" + path + `\` to ${typeDescription} \`` + val + "`"); + this.path = path; + } + }; + Object.defineProperty(ObjectExpectedError.prototype, "name", { + value: "ObjectExpectedError" + }); + module2.exports = ObjectExpectedError; + } +}); + +// node_modules/mongoose/lib/error/objectParameter.js +var require_objectParameter = __commonJS({ + "node_modules/mongoose/lib/error/objectParameter.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var ObjectParameterError = class extends MongooseError { + constructor(value, paramName, fnName) { + super('Parameter "' + paramName + '" to ' + fnName + '() must be an object, got "' + (value?.toString() ?? value + "") + '" (type ' + typeof value + ")"); + } + }; + Object.defineProperty(ObjectParameterError.prototype, "name", { + value: "ObjectParameterError" + }); + module2.exports = ObjectParameterError; + } +}); + +// node_modules/mongoose/lib/error/parallelValidate.js +var require_parallelValidate = __commonJS({ + "node_modules/mongoose/lib/error/parallelValidate.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var ParallelValidateError = class extends MongooseError { + constructor(doc) { + const msg = "Can't validate() the same doc multiple times in parallel. Document: "; + super(msg + doc._doc._id); + } + }; + Object.defineProperty(ParallelValidateError.prototype, "name", { + value: "ParallelValidateError" + }); + module2.exports = ParallelValidateError; + } +}); + +// node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js +var require_hasIncludedChildren = __commonJS({ + "node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js"(exports2, module2) { + "use strict"; + module2.exports = function hasIncludedChildren(fields) { + const hasIncludedChildren2 = {}; + const keys = Object.keys(fields); + for (const key of keys) { + if (key.indexOf(".") === -1) { + hasIncludedChildren2[key] = 1; + continue; + } + const parts = key.split("."); + let c4 = parts[0]; + for (let i4 = 0; i4 < parts.length; ++i4) { + hasIncludedChildren2[c4] = 1; + if (i4 + 1 < parts.length) { + c4 = c4 + "." + parts[i4 + 1]; + } + } + } + return hasIncludedChildren2; + }; + } +}); + +// node_modules/mongoose/lib/helpers/projection/isNestedProjection.js +var require_isNestedProjection = __commonJS({ + "node_modules/mongoose/lib/helpers/projection/isNestedProjection.js"(exports2, module2) { + "use strict"; + module2.exports = function isNestedProjection(val) { + if (val == null || typeof val !== "object") { + return false; + } + return val.$slice == null && val.$elemMatch == null && val.$meta == null && val.$ == null; + }; + } +}); + +// node_modules/mongoose/lib/helpers/document/applyDefaults.js +var require_applyDefaults = __commonJS({ + "node_modules/mongoose/lib/helpers/document/applyDefaults.js"(exports2, module2) { + "use strict"; + var isNestedProjection = require_isNestedProjection(); + module2.exports = function applyDefaults(doc, fields, exclude, hasIncludedChildren, isBeforeSetters, pathsToSkip, options) { + const paths = Object.keys(doc.$__schema.paths); + const plen = paths.length; + const skipParentChangeTracking = options && options.skipParentChangeTracking; + for (let i4 = 0; i4 < plen; ++i4) { + let def; + let curPath = ""; + const p4 = paths[i4]; + if (p4 === "_id" && doc.$__.skipId) { + continue; + } + const type = doc.$__schema.paths[p4]; + const path = type.splitPath(); + const len = path.length; + if (path[len - 1] === "$*") { + continue; + } + let included = false; + let doc_ = doc._doc; + for (let j4 = 0; j4 < len; ++j4) { + if (doc_ == null) { + break; + } + const piece = path[j4]; + curPath += (!curPath.length ? "" : ".") + piece; + if (exclude === true) { + if (curPath in fields) { + break; + } + } else if (exclude === false && fields && !included) { + const hasSubpaths = type.$isSingleNested || type.$isMongooseDocumentArray; + if (curPath in fields && !isNestedProjection(fields[curPath]) || j4 === len - 1 && hasSubpaths && hasIncludedChildren != null && hasIncludedChildren[curPath]) { + included = true; + } else if (hasIncludedChildren != null && !hasIncludedChildren[curPath]) { + break; + } + } + if (j4 === len - 1) { + if (doc_[piece] !== void 0) { + break; + } + if (isBeforeSetters != null) { + if (typeof type.defaultValue === "function") { + if (!type.defaultValue.$runBeforeSetters && isBeforeSetters) { + break; + } + if (type.defaultValue.$runBeforeSetters && !isBeforeSetters) { + break; + } + } else if (!isBeforeSetters) { + continue; + } + } + if (pathsToSkip && pathsToSkip[curPath]) { + break; + } + if (fields && exclude !== null) { + if (exclude === true) { + if (p4 in fields) { + continue; + } + try { + def = type.getDefault(doc, false); + } catch (err) { + doc.invalidate(p4, err); + break; + } + if (typeof def !== "undefined") { + doc_[piece] = def; + applyChangeTracking(doc, p4, skipParentChangeTracking); + } + } else if (included) { + try { + def = type.getDefault(doc, false); + } catch (err) { + doc.invalidate(p4, err); + break; + } + if (typeof def !== "undefined") { + doc_[piece] = def; + applyChangeTracking(doc, p4, skipParentChangeTracking); + } + } + } else { + try { + def = type.getDefault(doc, false); + } catch (err) { + doc.invalidate(p4, err); + break; + } + if (typeof def !== "undefined") { + doc_[piece] = def; + applyChangeTracking(doc, p4, skipParentChangeTracking); + } + } + } else { + doc_ = doc_[piece]; + } + } + } + }; + function applyChangeTracking(doc, fullPath, skipParentChangeTracking) { + doc.$__.activePaths.default(fullPath); + if (!skipParentChangeTracking && doc.$isSubdocument && doc.$isSingleNested && doc.$parent() != null) { + doc.$parent().$__.activePaths.default(doc.$__pathRelativeToParent(fullPath)); + } + } + } +}); + +// node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js +var require_cleanModifiedSubpaths = __commonJS({ + "node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js"(exports2, module2) { + "use strict"; + module2.exports = function cleanModifiedSubpaths(doc, path, options) { + options = options || {}; + const skipDocArrays = options.skipDocArrays; + let deleted = 0; + if (!doc) { + return deleted; + } + for (const modifiedPath of Object.keys(doc.$__.activePaths.getStatePaths("modify"))) { + if (skipDocArrays) { + const schemaType = doc.$__schema.path(modifiedPath); + if (schemaType && schemaType.$isMongooseDocumentArray) { + continue; + } + } + if (modifiedPath.startsWith(path + ".")) { + doc.$__.activePaths.clearPath(modifiedPath); + ++deleted; + if (doc.$isSubdocument) { + cleanParent(doc, modifiedPath); + } + } + } + return deleted; + }; + function cleanParent(doc, path, seen = /* @__PURE__ */ new Set()) { + if (seen.has(doc)) { + throw new Error("Infinite subdocument loop: subdoc with _id " + doc._id + " is a parent of itself"); + } + const parent = doc.$parent(); + const newPath = doc.$__pathRelativeToParent(void 0, false) + "." + path; + parent.$__.activePaths.clearPath(newPath); + if (parent.$isSubdocument) { + cleanParent(parent, newPath, seen); + } + } + } +}); + +// node_modules/mongoose/lib/helpers/document/compile.js +var require_compile = __commonJS({ + "node_modules/mongoose/lib/helpers/document/compile.js"(exports2) { + "use strict"; + var clone = require_clone(); + var documentSchemaSymbol = require_symbols().documentSchemaSymbol; + var internalToObjectOptions = require_options().internalToObjectOptions; + var utils = require_utils6(); + var Document; + var getSymbol = require_symbols().getSymbol; + var scopeSymbol = require_symbols().scopeSymbol; + var isPOJO = utils.isPOJO; + exports2.compile = compile; + exports2.defineKey = defineKey; + var _isEmptyOptions = Object.freeze({ + minimize: true, + virtuals: false, + getters: false, + transform: false + }); + var noDottedPathGetOptions = Object.freeze({ + noDottedPath: true + }); + function compile(tree, proto, prefix, options) { + Document = Document || require_document2(); + const typeKey = options.typeKey; + for (const key of Object.keys(tree)) { + const limb = tree[key]; + const hasSubprops = isPOJO(limb) && Object.keys(limb).length > 0 && (!limb[typeKey] || typeKey === "type" && isPOJO(limb.type) && limb.type.type); + const subprops = hasSubprops ? limb : null; + defineKey({ prop: key, subprops, prototype: proto, prefix, options }); + } + } + function defineKey({ prop, subprops, prototype, prefix, options }) { + Document = Document || require_document2(); + const path = (prefix ? prefix + "." : "") + prop; + prefix = prefix || ""; + const useGetOptions = prefix ? Object.freeze({}) : noDottedPathGetOptions; + if (subprops) { + Object.defineProperty(prototype, prop, { + enumerable: true, + configurable: true, + get: function() { + const _this = this; + if (!this.$__.getters) { + this.$__.getters = {}; + } + if (!this.$__.getters[path]) { + const nested = Object.create(Document.prototype, getOwnPropertyDescriptors(this)); + if (!prefix) { + nested.$__[scopeSymbol] = this; + } + nested.$__.nestedPath = path; + Object.defineProperty(nested, "schema", { + enumerable: false, + configurable: true, + writable: false, + value: prototype.schema + }); + Object.defineProperty(nested, "$__schema", { + enumerable: false, + configurable: true, + writable: false, + value: prototype.schema + }); + Object.defineProperty(nested, documentSchemaSymbol, { + enumerable: false, + configurable: true, + writable: false, + value: prototype.schema + }); + Object.defineProperty(nested, "toObject", { + enumerable: false, + configurable: true, + writable: false, + value: function() { + return clone(_this.get(path, null, { + virtuals: this && this.schema && this.schema.options && this.schema.options.toObject && this.schema.options.toObject.virtuals || null + })); + } + }); + Object.defineProperty(nested, "$__get", { + enumerable: false, + configurable: true, + writable: false, + value: function() { + return _this.get(path, null, { + virtuals: this && this.schema && this.schema.options && this.schema.options.toObject && this.schema.options.toObject.virtuals || null + }); + } + }); + Object.defineProperty(nested, "toJSON", { + enumerable: false, + configurable: true, + writable: false, + value: function() { + return _this.get(path, null, { + virtuals: this && this.schema && this.schema.options && this.schema.options.toJSON && this.schema.options.toJSON.virtuals || null + }); + } + }); + Object.defineProperty(nested, "$__isNested", { + enumerable: false, + configurable: true, + writable: false, + value: true + }); + Object.defineProperty(nested, "$isEmpty", { + enumerable: false, + configurable: true, + writable: false, + value: function() { + return Object.keys(this.get(path, null, _isEmptyOptions) || {}).length === 0; + } + }); + Object.defineProperty(nested, "$__parent", { + enumerable: false, + configurable: true, + writable: false, + value: this + }); + compile(subprops, nested, path, options); + this.$__.getters[path] = nested; + } + return this.$__.getters[path]; + }, + set: function(v4) { + if (v4 != null && v4.$__isNested) { + v4 = v4.$__get(); + } else if (v4 instanceof Document && !v4.$__isNested) { + v4 = v4.$toObject(internalToObjectOptions); + } + const doc = this.$__[scopeSymbol] || this; + doc.$set(path, v4); + } + }); + } else { + Object.defineProperty(prototype, prop, { + enumerable: true, + configurable: true, + get: function() { + return this[getSymbol].call( + this.$__[scopeSymbol] || this, + path, + null, + useGetOptions + ); + }, + set: function(v4) { + this.$set.call(this.$__[scopeSymbol] || this, path, v4); + } + }); + } + } + function getOwnPropertyDescriptors(object) { + const result = {}; + Object.getOwnPropertyNames(object).forEach(function(key) { + const skip = [ + "isNew", + "$__", + "$errors", + "errors", + "_doc", + "$locals", + "$op", + "__parentArray", + "__index", + "$isDocumentArrayElement" + ].indexOf(key) === -1; + if (skip) { + return; + } + result[key] = Object.getOwnPropertyDescriptor(object, key); + result[key].enumerable = false; + }); + return result; + } + } +}); + +// node_modules/mongoose/lib/helpers/firstKey.js +var require_firstKey = __commonJS({ + "node_modules/mongoose/lib/helpers/firstKey.js"(exports2, module2) { + "use strict"; + module2.exports = function firstKey(obj) { + if (obj == null) { + return null; + } + return Object.keys(obj)[0]; + }; + } +}); + +// node_modules/mongoose/lib/helpers/common.js +var require_common4 = __commonJS({ + "node_modules/mongoose/lib/helpers/common.js"(exports2) { + "use strict"; + var Binary = require_bson().Binary; + var isBsonType = require_isBsonType(); + var isMongooseObject = require_isMongooseObject(); + var MongooseError = require_error2(); + var util = require("util"); + exports2.flatten = flatten; + exports2.modifiedPaths = modifiedPaths; + function flatten(update, path, options, schema) { + let keys; + if (update && isMongooseObject(update) && !Buffer.isBuffer(update)) { + keys = Object.keys(update.toObject({ transform: false, virtuals: false }) || {}); + } else { + keys = Object.keys(update || {}); + } + const numKeys = keys.length; + const result = {}; + path = path ? path + "." : ""; + for (let i4 = 0; i4 < numKeys; ++i4) { + const key = keys[i4]; + const val = update[key]; + result[path + key] = val; + const keySchema = schema && schema.path && schema.path(path + key); + const isNested = schema && schema.nested && schema.nested[path + key]; + if (keySchema && keySchema.instance === "Mixed") continue; + if (shouldFlatten(val)) { + if (options && options.skipArrays && Array.isArray(val)) { + continue; + } + const flat = flatten(val, path + key, options, schema); + for (const k4 in flat) { + result[k4] = flat[k4]; + } + if (Array.isArray(val)) { + result[path + key] = val; + } + } + if (isNested) { + const paths = Object.keys(schema.paths); + for (const p4 of paths) { + if (p4.startsWith(path + key + ".") && !Object.hasOwn(result, p4)) { + result[p4] = void 0; + } + } + } + } + return result; + } + function modifiedPaths(update, path, result, recursion = null) { + if (update == null || typeof update !== "object") { + return; + } + if (recursion == null) { + recursion = { + raw: { update, path }, + trace: /* @__PURE__ */ new WeakSet() + }; + } + if (recursion.trace.has(update)) { + throw new MongooseError(`a circular reference in the update value, updateValue: +${util.inspect(recursion.raw.update, { showHidden: false, depth: 1 })} +updatePath: '${recursion.raw.path}'`); + } + recursion.trace.add(update); + const keys = Object.keys(update || {}); + const numKeys = keys.length; + result = result || {}; + path = path ? path + "." : ""; + for (let i4 = 0; i4 < numKeys; ++i4) { + const key = keys[i4]; + let val = update[key]; + const _path = path + key; + result[_path] = true; + if (!Buffer.isBuffer(val) && isMongooseObject(val)) { + val = val.toObject({ transform: false, virtuals: false }); + } + if (shouldFlatten(val)) { + modifiedPaths(val, path + key, result, recursion); + } + } + recursion.trace.delete(update); + return result; + } + function shouldFlatten(val) { + return val && typeof val === "object" && !(val instanceof Date) && !isBsonType(val, "ObjectId") && (!Array.isArray(val) || val.length !== 0) && !(val instanceof Buffer) && !isBsonType(val, "Decimal128") && !(val instanceof Binary); + } + } +}); + +// node_modules/mongoose/lib/helpers/get.js +var require_get = __commonJS({ + "node_modules/mongoose/lib/helpers/get.js"(exports2, module2) { + "use strict"; + module2.exports = function get2(obj, path, def) { + let parts; + let isPathArray = false; + if (typeof path === "string") { + if (path.indexOf(".") === -1) { + const _v = getProperty(obj, path); + if (_v == null) { + return def; + } + return _v; + } + parts = path.split("."); + } else { + isPathArray = true; + parts = path; + if (parts.length === 1) { + const _v = getProperty(obj, parts[0]); + if (_v == null) { + return def; + } + return _v; + } + } + let rest = path; + let cur = obj; + for (const part of parts) { + if (cur == null) { + return def; + } + if (!isPathArray && cur[rest] != null) { + return cur[rest]; + } + cur = getProperty(cur, part); + if (!isPathArray) { + rest = rest.substr(part.length + 1); + } + } + return cur == null ? def : cur; + }; + function getProperty(obj, prop) { + if (obj == null) { + return obj; + } + if (obj instanceof Map) { + return obj.get(prop); + } + return obj[prop]; + } + } +}); + +// node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js +var require_areDiscriminatorValuesEqual = __commonJS({ + "node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js"(exports2, module2) { + "use strict"; + var isBsonType = require_isBsonType(); + module2.exports = function areDiscriminatorValuesEqual(a4, b4) { + if (typeof a4 === "string" && typeof b4 === "string") { + return a4 === b4; + } + if (typeof a4 === "number" && typeof b4 === "number") { + return a4 === b4; + } + if (isBsonType(a4, "ObjectId") && isBsonType(b4, "ObjectId")) { + return a4.toString() === b4.toString(); + } + return false; + }; + } +}); + +// node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js +var require_getSchemaDiscriminatorByValue = __commonJS({ + "node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js"(exports2, module2) { + "use strict"; + var areDiscriminatorValuesEqual = require_areDiscriminatorValuesEqual(); + module2.exports = function getSchemaDiscriminatorByValue(schema, value) { + if (schema == null || schema.discriminators == null) { + return null; + } + for (const key of Object.keys(schema.discriminators)) { + const discriminatorSchema = schema.discriminators[key]; + if (discriminatorSchema.discriminatorMapping == null) { + continue; + } + if (areDiscriminatorValuesEqual(discriminatorSchema.discriminatorMapping.value, value)) { + return discriminatorSchema; + } + } + return null; + }; + } +}); + +// node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js +var require_getEmbeddedDiscriminatorPath = __commonJS({ + "node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js"(exports2, module2) { + "use strict"; + var get2 = require_get(); + var getSchemaDiscriminatorByValue = require_getSchemaDiscriminatorByValue(); + module2.exports = function getEmbeddedDiscriminatorPath(doc, path, options) { + options = options || {}; + const typeOnly = options.typeOnly; + const parts = Array.isArray(path) ? path : path.indexOf(".") === -1 ? [path] : path.split("."); + let schemaType = null; + let type = "adhocOrUndefined"; + const schema = getSchemaDiscriminatorByValue(doc.schema, doc.get(doc.schema.options.discriminatorKey)) || doc.schema; + for (let i4 = 0; i4 < parts.length; ++i4) { + const subpath = parts.slice(0, i4 + 1).join("."); + schemaType = schema.path(subpath); + if (schemaType == null) { + type = "adhocOrUndefined"; + continue; + } + if (schemaType.instance === "Mixed") { + return typeOnly ? "real" : schemaType; + } + type = schema.pathType(subpath); + if ((schemaType.$isSingleNested || schemaType.$isMongooseDocumentArrayElement) && schemaType.schema.discriminators != null) { + const discriminators = schemaType.schema.discriminators; + const discriminatorKey = doc.get(subpath + "." + get2(schemaType, "schema.options.discriminatorKey")); + if (discriminatorKey == null || discriminators[discriminatorKey] == null) { + continue; + } + const rest = parts.slice(i4 + 1).join("."); + return getEmbeddedDiscriminatorPath(doc.get(subpath), rest, options); + } + } + return typeOnly ? type : schemaType; + }; + } +}); + +// node_modules/mongoose/lib/helpers/schema/getKeysInSchemaOrder.js +var require_getKeysInSchemaOrder = __commonJS({ + "node_modules/mongoose/lib/helpers/schema/getKeysInSchemaOrder.js"(exports2, module2) { + "use strict"; + var get2 = require_get(); + module2.exports = function getKeysInSchemaOrder(schema, val, path) { + const schemaKeys = path != null ? Object.keys(get2(schema.tree, path, {})) : Object.keys(schema.tree); + const valKeys = new Set(Object.keys(val)); + let keys; + if (valKeys.size > 1) { + keys = /* @__PURE__ */ new Set(); + for (const key of schemaKeys) { + if (valKeys.has(key)) { + keys.add(key); + } + } + for (const key of valKeys) { + if (!keys.has(key)) { + keys.add(key); + } + } + keys = Array.from(keys); + } else { + keys = Array.from(valKeys); + } + return keys; + }; + } +}); + +// node_modules/mongoose/lib/helpers/schema/getSubdocumentStrictValue.js +var require_getSubdocumentStrictValue = __commonJS({ + "node_modules/mongoose/lib/helpers/schema/getSubdocumentStrictValue.js"(exports2, module2) { + "use strict"; + module2.exports = function getSubdocumentStrictValue(schema, parts) { + if (parts.length === 1) { + return void 0; + } + let cur = parts[0]; + let strict = void 0; + for (let i4 = 0; i4 < parts.length - 1; ++i4) { + const curSchemaType = schema.path(cur); + if (curSchemaType && curSchemaType.schema) { + strict = curSchemaType.schema.options.strict; + schema = curSchemaType.schema; + cur = curSchemaType.$isMongooseDocumentArray && !isNaN(parts[i4 + 1]) ? "" : parts[i4 + 1]; + } else { + cur += cur.length ? "." + parts[i4 + 1] : parts[i4 + 1]; + } + } + return strict; + }; + } +}); + +// node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js +var require_handleSpreadDoc = __commonJS({ + "node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js"(exports2, module2) { + "use strict"; + var utils = require_utils6(); + var keysToSkip = /* @__PURE__ */ new Set(["__index", "__parentArray", "_doc"]); + module2.exports = function handleSpreadDoc(v4, includeExtraKeys) { + if (utils.isPOJO(v4) && v4.$__ != null && v4._doc != null) { + if (includeExtraKeys) { + const extraKeys = {}; + for (const key of Object.keys(v4)) { + if (typeof key === "symbol") { + continue; + } + if (key[0] === "$") { + continue; + } + if (keysToSkip.has(key)) { + continue; + } + extraKeys[key] = v4[key]; + } + return { ...v4._doc, ...extraKeys }; + } + return v4._doc; + } + return v4; + }; + } +}); + +// node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js +var require_isDefiningProjection = __commonJS({ + "node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js"(exports2, module2) { + "use strict"; + module2.exports = function isDefiningProjection(val) { + if (val == null) { + return true; + } + if (typeof val === "object") { + return !("$meta" in val) && !("$slice" in val); + } + return true; + }; + } +}); + +// node_modules/mongoose/lib/helpers/projection/isExclusive.js +var require_isExclusive = __commonJS({ + "node_modules/mongoose/lib/helpers/projection/isExclusive.js"(exports2, module2) { + "use strict"; + var isDefiningProjection = require_isDefiningProjection(); + var isPOJO = require_isPOJO(); + module2.exports = function isExclusive(projection) { + if (projection == null) { + return null; + } + const keys = Object.keys(projection); + let exclude = null; + if (keys.length === 1 && keys[0] === "_id") { + exclude = !projection._id; + } else { + for (let ki = 0; ki < keys.length; ++ki) { + const key = keys[ki]; + if (key !== "_id" && isDefiningProjection(projection[key])) { + exclude = isPOJO(projection[key]) ? isExclusive(projection[key]) ?? exclude : !projection[key]; + if (exclude != null) { + break; + } + } + } + } + return exclude; + }; + } +}); + +// node_modules/mongoose/lib/helpers/projection/isPathExcluded.js +var require_isPathExcluded = __commonJS({ + "node_modules/mongoose/lib/helpers/projection/isPathExcluded.js"(exports2, module2) { + "use strict"; + var isDefiningProjection = require_isDefiningProjection(); + module2.exports = function isPathExcluded(projection, path) { + if (projection == null) { + return false; + } + if (path === "_id") { + return projection._id === 0; + } + const paths = Object.keys(projection); + let type = null; + for (const _path of paths) { + if (isDefiningProjection(projection[_path])) { + type = projection[path] === 1 ? "inclusive" : "exclusive"; + break; + } + } + if (type === "inclusive") { + return projection[path] !== 1; + } + if (type === "exclusive") { + return projection[path] === 0; + } + return false; + }; + } +}); + +// node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js +var require_markArraySubdocsPopulated = __commonJS({ + "node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js"(exports2, module2) { + "use strict"; + var utils = require_utils6(); + module2.exports = function markArraySubdocsPopulated(doc, populated) { + if (doc._doc._id == null || populated == null || populated.length === 0) { + return; + } + const id = String(doc._doc._id); + for (const item of populated) { + if (item.isVirtual) { + continue; + } + const path = item.path; + const pieces = path.split("."); + for (let i4 = 0; i4 < pieces.length - 1; ++i4) { + const subpath = pieces.slice(0, i4 + 1).join("."); + const rest = pieces.slice(i4 + 1).join("."); + const val = doc.get(subpath); + if (val == null) { + continue; + } + if (utils.isMongooseDocumentArray(val)) { + for (let j4 = 0; j4 < val.length; ++j4) { + if (val[j4]) { + val[j4].populated(rest, item._docs[id] == null ? void 0 : item._docs[id][j4], item); + } + } + break; + } + } + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/minimize.js +var require_minimize = __commonJS({ + "node_modules/mongoose/lib/helpers/minimize.js"(exports2, module2) { + "use strict"; + var { isPOJO } = require_utils6(); + module2.exports = minimize; + function minimize(obj) { + const keys = Object.keys(obj); + let i4 = keys.length; + let hasKeys; + let key; + let val; + while (i4--) { + key = keys[i4]; + val = obj[key]; + if (isPOJO(val)) { + obj[key] = minimize(val); + } + if (void 0 === obj[key]) { + delete obj[key]; + continue; + } + hasKeys = true; + } + return hasKeys ? obj : void 0; + } + } +}); + +// node_modules/mongoose/lib/helpers/path/parentPaths.js +var require_parentPaths = __commonJS({ + "node_modules/mongoose/lib/helpers/path/parentPaths.js"(exports2, module2) { + "use strict"; + var dotRE = /\./g; + module2.exports = function parentPaths(path) { + if (path.indexOf(".") === -1) { + return [path]; + } + const pieces = path.split(dotRE); + const len = pieces.length; + const ret = new Array(len); + let cur = ""; + for (let i4 = 0; i4 < len; ++i4) { + cur += cur.length !== 0 ? "." + pieces[i4] : pieces[i4]; + ret[i4] = cur; + } + return ret; + }; + } +}); + +// node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js +var require_checkEmbeddedDiscriminatorKeyProjection = __commonJS({ + "node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js"(exports2, module2) { + "use strict"; + module2.exports = function checkEmbeddedDiscriminatorKeyProjection(userProjection, path, schema, selected, addedPaths) { + const userProjectedInPath = Object.keys(userProjection).reduce((cur, key) => cur || key.startsWith(path + "."), false); + const _discriminatorKey = path + "." + schema.options.discriminatorKey; + if (!userProjectedInPath && addedPaths.length === 1 && addedPaths[0] === _discriminatorKey) { + selected.splice(selected.indexOf(_discriminatorKey), 1); + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js +var require_getDiscriminatorByValue = __commonJS({ + "node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js"(exports2, module2) { + "use strict"; + var areDiscriminatorValuesEqual = require_areDiscriminatorValuesEqual(); + module2.exports = function getDiscriminatorByValue(discriminators, value) { + if (discriminators == null) { + return null; + } + for (const name of Object.keys(discriminators)) { + const it = discriminators[name]; + if (it.schema && it.schema.discriminatorMapping && areDiscriminatorValuesEqual(it.schema.discriminatorMapping.value, value)) { + return it; + } + } + return null; + }; + } +}); + +// node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js +var require_isPathSelectedInclusive = __commonJS({ + "node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js"(exports2, module2) { + "use strict"; + module2.exports = function isPathSelectedInclusive(fields, path) { + const chunks = path.split("."); + let cur = ""; + let j4; + let keys; + let numKeys; + for (let i4 = 0; i4 < chunks.length; ++i4) { + cur += cur.length ? "." : "" + chunks[i4]; + if (fields[cur]) { + keys = Object.keys(fields); + numKeys = keys.length; + for (j4 = 0; j4 < numKeys; ++j4) { + if (keys[i4].indexOf(cur + ".") === 0 && keys[i4].indexOf(path) !== 0) { + continue; + } + } + return true; + } + } + return false; + }; + } +}); + +// node_modules/mongoose/lib/queryHelpers.js +var require_queryHelpers = __commonJS({ + "node_modules/mongoose/lib/queryHelpers.js"(exports2) { + "use strict"; + var PopulateOptions = require_populateOptions(); + var checkEmbeddedDiscriminatorKeyProjection = require_checkEmbeddedDiscriminatorKeyProjection(); + var get2 = require_get(); + var getDiscriminatorByValue = require_getDiscriminatorByValue(); + var isDefiningProjection = require_isDefiningProjection(); + var clone = require_clone(); + var isPathSelectedInclusive = require_isPathSelectedInclusive(); + exports2.preparePopulationOptionsMQ = function preparePopulationOptionsMQ(query, options) { + const _populate = query._mongooseOptions.populate; + const pop = Object.keys(_populate).reduce((vals, key) => vals.concat([_populate[key]]), []); + if (options.lean != null) { + pop.filter((p4) => (p4 && p4.options && p4.options.lean) == null).forEach(makeLean(options.lean)); + } + const session = query && query.options && query.options.session || null; + if (session != null) { + pop.forEach((path) => { + if (path.options == null) { + path.options = { session }; + return; + } + if (!("session" in path.options)) { + path.options.session = session; + } + }); + } + const projection = query._fieldsForExec(); + for (let i4 = 0; i4 < pop.length; ++i4) { + if (pop[i4] instanceof PopulateOptions) { + pop[i4] = new PopulateOptions({ + ...pop[i4], + _queryProjection: projection, + _localModel: query.model + }); + } else { + pop[i4]._queryProjection = projection; + pop[i4]._localModel = query.model; + } + } + return pop; + }; + exports2.createModel = function createModel(model, doc, fields, userProvidedFields, options) { + model.hooks.execPreSync("createModel", doc); + const discriminatorMapping = model.schema ? model.schema.discriminatorMapping : null; + const key = discriminatorMapping && discriminatorMapping.isRoot ? discriminatorMapping.key : null; + const value = doc[key]; + if (key && value && model.discriminators) { + const discriminator = model.discriminators[value] || getDiscriminatorByValue(model.discriminators, value); + if (discriminator) { + const _fields = clone(userProvidedFields); + exports2.applyPaths(_fields, discriminator.schema); + return new discriminator(void 0, _fields, true); + } + } + const _opts = { + skipId: true, + isNew: false, + willInit: true + }; + if (options != null && "defaults" in options) { + _opts.defaults = options.defaults; + } + return new model(void 0, fields, _opts); + }; + exports2.createModelAndInit = function createModelAndInit(model, doc, fields, userProvidedFields, options, populatedIds, callback) { + const initOpts = populatedIds ? { populated: populatedIds } : void 0; + const casted = exports2.createModel(model, doc, fields, userProvidedFields, options); + try { + casted.$init(doc, initOpts, callback); + } catch (error2) { + callback(error2, casted); + } + }; + exports2.applyPaths = function applyPaths(fields, schema, sanitizeProjection) { + let exclude; + let keys; + const minusPathsToSkip = /* @__PURE__ */ new Set(); + if (fields) { + keys = Object.keys(fields); + const minusPaths = []; + for (let i4 = 0; i4 < keys.length; ++i4) { + const key = keys[i4]; + if (keys[i4][0] !== "-") { + continue; + } + delete fields[key]; + if (key === "-_id") { + fields["_id"] = 0; + } else { + minusPaths.push(key.slice(1)); + } + } + keys = Object.keys(fields); + for (let keyIndex = 0; keyIndex < keys.length; ++keyIndex) { + if (keys[keyIndex][0] === "+") { + continue; + } + const field = fields[keys[keyIndex]]; + if (!isDefiningProjection(field)) { + continue; + } + if (keys[keyIndex] === "_id" && keys.length > 1) { + continue; + } + if (keys[keyIndex] === schema.options.discriminatorKey && keys.length > 1 && field != null && !field) { + continue; + } + exclude = !field; + break; + } + for (const path of minusPaths) { + const type = schema.path(path); + if (!type || !type.selected || exclude !== false) { + fields[path] = 0; + exclude = true; + } else if (type && type.selected && exclude === false) { + minusPathsToSkip.add(path); + } + } + } + const selected = []; + const excluded = []; + const stack2 = []; + analyzeSchema(schema); + switch (exclude) { + case true: + for (const fieldName of excluded) { + fields[fieldName] = 0; + } + break; + case false: + if (schema && schema.paths["_id"] && schema.paths["_id"].options && schema.paths["_id"].options.select === false) { + fields._id = 0; + } + for (const fieldName of selected) { + if (minusPathsToSkip.has(fieldName)) { + continue; + } + if (isPathSelectedInclusive(fields, fieldName)) { + continue; + } + fields[fieldName] = fields[fieldName] || 1; + } + break; + case void 0: + if (fields == null) { + break; + } + for (const key of Object.keys(fields || {})) { + if (key.startsWith("+")) { + delete fields[key]; + } + } + for (const fieldName of excluded) { + if (fields[fieldName] != null) { + continue; + } + fields[fieldName] = 0; + } + break; + } + function analyzeSchema(schema2, prefix) { + prefix || (prefix = ""); + if (stack2.indexOf(schema2) !== -1) { + return []; + } + stack2.push(schema2); + const addedPaths = []; + schema2.eachPath(function(path, type) { + if (prefix) path = prefix + "." + path; + if (type.$isSchemaMap || path.endsWith(".$*")) { + const plusPath = "+" + path; + const hasPlusPath = fields && plusPath in fields; + if (type.options && type.options.select === false && !hasPlusPath) { + excluded.push(path); + } + return; + } + let addedPath = analyzePath(path, type); + if (addedPath == null && !Array.isArray(type) && type.$isMongooseArray && !type.$isMongooseDocumentArray) { + addedPath = analyzePath(path, type.caster); + } + if (addedPath != null) { + addedPaths.push(addedPath); + } + if (type.schema) { + const _addedPaths = analyzeSchema(type.schema, path); + if (exclude === false) { + checkEmbeddedDiscriminatorKeyProjection( + fields, + path, + type.schema, + selected, + _addedPaths + ); + } + } + }); + stack2.pop(); + return addedPaths; + } + function analyzePath(path, type) { + if (fields == null) { + return; + } + if (typeof type.selected !== "boolean") { + return; + } + if (type.selected === false && fields[path]) { + if (sanitizeProjection) { + fields[path] = 0; + } + return; + } + if (!exclude && type.selected && path === schema.options.discriminatorKey && fields[path] != null && !fields[path]) { + delete fields[path]; + return; + } + if (exclude === false && type.selected && fields[path] != null && !fields[path]) { + delete fields[path]; + return; + } + const plusPath = "+" + path; + const hasPlusPath = fields && plusPath in fields; + if (hasPlusPath) { + delete fields[plusPath]; + if (exclude === false && keys.length > 1 && !~keys.indexOf(path) && !sanitizeProjection) { + fields[path] = 1; + } else if (exclude == null && sanitizeProjection && type.selected === false) { + fields[path] = 0; + } + return; + } + const pieces = path.split("."); + let cur = ""; + for (let i4 = 0; i4 < pieces.length; ++i4) { + cur += cur.length ? "." + pieces[i4] : pieces[i4]; + if (excluded.indexOf(cur) !== -1) { + return; + } + } + if (!exclude && (type && type.options && type.options.$skipDiscriminatorCheck || false)) { + let cur2 = ""; + for (let i4 = 0; i4 < pieces.length; ++i4) { + cur2 += (cur2.length === 0 ? "" : ".") + pieces[i4]; + const projection = get2(fields, cur2, false) || get2(fields, cur2 + ".$", false); + if (projection && typeof projection !== "object") { + return; + } + } + } + (type.selected ? selected : excluded).push(path); + return path; + } + }; + function makeLean(val) { + return function(option) { + option.options || (option.options = {}); + if (val != null && Array.isArray(val.virtuals)) { + val = Object.assign({}, val); + val.virtuals = val.virtuals.filter((path) => typeof path === "string" && path.startsWith(option.path + ".")).map((path) => path.slice(option.path.length + 1)); + } + option.options.lean = val; + }; + } + } +}); + +// node_modules/mongoose/lib/helpers/isPromise.js +var require_isPromise = __commonJS({ + "node_modules/mongoose/lib/helpers/isPromise.js"(exports2, module2) { + "use strict"; + function isPromise(val) { + return !!val && (typeof val === "object" || typeof val === "function") && typeof val.then === "function"; + } + module2.exports = isPromise; + } +}); + +// node_modules/mongoose/lib/helpers/document/getDeepestSubdocumentForPath.js +var require_getDeepestSubdocumentForPath = __commonJS({ + "node_modules/mongoose/lib/helpers/document/getDeepestSubdocumentForPath.js"(exports2, module2) { + "use strict"; + module2.exports = function getDeepestSubdocumentForPath(doc, parts, schema) { + let curPath = parts[0]; + let curSchema = schema; + let subdoc = doc; + for (let i4 = 0; i4 < parts.length - 1; ++i4) { + const curSchemaType = curSchema.path(curPath); + if (curSchemaType && curSchemaType.schema) { + let newSubdoc = subdoc.get(curPath); + curSchema = curSchemaType.schema; + curPath = parts[i4 + 1]; + if (Array.isArray(newSubdoc) && !isNaN(curPath)) { + newSubdoc = newSubdoc[curPath]; + curPath = ""; + } + if (newSubdoc == null) { + break; + } + subdoc = newSubdoc; + } else { + curPath += curPath.length ? "." + parts[i4 + 1] : parts[i4 + 1]; + } + } + return subdoc; + }; + } +}); + +// node_modules/mongoose/lib/types/subdocument.js +var require_subdocument = __commonJS({ + "node_modules/mongoose/lib/types/subdocument.js"(exports2, module2) { + "use strict"; + var Document = require_document2(); + var immediate = require_immediate(); + var internalToObjectOptions = require_options().internalToObjectOptions; + var util = require("util"); + var utils = require_utils6(); + module2.exports = Subdocument; + function Subdocument(value, fields, parent, skipId, options) { + if (typeof skipId === "object" && skipId != null && options == null) { + options = skipId; + skipId = void 0; + } + if (parent != null) { + const parentOptions = { isNew: parent.isNew }; + if ("defaults" in parent.$__) { + parentOptions.defaults = parent.$__.defaults; + } + options = Object.assign(parentOptions, options); + } + if (options != null && options.path != null) { + this.$basePath = options.path; + } + if (options != null && options.pathRelativeToParent != null) { + this.$pathRelativeToParent = options.pathRelativeToParent; + } + let documentOptions = options; + if (options != null && options.path != null) { + documentOptions = Object.assign({}, options); + delete documentOptions.path; + } + Document.call(this, value, fields, skipId, documentOptions); + delete this.$__.priorDoc; + } + Subdocument.prototype = Object.create(Document.prototype); + Object.defineProperty(Subdocument.prototype, "$isSubdocument", { + configurable: false, + writable: false, + value: true + }); + Object.defineProperty(Subdocument.prototype, "$isSingleNested", { + configurable: false, + writable: false, + value: true + }); + Subdocument.prototype.toBSON = function() { + return this.toObject(internalToObjectOptions); + }; + Subdocument.prototype.save = async function save(options) { + options = options || {}; + if (!options.suppressWarning) { + utils.warn("mongoose: calling `save()` on a subdoc does **not** save the document to MongoDB, it only runs save middleware. Use `subdoc.save({ suppressWarning: true })` to hide this warning if you're sure this behavior is right for your app."); + } + return new Promise((resolve, reject) => { + this.$__save((err) => { + if (err != null) { + return reject(err); + } + resolve(this); + }); + }); + }; + Subdocument.prototype.$__fullPath = function(path) { + if (!this.$__.fullPath) { + this.ownerDocument(); + } + return path ? this.$__.fullPath + "." + path : this.$__.fullPath; + }; + Subdocument.prototype.$__pathRelativeToParent = function(p4) { + if (this.$pathRelativeToParent != null) { + return p4 == null ? this.$pathRelativeToParent : this.$pathRelativeToParent + "." + p4; + } + if (p4 == null) { + return this.$basePath; + } + if (!this.$basePath) { + return p4; + } + return [this.$basePath, p4].join("."); + }; + Subdocument.prototype.$__save = function(fn2) { + return immediate(() => fn2(null, this)); + }; + Subdocument.prototype.$isValid = function(path) { + const parent = this.$parent(); + const fullPath = this.$__pathRelativeToParent(path); + if (parent != null && fullPath != null) { + return parent.$isValid(fullPath); + } + return Document.prototype.$isValid.call(this, path); + }; + Subdocument.prototype.markModified = function(path) { + Document.prototype.markModified.call(this, path); + const parent = this.$parent(); + if (parent == null) { + return; + } + const pathToMark = this.$__pathRelativeToParent(path); + if (pathToMark == null) { + return; + } + const myPath = this.$__pathRelativeToParent().replace(/\.$/, ""); + if (parent.isDirectModified(myPath) || this.isNew) { + return; + } + this.$__parent.markModified(pathToMark, this); + }; + Subdocument.prototype.isModified = function(paths, options, modifiedPaths) { + const parent = this.$parent(); + if (parent != null) { + if (Array.isArray(paths) || typeof paths === "string") { + paths = Array.isArray(paths) ? paths : paths.split(" "); + paths = paths.map((p4) => this.$__pathRelativeToParent(p4)).filter((p4) => p4 != null); + } else if (!paths) { + paths = this.$__pathRelativeToParent(); + } + return parent.$isModified(paths, options, modifiedPaths); + } + return Document.prototype.isModified.call(this, paths, options, modifiedPaths); + }; + Subdocument.prototype.$markValid = function(path) { + Document.prototype.$markValid.call(this, path); + const parent = this.$parent(); + const fullPath = this.$__pathRelativeToParent(path); + if (parent != null && fullPath != null) { + parent.$markValid(fullPath); + } + }; + Subdocument.prototype.invalidate = function(path, err, val) { + Document.prototype.invalidate.call(this, path, err, val); + const parent = this.$parent(); + const fullPath = this.$__pathRelativeToParent(path); + if (parent != null && fullPath != null) { + parent.invalidate(fullPath, err, val); + } else if (err.kind === "cast" || err.name === "CastError" || fullPath == null) { + throw err; + } + return this.ownerDocument().$__.validationError; + }; + Subdocument.prototype.$ignore = function(path) { + Document.prototype.$ignore.call(this, path); + const parent = this.$parent(); + const fullPath = this.$__pathRelativeToParent(path); + if (parent != null && fullPath != null) { + parent.$ignore(fullPath); + } + }; + Subdocument.prototype.ownerDocument = function() { + if (this.$__.ownerDocument) { + return this.$__.ownerDocument; + } + let parent = this; + const paths = []; + const seenDocs = /* @__PURE__ */ new Set([parent]); + while (true) { + if (typeof parent.$__pathRelativeToParent !== "function") { + break; + } + paths.unshift(parent.$__pathRelativeToParent(void 0, true)); + const _parent = parent.$parent(); + if (_parent == null) { + break; + } + parent = _parent; + if (seenDocs.has(parent)) { + throw new Error("Infinite subdocument loop: subdoc with _id " + parent._id + " is a parent of itself"); + } + seenDocs.add(parent); + } + this.$__.fullPath = paths.join("."); + this.$__.ownerDocument = parent; + return this.$__.ownerDocument; + }; + Subdocument.prototype.$__fullPathWithIndexes = function() { + let parent = this; + const paths = []; + const seenDocs = /* @__PURE__ */ new Set([parent]); + while (true) { + if (typeof parent.$__pathRelativeToParent !== "function") { + break; + } + paths.unshift(parent.$__pathRelativeToParent(void 0, false)); + const _parent = parent.$parent(); + if (_parent == null) { + break; + } + parent = _parent; + if (seenDocs.has(parent)) { + throw new Error("Infinite subdocument loop: subdoc with _id " + parent._id + " is a parent of itself"); + } + seenDocs.add(parent); + } + return paths.join("."); + }; + Subdocument.prototype.parent = function() { + return this.$__parent; + }; + Subdocument.prototype.$parent = Subdocument.prototype.parent; + Subdocument.prototype.$__deleteOne = function(cb) { + if (cb == null) { + return; + } + return cb(null, this); + }; + Subdocument.prototype.$__removeFromParent = function() { + this.$__parent.set(this.$basePath, null); + }; + Subdocument.prototype.deleteOne = function(options, callback) { + if (typeof options === "function") { + callback = options; + options = null; + } + registerRemoveListener(this); + if (!options || !options.noop) { + this.$__removeFromParent(); + const owner = this.ownerDocument(); + owner.$__.removedSubdocs = owner.$__.removedSubdocs || []; + owner.$__.removedSubdocs.push(this); + } + return this.$__deleteOne(callback); + }; + Subdocument.prototype.populate = function() { + throw new Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.nested.populate("path")`, use `doc.populate("nested.path")`'); + }; + Subdocument.prototype.inspect = function() { + return this.toObject(); + }; + if (util.inspect.custom) { + Subdocument.prototype[util.inspect.custom] = Subdocument.prototype.inspect; + } + Subdocument.prototype.$toObject = function $toObject(options, json) { + const ret = Document.prototype.$toObject.call(this, options, json); + if (Object.keys(ret).length === 0 && options?._calledWithOptions != null) { + const minimize = options._calledWithOptions?.minimize ?? this?.$__schemaTypeOptions?.minimize ?? options.minimize; + if (minimize && !this.constructor.$__required) { + return void 0; + } + } + return ret; + }; + function registerRemoveListener(sub) { + const owner = sub.ownerDocument(); + function emitRemove() { + owner.$removeListener("save", emitRemove); + owner.$removeListener("deleteOne", emitRemove); + sub.emit("deleteOne", sub); + sub.constructor.emit("deleteOne", sub); + } + owner.$on("save", emitRemove); + owner.$on("deleteOne", emitRemove); + } + } +}); + +// node_modules/mongoose/lib/types/arraySubdocument.js +var require_arraySubdocument = __commonJS({ + "node_modules/mongoose/lib/types/arraySubdocument.js"(exports2, module2) { + "use strict"; + var EventEmitter = require("events").EventEmitter; + var Subdocument = require_subdocument(); + var utils = require_utils6(); + var documentArrayParent = require_symbols().documentArrayParent; + function ArraySubdocument(obj, parentArr, skipId, fields, index) { + if (utils.isMongooseDocumentArray(parentArr)) { + this.__parentArray = parentArr; + this[documentArrayParent] = parentArr.$parent(); + } else { + this.__parentArray = void 0; + this[documentArrayParent] = void 0; + } + this.$setIndex(index); + this.$__parent = this[documentArrayParent]; + let options; + if (typeof skipId === "object" && skipId != null) { + options = { isNew: true, ...skipId }; + skipId = void 0; + } else { + options = { isNew: true }; + } + Subdocument.call(this, obj, fields, this[documentArrayParent], skipId, options); + } + ArraySubdocument.prototype = Object.create(Subdocument.prototype); + ArraySubdocument.prototype.constructor = ArraySubdocument; + Object.defineProperty(ArraySubdocument.prototype, "$isSingleNested", { + configurable: false, + writable: false, + value: false + }); + Object.defineProperty(ArraySubdocument.prototype, "$isDocumentArrayElement", { + configurable: false, + writable: false, + value: true + }); + for (const i4 in EventEmitter.prototype) { + ArraySubdocument[i4] = EventEmitter.prototype[i4]; + } + ArraySubdocument.prototype.$setIndex = function(index) { + this.__index = index; + if (this.$__ != null && this.$__.validationError != null) { + const keys = Object.keys(this.$__.validationError.errors); + for (const key of keys) { + this.invalidate(key, this.$__.validationError.errors[key]); + } + } + }; + ArraySubdocument.prototype.populate = function() { + throw new Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.arr[0].populate("path")`, use `doc.populate("arr.0.path")`'); + }; + ArraySubdocument.prototype.$__removeFromParent = function() { + const _id = this._doc._id; + if (!_id) { + throw new Error("For your own good, Mongoose does not know how to remove an ArraySubdocument that has no _id"); + } + this.__parentArray.pull({ _id }); + }; + ArraySubdocument.prototype.$__fullPath = function(path, skipIndex) { + if (this.__index == null) { + return null; + } + if (!this.$__.fullPath) { + this.ownerDocument(); + } + if (skipIndex) { + return path ? this.$__.fullPath + "." + path : this.$__.fullPath; + } + return path ? this.$__.fullPath + "." + this.__index + "." + path : this.$__.fullPath + "." + this.__index; + }; + ArraySubdocument.prototype.$__pathRelativeToParent = function(path, skipIndex) { + if (this.__index == null || (!this.__parentArray || !this.__parentArray.$path)) { + return null; + } + if (skipIndex) { + return path == null ? this.__parentArray.$path() : this.__parentArray.$path() + "." + path; + } + if (path == null) { + return this.__parentArray.$path() + "." + this.__index; + } + return this.__parentArray.$path() + "." + this.__index + "." + path; + }; + ArraySubdocument.prototype.$parent = function() { + return this[documentArrayParent]; + }; + ArraySubdocument.prototype.parentArray = function() { + return this.__parentArray; + }; + module2.exports = ArraySubdocument; + } +}); + +// node_modules/mongoose/lib/types/array/methods/index.js +var require_methods2 = __commonJS({ + "node_modules/mongoose/lib/types/array/methods/index.js"(exports2, module2) { + "use strict"; + var Document = require_document2(); + var ArraySubdocument = require_arraySubdocument(); + var MongooseError = require_mongooseError(); + var cleanModifiedSubpaths = require_cleanModifiedSubpaths(); + var clone = require_clone(); + var internalToObjectOptions = require_options().internalToObjectOptions; + var mpath = require_mpath(); + var utils = require_utils6(); + var isBsonType = require_isBsonType(); + var arrayAtomicsBackupSymbol = require_symbols().arrayAtomicsBackupSymbol; + var arrayAtomicsSymbol = require_symbols().arrayAtomicsSymbol; + var arrayParentSymbol = require_symbols().arrayParentSymbol; + var arrayPathSymbol = require_symbols().arrayPathSymbol; + var arraySchemaSymbol = require_symbols().arraySchemaSymbol; + var populateModelSymbol = require_symbols().populateModelSymbol; + var slicedSymbol = /* @__PURE__ */ Symbol("mongoose#Array#sliced"); + var _basePush = Array.prototype.push; + var methods = { + /** + * Depopulates stored atomic operation values as necessary for direct insertion to MongoDB. + * + * If no atomics exist, we return all array values after conversion. + * + * @return {Array} + * @method $__getAtomics + * @memberOf MongooseArray + * @instance + * @api private + */ + $__getAtomics() { + const ret = []; + const keys = Object.keys(this[arrayAtomicsSymbol] || {}); + let i4 = keys.length; + const opts = Object.assign({}, internalToObjectOptions, { _isNested: true }); + if (i4 === 0) { + ret[0] = ["$set", this.toObject(opts)]; + return ret; + } + while (i4--) { + const op2 = keys[i4]; + let val = this[arrayAtomicsSymbol][op2]; + if (utils.isMongooseObject(val)) { + val = val.toObject(opts); + } else if (Array.isArray(val)) { + val = this.toObject.call(val, opts); + } else if (val != null && Array.isArray(val.$each)) { + val.$each = this.toObject.call(val.$each, opts); + } else if (val != null && typeof val.valueOf === "function") { + val = val.valueOf(); + } + if (op2 === "$addToSet") { + val = { $each: val }; + } + ret.push([op2, val]); + } + return ret; + }, + /** + * Public API for getting atomics. Alias for $__getAtomics() that can be + * implemented by custom container types. + * + * @return {Array} + * @method getAtomics + * @memberOf MongooseArray + * @instance + * @api public + */ + getAtomics() { + return this.$__getAtomics(); + }, + /** + * Clears all pending atomic operations. Called by Mongoose after save(). + * + * @return {void} + * @method clearAtomics + * @memberOf MongooseArray + * @instance + * @api public + */ + clearAtomics() { + this[arrayAtomicsBackupSymbol] = this[arrayAtomicsSymbol]; + this[arrayAtomicsSymbol] = {}; + }, + /*! + * ignore + */ + $atomics() { + return this[arrayAtomicsSymbol]; + }, + /*! + * ignore + */ + $parent() { + return this[arrayParentSymbol]; + }, + /*! + * ignore + */ + $path() { + return this[arrayPathSymbol]; + }, + /*! + * ignore + */ + $schemaType() { + return this[arraySchemaSymbol]; + }, + /** + * Atomically shifts the array at most one time per document `save()`. + * + * #### Note: + * + * _Calling this multiple times on an array before saving sends the same command as calling it once._ + * _This update is implemented using the MongoDB [$pop](https://www.mongodb.com/docs/manual/reference/operator/update/pop/) method which enforces this restriction._ + * + * doc.array = [1,2,3]; + * + * const shifted = doc.array.$shift(); + * console.log(shifted); // 1 + * console.log(doc.array); // [2,3] + * + * // no affect + * shifted = doc.array.$shift(); + * console.log(doc.array); // [2,3] + * + * doc.save(function (err) { + * if (err) return handleError(err); + * + * // we saved, now $shift works again + * shifted = doc.array.$shift(); + * console.log(shifted ); // 2 + * console.log(doc.array); // [3] + * }) + * + * @api public + * @memberOf MongooseArray + * @instance + * @method $shift + * @see mongodb https://www.mongodb.com/docs/manual/reference/operator/update/pop/ + */ + $shift() { + this._registerAtomic("$pop", -1); + this._markModified(); + const __array = this.__array; + if (__array._shifted) { + return; + } + __array._shifted = true; + return [].shift.call(__array); + }, + /** + * Pops the array atomically at most one time per document `save()`. + * + * #### NOTE: + * + * _Calling this multiple times on an array before saving sends the same command as calling it once._ + * _This update is implemented using the MongoDB [$pop](https://www.mongodb.com/docs/manual/reference/operator/update/pop/) method which enforces this restriction._ + * + * doc.array = [1,2,3]; + * + * const popped = doc.array.$pop(); + * console.log(popped); // 3 + * console.log(doc.array); // [1,2] + * + * // no affect + * popped = doc.array.$pop(); + * console.log(doc.array); // [1,2] + * + * doc.save(function (err) { + * if (err) return handleError(err); + * + * // we saved, now $pop works again + * popped = doc.array.$pop(); + * console.log(popped); // 2 + * console.log(doc.array); // [1] + * }) + * + * @api public + * @method $pop + * @memberOf MongooseArray + * @instance + * @see mongodb https://www.mongodb.com/docs/manual/reference/operator/update/pop/ + * @method $pop + * @memberOf MongooseArray + */ + $pop() { + this._registerAtomic("$pop", 1); + this._markModified(); + if (this._popped) { + return; + } + this._popped = true; + return [].pop.call(this); + }, + /*! + * ignore + */ + $schema() { + return this[arraySchemaSymbol]; + }, + /** + * Casts a member based on this arrays schema. + * + * @param {any} value + * @return value the casted value + * @method _cast + * @api private + * @memberOf MongooseArray + */ + _cast(value) { + let populated = false; + let Model; + const parent = this[arrayParentSymbol]; + if (parent) { + populated = parent.$populated(this[arrayPathSymbol], true); + } + if (populated && value !== null && value !== void 0) { + Model = populated.options[populateModelSymbol]; + if (Model == null) { + throw new MongooseError("No populated model found for path `" + this[arrayPathSymbol] + "`. This is likely a bug in Mongoose, please report an issue on github.com/Automattic/mongoose."); + } + if (Buffer.isBuffer(value) || isBsonType(value, "ObjectId") || !utils.isObject(value)) { + value = { _id: value }; + } + const isDisc = value.schema && value.schema.discriminatorMapping && value.schema.discriminatorMapping.key !== void 0; + if (!isDisc) { + value = new Model(value); + } + return this[arraySchemaSymbol].caster.applySetters(value, parent, true); + } + return this[arraySchemaSymbol].caster.applySetters(value, parent, false); + }, + /** + * Internal helper for .map() + * + * @api private + * @return {Number} + * @method _mapCast + * @memberOf MongooseArray + */ + _mapCast(val, index) { + return this._cast(val, this.length + index); + }, + /** + * Marks this array as modified. + * + * If it bubbles up from an embedded document change, then it takes the following arguments (otherwise, takes 0 arguments) + * + * @param {ArraySubdocument} subdoc the embedded doc that invoked this method on the Array + * @param {String} embeddedPath the path which changed in the subdoc + * @method _markModified + * @api private + * @memberOf MongooseArray + */ + _markModified(elem) { + const parent = this[arrayParentSymbol]; + let dirtyPath; + if (parent) { + dirtyPath = this[arrayPathSymbol]; + if (arguments.length) { + dirtyPath = dirtyPath + "." + elem; + } + if (dirtyPath != null && dirtyPath.endsWith(".$")) { + return this; + } + parent.markModified(dirtyPath, arguments.length !== 0 ? elem : parent); + } + return this; + }, + /** + * Register an atomic operation with the parent. + * + * @param {Array} op operation + * @param {any} val + * @method _registerAtomic + * @api private + * @memberOf MongooseArray + */ + _registerAtomic(op2, val) { + if (this[slicedSymbol]) { + return; + } + if (op2 === "$set") { + this[arrayAtomicsSymbol] = { $set: val }; + cleanModifiedSubpaths(this[arrayParentSymbol], this[arrayPathSymbol]); + this._markModified(); + return this; + } + const atomics = this[arrayAtomicsSymbol]; + if (op2 === "$pop" && !("$pop" in atomics)) { + const _this = this; + this[arrayParentSymbol].once("save", function() { + _this._popped = _this._shifted = null; + }); + } + if (atomics.$set || Object.keys(atomics).length && !(op2 in atomics)) { + this[arrayAtomicsSymbol] = { $set: this }; + return this; + } + let selector; + if (op2 === "$pullAll" || op2 === "$addToSet") { + atomics[op2] || (atomics[op2] = []); + atomics[op2] = atomics[op2].concat(val); + } else if (op2 === "$pullDocs") { + const pullOp = atomics["$pull"] || (atomics["$pull"] = {}); + if (val[0] instanceof ArraySubdocument) { + selector = pullOp["$or"] || (pullOp["$or"] = []); + Array.prototype.push.apply(selector, val.map((v4) => { + return v4.toObject({ + transform: (doc, ret) => { + if (v4 == null || v4.$__ == null) { + return ret; + } + Object.keys(v4.$__.activePaths.getStatePaths("default")).forEach((path) => { + mpath.unset(path, ret); + _minimizePath(ret, path); + }); + return ret; + }, + virtuals: false + }); + })); + } else { + selector = pullOp["_id"] || (pullOp["_id"] = { $in: [] }); + selector["$in"] = selector["$in"].concat(val); + } + } else if (op2 === "$push") { + atomics.$push = atomics.$push || { $each: [] }; + if (val != null && utils.hasUserDefinedProperty(val, "$each")) { + atomics.$push = val; + } else { + if (val.length === 1) { + atomics.$push.$each.push(val[0]); + } else if (val.length < 1e4) { + atomics.$push.$each.push(...val); + } else { + for (const v4 of val) { + atomics.$push.$each.push(v4); + } + } + } + } else { + atomics[op2] = val; + } + return this; + }, + /** + * Adds values to the array if not already present. + * + * #### Example: + * + * console.log(doc.array) // [2,3,4] + * const added = doc.array.addToSet(4,5); + * console.log(doc.array) // [2,3,4,5] + * console.log(added) // [5] + * + * @param {...any} [args] + * @return {Array} the values that were added + * @memberOf MongooseArray + * @api public + * @method addToSet + */ + addToSet() { + _checkManualPopulation(this, arguments); + _depopulateIfNecessary(this, arguments); + const values = [].map.call(arguments, this._mapCast, this); + const added = []; + let type = ""; + if (values[0] instanceof ArraySubdocument) { + type = "doc"; + } else if (values[0] instanceof Date) { + type = "date"; + } else if (isBsonType(values[0], "ObjectId")) { + type = "ObjectId"; + } + const rawValues = utils.isMongooseArray(values) ? values.__array : values; + const rawArray = utils.isMongooseArray(this) ? this.__array : this; + rawValues.forEach(function(v4) { + let found; + const val = +v4; + switch (type) { + case "doc": + found = this.some(function(doc) { + return doc.equals(v4); + }); + break; + case "date": + found = this.some(function(d4) { + return +d4 === val; + }); + break; + case "ObjectId": + found = this.find((o4) => o4.toString() === v4.toString()); + break; + default: + found = ~this.indexOf(v4); + break; + } + if (!found) { + this._markModified(); + rawArray.push(v4); + this._registerAtomic("$addToSet", v4); + [].push.call(added, v4); + } + }, this); + return added; + }, + /** + * Returns the number of pending atomic operations to send to the db for this array. + * + * @api private + * @return {Number} + * @method hasAtomics + * @memberOf MongooseArray + */ + hasAtomics() { + if (!utils.isPOJO(this[arrayAtomicsSymbol])) { + return 0; + } + return Object.keys(this[arrayAtomicsSymbol]).length; + }, + /** + * Return whether or not the `obj` is included in the array. + * + * @param {Object} obj the item to check + * @param {Number} fromIndex + * @return {Boolean} + * @api public + * @method includes + * @memberOf MongooseArray + */ + includes(obj, fromIndex) { + const ret = this.indexOf(obj, fromIndex); + return ret !== -1; + }, + /** + * Return the index of `obj` or `-1` if not found. + * + * @param {Object} obj the item to look for + * @param {Number} fromIndex + * @return {Number} + * @api public + * @method indexOf + * @memberOf MongooseArray + */ + indexOf(obj, fromIndex) { + if (isBsonType(obj, "ObjectId")) { + obj = obj.toString(); + } + fromIndex = fromIndex == null ? 0 : fromIndex; + const len = this.length; + for (let i4 = fromIndex; i4 < len; ++i4) { + if (obj == this[i4]) { + return i4; + } + } + return -1; + }, + /** + * Helper for console.log + * + * @api public + * @method inspect + * @memberOf MongooseArray + */ + inspect() { + return JSON.stringify(this); + }, + /** + * Pushes items to the array non-atomically. + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwritting any changes that happen between when you retrieved the object and when you save it._ + * + * @param {...any} [args] + * @api public + * @method nonAtomicPush + * @memberOf MongooseArray + */ + nonAtomicPush() { + const values = [].map.call(arguments, this._mapCast, this); + this._markModified(); + const ret = [].push.apply(this, values); + this._registerAtomic("$set", this); + return ret; + }, + /** + * Wraps [`Array#pop`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/pop) with proper change tracking. + * + * #### Note: + * + * _marks the entire array as modified which will pass the entire thing to $set potentially overwriting any changes that happen between when you retrieved the object and when you save it._ + * + * @see MongooseArray#$pop https://mongoosejs.com/docs/api/array.html#MongooseArray.prototype.$pop() + * @api public + * @method pop + * @memberOf MongooseArray + */ + pop() { + this._markModified(); + const ret = [].pop.call(this); + this._registerAtomic("$set", this); + return ret; + }, + /** + * Pulls items from the array atomically. Equality is determined by casting + * the provided value to an embedded document and comparing using + * [the `Document.equals()` function.](https://mongoosejs.com/docs/api/document.html#Document.prototype.equals()) + * + * #### Example: + * + * doc.array.pull(ObjectId) + * doc.array.pull({ _id: 'someId' }) + * doc.array.pull(36) + * doc.array.pull('tag 1', 'tag 2') + * + * To remove a document from a subdocument array we may pass an object with a matching `_id`. + * + * doc.subdocs.push({ _id: 4815162342 }) + * doc.subdocs.pull({ _id: 4815162342 }) // removed + * + * Or we may passing the _id directly and let mongoose take care of it. + * + * doc.subdocs.push({ _id: 4815162342 }) + * doc.subdocs.pull(4815162342); // works + * + * The first pull call will result in a atomic operation on the database, if pull is called repeatedly without saving the document, a $set operation is used on the complete array instead, overwriting possible changes that happened on the database in the meantime. + * + * @param {...any} [args] + * @see mongodb https://www.mongodb.com/docs/manual/reference/operator/update/pull/ + * @api public + * @method pull + * @memberOf MongooseArray + */ + pull() { + const values = [].map.call(arguments, (v4, i5) => this._cast(v4, i5, { defaults: false }), this); + let cur = this; + if (utils.isMongooseArray(cur)) { + cur = cur.__array; + } + let i4 = cur.length; + let mem; + this._markModified(); + while (i4--) { + mem = cur[i4]; + if (mem instanceof Document) { + const some = values.some(function(v4) { + return mem.equals(v4); + }); + if (some) { + cur.splice(i4, 1); + } + } else if (~this.indexOf.call(values, mem)) { + cur.splice(i4, 1); + } + } + if (values[0] instanceof ArraySubdocument) { + this._registerAtomic("$pullDocs", values.map(function(v4) { + const _id = v4.$__getValue("_id"); + if (_id === void 0 || v4.$isDefault("_id")) { + return v4; + } + return _id; + })); + } else { + this._registerAtomic("$pullAll", values); + } + if (cleanModifiedSubpaths(this[arrayParentSymbol], this[arrayPathSymbol]) > 0) { + this._registerAtomic("$set", this); + } + return this; + }, + /** + * Wraps [`Array#push`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/push) with proper change tracking. + * + * #### Example: + * + * const schema = Schema({ nums: [Number] }); + * const Model = mongoose.model('Test', schema); + * + * const doc = await Model.create({ nums: [3, 4] }); + * doc.nums.push(5); // Add 5 to the end of the array + * await doc.save(); + * + * // You can also pass an object with `$each` as the + * // first parameter to use MongoDB's `$position` + * doc.nums.push({ + * $each: [1, 2], + * $position: 0 + * }); + * doc.nums; // [1, 2, 3, 4, 5] + * + * @param {...Object} [args] + * @api public + * @method push + * @memberOf MongooseArray + */ + push() { + let values = arguments; + let atomic = values; + const isOverwrite = values[0] != null && utils.hasUserDefinedProperty(values[0], "$each"); + const arr = utils.isMongooseArray(this) ? this.__array : this; + if (isOverwrite) { + atomic = values[0]; + values = values[0].$each; + } + if (this[arraySchemaSymbol] == null) { + return _basePush.apply(this, values); + } + _checkManualPopulation(this, values); + _depopulateIfNecessary(this, values); + values = [].map.call(values, this._mapCast, this); + let ret; + const atomics = this[arrayAtomicsSymbol]; + this._markModified(); + if (isOverwrite) { + atomic.$each = values; + if ((atomics.$push && atomics.$push.$each && atomics.$push.$each.length || 0) !== 0 && atomics.$push.$position != atomic.$position) { + if (atomic.$position != null) { + [].splice.apply(arr, [atomic.$position, 0].concat(values)); + ret = arr.length; + } else { + ret = [].push.apply(arr, values); + } + this._registerAtomic("$set", this); + } else if (atomic.$position != null) { + [].splice.apply(arr, [atomic.$position, 0].concat(values)); + ret = this.length; + } else { + ret = [].push.apply(arr, values); + } + } else { + atomic = values; + ret = _basePush.apply(arr, values); + } + this._registerAtomic("$push", atomic); + return ret; + }, + /** + * Alias of [pull](https://mongoosejs.com/docs/api/array.html#MongooseArray.prototype.pull()) + * + * @see MongooseArray#pull https://mongoosejs.com/docs/api/array.html#MongooseArray.prototype.pull() + * @see mongodb https://www.mongodb.com/docs/manual/reference/operator/update/pull/ + * @api public + * @memberOf MongooseArray + * @instance + * @method remove + */ + remove() { + return this.pull.apply(this, arguments); + }, + /** + * Sets the casted `val` at index `i` and marks the array modified. + * + * #### Example: + * + * // given documents based on the following + * const Doc = mongoose.model('Doc', new Schema({ array: [Number] })); + * + * const doc = new Doc({ array: [2,3,4] }) + * + * console.log(doc.array) // [2,3,4] + * + * doc.array.set(1,"5"); + * console.log(doc.array); // [2,5,4] // properly cast to number + * doc.save() // the change is saved + * + * // VS not using array#set + * doc.array[1] = "5"; + * console.log(doc.array); // [2,"5",4] // no casting + * doc.save() // change is not saved + * + * @return {Array} this + * @api public + * @method set + * @memberOf MongooseArray + */ + set(i4, val, skipModified) { + const arr = this.__array; + if (skipModified) { + arr[i4] = val; + return this; + } + const value = methods._cast.call(this, val, i4); + methods._markModified.call(this, i4); + arr[i4] = value; + return this; + }, + /** + * Wraps [`Array#shift`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/unshift) with proper change tracking. + * + * #### Example: + * + * doc.array = [2,3]; + * const res = doc.array.shift(); + * console.log(res) // 2 + * console.log(doc.array) // [3] + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwritting any changes that happen between when you retrieved the object and when you save it._ + * + * @api public + * @method shift + * @memberOf MongooseArray + */ + shift() { + const arr = utils.isMongooseArray(this) ? this.__array : this; + this._markModified(); + const ret = [].shift.call(arr); + this._registerAtomic("$set", this); + return ret; + }, + /** + * Wraps [`Array#sort`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/sort) with proper change tracking. + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwritting any changes that happen between when you retrieved the object and when you save it._ + * + * @api public + * @method sort + * @memberOf MongooseArray + * @see MasteringJS: Array sort https://masteringjs.io/tutorials/fundamentals/array-sort + */ + sort() { + const arr = utils.isMongooseArray(this) ? this.__array : this; + const ret = [].sort.apply(arr, arguments); + this._registerAtomic("$set", this); + return ret; + }, + /** + * Wraps [`Array#splice`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/splice) with proper change tracking and casting. + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwritting any changes that happen between when you retrieved the object and when you save it._ + * + * @api public + * @method splice + * @memberOf MongooseArray + * @see MasteringJS: Array splice https://masteringjs.io/tutorials/fundamentals/array-splice + */ + splice() { + let ret; + const arr = utils.isMongooseArray(this) ? this.__array : this; + this._markModified(); + _checkManualPopulation(this, Array.prototype.slice.call(arguments, 2)); + if (arguments.length) { + let vals; + if (this[arraySchemaSymbol] == null) { + vals = arguments; + } else { + vals = []; + for (let i4 = 0; i4 < arguments.length; ++i4) { + vals[i4] = i4 < 2 ? arguments[i4] : this._cast(arguments[i4], arguments[0] + (i4 - 2)); + } + } + ret = [].splice.apply(arr, vals); + this._registerAtomic("$set", this); + } + return ret; + }, + /*! + * ignore + */ + toBSON() { + return this.toObject(internalToObjectOptions); + }, + /** + * Returns a native js Array. + * + * @param {Object} options + * @return {Array} + * @api public + * @method toObject + * @memberOf MongooseArray + */ + toObject(options) { + const arr = utils.isMongooseArray(this) ? this.__array : this; + if (options && options.depopulate) { + options = clone(options); + options._isNested = true; + return [].concat(arr).map(function(doc) { + return doc instanceof Document ? doc.toObject(options) : doc; + }); + } + return [].concat(arr); + }, + $toObject() { + return this.constructor.prototype.toObject.apply(this, arguments); + }, + /** + * Wraps [`Array#unshift`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/unshift) with proper change tracking. + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwriting any changes that happen between when you retrieved the object and when you save it._ + * + * @api public + * @method unshift + * @memberOf MongooseArray + */ + unshift() { + _checkManualPopulation(this, arguments); + let values; + if (this[arraySchemaSymbol] == null) { + values = arguments; + } else { + values = [].map.call(arguments, this._cast, this); + } + const arr = utils.isMongooseArray(this) ? this.__array : this; + this._markModified(); + [].unshift.apply(arr, values); + this._registerAtomic("$set", this); + return this.length; + } + }; + function _isAllSubdocs(docs, ref) { + if (!ref) { + return false; + } + for (const arg of docs) { + if (arg == null) { + return false; + } + const model = arg.constructor; + if (!(arg instanceof Document) || model.modelName !== ref && model.baseModelName !== ref) { + return false; + } + } + return true; + } + function _minimizePath(obj, parts, i4) { + if (typeof parts === "string") { + if (parts.indexOf(".") === -1) { + return; + } + parts = mpath.stringToParts(parts); + } + i4 = i4 || 0; + if (i4 >= parts.length) { + return; + } + if (obj == null || typeof obj !== "object") { + return; + } + _minimizePath(obj[parts[0]], parts, i4 + 1); + if (obj[parts[0]] != null && typeof obj[parts[0]] === "object" && Object.keys(obj[parts[0]]).length === 0) { + delete obj[parts[0]]; + } + } + function _checkManualPopulation(arr, docs) { + const ref = arr == null ? null : arr[arraySchemaSymbol] && arr[arraySchemaSymbol].caster && arr[arraySchemaSymbol].caster.options && arr[arraySchemaSymbol].caster.options.ref || null; + if (arr.length === 0 && docs.length !== 0) { + if (_isAllSubdocs(docs, ref)) { + arr[arrayParentSymbol].$populated(arr[arrayPathSymbol], [], { + [populateModelSymbol]: docs[0].constructor + }); + } + } + } + function _depopulateIfNecessary(arr, docs) { + const ref = arr == null ? null : arr[arraySchemaSymbol] && arr[arraySchemaSymbol].caster && arr[arraySchemaSymbol].caster.options && arr[arraySchemaSymbol].caster.options.ref || null; + const parentDoc = arr[arrayParentSymbol]; + const path = arr[arrayPathSymbol]; + if (!ref || !parentDoc.populated(path)) { + return; + } + for (const doc of docs) { + if (doc == null) { + continue; + } + if (typeof doc !== "object" || doc instanceof String || doc instanceof Number || doc instanceof Buffer || utils.isMongooseType(doc)) { + parentDoc.depopulate(path); + break; + } + } + } + var returnVanillaArrayMethods = [ + "filter", + "flat", + "flatMap", + "map", + "slice" + ]; + for (const method of returnVanillaArrayMethods) { + if (Array.prototype[method] == null) { + continue; + } + methods[method] = function() { + const _arr = utils.isMongooseArray(this) ? this.__array : this; + const arr = [].concat(_arr); + return arr[method].apply(arr, arguments); + }; + } + module2.exports = methods; + } +}); + +// node_modules/mongoose/lib/types/array/index.js +var require_array = __commonJS({ + "node_modules/mongoose/lib/types/array/index.js"(exports2, module2) { + "use strict"; + var mongooseArrayMethods = require_methods2(); + var arrayAtomicsSymbol = require_symbols().arrayAtomicsSymbol; + var arrayAtomicsBackupSymbol = require_symbols().arrayAtomicsBackupSymbol; + var arrayParentSymbol = require_symbols().arrayParentSymbol; + var arrayPathSymbol = require_symbols().arrayPathSymbol; + var arraySchemaSymbol = require_symbols().arraySchemaSymbol; + var _basePush = Array.prototype.push; + var numberRE = /^\d+$/; + function MongooseArray(values, path, doc, schematype) { + let __array; + if (Array.isArray(values)) { + const len = values.length; + if (len === 0) { + __array = new Array(); + } else if (len === 1) { + __array = new Array(1); + __array[0] = values[0]; + } else if (len < 1e4) { + __array = new Array(); + _basePush.apply(__array, values); + } else { + __array = new Array(); + for (let i4 = 0; i4 < len; ++i4) { + _basePush.call(__array, values[i4]); + } + } + } else { + __array = []; + } + const internals = { + [arrayAtomicsSymbol]: {}, + [arrayAtomicsBackupSymbol]: void 0, + [arrayPathSymbol]: path, + [arraySchemaSymbol]: schematype, + [arrayParentSymbol]: void 0, + isMongooseArray: true, + isMongooseArrayProxy: true, + __array + }; + if (values && values[arrayAtomicsSymbol] != null) { + internals[arrayAtomicsSymbol] = values[arrayAtomicsSymbol]; + } + if (doc != null && doc.$__) { + internals[arrayParentSymbol] = doc; + internals[arraySchemaSymbol] = schematype || doc.schema.path(path); + } + const proxy = new Proxy(__array, { + get: function(target, prop) { + if (Object.hasOwn(internals, prop)) { + return internals[prop]; + } + if (Object.hasOwn(mongooseArrayMethods, prop)) { + return mongooseArrayMethods[prop]; + } + if (schematype && schematype.virtuals && Object.hasOwn(schematype.virtuals, prop)) { + return schematype.virtuals[prop].applyGetters(void 0, target); + } + if (typeof prop === "string" && numberRE.test(prop) && schematype?.$embeddedSchemaType != null) { + return schematype.$embeddedSchemaType.applyGetters(__array[prop], doc); + } + return __array[prop]; + }, + set: function(target, prop, value) { + if (typeof prop === "string" && numberRE.test(prop)) { + mongooseArrayMethods.set.call(proxy, prop, value, false); + } else if (Object.hasOwn(internals, prop)) { + internals[prop] = value; + } else if (schematype?.virtuals && Object.hasOwn(schematype.virtuals, prop)) { + schematype.virtuals[prop].applySetters(value, target); + } else { + __array[prop] = value; + } + return true; + } + }); + return proxy; + } + module2.exports = exports2 = MongooseArray; + } +}); + +// node_modules/mongoose/lib/types/documentArray/methods/index.js +var require_methods3 = __commonJS({ + "node_modules/mongoose/lib/types/documentArray/methods/index.js"(exports2, module2) { + "use strict"; + var ArrayMethods = require_methods2(); + var Document = require_document2(); + var getDiscriminatorByValue = require_getDiscriminatorByValue(); + var internalToObjectOptions = require_options().internalToObjectOptions; + var utils = require_utils6(); + var isBsonType = require_isBsonType(); + var arrayParentSymbol = require_symbols().arrayParentSymbol; + var arrayPathSymbol = require_symbols().arrayPathSymbol; + var arraySchemaSymbol = require_symbols().arraySchemaSymbol; + var documentArrayParent = require_symbols().documentArrayParent; + var _baseToString = Array.prototype.toString; + var methods = { + /*! + * ignore + */ + toBSON() { + return this.toObject(internalToObjectOptions); + }, + toString() { + return _baseToString.call(this.__array.map((subdoc) => { + if (subdoc != null && subdoc.$__ != null) { + return subdoc.toString(); + } + return subdoc; + })); + }, + /*! + * ignore + */ + getArrayParent() { + return this[arrayParentSymbol]; + }, + /*! + * ignore + */ + $schemaType() { + return this[arraySchemaSymbol]; + }, + /** + * Overrides MongooseArray#cast + * + * @method _cast + * @api private + * @memberOf MongooseDocumentArray + */ + _cast(value, index, options) { + if (this[arraySchemaSymbol] == null) { + return value; + } + let Constructor = this[arraySchemaSymbol].casterConstructor; + const isInstance = Constructor.$isMongooseDocumentArray ? utils.isMongooseDocumentArray(value) : value instanceof Constructor; + if (isInstance || // Hack re: #5001, see #5005 + value && value.constructor && value.constructor.baseCasterConstructor === Constructor) { + if (!(value[documentArrayParent] && value.__parentArray)) { + value[documentArrayParent] = this[arrayParentSymbol]; + value.__parentArray = this; + } + value.$setIndex(index); + return value; + } + if (value === void 0 || value === null) { + return null; + } + if (Buffer.isBuffer(value) || isBsonType(value, "ObjectId") || !utils.isObject(value)) { + value = { _id: value }; + } + if (value && Constructor.discriminators && Constructor.schema && Constructor.schema.options && Constructor.schema.options.discriminatorKey) { + if (typeof value[Constructor.schema.options.discriminatorKey] === "string" && Constructor.discriminators[value[Constructor.schema.options.discriminatorKey]]) { + Constructor = Constructor.discriminators[value[Constructor.schema.options.discriminatorKey]]; + } else { + const constructorByValue = getDiscriminatorByValue(Constructor.discriminators, value[Constructor.schema.options.discriminatorKey]); + if (constructorByValue) { + Constructor = constructorByValue; + } + } + } + if (Constructor.$isMongooseDocumentArray) { + return Constructor.cast(value, this, void 0, void 0, index); + } + const ret = new Constructor(value, this, options, void 0, index); + ret.isNew = true; + return ret; + }, + /** + * Searches array items for the first document with a matching _id. + * + * #### Example: + * + * const embeddedDoc = m.array.id(some_id); + * + * @return {EmbeddedDocument|null} the subdocument or null if not found. + * @param {ObjectId|String|Number|Buffer} id + * @method id + * @api public + * @memberOf MongooseDocumentArray + */ + id(id) { + if (id == null) { + return null; + } + const schemaType = this[arraySchemaSymbol]; + let idSchemaType = null; + if (schemaType && schemaType.schema) { + idSchemaType = schemaType.schema.path("_id"); + } else if (schemaType && schemaType.casterConstructor && schemaType.casterConstructor.schema) { + idSchemaType = schemaType.casterConstructor.schema.path("_id"); + } + let castedId = null; + if (idSchemaType) { + try { + castedId = idSchemaType.cast(id); + } catch (_err) { + } + } + let _id; + for (const val of this) { + if (!val) { + continue; + } + _id = val.get("_id"); + if (_id == null) { + continue; + } else if (_id instanceof Document) { + _id = _id.get("_id"); + if (castedId != null && utils.deepEqual(castedId, _id)) { + return val; + } else if (castedId == null && (id == _id || utils.deepEqual(id, _id))) { + return val; + } + } else if (castedId != null && utils.deepEqual(castedId, _id)) { + return val; + } else if (castedId == null && (_id == id || utils.deepEqual(id, _id))) { + return val; + } + } + return null; + }, + /** + * Returns a native js Array of plain js objects + * + * #### Note: + * + * _Each sub-document is converted to a plain object by calling its `#toObject` method._ + * + * @param {Object} [options] optional options to pass to each documents `toObject` method call during conversion + * @return {Array} + * @method toObject + * @api public + * @memberOf MongooseDocumentArray + */ + toObject(options) { + return [].concat(this.map(function(doc) { + if (doc == null) { + return null; + } + if (typeof doc.toObject !== "function") { + return doc; + } + return doc.toObject(options); + })); + }, + $toObject() { + return this.constructor.prototype.toObject.apply(this, arguments); + }, + /** + * Wraps [`Array#push`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/push) with proper change tracking. + * + * @param {...Object} [args] + * @api public + * @method push + * @memberOf MongooseDocumentArray + */ + push() { + const ret = ArrayMethods.push.apply(this, arguments); + _updateParentPopulated(this); + return ret; + }, + /** + * Pulls items from the array atomically. + * + * @param {...Object} [args] + * @api public + * @method pull + * @memberOf MongooseDocumentArray + */ + pull() { + const ret = ArrayMethods.pull.apply(this, arguments); + _updateParentPopulated(this); + return ret; + }, + /** + * Wraps [`Array#shift`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/unshift) with proper change tracking. + * @api private + */ + shift() { + const ret = ArrayMethods.shift.apply(this, arguments); + _updateParentPopulated(this); + return ret; + }, + /** + * Wraps [`Array#splice`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/splice) with proper change tracking and casting. + * @api private + */ + splice() { + const ret = ArrayMethods.splice.apply(this, arguments); + _updateParentPopulated(this); + return ret; + }, + /** + * Helper for console.log + * + * @method inspect + * @api public + * @memberOf MongooseDocumentArray + */ + inspect() { + return this.toObject(); + }, + /** + * Creates a subdocument casted to this schema. + * + * This is the same subdocument constructor used for casting. + * + * @param {Object} obj the value to cast to this arrays SubDocument schema + * @method create + * @api public + * @memberOf MongooseDocumentArray + */ + create(obj) { + let Constructor = this[arraySchemaSymbol].casterConstructor; + if (obj && Constructor.discriminators && Constructor.schema && Constructor.schema.options && Constructor.schema.options.discriminatorKey) { + if (typeof obj[Constructor.schema.options.discriminatorKey] === "string" && Constructor.discriminators[obj[Constructor.schema.options.discriminatorKey]]) { + Constructor = Constructor.discriminators[obj[Constructor.schema.options.discriminatorKey]]; + } else { + const constructorByValue = getDiscriminatorByValue(Constructor.discriminators, obj[Constructor.schema.options.discriminatorKey]); + if (constructorByValue) { + Constructor = constructorByValue; + } + } + } + return new Constructor(obj, this); + }, + /*! + * ignore + */ + notify(event) { + const _this = this; + return function notify(val, _arr) { + _arr = _arr || _this; + let i4 = _arr.length; + while (i4--) { + if (_arr[i4] == null) { + continue; + } + switch (event) { + // only swap for save event for now, we may change this to all event types later + case "save": + val = _this[i4]; + break; + default: + break; + } + if (utils.isMongooseArray(_arr[i4])) { + notify(val, _arr[i4]); + } else if (_arr[i4]) { + _arr[i4].emit(event, val); + } + } + }; + }, + set(i4, val, skipModified) { + const arr = this.__array; + if (skipModified) { + arr[i4] = val; + return this; + } + const value = methods._cast.call(this, val, i4); + methods._markModified.call(this, i4); + arr[i4] = value; + return this; + }, + _markModified(elem, embeddedPath) { + const parent = this[arrayParentSymbol]; + let dirtyPath; + if (parent) { + dirtyPath = this[arrayPathSymbol]; + if (arguments.length) { + if (embeddedPath != null) { + const index = elem.__index; + dirtyPath = dirtyPath + "." + index + "." + embeddedPath; + } else { + dirtyPath = dirtyPath + "." + elem; + } + } + if (dirtyPath != null && dirtyPath.endsWith(".$")) { + return this; + } + parent.markModified(dirtyPath, arguments.length !== 0 ? elem : parent); + } + return this; + } + }; + module2.exports = methods; + function _updateParentPopulated(arr) { + const parent = arr[arrayParentSymbol]; + if (!parent || parent.$__.populated == null) return; + const populatedPaths = Object.keys(parent.$__.populated).filter((p4) => p4.startsWith(arr[arrayPathSymbol] + ".")); + for (const path of populatedPaths) { + const remnant = path.slice((arr[arrayPathSymbol] + ".").length); + if (!Array.isArray(parent.$__.populated[path].value)) { + continue; + } + parent.$__.populated[path].value = arr.map((val) => val.$populated(remnant)); + } + } + } +}); + +// node_modules/mongoose/lib/types/documentArray/index.js +var require_documentArray = __commonJS({ + "node_modules/mongoose/lib/types/documentArray/index.js"(exports2, module2) { + "use strict"; + var ArrayMethods = require_methods2(); + var DocumentArrayMethods = require_methods3(); + var arrayAtomicsSymbol = require_symbols().arrayAtomicsSymbol; + var arrayAtomicsBackupSymbol = require_symbols().arrayAtomicsBackupSymbol; + var arrayParentSymbol = require_symbols().arrayParentSymbol; + var arrayPathSymbol = require_symbols().arrayPathSymbol; + var arraySchemaSymbol = require_symbols().arraySchemaSymbol; + var _basePush = Array.prototype.push; + var numberRE = /^\d+$/; + function MongooseDocumentArray(values, path, doc, schematype) { + const __array = []; + const internals = { + [arrayAtomicsSymbol]: {}, + [arrayAtomicsBackupSymbol]: void 0, + [arrayPathSymbol]: path, + [arraySchemaSymbol]: void 0, + [arrayParentSymbol]: void 0 + }; + if (Array.isArray(values)) { + if (values[arrayPathSymbol] === path && values[arrayParentSymbol] === doc) { + internals[arrayAtomicsSymbol] = Object.assign({}, values[arrayAtomicsSymbol]); + } + values.forEach((v4) => { + _basePush.call(__array, v4); + }); + } + internals[arrayPathSymbol] = path; + internals.__array = __array; + if (doc && doc.$__) { + internals[arrayParentSymbol] = doc; + internals[arraySchemaSymbol] = doc.$__schema.path(path); + while (internals[arraySchemaSymbol] != null && internals[arraySchemaSymbol].$isMongooseArray && !internals[arraySchemaSymbol].$isMongooseDocumentArray) { + internals[arraySchemaSymbol] = internals[arraySchemaSymbol].casterConstructor; + } + } + const proxy = new Proxy(__array, { + get: function(target, prop) { + if (prop === "isMongooseArray" || prop === "isMongooseArrayProxy" || prop === "isMongooseDocumentArray" || prop === "isMongooseDocumentArrayProxy") { + return true; + } + if (Object.hasOwn(internals, prop)) { + return internals[prop]; + } + if (Object.hasOwn(DocumentArrayMethods, prop)) { + return DocumentArrayMethods[prop]; + } + if (schematype && schematype.virtuals && Object.hasOwn(schematype.virtuals, prop)) { + return schematype.virtuals[prop].applyGetters(void 0, target); + } + if (Object.hasOwn(ArrayMethods, prop)) { + return ArrayMethods[prop]; + } + return __array[prop]; + }, + set: function(target, prop, value) { + if (typeof prop === "string" && numberRE.test(prop)) { + DocumentArrayMethods.set.call(proxy, prop, value, false); + } else if (Object.hasOwn(internals, prop)) { + internals[prop] = value; + } else if (schematype?.virtuals && Object.hasOwn(schematype.virtuals, prop)) { + schematype.virtuals[prop].applySetters(value, target); + } else { + __array[prop] = value; + } + return true; + } + }); + return proxy; + } + module2.exports = MongooseDocumentArray; + } +}); + +// node_modules/mongoose/lib/document.js +var require_document2 = __commonJS({ + "node_modules/mongoose/lib/document.js"(exports2, module2) { + "use strict"; + var DivergentArrayError = require_divergentArray(); + var EventEmitter = require("events").EventEmitter; + var InternalCache = require_internal2(); + var MongooseBuffer = require_buffer(); + var MongooseError = require_error2(); + var MixedSchema = require_mixed(); + var ModifiedPathsSnapshot = require_modifiedPathsSnapshot(); + var ObjectExpectedError = require_objectExpected(); + var ObjectParameterError = require_objectParameter(); + var ParallelValidateError = require_parallelValidate(); + var Schema2 = require_schema2(); + var StrictModeError = require_strict(); + var ValidationError = require_validation(); + var ValidatorError = require_validator(); + var $__hasIncludedChildren = require_hasIncludedChildren(); + var applyDefaults = require_applyDefaults(); + var cleanModifiedSubpaths = require_cleanModifiedSubpaths(); + var clone = require_clone(); + var compile = require_compile().compile; + var defineKey = require_compile().defineKey; + var firstKey = require_firstKey(); + var flatten = require_common4().flatten; + var getEmbeddedDiscriminatorPath = require_getEmbeddedDiscriminatorPath(); + var getKeysInSchemaOrder = require_getKeysInSchemaOrder(); + var getSubdocumentStrictValue = require_getSubdocumentStrictValue(); + var handleSpreadDoc = require_handleSpreadDoc(); + var immediate = require_immediate(); + var isBsonType = require_isBsonType(); + var isDefiningProjection = require_isDefiningProjection(); + var isExclusive = require_isExclusive(); + var isPathExcluded = require_isPathExcluded(); + var inspect = require("util").inspect; + var internalToObjectOptions = require_options().internalToObjectOptions; + var markArraySubdocsPopulated = require_markArraySubdocsPopulated(); + var minimize = require_minimize(); + var mpath = require_mpath(); + var parentPaths = require_parentPaths(); + var queryhelpers = require_queryHelpers(); + var utils = require_utils6(); + var isPromise = require_isPromise(); + var deepEqual = utils.deepEqual; + var isMongooseObject = utils.isMongooseObject; + var arrayAtomicsBackupSymbol = require_symbols().arrayAtomicsBackupSymbol; + var arrayAtomicsSymbol = require_symbols().arrayAtomicsSymbol; + var documentArrayParent = require_symbols().documentArrayParent; + var documentIsModified = require_symbols().documentIsModified; + var documentModifiedPaths = require_symbols().documentModifiedPaths; + var documentSchemaSymbol = require_symbols().documentSchemaSymbol; + var getSymbol = require_symbols().getSymbol; + var modelSymbol = require_symbols().modelSymbol; + var populateModelSymbol = require_symbols().populateModelSymbol; + var scopeSymbol = require_symbols().scopeSymbol; + var schemaMixedSymbol = require_symbols2().schemaMixedSymbol; + var getDeepestSubdocumentForPath = require_getDeepestSubdocumentForPath(); + var sessionNewDocuments = require_symbols().sessionNewDocuments; + var DocumentArray; + var MongooseArray; + var Embedded; + var specialProperties = utils.specialProperties; + var VERSION_WHERE = 1; + var VERSION_INC = 2; + var VERSION_ALL = VERSION_WHERE | VERSION_INC; + function Document(obj, fields, skipId, options) { + if (typeof skipId === "object" && skipId != null) { + options = skipId; + skipId = options.skipId; + } + options = Object.assign({}, options); + if (this.$__schema == null) { + const _schema = utils.isObject(fields) && !fields.instanceOfSchema ? new Schema2(fields) : fields; + this.$__setSchema(_schema); + fields = skipId; + skipId = options; + options = arguments[4] || {}; + } + this.$__ = new InternalCache(); + if (options.isNew != null && options.isNew !== true) { + this.$isNew = options.isNew; + } + if (options.priorDoc != null) { + this.$__.priorDoc = options.priorDoc; + } + if (skipId) { + this.$__.skipId = skipId; + } + if (obj != null && typeof obj !== "object") { + throw new ObjectParameterError(obj, "obj", "Document"); + } + let defaults = true; + if (options.defaults !== void 0) { + this.$__.defaults = options.defaults; + defaults = options.defaults; + } + const schema = this.$__schema; + if (typeof fields === "boolean" || fields === "throw") { + if (fields !== true) { + this.$__.strictMode = fields; + } + fields = void 0; + } else if (schema.options.strict !== true) { + this.$__.strictMode = schema.options.strict; + } + const requiredPaths = schema.requiredPaths(true); + for (const path of requiredPaths) { + this.$__.activePaths.require(path); + } + let exclude = null; + if (utils.isPOJO(fields) && Object.keys(fields).length > 0) { + exclude = isExclusive(fields); + this.$__.selected = fields; + this.$__.exclude = exclude; + } + const hasIncludedChildren = exclude === false && fields ? $__hasIncludedChildren(fields) : null; + if (this._doc == null) { + this.$__buildDoc(obj, fields, skipId, exclude, hasIncludedChildren, false); + if (defaults) { + applyDefaults(this, fields, exclude, hasIncludedChildren, true, null, { + skipParentChangeTracking: true + }); + } + } + if (obj) { + if (this.$__original_set) { + this.$__original_set(obj, void 0, true, options); + } else { + this.$set(obj, void 0, true, options); + } + if (obj instanceof Document) { + this.$isNew = obj.$isNew; + } + } + if (options.willInit && defaults) { + if (options.skipDefaults) { + this.$__.skipDefaults = options.skipDefaults; + } + } else if (defaults) { + applyDefaults(this, fields, exclude, hasIncludedChildren, false, options.skipDefaults); + } + if (!this.$__.strictMode && obj) { + const _this = this; + const keys = Object.keys(this._doc); + keys.forEach(function(key) { + if (!(key in schema.tree) && !(key in schema.methods) && !(key in schema.virtuals) && !key.startsWith("$")) { + defineKey({ prop: key, subprops: null, prototype: _this }); + } + }); + } + applyQueue(this); + } + Document.prototype.$isMongooseDocumentPrototype = true; + Object.defineProperty(Document.prototype, "isNew", { + get: function() { + return this.$isNew; + }, + set: function(value) { + this.$isNew = value; + } + }); + Object.defineProperty(Document.prototype, "errors", { + get: function() { + return this.$errors; + }, + set: function(value) { + this.$errors = value; + } + }); + Document.prototype.$isNew = true; + utils.each( + [ + "on", + "once", + "emit", + "listeners", + "removeListener", + "setMaxListeners", + "removeAllListeners", + "addListener" + ], + function(emitterFn) { + Document.prototype[emitterFn] = function() { + if (!this.$__.emitter) { + if (emitterFn === "emit") { + return; + } + this.$__.emitter = new EventEmitter(); + this.$__.emitter.setMaxListeners(0); + } + return this.$__.emitter[emitterFn].apply(this.$__.emitter, arguments); + }; + Document.prototype[`$${emitterFn}`] = Document.prototype[emitterFn]; + } + ); + Document.prototype.constructor = Document; + for (const i4 in EventEmitter.prototype) { + Document[i4] = EventEmitter.prototype[i4]; + } + Document.prototype.$__schema; + Document.prototype.schema; + Object.defineProperty(Document.prototype, "$locals", { + configurable: false, + enumerable: false, + get: function() { + if (this.$__.locals == null) { + this.$__.locals = {}; + } + return this.$__.locals; + }, + set: function(v4) { + this.$__.locals = v4; + } + }); + Document.prototype.isNew; + Object.defineProperty(Document.prototype, "$where", { + configurable: false, + enumerable: false, + writable: true + }); + Document.prototype.id; + Document.prototype.$errors; + Object.defineProperty(Document.prototype, "$op", { + get: function() { + return this.$__.op || null; + }, + set: function(value) { + this.$__.op = value; + } + }); + function $applyDefaultsToNested(val, path, doc) { + if (val == null) { + return; + } + const paths = Object.keys(doc.$__schema.paths); + const plen = paths.length; + const pathPieces = path.indexOf(".") === -1 ? [path] : path.split("."); + for (let i4 = 0; i4 < plen; ++i4) { + let curPath = ""; + const p4 = paths[i4]; + if (!p4.startsWith(path + ".")) { + continue; + } + const type = doc.$__schema.paths[p4]; + const pieces = type.splitPath().slice(pathPieces.length); + const len = pieces.length; + if (type.defaultValue === void 0) { + continue; + } + let cur = val; + for (let j4 = 0; j4 < len; ++j4) { + if (cur == null) { + break; + } + const piece = pieces[j4]; + if (j4 === len - 1) { + if (cur[piece] !== void 0) { + break; + } + try { + const def = type.getDefault(doc, false); + if (def !== void 0) { + cur[piece] = def; + } + } catch (err) { + doc.invalidate(path + "." + curPath, err); + break; + } + break; + } + curPath += (!curPath.length ? "" : ".") + piece; + cur[piece] = cur[piece] || {}; + cur = cur[piece]; + } + } + } + Document.prototype.$__buildDoc = function(obj, fields, skipId, exclude, hasIncludedChildren) { + const doc = {}; + const paths = Object.keys(this.$__schema.paths).filter((p4) => !p4.includes("$*")); + const plen = paths.length; + let ii = 0; + for (; ii < plen; ++ii) { + const p4 = paths[ii]; + if (p4 === "_id") { + if (skipId) { + continue; + } + if (obj && "_id" in obj) { + continue; + } + } + const path = this.$__schema.paths[p4].splitPath(); + const len = path.length; + const last = len - 1; + let curPath = ""; + let doc_ = doc; + let included = false; + for (let i4 = 0; i4 < len; ++i4) { + const piece = path[i4]; + if (!curPath.length) { + curPath = piece; + } else { + curPath += "." + piece; + } + if (exclude === true) { + if (curPath in fields) { + break; + } + } else if (exclude === false && fields && !included) { + if (curPath in fields) { + included = true; + } else if (!hasIncludedChildren[curPath]) { + break; + } + } + if (i4 < last) { + doc_ = doc_[piece] || (doc_[piece] = {}); + } + } + } + this._doc = doc; + }; + Document.prototype.toBSON = function() { + return this.toObject(internalToObjectOptions); + }; + Document.prototype.init = function(doc, opts, fn2) { + if (typeof opts === "function") { + fn2 = opts; + opts = null; + } + if (doc == null) { + throw new ObjectParameterError(doc, "doc", "init"); + } + this.$__init(doc, opts); + if (fn2) { + fn2(null, this); + } + return this; + }; + Document.prototype.$init = function() { + return this.constructor.prototype.init.apply(this, arguments); + }; + Document.prototype.$__init = function(doc, opts) { + this.$isNew = false; + opts = opts || {}; + if (doc._id != null && opts.populated && opts.populated.length) { + const id = String(doc._id); + for (const item of opts.populated) { + if (item.isVirtual) { + this.$populated(item.path, utils.getValue(item.path, doc), item); + } else { + this.$populated(item.path, item._docs[id], item); + } + if (item._childDocs == null) { + continue; + } + for (const child of item._childDocs) { + if (child == null || child.$__ == null) { + continue; + } + child.$__.parent = this; + } + item._childDocs = []; + } + } + init(this, doc, this._doc, opts); + markArraySubdocsPopulated(this, opts.populated); + this.$emit("init", this); + this.constructor.emit("init", this); + const hasIncludedChildren = this.$__.exclude === false && this.$__.selected ? $__hasIncludedChildren(this.$__.selected) : null; + applyDefaults(this, this.$__.selected, this.$__.exclude, hasIncludedChildren, false, this.$__.skipDefaults); + return this; + }; + function init(self2, obj, doc, opts, prefix) { + prefix = prefix || ""; + if (obj.$__ != null) { + obj = obj._doc; + } + const keys = Object.keys(obj); + const len = keys.length; + let schemaType; + let path; + let i4; + const strict = self2.$__.strictMode; + const docSchema = self2.$__schema; + for (let index = 0; index < len; ++index) { + i4 = keys[index]; + if (specialProperties.has(i4)) { + continue; + } + path = prefix ? prefix + i4 : i4; + schemaType = docSchema.path(path); + if (docSchema.$isRootDiscriminator && !self2.$__isSelected(path)) { + continue; + } + const value = obj[i4]; + if (!schemaType && utils.isPOJO(value)) { + if (!doc[i4]) { + doc[i4] = {}; + if (!strict && !(i4 in docSchema.tree) && !(i4 in docSchema.methods) && !(i4 in docSchema.virtuals)) { + self2[i4] = doc[i4]; + } else if (opts?.virtuals && i4 in docSchema.virtuals) { + self2[i4] = doc[i4]; + } + } + init(self2, value, doc[i4], opts, path + "."); + } else if (!schemaType) { + doc[i4] = value; + if (!strict && !prefix) { + self2[i4] = value; + } else if (opts?.virtuals && i4 in docSchema.virtuals) { + self2[i4] = value; + } + } else { + if (Object.hasOwn(doc, i4) && value !== void 0 && !opts.hydratedPopulatedDocs) { + delete doc[i4]; + } + if (value === null) { + doc[i4] = schemaType._castNullish(null); + } else if (value !== void 0) { + const wasPopulated = value.$__ == null ? null : value.$__.wasPopulated; + if (schemaType && !wasPopulated && !opts.hydratedPopulatedDocs) { + try { + if (opts && opts.setters) { + const overrideInit = false; + doc[i4] = schemaType.applySetters(value, self2, overrideInit, null, opts); + } else { + doc[i4] = schemaType.cast(value, self2, true, void 0, opts); + } + } catch (e4) { + self2.invalidate(e4.path, new ValidatorError({ + path: e4.path, + message: e4.message, + type: "cast", + value: e4.value, + reason: e4 + })); + } + } else if (schemaType && opts.hydratedPopulatedDocs) { + doc[i4] = schemaType.cast(value, self2, true, void 0, { hydratedPopulatedDocs: true }); + if (doc[i4] && doc[i4].$__ && doc[i4].$__.wasPopulated) { + self2.$populated(path, doc[i4].$__.wasPopulated.value, doc[i4].$__.wasPopulated.options); + } else if (Array.isArray(doc[i4]) && doc[i4].length && doc[i4][0]?.$__?.wasPopulated) { + self2.$populated(path, doc[i4].map((populatedDoc) => populatedDoc?.$__?.wasPopulated?.value).filter((val) => val != null), doc[i4][0].$__.wasPopulated.options); + } + } else { + doc[i4] = value; + } + } + if (!self2.$isModified(path)) { + self2.$__.activePaths.init(path); + } + } + } + } + Document.prototype.updateOne = function updateOne(update, options, callback) { + const query = this.constructor.updateOne(); + const self2 = this; + query.pre(function queryPreUpdateOne(cb) { + self2.constructor._middleware.execPre("updateOne", self2, [self2, update, options], (err, res) => { + this.updateOne({ _id: self2._doc._id }, update, options); + if (self2.$session() != null) { + if (!("session" in query.options)) { + query.options.session = self2.$session(); + } + } + return cb(err, res); + }); + }); + query.post(function queryPostUpdateOne(cb) { + self2.constructor._middleware.execPost("updateOne", self2, [self2], {}, cb); + }); + if (callback != null) { + return query.exec(callback); + } + return query; + }; + Document.prototype.replaceOne = function replaceOne() { + const args2 = [...arguments]; + args2.unshift({ _id: this._doc._id }); + return this.constructor.replaceOne.apply(this.constructor, args2); + }; + Document.prototype.$session = function $session(session) { + if (arguments.length === 0) { + if (this.$__.session != null && this.$__.session.hasEnded) { + this.$__.session = null; + return null; + } + return this.$__.session; + } + if (session != null && session.hasEnded) { + throw new MongooseError("Cannot set a document's session to a session that has ended. Make sure you haven't called `endSession()` on the session you are passing to `$session()`."); + } + if (session == null && this.$__.session == null) { + return; + } + this.$__.session = session; + if (!this.$isSubdocument) { + const subdocs = this.$getAllSubdocs(); + for (const child of subdocs) { + child.$session(session); + } + } + return session; + }; + Document.prototype.$timestamps = function $timestamps(value) { + if (arguments.length === 0) { + if (this.$__.timestamps != null) { + return this.$__.timestamps; + } + if (this.$__schema) { + return this.$__schema.options.timestamps; + } + return void 0; + } + const currentValue = this.$timestamps(); + if (value !== currentValue) { + this.$__.timestamps = value; + } + return this; + }; + Document.prototype.overwrite = function overwrite(obj) { + const keys = Array.from(new Set(Object.keys(this._doc).concat(Object.keys(obj)))); + for (const key of keys) { + if (key === "_id") { + continue; + } + if (this.$__schema.options.versionKey && key === this.$__schema.options.versionKey) { + continue; + } + if (this.$__schema.options.discriminatorKey && key === this.$__schema.options.discriminatorKey) { + continue; + } + this.$set(key, obj[key]); + } + return this; + }; + Document.prototype.$set = function $set(path, val, type, options) { + if (utils.isPOJO(type)) { + options = type; + type = void 0; + } + const merge = options && options.merge; + const adhoc = type && type !== true; + const constructing = type === true; + let adhocs; + let keys; + let i4 = 0; + let pathtype; + let key; + let prefix; + const userSpecifiedStrict = options && "strict" in options; + let strict = userSpecifiedStrict ? options.strict : this.$__.strictMode; + if (adhoc) { + adhocs = this.$__.adhocPaths || (this.$__.adhocPaths = {}); + adhocs[path] = this.$__schema.interpretAsType(path, type, this.$__schema.options); + } + if (path == null) { + [path, val] = [val, path]; + } else if (typeof path !== "string") { + if (path instanceof Document) { + if (path.$__isNested) { + path = path.toObject(); + } else { + path = path.$__schema === this.$__schema ? applyVirtuals(path, { ...path._doc }) : path._doc; + } + } + if (path == null) { + [path, val] = [val, path]; + } + prefix = val ? val + "." : ""; + keys = getKeysInSchemaOrder(this.$__schema, path); + const len = keys.length; + const _skipMinimizeTopLevel = options && options._skipMinimizeTopLevel || false; + if (len === 0 && _skipMinimizeTopLevel) { + delete options._skipMinimizeTopLevel; + if (val) { + this.$set(val, {}); + } + return this; + } + options = Object.assign({}, options, { _skipMinimizeTopLevel: false }); + for (let i5 = 0; i5 < len; ++i5) { + key = keys[i5]; + const pathName = prefix ? prefix + key : key; + pathtype = this.$__schema.pathType(pathName); + const valForKey = path[key]; + if (type === true && !prefix && valForKey != null && pathtype === "nested" && this._doc[key] != null) { + delete this._doc[key]; + } + if (utils.isNonBuiltinObject(valForKey) && pathtype === "nested") { + this.$set(pathName, valForKey, constructing, options); + $applyDefaultsToNested(this.$get(pathName), pathName, this); + continue; + } else if (strict) { + if (constructing && valForKey === void 0 && this.$get(pathName) !== void 0) { + continue; + } + if (pathtype === "adhocOrUndefined") { + pathtype = getEmbeddedDiscriminatorPath(this, pathName, { typeOnly: true }); + } + if (pathtype === "real" || pathtype === "virtual") { + this.$set(pathName, valForKey, constructing, options); + } else if (pathtype === "nested" && valForKey instanceof Document) { + this.$set( + pathName, + valForKey.toObject({ transform: false }), + constructing, + options + ); + } else if (strict === "throw") { + if (pathtype === "nested") { + throw new ObjectExpectedError(key, valForKey); + } else { + throw new StrictModeError(key); + } + } else if (pathtype === "nested" && valForKey == null) { + this.$set(pathName, valForKey, constructing, options); + } + } else { + this.$set(pathName, valForKey, constructing, options); + } + } + const orderedDoc = {}; + const orderedKeys = Object.keys(this.$__schema.tree); + for (let i5 = 0, len2 = orderedKeys.length; i5 < len2; ++i5) { + (key = orderedKeys[i5]) && Object.hasOwn(this._doc, key) && (orderedDoc[key] = void 0); + } + this._doc = Object.assign(orderedDoc, this._doc); + return this; + } + let pathType = this.$__schema.pathType(path); + let parts = null; + if (pathType === "adhocOrUndefined") { + parts = path.indexOf(".") === -1 ? [path] : path.split("."); + pathType = getEmbeddedDiscriminatorPath(this, parts, { typeOnly: true }); + } + if (pathType === "adhocOrUndefined" && !userSpecifiedStrict) { + if (parts == null) { + parts = path.indexOf(".") === -1 ? [path] : path.split("."); + } + const subdocStrict = getSubdocumentStrictValue(this.$__schema, parts); + if (subdocStrict !== void 0) { + strict = subdocStrict; + } + } + val = handleSpreadDoc(val, true); + const priorVal = (() => { + if (this.$__.priorDoc != null) { + return this.$__.priorDoc.$__getValue(path); + } + if (constructing) { + return void 0; + } + return this.$__getValue(path); + })(); + if (pathType === "nested" && val) { + if (typeof val === "object" && val != null) { + if (val.$__ != null) { + val = val.toObject(internalToObjectOptions); + } + if (val == null) { + this.invalidate(path, new MongooseError.CastError("Object", val, path)); + return this; + } + const wasModified = this.$isModified(path); + const hasInitialVal = this.$__.savedState != null && Object.hasOwn(this.$__.savedState, path); + if (this.$__.savedState != null && !this.$isNew && !Object.hasOwn(this.$__.savedState, path)) { + const initialVal = this.$__getValue(path); + this.$__.savedState[path] = initialVal; + const keys3 = Object.keys(initialVal || {}); + for (const key2 of keys3) { + this.$__.savedState[path + "." + key2] = initialVal[key2]; + } + } + if (!merge) { + this.$__setValue(path, null); + cleanModifiedSubpaths(this, path); + } else { + return this.$set(val, path, constructing, options); + } + const keys2 = getKeysInSchemaOrder(this.$__schema, val, path); + this.$__setValue(path, {}); + for (const key2 of keys2) { + this.$set(path + "." + key2, val[key2], constructing, { ...options, _skipMarkModified: true }); + } + if (priorVal != null && (!wasModified || hasInitialVal) && utils.deepEqual(hasInitialVal ? this.$__.savedState[path] : priorVal, val)) { + this.unmarkModified(path); + } else { + this.markModified(path); + } + return this; + } + this.invalidate(path, new MongooseError.CastError("Object", val, path)); + return this; + } + let schema; + if (parts == null) { + parts = path.indexOf(".") === -1 ? [path] : path.split("."); + } + if (typeof this.$__schema.aliases[parts[0]] === "string") { + parts[0] = this.$__schema.aliases[parts[0]]; + } + if (pathType === "adhocOrUndefined" && strict) { + let mixed; + for (i4 = 0; i4 < parts.length; ++i4) { + const subpath = parts.slice(0, i4 + 1).join("."); + if (i4 + 1 < parts.length && this.$__schema.pathType(subpath) === "virtual") { + mpath.set(path, val, this); + return this; + } + schema = this.$__schema.path(subpath); + if (schema == null) { + continue; + } + if (schema instanceof MixedSchema) { + mixed = true; + break; + } else if (schema.$isSchemaMap && schema.$__schemaType instanceof MixedSchema && i4 < parts.length - 1) { + mixed = true; + schema = schema.$__schemaType; + break; + } + } + if (schema == null) { + schema = getEmbeddedDiscriminatorPath(this, path); + } + if (!mixed && !schema) { + if (strict === "throw") { + throw new StrictModeError(path); + } + return this; + } + } else if (pathType === "virtual") { + schema = this.$__schema.virtualpath(path); + schema.applySetters(val, this); + return this; + } else { + schema = this.$__path(path); + } + let cur = this._doc; + let curPath = ""; + for (i4 = 0; i4 < parts.length - 1; ++i4) { + cur = cur instanceof Map ? cur.get(parts[i4]) : cur[parts[i4]]; + curPath += (curPath.length !== 0 ? "." : "") + parts[i4]; + if (!cur) { + this.$set(curPath, {}); + if (!this.$__isSelected(curPath)) { + this.unmarkModified(curPath); + } + cur = this.$__getValue(curPath); + } + } + let pathToMark; + if (parts.length <= 1) { + pathToMark = path; + } else { + const len = parts.length; + for (i4 = 0; i4 < len; ++i4) { + const subpath = parts.slice(0, i4 + 1).join("."); + if (this.$get(subpath, null, { getters: false }) === null) { + pathToMark = subpath; + break; + } + } + if (!pathToMark) { + pathToMark = path; + } + } + if (!schema) { + this.$__set(pathToMark, path, options, constructing, parts, schema, val, priorVal); + if (pathType === "nested" && val == null) { + cleanModifiedSubpaths(this, path); + } + return this; + } + if (schema.$isSingleNested || schema.$isMongooseArray) { + _markValidSubpaths(this, path); + } + if (val != null && merge && schema.$isSingleNested) { + if (val instanceof Document) { + val = val.toObject({ virtuals: false, transform: false }); + } + const keys2 = Object.keys(val); + for (const key2 of keys2) { + this.$set(path + "." + key2, val[key2], constructing, options); + } + return this; + } + let shouldSet = true; + try { + const refMatches = (() => { + if (schema.options == null) { + return false; + } + if (!(val instanceof Document)) { + return false; + } + const model = val.constructor; + const refOpt = typeof schema.options.ref === "function" && !schema.options.ref[modelSymbol] ? schema.options.ref.call(this, this) : schema.options.ref; + const ref = refOpt?.modelName || refOpt; + if (ref != null && (ref === model.modelName || ref === model.baseModelName)) { + return true; + } + const refPath = schema.options.refPath; + if (refPath == null) { + return false; + } + const modelName = val.get(refPath); + return modelName === model.modelName || modelName === model.baseModelName; + })(); + let didPopulate = false; + if (refMatches && val instanceof Document && (!val.$__.wasPopulated || utils.deepEqual(val.$__.wasPopulated.value, val._doc._id))) { + const unpopulatedValue = schema && schema.$isSingleNested ? schema.cast(val, this) : val._doc._id; + this.$populated(path, unpopulatedValue, { [populateModelSymbol]: val.constructor }); + val.$__.wasPopulated = { value: unpopulatedValue }; + didPopulate = true; + } + let popOpts; + const typeKey = this.$__schema.options.typeKey; + if (schema.options && Array.isArray(schema.options[typeKey]) && schema.options[typeKey].length && schema.options[typeKey][0] && schema.options[typeKey][0].ref && _isManuallyPopulatedArray(val, schema.options[typeKey][0].ref)) { + popOpts = { [populateModelSymbol]: val[0].constructor }; + this.$populated(path, val.map(function(v4) { + return v4._doc._id; + }), popOpts); + for (const doc of val) { + doc.$__.wasPopulated = { value: doc._doc._id }; + } + didPopulate = true; + } + if (!refMatches || !schema.$isSingleNested || !val.$__) { + let setterContext = this; + if (this.$__schema.singleNestedPaths[path] != null && parts.length > 1) { + setterContext = getDeepestSubdocumentForPath(this, parts, this.schema); + } + if (options != null && options.overwriteImmutable) { + val = schema.applySetters(val, setterContext, false, priorVal, { path, overwriteImmutable: true }); + } else { + val = schema.applySetters(val, setterContext, false, priorVal, { path }); + } + } + if (Array.isArray(val) && !Array.isArray(schema) && schema.$isMongooseDocumentArray && val.length !== 0 && val[0] != null && val[0].$__ != null && val[0].$__.populated != null) { + const populatedPaths = Object.keys(val[0].$__.populated); + for (const populatedPath of populatedPaths) { + this.$populated( + path + "." + populatedPath, + val.map((v4) => v4.$populated(populatedPath)), + val[0].$__.populated[populatedPath].options + ); + } + didPopulate = true; + } + if (!didPopulate && this.$__.populated) { + if (Array.isArray(val) && this.$__.populated[path]) { + for (let i5 = 0; i5 < val.length; ++i5) { + if (val[i5] instanceof Document) { + val.set(i5, val[i5]._doc._id, true); + } + } + } + delete this.$__.populated[path]; + } + if (val != null && schema.$isSingleNested) { + _checkImmutableSubpaths(val, schema, priorVal); + } + this.$markValid(path); + } catch (e4) { + if (e4 instanceof MongooseError.StrictModeError && e4.isImmutableError) { + this.invalidate(path, e4); + } else if (e4 instanceof MongooseError.CastError) { + this.invalidate(e4.path, e4); + if (e4.$originalErrorPath) { + this.invalidate( + path, + new MongooseError.CastError(schema.instance, val, path, e4.$originalErrorPath) + ); + } + } else { + this.invalidate( + path, + new MongooseError.CastError(schema.instance, val, path, e4) + ); + } + shouldSet = false; + } + if (shouldSet) { + let savedState = null; + let savedStatePath = null; + if (!constructing) { + const doc = this.$isSubdocument ? this.ownerDocument() : this; + savedState = doc.$__.savedState; + savedStatePath = this.$isSubdocument ? this.$__.fullPath + "." + path : path; + doc.$__saveInitialState(savedStatePath); + } + this.$__set(pathToMark, path, options, constructing, parts, schema, val, priorVal); + const isInTransaction = !!this.$__.session?.transaction; + const isModifiedWithinTransaction = this.$__.session && this.$__.session[sessionNewDocuments] && this.$__.session[sessionNewDocuments].has(this) && this.$__.session[sessionNewDocuments].get(this).modifiedPaths && !this.$__.session[sessionNewDocuments].get(this).modifiedPaths.has(savedStatePath); + if (savedState != null && Object.hasOwn(savedState, savedStatePath) && (!isInTransaction || isModifiedWithinTransaction) && utils.deepEqual(val, savedState[savedStatePath])) { + this.unmarkModified(path); + } + } + if (schema.$isSingleNested && (this.isDirectModified(path) || val == null)) { + cleanModifiedSubpaths(this, path); + } else if (schema.$isSchemaMap && val == null) { + cleanModifiedSubpaths(this, path); + } + return this; + }; + function _isManuallyPopulatedArray(val, ref) { + if (!Array.isArray(val)) { + return false; + } + if (val.length === 0) { + return false; + } + for (const el of val) { + if (!(el instanceof Document)) { + return false; + } + const modelName = el.constructor.modelName; + if (modelName == null) { + return false; + } + if (el.constructor.modelName != ref && el.constructor.baseModelName != ref) { + return false; + } + } + return true; + } + Document.prototype.set = Document.prototype.$set; + Document.prototype.$__shouldModify = function(pathToMark, path, options, constructing, parts, schema, val, priorVal) { + if (options && options._skipMarkModified) { + return false; + } + if (this.$isNew) { + return true; + } + if (path in this.$__.activePaths.getStatePaths("modify")) { + return true; + } + if (val === void 0 && !this.$__isSelected(path)) { + return true; + } + if (val === void 0 && path in this.$__.activePaths.getStatePaths("default")) { + return false; + } + if (this.$populated(path) && val instanceof Document && deepEqual(val._doc._id, priorVal)) { + return false; + } + if (!deepEqual(val, priorVal !== void 0 ? priorVal : utils.getValue(path, this))) { + return true; + } + if (!constructing && val !== null && val !== void 0 && path in this.$__.activePaths.getStatePaths("default") && deepEqual(val, schema.getDefault(this, constructing))) { + return true; + } + return false; + }; + Document.prototype.$__set = function(pathToMark, path, options, constructing, parts, schema, val, priorVal) { + Embedded = Embedded || require_arraySubdocument(); + const shouldModify = this.$__shouldModify( + pathToMark, + path, + options, + constructing, + parts, + schema, + val, + priorVal + ); + if (shouldModify) { + if (this.$__.primitiveAtomics && this.$__.primitiveAtomics[path]) { + delete this.$__.primitiveAtomics[path]; + if (Object.keys(this.$__.primitiveAtomics).length === 0) { + delete this.$__.primitiveAtomics; + } + } + this.markModified(pathToMark); + MongooseArray || (MongooseArray = require_array()); + if (val && utils.isMongooseArray(val)) { + val._registerAtomic("$set", val); + if (utils.isMongooseDocumentArray(val)) { + val.forEach(function(item) { + item && item.__parentArray && (item.__parentArray = val); + }); + } + } + } else if (Array.isArray(val) && Array.isArray(priorVal) && utils.isMongooseArray(val) && utils.isMongooseArray(priorVal)) { + val[arrayAtomicsSymbol] = priorVal[arrayAtomicsSymbol]; + val[arrayAtomicsBackupSymbol] = priorVal[arrayAtomicsBackupSymbol]; + if (utils.isMongooseDocumentArray(val)) { + val.forEach((doc) => { + if (doc != null) { + doc.$isNew = false; + } + }); + } + } + let obj = this._doc; + let i4 = 0; + const l4 = parts.length; + let cur = ""; + for (; i4 < l4; i4++) { + const next = i4 + 1; + const last = next === l4; + cur += cur ? "." + parts[i4] : parts[i4]; + if (specialProperties.has(parts[i4])) { + continue; + } + if (last) { + if (obj instanceof Map) { + obj.set(parts[i4], val); + } else if (obj.$isSingleNested) { + if (!(parts[i4] in obj)) { + obj[parts[i4]] = val; + obj._doc[parts[i4]] = val; + } else { + obj._doc[parts[i4]] = val; + } + if (shouldModify) { + obj.markModified(parts[i4]); + } + } else { + obj[parts[i4]] = val; + } + } else { + const isMap = obj instanceof Map; + let value = isMap ? obj.get(parts[i4]) : obj[parts[i4]]; + if (utils.isPOJO(value)) { + obj = value; + } else if (value && value instanceof Embedded) { + obj = value; + } else if (value && !Array.isArray(value) && value.$isSingleNested) { + obj = value; + } else if (value && Array.isArray(value)) { + obj = value; + } else if (value == null) { + value = {}; + if (isMap) { + obj.set(parts[i4], value); + } else { + obj[parts[i4]] = value; + } + obj = value; + } else { + obj = value; + } + } + } + }; + Document.prototype.$__getValue = function(path) { + if (typeof path !== "string" && !Array.isArray(path)) { + throw new TypeError( + `Invalid \`path\`. Must be either string or array. Got "${path}" (type ${typeof path})` + ); + } + return utils.getValue(path, this._doc); + }; + Document.prototype.$inc = function $inc(path, val) { + if (val == null) { + val = 1; + } + if (Array.isArray(path)) { + path.forEach((p4) => this.$inc(p4, val)); + return this; + } + const schemaType = this.$__path(path); + if (schemaType == null) { + if (this.$__.strictMode === "throw") { + throw new StrictModeError(path); + } else if (this.$__.strictMode === true) { + return this; + } + } else if (schemaType.instance !== "Number") { + this.invalidate(path, new MongooseError.CastError(schemaType.instance, val, path)); + return this; + } + const currentValue = this.$__getValue(path) || 0; + let shouldSet = false; + let valToSet = null; + let valToInc = val; + try { + val = schemaType.cast(val); + valToSet = schemaType.applySetters(currentValue + val, this); + valToInc = valToSet - currentValue; + shouldSet = true; + } catch (err) { + this.invalidate(path, new MongooseError.CastError("number", val, path, err)); + } + if (shouldSet) { + this.$__.primitiveAtomics = this.$__.primitiveAtomics || {}; + if (this.$__.primitiveAtomics[path] == null) { + this.$__.primitiveAtomics[path] = { $inc: valToInc }; + } else { + this.$__.primitiveAtomics[path].$inc += valToInc; + } + this.markModified(path); + this.$__setValue(path, valToSet); + } + return this; + }; + Document.prototype.$__setValue = function(path, val) { + utils.setValue(path, val, this._doc); + return this; + }; + Document.prototype.get = function(path, type, options) { + let adhoc; + if (options == null) { + options = {}; + } + if (type) { + adhoc = this.$__schema.interpretAsType(path, type, this.$__schema.options); + } + const noDottedPath = options.noDottedPath; + let schema = noDottedPath ? this.$__schema.paths[path] : this.$__path(path); + if (schema == null) { + schema = this.$__schema.virtualpath(path); + if (schema != null) { + return schema.applyGetters(void 0, this); + } + } + if (noDottedPath) { + let obj2 = this._doc[path]; + if (adhoc) { + obj2 = adhoc.cast(obj2); + } + if (schema != null && options.getters !== false) { + return schema.applyGetters(obj2, this); + } + return obj2; + } + if (schema != null && schema.instance === "Mixed") { + const virtual = this.$__schema.virtualpath(path); + if (virtual != null) { + schema = virtual; + } + } + const hasDot = path.indexOf(".") !== -1; + let obj = this._doc; + const pieces = hasDot ? path.split(".") : [path]; + if (typeof this.$__schema.aliases[pieces[0]] === "string") { + pieces[0] = this.$__schema.aliases[pieces[0]]; + } + for (let i4 = 0, l4 = pieces.length; i4 < l4; i4++) { + if (obj && obj._doc) { + obj = obj._doc; + } + if (obj == null) { + obj = void 0; + } else if (obj instanceof Map) { + obj = obj.get(pieces[i4], { getters: false }); + } else if (i4 === l4 - 1) { + obj = utils.getValue(pieces[i4], obj); + } else { + obj = obj[pieces[i4]]; + } + } + if (adhoc) { + obj = adhoc.cast(obj); + } + if (schema != null && options.getters !== false) { + obj = schema.applyGetters(obj, this); + } else if (this.$__schema.nested[path] && options.virtuals) { + return applyVirtuals(this, clone(obj) || {}, { path }); + } + return obj; + }; + Document.prototype[getSymbol] = Document.prototype.get; + Document.prototype.$get = Document.prototype.get; + Document.prototype.$__path = function(path) { + const adhocs = this.$__.adhocPaths; + const adhocType = adhocs && Object.hasOwn(adhocs, path) ? adhocs[path] : null; + if (adhocType) { + return adhocType; + } + return this.$__schema.path(path); + }; + Document.prototype.markModified = function(path, scope) { + this.$__saveInitialState(path); + this.$__.activePaths.modify(path); + if (scope != null && !this.$isSubdocument) { + this.$__.pathsToScopes = this.$__pathsToScopes || {}; + this.$__.pathsToScopes[path] = scope; + } + }; + Document.prototype.$__saveInitialState = function $__saveInitialState(path) { + const savedState = this.$__.savedState; + const savedStatePath = path; + if (savedState != null) { + const firstDot = savedStatePath.indexOf("."); + const topLevelPath = firstDot === -1 ? savedStatePath : savedStatePath.slice(0, firstDot); + if (!Object.hasOwn(savedState, topLevelPath)) { + savedState[topLevelPath] = clone(this.$__getValue(topLevelPath)); + } + } + }; + Document.prototype.unmarkModified = function(path) { + this.$__.activePaths.init(path); + if (this.$__.pathsToScopes != null) { + delete this.$__.pathsToScopes[path]; + } + }; + Document.prototype.$ignore = function(path) { + this.$__.activePaths.ignore(path); + }; + Document.prototype.directModifiedPaths = function() { + return Object.keys(this.$__.activePaths.getStatePaths("modify")); + }; + Document.prototype.$isEmpty = function(path) { + const isEmptyOptions = { + minimize: true, + virtuals: false, + getters: false, + transform: false + }; + if (arguments.length !== 0) { + const v4 = this.$get(path); + if (v4 == null) { + return true; + } + if (typeof v4 !== "object") { + return false; + } + if (utils.isPOJO(v4)) { + return _isEmpty(v4); + } + return Object.keys(v4.toObject(isEmptyOptions)).length === 0; + } + return Object.keys(this.toObject(isEmptyOptions)).length === 0; + }; + function _isEmpty(v4) { + if (v4 == null) { + return true; + } + if (typeof v4 !== "object" || Array.isArray(v4)) { + return false; + } + for (const key of Object.keys(v4)) { + if (!_isEmpty(v4[key])) { + return false; + } + } + return true; + } + Document.prototype.modifiedPaths = function(options) { + options = options || {}; + const directModifiedPaths = Object.keys(this.$__.activePaths.getStatePaths("modify")); + const result = /* @__PURE__ */ new Set(); + let i4 = 0; + let j4 = 0; + const len = directModifiedPaths.length; + for (i4 = 0; i4 < len; ++i4) { + const path = directModifiedPaths[i4]; + const parts = parentPaths(path); + const pLen = parts.length; + for (j4 = 0; j4 < pLen; ++j4) { + result.add(parts[j4]); + } + if (!options.includeChildren) { + continue; + } + let ii = 0; + let cur = this.$get(path); + if (typeof cur === "object" && cur !== null) { + if (cur._doc) { + cur = cur._doc; + } + const len2 = cur.length; + if (Array.isArray(cur)) { + for (ii = 0; ii < len2; ++ii) { + const subPath = path + "." + ii; + if (!result.has(subPath)) { + result.add(subPath); + if (cur[ii] != null && cur[ii].$__) { + const modified = cur[ii].modifiedPaths(); + let iii = 0; + const iiiLen = modified.length; + for (iii = 0; iii < iiiLen; ++iii) { + result.add(subPath + "." + modified[iii]); + } + } + } + } + } else { + const keys = Object.keys(cur); + let ii2 = 0; + const len3 = keys.length; + for (ii2 = 0; ii2 < len3; ++ii2) { + result.add(path + "." + keys[ii2]); + } + } + } + } + return Array.from(result); + }; + Document.prototype[documentModifiedPaths] = Document.prototype.modifiedPaths; + Document.prototype.isModified = function(paths, options, modifiedPaths) { + if (paths) { + const ignoreAtomics = options && options.ignoreAtomics; + const directModifiedPathsObj = this.$__.activePaths.states.modify; + if (directModifiedPathsObj == null) { + return false; + } + if (typeof paths === "string") { + paths = paths.indexOf(" ") === -1 ? [paths] : paths.split(" "); + } + for (const path of paths) { + if (directModifiedPathsObj[path] != null) { + return true; + } + } + const modified = modifiedPaths || this[documentModifiedPaths](); + const isModifiedChild = paths.some(function(path) { + return !!~modified.indexOf(path); + }); + let directModifiedPaths = Object.keys(directModifiedPathsObj); + if (ignoreAtomics) { + directModifiedPaths = directModifiedPaths.filter((path) => { + const value = this.$__getValue(path); + if (value != null && value[arrayAtomicsSymbol] != null && value[arrayAtomicsSymbol].$set === void 0) { + return false; + } + return true; + }); + } + return isModifiedChild || paths.some(function(path) { + return directModifiedPaths.some(function(mod) { + return mod === path || path.startsWith(mod + "."); + }); + }); + } + return this.$__.activePaths.some("modify"); + }; + Document.prototype.$isModified = Document.prototype.isModified; + Document.prototype[documentIsModified] = Document.prototype.isModified; + Document.prototype.$isDefault = function(path) { + if (path == null) { + return this.$__.activePaths.some("default"); + } + if (typeof path === "string" && path.indexOf(" ") === -1) { + return Object.hasOwn(this.$__.activePaths.getStatePaths("default"), path); + } + let paths = path; + if (!Array.isArray(paths)) { + paths = paths.split(" "); + } + return paths.some((path2) => Object.hasOwn(this.$__.activePaths.getStatePaths("default"), path2)); + }; + Document.prototype.$isDeleted = function(val) { + if (arguments.length === 0) { + return !!this.$__.isDeleted; + } + this.$__.isDeleted = !!val; + return this; + }; + Document.prototype.isDirectModified = function(path) { + if (path == null) { + return this.$__.activePaths.some("modify"); + } + if (typeof path === "string" && path.indexOf(" ") === -1) { + const res = Object.hasOwn(this.$__.activePaths.getStatePaths("modify"), path); + if (res || path.indexOf(".") === -1) { + return res; + } + const pieces = path.split("."); + for (let i4 = 0; i4 < pieces.length - 1; ++i4) { + const subpath = pieces.slice(0, i4 + 1).join("."); + const subdoc = this.$get(subpath); + if (subdoc != null && subdoc.$__ != null && subdoc.isDirectModified(pieces.slice(i4 + 1).join("."))) { + return true; + } + } + return false; + } + let paths = path; + if (typeof paths === "string") { + paths = paths.split(" "); + } + return paths.some((path2) => this.isDirectModified(path2)); + }; + Document.prototype.isInit = function(path) { + if (path == null) { + return this.$__.activePaths.some("init"); + } + if (typeof path === "string" && path.indexOf(" ") === -1) { + return Object.hasOwn(this.$__.activePaths.getStatePaths("init"), path); + } + let paths = path; + if (!Array.isArray(paths)) { + paths = paths.split(" "); + } + return paths.some((path2) => Object.hasOwn(this.$__.activePaths.getStatePaths("init"), path2)); + }; + Document.prototype.isSelected = function isSelected(path) { + if (this.$__.selected == null) { + return true; + } + if (!path) { + return false; + } + if (path === "_id") { + return this.$__.selected._id !== 0; + } + if (path.indexOf(" ") !== -1) { + path = path.split(" "); + } + if (Array.isArray(path)) { + return path.some((p4) => this.$__isSelected(p4)); + } + const paths = Object.keys(this.$__.selected); + let inclusive = null; + if (paths.length === 1 && paths[0] === "_id") { + return this.$__.selected._id === 0; + } + for (const cur of paths) { + if (cur === "_id") { + continue; + } + if (!isDefiningProjection(this.$__.selected[cur])) { + continue; + } + inclusive = !!this.$__.selected[cur]; + break; + } + if (inclusive === null) { + return true; + } + if (path in this.$__.selected) { + return inclusive; + } + const pathDot = path + "."; + for (const cur of paths) { + if (cur === "_id") { + continue; + } + if (cur.startsWith(pathDot)) { + return inclusive || cur !== pathDot; + } + if (pathDot.startsWith(cur + ".")) { + return inclusive; + } + } + return !inclusive; + }; + Document.prototype.$__isSelected = Document.prototype.isSelected; + Document.prototype.isDirectSelected = function isDirectSelected(path) { + if (this.$__.selected == null) { + return true; + } + if (path === "_id") { + return this.$__.selected._id !== 0; + } + if (path.indexOf(" ") !== -1) { + path = path.split(" "); + } + if (Array.isArray(path)) { + return path.some((p4) => this.isDirectSelected(p4)); + } + const paths = Object.keys(this.$__.selected); + let inclusive = null; + if (paths.length === 1 && paths[0] === "_id") { + return this.$__.selected._id === 0; + } + for (const cur of paths) { + if (cur === "_id") { + continue; + } + if (!isDefiningProjection(this.$__.selected[cur])) { + continue; + } + inclusive = !!this.$__.selected[cur]; + break; + } + if (inclusive === null) { + return true; + } + if (Object.hasOwn(this.$__.selected, path)) { + return inclusive; + } + return !inclusive; + }; + Document.prototype.validate = async function validate(pathsToValidate, options) { + if (typeof pathsToValidate === "function" || typeof options === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Document.prototype.validate() no longer accepts a callback"); + } + this.$op = "validate"; + if (arguments.length === 1) { + if (typeof arguments[0] === "object" && !Array.isArray(arguments[0])) { + options = arguments[0]; + pathsToValidate = null; + } + } + if (options && typeof options.pathsToSkip === "string") { + const isOnePathOnly = options.pathsToSkip.indexOf(" ") === -1; + options.pathsToSkip = isOnePathOnly ? [options.pathsToSkip] : options.pathsToSkip.split(" "); + } + const _skipParallelValidateCheck = options && options._skipParallelValidateCheck; + if (this.$isSubdocument != null) { + } else if (this.$__.validating && !_skipParallelValidateCheck) { + throw new ParallelValidateError(this); + } else if (!_skipParallelValidateCheck) { + this.$__.validating = true; + } + return new Promise((resolve, reject) => { + this.$__validate(pathsToValidate, options, (error2) => { + this.$op = null; + this.$__.validating = null; + if (error2 != null) { + return reject(error2); + } + resolve(); + }); + }); + }; + Document.prototype.$validate = Document.prototype.validate; + function _evaluateRequiredFunctions(doc) { + const requiredFields = Object.keys(doc.$__.activePaths.getStatePaths("require")); + let i4 = 0; + const len = requiredFields.length; + for (i4 = 0; i4 < len; ++i4) { + const path = requiredFields[i4]; + const p4 = doc.$__schema.path(path); + if (p4 != null && typeof p4.originalRequiredValue === "function") { + doc.$__.cachedRequired = doc.$__.cachedRequired || {}; + try { + doc.$__.cachedRequired[path] = p4.originalRequiredValue.call(doc, doc); + } catch (err) { + doc.invalidate(path, err); + } + } + } + } + function _getPathsToValidate(doc, pathsToValidate, pathsToSkip, isNestedValidate) { + const doValidateOptions = {}; + _evaluateRequiredFunctions(doc); + let paths = new Set(Object.keys(doc.$__.activePaths.getStatePaths("require")).filter(function(path) { + if (!doc.$__isSelected(path) && !doc.$isModified(path)) { + return false; + } + if (path.endsWith(".$*")) { + return false; + } + if (doc.$__.cachedRequired != null && path in doc.$__.cachedRequired) { + return doc.$__.cachedRequired[path]; + } + return true; + })); + Object.keys(doc.$__.activePaths.getStatePaths("init")).forEach(addToPaths); + Object.keys(doc.$__.activePaths.getStatePaths("modify")).forEach(addToPaths); + Object.keys(doc.$__.activePaths.getStatePaths("default")).forEach(addToPaths); + function addToPaths(p4) { + if (p4.endsWith(".$*")) { + return; + } + paths.add(p4); + } + if (!isNestedValidate) { + const topLevelSubdocs = []; + for (const path of Object.keys(doc.$__schema.paths)) { + const schemaType = doc.$__schema.path(path); + if (schemaType.$isSingleNested) { + const subdoc = doc.$get(path); + if (subdoc) { + topLevelSubdocs.push(subdoc); + } + } else if (schemaType.$isMongooseDocumentArray) { + const arr = doc.$get(path); + if (arr && arr.length) { + for (const subdoc of arr) { + if (subdoc) { + topLevelSubdocs.push(subdoc); + } + } + } + } + } + const modifiedPaths = doc.modifiedPaths(); + for (const subdoc of topLevelSubdocs) { + if (subdoc.$basePath) { + const fullPathToSubdoc = subdoc.$__pathRelativeToParent(); + for (const modifiedPath of subdoc.modifiedPaths()) { + paths.delete(fullPathToSubdoc + "." + modifiedPath); + } + const subdocParent = subdoc.$parent(); + if (subdocParent == null) { + throw new Error("Cannot validate subdocument that does not have a parent"); + } + if (doc.$isModified(fullPathToSubdoc, null, modifiedPaths) && // Avoid using isDirectModified() here because that does additional checks on whether the parent path + // is direct modified, which can cause performance issues re: gh-14897 + !Object.hasOwn(subdocParent.$__.activePaths.getStatePaths("modify"), fullPathToSubdoc) && !subdocParent.$isDefault(fullPathToSubdoc)) { + paths.add(fullPathToSubdoc); + if (doc.$__.pathsToScopes == null) { + doc.$__.pathsToScopes = {}; + } + doc.$__.pathsToScopes[fullPathToSubdoc] = subdoc.$isDocumentArrayElement ? subdoc.__parentArray : subdoc.$parent(); + doValidateOptions[fullPathToSubdoc] = { skipSchemaValidators: true }; + if (subdoc.$isDocumentArrayElement && subdoc.__index != null) { + doValidateOptions[fullPathToSubdoc].index = subdoc.__index; + } + } + } + } + } + for (const path of paths) { + const _pathType = doc.$__schema.path(path); + if (!_pathType) { + continue; + } + if (_pathType.$isMongooseDocumentArray) { + for (const p4 of paths) { + if (p4 == null || p4.startsWith(_pathType.path + ".")) { + paths.delete(p4); + } + } + } + if (!_pathType.caster && _pathType.validators.length === 0 && !_pathType.$parentSchemaDocArray) { + paths.delete(path); + } else if (_pathType.$isMongooseArray && !_pathType.$isMongooseDocumentArray && // Skip document arrays... + !_pathType.$embeddedSchemaType.$isMongooseArray && // and arrays of arrays + _pathType.validators.length === 0 && // and arrays with top-level validators + _pathType.$embeddedSchemaType.validators.length === 0) { + paths.delete(path); + } + } + if (Array.isArray(pathsToValidate)) { + paths = _handlePathsToValidate(paths, pathsToValidate); + } else if (Array.isArray(pathsToSkip)) { + paths = _handlePathsToSkip(paths, pathsToSkip); + } + _addArrayPathsToValidate(doc, paths); + const flattenOptions = { skipArrays: true }; + for (const pathToCheck of paths) { + if (doc.$__schema.nested[pathToCheck]) { + let _v = doc.$__getValue(pathToCheck); + if (isMongooseObject(_v)) { + _v = _v.toObject({ transform: false }); + } + const flat = flatten(_v, pathToCheck, flattenOptions, doc.$__schema); + const singleNestedPaths = doc.$__schema.singleNestedPaths; + for (const path of Object.keys(flat)) { + if (!Object.hasOwn(singleNestedPaths, path)) { + addToPaths(path); + } + } + } + } + for (const path of paths) { + const _pathType = doc.$__schema.path(path); + if (!_pathType) { + continue; + } + if (_pathType.$parentSchemaDocArray && typeof _pathType.$parentSchemaDocArray.path === "string") { + paths.add(_pathType.$parentSchemaDocArray.path); + } + if (!_pathType.$isSchemaMap) { + continue; + } + const val = doc.$__getValue(path); + if (val == null) { + continue; + } + for (const key of val.keys()) { + paths.add(path + "." + key); + } + } + paths = Array.from(paths); + return [paths, doValidateOptions]; + } + function _addArrayPathsToValidate(doc, paths) { + for (const path of paths) { + const _pathType = doc.$__schema.path(path); + if (!_pathType) { + continue; + } + if (!_pathType.$isMongooseArray || // To avoid potential performance issues, skip doc arrays whose children + // are not required. `getPositionalPathType()` may be slow, so avoid + // it unless we have a case of #6364 + !Array.isArray(_pathType) && _pathType.$isMongooseDocumentArray && !(_pathType && _pathType.schemaOptions && _pathType.schemaOptions.required)) { + continue; + } + if (_pathType.$isMongooseArray && !_pathType.$isMongooseDocumentArray && // Skip document arrays... + !_pathType.$embeddedSchemaType.$isMongooseArray && // and arrays of arrays + _pathType.$embeddedSchemaType.validators.length === 0) { + continue; + } + const val = doc.$__getValue(path); + _pushNestedArrayPaths(val, paths, path); + } + } + function _pushNestedArrayPaths(val, paths, path) { + if (val != null) { + const numElements = val.length; + for (let j4 = 0; j4 < numElements; ++j4) { + if (Array.isArray(val[j4])) { + _pushNestedArrayPaths(val[j4], paths, path + "." + j4); + } else { + paths.add(path + "." + j4); + } + } + } + } + Document.prototype.$__validate = function(pathsToValidate, options, callback) { + if (this.$__.saveOptions && this.$__.saveOptions.pathsToSave && !pathsToValidate) { + pathsToValidate = [...this.$__.saveOptions.pathsToSave]; + } else if (typeof pathsToValidate === "function") { + callback = pathsToValidate; + options = null; + pathsToValidate = null; + } else if (typeof options === "function") { + callback = options; + options = null; + } + const hasValidateModifiedOnlyOption = options && typeof options === "object" && "validateModifiedOnly" in options; + const pathsToSkip = options && options.pathsToSkip || null; + let shouldValidateModifiedOnly; + if (hasValidateModifiedOnlyOption) { + shouldValidateModifiedOnly = !!options.validateModifiedOnly; + } else { + shouldValidateModifiedOnly = this.$__schema.options.validateModifiedOnly; + } + const validateAllPaths = options && options.validateAllPaths; + if (validateAllPaths) { + if (pathsToSkip) { + throw new TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`"); + } + if (pathsToValidate) { + throw new TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`"); + } + if (hasValidateModifiedOnlyOption && shouldValidateModifiedOnly) { + throw new TypeError("Cannot set both `validateAllPaths` and `validateModifiedOnly`"); + } + } + const _this = this; + const _complete = () => { + let validationError = this.$__.validationError; + this.$__.validationError = null; + this.$__.validating = null; + if (shouldValidateModifiedOnly && validationError != null) { + const errors = Object.keys(validationError.errors); + for (const errPath of errors) { + if (!this.$isModified(errPath)) { + delete validationError.errors[errPath]; + } + } + if (Object.keys(validationError.errors).length === 0) { + validationError = void 0; + } + } + this.$__.cachedRequired = {}; + this.$emit("validate", _this); + this.constructor.emit("validate", _this); + if (validationError) { + for (const key in validationError.errors) { + if (!this[documentArrayParent] && validationError.errors[key] instanceof MongooseError.CastError) { + this.invalidate(key, validationError.errors[key]); + } + } + return validationError; + } + }; + let paths; + let doValidateOptionsByPath; + if (validateAllPaths) { + paths = new Set(Object.keys(this.$__schema.paths)); + for (const path of paths) { + const schemaType = this.$__schema.path(path); + if (!schemaType || !schemaType.$isMongooseArray) { + continue; + } + const val = this.$__getValue(path); + if (!val) { + continue; + } + _pushNestedArrayPaths(val, paths, path); + } + paths = [...paths]; + doValidateOptionsByPath = {}; + } else { + const pathDetails = _getPathsToValidate(this, pathsToValidate, pathsToSkip, options && options._nestedValidate); + paths = shouldValidateModifiedOnly ? pathDetails[0].filter((path) => this.$isModified(path)) : pathDetails[0]; + doValidateOptionsByPath = pathDetails[1]; + } + if (typeof pathsToValidate === "string") { + pathsToValidate = pathsToValidate.split(" "); + } + if (paths.length === 0) { + return immediate(function() { + const error2 = _complete(); + if (error2) { + return _this.$__schema.s.hooks.execPost("validate:error", _this, [_this], { error: error2 }, function(error3) { + callback(error3); + }); + } + callback(null, _this); + }); + } + const validated = {}; + let total = 0; + let pathsToSave = this.$__.saveOptions?.pathsToSave; + if (Array.isArray(pathsToSave)) { + pathsToSave = new Set(pathsToSave); + for (const path of paths) { + if (!pathsToSave.has(path)) { + continue; + } + validatePath(path); + } + } else { + for (const path of paths) { + validatePath(path); + } + } + function validatePath(path) { + if (path == null || validated[path]) { + return; + } + validated[path] = true; + total++; + immediate(function() { + const schemaType = _this.$__schema.path(path); + if (!schemaType) { + return --total || complete(); + } + if (!_this.$isValid(path)) { + --total || complete(); + return; + } + if (schemaType[schemaMixedSymbol] != null && path !== schemaType.path) { + return --total || complete(); + } + let val = _this.$__getValue(path); + let pop; + if (pop = _this.$populated(path)) { + val = pop; + } else if (val != null && val.$__ != null && val.$__.wasPopulated) { + val = val._doc._id; + } + const scope = _this.$__.pathsToScopes != null && path in _this.$__.pathsToScopes ? _this.$__.pathsToScopes[path] : _this; + const doValidateOptions = { + ...doValidateOptionsByPath[path], + path, + validateAllPaths, + _nestedValidate: true + }; + schemaType.doValidate(val, function(err) { + if (err) { + const isSubdoc = schemaType.$isSingleNested || schemaType.$isArraySubdocument || schemaType.$isMongooseDocumentArray; + if (isSubdoc && err instanceof ValidationError) { + return --total || complete(); + } + _this.invalidate(path, err, void 0, true); + } + --total || complete(); + }, scope, doValidateOptions); + }); + } + function complete() { + const error2 = _complete(); + if (error2) { + return _this.$__schema.s.hooks.execPost("validate:error", _this, [_this], { error: error2 }, function(error3) { + callback(error3); + }); + } + callback(null, _this); + } + }; + function _handlePathsToValidate(paths, pathsToValidate) { + const _pathsToValidate = new Set(pathsToValidate); + const parentPaths2 = /* @__PURE__ */ new Map([]); + for (const path of pathsToValidate) { + if (path.indexOf(".") === -1) { + continue; + } + const pieces = path.split("."); + let cur = pieces[0]; + for (let i4 = 1; i4 < pieces.length; ++i4) { + parentPaths2.set(cur, path); + cur = cur + "." + pieces[i4]; + } + } + const ret = /* @__PURE__ */ new Set(); + for (const path of paths) { + if (_pathsToValidate.has(path)) { + ret.add(path); + } else if (parentPaths2.has(path)) { + ret.add(parentPaths2.get(path)); + } + } + return ret; + } + function _handlePathsToSkip(paths, pathsToSkip) { + pathsToSkip = new Set(pathsToSkip); + paths = Array.from(paths).filter((p4) => !pathsToSkip.has(p4)); + return new Set(paths); + } + Document.prototype.validateSync = function(pathsToValidate, options) { + const _this = this; + if (arguments.length === 1 && typeof arguments[0] === "object" && !Array.isArray(arguments[0])) { + options = arguments[0]; + pathsToValidate = null; + } + const hasValidateModifiedOnlyOption = options && typeof options === "object" && "validateModifiedOnly" in options; + let shouldValidateModifiedOnly; + if (hasValidateModifiedOnlyOption) { + shouldValidateModifiedOnly = !!options.validateModifiedOnly; + } else { + shouldValidateModifiedOnly = this.$__schema.options.validateModifiedOnly; + } + let pathsToSkip = options && options.pathsToSkip; + const validateAllPaths = options && options.validateAllPaths; + if (validateAllPaths) { + if (pathsToSkip) { + throw new TypeError("Cannot set both `validateAllPaths` and `pathsToSkip`"); + } + if (pathsToValidate) { + throw new TypeError("Cannot set both `validateAllPaths` and `pathsToValidate`"); + } + } + if (typeof pathsToValidate === "string") { + const isOnePathOnly = pathsToValidate.indexOf(" ") === -1; + pathsToValidate = isOnePathOnly ? [pathsToValidate] : pathsToValidate.split(" "); + } else if (typeof pathsToSkip === "string" && pathsToSkip.indexOf(" ") !== -1) { + pathsToSkip = pathsToSkip.split(" "); + } + let paths; + let skipSchemaValidators; + if (validateAllPaths) { + paths = new Set(Object.keys(this.$__schema.paths)); + for (const path of paths) { + const schemaType = this.$__schema.path(path); + if (!schemaType || !schemaType.$isMongooseArray) { + continue; + } + const val = this.$__getValue(path); + if (!val) { + continue; + } + _pushNestedArrayPaths(val, paths, path); + } + paths = [...paths]; + skipSchemaValidators = {}; + } else { + const pathDetails = _getPathsToValidate(this, pathsToValidate, pathsToSkip); + paths = shouldValidateModifiedOnly ? pathDetails[0].filter((path) => this.$isModified(path)) : pathDetails[0]; + skipSchemaValidators = pathDetails[1]; + } + const validating = {}; + for (let i4 = 0, len = paths.length; i4 < len; ++i4) { + const path = paths[i4]; + if (validating[path]) { + continue; + } + validating[path] = true; + const p4 = _this.$__schema.path(path); + if (!p4) { + continue; + } + if (!_this.$isValid(path)) { + continue; + } + const val = _this.$__getValue(path); + const err2 = p4.doValidateSync(val, _this, { + skipSchemaValidators: skipSchemaValidators[path], + path, + validateModifiedOnly: shouldValidateModifiedOnly, + validateAllPaths + }); + if (err2) { + const isSubdoc = p4.$isSingleNested || p4.$isArraySubdocument || p4.$isMongooseDocumentArray; + if (isSubdoc && err2 instanceof ValidationError) { + continue; + } + _this.invalidate(path, err2, void 0, true); + } + } + const err = _this.$__.validationError; + _this.$__.validationError = void 0; + _this.$emit("validate", _this); + _this.constructor.emit("validate", _this); + if (err) { + for (const key in err.errors) { + if (err.errors[key] instanceof MongooseError.CastError) { + _this.invalidate(key, err.errors[key]); + } + } + } + return err; + }; + Document.prototype.invalidate = function(path, err, val, kind) { + if (!this.$__.validationError) { + this.$__.validationError = new ValidationError(this); + } + if (this.$__.validationError.errors[path]) { + return; + } + if (!err || typeof err === "string") { + err = new ValidatorError({ + path, + message: err, + type: kind || "user defined", + value: val + }); + } + if (this.$__.validationError === err) { + return this.$__.validationError; + } + this.$__.validationError.addError(path, err); + return this.$__.validationError; + }; + Document.prototype.$markValid = function(path) { + if (!this.$__.validationError || !this.$__.validationError.errors[path]) { + return; + } + delete this.$__.validationError.errors[path]; + if (Object.keys(this.$__.validationError.errors).length === 0) { + this.$__.validationError = null; + } + }; + function _markValidSubpaths(doc, path) { + if (!doc.$__.validationError) { + return; + } + const keys = Object.keys(doc.$__.validationError.errors); + for (const key of keys) { + if (key.startsWith(path + ".")) { + delete doc.$__.validationError.errors[key]; + } + } + if (Object.keys(doc.$__.validationError.errors).length === 0) { + doc.$__.validationError = null; + } + } + function _checkImmutableSubpaths(subdoc, schematype, priorVal) { + const schema = schematype.schema; + if (schema == null) { + return; + } + for (const key of Object.keys(schema.paths)) { + const path = schema.paths[key]; + if (path.$immutableSetter == null) { + continue; + } + const oldVal = priorVal == null ? void 0 : priorVal.$__getValue(key); + path.$immutableSetter.call(subdoc, oldVal); + } + } + Document.prototype.$isValid = function(path) { + if (this.$__.validationError == null || Object.keys(this.$__.validationError.errors).length === 0) { + return true; + } + if (path == null) { + return false; + } + if (path.indexOf(" ") !== -1) { + path = path.split(" "); + } + if (Array.isArray(path)) { + return path.some((p4) => this.$__.validationError.errors[p4] == null); + } + return this.$__.validationError.errors[path] == null; + }; + Document.prototype.$__reset = function reset() { + let _this = this; + const subdocs = !this.$isSubdocument ? this.$getAllSubdocs({ useCache: true }) : null; + if (subdocs && subdocs.length > 0) { + for (const subdoc of subdocs) { + subdoc.$__reset(); + } + } + this.$__dirty().forEach(function(dirt) { + const type = dirt.value; + if (type && typeof type.clearAtomics === "function") { + type.clearAtomics(); + } else if (type && type[arrayAtomicsSymbol]) { + type[arrayAtomicsBackupSymbol] = type[arrayAtomicsSymbol]; + type[arrayAtomicsSymbol] = {}; + } + }); + this.$__.backup = {}; + this.$__.backup.activePaths = { + modify: Object.assign({}, this.$__.activePaths.getStatePaths("modify")), + default: Object.assign({}, this.$__.activePaths.getStatePaths("default")) + }; + this.$__.backup.validationError = this.$__.validationError; + this.$__.backup.errors = this.$errors; + this.$__.activePaths.clear("modify"); + this.$__.activePaths.clear("default"); + this.$__.validationError = void 0; + this.$errors = void 0; + _this = this; + this.$__schema.requiredPaths().forEach(function(path) { + _this.$__.activePaths.require(path); + }); + return this; + }; + Document.prototype.$__undoReset = function $__undoReset() { + if (this.$__.backup == null || this.$__.backup.activePaths == null) { + return; + } + this.$__.activePaths.states.modify = this.$__.backup.activePaths.modify; + this.$__.activePaths.states.default = this.$__.backup.activePaths.default; + this.$__.validationError = this.$__.backup.validationError; + this.$errors = this.$__.backup.errors; + for (const dirt of this.$__dirty()) { + const type = dirt.value; + if (type && type[arrayAtomicsSymbol] && type[arrayAtomicsBackupSymbol]) { + type[arrayAtomicsSymbol] = type[arrayAtomicsBackupSymbol]; + } + } + if (!this.$isSubdocument) { + for (const subdoc of this.$getAllSubdocs()) { + subdoc.$__undoReset(); + } + } + }; + Document.prototype.$__dirty = function() { + const _this = this; + let all = this.$__.activePaths.map("modify", function(path) { + return { + path, + value: _this.$__getValue(path), + schema: _this.$__path(path) + }; + }); + all = all.concat(this.$__.activePaths.map("default", function(path) { + if (path === "_id" || _this.$__getValue(path) == null) { + return; + } + return { + path, + value: _this.$__getValue(path), + schema: _this.$__path(path) + }; + })); + const allPaths = new Map(all.filter((el) => el != null).map((el) => [el.path, el.value])); + const minimal = []; + all.forEach(function(item) { + if (!item) { + return; + } + let top = null; + const array = parentPaths(item.path); + for (let i4 = 0; i4 < array.length - 1; i4++) { + if (allPaths.has(array[i4])) { + top = allPaths.get(array[i4]); + break; + } + } + if (top == null) { + minimal.push(item); + } else if (top != null && top[arrayAtomicsSymbol] != null && top.hasAtomics()) { + top[arrayAtomicsSymbol] = {}; + top[arrayAtomicsSymbol].$set = top; + } + }); + return minimal; + }; + Document.prototype.$__setSchema = function(schema) { + compile(schema.tree, this, void 0, schema.options); + for (const key of Object.keys(schema.virtuals)) { + schema.virtuals[key]._applyDefaultGetters(); + } + if (schema.path("schema") == null) { + this.schema = schema; + } + this.$__schema = schema; + this[documentSchemaSymbol] = schema; + }; + Document.prototype.$__getArrayPathsToValidate = function() { + DocumentArray || (DocumentArray = require_documentArray()); + return this.$__.activePaths.map("init", "modify", function(i4) { + return this.$__getValue(i4); + }.bind(this)).filter(function(val) { + return val && Array.isArray(val) && utils.isMongooseDocumentArray(val) && val.length; + }).reduce(function(seed, array) { + return seed.concat(array); + }, []).filter(function(doc) { + return doc; + }); + }; + Document.prototype.$getAllSubdocs = function(options) { + if (options?.useCache && this.$__.saveOptions?.__subdocs) { + return this.$__.saveOptions.__subdocs; + } + DocumentArray || (DocumentArray = require_documentArray()); + Embedded = Embedded || require_arraySubdocument(); + const subDocs = []; + function getSubdocs(doc) { + const newSubdocs = []; + for (const { model } of doc.$__schema.childSchemas) { + const val = doc.$__getValue(model.path); + if (val == null) { + continue; + } + if (val.$__) { + newSubdocs.push(val); + } + if (Array.isArray(val)) { + for (const el of val) { + if (el != null && el.$__) { + newSubdocs.push(el); + } + } + } + if (val instanceof Map) { + for (const el of val.values()) { + if (el != null && el.$__) { + newSubdocs.push(el); + } + } + } + } + for (const subdoc of newSubdocs) { + getSubdocs(subdoc); + } + subDocs.push(...newSubdocs); + } + getSubdocs(this); + if (this.$__.saveOptions) { + this.$__.saveOptions.__subdocs = subDocs; + } + return subDocs; + }; + function applyQueue(doc) { + const q4 = doc.$__schema && doc.$__schema.callQueue; + if (!q4.length) { + return; + } + for (const pair of q4) { + if (pair[0] !== "pre" && pair[0] !== "post" && pair[0] !== "on") { + doc[pair[0]].apply(doc, pair[1]); + } + } + } + Document.prototype.$__handleReject = function handleReject(err) { + if (this.$listeners("error").length) { + this.$emit("error", err); + } else if (this.constructor.listeners && this.constructor.listeners("error").length) { + this.constructor.emit("error", err); + } + }; + Document.prototype.$toObject = function(options, json) { + const defaultOptions = this.$__schema._defaultToObjectOptions(json); + const hasOnlyPrimitiveValues = this.$__hasOnlyPrimitiveValues(); + options = utils.isPOJO(options) ? { ...options } : {}; + options._calledWithOptions = options._calledWithOptions || { ...options }; + let _minimize; + if (options._calledWithOptions.minimize != null) { + _minimize = options.minimize; + } else if (this.$__schemaTypeOptions?.minimize != null) { + _minimize = this.$__schemaTypeOptions.minimize; + } else if (defaultOptions != null && defaultOptions.minimize != null) { + _minimize = defaultOptions.minimize; + } else { + _minimize = this.$__schema.options.minimize; + } + options.minimize = _minimize; + if (!hasOnlyPrimitiveValues) { + options._seen = options._seen || /* @__PURE__ */ new Map(); + } + const depopulate = options._calledWithOptions.depopulate ?? defaultOptions?.depopulate ?? options.depopulate ?? false; + if (depopulate && options._isNested && this.$__.wasPopulated) { + return clone(this.$__.wasPopulated.value || this._doc._id, options); + } + if (depopulate) { + options.depopulate = true; + } + if (defaultOptions != null) { + for (const key of Object.keys(defaultOptions)) { + if (options[key] == null) { + options[key] = defaultOptions[key]; + } + } + } + options._isNested = true; + options.json = json; + options.minimize = _minimize; + const parentOptions = options._parentOptions; + options._parentOptions = this.$isSubdocument ? options : null; + const schemaFieldsOnly = options._calledWithOptions.schemaFieldsOnly ?? options.schemaFieldsOnly ?? defaultOptions.schemaFieldsOnly ?? false; + let ret; + if (hasOnlyPrimitiveValues && !options.flattenObjectIds) { + ret = this.$__toObjectShallow(schemaFieldsOnly); + } else if (schemaFieldsOnly) { + ret = {}; + for (const path of Object.keys(this.$__schema.paths)) { + const value = this.$__getValue(path); + if (value === void 0) { + continue; + } + let pathToSet = path; + let objToSet = ret; + if (path.indexOf(".") !== -1) { + const segments = path.split("."); + pathToSet = segments[segments.length - 1]; + for (let i4 = 0; i4 < segments.length - 1; ++i4) { + objToSet[segments[i4]] = objToSet[segments[i4]] ?? {}; + objToSet = objToSet[segments[i4]]; + } + } + if (value === null) { + objToSet[pathToSet] = null; + continue; + } + objToSet[pathToSet] = clone(value, options); + } + } else { + ret = clone(this._doc, options) || {}; + } + const getters = options._calledWithOptions.getters ?? options.getters ?? defaultOptions.getters ?? false; + if (getters) { + applyGetters(this, ret); + if (options.minimize) { + ret = minimize(ret) || {}; + } + } + const virtuals = options._calledWithOptions.virtuals ?? defaultOptions.virtuals ?? parentOptions?.virtuals ?? void 0; + if (virtuals || getters && virtuals !== false) { + applyVirtuals(this, ret, options, options); + } + if (options.versionKey === false && this.$__schema.options.versionKey) { + delete ret[this.$__schema.options.versionKey]; + } + const transform = options._calledWithOptions.transform ?? true; + let transformFunction = void 0; + if (transform === true) { + transformFunction = defaultOptions.transform; + } else if (typeof transform === "function") { + transformFunction = transform; + } + if (transform) { + applySchemaTypeTransforms(this, ret); + } + if (options.useProjection) { + omitDeselectedFields(this, ret); + } + if (typeof transformFunction === "function") { + const xformed = transformFunction(this, ret, options); + if (typeof xformed !== "undefined") { + ret = xformed; + } + } + return ret; + }; + Document.prototype.$__toObjectShallow = function $__toObjectShallow(schemaFieldsOnly) { + const ret = {}; + if (this._doc != null) { + const keys = schemaFieldsOnly ? Object.keys(this.$__schema.paths) : Object.keys(this._doc); + for (const key of keys) { + const value = this._doc[key]; + if (value instanceof Date) { + ret[key] = new Date(value); + } else if (value !== void 0) { + ret[key] = value; + } + } + } + return ret; + }; + Document.prototype.toObject = function(options) { + return this.$toObject(options); + }; + function applyVirtuals(self2, json, options, toObjectOptions) { + const schema = self2.$__schema; + const virtuals = schema.virtuals; + const paths = Object.keys(virtuals); + let i4 = paths.length; + const numPaths = i4; + let path; + let assignPath; + let cur = self2._doc; + let v4; + const aliases = typeof (toObjectOptions && toObjectOptions.aliases) === "boolean" ? toObjectOptions.aliases : true; + options = options || {}; + let virtualsToApply = null; + if (Array.isArray(options.virtuals)) { + virtualsToApply = new Set(options.virtuals); + } else if (options.virtuals && options.virtuals.pathsToSkip) { + virtualsToApply = new Set(paths); + for (let i5 = 0; i5 < options.virtuals.pathsToSkip.length; i5++) { + if (virtualsToApply.has(options.virtuals.pathsToSkip[i5])) { + virtualsToApply.delete(options.virtuals.pathsToSkip[i5]); + } + } + } + if (!cur) { + return json; + } + for (i4 = 0; i4 < numPaths; ++i4) { + path = paths[i4]; + if (virtualsToApply != null && !virtualsToApply.has(path)) { + continue; + } + if (!aliases && Object.hasOwn(schema.aliases, path)) { + continue; + } + assignPath = path; + if (options.path != null) { + if (!path.startsWith(options.path + ".")) { + continue; + } + assignPath = path.substring(options.path.length + 1); + } + if (assignPath.indexOf(".") === -1 && assignPath === path) { + v4 = virtuals[path].applyGetters(void 0, self2); + if (v4 === void 0) { + continue; + } + v4 = clone(v4, options); + json[assignPath] = v4; + continue; + } + const parts = assignPath.split("."); + v4 = clone(self2.get(path), options); + if (v4 === void 0) { + continue; + } + const plen = parts.length; + cur = json; + for (let j4 = 0; j4 < plen - 1; ++j4) { + cur[parts[j4]] = cur[parts[j4]] || {}; + cur = cur[parts[j4]]; + } + cur[parts[plen - 1]] = v4; + } + return json; + } + function applyGetters(self2, json) { + const schema = self2.$__schema; + const paths = Object.keys(schema.paths); + let i4 = paths.length; + let path; + let cur = self2._doc; + let v4; + if (!cur) { + return json; + } + while (i4--) { + path = paths[i4]; + const parts = path.split("."); + const plen = parts.length; + const last = plen - 1; + let branch = json; + let part; + cur = self2._doc; + if (!self2.$__isSelected(path)) { + continue; + } + for (let ii = 0; ii < plen; ++ii) { + part = parts[ii]; + v4 = cur[part]; + if (branch != null && typeof branch !== "object") { + break; + } else if (ii === last) { + branch[part] = schema.paths[path].applyGetters( + branch[part], + self2 + ); + if (Array.isArray(branch[part]) && schema.paths[path].$embeddedSchemaType) { + for (let i5 = 0; i5 < branch[part].length; ++i5) { + branch[part][i5] = schema.paths[path].$embeddedSchemaType.applyGetters( + branch[part][i5], + self2 + ); + } + } + } else if (v4 == null) { + if (part in cur) { + branch[part] = v4; + } + break; + } else { + branch = branch[part] || (branch[part] = {}); + } + cur = v4; + } + } + return json; + } + function applySchemaTypeTransforms(self2, json) { + const schema = self2.$__schema; + const paths = Object.keys(schema.paths || {}); + const cur = self2._doc; + if (!cur) { + return json; + } + for (const path of paths) { + const schematype = schema.paths[path]; + const topLevelTransformFunction = schematype.options.transform ?? schematype.constructor?.defaultOptions?.transform; + const embeddedSchemaTypeTransformFunction = schematype.$embeddedSchemaType?.options?.transform ?? schematype.$embeddedSchemaType?.constructor?.defaultOptions?.transform; + if (typeof topLevelTransformFunction === "function") { + const val = self2.$get(path); + if (val === void 0) { + continue; + } + const transformedValue = topLevelTransformFunction.call(self2, val); + throwErrorIfPromise(path, transformedValue); + utils.setValue(path, transformedValue, json); + } else if (typeof embeddedSchemaTypeTransformFunction === "function") { + const val = self2.$get(path); + if (val === void 0) { + continue; + } + const vals = [].concat(val); + for (let i4 = 0; i4 < vals.length; ++i4) { + const transformedValue = embeddedSchemaTypeTransformFunction.call(self2, vals[i4]); + vals[i4] = transformedValue; + throwErrorIfPromise(path, transformedValue); + } + json[path] = vals; + } + } + return json; + } + function throwErrorIfPromise(path, transformedValue) { + if (isPromise(transformedValue)) { + throw new Error("`transform` function must be synchronous, but the transform on path `" + path + "` returned a promise."); + } + } + function omitDeselectedFields(self2, json) { + const schema = self2.$__schema; + const paths = Object.keys(schema.paths || {}); + const cur = self2._doc; + if (!cur) { + return json; + } + let selected = self2.$__.selected; + if (selected === void 0) { + selected = {}; + queryhelpers.applyPaths(selected, schema); + } + if (selected == null || Object.keys(selected).length === 0) { + return json; + } + for (const path of paths) { + if (selected[path] != null && !selected[path]) { + delete json[path]; + } + } + return json; + } + Document.prototype.toJSON = function(options) { + return this.$toObject(options, true); + }; + Document.prototype.ownerDocument = function() { + return this; + }; + Document.prototype.parent = function() { + if (this.$isSubdocument || this.$__.wasPopulated) { + return this.$__.parent; + } + return this; + }; + Document.prototype.$parent = Document.prototype.parent; + Document.prototype.inspect = function(options) { + const isPOJO = utils.isPOJO(options); + let opts; + if (isPOJO) { + opts = options; + opts.minimize = false; + } + const ret = arguments.length > 0 ? this.toObject(opts) : this.toObject(); + if (ret == null) { + return "MongooseDocument { " + ret + " }"; + } + return ret; + }; + if (inspect.custom) { + Document.prototype[inspect.custom] = Document.prototype.inspect; + } + Document.prototype.toString = function() { + const ret = this.inspect(); + if (typeof ret === "string") { + return ret; + } + return inspect(ret); + }; + Document.prototype.equals = function(doc) { + if (!doc) { + return false; + } + const tid = this.$__getValue("_id"); + const docid = doc.$__ != null ? doc.$__getValue("_id") : doc; + if (!tid && !docid) { + return deepEqual(this, doc); + } + return tid && tid.equals ? tid.equals(docid) : tid === docid; + }; + Document.prototype.populate = async function populate() { + const pop = {}; + const args2 = [...arguments]; + if (typeof args2[args2.length - 1] === "function") { + throw new MongooseError("Document.prototype.populate() no longer accepts a callback"); + } + if (args2.length !== 0) { + const res = utils.populate.apply(null, args2); + for (const populateOptions of res) { + pop[populateOptions.path] = populateOptions; + } + } + const paths = utils.object.vals(pop); + let topLevelModel = this.constructor; + if (this.$__isNested) { + topLevelModel = this.$__[scopeSymbol].constructor; + const nestedPath = this.$__.nestedPath; + paths.forEach(function(populateOptions) { + populateOptions.path = nestedPath + "." + populateOptions.path; + }); + } + if (this.$session() != null) { + const session = this.$session(); + paths.forEach((path) => { + if (path.options == null) { + path.options = { session }; + return; + } + if (!("session" in path.options)) { + path.options.session = session; + } + }); + } + paths.forEach((p4) => { + p4._localModel = topLevelModel; + }); + return topLevelModel.populate(this, paths); + }; + Document.prototype.$getPopulatedDocs = function $getPopulatedDocs() { + let keys = []; + if (this.$__.populated != null) { + keys = keys.concat(Object.keys(this.$__.populated)); + } + let result = []; + for (const key of keys) { + const value = this.$get(key); + if (Array.isArray(value)) { + result = result.concat(value); + } else if (value instanceof Document) { + result.push(value); + } + } + return result; + }; + Document.prototype.populated = function(path, val, options) { + if (val == null || val === true) { + if (!this.$__.populated) { + return void 0; + } + if (typeof path !== "string") { + return void 0; + } + const _path = path.endsWith(".$*") ? path.replace(/\.\$\*$/, "") : path; + const v4 = this.$__.populated[_path]; + if (v4) { + return val === true ? v4 : v4.value; + } + return void 0; + } + this.$__.populated || (this.$__.populated = {}); + this.$__.populated[path] = { value: val, options }; + const pieces = path.split("."); + for (let i4 = 0; i4 < pieces.length - 1; ++i4) { + const subpath = pieces.slice(0, i4 + 1).join("."); + const subdoc = this.$get(subpath); + if (subdoc != null && subdoc.$__ != null && this.$populated(subpath)) { + const rest = pieces.slice(i4 + 1).join("."); + subdoc.$populated(rest, val, options); + break; + } + } + return val; + }; + Document.prototype.$populated = Document.prototype.populated; + Document.prototype.$assertPopulated = function $assertPopulated(path, values) { + if (Array.isArray(path)) { + path.forEach((p4) => this.$assertPopulated(p4, values)); + return this; + } + if (arguments.length > 1) { + this.$set(values); + } + if (!this.$populated(path)) { + throw new MongooseError(`Expected path "${path}" to be populated`); + } + return this; + }; + Document.prototype.depopulate = function(path) { + if (typeof path === "string") { + path = path.indexOf(" ") === -1 ? [path] : path.split(" "); + } + let populatedIds; + const virtualKeys = this.$$populatedVirtuals ? Object.keys(this.$$populatedVirtuals) : []; + const populated = this.$__ && this.$__.populated || {}; + if (arguments.length === 0) { + for (const virtualKey of virtualKeys) { + delete this.$$populatedVirtuals[virtualKey]; + delete this._doc[virtualKey]; + delete populated[virtualKey]; + } + const keys = Object.keys(populated); + for (const key of keys) { + populatedIds = this.$populated(key); + if (!populatedIds) { + continue; + } + delete populated[key]; + if (Array.isArray(populatedIds)) { + const arr = utils.getValue(key, this._doc); + if (arr.isMongooseArray) { + const rawArray = arr.__array; + for (let i4 = 0; i4 < rawArray.length; ++i4) { + const subdoc = rawArray[i4]; + if (subdoc == null) { + continue; + } + rawArray[i4] = subdoc instanceof Document ? subdoc._doc._id : subdoc._id; + } + } else { + utils.setValue(key, populatedIds, this._doc); + } + } else { + utils.setValue(key, populatedIds, this._doc); + } + } + return this; + } + for (const singlePath of path) { + populatedIds = this.$populated(singlePath); + delete populated[singlePath]; + if (virtualKeys.indexOf(singlePath) !== -1) { + delete this.$$populatedVirtuals[singlePath]; + delete this._doc[singlePath]; + } else if (populatedIds) { + if (Array.isArray(populatedIds)) { + const arr = utils.getValue(singlePath, this._doc); + if (arr.isMongooseArray) { + const rawArray = arr.__array; + for (let i4 = 0; i4 < rawArray.length; ++i4) { + const subdoc = rawArray[i4]; + if (subdoc == null) { + continue; + } + rawArray[i4] = subdoc instanceof Document ? subdoc._doc._id : subdoc._id; + } + } else { + utils.setValue(singlePath, populatedIds, this._doc); + } + } else { + utils.setValue(singlePath, populatedIds, this._doc); + } + } + } + return this; + }; + Document.prototype.$__fullPath = function(path) { + return path || ""; + }; + Document.prototype.getChanges = function() { + const delta = this.$__delta(); + const changes = delta ? delta[1] : {}; + return changes; + }; + Document.prototype.$__delta = function $__delta() { + const dirty = this.$__dirty(); + const optimisticConcurrency = this.$__schema.options.optimisticConcurrency; + if (optimisticConcurrency) { + if (Array.isArray(optimisticConcurrency)) { + const optCon = new Set(optimisticConcurrency); + const modPaths = this.modifiedPaths(); + if (modPaths.find((path) => optCon.has(path))) { + this.$__.version = dirty.length ? VERSION_ALL : VERSION_WHERE; + } + } else { + this.$__.version = dirty.length ? VERSION_ALL : VERSION_WHERE; + } + } + if (!dirty.length && VERSION_ALL !== this.$__.version) { + return; + } + const where = {}; + const delta = {}; + const len = dirty.length; + const divergent = []; + let d4 = 0; + where._id = this._doc._id; + if ((where && where._id && where._id.$__ || null) != null) { + where._id = where._id.toObject({ transform: false, depopulate: true }); + } + for (; d4 < len; ++d4) { + const data2 = dirty[d4]; + let value = data2.value; + const match = checkDivergentArray(this, data2.path, value); + if (match) { + divergent.push(match); + continue; + } + const pop = this.$populated(data2.path, true); + if (!pop && this.$__.selected) { + const pathSplit = data2.path.split("."); + const top = pathSplit[0]; + if (this.$__.selected[top] && this.$__.selected[top].$elemMatch) { + if (pathSplit.length > 1 && pathSplit[1] == 0 && typeof where[top] === "undefined") { + where[top] = this.$__.selected[top]; + pathSplit[1] = "$"; + data2.path = pathSplit.join("."); + } else { + divergent.push(data2.path); + continue; + } + } + } + if (this.$isDefault(data2.path) && this.$__.selected) { + if (data2.path.indexOf(".") === -1 && isPathExcluded(this.$__.selected, data2.path)) { + continue; + } + const pathsToCheck = parentPaths(data2.path); + if (pathsToCheck.find((path) => isPathExcluded(this.$__.isSelected, path))) { + continue; + } + } + if (divergent.length) continue; + if (value === void 0) { + operand(this, where, delta, data2, 1, "$unset"); + } else if (value === null) { + operand(this, where, delta, data2, null); + } else if (typeof value.getAtomics === "function") { + handleAtomics(this, where, delta, data2, value); + } else if (value[MongooseBuffer.pathSymbol] && Buffer.isBuffer(value)) { + value = value.toObject(); + operand(this, where, delta, data2, value); + } else { + if (this.$__.primitiveAtomics && this.$__.primitiveAtomics[data2.path] != null) { + const val = this.$__.primitiveAtomics[data2.path]; + const op2 = firstKey(val); + operand(this, where, delta, data2, val[op2], op2); + } else { + value = clone(value, { + depopulate: true, + transform: false, + virtuals: false, + getters: false, + omitUndefined: true, + _isNested: true + }); + operand(this, where, delta, data2, value); + } + } + } + if (divergent.length) { + return new DivergentArrayError(divergent); + } + if (this.$__.version) { + this.$__version(where, delta); + } + if (Object.keys(delta).length === 0) { + return [where, null]; + } + return [where, delta]; + }; + function checkDivergentArray(doc, path, array) { + const pop = doc.$populated(path, true); + if (!pop && doc.$__.selected) { + const top = path.split(".")[0]; + if (doc.$__.selected[top + ".$"]) { + return top; + } + } + if (!(pop && utils.isMongooseArray(array))) return; + const check = pop.options.match || pop.options.options && Object.hasOwn(pop.options.options, "limit") || // 0 is not permitted + pop.options.options && pop.options.options.skip || // 0 is permitted + pop.options.select && // deselected _id? + (pop.options.select._id === 0 || /\s?-_id\s?/.test(pop.options.select)); + if (check) { + const atomics = array[arrayAtomicsSymbol]; + if (Object.keys(atomics).length === 0 || atomics.$set || atomics.$pop) { + return path; + } + } + } + function operand(self2, where, delta, data2, val, op2) { + op2 || (op2 = "$set"); + if (!delta[op2]) delta[op2] = {}; + delta[op2][data2.path] = val; + if (self2.$__schema.options.versionKey === false) return; + if (shouldSkipVersioning(self2, data2.path)) return; + if (VERSION_ALL === (VERSION_ALL & self2.$__.version)) return; + if (self2.$__schema.options.optimisticConcurrency) { + return; + } + switch (op2) { + case "$set": + case "$unset": + case "$pop": + case "$pull": + case "$pullAll": + case "$push": + case "$addToSet": + case "$inc": + break; + default: + return; + } + if (op2 === "$push" || op2 === "$addToSet" || op2 === "$pullAll" || op2 === "$pull") { + if (/\.\d+\.|\.\d+$/.test(data2.path)) { + self2.$__.version = VERSION_ALL; + } else { + self2.$__.version |= VERSION_INC; + } + } else if (/^\$p/.test(op2)) { + self2.$__.version = VERSION_ALL; + } else if (Array.isArray(val)) { + self2.$__.version = VERSION_ALL; + } else if (/\.\d+\.|\.\d+$/.test(data2.path)) { + self2.$__.version |= VERSION_WHERE; + } + } + function handleAtomics(self2, where, delta, data2, value) { + if (delta.$set && delta.$set[data2.path]) { + return; + } + if (typeof value.getAtomics === "function") { + value.getAtomics().forEach(function(atomic) { + const op3 = atomic[0]; + const val2 = atomic[1]; + operand(self2, where, delta, data2, val2, op3); + }); + return; + } + if (typeof value.$__getAtomics === "function") { + value.$__getAtomics().forEach(function(atomic) { + const op3 = atomic[0]; + const val2 = atomic[1]; + operand(self2, where, delta, data2, val2, op3); + }); + return; + } + const atomics = value[arrayAtomicsSymbol]; + const ops = Object.keys(atomics); + let i4 = ops.length; + let val; + let op2; + if (i4 === 0) { + if (utils.isMongooseObject(value)) { + value = value.toObject({ depopulate: 1, _isNested: true }); + } else if (value.valueOf) { + value = value.valueOf(); + } + return operand(self2, where, delta, data2, value); + } + function iter(mem) { + return utils.isMongooseObject(mem) ? mem.toObject({ depopulate: 1, _isNested: true }) : mem; + } + while (i4--) { + op2 = ops[i4]; + val = atomics[op2]; + if (utils.isMongooseObject(val)) { + val = val.toObject({ depopulate: true, transform: false, _isNested: true }); + } else if (Array.isArray(val)) { + val = val.map(iter); + } else if (val.valueOf) { + val = val.valueOf(); + } + if (op2 === "$addToSet") { + val = { $each: val }; + } + operand(self2, where, delta, data2, val, op2); + } + } + function shouldSkipVersioning(self2, path) { + const skipVersioning = self2.$__schema.options.skipVersioning; + if (!skipVersioning) return false; + path = path.replace(/\.\d+\./, "."); + return skipVersioning[path]; + } + Document.prototype.$clone = function() { + const Model = this.constructor; + const clonedDoc = new Model(); + clonedDoc.$isNew = this.$isNew; + if (this._doc) { + clonedDoc._doc = clone(this._doc, { retainDocuments: true }); + } + if (this.$__) { + const Cache = this.$__.constructor; + const clonedCache = new Cache(); + for (const key of Object.getOwnPropertyNames(this.$__)) { + if (key === "activePaths") { + continue; + } + clonedCache[key] = clone(this.$__[key]); + } + Object.assign(clonedCache.activePaths, clone({ ...this.$__.activePaths })); + clonedDoc.$__ = clonedCache; + } + return clonedDoc; + }; + Document.prototype.$createModifiedPathsSnapshot = function $createModifiedPathsSnapshot() { + const subdocSnapshot = /* @__PURE__ */ new WeakMap(); + if (!this.$isSubdocument) { + const subdocs = this.$getAllSubdocs(); + for (const child of subdocs) { + subdocSnapshot.set(child, child.$__.activePaths.clone()); + } + } + return new ModifiedPathsSnapshot( + subdocSnapshot, + this.$__.activePaths.clone(), + this.$__.version + ); + }; + Document.prototype.$restoreModifiedPathsSnapshot = function $restoreModifiedPathsSnapshot(snapshot) { + this.$__.activePaths = snapshot.activePaths.clone(); + this.$__.version = snapshot.version; + if (!this.$isSubdocument) { + const subdocs = this.$getAllSubdocs(); + for (const child of subdocs) { + if (snapshot.subdocSnapshot.has(child)) { + child.$__.activePaths = snapshot.subdocSnapshot.get(child); + } + } + } + return this; + }; + Document.prototype.$clearModifiedPaths = function $clearModifiedPaths() { + this.$__.activePaths.clear("modify"); + this.$__.activePaths.clear("init"); + this.$__.version = 0; + if (!this.$isSubdocument) { + const subdocs = this.$getAllSubdocs(); + for (const child of subdocs) { + child.$clearModifiedPaths(); + } + } + return this; + }; + Document.prototype.$__hasOnlyPrimitiveValues = function $__hasOnlyPrimitiveValues() { + return !this.$__.populated && !this.$__.wasPopulated && (this._doc == null || Object.values(this._doc).every((v4) => { + return v4 == null || typeof v4 !== "object" || utils.isNativeObject(v4) && !Array.isArray(v4) || isBsonType(v4, "ObjectId") || isBsonType(v4, "Decimal128"); + })); + }; + Document.prototype._applyVersionIncrement = function _applyVersionIncrement() { + if (!this.$__.version) return; + const doIncrement = VERSION_INC === (VERSION_INC & this.$__.version); + this.$__.version = void 0; + if (doIncrement) { + const key = this.$__schema.options.versionKey; + const version = this.$__getValue(key) || 0; + this.$__setValue(key, version + 1); + } + }; + Document.prototype._applyVersionIncrement = function _applyVersionIncrement() { + if (!this.$__.version) return; + const doIncrement = VERSION_INC === (VERSION_INC & this.$__.version); + this.$__.version = void 0; + if (doIncrement) { + const key = this.$__schema.options.versionKey; + const version = this.$__getValue(key) || 0; + this.$__setValue(key, version + 1); + } + }; + Document.VERSION_WHERE = VERSION_WHERE; + Document.VERSION_INC = VERSION_INC; + Document.VERSION_ALL = VERSION_ALL; + Document.ValidationError = ValidationError; + module2.exports = exports2 = Document; + } +}); + +// node_modules/mongoose/lib/utils.js +var require_utils6 = __commonJS({ + "node_modules/mongoose/lib/utils.js"(exports2) { + "use strict"; + var UUID = require_bson().UUID; + var ms = require_ms2(); + var mpath = require_mpath(); + var ObjectId2 = require_objectid(); + var PopulateOptions = require_populateOptions(); + var clone = require_clone(); + var immediate = require_immediate(); + var isObject = require_isObject(); + var isMongooseArray = require_isMongooseArray(); + var isMongooseDocumentArray = require_isMongooseDocumentArray(); + var isBsonType = require_isBsonType(); + var isPOJO = require_isPOJO(); + var getFunctionName = require_getFunctionName(); + var isMongooseObject = require_isMongooseObject(); + var promiseOrCallback = require_promiseOrCallback(); + var schemaMerge = require_merge(); + var specialProperties = require_specialProperties(); + var { trustedSymbol } = require_trusted(); + var Document; + exports2.specialProperties = specialProperties; + exports2.isMongooseArray = isMongooseArray.isMongooseArray; + exports2.isMongooseDocumentArray = isMongooseDocumentArray.isMongooseDocumentArray; + exports2.registerMongooseArray = isMongooseArray.registerMongooseArray; + exports2.registerMongooseDocumentArray = isMongooseDocumentArray.registerMongooseDocumentArray; + var oneSpaceRE = /\s/; + var manySpaceRE = /\s+/; + exports2.toCollectionName = function(name, pluralize) { + if (name === "system.profile") { + return name; + } + if (name === "system.indexes") { + return name; + } + if (typeof pluralize === "function") { + if (typeof name !== "string") { + throw new TypeError("Collection name must be a string"); + } + if (name.length === 0) { + throw new TypeError("Collection name cannot be empty"); + } + return pluralize(name); + } + return name; + }; + exports2.deepEqual = function deepEqual(a4, b4) { + if (a4 === b4) { + return true; + } + if (typeof a4 !== "object" || typeof b4 !== "object") { + return a4 === b4; + } + if (a4 instanceof Date && b4 instanceof Date) { + return a4.getTime() === b4.getTime(); + } + if (isBsonType(a4, "ObjectId") && isBsonType(b4, "ObjectId") || isBsonType(a4, "Decimal128") && isBsonType(b4, "Decimal128")) { + return a4.toString() === b4.toString(); + } + if (a4 instanceof RegExp && b4 instanceof RegExp) { + return a4.source === b4.source && a4.ignoreCase === b4.ignoreCase && a4.multiline === b4.multiline && a4.global === b4.global && a4.dotAll === b4.dotAll && a4.unicode === b4.unicode && a4.sticky === b4.sticky && a4.hasIndices === b4.hasIndices; + } + if (a4 == null || b4 == null) { + return false; + } + if (a4.prototype !== b4.prototype) { + return false; + } + if (a4 instanceof Map || b4 instanceof Map) { + if (!(a4 instanceof Map) || !(b4 instanceof Map)) { + return false; + } + return deepEqual(Array.from(a4.keys()), Array.from(b4.keys())) && deepEqual(Array.from(a4.values()), Array.from(b4.values())); + } + if (a4 instanceof Number && b4 instanceof Number) { + return a4.valueOf() === b4.valueOf(); + } + if (Buffer.isBuffer(a4)) { + return exports2.buffer.areEqual(a4, b4); + } + if (Array.isArray(a4) || Array.isArray(b4)) { + if (!Array.isArray(a4) || !Array.isArray(b4)) { + return false; + } + const len = a4.length; + if (len !== b4.length) { + return false; + } + for (let i4 = 0; i4 < len; ++i4) { + if (!deepEqual(a4[i4], b4[i4])) { + return false; + } + } + return true; + } + if (a4.$__ != null) { + a4 = a4._doc; + } else if (isMongooseObject(a4)) { + a4 = a4.toObject(); + } + if (b4.$__ != null) { + b4 = b4._doc; + } else if (isMongooseObject(b4)) { + b4 = b4.toObject(); + } + const ka = Object.keys(a4); + const kb = Object.keys(b4); + const kaLength = ka.length; + if (kaLength !== kb.length) { + return false; + } + for (let i4 = kaLength - 1; i4 >= 0; i4--) { + if (ka[i4] !== kb[i4]) { + return false; + } + } + for (const key of ka) { + if (!deepEqual(a4[key], b4[key])) { + return false; + } + } + return true; + }; + exports2.last = function(arr) { + if (arr.length > 0) { + return arr[arr.length - 1]; + } + return void 0; + }; + exports2.promiseOrCallback = promiseOrCallback; + exports2.cloneArrays = function cloneArrays(arr) { + if (!Array.isArray(arr)) { + return arr; + } + return arr.map((el) => exports2.cloneArrays(el)); + }; + exports2.omit = function omit(obj, keys) { + if (keys == null) { + return Object.assign({}, obj); + } + if (!Array.isArray(keys)) { + keys = [keys]; + } + const ret = Object.assign({}, obj); + for (const key of keys) { + delete ret[key]; + } + return ret; + }; + exports2.clonePOJOsAndArrays = function clonePOJOsAndArrays(val) { + if (val == null) { + return val; + } + if (val.$__ != null) { + return val; + } + if (isPOJO(val)) { + val = { ...val }; + for (const key of Object.keys(val)) { + val[key] = exports2.clonePOJOsAndArrays(val[key]); + } + return val; + } + if (Array.isArray(val)) { + val = [...val]; + for (let i4 = 0; i4 < val.length; ++i4) { + val[i4] = exports2.clonePOJOsAndArrays(val[i4]); + } + return val; + } + return val; + }; + exports2.merge = function merge(to, from, options, path) { + options = options || {}; + const keys = Object.keys(from); + let i4 = 0; + const len = keys.length; + let key; + if (from[trustedSymbol]) { + to[trustedSymbol] = from[trustedSymbol]; + } + path = path || ""; + const omitNested = options.omitNested || {}; + while (i4 < len) { + key = keys[i4++]; + if (options.omit && options.omit[key]) { + continue; + } + if (omitNested[path]) { + continue; + } + if (specialProperties.has(key)) { + continue; + } + if (to[key] == null) { + to[key] = exports2.clonePOJOsAndArrays(from[key]); + } else if (exports2.isObject(from[key])) { + if (!exports2.isObject(to[key])) { + to[key] = {}; + } + if (from[key] != null) { + if (options.isDiscriminatorSchemaMerge && (from[key].$isSingleNested && to[key].$isMongooseDocumentArray) || from[key].$isMongooseDocumentArray && to[key].$isSingleNested) { + continue; + } else if (from[key].instanceOfSchema) { + if (to[key].instanceOfSchema) { + schemaMerge(to[key], from[key].clone(), options.isDiscriminatorSchemaMerge); + } else { + to[key] = from[key].clone(); + } + continue; + } else if (isBsonType(from[key], "ObjectId")) { + to[key] = new ObjectId2(from[key]); + continue; + } + } + merge(to[key], from[key], options, path ? path + "." + key : key); + } else if (options.overwrite) { + to[key] = from[key]; + } + } + return to; + }; + exports2.toObject = function toObject(obj) { + Document || (Document = require_document2()); + let ret; + if (obj == null) { + return obj; + } + if (obj instanceof Document) { + return obj.toObject(); + } + if (Array.isArray(obj)) { + ret = []; + for (const doc of obj) { + ret.push(toObject(doc)); + } + return ret; + } + if (exports2.isPOJO(obj)) { + ret = {}; + if (obj[trustedSymbol]) { + ret[trustedSymbol] = obj[trustedSymbol]; + } + for (const k4 of Object.keys(obj)) { + if (specialProperties.has(k4)) { + continue; + } + ret[k4] = toObject(obj[k4]); + } + return ret; + } + return obj; + }; + exports2.isObject = isObject; + exports2.isPOJO = require_isPOJO(); + exports2.isNonBuiltinObject = function isNonBuiltinObject(val) { + return typeof val === "object" && !exports2.isNativeObject(val) && !exports2.isMongooseType(val) && !(val instanceof UUID) && val != null; + }; + exports2.isNativeObject = function(arg) { + return Array.isArray(arg) || arg instanceof Date || arg instanceof Boolean || arg instanceof Number || arg instanceof String; + }; + exports2.isEmptyObject = function(val) { + return val != null && typeof val === "object" && Object.keys(val).length === 0; + }; + exports2.hasKey = function hasKey(obj, key) { + const props = Object.keys(obj); + for (const prop of props) { + if (prop === key) { + return true; + } + if (exports2.isPOJO(obj[prop]) && exports2.hasKey(obj[prop], key)) { + return true; + } + } + return false; + }; + exports2.tick = function tick(callback) { + if (typeof callback !== "function") { + return; + } + return function() { + try { + callback.apply(this, arguments); + } catch (err) { + immediate(function() { + throw err; + }); + } + }; + }; + exports2.isMongooseType = function(v4) { + return isBsonType(v4, "ObjectId") || isBsonType(v4, "Decimal128") || v4 instanceof Buffer; + }; + exports2.isMongooseObject = isMongooseObject; + exports2.expires = function expires(object) { + if (!(object && object.constructor.name === "Object")) { + return; + } + if (!("expires" in object)) { + return; + } + object.expireAfterSeconds = typeof object.expires !== "string" ? object.expires : Math.round(ms(object.expires) / 1e3); + delete object.expires; + }; + exports2.populate = function populate(path, select, model, match, options, subPopulate, justOne, count) { + let obj = null; + if (arguments.length === 1) { + if (path instanceof PopulateOptions) { + path._docs = {}; + path._childDocs = []; + return [path]; + } + if (Array.isArray(path)) { + const singles = makeSingles(path); + return singles.map((o4) => exports2.populate(o4)[0]); + } + if (exports2.isObject(path)) { + obj = Object.assign({}, path); + } else { + obj = { path }; + } + } else if (typeof model === "object") { + obj = { + path, + select, + match: model, + options: match + }; + } else { + obj = { + path, + select, + model, + match, + options, + populate: subPopulate, + justOne, + count + }; + } + if (typeof obj.path !== "string" && !(Array.isArray(obj.path) && obj.path.every((el) => typeof el === "string"))) { + throw new TypeError("utils.populate: invalid path. Expected string or array of strings. Got typeof `" + typeof path + "`"); + } + return _populateObj(obj); + function makeSingles(arr) { + const ret = []; + arr.forEach(function(obj2) { + if (oneSpaceRE.test(obj2.path)) { + const paths = obj2.path.split(manySpaceRE); + paths.forEach(function(p4) { + const copy = Object.assign({}, obj2); + copy.path = p4; + ret.push(copy); + }); + } else { + ret.push(obj2); + } + }); + return ret; + } + }; + function _populateObj(obj) { + if (Array.isArray(obj.populate)) { + const ret2 = []; + obj.populate.forEach(function(obj2) { + if (oneSpaceRE.test(obj2.path)) { + const copy = Object.assign({}, obj2); + const paths2 = copy.path.split(manySpaceRE); + paths2.forEach(function(p4) { + copy.path = p4; + ret2.push(exports2.populate(copy)[0]); + }); + } else { + ret2.push(exports2.populate(obj2)[0]); + } + }); + obj.populate = exports2.populate(ret2); + } else if (obj.populate != null && typeof obj.populate === "object") { + obj.populate = exports2.populate(obj.populate); + } + const ret = []; + const paths = oneSpaceRE.test(obj.path) ? obj.path.split(manySpaceRE) : Array.isArray(obj.path) ? obj.path : [obj.path]; + if (obj.options != null) { + obj.options = clone(obj.options); + } + for (const path of paths) { + ret.push(new PopulateOptions(Object.assign({}, obj, { path }))); + } + return ret; + } + exports2.getValue = function(path, obj, map2) { + return mpath.get(path, obj, getValueLookup, map2); + }; + var mapGetterOptions = Object.freeze({ getters: false }); + function getValueLookup(obj, part) { + if (part === "$*" && obj instanceof Map) { + return obj; + } + let _from = obj?._doc || obj; + if (_from != null && _from.isMongooseArrayProxy) { + _from = _from.__array; + } + return _from instanceof Map ? _from.get(part, mapGetterOptions) : _from[part]; + } + exports2.setValue = function(path, val, obj, map2, _copying) { + mpath.set(path, val, obj, "_doc", map2, _copying); + }; + exports2.object = {}; + exports2.object.vals = function vals(o4) { + const keys = Object.keys(o4); + let i4 = keys.length; + const ret = []; + while (i4--) { + ret.push(o4[keys[i4]]); + } + return ret; + }; + exports2.isNullOrUndefined = function(val) { + return val === null || val === void 0; + }; + exports2.array = {}; + exports2.array.flatten = function flatten(arr, filter, ret) { + ret || (ret = []); + arr.forEach(function(item) { + if (Array.isArray(item)) { + flatten(item, filter, ret); + } else { + if (!filter || filter(item)) { + ret.push(item); + } + } + }); + return ret; + }; + exports2.hasUserDefinedProperty = function(obj, key) { + if (obj == null) { + return false; + } + if (Array.isArray(key)) { + for (const k4 of key) { + if (exports2.hasUserDefinedProperty(obj, k4)) { + return true; + } + } + return false; + } + if (Object.hasOwn(obj, key)) { + return true; + } + if (typeof obj === "object" && key in obj) { + const v4 = obj[key]; + return v4 !== Object.prototype[key] && v4 !== Array.prototype[key]; + } + return false; + }; + var MAX_ARRAY_INDEX = Math.pow(2, 32) - 1; + exports2.isArrayIndex = function(val) { + if (typeof val === "number") { + return val >= 0 && val <= MAX_ARRAY_INDEX; + } + if (typeof val === "string") { + if (!/^\d+$/.test(val)) { + return false; + } + val = +val; + return val >= 0 && val <= MAX_ARRAY_INDEX; + } + return false; + }; + exports2.array.unique = function(arr) { + const primitives = /* @__PURE__ */ new Set(); + const ids = /* @__PURE__ */ new Set(); + const ret = []; + for (const item of arr) { + if (typeof item === "number" || typeof item === "string" || item == null) { + if (primitives.has(item)) { + continue; + } + ret.push(item); + primitives.add(item); + } else if (isBsonType(item, "ObjectId")) { + if (ids.has(item.toString())) { + continue; + } + ret.push(item); + ids.add(item.toString()); + } else { + ret.push(item); + } + } + return ret; + }; + exports2.buffer = {}; + exports2.buffer.areEqual = function(a4, b4) { + if (!Buffer.isBuffer(a4)) { + return false; + } + if (!Buffer.isBuffer(b4)) { + return false; + } + if (a4.length !== b4.length) { + return false; + } + for (let i4 = 0, len = a4.length; i4 < len; ++i4) { + if (a4[i4] !== b4[i4]) { + return false; + } + } + return true; + }; + exports2.getFunctionName = getFunctionName; + exports2.decorate = function(destination, source) { + for (const key in source) { + if (specialProperties.has(key)) { + continue; + } + destination[key] = source[key]; + } + }; + exports2.mergeClone = function(to, fromObj) { + if (isMongooseObject(fromObj)) { + fromObj = fromObj.toObject({ + transform: false, + virtuals: false, + depopulate: true, + getters: false, + flattenDecimals: false + }); + } + const keys = Object.keys(fromObj); + const len = keys.length; + let i4 = 0; + let key; + while (i4 < len) { + key = keys[i4++]; + if (specialProperties.has(key)) { + continue; + } + if (typeof to[key] === "undefined") { + to[key] = clone(fromObj[key], { + transform: false, + virtuals: false, + depopulate: true, + getters: false, + flattenDecimals: false + }); + } else { + let val = fromObj[key]; + if (val != null && val.valueOf && !(val instanceof Date)) { + val = val.valueOf(); + } + if (exports2.isObject(val)) { + let obj = val; + if (isMongooseObject(val) && !val.isMongooseBuffer) { + obj = obj.toObject({ + transform: false, + virtuals: false, + depopulate: true, + getters: false, + flattenDecimals: false + }); + } + if (val.isMongooseBuffer) { + obj = Buffer.from(obj); + } + exports2.mergeClone(to[key], obj); + } else { + to[key] = clone(val, { + flattenDecimals: false + }); + } + } + } + }; + exports2.each = function(arr, fn2) { + for (const item of arr) { + fn2(item); + } + }; + exports2.renameObjKey = function(oldObj, oldKey, newKey) { + const keys = Object.keys(oldObj); + return keys.reduce( + (acc, val) => { + if (val === oldKey) { + acc[newKey] = oldObj[oldKey]; + } else { + acc[val] = oldObj[val]; + } + return acc; + }, + {} + ); + }; + exports2.getOption = function(name) { + const sources = Array.prototype.slice.call(arguments, 1); + for (const source of sources) { + if (source == null) { + continue; + } + if (source[name] != null) { + return source[name]; + } + } + return null; + }; + exports2.noop = function() { + }; + exports2.errorToPOJO = function errorToPOJO(error2) { + const isError = error2 instanceof Error; + if (!isError) { + throw new Error("`error` must be `instanceof Error`."); + } + const ret = {}; + for (const properyName of Object.getOwnPropertyNames(error2)) { + ret[properyName] = error2[properyName]; + } + return ret; + }; + exports2.warn = function warn(message2) { + return process.emitWarning(message2, { code: "MONGOOSE" }); + }; + exports2.injectTimestampsOption = function injectTimestampsOption(writeOperation, timestampsOption) { + if (timestampsOption == null) { + return; + } + writeOperation.timestamps = timestampsOption; + }; + } +}); + +// node_modules/mongoose/lib/schemaType.js +var require_schemaType = __commonJS({ + "node_modules/mongoose/lib/schemaType.js"(exports2, module2) { + "use strict"; + var MongooseError = require_error2(); + var SchemaTypeOptions = require_schemaTypeOptions(); + var $exists = require_exists(); + var $type = require_type(); + var clone = require_clone(); + var handleImmutable = require_handleImmutable(); + var isAsyncFunction = require_isAsyncFunction(); + var isSimpleValidator = require_isSimpleValidator(); + var immediate = require_immediate(); + var schemaTypeSymbol = require_symbols().schemaTypeSymbol; + var utils = require_utils6(); + var validatorErrorSymbol = require_symbols().validatorErrorSymbol; + var documentIsModified = require_symbols().documentIsModified; + var populateModelSymbol = require_symbols().populateModelSymbol; + var CastError = MongooseError.CastError; + var ValidatorError = MongooseError.ValidatorError; + var setOptionsForDefaults = { _skipMarkModified: true }; + function SchemaType(path, options, instance, parentSchema) { + this[schemaTypeSymbol] = true; + this.path = path; + this.instance = instance; + this.schemaName = this.constructor.schemaName; + this.validators = []; + this.getters = Object.hasOwn(this.constructor, "getters") ? this.constructor.getters.slice() : []; + this.setters = Object.hasOwn(this.constructor, "setters") ? this.constructor.setters.slice() : []; + this.splitPath(); + options = options || {}; + const defaultOptions = this.constructor.defaultOptions || {}; + const defaultOptionsKeys = Object.keys(defaultOptions); + for (const option of defaultOptionsKeys) { + if (option === "validate") { + this.validate(defaultOptions.validate); + } else if (Object.hasOwn(defaultOptions, option) && !Object.hasOwn(options, option)) { + options[option] = defaultOptions[option]; + } + } + if (options.select == null) { + delete options.select; + } + const Options = this.OptionsConstructor || SchemaTypeOptions; + this.options = new Options(options); + this.parentSchema = parentSchema; + this._index = null; + if (utils.hasUserDefinedProperty(this.options, "immutable")) { + this.$immutable = this.options.immutable; + handleImmutable(this); + } + const keys = Object.keys(this.options); + for (const prop of keys) { + if (prop === "cast") { + if (Array.isArray(this.options[prop])) { + this.castFunction.apply(this, this.options[prop]); + } else { + this.castFunction(this.options[prop]); + } + continue; + } + if (utils.hasUserDefinedProperty(this.options, prop) && typeof this[prop] === "function") { + if (prop === "index" && this._index) { + if (options.index === false) { + const index = this._index; + if (typeof index === "object" && index != null) { + if (index.unique) { + throw new Error('Path "' + this.path + '" may not have `index` set to false and `unique` set to true'); + } + if (index.sparse) { + throw new Error('Path "' + this.path + '" may not have `index` set to false and `sparse` set to true'); + } + } + this._index = false; + } + continue; + } + const val = options[prop]; + if (prop === "default") { + this.default(val); + continue; + } + const opts = Array.isArray(val) ? val : [val]; + this[prop].apply(this, opts); + } + } + Object.defineProperty(this, "$$context", { + enumerable: false, + configurable: false, + writable: true, + value: null + }); + } + SchemaType.prototype.OptionsConstructor = SchemaTypeOptions; + SchemaType.prototype.path; + SchemaType.prototype.toJSON = function toJSON() { + const res = { ...this }; + delete res.parentSchema; + return res; + }; + SchemaType.prototype.validators; + SchemaType.prototype.isRequired; + SchemaType.prototype.splitPath = function() { + if (this._presplitPath != null) { + return this._presplitPath; + } + if (this.path == null) { + return void 0; + } + this._presplitPath = this.path.indexOf(".") === -1 ? [this.path] : this.path.split("."); + return this._presplitPath; + }; + SchemaType.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = (v4) => v4; + } + this._cast = caster; + return this._cast; + }; + SchemaType.prototype.castFunction = function castFunction(caster, message2) { + if (arguments.length === 0) { + return this._castFunction; + } + if (caster === false) { + caster = this.constructor._defaultCaster || ((v4) => v4); + } + if (typeof caster === "string") { + this._castErrorMessage = caster; + return this._castFunction; + } + if (caster != null) { + this._castFunction = caster; + } + if (message2 != null) { + this._castErrorMessage = message2; + } + return this._castFunction; + }; + SchemaType.prototype.cast = function cast() { + throw new Error("Base SchemaType class does not implement a `cast()` function"); + }; + SchemaType.set = function set(option, value) { + if (!Object.hasOwn(this, "defaultOptions")) { + this.defaultOptions = Object.assign({}, this.defaultOptions); + } + this.defaultOptions[option] = value; + }; + SchemaType.get = function(getter) { + this.getters = Object.hasOwn(this, "getters") ? this.getters : []; + this.getters.push(getter); + }; + SchemaType.prototype.default = function(val) { + if (arguments.length === 1) { + if (val === void 0) { + this.defaultValue = void 0; + return void 0; + } + if (val != null && val.instanceOfSchema) { + throw new MongooseError("Cannot set default value of path `" + this.path + "` to a mongoose Schema instance."); + } + this.defaultValue = val; + return this.defaultValue; + } else if (arguments.length > 1) { + this.defaultValue = [...arguments]; + } + return this.defaultValue; + }; + SchemaType.prototype.index = function(options) { + this._index = options; + utils.expires(this._index); + return this; + }; + SchemaType.prototype.unique = function unique(value, message2) { + if (this._index === false) { + if (!value) { + return; + } + throw new Error('Path "' + this.path + '" may not have `index` set to false and `unique` set to true'); + } + if (!Object.hasOwn(this.options, "index") && value === false) { + return this; + } + if (this._index == null || this._index === true) { + this._index = {}; + } else if (typeof this._index === "string") { + this._index = { type: this._index }; + } + this._index.unique = !!value; + if (typeof message2 === "string") { + this._duplicateKeyErrorMessage = message2; + } + return this; + }; + SchemaType.prototype.text = function(bool) { + if (this._index === false) { + if (!bool) { + return this; + } + throw new Error('Path "' + this.path + '" may not have `index` set to false and `text` set to true'); + } + if (!Object.hasOwn(this.options, "index") && bool === false) { + return this; + } + if (this._index === null || this._index === void 0 || typeof this._index === "boolean") { + this._index = {}; + } else if (typeof this._index === "string") { + this._index = { type: this._index }; + } + this._index.text = bool; + return this; + }; + SchemaType.prototype.sparse = function(bool) { + if (this._index === false) { + if (!bool) { + return this; + } + throw new Error('Path "' + this.path + '" may not have `index` set to false and `sparse` set to true'); + } + if (!Object.hasOwn(this.options, "index") && bool === false) { + return this; + } + if (this._index == null || typeof this._index === "boolean") { + this._index = {}; + } else if (typeof this._index === "string") { + this._index = { type: this._index }; + } + this._index.sparse = bool; + return this; + }; + SchemaType.prototype.immutable = function(bool) { + this.$immutable = bool; + handleImmutable(this); + return this; + }; + SchemaType.prototype.transform = function(fn2) { + this.options.transform = fn2; + return this; + }; + SchemaType.prototype.set = function(fn2) { + if (typeof fn2 !== "function") { + throw new TypeError("A setter must be a function."); + } + this.setters.push(fn2); + return this; + }; + SchemaType.prototype.get = function(fn2) { + if (typeof fn2 !== "function") { + throw new TypeError("A getter must be a function."); + } + this.getters.push(fn2); + return this; + }; + SchemaType.prototype.validateAll = function(validators) { + for (let i4 = 0; i4 < validators.length; i4++) { + this.validate(validators[i4]); + } + return this; + }; + SchemaType.prototype.validate = function(obj, message2, type) { + if (typeof obj === "function" || obj && utils.getFunctionName(obj.constructor) === "RegExp") { + let properties; + if (typeof message2 === "function") { + properties = { validator: obj, message: message2 }; + properties.type = type || "user defined"; + } else if (message2 instanceof Object && !type) { + properties = isSimpleValidator(message2) ? Object.assign({}, message2) : clone(message2); + if (!properties.message) { + properties.message = properties.msg; + } + properties.validator = obj; + properties.type = properties.type || "user defined"; + } else { + if (message2 == null) { + message2 = MongooseError.messages.general.default; + } + if (!type) { + type = "user defined"; + } + properties = { message: message2, type, validator: obj }; + } + this.validators.push(properties); + return this; + } + let i4; + let length; + let arg; + for (i4 = 0, length = arguments.length; i4 < length; i4++) { + arg = arguments[i4]; + if (!utils.isPOJO(arg)) { + const msg = "Invalid validator. Received (" + typeof arg + ") " + arg + ". See https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.validate()"; + throw new Error(msg); + } + this.validate(arg.validator, arg); + } + return this; + }; + SchemaType.prototype.required = function(required, message2) { + let customOptions = {}; + if (arguments.length > 0 && required == null) { + this.validators = this.validators.filter(function(v4) { + return v4.validator !== this.requiredValidator; + }, this); + this.isRequired = false; + delete this.originalRequiredValue; + return this; + } + if (typeof required === "object") { + customOptions = required; + message2 = customOptions.message || message2; + required = required.isRequired; + } + if (required === false) { + this.validators = this.validators.filter(function(v4) { + return v4.validator !== this.requiredValidator; + }, this); + this.isRequired = false; + delete this.originalRequiredValue; + return this; + } + const _this = this; + this.isRequired = true; + this.requiredValidator = function(v4) { + const cachedRequired = this && this.$__ && this.$__.cachedRequired; + if (cachedRequired != null && !this.$__isSelected(_this.path) && !this[documentIsModified](_this.path)) { + return true; + } + if (cachedRequired != null && _this.path in cachedRequired) { + const res = cachedRequired[_this.path] ? _this.checkRequired(v4, this) : true; + delete cachedRequired[_this.path]; + return res; + } else if (typeof required === "function") { + return required.apply(this) ? _this.checkRequired(v4, this) : true; + } + return _this.checkRequired(v4, this); + }; + this.originalRequiredValue = required; + if (typeof required === "string") { + message2 = required; + required = void 0; + } + const msg = message2 || MongooseError.messages.general.required; + this.validators.unshift(Object.assign({}, customOptions, { + validator: this.requiredValidator, + message: msg, + type: "required" + })); + return this; + }; + SchemaType.prototype.ref = function(ref) { + this.options.ref = ref; + return this; + }; + SchemaType.prototype.getDefault = function(scope, init, options) { + let ret; + if (this.defaultValue == null) { + return this.defaultValue; + } + if (typeof this.defaultValue === "function") { + if (this.defaultValue === Date.now || this.defaultValue === Array || this.defaultValue.name.toLowerCase() === "objectid") { + ret = this.defaultValue.call(scope); + } else { + ret = this.defaultValue.call(scope, scope); + } + } else { + ret = this.defaultValue; + } + if (ret !== null && ret !== void 0) { + if (typeof ret === "object" && (!this.options || !this.options.shared)) { + ret = clone(ret); + } + if (options && options.skipCast) { + return this._applySetters(ret, scope); + } + const casted = this.applySetters(ret, scope, init, void 0, setOptionsForDefaults); + if (casted && !Array.isArray(casted) && casted.$isSingleNested) { + casted.$__parent = scope; + } + return casted; + } + return ret; + }; + SchemaType.prototype._applySetters = function(value, scope, init, priorVal, options) { + let v4 = value; + if (init) { + return v4; + } + const setters = this.setters; + for (let i4 = setters.length - 1; i4 >= 0; i4--) { + v4 = setters[i4].call(scope, v4, priorVal, this, options); + } + return v4; + }; + SchemaType.prototype._castNullish = function _castNullish(v4) { + return v4; + }; + SchemaType.prototype.applySetters = function(value, scope, init, priorVal, options) { + let v4 = this._applySetters(value, scope, init, priorVal, options); + if (v4 == null) { + return this._castNullish(v4); + } + v4 = this.cast(v4, scope, init, priorVal, options); + return v4; + }; + SchemaType.prototype.applyGetters = function(value, scope) { + let v4 = value; + const getters = this.getters; + const len = getters.length; + if (len === 0) { + return v4; + } + for (let i4 = 0; i4 < len; ++i4) { + v4 = getters[i4].call(scope, v4, this); + } + return v4; + }; + SchemaType.prototype.select = function select(val) { + this.selected = !!val; + return this; + }; + SchemaType.prototype.doValidate = function(value, fn2, scope, options) { + let err = false; + const path = this.path; + if (typeof fn2 !== "function") { + throw new TypeError(`Must pass callback function to doValidate(), got ${typeof fn2}`); + } + const validators = this.validators.filter((v4) => typeof v4 === "object" && v4 !== null); + let count = validators.length; + if (!count) { + return fn2(null); + } + for (let i4 = 0, len = validators.length; i4 < len; ++i4) { + if (err) { + break; + } + const v4 = validators[i4]; + const validator = v4.validator; + let ok; + const validatorProperties = isSimpleValidator(v4) ? Object.assign({}, v4) : clone(v4); + validatorProperties.path = options && options.path ? options.path : path; + validatorProperties.fullPath = this.$fullPath; + validatorProperties.value = value; + if (typeof value === "string") { + validatorProperties.length = value.length; + if (validatorProperties.value.length > 30) { + validatorProperties.value = validatorProperties.value.slice(0, 30) + "..."; + } + } + if (validator instanceof RegExp) { + validate(validator.test(value), validatorProperties, scope); + continue; + } + if (typeof validator !== "function") { + continue; + } + if (value === void 0 && validator !== this.requiredValidator) { + validate(true, validatorProperties, scope); + continue; + } + try { + if (validatorProperties.propsParameter) { + ok = validator.call(scope, value, validatorProperties); + } else { + ok = validator.call(scope, value); + } + } catch (error2) { + ok = false; + validatorProperties.reason = error2; + if (error2.message) { + validatorProperties.message = error2.message; + } + } + if (ok != null && typeof ok.then === "function") { + ok.then( + function(ok2) { + validate(ok2, validatorProperties, scope); + }, + function(error2) { + validatorProperties.reason = error2; + validatorProperties.message = error2.message; + ok = false; + validate(ok, validatorProperties, scope); + } + ); + } else { + validate(ok, validatorProperties, scope); + } + } + function validate(ok, validatorProperties, scope2) { + if (err) { + return; + } + if (ok === void 0 || ok) { + if (--count <= 0) { + immediate(function() { + fn2(null); + }); + } + } else { + const ErrorConstructor = validatorProperties.ErrorConstructor || ValidatorError; + err = new ErrorConstructor(validatorProperties, scope2); + err[validatorErrorSymbol] = true; + immediate(function() { + fn2(err); + }); + } + } + }; + function _validate(ok, validatorProperties) { + if (ok !== void 0 && !ok) { + const ErrorConstructor = validatorProperties.ErrorConstructor || ValidatorError; + const err = new ErrorConstructor(validatorProperties); + err[validatorErrorSymbol] = true; + return err; + } + } + SchemaType.prototype.doValidateSync = function(value, scope, options) { + const path = this.path; + const count = this.validators.length; + if (!count) { + return null; + } + let validators = this.validators; + if (value === void 0) { + if (this.validators.length !== 0 && this.validators[0].type === "required") { + validators = [this.validators[0]]; + } else { + return null; + } + } + let err = null; + let i4 = 0; + const len = validators.length; + for (i4 = 0; i4 < len; ++i4) { + const v4 = validators[i4]; + if (v4 === null || typeof v4 !== "object") { + continue; + } + const validator = v4.validator; + const validatorProperties = isSimpleValidator(v4) ? Object.assign({}, v4) : clone(v4); + validatorProperties.path = options && options.path ? options.path : path; + validatorProperties.fullPath = this.$fullPath; + validatorProperties.value = value; + if (typeof value === "string") { + validatorProperties.length = value.length; + if (validatorProperties.value.length > 30) { + validatorProperties.value = validatorProperties.value.slice(0, 30) + "..."; + } + } + let ok = false; + if (isAsyncFunction(validator)) { + continue; + } + if (validator instanceof RegExp) { + err = _validate(validator.test(value), validatorProperties); + continue; + } + if (typeof validator !== "function") { + continue; + } + try { + if (validatorProperties.propsParameter) { + ok = validator.call(scope, value, validatorProperties); + } else { + ok = validator.call(scope, value); + } + } catch (error2) { + ok = false; + validatorProperties.reason = error2; + } + if (ok != null && typeof ok.then === "function") { + continue; + } + err = _validate(ok, validatorProperties); + if (err) { + break; + } + } + return err; + }; + SchemaType._isRef = function(self2, value, doc, init) { + let ref = init && self2.options && (self2.options.ref || self2.options.refPath); + if (!ref && doc && doc.$__ != null) { + const path = doc.$__fullPath(self2.path, true); + const owner = doc.ownerDocument(); + ref = path != null && owner.$populated(path) || doc.$populated(self2.path); + } + if (ref) { + if (value == null) { + return true; + } + if (!Buffer.isBuffer(value) && // buffers are objects too + value._bsontype !== "Binary" && utils.isObject(value)) { + return true; + } + return init; + } + return false; + }; + SchemaType.prototype._castRef = function _castRef(value, doc, init, options) { + if (value == null) { + return value; + } + if (value.$__ != null) { + value.$__.wasPopulated = value.$__.wasPopulated || { value: value._doc._id }; + return value; + } + if (Buffer.isBuffer(value) || !utils.isObject(value)) { + if (init) { + return value; + } + throw new CastError(this.instance, value, this.path, null, this); + } + const path = doc.$__fullPath(this.path, true); + const owner = doc.ownerDocument(); + const pop = owner.$populated(path, true); + let ret = value; + if (!doc.$__.populated || !doc.$__.populated[path] || !doc.$__.populated[path].options || !doc.$__.populated[path].options.options || !doc.$__.populated[path].options.options.lean) { + const PopulatedModel = pop ? pop.options[populateModelSymbol] : doc.constructor.db.model(this.options.ref); + ret = PopulatedModel.hydrate(value, null, options); + ret.$__.wasPopulated = { value: ret._doc._id, options: { [populateModelSymbol]: PopulatedModel } }; + } + return ret; + }; + function handleSingle(val, context) { + return this.castForQuery(null, val, context); + } + function handleArray(val, context) { + const _this = this; + if (!Array.isArray(val)) { + return [this.castForQuery(null, val, context)]; + } + return val.map(function(m4) { + return _this.castForQuery(null, m4, context); + }); + } + function handle$in(val, context) { + const _this = this; + if (!Array.isArray(val)) { + return [this.castForQuery(null, val, context)]; + } + return val.map(function(m4) { + if (Array.isArray(m4) && m4.length === 0) { + return m4; + } + return _this.castForQuery(null, m4, context); + }); + } + SchemaType.prototype.$conditionalHandlers = { + $all: handleArray, + $eq: handleSingle, + $in: handle$in, + $ne: handleSingle, + $nin: handle$in, + $exists, + $type + }; + SchemaType.prototype.castForQuery = function($conditional, val, context) { + let handler2; + if ($conditional != null) { + handler2 = this.$conditionalHandlers[$conditional]; + if (!handler2) { + throw new Error("Can't use " + $conditional); + } + return handler2.call(this, val, context); + } + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } + }; + SchemaType.checkRequired = function(fn2) { + if (arguments.length !== 0) { + this._checkRequired = fn2; + } + return this._checkRequired; + }; + SchemaType.prototype.checkRequired = function(val) { + return val != null; + }; + SchemaType.prototype.clone = function() { + const options = Object.assign({}, this.options); + const schematype = new this.constructor(this.path, options, this.instance, this.parentSchema); + schematype.validators = this.validators.slice(); + if (this.requiredValidator !== void 0) schematype.requiredValidator = this.requiredValidator; + if (this.defaultValue !== void 0) schematype.defaultValue = this.defaultValue; + if (this.$immutable !== void 0 && this.options.immutable === void 0) { + schematype.$immutable = this.$immutable; + handleImmutable(schematype); + } + if (this._index !== void 0) schematype._index = this._index; + if (this.selected !== void 0) schematype.selected = this.selected; + if (this.isRequired !== void 0) schematype.isRequired = this.isRequired; + if (this.originalRequiredValue !== void 0) schematype.originalRequiredValue = this.originalRequiredValue; + schematype.getters = this.getters.slice(); + schematype.setters = this.setters.slice(); + return schematype; + }; + SchemaType.prototype.getEmbeddedSchemaType = function getEmbeddedSchemaType() { + return this.$embeddedSchemaType; + }; + SchemaType.prototype._duplicateKeyErrorMessage = null; + SchemaType.prototype.toJSONSchema = function toJSONSchema(_options) { + throw new Error(`Converting unsupported SchemaType to JSON Schema: ${this.instance} at path "${this.path}"`); + }; + SchemaType.prototype.autoEncryptionType = function autoEncryptionType() { + return null; + }; + module2.exports = exports2 = SchemaType; + exports2.CastError = CastError; + exports2.ValidatorError = ValidatorError; + } +}); + +// node_modules/mongoose/lib/options/virtualOptions.js +var require_virtualOptions = __commonJS({ + "node_modules/mongoose/lib/options/virtualOptions.js"(exports2, module2) { + "use strict"; + var opts = require_propertyOptions(); + var VirtualOptions = class { + constructor(obj) { + Object.assign(this, obj); + if (obj != null && obj.options != null) { + this.options = Object.assign({}, obj.options); + } + } + }; + Object.defineProperty(VirtualOptions.prototype, "ref", opts); + Object.defineProperty(VirtualOptions.prototype, "refPath", opts); + Object.defineProperty(VirtualOptions.prototype, "localField", opts); + Object.defineProperty(VirtualOptions.prototype, "foreignField", opts); + Object.defineProperty(VirtualOptions.prototype, "justOne", opts); + Object.defineProperty(VirtualOptions.prototype, "count", opts); + Object.defineProperty(VirtualOptions.prototype, "match", opts); + Object.defineProperty(VirtualOptions.prototype, "options", opts); + Object.defineProperty(VirtualOptions.prototype, "skip", opts); + Object.defineProperty(VirtualOptions.prototype, "limit", opts); + Object.defineProperty(VirtualOptions.prototype, "perDocumentLimit", opts); + module2.exports = VirtualOptions; + } +}); + +// node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js +var require_lookupLocalFields = __commonJS({ + "node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js"(exports2, module2) { + "use strict"; + module2.exports = function lookupLocalFields(cur, path, val) { + if (cur == null) { + return cur; + } + if (cur._doc != null) { + cur = cur._doc; + } + if (arguments.length >= 3) { + if (typeof cur !== "object") { + return void 0; + } + if (val === void 0) { + return void 0; + } + if (cur instanceof Map) { + cur.set(path, val); + } else { + cur[path] = val; + } + return val; + } + if (path === "$*") { + return cur instanceof Map ? Array.from(cur.values()) : Object.keys(cur).map((key) => cur[key]); + } + if (cur instanceof Map) { + return cur.get(path); + } + return cur[path]; + }; + } +}); + +// node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js +var require_modelNamesFromRefPath = __commonJS({ + "node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var isPathExcluded = require_isPathExcluded(); + var lookupLocalFields = require_lookupLocalFields(); + var mpath = require_mpath(); + var util = require("util"); + var utils = require_utils6(); + var hasNumericPropRE = /(\.\d+$|\.\d+\.)/g; + module2.exports = function modelNamesFromRefPath(refPath, doc, populatedPath, modelSchema, queryProjection) { + if (refPath == null) { + return []; + } + if (typeof refPath === "string" && queryProjection != null && isPathExcluded(queryProjection, refPath)) { + throw new MongooseError("refPath `" + refPath + "` must not be excluded in projection, got " + util.inspect(queryProjection)); + } + if (hasNumericPropRE.test(populatedPath)) { + const chunks = populatedPath.split(hasNumericPropRE); + if (chunks[chunks.length - 1] === "") { + throw new Error("Can't populate individual element in an array"); + } + let _refPath = ""; + let _remaining = refPath; + for (let i4 = 0; i4 < chunks.length; i4 += 2) { + const chunk = chunks[i4]; + if (_remaining.startsWith(chunk + ".")) { + _refPath += _remaining.substring(0, chunk.length) + chunks[i4 + 1]; + _remaining = _remaining.substring(chunk.length + 1); + } else if (i4 === chunks.length - 1) { + _refPath += _remaining; + _remaining = ""; + break; + } else { + throw new Error("Could not normalize ref path, chunk " + chunk + " not in populated path"); + } + } + const refValue2 = mpath.get(_refPath, doc, lookupLocalFields); + let modelNames2 = Array.isArray(refValue2) ? refValue2 : [refValue2]; + modelNames2 = utils.array.flatten(modelNames2); + return modelNames2; + } + const refValue = mpath.get(refPath, doc, lookupLocalFields); + let modelNames; + if (modelSchema != null && Object.hasOwn(modelSchema.virtuals, refPath)) { + modelNames = [modelSchema.virtuals[refPath].applyGetters(void 0, doc)]; + } else { + modelNames = Array.isArray(refValue) ? refValue : [refValue]; + } + return modelNames; + }; + } +}); + +// node_modules/mongoose/lib/virtualType.js +var require_virtualType = __commonJS({ + "node_modules/mongoose/lib/virtualType.js"(exports2, module2) { + "use strict"; + var modelNamesFromRefPath = require_modelNamesFromRefPath(); + var utils = require_utils6(); + var modelSymbol = require_symbols().modelSymbol; + function VirtualType(options, name) { + this.path = name; + this.getters = []; + this.setters = []; + this.options = Object.assign({}, options); + } + VirtualType.prototype._applyDefaultGetters = function() { + if (this.getters.length > 0 || this.setters.length > 0) { + return; + } + const path = this.path; + const internalProperty = "$" + path; + this.getters.push(function() { + return this.$locals[internalProperty]; + }); + this.setters.push(function(v4) { + this.$locals[internalProperty] = v4; + }); + }; + VirtualType.prototype.clone = function() { + const clone = new VirtualType(this.options, this.path); + clone.getters = [].concat(this.getters); + clone.setters = [].concat(this.setters); + return clone; + }; + VirtualType.prototype.get = function(fn2) { + this.getters.push(fn2); + return this; + }; + VirtualType.prototype.set = function(fn2) { + this.setters.push(fn2); + return this; + }; + VirtualType.prototype.applyGetters = function(value, doc) { + if (utils.hasUserDefinedProperty(this.options, ["ref", "refPath"]) && doc.$$populatedVirtuals && Object.hasOwn(doc.$$populatedVirtuals, this.path)) { + value = doc.$$populatedVirtuals[this.path]; + } + let v4 = value; + for (const getter of this.getters) { + v4 = getter.call(doc, v4, this, doc); + } + return v4; + }; + VirtualType.prototype.applySetters = function(value, doc) { + let v4 = value; + for (const setter of this.setters) { + v4 = setter.call(doc, v4, this, doc); + } + return v4; + }; + VirtualType.prototype._getModelNamesForPopulate = function _getModelNamesForPopulate(doc) { + if (this.options.refPath) { + return modelNamesFromRefPath(this.options.refPath, doc, this.path); + } + let normalizedRef = null; + if (typeof this.options.ref === "function" && !this.options.ref[modelSymbol]) { + normalizedRef = this.options.ref.call(doc, doc); + } else { + normalizedRef = this.options.ref; + } + if (normalizedRef != null && !Array.isArray(normalizedRef)) { + return [normalizedRef]; + } + return normalizedRef; + }; + module2.exports = VirtualType; + } +}); + +// node_modules/mongoose/lib/helpers/schema/addAutoId.js +var require_addAutoId = __commonJS({ + "node_modules/mongoose/lib/helpers/schema/addAutoId.js"(exports2, module2) { + "use strict"; + module2.exports = function addAutoId(schema) { + const _obj = { _id: { auto: true } }; + _obj._id[schema.options.typeKey] = "ObjectId"; + schema.add(_obj); + }; + } +}); + +// node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js +var require_decorateDiscriminatorIndexOptions = __commonJS({ + "node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js"(exports2, module2) { + "use strict"; + module2.exports = function decorateDiscriminatorIndexOptions(schema, indexOptions) { + const discriminatorName = schema.discriminatorMapping && schema.discriminatorMapping.value; + if (discriminatorName && !("sparse" in indexOptions)) { + const discriminatorKey = schema.options.discriminatorKey; + indexOptions.partialFilterExpression = indexOptions.partialFilterExpression || {}; + indexOptions.partialFilterExpression[discriminatorKey] = discriminatorName; + } + return indexOptions; + }; + } +}); + +// node_modules/mongoose/lib/helpers/schema/getIndexes.js +var require_getIndexes = __commonJS({ + "node_modules/mongoose/lib/helpers/schema/getIndexes.js"(exports2, module2) { + "use strict"; + var get2 = require_get(); + var helperIsObject = require_isObject(); + var decorateDiscriminatorIndexOptions = require_decorateDiscriminatorIndexOptions(); + module2.exports = function getIndexes(schema) { + let indexes = []; + const schemaStack = /* @__PURE__ */ new WeakMap(); + const indexTypes = schema.constructor.indexTypes; + const indexByName = /* @__PURE__ */ new Map(); + collectIndexes(schema); + return indexes; + function collectIndexes(schema2, prefix, baseSchema) { + if (schemaStack.has(schema2)) { + return; + } + schemaStack.set(schema2, true); + prefix = prefix || ""; + const keys = Object.keys(schema2.paths); + for (const key of keys) { + const path = schema2.paths[key]; + if (baseSchema != null && baseSchema.paths[key]) { + continue; + } + if (path._duplicateKeyErrorMessage != null) { + schema2._duplicateKeyErrorMessagesByPath = schema2._duplicateKeyErrorMessagesByPath || {}; + schema2._duplicateKeyErrorMessagesByPath[key] = path._duplicateKeyErrorMessage; + } + if (path.$isMongooseDocumentArray || path.$isSingleNested) { + if (get2(path, "options.excludeIndexes") !== true && get2(path, "schemaOptions.excludeIndexes") !== true && get2(path, "schema.options.excludeIndexes") !== true) { + collectIndexes(path.schema, prefix + key + "."); + } + if (path.schema.discriminators != null) { + const discriminators = path.schema.discriminators; + const discriminatorKeys = Object.keys(discriminators); + for (const discriminatorKey of discriminatorKeys) { + collectIndexes( + discriminators[discriminatorKey], + prefix + key + ".", + path.schema + ); + } + } + if (path.$isMongooseDocumentArray) { + continue; + } + } + const index = path._index || path.caster && path.caster._index; + if (index !== false && index !== null && index !== void 0) { + const field = {}; + const isObject = helperIsObject(index); + const options = isObject ? { ...index } : {}; + const type = typeof index === "string" ? index : isObject ? index.type : false; + if (type && indexTypes.indexOf(type) !== -1) { + field[prefix + key] = type; + } else if (options.text) { + field[prefix + key] = "text"; + delete options.text; + } else { + let isDescendingIndex = false; + if (index === "descending" || index === "desc") { + isDescendingIndex = true; + } else if (index === "ascending" || index === "asc") { + isDescendingIndex = false; + } else { + isDescendingIndex = Number(index) === -1; + } + field[prefix + key] = isDescendingIndex ? -1 : 1; + } + delete options.type; + if (!("background" in options)) { + options.background = true; + } + if (schema2.options.autoIndex != null) { + options._autoIndex = schema2.options.autoIndex; + } + const indexName = options && options.name; + if (typeof indexName === "string") { + if (indexByName.has(indexName)) { + Object.assign(indexByName.get(indexName), field); + } else { + indexes.push([field, options]); + indexByName.set(indexName, field); + } + } else { + indexes.push([field, options]); + indexByName.set(indexName, field); + } + } + } + schemaStack.delete(schema2); + if (prefix) { + fixSubIndexPaths(schema2, prefix); + } else { + schema2._indexes.forEach(function(index) { + const options = index[1]; + if (!("background" in options)) { + options.background = true; + } + decorateDiscriminatorIndexOptions(schema2, options); + }); + indexes = indexes.concat(schema2._indexes); + } + } + function fixSubIndexPaths(schema2, prefix) { + const subindexes = schema2._indexes; + const len = subindexes.length; + for (let i4 = 0; i4 < len; ++i4) { + const indexObj = subindexes[i4][0]; + const indexOptions = subindexes[i4][1]; + const keys = Object.keys(indexObj); + const klen = keys.length; + const newindex = {}; + for (let j4 = 0; j4 < klen; ++j4) { + const key = keys[j4]; + newindex[prefix + key] = indexObj[key]; + } + const newIndexOptions = Object.assign({}, indexOptions); + if (indexOptions != null && indexOptions.partialFilterExpression != null) { + newIndexOptions.partialFilterExpression = {}; + const partialFilterExpression = indexOptions.partialFilterExpression; + for (const key of Object.keys(partialFilterExpression)) { + newIndexOptions.partialFilterExpression[prefix + key] = partialFilterExpression[key]; + } + } + indexes.push([newindex, newIndexOptions]); + } + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/query/handleReadPreferenceAliases.js +var require_handleReadPreferenceAliases = __commonJS({ + "node_modules/mongoose/lib/helpers/query/handleReadPreferenceAliases.js"(exports2, module2) { + "use strict"; + module2.exports = function handleReadPreferenceAliases(pref) { + switch (pref) { + case "p": + pref = "primary"; + break; + case "pp": + pref = "primaryPreferred"; + break; + case "s": + pref = "secondary"; + break; + case "sp": + pref = "secondaryPreferred"; + break; + case "n": + pref = "nearest"; + break; + } + return pref; + }; + } +}); + +// node_modules/mongoose/lib/helpers/schema/idGetter.js +var require_idGetter = __commonJS({ + "node_modules/mongoose/lib/helpers/schema/idGetter.js"(exports2, module2) { + "use strict"; + module2.exports = function addIdGetter(schema) { + const autoIdGetter = !schema.paths["id"] && schema.paths["_id"] && schema.options.id; + if (!autoIdGetter) { + return schema; + } + if (schema.aliases && schema.aliases.id) { + return schema; + } + schema.virtual("id").get(idGetter); + return schema; + }; + function idGetter() { + if (this._id != null) { + return this._id.toString(); + } + return null; + } + } +}); + +// node_modules/mongoose/lib/helpers/indexes/isIndexSpecEqual.js +var require_isIndexSpecEqual = __commonJS({ + "node_modules/mongoose/lib/helpers/indexes/isIndexSpecEqual.js"(exports2, module2) { + "use strict"; + module2.exports = function isIndexSpecEqual(spec1, spec2) { + const spec1Keys = Object.keys(spec1); + const spec2Keys = Object.keys(spec2); + if (spec1Keys.length !== spec2Keys.length) { + return false; + } + for (let i4 = 0; i4 < spec1Keys.length; i4++) { + const key = spec1Keys[i4]; + if (key !== spec2Keys[i4] || spec1[key] !== spec2[key]) { + return false; + } + } + return true; + }; + } +}); + +// node_modules/mongoose/lib/helpers/populate/setPopulatedVirtualValue.js +var require_setPopulatedVirtualValue = __commonJS({ + "node_modules/mongoose/lib/helpers/populate/setPopulatedVirtualValue.js"(exports2, module2) { + "use strict"; + module2.exports = function setPopulatedVirtualValue(populatedVirtuals, name, v4, options) { + if (options.justOne || options.count) { + populatedVirtuals[name] = Array.isArray(v4) ? v4[0] : v4; + if (typeof populatedVirtuals[name] !== "object") { + populatedVirtuals[name] = options.count ? v4 : null; + } + } else { + populatedVirtuals[name] = Array.isArray(v4) ? v4 : v4 == null ? [] : [v4]; + populatedVirtuals[name] = populatedVirtuals[name].filter(function(doc) { + return doc && typeof doc === "object"; + }); + } + return populatedVirtuals[name]; + }; + } +}); + +// node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js +var require_cleanPositionalOperators = __commonJS({ + "node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js"(exports2, module2) { + "use strict"; + module2.exports = function cleanPositionalOperators(path) { + return path.replace(/\.\$(\[[^\]]*\])?(?=\.)/g, ".0").replace(/\.\$(\[[^\]]*\])?$/g, ".0"); + }; + } +}); + +// node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js +var require_handleTimestampOption = __commonJS({ + "node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js"(exports2, module2) { + "use strict"; + module2.exports = handleTimestampOption; + function handleTimestampOption(arg, prop) { + if (arg == null) { + return null; + } + if (typeof arg === "boolean") { + return prop; + } + if (typeof arg[prop] === "boolean") { + return arg[prop] ? prop : null; + } + if (!(prop in arg)) { + return prop; + } + return arg[prop]; + } + } +}); + +// node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js +var require_applyTimestampsToChildren = __commonJS({ + "node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js"(exports2, module2) { + "use strict"; + var cleanPositionalOperators = require_cleanPositionalOperators(); + var handleTimestampOption = require_handleTimestampOption(); + module2.exports = applyTimestampsToChildren; + function applyTimestampsToChildren(now, update, schema) { + if (update == null) { + return; + } + const keys = Object.keys(update); + const hasDollarKey = keys.some((key) => key[0] === "$"); + if (hasDollarKey) { + if (update.$push) { + _applyTimestampToUpdateOperator(update.$push); + } + if (update.$addToSet) { + _applyTimestampToUpdateOperator(update.$addToSet); + } + if (update.$set != null) { + const keys2 = Object.keys(update.$set); + for (const key of keys2) { + applyTimestampsToUpdateKey(schema, key, update.$set, now); + } + } + if (update.$setOnInsert != null) { + const keys2 = Object.keys(update.$setOnInsert); + for (const key of keys2) { + applyTimestampsToUpdateKey(schema, key, update.$setOnInsert, now); + } + } + } + const updateKeys = Object.keys(update).filter((key) => key[0] !== "$"); + for (const key of updateKeys) { + applyTimestampsToUpdateKey(schema, key, update, now); + } + function _applyTimestampToUpdateOperator(op2) { + for (const key of Object.keys(op2)) { + const $path = schema.path(key.replace(/\.\$\./i, ".").replace(/.\$$/, "")); + if (op2[key] && $path && $path.$isMongooseDocumentArray && $path.schema.options.timestamps) { + const timestamps = $path.schema.options.timestamps; + const createdAt = handleTimestampOption(timestamps, "createdAt"); + const updatedAt = handleTimestampOption(timestamps, "updatedAt"); + if (op2[key].$each) { + op2[key].$each.forEach(function(subdoc) { + if (updatedAt != null) { + subdoc[updatedAt] = now; + } + if (createdAt != null) { + subdoc[createdAt] = now; + } + applyTimestampsToChildren(now, subdoc, $path.schema); + }); + } else { + if (updatedAt != null) { + op2[key][updatedAt] = now; + } + if (createdAt != null) { + op2[key][createdAt] = now; + } + applyTimestampsToChildren(now, op2[key], $path.schema); + } + } + } + } + } + function applyTimestampsToDocumentArray(arr, schematype, now) { + const timestamps = schematype.schema.options.timestamps; + const len = arr.length; + if (!timestamps) { + for (let i4 = 0; i4 < len; ++i4) { + applyTimestampsToChildren(now, arr[i4], schematype.schema); + } + return; + } + const createdAt = handleTimestampOption(timestamps, "createdAt"); + const updatedAt = handleTimestampOption(timestamps, "updatedAt"); + for (let i4 = 0; i4 < len; ++i4) { + if (updatedAt != null) { + arr[i4][updatedAt] = now; + } + if (createdAt != null) { + arr[i4][createdAt] = now; + } + applyTimestampsToChildren(now, arr[i4], schematype.schema); + } + } + function applyTimestampsToSingleNested(subdoc, schematype, now) { + const timestamps = schematype.schema.options.timestamps; + if (!timestamps) { + applyTimestampsToChildren(now, subdoc, schematype.schema); + return; + } + const createdAt = handleTimestampOption(timestamps, "createdAt"); + const updatedAt = handleTimestampOption(timestamps, "updatedAt"); + if (updatedAt != null) { + subdoc[updatedAt] = now; + } + if (createdAt != null) { + subdoc[createdAt] = now; + } + applyTimestampsToChildren(now, subdoc, schematype.schema); + } + function applyTimestampsToUpdateKey(schema, key, update, now) { + const keyToSearch = cleanPositionalOperators(key); + const path = schema.path(keyToSearch); + if (!path) { + return; + } + const parentSchemaTypes = []; + const pieces = keyToSearch.split("."); + for (let i4 = pieces.length - 1; i4 > 0; --i4) { + const s4 = schema.path(pieces.slice(0, i4).join(".")); + if (s4 != null && (s4.$isMongooseDocumentArray || s4.$isSingleNested)) { + parentSchemaTypes.push({ parentPath: key.split(".").slice(0, i4).join("."), parentSchemaType: s4 }); + } + } + if (Array.isArray(update[key]) && path.$isMongooseDocumentArray) { + applyTimestampsToDocumentArray(update[key], path, now); + } else if (update[key] && path.$isSingleNested) { + applyTimestampsToSingleNested(update[key], path, now); + } else if (parentSchemaTypes.length > 0) { + for (const item of parentSchemaTypes) { + const parentPath = item.parentPath; + const parentSchemaType = item.parentSchemaType; + const timestamps = parentSchemaType.schema.options.timestamps; + const updatedAt = handleTimestampOption(timestamps, "updatedAt"); + if (!timestamps || updatedAt == null) { + continue; + } + if (parentSchemaType.$isSingleNested) { + update[parentPath + "." + updatedAt] = now; + } else if (parentSchemaType.$isMongooseDocumentArray) { + let childPath = key.substring(parentPath.length + 1); + if (/^\d+$/.test(childPath)) { + update[parentPath + "." + childPath][updatedAt] = now; + continue; + } + const firstDot = childPath.indexOf("."); + childPath = firstDot !== -1 ? childPath.substring(0, firstDot) : childPath; + update[parentPath + "." + childPath + "." + updatedAt] = now; + } + } + } else if (path.schema != null && path.schema != schema && update[key]) { + const timestamps = path.schema.options.timestamps; + const createdAt = handleTimestampOption(timestamps, "createdAt"); + const updatedAt = handleTimestampOption(timestamps, "updatedAt"); + if (!timestamps) { + return; + } + if (updatedAt != null) { + update[key][updatedAt] = now; + } + if (createdAt != null) { + update[key][createdAt] = now; + } + } + } + } +}); + +// node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js +var require_applyTimestampsToUpdate = __commonJS({ + "node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js"(exports2, module2) { + "use strict"; + var get2 = require_get(); + module2.exports = applyTimestampsToUpdate; + function applyTimestampsToUpdate(now, createdAt, updatedAt, currentUpdate, options, isReplace) { + const updates = currentUpdate; + let _updates = updates; + const timestamps = get2(options, "timestamps", true); + if (!timestamps || updates == null) { + return currentUpdate; + } + const skipCreatedAt = timestamps != null && timestamps.createdAt === false; + const skipUpdatedAt = timestamps != null && timestamps.updatedAt === false; + if (isReplace) { + if (currentUpdate && currentUpdate.$set) { + currentUpdate = currentUpdate.$set; + updates.$set = {}; + _updates = updates.$set; + } + if (!skipUpdatedAt && updatedAt && !currentUpdate[updatedAt]) { + _updates[updatedAt] = now; + } + if (!skipCreatedAt && createdAt && !currentUpdate[createdAt]) { + _updates[createdAt] = now; + } + return updates; + } + currentUpdate = currentUpdate || {}; + if (Array.isArray(updates)) { + if (updatedAt == null) { + return updates; + } + updates.push({ $set: { [updatedAt]: now } }); + return updates; + } + updates.$set = updates.$set || {}; + if (!skipUpdatedAt && updatedAt && (!currentUpdate.$currentDate || !currentUpdate.$currentDate[updatedAt])) { + let timestampSet = false; + if (updatedAt.indexOf(".") !== -1) { + const pieces = updatedAt.split("."); + for (let i4 = 1; i4 < pieces.length; ++i4) { + const remnant = pieces.slice(-i4).join("."); + const start = pieces.slice(0, -i4).join("."); + if (currentUpdate[start] != null) { + currentUpdate[start][remnant] = now; + timestampSet = true; + break; + } else if (currentUpdate.$set && currentUpdate.$set[start]) { + currentUpdate.$set[start][remnant] = now; + timestampSet = true; + break; + } + } + } + if (!timestampSet) { + updates.$set[updatedAt] = now; + } + if (Object.hasOwn(updates, updatedAt)) { + delete updates[updatedAt]; + } + } + if (!skipCreatedAt && createdAt) { + const overwriteImmutable = get2(options, "overwriteImmutable", false); + const hasUserCreatedAt = currentUpdate[createdAt] != null || currentUpdate?.$set[createdAt] != null; + if (overwriteImmutable && hasUserCreatedAt) { + if (currentUpdate[createdAt] != null) { + updates.$set[createdAt] = currentUpdate[createdAt]; + delete currentUpdate[createdAt]; + } + } else { + if (currentUpdate[createdAt]) { + delete currentUpdate[createdAt]; + } + if (currentUpdate.$set && currentUpdate.$set[createdAt]) { + delete currentUpdate.$set[createdAt]; + } + let timestampSet = false; + if (createdAt.indexOf(".") !== -1) { + const pieces = createdAt.split("."); + for (let i4 = 1; i4 < pieces.length; ++i4) { + const remnant = pieces.slice(-i4).join("."); + const start = pieces.slice(0, -i4).join("."); + if (currentUpdate[start] != null) { + currentUpdate[start][remnant] = now; + timestampSet = true; + break; + } else if (currentUpdate.$set && currentUpdate.$set[start]) { + currentUpdate.$set[start][remnant] = now; + timestampSet = true; + break; + } + } + } + if (!timestampSet) { + updates.$setOnInsert = updates.$setOnInsert || {}; + updates.$setOnInsert[createdAt] = now; + } + } + } + if (Object.keys(updates.$set).length === 0) { + delete updates.$set; + } + return updates; + } + } +}); + +// node_modules/mongoose/lib/helpers/timestamps/setDocumentTimestamps.js +var require_setDocumentTimestamps = __commonJS({ + "node_modules/mongoose/lib/helpers/timestamps/setDocumentTimestamps.js"(exports2, module2) { + "use strict"; + module2.exports = function setDocumentTimestamps(doc, timestampOption, currentTime, createdAt, updatedAt) { + const skipUpdatedAt = timestampOption != null && timestampOption.updatedAt === false; + const skipCreatedAt = timestampOption != null && timestampOption.createdAt === false; + const defaultTimestamp = currentTime != null ? currentTime() : doc.ownerDocument().constructor.base.now(); + if (!skipCreatedAt && (doc.isNew || doc.$isSubdocument) && createdAt && !doc.$__getValue(createdAt) && doc.$__isSelected(createdAt)) { + doc.$set(createdAt, defaultTimestamp, void 0, { overwriteImmutable: true }); + } + if (!skipUpdatedAt && updatedAt && (doc.isNew || doc.$isModified())) { + let ts = defaultTimestamp; + if (doc.isNew && createdAt != null) { + ts = doc.$__getValue(createdAt); + } + doc.$set(updatedAt, ts); + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js +var require_setupTimestamps = __commonJS({ + "node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js"(exports2, module2) { + "use strict"; + var applyTimestampsToChildren = require_applyTimestampsToChildren(); + var applyTimestampsToUpdate = require_applyTimestampsToUpdate(); + var get2 = require_get(); + var handleTimestampOption = require_handleTimestampOption(); + var setDocumentTimestamps = require_setDocumentTimestamps(); + var symbols = require_symbols2(); + var replaceOps = /* @__PURE__ */ new Set([ + "replaceOne", + "findOneAndReplace" + ]); + module2.exports = function setupTimestamps(schema, timestamps) { + const childHasTimestamp = schema.childSchemas.find(withTimestamp); + function withTimestamp(s4) { + const ts = s4.schema.options.timestamps; + return !!ts; + } + if (!timestamps && !childHasTimestamp) { + return; + } + const createdAt = handleTimestampOption(timestamps, "createdAt"); + const updatedAt = handleTimestampOption(timestamps, "updatedAt"); + const currentTime = timestamps != null && Object.hasOwn(timestamps, "currentTime") ? timestamps.currentTime : null; + const schemaAdditions = {}; + schema.$timestamps = { createdAt, updatedAt }; + if (createdAt && !schema.paths[createdAt]) { + const baseImmutableCreatedAt = schema.base != null ? schema.base.get("timestamps.createdAt.immutable") : null; + const immutable = baseImmutableCreatedAt != null ? baseImmutableCreatedAt : true; + schemaAdditions[createdAt] = { [schema.options.typeKey || "type"]: Date, immutable }; + } + if (updatedAt && !schema.paths[updatedAt]) { + schemaAdditions[updatedAt] = Date; + } + schema.add(schemaAdditions); + schema.pre("save", function timestampsPreSave(next) { + const timestampOption = get2(this, "$__.saveOptions.timestamps"); + if (timestampOption === false) { + return next(); + } + setDocumentTimestamps(this, timestampOption, currentTime, createdAt, updatedAt); + next(); + }); + schema.methods.initializeTimestamps = function() { + const ts = currentTime != null ? currentTime() : this.constructor.base.now(); + if (createdAt && !this.get(createdAt)) { + this.$set(createdAt, ts); + } + if (updatedAt && !this.get(updatedAt)) { + this.$set(updatedAt, ts); + } + if (this.$isSubdocument) { + return this; + } + const subdocs = this.$getAllSubdocs(); + for (const subdoc of subdocs) { + if (subdoc.initializeTimestamps) { + subdoc.initializeTimestamps(); + } + } + return this; + }; + _setTimestampsOnUpdate[symbols.builtInMiddleware] = true; + const opts = { query: true, model: false }; + schema.pre("findOneAndReplace", opts, _setTimestampsOnUpdate); + schema.pre("findOneAndUpdate", opts, _setTimestampsOnUpdate); + schema.pre("replaceOne", opts, _setTimestampsOnUpdate); + schema.pre("update", opts, _setTimestampsOnUpdate); + schema.pre("updateOne", opts, _setTimestampsOnUpdate); + schema.pre("updateMany", opts, _setTimestampsOnUpdate); + function _setTimestampsOnUpdate(next) { + const now = currentTime != null ? currentTime() : this.model.base.now(); + if (replaceOps.has(this.op) && this.getUpdate() == null) { + this.setUpdate({}); + } + applyTimestampsToUpdate( + now, + createdAt, + updatedAt, + this.getUpdate(), + this._mongooseOptions, + replaceOps.has(this.op) + ); + applyTimestampsToChildren(now, this.getUpdate(), this.model.schema); + next(); + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/populate/validateRef.js +var require_validateRef = __commonJS({ + "node_modules/mongoose/lib/helpers/populate/validateRef.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var util = require("util"); + module2.exports = validateRef; + function validateRef(ref, path) { + if (typeof ref === "string") { + return; + } + if (typeof ref === "function") { + return; + } + throw new MongooseError('Invalid ref at path "' + path + '". Got ' + util.inspect(ref, { depth: 0 })); + } + } +}); + +// node_modules/mongoose/lib/constants.js +var require_constants6 = __commonJS({ + "node_modules/mongoose/lib/constants.js"(exports2) { + "use strict"; + var queryOperations = Object.freeze([ + // Read + "countDocuments", + "distinct", + "estimatedDocumentCount", + "find", + "findOne", + // Update + "findOneAndReplace", + "findOneAndUpdate", + "replaceOne", + "updateMany", + "updateOne", + // Delete + "deleteMany", + "deleteOne", + "findOneAndDelete" + ]); + exports2.queryOperations = queryOperations; + var queryMiddlewareFunctions = queryOperations.concat([ + "validate" + ]); + exports2.queryMiddlewareFunctions = queryMiddlewareFunctions; + var aggregateMiddlewareFunctions = [ + "aggregate" + ]; + exports2.aggregateMiddlewareFunctions = aggregateMiddlewareFunctions; + var modelMiddlewareFunctions = [ + "bulkWrite", + "createCollection", + "insertMany" + ]; + exports2.modelMiddlewareFunctions = modelMiddlewareFunctions; + var documentMiddlewareFunctions = [ + "validate", + "save", + "remove", + "updateOne", + "deleteOne", + "init" + ]; + exports2.documentMiddlewareFunctions = documentMiddlewareFunctions; + } +}); + +// node_modules/mongoose/lib/helpers/model/applyHooks.js +var require_applyHooks = __commonJS({ + "node_modules/mongoose/lib/helpers/model/applyHooks.js"(exports2, module2) { + "use strict"; + var symbols = require_symbols2(); + var promiseOrCallback = require_promiseOrCallback(); + module2.exports = applyHooks; + applyHooks.middlewareFunctions = [ + "deleteOne", + "save", + "validate", + "remove", + "updateOne", + "init" + ]; + var alreadyHookedFunctions = new Set(applyHooks.middlewareFunctions.flatMap((fn2) => [fn2, `$__${fn2}`])); + function applyHooks(model, schema, options) { + options = options || {}; + const kareemOptions = { + useErrorHandlers: true, + numCallbackParams: 1, + nullResultByDefault: true, + contextParameter: true + }; + const objToDecorate = options.decorateDoc ? model : model.prototype; + model.$appliedHooks = true; + for (const key of Object.keys(schema.paths)) { + const type = schema.paths[key]; + let childModel = null; + if (type.$isSingleNested) { + childModel = type.caster; + } else if (type.$isMongooseDocumentArray) { + childModel = type.Constructor; + } else { + continue; + } + if (childModel.$appliedHooks) { + continue; + } + applyHooks(childModel, type.schema, { ...options, isChildSchema: true }); + if (childModel.discriminators != null) { + const keys = Object.keys(childModel.discriminators); + for (const key2 of keys) { + applyHooks( + childModel.discriminators[key2], + childModel.discriminators[key2].schema, + options + ); + } + } + } + const middleware = schema.s.hooks.filter((hook) => { + if (hook.name === "updateOne" || hook.name === "deleteOne") { + return !!hook["document"]; + } + if (hook.name === "remove" || hook.name === "init") { + return hook["document"] == null || !!hook["document"]; + } + if (hook.query != null || hook.document != null) { + return hook.document !== false; + } + return true; + }).filter((hook) => { + if (schema.methods[hook.name]) { + return !hook.fn[symbols.builtInMiddleware]; + } + return true; + }); + model._middleware = middleware; + objToDecorate.$__originalValidate = objToDecorate.$__originalValidate || objToDecorate.$__validate; + const internalMethodsToWrap = options && options.isChildSchema ? ["save", "validate", "deleteOne"] : ["save", "validate"]; + for (const method of internalMethodsToWrap) { + const toWrap = method === "validate" ? "$__originalValidate" : `$__${method}`; + const wrapped = middleware.createWrapper(method, objToDecorate[toWrap], null, kareemOptions); + objToDecorate[`$__${method}`] = wrapped; + } + objToDecorate.$__init = middleware.createWrapperSync("init", objToDecorate.$__init, null, kareemOptions); + const customMethods = Object.keys(schema.methods); + const customMethodOptions = Object.assign({}, kareemOptions, { + // Only use `checkForPromise` for custom methods, because mongoose + // query thunks are not as consistent as I would like about returning + // a nullish value rather than the query. If a query thunk returns + // a query, `checkForPromise` causes infinite recursion + checkForPromise: true + }); + for (const method of customMethods) { + if (alreadyHookedFunctions.has(method)) { + continue; + } + if (!middleware.hasHooks(method)) { + continue; + } + const originalMethod = objToDecorate[method]; + objToDecorate[method] = function() { + const args2 = Array.prototype.slice.call(arguments); + const cb = args2.slice(-1).pop(); + const argsWithoutCallback = typeof cb === "function" ? args2.slice(0, args2.length - 1) : args2; + return promiseOrCallback(cb, (callback) => { + return this[`$__${method}`].apply( + this, + argsWithoutCallback.concat([callback]) + ); + }, model.events); + }; + objToDecorate[`$__${method}`] = middleware.createWrapper(method, originalMethod, null, customMethodOptions); + } + } + } +}); + +// node_modules/mongoose/lib/types/double.js +var require_double = __commonJS({ + "node_modules/mongoose/lib/types/double.js"(exports2, module2) { + "use strict"; + module2.exports = require_bson().Double; + } +}); + +// node_modules/mongoose/lib/types/map.js +var require_map = __commonJS({ + "node_modules/mongoose/lib/types/map.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var clone = require_clone(); + var deepEqual = require_utils6().deepEqual; + var getConstructorName = require_getConstructorName(); + var handleSpreadDoc = require_handleSpreadDoc(); + var util = require("util"); + var specialProperties = require_specialProperties(); + var isBsonType = require_isBsonType(); + var cleanModifiedSubpaths = require_cleanModifiedSubpaths(); + var populateModelSymbol = require_symbols().populateModelSymbol; + var MongooseMap = class extends Map { + constructor(v4, path, doc, schemaType, options) { + if (getConstructorName(v4) === "Object") { + v4 = Object.keys(v4).reduce((arr, key) => arr.concat([[key, v4[key]]]), []); + } + super(v4); + this.$__parent = doc != null && doc.$__ != null ? doc : null; + if (this.$__parent?.$isSingleNested && this.$__parent.$basePath) { + this.$__path = this.$__parent.$basePath + "." + path; + this.$__pathRelativeToParent = path; + } else if (options?.path) { + this.$__path = options.path; + this.$__pathRelativeToParent = null; + } else { + this.$__path = path; + this.$__pathRelativeToParent = null; + } + this.$__schemaType = schemaType; + this.$__runDeferred(); + } + $init(key, value) { + checkValidKey(key); + super.set(key, value); + if (value != null && value.$isSingleNested) { + value.$basePath = this.$__path + "." + key; + if (this.$__pathRelativeToParent != null) { + value.$pathRelativeToParent = this.$__pathRelativeToParent + "." + key; + } else { + value.$pathRelativeToParent = this.$__path + "." + key; + } + } + } + $__set(key, value) { + super.set(key, value); + } + /** + * Overwrites native Map's `get()` function to support Mongoose getters. + * + * @api public + * @method get + * @memberOf Map + */ + get(key, options) { + if (isBsonType(key, "ObjectId")) { + key = key.toString(); + } + options = options || {}; + if (options.getters === false) { + return super.get(key); + } + return this.$__schemaType.applyGetters(super.get(key), this.$__parent); + } + /** + * Overwrites native Map's `set()` function to support setters, `populate()`, + * and change tracking. Note that Mongoose maps _only_ support strings and + * ObjectIds as keys. + * + * Keys also cannot: + * - be named after special properties `prototype`, `constructor`, and `__proto__` + * - start with a dollar sign (`$`) + * - contain any dots (`.`) + * + * #### Example: + * + * doc.myMap.set('test', 42); // works + * doc.myMap.set({ obj: 42 }, 42); // Throws "Mongoose maps only support string keys" + * doc.myMap.set(10, 42); // Throws "Mongoose maps only support string keys" + * doc.myMap.set("$test", 42); // Throws "Mongoose maps do not support keys that start with "$", got "$test"" + * + * @api public + * @method set + * @memberOf Map + */ + set(key, value) { + if (isBsonType(key, "ObjectId")) { + key = key.toString(); + } + checkValidKey(key); + value = handleSpreadDoc(value); + if (this.$__schemaType == null) { + this.$__deferred = this.$__deferred || []; + this.$__deferred.push({ key, value }); + return; + } + let _fullPath; + const parent = this.$__parent; + const populated = parent != null && parent.$__ && parent.$__.populated ? parent.$populated(fullPath.call(this), true) || parent.$populated(this.$__path, true) : null; + const priorVal = this.get(key); + if (populated != null) { + if (this.$__schemaType.$isSingleNested) { + throw new MongooseError( + `Cannot manually populate single nested subdoc underneath Map at path "${this.$__path}". Try using an array instead of a Map.` + ); + } + if (Array.isArray(value) && this.$__schemaType.$isMongooseArray) { + value = value.map((v4) => { + if (v4.$__ == null) { + v4 = new populated.options[populateModelSymbol](v4); + } + v4.$__.wasPopulated = { value: v4._doc._id }; + return v4; + }); + } else if (value != null) { + if (value.$__ == null) { + value = new populated.options[populateModelSymbol](value); + } + value.$__.wasPopulated = { value: value._doc._id }; + } + } else { + try { + let options = null; + if (this.$__schemaType.$isMongooseDocumentArray || this.$__schemaType.$isSingleNested || this.$__schemaType.$isMongooseArray || this.$__schemaType.$isSchemaMap) { + options = { path: fullPath.call(this) }; + if (this.$__schemaType.$isSingleNested) { + options.pathRelativeToParent = this.$__pathRelativeToParent != null ? this.$__pathRelativeToParent + "." + key : this.$__path + "." + key; + } + } + value = this.$__schemaType.applySetters( + value, + this.$__parent, + false, + this.get(key), + options + ); + } catch (error2) { + if (this.$__parent != null && this.$__parent.$__ != null) { + this.$__parent.invalidate(fullPath.call(this), error2); + return; + } + throw error2; + } + } + super.set(key, value); + if (value != null && value.$isSingleNested) { + if (this.$__pathRelativeToParent != null) { + value.$pathRelativeToParent = this.$__pathRelativeToParent + "." + key; + } else { + value.$pathRelativeToParent = this.$__path + "." + key; + } + } + if (parent != null && parent.$__ != null && !deepEqual(value, priorVal)) { + let pathToMark; + if (this.$__pathRelativeToParent != null) { + pathToMark = this.$__pathRelativeToParent + "." + key; + } else { + pathToMark = fullPath.call(this); + } + parent.markModified(pathToMark); + if (this.$__schemaType.$isMongooseDocumentArray || this.$__schemaType.$isSingleNested) { + cleanModifiedSubpaths(parent, pathToMark); + } + } + function fullPath() { + if (_fullPath) { + return _fullPath; + } + _fullPath = this.$__path + "." + key; + return _fullPath; + } + } + /** + * Overwrites native Map's `clear()` function to support change tracking. + * + * @api public + * @method clear + * @memberOf Map + */ + clear() { + super.clear(); + const parent = this.$__parent; + if (parent != null) { + parent.markModified(this.$__path); + } + } + /** + * Overwrites native Map's `delete()` function to support change tracking. + * + * @api public + * @method delete + * @memberOf Map + */ + delete(key) { + if (isBsonType(key, "ObjectId")) { + key = key.toString(); + } + this.set(key, void 0); + return super.delete(key); + } + /** + * Converts this map to a native JavaScript Map so the MongoDB driver can serialize it. + * + * @api public + * @method toBSON + * @memberOf Map + */ + toBSON() { + return new Map(this); + } + toObject(options) { + if (options && options.flattenMaps) { + const ret = {}; + const keys = this.keys(); + for (const key of keys) { + ret[key] = clone(this.get(key), options); + } + return ret; + } + return new Map(this); + } + $toObject() { + return this.constructor.prototype.toObject.apply(this, arguments); + } + /** + * Converts this map to a native JavaScript Map for `JSON.stringify()`. Set + * the `flattenMaps` option to convert this map to a POJO instead. + * + * #### Example: + * + * doc.myMap.toJSON() instanceof Map; // true + * doc.myMap.toJSON({ flattenMaps: true }) instanceof Map; // false + * + * @api public + * @method toJSON + * @param {Object} [options] + * @param {Boolean} [options.flattenMaps=false] set to `true` to convert the map to a POJO rather than a native JavaScript map + * @memberOf Map + */ + toJSON(options) { + if (typeof (options && options.flattenMaps) === "boolean" ? options.flattenMaps : true) { + const ret = {}; + const keys = this.keys(); + for (const key of keys) { + ret[key] = clone(this.get(key), options); + } + return ret; + } + return new Map(this); + } + inspect() { + return new Map(this); + } + $__runDeferred() { + if (!this.$__deferred) { + return; + } + for (const keyValueObject of this.$__deferred) { + this.set(keyValueObject.key, keyValueObject.value); + } + this.$__deferred = null; + } + }; + if (util.inspect.custom) { + Object.defineProperty(MongooseMap.prototype, util.inspect.custom, { + enumerable: false, + writable: false, + configurable: false, + value: MongooseMap.prototype.inspect + }); + } + Object.defineProperty(MongooseMap.prototype, "$__set", { + enumerable: false, + writable: true, + configurable: false + }); + Object.defineProperty(MongooseMap.prototype, "$__parent", { + enumerable: false, + writable: true, + configurable: false + }); + Object.defineProperty(MongooseMap.prototype, "$__path", { + enumerable: false, + writable: true, + configurable: false + }); + Object.defineProperty(MongooseMap.prototype, "$__schemaType", { + enumerable: false, + writable: true, + configurable: false + }); + Object.defineProperty(MongooseMap.prototype, "$isMongooseMap", { + enumerable: false, + writable: false, + configurable: false, + value: true + }); + Object.defineProperty(MongooseMap.prototype, "$__deferredCalls", { + enumerable: false, + writable: false, + configurable: false, + value: true + }); + function checkValidKey(key) { + const keyType = typeof key; + if (keyType !== "string") { + throw new TypeError(`Mongoose maps only support string keys, got ${keyType}`); + } + if (key.startsWith("$")) { + throw new Error(`Mongoose maps do not support keys that start with "$", got "${key}"`); + } + if (key.includes(".")) { + throw new Error(`Mongoose maps do not support keys that contain ".", got "${key}"`); + } + if (specialProperties.has(key)) { + throw new Error(`Mongoose maps do not support reserved key name "${key}"`); + } + } + module2.exports = MongooseMap; + } +}); + +// node_modules/mongoose/lib/types/uuid.js +var require_uuid = __commonJS({ + "node_modules/mongoose/lib/types/uuid.js"(exports2, module2) { + "use strict"; + module2.exports = require_bson().UUID; + } +}); + +// node_modules/mongoose/lib/types/index.js +var require_types2 = __commonJS({ + "node_modules/mongoose/lib/types/index.js"(exports2) { + "use strict"; + exports2.Array = require_array(); + exports2.Buffer = require_buffer(); + exports2.Document = // @deprecate + exports2.Embedded = require_arraySubdocument(); + exports2.DocumentArray = require_documentArray(); + exports2.Double = require_double(); + exports2.Decimal128 = require_decimal128(); + exports2.ObjectId = require_objectid(); + exports2.Map = require_map(); + exports2.Subdocument = require_subdocument(); + exports2.UUID = require_uuid(); + } +}); + +// node_modules/mongoose/lib/options/schemaArrayOptions.js +var require_schemaArrayOptions = __commonJS({ + "node_modules/mongoose/lib/options/schemaArrayOptions.js"(exports2, module2) { + "use strict"; + var SchemaTypeOptions = require_schemaTypeOptions(); + var SchemaArrayOptions = class extends SchemaTypeOptions { + }; + var opts = require_propertyOptions(); + Object.defineProperty(SchemaArrayOptions.prototype, "enum", opts); + Object.defineProperty(SchemaArrayOptions.prototype, "of", opts); + Object.defineProperty(SchemaArrayOptions.prototype, "castNonArrays", opts); + module2.exports = SchemaArrayOptions; + } +}); + +// node_modules/mongoose/lib/helpers/arrayDepth.js +var require_arrayDepth = __commonJS({ + "node_modules/mongoose/lib/helpers/arrayDepth.js"(exports2, module2) { + "use strict"; + module2.exports = arrayDepth; + function arrayDepth(arr) { + if (!Array.isArray(arr)) { + return { min: 0, max: 0, containsNonArrayItem: true }; + } + if (arr.length === 0) { + return { min: 1, max: 1, containsNonArrayItem: false }; + } + if (arr.length === 1 && !Array.isArray(arr[0])) { + return { min: 1, max: 1, containsNonArrayItem: false }; + } + const res = arrayDepth(arr[0]); + for (let i4 = 1; i4 < arr.length; ++i4) { + const _res = arrayDepth(arr[i4]); + if (_res.min < res.min) { + res.min = _res.min; + } + if (_res.max > res.max) { + res.max = _res.max; + } + res.containsNonArrayItem = res.containsNonArrayItem || _res.containsNonArrayItem; + } + res.min = res.min + 1; + res.max = res.max + 1; + return res; + } + } +}); + +// node_modules/mongoose/lib/cast/number.js +var require_number = __commonJS({ + "node_modules/mongoose/lib/cast/number.js"(exports2, module2) { + "use strict"; + var assert = require("assert"); + module2.exports = function castNumber(val) { + if (val == null) { + return val; + } + if (val === "") { + return null; + } + if (typeof val === "string" || typeof val === "boolean") { + val = Number(val); + } + assert.ok(!isNaN(val)); + if (val instanceof Number) { + return val.valueOf(); + } + if (typeof val === "number") { + return val; + } + if (!Array.isArray(val) && typeof val.valueOf === "function") { + return Number(val.valueOf()); + } + if (val.toString && !Array.isArray(val) && val.toString() == Number(val)) { + return Number(val); + } + assert.ok(false); + }; + } +}); + +// node_modules/mongoose/lib/helpers/omitUndefined.js +var require_omitUndefined = __commonJS({ + "node_modules/mongoose/lib/helpers/omitUndefined.js"(exports2, module2) { + "use strict"; + module2.exports = function omitUndefined(val) { + if (val == null || typeof val !== "object") { + return val; + } + if (Array.isArray(val)) { + for (let i4 = val.length - 1; i4 >= 0; --i4) { + if (val[i4] === void 0) { + val.splice(i4, 1); + } + } + } + for (const key of Object.keys(val)) { + if (val[key] === void 0) { + delete val[key]; + } + } + return val; + }; + } +}); + +// node_modules/mongoose/lib/helpers/query/cast$expr.js +var require_cast_expr = __commonJS({ + "node_modules/mongoose/lib/helpers/query/cast$expr.js"(exports2, module2) { + "use strict"; + var CastError = require_cast(); + var StrictModeError = require_strict(); + var castNumber = require_number(); + var omitUndefined = require_omitUndefined(); + var booleanComparison = /* @__PURE__ */ new Set(["$and", "$or"]); + var comparisonOperator = /* @__PURE__ */ new Set(["$cmp", "$eq", "$lt", "$lte", "$gt", "$gte"]); + var arithmeticOperatorArray = /* @__PURE__ */ new Set([ + // avoid casting '$add' or '$subtract', because expressions can be either number or date, + // and we don't have a good way of inferring which arguments should be numbers and which should + // be dates. + "$multiply", + "$divide", + "$log", + "$mod", + "$trunc", + "$avg", + "$max", + "$min", + "$stdDevPop", + "$stdDevSamp", + "$sum" + ]); + var arithmeticOperatorNumber = /* @__PURE__ */ new Set([ + "$abs", + "$exp", + "$ceil", + "$floor", + "$ln", + "$log10", + "$sqrt", + "$sin", + "$cos", + "$tan", + "$asin", + "$acos", + "$atan", + "$atan2", + "$asinh", + "$acosh", + "$atanh", + "$sinh", + "$cosh", + "$tanh", + "$degreesToRadians", + "$radiansToDegrees" + ]); + var arrayElementOperators = /* @__PURE__ */ new Set([ + "$arrayElemAt", + "$first", + "$last" + ]); + var dateOperators = /* @__PURE__ */ new Set([ + "$year", + "$month", + "$week", + "$dayOfMonth", + "$dayOfYear", + "$hour", + "$minute", + "$second", + "$isoDayOfWeek", + "$isoWeekYear", + "$isoWeek", + "$millisecond" + ]); + var expressionOperator = /* @__PURE__ */ new Set(["$not"]); + module2.exports = function cast$expr(val, schema, strictQuery) { + if (typeof val === "boolean") { + return val; + } + if (typeof val !== "object" || val === null) { + throw new Error("`$expr` must be an object or boolean literal"); + } + return _castExpression(val, schema, strictQuery); + }; + function _castExpression(val, schema, strictQuery) { + if (isPath(val) || val === null) { + return val; + } + if (val.$cond != null) { + if (Array.isArray(val.$cond)) { + val.$cond = val.$cond.map((expr) => _castExpression(expr, schema, strictQuery)); + } else { + val.$cond.if = _castExpression(val.$cond.if, schema, strictQuery); + val.$cond.then = _castExpression(val.$cond.then, schema, strictQuery); + val.$cond.else = _castExpression(val.$cond.else, schema, strictQuery); + } + } else if (val.$ifNull != null) { + val.$ifNull.map((v4) => _castExpression(v4, schema, strictQuery)); + } else if (val.$switch != null) { + if (Array.isArray(val.$switch.branches)) { + val.$switch.branches = val.$switch.branches.map((v4) => _castExpression(v4, schema, strictQuery)); + } + if ("default" in val.$switch) { + val.$switch.default = _castExpression(val.$switch.default, schema, strictQuery); + } + } + const keys = Object.keys(val); + for (const key of keys) { + if (booleanComparison.has(key)) { + val[key] = val[key].map((v4) => _castExpression(v4, schema, strictQuery)); + } else if (comparisonOperator.has(key)) { + val[key] = castComparison(val[key], schema, strictQuery); + } else if (arithmeticOperatorArray.has(key)) { + val[key] = castArithmetic(val[key], schema, strictQuery); + } else if (arithmeticOperatorNumber.has(key)) { + val[key] = castNumberOperator(val[key], schema, strictQuery); + } else if (expressionOperator.has(key)) { + val[key] = _castExpression(val[key], schema, strictQuery); + } + } + if (val.$in) { + val.$in = castIn(val.$in, schema, strictQuery); + } + if (val.$size) { + val.$size = castNumberOperator(val.$size, schema, strictQuery); + } + if (val.$round) { + const $round = val.$round; + if (!Array.isArray($round) || $round.length < 1 || $round.length > 2) { + throw new CastError("Array", $round, "$round"); + } + val.$round = $round.map((v4) => castNumberOperator(v4, schema, strictQuery)); + } + omitUndefined(val); + return val; + } + function castNumberOperator(val) { + if (!isLiteral(val)) { + return val; + } + try { + return castNumber(val); + } catch (err) { + throw new CastError("Number", val); + } + } + function castIn(val, schema, strictQuery) { + const path = val[1]; + if (!isPath(path)) { + return val; + } + const search = val[0]; + const schematype = schema.path(path.slice(1)); + if (schematype === null) { + if (strictQuery === false) { + return val; + } else if (strictQuery === "throw") { + throw new StrictModeError("$in"); + } + return void 0; + } + if (!schematype.$isMongooseArray) { + throw new Error("Path must be an array for $in"); + } + return [ + schematype.$isMongooseDocumentArray ? schematype.$embeddedSchemaType.cast(search) : schematype.caster.cast(search), + path + ]; + } + function castArithmetic(val) { + if (!Array.isArray(val)) { + if (!isLiteral(val)) { + return val; + } + try { + return castNumber(val); + } catch (err) { + throw new CastError("Number", val); + } + } + return val.map((v4) => { + if (!isLiteral(v4)) { + return v4; + } + try { + return castNumber(v4); + } catch (err) { + throw new CastError("Number", v4); + } + }); + } + function castComparison(val, schema, strictQuery) { + if (!Array.isArray(val) || val.length !== 2) { + throw new Error("Comparison operator must be an array of length 2"); + } + val[0] = _castExpression(val[0], schema, strictQuery); + const lhs = val[0]; + if (isLiteral(val[1])) { + let path = null; + let schematype = null; + let caster = null; + if (isPath(lhs)) { + path = lhs.slice(1); + schematype = schema.path(path); + } else if (typeof lhs === "object" && lhs != null) { + for (const key of Object.keys(lhs)) { + if (dateOperators.has(key) && isPath(lhs[key])) { + path = lhs[key].slice(1) + "." + key; + caster = castNumber; + } else if (arrayElementOperators.has(key) && isPath(lhs[key])) { + path = lhs[key].slice(1) + "." + key; + schematype = schema.path(lhs[key].slice(1)); + if (schematype != null) { + if (schematype.$isMongooseDocumentArray) { + schematype = schematype.$embeddedSchemaType; + } else if (schematype.$isMongooseArray) { + schematype = schematype.caster; + } + } + } + } + } + const is$literal = typeof val[1] === "object" && val[1] != null && val[1].$literal != null; + if (schematype != null) { + if (is$literal) { + val[1] = { $literal: schematype.cast(val[1].$literal) }; + } else { + val[1] = schematype.cast(val[1]); + } + } else if (caster != null) { + if (is$literal) { + try { + val[1] = { $literal: caster(val[1].$literal) }; + } catch (err) { + throw new CastError(caster.name.replace(/^cast/, ""), val[1], path + ".$literal"); + } + } else { + try { + val[1] = caster(val[1]); + } catch (err) { + throw new CastError(caster.name.replace(/^cast/, ""), val[1], path); + } + } + } else if (path != null && strictQuery === true) { + return void 0; + } else if (path != null && strictQuery === "throw") { + throw new StrictModeError(path); + } + } else { + val[1] = _castExpression(val[1]); + } + return val; + } + function isPath(val) { + return typeof val === "string" && val[0] === "$"; + } + function isLiteral(val) { + if (typeof val === "string" && val[0] === "$") { + return false; + } + if (typeof val === "object" && val !== null && Object.keys(val).find((key) => key[0] === "$")) { + return val.$literal != null; + } + return true; + } + } +}); + +// node_modules/mongoose/lib/cast/string.js +var require_string = __commonJS({ + "node_modules/mongoose/lib/cast/string.js"(exports2, module2) { + "use strict"; + var CastError = require_cast(); + module2.exports = function castString(value, path) { + if (value == null) { + return value; + } + if (value._id && typeof value._id === "string") { + return value._id; + } + if (value.toString && value.toString !== Object.prototype.toString && !Array.isArray(value)) { + return value.toString(); + } + throw new CastError("string", value, path); + }; + } +}); + +// node_modules/mongoose/lib/schema/operators/text.js +var require_text2 = __commonJS({ + "node_modules/mongoose/lib/schema/operators/text.js"(exports2, module2) { + "use strict"; + var CastError = require_cast(); + var castBoolean = require_boolean(); + var castString = require_string(); + module2.exports = function castTextSearch(val, path) { + if (val == null || typeof val !== "object") { + throw new CastError("$text", val, path); + } + if (val.$search != null) { + val.$search = castString(val.$search, path + ".$search"); + } + if (val.$language != null) { + val.$language = castString(val.$language, path + ".$language"); + } + if (val.$caseSensitive != null) { + val.$caseSensitive = castBoolean( + val.$caseSensitive, + path + ".$castSensitive" + ); + } + if (val.$diacriticSensitive != null) { + val.$diacriticSensitive = castBoolean( + val.$diacriticSensitive, + path + ".$diacriticSensitive" + ); + } + return val; + }; + } +}); + +// node_modules/mongoose/lib/helpers/query/isOperator.js +var require_isOperator = __commonJS({ + "node_modules/mongoose/lib/helpers/query/isOperator.js"(exports2, module2) { + "use strict"; + var specialKeys = /* @__PURE__ */ new Set([ + "$ref", + "$id", + "$db" + ]); + module2.exports = function isOperator(path) { + return path[0] === "$" && !specialKeys.has(path); + }; + } +}); + +// node_modules/mongoose/lib/cast.js +var require_cast2 = __commonJS({ + "node_modules/mongoose/lib/cast.js"(exports2, module2) { + "use strict"; + var CastError = require_cast(); + var StrictModeError = require_strict(); + var Types = require_schema(); + var cast$expr = require_cast_expr(); + var castString = require_string(); + var castTextSearch = require_text2(); + var get2 = require_get(); + var getSchemaDiscriminatorByValue = require_getSchemaDiscriminatorByValue(); + var isOperator = require_isOperator(); + var util = require("util"); + var isObject = require_isObject(); + var isMongooseObject = require_isMongooseObject(); + var utils = require_utils6(); + var ALLOWED_GEOWITHIN_GEOJSON_TYPES = ["Polygon", "MultiPolygon"]; + module2.exports = function cast(schema, obj, options, context) { + if (Array.isArray(obj)) { + throw new Error("Query filter must be an object, got an array ", util.inspect(obj)); + } + if (obj == null) { + return obj; + } + if (schema != null && schema.discriminators != null && obj[schema.options.discriminatorKey] != null) { + schema = getSchemaDiscriminatorByValue(schema, obj[schema.options.discriminatorKey]) || schema; + } + const paths = Object.keys(obj); + let i4 = paths.length; + let _keys; + let any$conditionals; + let schematype; + let nested; + let path; + let type; + let val; + options = options || {}; + while (i4--) { + path = paths[i4]; + val = obj[path]; + if (path === "$or" || path === "$nor" || path === "$and") { + if (!Array.isArray(val)) { + throw new CastError("Array", val, path); + } + for (let k4 = val.length - 1; k4 >= 0; k4--) { + if (val[k4] == null || typeof val[k4] !== "object") { + throw new CastError("Object", val[k4], path + "." + k4); + } + const beforeCastKeysLength = Object.keys(val[k4]).length; + const discriminatorValue = val[k4][schema.options.discriminatorKey]; + if (discriminatorValue == null) { + val[k4] = cast(schema, val[k4], options, context); + } else { + const discriminatorSchema = getSchemaDiscriminatorByValue(context.schema, discriminatorValue); + val[k4] = cast(discriminatorSchema ? discriminatorSchema : schema, val[k4], options, context); + } + if (Object.keys(val[k4]).length === 0 && beforeCastKeysLength !== 0) { + val.splice(k4, 1); + } + } + if (val.length === 0) { + delete obj[path]; + } + } else if (path === "$where") { + type = typeof val; + if (type !== "string" && type !== "function") { + throw new Error("Must have a string or function for $where"); + } + if (type === "function") { + obj[path] = val.toString(); + } + continue; + } else if (path === "$expr") { + val = cast$expr(val, schema); + continue; + } else if (path === "$elemMatch") { + val = cast(schema, val, options, context); + } else if (path === "$text") { + val = castTextSearch(val, path); + } else if (path === "$comment" && !Object.hasOwn(schema.paths, "$comment")) { + val = castString(val, path); + obj[path] = val; + } else { + if (!schema) { + continue; + } + schematype = schema.path(path); + if (!schematype) { + const split = path.split("."); + let j4 = split.length; + while (j4--) { + const pathFirstHalf = split.slice(0, j4).join("."); + const pathLastHalf = split.slice(j4).join("."); + const _schematype = schema.path(pathFirstHalf); + const discriminatorKey = _schematype && _schematype.schema && _schematype.schema.options && _schematype.schema.options.discriminatorKey; + if (_schematype != null && (_schematype.schema && _schematype.schema.discriminators) != null && discriminatorKey != null && pathLastHalf !== discriminatorKey) { + const discriminatorVal = get2(obj, pathFirstHalf + "." + discriminatorKey); + const discriminators = _schematype.schema.discriminators; + if (typeof discriminatorVal === "string" && discriminators[discriminatorVal] != null) { + schematype = discriminators[discriminatorVal].path(pathLastHalf); + } else if (discriminatorVal != null && Object.keys(discriminatorVal).length === 1 && Array.isArray(discriminatorVal.$in) && discriminatorVal.$in.length === 1 && typeof discriminatorVal.$in[0] === "string" && discriminators[discriminatorVal.$in[0]] != null) { + schematype = discriminators[discriminatorVal.$in[0]].path(pathLastHalf); + } + } + } + } + if (!schematype) { + const split = path.split("."); + let j4 = split.length; + let pathFirstHalf; + let pathLastHalf; + let remainingConds; + while (j4--) { + pathFirstHalf = split.slice(0, j4).join("."); + schematype = schema.path(pathFirstHalf); + if (schematype) { + break; + } + } + if (schematype) { + if (schematype.caster && schematype.caster.schema) { + remainingConds = {}; + pathLastHalf = split.slice(j4).join("."); + remainingConds[pathLastHalf] = val; + const ret = cast(schematype.caster.schema, remainingConds, options, context)[pathLastHalf]; + if (ret === void 0) { + delete obj[path]; + } else { + obj[path] = ret; + } + } else { + obj[path] = val; + } + continue; + } + if (isObject(val)) { + let geo = ""; + if (val.$near) { + geo = "$near"; + } else if (val.$nearSphere) { + geo = "$nearSphere"; + } else if (val.$within) { + geo = "$within"; + } else if (val.$geoIntersects) { + geo = "$geoIntersects"; + } else if (val.$geoWithin) { + geo = "$geoWithin"; + } + if (geo) { + const numbertype = new Types.Number("__QueryCasting__", null, null, schema); + let value = val[geo]; + if (val.$maxDistance != null) { + val.$maxDistance = numbertype.castForQuery( + null, + val.$maxDistance, + context + ); + } + if (val.$minDistance != null) { + val.$minDistance = numbertype.castForQuery( + null, + val.$minDistance, + context + ); + } + if (geo === "$within") { + const withinType = value.$center || value.$centerSphere || value.$box || value.$polygon; + if (!withinType) { + throw new Error("Bad $within parameter: " + JSON.stringify(val)); + } + value = withinType; + } else if (geo === "$near" && typeof value.type === "string" && Array.isArray(value.coordinates)) { + value = value.coordinates; + } else if ((geo === "$near" || geo === "$nearSphere" || geo === "$geoIntersects") && value.$geometry && typeof value.$geometry.type === "string" && Array.isArray(value.$geometry.coordinates)) { + if (value.$maxDistance != null) { + value.$maxDistance = numbertype.castForQuery( + null, + value.$maxDistance, + context + ); + } + if (value.$minDistance != null) { + value.$minDistance = numbertype.castForQuery( + null, + value.$minDistance, + context + ); + } + if (isMongooseObject(value.$geometry)) { + value.$geometry = value.$geometry.toObject({ + transform: false, + virtuals: false + }); + } + value = value.$geometry.coordinates; + } else if (geo === "$geoWithin") { + if (value.$geometry) { + if (isMongooseObject(value.$geometry)) { + value.$geometry = value.$geometry.toObject({ virtuals: false }); + } + const geoWithinType = value.$geometry.type; + if (ALLOWED_GEOWITHIN_GEOJSON_TYPES.indexOf(geoWithinType) === -1) { + throw new Error('Invalid geoJSON type for $geoWithin "' + geoWithinType + '", must be "Polygon" or "MultiPolygon"'); + } + value = value.$geometry.coordinates; + } else { + value = value.$box || value.$polygon || value.$center || value.$centerSphere; + if (isMongooseObject(value)) { + value = value.toObject({ virtuals: false }); + } + } + } + _cast(value, numbertype, context); + continue; + } + } + if (schema.nested[path]) { + continue; + } + const strict = "strict" in options ? options.strict : schema.options.strict; + const strictQuery = getStrictQuery(options, schema._userProvidedOptions, schema.options, context); + if (options.upsert && strict) { + if (strict === "throw") { + throw new StrictModeError(path); + } + throw new StrictModeError(path, 'Path "' + path + '" is not in schema, strict mode is `true`, and upsert is `true`.'); + } + if (strictQuery === "throw") { + throw new StrictModeError(path, 'Path "' + path + `" is not in schema and strictQuery is 'throw'.`); + } else if (strictQuery) { + delete obj[path]; + } + } else if (val == null) { + continue; + } else if (utils.isPOJO(val)) { + any$conditionals = Object.keys(val).some(isOperator); + if (!any$conditionals) { + obj[path] = schematype.castForQuery( + null, + val, + context + ); + } else { + const ks = Object.keys(val); + let $cond; + let k4 = ks.length; + while (k4--) { + $cond = ks[k4]; + nested = val[$cond]; + if ($cond === "$elemMatch") { + if (nested && schematype != null && schematype.schema != null) { + cast(schematype.schema, nested, options, context); + } else if (nested && schematype != null && schematype.$isMongooseArray) { + if (utils.isPOJO(nested) && nested.$not != null) { + cast(schema, nested, options, context); + } else { + val[$cond] = schematype.castForQuery( + $cond, + nested, + context + ); + } + } + } else if ($cond === "$not") { + if (nested && schematype) { + _keys = Object.keys(nested); + if (_keys.length && isOperator(_keys[0])) { + for (const key in nested) { + nested[key] = schematype.castForQuery( + key, + nested[key], + context + ); + } + } else { + val[$cond] = schematype.castForQuery( + $cond, + nested, + context + ); + } + continue; + } + } else { + val[$cond] = schematype.castForQuery( + $cond, + nested, + context + ); + } + } + } + } else if (Array.isArray(val) && ["Buffer", "Array"].indexOf(schematype.instance) === -1 && !options.sanitizeFilter) { + const casted = []; + const valuesArray = val; + for (const _val of valuesArray) { + casted.push(schematype.castForQuery( + null, + _val, + context + )); + } + obj[path] = { $in: casted }; + } else { + obj[path] = schematype.castForQuery( + null, + val, + context + ); + } + } + } + return obj; + }; + function _cast(val, numbertype, context) { + if (Array.isArray(val)) { + val.forEach(function(item, i4) { + if (Array.isArray(item) || isObject(item)) { + return _cast(item, numbertype, context); + } + val[i4] = numbertype.castForQuery(null, item, context); + }); + } else { + const nearKeys = Object.keys(val); + let nearLen = nearKeys.length; + while (nearLen--) { + const nkey = nearKeys[nearLen]; + const item = val[nkey]; + if (Array.isArray(item) || isObject(item)) { + _cast(item, numbertype, context); + val[nkey] = item; + } else { + val[nkey] = numbertype.castForQuery({ val: item, context }); + } + } + } + } + function getStrictQuery(queryOptions, schemaUserProvidedOptions, schemaOptions, context) { + if ("strictQuery" in queryOptions) { + return queryOptions.strictQuery; + } + if ("strictQuery" in schemaUserProvidedOptions) { + return schemaUserProvidedOptions.strictQuery; + } + const mongooseOptions = context && context.mongooseCollection && context.mongooseCollection.conn && context.mongooseCollection.conn.base && context.mongooseCollection.conn.base.options; + if (mongooseOptions) { + if ("strictQuery" in mongooseOptions) { + return mongooseOptions.strictQuery; + } + } + return schemaOptions.strictQuery; + } + } +}); + +// node_modules/mongoose/lib/options/schemaNumberOptions.js +var require_schemaNumberOptions = __commonJS({ + "node_modules/mongoose/lib/options/schemaNumberOptions.js"(exports2, module2) { + "use strict"; + var SchemaTypeOptions = require_schemaTypeOptions(); + var SchemaNumberOptions = class extends SchemaTypeOptions { + }; + var opts = require_propertyOptions(); + Object.defineProperty(SchemaNumberOptions.prototype, "min", opts); + Object.defineProperty(SchemaNumberOptions.prototype, "max", opts); + Object.defineProperty(SchemaNumberOptions.prototype, "enum", opts); + Object.defineProperty(SchemaNumberOptions.prototype, "populate", opts); + module2.exports = SchemaNumberOptions; + } +}); + +// node_modules/mongoose/lib/helpers/createJSONSchemaTypeDefinition.js +var require_createJSONSchemaTypeDefinition = __commonJS({ + "node_modules/mongoose/lib/helpers/createJSONSchemaTypeDefinition.js"(exports2, module2) { + "use strict"; + module2.exports = function createJSONSchemaTypeArray(type, bsonType, useBsonType, isRequired) { + if (useBsonType) { + if (isRequired) { + return { bsonType }; + } + return { bsonType: [bsonType, "null"] }; + } else { + if (isRequired) { + return { type }; + } + return { type: [type, "null"] }; + } + }; + } +}); + +// node_modules/mongoose/lib/schema/operators/bitwise.js +var require_bitwise = __commonJS({ + "node_modules/mongoose/lib/schema/operators/bitwise.js"(exports2, module2) { + "use strict"; + var CastError = require_cast(); + function handleBitwiseOperator(val) { + const _this = this; + if (Array.isArray(val)) { + return val.map(function(v4) { + return _castNumber(_this.path, v4); + }); + } else if (Buffer.isBuffer(val)) { + return val; + } + return _castNumber(_this.path, val); + } + function _castNumber(path, num) { + const v4 = Number(num); + if (isNaN(v4)) { + throw new CastError("number", num, path); + } + return v4; + } + module2.exports = handleBitwiseOperator; + } +}); + +// node_modules/mongoose/lib/schema/number.js +var require_number2 = __commonJS({ + "node_modules/mongoose/lib/schema/number.js"(exports2, module2) { + "use strict"; + var MongooseError = require_error2(); + var SchemaNumberOptions = require_schemaNumberOptions(); + var SchemaType = require_schemaType(); + var castNumber = require_number(); + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + var handleBitwiseOperator = require_bitwise(); + var utils = require_utils6(); + var CastError = SchemaType.CastError; + function SchemaNumber(key, options, _schemaOptions, parentSchema) { + SchemaType.call(this, key, options, "Number", parentSchema); + } + SchemaNumber.get = SchemaType.get; + SchemaNumber.set = SchemaType.set; + SchemaNumber.setters = []; + SchemaNumber._cast = castNumber; + SchemaNumber.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + return this._cast; + }; + SchemaNumber._defaultCaster = (v4) => { + if (typeof v4 !== "number") { + throw new Error(); + } + return v4; + }; + SchemaNumber.schemaName = "Number"; + SchemaNumber.defaultOptions = {}; + SchemaNumber.prototype = Object.create(SchemaType.prototype); + SchemaNumber.prototype.constructor = SchemaNumber; + SchemaNumber.prototype.OptionsConstructor = SchemaNumberOptions; + SchemaNumber._checkRequired = (v4) => typeof v4 === "number" || v4 instanceof Number; + SchemaNumber.checkRequired = SchemaType.checkRequired; + SchemaNumber.prototype.checkRequired = function checkRequired(value, doc) { + if (typeof value === "object" && SchemaType._isRef(this, value, doc, true)) { + return value != null; + } + const _checkRequired = typeof this.constructor.checkRequired === "function" ? this.constructor.checkRequired() : SchemaNumber.checkRequired(); + return _checkRequired(value); + }; + SchemaNumber.prototype.min = function(value, message2) { + if (this.minValidator) { + this.validators = this.validators.filter(function(v4) { + return v4.validator !== this.minValidator; + }, this); + } + if (value !== null && value !== void 0) { + let msg = message2 || MongooseError.messages.Number.min; + msg = msg.replace(/{MIN}/, value); + this.validators.push({ + validator: this.minValidator = function(v4) { + return v4 == null || v4 >= value; + }, + message: msg, + type: "min", + min: value + }); + } + return this; + }; + SchemaNumber.prototype.max = function(value, message2) { + if (this.maxValidator) { + this.validators = this.validators.filter(function(v4) { + return v4.validator !== this.maxValidator; + }, this); + } + if (value !== null && value !== void 0) { + let msg = message2 || MongooseError.messages.Number.max; + msg = msg.replace(/{MAX}/, value); + this.validators.push({ + validator: this.maxValidator = function(v4) { + return v4 == null || v4 <= value; + }, + message: msg, + type: "max", + max: value + }); + } + return this; + }; + SchemaNumber.prototype.enum = function(values, message2) { + if (this.enumValidator) { + this.validators = this.validators.filter(function(v4) { + return v4.validator !== this.enumValidator; + }, this); + } + if (!Array.isArray(values)) { + const isObjectSyntax = utils.isPOJO(values) && values.values != null; + if (isObjectSyntax) { + message2 = values.message; + values = values.values; + } else if (typeof values === "number") { + values = Array.prototype.slice.call(arguments); + message2 = null; + } + if (utils.isPOJO(values)) { + const keys = Object.keys(values).sort(); + const objVals = Object.values(values).sort(); + if (keys.length === objVals.length && keys.every((k4, i4) => k4 === String(objVals[i4])) && objVals.filter((v4) => typeof v4 === "number").length === Math.floor(objVals.length / 2)) { + values = objVals.filter((v4) => typeof v4 === "number"); + } else { + values = Object.values(values); + } + } + message2 = message2 || MongooseError.messages.Number.enum; + } + message2 = message2 == null ? MongooseError.messages.Number.enum : message2; + this.enumValidator = (v4) => v4 == null || values.indexOf(v4) !== -1; + this.validators.push({ + validator: this.enumValidator, + message: message2, + type: "enum", + enumValues: values + }); + return this; + }; + SchemaNumber.prototype.cast = function(value, doc, init, prev, options) { + if (typeof value !== "number" && SchemaType._isRef(this, value, doc, init)) { + if (value == null || utils.isNonBuiltinObject(value)) { + return this._castRef(value, doc, init, options); + } + } + const val = value && typeof value._id !== "undefined" ? value._id : ( + // documents + value + ); + let castNumber2; + if (typeof this._castFunction === "function") { + castNumber2 = this._castFunction; + } else if (typeof this.constructor.cast === "function") { + castNumber2 = this.constructor.cast(); + } else { + castNumber2 = SchemaNumber.cast(); + } + try { + return castNumber2(val); + } catch (err) { + throw new CastError("Number", val, this.path, err, this); + } + }; + function handleSingle(val) { + return this.cast(val); + } + function handleArray(val) { + const _this = this; + if (!Array.isArray(val)) { + return [this.cast(val)]; + } + return val.map(function(m4) { + return _this.cast(m4); + }); + } + var $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $bitsAllClear: handleBitwiseOperator, + $bitsAnyClear: handleBitwiseOperator, + $bitsAllSet: handleBitwiseOperator, + $bitsAnySet: handleBitwiseOperator, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle, + $mod: handleArray + }; + Object.defineProperty(SchemaNumber.prototype, "$conditionalHandlers", { + enumerable: false, + value: $conditionalHandlers + }); + SchemaNumber.prototype.castForQuery = function($conditional, val, context) { + let handler2; + if ($conditional != null) { + handler2 = this.$conditionalHandlers[$conditional]; + if (!handler2) { + throw new CastError("number", val, this.path, null, this); + } + return handler2.call(this, val, context); + } + try { + val = this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } + return val; + }; + SchemaNumber.prototype.toJSONSchema = function toJSONSchema(options) { + const isRequired = this.options.required && typeof this.options.required !== "function" || this.path === "_id"; + return createJSONSchemaTypeDefinition("number", "number", options?.useBsonType, isRequired); + }; + module2.exports = SchemaNumber; + } +}); + +// node_modules/mongoose/lib/schema/operators/helpers.js +var require_helpers3 = __commonJS({ + "node_modules/mongoose/lib/schema/operators/helpers.js"(exports2) { + "use strict"; + var SchemaNumber = require_number2(); + exports2.castToNumber = castToNumber; + exports2.castArraysOfNumbers = castArraysOfNumbers; + function castToNumber(val) { + return SchemaNumber.cast()(val); + } + function castArraysOfNumbers(arr, self2) { + arr.forEach(function(v4, i4) { + if (Array.isArray(v4)) { + castArraysOfNumbers(v4, self2); + } else { + arr[i4] = castToNumber.call(self2, v4); + } + }); + } + } +}); + +// node_modules/mongoose/lib/schema/operators/geospatial.js +var require_geospatial = __commonJS({ + "node_modules/mongoose/lib/schema/operators/geospatial.js"(exports2) { + "use strict"; + var castArraysOfNumbers = require_helpers3().castArraysOfNumbers; + var castToNumber = require_helpers3().castToNumber; + exports2.cast$geoIntersects = cast$geoIntersects; + exports2.cast$near = cast$near; + exports2.cast$within = cast$within; + function cast$near(val) { + const SchemaArray = require_array2(); + if (Array.isArray(val)) { + castArraysOfNumbers(val, this); + return val; + } + _castMinMaxDistance(this, val); + if (val && val.$geometry) { + return cast$geometry(val, this); + } + if (!Array.isArray(val)) { + throw new TypeError("$near must be either an array or an object with a $geometry property"); + } + return SchemaArray.prototype.castForQuery.call(this, null, val); + } + function cast$geometry(val, self2) { + switch (val.$geometry.type) { + case "Polygon": + case "LineString": + case "Point": + castArraysOfNumbers(val.$geometry.coordinates, self2); + break; + default: + break; + } + _castMinMaxDistance(self2, val); + return val; + } + function cast$within(val) { + _castMinMaxDistance(this, val); + if (val.$box || val.$polygon) { + const type = val.$box ? "$box" : "$polygon"; + val[type].forEach((arr) => { + if (!Array.isArray(arr)) { + const msg = "Invalid $within $box argument. Expected an array, received " + arr; + throw new TypeError(msg); + } + arr.forEach((v4, i4) => { + arr[i4] = castToNumber.call(this, v4); + }); + }); + } else if (val.$center || val.$centerSphere) { + const type = val.$center ? "$center" : "$centerSphere"; + val[type].forEach((item, i4) => { + if (Array.isArray(item)) { + item.forEach((v4, j4) => { + item[j4] = castToNumber.call(this, v4); + }); + } else { + val[type][i4] = castToNumber.call(this, item); + } + }); + } else if (val.$geometry) { + cast$geometry(val, this); + } + return val; + } + function cast$geoIntersects(val) { + const geo = val.$geometry; + if (!geo) { + return; + } + cast$geometry(val, this); + return val; + } + function _castMinMaxDistance(self2, val) { + if (val.$maxDistance) { + val.$maxDistance = castToNumber.call(self2, val.$maxDistance); + } + if (val.$minDistance) { + val.$minDistance = castToNumber.call(self2, val.$minDistance); + } + } + } +}); + +// node_modules/mongoose/lib/schema/array.js +var require_array2 = __commonJS({ + "node_modules/mongoose/lib/schema/array.js"(exports2, module2) { + "use strict"; + var $exists = require_exists(); + var $type = require_type(); + var MongooseError = require_mongooseError(); + var SchemaArrayOptions = require_schemaArrayOptions(); + var SchemaType = require_schemaType(); + var CastError = SchemaType.CastError; + var Mixed = require_mixed(); + var VirtualOptions = require_virtualOptions(); + var VirtualType = require_virtualType(); + var arrayDepth = require_arrayDepth(); + var cast = require_cast2(); + var clone = require_clone(); + var getConstructorName = require_getConstructorName(); + var isOperator = require_isOperator(); + var util = require("util"); + var utils = require_utils6(); + var castToNumber = require_helpers3().castToNumber; + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + var geospatial = require_geospatial(); + var getDiscriminatorByValue = require_getDiscriminatorByValue(); + var MongooseArray; + var EmbeddedDoc; + var isNestedArraySymbol = /* @__PURE__ */ Symbol("mongoose#isNestedArray"); + var emptyOpts = Object.freeze({}); + function SchemaArray(key, cast2, options, schemaOptions, parentSchema) { + EmbeddedDoc || (EmbeddedDoc = require_types2().Embedded); + let typeKey = "type"; + if (schemaOptions && schemaOptions.typeKey) { + typeKey = schemaOptions.typeKey; + } + this.schemaOptions = schemaOptions; + if (cast2) { + let castOptions = {}; + if (utils.isPOJO(cast2)) { + if (cast2[typeKey]) { + castOptions = clone(cast2); + delete castOptions[typeKey]; + cast2 = cast2[typeKey]; + } else { + cast2 = Mixed; + } + } + if (options != null && options.ref != null && castOptions.ref == null) { + castOptions.ref = options.ref; + } + if (cast2 === Object) { + cast2 = Mixed; + } + const name = typeof cast2 === "string" ? cast2 : utils.getFunctionName(cast2); + const Types = require_schema(); + const caster = Object.hasOwn(Types, name) ? Types[name] : cast2; + this.casterConstructor = caster; + if (this.casterConstructor instanceof SchemaArray) { + this.casterConstructor[isNestedArraySymbol] = true; + } + if (typeof caster === "function" && !caster.$isArraySubdocument && !caster.$isSchemaMap) { + const path = this.caster instanceof EmbeddedDoc ? null : key; + if (caster === SchemaArray) { + this.caster = new caster(path, castOptions, schemaOptions, null, parentSchema); + } else { + this.caster = new caster(path, castOptions, schemaOptions, parentSchema); + } + } else { + this.caster = caster; + if (!(this.caster instanceof EmbeddedDoc)) { + this.caster.path = key; + } + } + this.$embeddedSchemaType = this.caster; + } + this.$isMongooseArray = true; + SchemaType.call(this, key, options, "Array", parentSchema); + let defaultArr; + let fn2; + if (this.defaultValue != null) { + defaultArr = this.defaultValue; + fn2 = typeof defaultArr === "function"; + } + if (!("defaultValue" in this) || this.defaultValue != null) { + const defaultFn = function() { + return fn2 ? defaultArr.call(this) : defaultArr != null ? [].concat(defaultArr) : []; + }; + defaultFn.$runBeforeSetters = !fn2; + this.default(defaultFn); + } + } + SchemaArray.schemaName = "Array"; + SchemaArray.options = { castNonArrays: true }; + SchemaArray.defaultOptions = {}; + SchemaArray.set = SchemaType.set; + SchemaArray.setters = []; + SchemaArray.get = SchemaType.get; + SchemaArray.prototype = Object.create(SchemaType.prototype); + SchemaArray.prototype.constructor = SchemaArray; + SchemaArray.prototype.OptionsConstructor = SchemaArrayOptions; + SchemaArray._checkRequired = SchemaType.prototype.checkRequired; + SchemaArray.checkRequired = SchemaType.checkRequired; + SchemaArray.prototype.virtuals = null; + SchemaArray.prototype.checkRequired = function checkRequired(value, doc) { + if (typeof value === "object" && SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + const _checkRequired = typeof this.constructor.checkRequired === "function" ? this.constructor.checkRequired() : SchemaArray.checkRequired(); + return _checkRequired(value); + }; + SchemaArray.prototype.enum = function() { + let arr = this; + while (true) { + const instance = arr && arr.caster && arr.caster.instance; + if (instance === "Array") { + arr = arr.caster; + continue; + } + if (instance !== "String" && instance !== "Number") { + throw new Error("`enum` can only be set on an array of strings or numbers , not " + instance); + } + break; + } + let enumArray = arguments; + if (!Array.isArray(arguments) && utils.isObject(arguments)) { + enumArray = utils.object.vals(enumArray); + } + arr.caster.enum.apply(arr.caster, enumArray); + return this; + }; + SchemaArray.prototype.applyGetters = function(value, scope) { + if (scope != null && scope.$__ != null && scope.$populated(this.path)) { + return value; + } + const ret = SchemaType.prototype.applyGetters.call(this, value, scope); + return ret; + }; + SchemaArray.prototype._applySetters = function(value, scope, init, priorVal) { + if (this.casterConstructor.$isMongooseArray && SchemaArray.options.castNonArrays && !this[isNestedArraySymbol]) { + let depth = 0; + let arr = this; + while (arr != null && arr.$isMongooseArray && !arr.$isMongooseDocumentArray) { + ++depth; + arr = arr.casterConstructor; + } + if (value != null && value.length !== 0) { + const valueDepth = arrayDepth(value); + if (valueDepth.min === valueDepth.max && valueDepth.max < depth && valueDepth.containsNonArrayItem) { + for (let i4 = valueDepth.max; i4 < depth; ++i4) { + value = [value]; + } + } + } + } + return SchemaType.prototype._applySetters.call(this, value, scope, init, priorVal); + }; + SchemaArray.prototype.cast = function(value, doc, init, prev, options) { + MongooseArray || (MongooseArray = require_types2().Array); + let i4; + let l4; + if (Array.isArray(value)) { + const len = value.length; + if (!len && doc) { + const indexes = doc.schema.indexedPaths(); + const arrayPath = this.path; + for (i4 = 0, l4 = indexes.length; i4 < l4; ++i4) { + const pathIndex = indexes[i4][0][arrayPath]; + if (pathIndex === "2dsphere" || pathIndex === "2d") { + return; + } + } + const arrayGeojsonPath = this.path.endsWith(".coordinates") ? this.path.substring(0, this.path.lastIndexOf(".")) : null; + if (arrayGeojsonPath != null) { + for (i4 = 0, l4 = indexes.length; i4 < l4; ++i4) { + const pathIndex = indexes[i4][0][arrayGeojsonPath]; + if (pathIndex === "2dsphere") { + return; + } + } + } + } + options = options || emptyOpts; + let rawValue = utils.isMongooseArray(value) ? value.__array : value; + let path = options.path || this.path; + if (options.arrayPathIndex != null) { + path += "." + options.arrayPathIndex; + } + value = MongooseArray(rawValue, path, doc, this); + rawValue = value.__array; + if (init && doc != null && doc.$__ != null && doc.$populated(this.path)) { + return value; + } + const caster = this.caster; + const isMongooseArray = caster.$isMongooseArray; + if (caster && this.casterConstructor !== Mixed) { + try { + const len2 = rawValue.length; + for (i4 = 0; i4 < len2; i4++) { + const opts = {}; + if (isMongooseArray) { + if (options.arrayPath != null) { + opts.arrayPathIndex = i4; + } else if (caster._arrayParentPath != null) { + opts.arrayPathIndex = i4; + } + } + if (options.hydratedPopulatedDocs) { + opts.hydratedPopulatedDocs = options.hydratedPopulatedDocs; + } + rawValue[i4] = caster.applySetters(rawValue[i4], doc, init, void 0, opts); + } + } catch (e4) { + throw new CastError("[" + e4.kind + "]", util.inspect(value), this.path + "." + i4, e4, this); + } + } + return value; + } + const castNonArraysOption = this.options.castNonArrays != null ? this.options.castNonArrays : SchemaArray.options.castNonArrays; + if (init || castNonArraysOption) { + if (!!doc && !!init) { + doc.markModified(this.path); + } + return this.cast([value], doc, init); + } + throw new CastError("Array", util.inspect(value), this.path, null, this); + }; + SchemaArray.prototype._castForPopulate = function _castForPopulate(value, doc) { + MongooseArray || (MongooseArray = require_types2().Array); + if (Array.isArray(value)) { + let i4; + const rawValue = value.__array ? value.__array : value; + const len = rawValue.length; + const caster = this.caster; + if (caster && this.casterConstructor !== Mixed) { + try { + for (i4 = 0; i4 < len; i4++) { + const opts = {}; + if (caster.$isMongooseArray && caster._arrayParentPath != null) { + opts.arrayPathIndex = i4; + } + rawValue[i4] = caster.cast(rawValue[i4], doc, false, void 0, opts); + } + } catch (e4) { + throw new CastError("[" + e4.kind + "]", util.inspect(value), this.path + "." + i4, e4, this); + } + } + return value; + } + throw new CastError("Array", util.inspect(value), this.path, null, this); + }; + SchemaArray.prototype.$toObject = SchemaArray.prototype.toObject; + SchemaArray.prototype.discriminator = function(...args2) { + let arr = this; + while (arr.$isMongooseArray && !arr.$isMongooseDocumentArray) { + arr = arr.casterConstructor; + if (arr == null || typeof arr === "function") { + throw new MongooseError("You can only add an embedded discriminator on a document array, " + this.path + " is a plain array"); + } + } + return arr.discriminator(...args2); + }; + SchemaArray.prototype.clone = function() { + const options = Object.assign({}, this.options); + const schematype = new this.constructor(this.path, this.caster, options, this.schemaOptions, this.parentSchema); + schematype.validators = this.validators.slice(); + if (this.requiredValidator !== void 0) { + schematype.requiredValidator = this.requiredValidator; + } + return schematype; + }; + SchemaArray.prototype._castForQuery = function(val, context) { + let Constructor = this.casterConstructor; + if (val && Constructor.discriminators && Constructor.schema && Constructor.schema.options && Constructor.schema.options.discriminatorKey) { + if (typeof val[Constructor.schema.options.discriminatorKey] === "string" && Constructor.discriminators[val[Constructor.schema.options.discriminatorKey]]) { + Constructor = Constructor.discriminators[val[Constructor.schema.options.discriminatorKey]]; + } else { + const constructorByValue = getDiscriminatorByValue(Constructor.discriminators, val[Constructor.schema.options.discriminatorKey]); + if (constructorByValue) { + Constructor = constructorByValue; + } + } + } + const proto = this.casterConstructor.prototype; + const protoCastForQuery = proto && proto.castForQuery; + const protoCast = proto && proto.cast; + const constructorCastForQuery = Constructor.castForQuery; + const caster = this.caster; + if (Array.isArray(val)) { + this.setters.reverse().forEach((setter) => { + val = setter.call(this, val, this); + }); + val = val.map(function(v4) { + if (utils.isObject(v4) && v4.$elemMatch) { + return v4; + } + if (protoCastForQuery) { + v4 = protoCastForQuery.call(caster, null, v4, context); + return v4; + } else if (protoCast) { + v4 = protoCast.call(caster, v4); + return v4; + } else if (constructorCastForQuery) { + v4 = constructorCastForQuery.call(caster, null, v4, context); + return v4; + } + if (v4 != null) { + v4 = new Constructor(v4); + return v4; + } + return v4; + }); + } else if (protoCastForQuery) { + val = protoCastForQuery.call(caster, null, val, context); + } else if (protoCast) { + val = protoCast.call(caster, val); + } else if (constructorCastForQuery) { + val = constructorCastForQuery.call(caster, null, val, context); + } else if (val != null) { + val = new Constructor(val); + } + return val; + }; + SchemaArray.prototype.castForQuery = function($conditional, val, context) { + let handler2; + if ($conditional != null) { + handler2 = this.$conditionalHandlers[$conditional]; + if (!handler2) { + throw new Error("Can't use " + $conditional + " with Array."); + } + return handler2.call(this, val, context); + } else { + return this._castForQuery(val, context); + } + }; + SchemaArray.prototype.virtual = function virtual(name, options) { + if (name instanceof VirtualType || getConstructorName(name) === "VirtualType") { + return this.virtual(name.path, name.options); + } + options = new VirtualOptions(options); + if (utils.hasUserDefinedProperty(options, ["ref", "refPath"])) { + throw new MongooseError("Cannot set populate virtual as a property of an array"); + } + const virtual2 = new VirtualType(options, name); + if (this.virtuals === null) { + this.virtuals = {}; + } + this.virtuals[name] = virtual2; + return virtual2; + }; + function cast$all(val, context) { + if (!Array.isArray(val)) { + val = [val]; + } + val = val.map((v4) => { + if (!utils.isObject(v4)) { + return v4; + } + if (v4.$elemMatch != null) { + return { $elemMatch: cast(this.casterConstructor.schema, v4.$elemMatch, null, this && this.$$context) }; + } + const o4 = {}; + o4[this.path] = v4; + return cast(this.casterConstructor.schema, o4, null, this && this.$$context)[this.path]; + }, this); + return this.castForQuery(null, val, context); + } + function cast$elemMatch(val, context) { + const keys = Object.keys(val); + const numKeys = keys.length; + for (let i4 = 0; i4 < numKeys; ++i4) { + const key = keys[i4]; + const value = val[key]; + if (isOperator(key) && value != null) { + val[key] = this.castForQuery(key, value, context); + } + } + return val; + } + var handle = SchemaArray.prototype.$conditionalHandlers = {}; + handle.$all = cast$all; + handle.$options = String; + handle.$elemMatch = cast$elemMatch; + handle.$geoIntersects = geospatial.cast$geoIntersects; + handle.$or = createLogicalQueryOperatorHandler("$or"); + handle.$and = createLogicalQueryOperatorHandler("$and"); + handle.$nor = createLogicalQueryOperatorHandler("$nor"); + function createLogicalQueryOperatorHandler(op2) { + return function logicalQueryOperatorHandler(val, context) { + if (!Array.isArray(val)) { + throw new TypeError("conditional " + op2 + " requires an array"); + } + const ret = []; + for (const obj of val) { + ret.push(cast(this.casterConstructor.schema ?? context.schema, obj, null, this && this.$$context)); + } + return ret; + }; + } + handle.$near = handle.$nearSphere = geospatial.cast$near; + handle.$within = handle.$geoWithin = geospatial.cast$within; + handle.$size = handle.$minDistance = handle.$maxDistance = castToNumber; + handle.$exists = $exists; + handle.$type = $type; + handle.$eq = handle.$gt = handle.$gte = handle.$lt = handle.$lte = handle.$not = handle.$regex = handle.$ne = SchemaArray.prototype._castForQuery; + handle.$nin = SchemaType.prototype.$conditionalHandlers.$nin; + handle.$in = SchemaType.prototype.$conditionalHandlers.$in; + SchemaArray.prototype.toJSONSchema = function toJSONSchema(options) { + const embeddedSchemaType = this.getEmbeddedSchemaType(); + const isRequired = this.options.required && typeof this.options.required !== "function"; + return { + ...createJSONSchemaTypeDefinition("array", "array", options?.useBsonType, isRequired), + items: embeddedSchemaType.toJSONSchema(options) + }; + }; + SchemaArray.prototype.autoEncryptionType = function autoEncryptionType() { + return "array"; + }; + module2.exports = SchemaArray; + } +}); + +// node_modules/mongoose/lib/cast/bigint.js +var require_bigint = __commonJS({ + "node_modules/mongoose/lib/cast/bigint.js"(exports2, module2) { + "use strict"; + var { Long } = require_bson(); + var MAX_BIGINT = 9223372036854775807n; + var MIN_BIGINT = -9223372036854775808n; + var ERROR_MESSAGE = `Mongoose only supports BigInts between ${MIN_BIGINT} and ${MAX_BIGINT} because MongoDB does not support arbitrary precision integers`; + module2.exports = function castBigInt2(val) { + if (val == null) { + return val; + } + if (val === "") { + return null; + } + if (typeof val === "bigint") { + if (val > MAX_BIGINT || val < MIN_BIGINT) { + throw new Error(ERROR_MESSAGE); + } + return val; + } + if (val instanceof Long) { + return val.toBigInt(); + } + if (typeof val === "string" || typeof val === "number") { + val = BigInt(val); + if (val > MAX_BIGINT || val < MIN_BIGINT) { + throw new Error(ERROR_MESSAGE); + } + return val; + } + throw new Error(`Cannot convert value to BigInt: "${val}"`); + }; + } +}); + +// node_modules/mongoose/lib/schema/bigint.js +var require_bigint2 = __commonJS({ + "node_modules/mongoose/lib/schema/bigint.js"(exports2, module2) { + "use strict"; + var CastError = require_cast(); + var SchemaType = require_schemaType(); + var castBigInt2 = require_bigint(); + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + function SchemaBigInt(path, options, _schemaOptions, parentSchema) { + SchemaType.call(this, path, options, "BigInt", parentSchema); + } + SchemaBigInt.schemaName = "BigInt"; + SchemaBigInt.defaultOptions = {}; + SchemaBigInt.prototype = Object.create(SchemaType.prototype); + SchemaBigInt.prototype.constructor = SchemaBigInt; + SchemaBigInt._cast = castBigInt2; + SchemaBigInt.set = SchemaType.set; + SchemaBigInt.setters = []; + SchemaBigInt.get = SchemaType.get; + SchemaBigInt.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + return this._cast; + }; + SchemaBigInt._checkRequired = (v4) => v4 != null; + SchemaBigInt.checkRequired = SchemaType.checkRequired; + SchemaBigInt.prototype.checkRequired = function(value) { + return this.constructor._checkRequired(value); + }; + SchemaBigInt.prototype.cast = function(value) { + let castBigInt3; + if (typeof this._castFunction === "function") { + castBigInt3 = this._castFunction; + } else if (typeof this.constructor.cast === "function") { + castBigInt3 = this.constructor.cast(); + } else { + castBigInt3 = SchemaBigInt.cast(); + } + try { + return castBigInt3(value); + } catch (error2) { + throw new CastError("BigInt", value, this.path, error2, this); + } + }; + var $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle + }; + Object.defineProperty(SchemaBigInt.prototype, "$conditionalHandlers", { + enumerable: false, + value: $conditionalHandlers + }); + function handleSingle(val, context) { + return this.castForQuery(null, val, context); + } + SchemaBigInt.prototype.castForQuery = function($conditional, val, context) { + let handler2; + if ($conditional != null) { + handler2 = this.$conditionalHandlers[$conditional]; + if (handler2) { + return handler2.call(this, val); + } + return this.applySetters(val, context); + } + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } + }; + SchemaBigInt.prototype._castNullish = function _castNullish(v4) { + if (typeof v4 === "undefined") { + return v4; + } + const castBigInt3 = typeof this.constructor.cast === "function" ? this.constructor.cast() : SchemaBigInt.cast(); + if (castBigInt3 == null) { + return v4; + } + return v4; + }; + SchemaBigInt.prototype.toJSONSchema = function toJSONSchema(options) { + const isRequired = this.options.required && typeof this.options.required !== "function"; + return createJSONSchemaTypeDefinition("string", "long", options?.useBsonType, isRequired); + }; + SchemaBigInt.prototype.autoEncryptionType = function autoEncryptionType() { + return "long"; + }; + module2.exports = SchemaBigInt; + } +}); + +// node_modules/mongoose/lib/schema/boolean.js +var require_boolean2 = __commonJS({ + "node_modules/mongoose/lib/schema/boolean.js"(exports2, module2) { + "use strict"; + var CastError = require_cast(); + var SchemaType = require_schemaType(); + var castBoolean = require_boolean(); + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + function SchemaBoolean(path, options, _schemaOptions, parentSchema) { + SchemaType.call(this, path, options, "Boolean", parentSchema); + } + SchemaBoolean.schemaName = "Boolean"; + SchemaBoolean.defaultOptions = {}; + SchemaBoolean.prototype = Object.create(SchemaType.prototype); + SchemaBoolean.prototype.constructor = SchemaBoolean; + SchemaBoolean._cast = castBoolean; + SchemaBoolean.set = SchemaType.set; + SchemaBoolean.setters = []; + SchemaBoolean.get = SchemaType.get; + SchemaBoolean.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + return this._cast; + }; + SchemaBoolean._defaultCaster = (v4) => { + if (v4 != null && typeof v4 !== "boolean") { + throw new Error(); + } + return v4; + }; + SchemaBoolean._checkRequired = (v4) => v4 === true || v4 === false; + SchemaBoolean.checkRequired = SchemaType.checkRequired; + SchemaBoolean.prototype.checkRequired = function(value) { + return this.constructor._checkRequired(value); + }; + Object.defineProperty(SchemaBoolean, "convertToTrue", { + get: () => castBoolean.convertToTrue, + set: (v4) => { + castBoolean.convertToTrue = v4; + } + }); + Object.defineProperty(SchemaBoolean, "convertToFalse", { + get: () => castBoolean.convertToFalse, + set: (v4) => { + castBoolean.convertToFalse = v4; + } + }); + SchemaBoolean.prototype.cast = function(value) { + let castBoolean2; + if (typeof this._castFunction === "function") { + castBoolean2 = this._castFunction; + } else if (typeof this.constructor.cast === "function") { + castBoolean2 = this.constructor.cast(); + } else { + castBoolean2 = SchemaBoolean.cast(); + } + try { + return castBoolean2(value); + } catch (error2) { + throw new CastError("Boolean", value, this.path, error2, this); + } + }; + var $conditionalHandlers = { ...SchemaType.prototype.$conditionalHandlers }; + Object.defineProperty(SchemaBoolean.prototype, "$conditionalHandlers", { + enumerable: false, + value: $conditionalHandlers + }); + SchemaBoolean.prototype.castForQuery = function($conditional, val, context) { + let handler2; + if ($conditional != null) { + handler2 = this.$conditionalHandlers[$conditional]; + if (handler2) { + return handler2.call(this, val); + } + return this.applySetters(val, context); + } + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } + }; + SchemaBoolean.prototype._castNullish = function _castNullish(v4) { + if (typeof v4 === "undefined") { + return v4; + } + const castBoolean2 = typeof this.constructor.cast === "function" ? this.constructor.cast() : SchemaBoolean.cast(); + if (castBoolean2 == null) { + return v4; + } + if (castBoolean2.convertToFalse instanceof Set && castBoolean2.convertToFalse.has(v4)) { + return false; + } + if (castBoolean2.convertToTrue instanceof Set && castBoolean2.convertToTrue.has(v4)) { + return true; + } + return v4; + }; + SchemaBoolean.prototype.toJSONSchema = function toJSONSchema(options) { + const isRequired = this.options.required && typeof this.options.required !== "function"; + return createJSONSchemaTypeDefinition("boolean", "bool", options?.useBsonType, isRequired); + }; + SchemaBoolean.prototype.autoEncryptionType = function autoEncryptionType() { + return "bool"; + }; + module2.exports = SchemaBoolean; + } +}); + +// node_modules/mongoose/lib/options/schemaBufferOptions.js +var require_schemaBufferOptions = __commonJS({ + "node_modules/mongoose/lib/options/schemaBufferOptions.js"(exports2, module2) { + "use strict"; + var SchemaTypeOptions = require_schemaTypeOptions(); + var SchemaBufferOptions = class extends SchemaTypeOptions { + }; + var opts = require_propertyOptions(); + Object.defineProperty(SchemaBufferOptions.prototype, "subtype", opts); + module2.exports = SchemaBufferOptions; + } +}); + +// node_modules/mongoose/lib/schema/buffer.js +var require_buffer2 = __commonJS({ + "node_modules/mongoose/lib/schema/buffer.js"(exports2, module2) { + "use strict"; + var MongooseBuffer = require_buffer(); + var SchemaBufferOptions = require_schemaBufferOptions(); + var SchemaType = require_schemaType(); + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + var handleBitwiseOperator = require_bitwise(); + var utils = require_utils6(); + var Binary = MongooseBuffer.Binary; + var CastError = SchemaType.CastError; + function SchemaBuffer(key, options, _schemaOptions, parentSchema) { + SchemaType.call(this, key, options, "Buffer", parentSchema); + } + SchemaBuffer.schemaName = "Buffer"; + SchemaBuffer.defaultOptions = {}; + SchemaBuffer.prototype = Object.create(SchemaType.prototype); + SchemaBuffer.prototype.constructor = SchemaBuffer; + SchemaBuffer.prototype.OptionsConstructor = SchemaBufferOptions; + SchemaBuffer._checkRequired = (v4) => !!(v4 && v4.length); + SchemaBuffer.set = SchemaType.set; + SchemaBuffer.setters = []; + SchemaBuffer.get = SchemaType.get; + SchemaBuffer.checkRequired = SchemaType.checkRequired; + SchemaBuffer.prototype.checkRequired = function(value, doc) { + if (SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + return this.constructor._checkRequired(value); + }; + SchemaBuffer.prototype.cast = function(value, doc, init, prev, options) { + let ret; + if (SchemaType._isRef(this, value, doc, init)) { + if (value && value.isMongooseBuffer) { + return value; + } + if (Buffer.isBuffer(value)) { + if (!value || !value.isMongooseBuffer) { + value = new MongooseBuffer(value, [this.path, doc]); + if (this.options.subtype != null) { + value._subtype = this.options.subtype; + } + } + return value; + } + if (value instanceof Binary) { + ret = new MongooseBuffer(value.value(true), [this.path, doc]); + if (typeof value.sub_type !== "number") { + throw new CastError("Buffer", value, this.path, null, this); + } + ret._subtype = value.sub_type; + return ret; + } + if (value == null || utils.isNonBuiltinObject(value)) { + return this._castRef(value, doc, init, options); + } + } + if (value && value._id) { + value = value._id; + } + if (value && value.isMongooseBuffer) { + return value; + } + if (Buffer.isBuffer(value)) { + if (!value || !value.isMongooseBuffer) { + value = new MongooseBuffer(value, [this.path, doc]); + if (this.options.subtype != null) { + value._subtype = this.options.subtype; + } + } + return value; + } + if (value instanceof Binary) { + ret = new MongooseBuffer(value.value(true), [this.path, doc]); + if (typeof value.sub_type !== "number") { + throw new CastError("Buffer", value, this.path, null, this); + } + ret._subtype = value.sub_type; + return ret; + } + if (value === null) { + return value; + } + const type = typeof value; + if (type === "string" || type === "number" || Array.isArray(value) || type === "object" && value.type === "Buffer" && Array.isArray(value.data)) { + if (type === "number") { + value = [value]; + } + ret = new MongooseBuffer(value, [this.path, doc]); + if (this.options.subtype != null) { + ret._subtype = this.options.subtype; + } + return ret; + } + if (utils.isPOJO(value) && (value.$binary instanceof Binary || typeof value.$binary === "string")) { + const buf = this.cast(Buffer.from(value.$binary, "base64")); + if (value.$type != null) { + buf._subtype = value.$type; + return buf; + } + } + throw new CastError("Buffer", value, this.path, null, this); + }; + SchemaBuffer.prototype.subtype = function(subtype) { + this.options.subtype = subtype; + return this; + }; + function handleSingle(val, context) { + return this.castForQuery(null, val, context); + } + var $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $bitsAllClear: handleBitwiseOperator, + $bitsAnyClear: handleBitwiseOperator, + $bitsAllSet: handleBitwiseOperator, + $bitsAnySet: handleBitwiseOperator, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle + }; + Object.defineProperty(SchemaBuffer.prototype, "$conditionalHandlers", { + enumerable: false, + value: $conditionalHandlers + }); + SchemaBuffer.prototype.castForQuery = function($conditional, val, context) { + let handler2; + if ($conditional != null) { + handler2 = this.$conditionalHandlers[$conditional]; + if (!handler2) { + throw new Error("Can't use " + $conditional + " with Buffer."); + } + return handler2.call(this, val); + } + let casted; + try { + casted = this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } + return casted ? casted.toObject({ transform: false, virtuals: false }) : casted; + }; + SchemaBuffer.prototype.toJSONSchema = function toJSONSchema(options) { + const isRequired = this.options.required && typeof this.options.required !== "function"; + return createJSONSchemaTypeDefinition("string", "binData", options?.useBsonType, isRequired); + }; + SchemaBuffer.prototype.autoEncryptionType = function autoEncryptionType() { + return "binData"; + }; + module2.exports = SchemaBuffer; + } +}); + +// node_modules/mongoose/lib/options/schemaDateOptions.js +var require_schemaDateOptions = __commonJS({ + "node_modules/mongoose/lib/options/schemaDateOptions.js"(exports2, module2) { + "use strict"; + var SchemaTypeOptions = require_schemaTypeOptions(); + var SchemaDateOptions = class extends SchemaTypeOptions { + }; + var opts = require_propertyOptions(); + Object.defineProperty(SchemaDateOptions.prototype, "min", opts); + Object.defineProperty(SchemaDateOptions.prototype, "max", opts); + Object.defineProperty(SchemaDateOptions.prototype, "expires", opts); + module2.exports = SchemaDateOptions; + } +}); + +// node_modules/mongoose/lib/cast/date.js +var require_date = __commonJS({ + "node_modules/mongoose/lib/cast/date.js"(exports2, module2) { + "use strict"; + var assert = require("assert"); + module2.exports = function castDate(value) { + if (value == null || value === "") { + return null; + } + if (value instanceof Date) { + assert.ok(!isNaN(value.valueOf())); + return value; + } + let date2; + assert.ok(typeof value !== "boolean"); + if (value instanceof Number || typeof value === "number") { + date2 = new Date(value); + } else if (typeof value === "string" && !isNaN(Number(value)) && (Number(value) >= 275761 || Number(value) < -271820)) { + date2 = new Date(Number(value)); + } else if (typeof value.valueOf === "function") { + date2 = new Date(value.valueOf()); + } else { + date2 = new Date(value); + } + if (!isNaN(date2.valueOf())) { + return date2; + } + assert.ok(false); + }; + } +}); + +// node_modules/mongoose/lib/schema/date.js +var require_date2 = __commonJS({ + "node_modules/mongoose/lib/schema/date.js"(exports2, module2) { + "use strict"; + var MongooseError = require_error2(); + var SchemaDateOptions = require_schemaDateOptions(); + var SchemaType = require_schemaType(); + var castDate = require_date(); + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + var getConstructorName = require_getConstructorName(); + var utils = require_utils6(); + var CastError = SchemaType.CastError; + function SchemaDate(key, options, _schemaOptions, parentSchema) { + SchemaType.call(this, key, options, "Date", parentSchema); + } + SchemaDate.schemaName = "Date"; + SchemaDate.defaultOptions = {}; + SchemaDate.prototype = Object.create(SchemaType.prototype); + SchemaDate.prototype.constructor = SchemaDate; + SchemaDate.prototype.OptionsConstructor = SchemaDateOptions; + SchemaDate._cast = castDate; + SchemaDate.set = SchemaType.set; + SchemaDate.setters = []; + SchemaDate.get = SchemaType.get; + SchemaDate.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + return this._cast; + }; + SchemaDate._defaultCaster = (v4) => { + if (v4 != null && !(v4 instanceof Date)) { + throw new Error(); + } + return v4; + }; + SchemaDate.prototype.expires = function(when) { + if (getConstructorName(this._index) !== "Object") { + this._index = {}; + } + this._index.expires = when; + utils.expires(this._index); + return this; + }; + SchemaDate._checkRequired = (v4) => v4 instanceof Date; + SchemaDate.checkRequired = SchemaType.checkRequired; + SchemaDate.prototype.checkRequired = function(value, doc) { + if (typeof value === "object" && SchemaType._isRef(this, value, doc, true)) { + return value != null; + } + const _checkRequired = typeof this.constructor.checkRequired === "function" ? this.constructor.checkRequired() : SchemaDate.checkRequired(); + return _checkRequired(value); + }; + SchemaDate.prototype.min = function(value, message2) { + if (this.minValidator) { + this.validators = this.validators.filter(function(v4) { + return v4.validator !== this.minValidator; + }, this); + } + if (value) { + let msg = message2 || MongooseError.messages.Date.min; + if (typeof msg === "string") { + msg = msg.replace(/{MIN}/, value === Date.now ? "Date.now()" : value.toString()); + } + const _this = this; + this.validators.push({ + validator: this.minValidator = function(val) { + let _value = value; + if (typeof value === "function" && value !== Date.now) { + _value = _value.call(this); + } + const min = _value === Date.now ? _value() : _this.cast(_value); + return val === null || val.valueOf() >= min.valueOf(); + }, + message: msg, + type: "min", + min: value + }); + } + return this; + }; + SchemaDate.prototype.max = function(value, message2) { + if (this.maxValidator) { + this.validators = this.validators.filter(function(v4) { + return v4.validator !== this.maxValidator; + }, this); + } + if (value) { + let msg = message2 || MongooseError.messages.Date.max; + if (typeof msg === "string") { + msg = msg.replace(/{MAX}/, value === Date.now ? "Date.now()" : value.toString()); + } + const _this = this; + this.validators.push({ + validator: this.maxValidator = function(val) { + let _value = value; + if (typeof _value === "function" && _value !== Date.now) { + _value = _value.call(this); + } + const max = _value === Date.now ? _value() : _this.cast(_value); + return val === null || val.valueOf() <= max.valueOf(); + }, + message: msg, + type: "max", + max: value + }); + } + return this; + }; + SchemaDate.prototype.cast = function(value) { + let castDate2; + if (typeof this._castFunction === "function") { + castDate2 = this._castFunction; + } else if (typeof this.constructor.cast === "function") { + castDate2 = this.constructor.cast(); + } else { + castDate2 = SchemaDate.cast(); + } + try { + return castDate2(value); + } catch (error2) { + throw new CastError("date", value, this.path, error2, this); + } + }; + function handleSingle(val) { + return this.cast(val); + } + var $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle + }; + Object.defineProperty(SchemaDate.prototype, "$conditionalHandlers", { + enumerable: false, + value: $conditionalHandlers + }); + SchemaDate.prototype.castForQuery = function($conditional, val, context) { + if ($conditional == null) { + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } + } + const handler2 = this.$conditionalHandlers[$conditional]; + if (!handler2) { + throw new Error("Can't use " + $conditional + " with Date."); + } + return handler2.call(this, val); + }; + SchemaDate.prototype.toJSONSchema = function toJSONSchema(options) { + const isRequired = this.options.required && typeof this.options.required !== "function"; + return createJSONSchemaTypeDefinition("string", "date", options?.useBsonType, isRequired); + }; + SchemaDate.prototype.autoEncryptionType = function autoEncryptionType() { + return "date"; + }; + module2.exports = SchemaDate; + } +}); + +// node_modules/mongoose/lib/cast/decimal128.js +var require_decimal1282 = __commonJS({ + "node_modules/mongoose/lib/cast/decimal128.js"(exports2, module2) { + "use strict"; + var Decimal128Type = require_decimal128(); + var assert = require("assert"); + module2.exports = function castDecimal128(value) { + if (value == null) { + return value; + } + if (typeof value === "object" && typeof value.$numberDecimal === "string") { + return Decimal128Type.fromString(value.$numberDecimal); + } + if (value instanceof Decimal128Type) { + return value; + } + if (typeof value === "string") { + return Decimal128Type.fromString(value); + } + if (typeof Buffer === "function" && Buffer.isBuffer(value)) { + return new Decimal128Type(value); + } + if (typeof Uint8Array === "function" && value instanceof Uint8Array) { + return new Decimal128Type(value); + } + if (typeof value === "number") { + return Decimal128Type.fromString(String(value)); + } + if (typeof value.valueOf === "function" && typeof value.valueOf() === "string") { + return Decimal128Type.fromString(value.valueOf()); + } + assert.ok(false); + }; + } +}); + +// node_modules/mongoose/lib/schema/decimal128.js +var require_decimal1283 = __commonJS({ + "node_modules/mongoose/lib/schema/decimal128.js"(exports2, module2) { + "use strict"; + var SchemaType = require_schemaType(); + var CastError = SchemaType.CastError; + var castDecimal128 = require_decimal1282(); + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + var isBsonType = require_isBsonType(); + function SchemaDecimal128(key, options, _schemaOptions, parentSchema) { + SchemaType.call(this, key, options, "Decimal128", parentSchema); + } + SchemaDecimal128.schemaName = "Decimal128"; + SchemaDecimal128.defaultOptions = {}; + SchemaDecimal128.prototype = Object.create(SchemaType.prototype); + SchemaDecimal128.prototype.constructor = SchemaDecimal128; + SchemaDecimal128._cast = castDecimal128; + SchemaDecimal128.set = SchemaType.set; + SchemaDecimal128.setters = []; + SchemaDecimal128.get = SchemaType.get; + SchemaDecimal128.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + return this._cast; + }; + SchemaDecimal128._defaultCaster = (v4) => { + if (v4 != null && !isBsonType(v4, "Decimal128")) { + throw new Error(); + } + return v4; + }; + SchemaDecimal128._checkRequired = (v4) => isBsonType(v4, "Decimal128"); + SchemaDecimal128.checkRequired = SchemaType.checkRequired; + SchemaDecimal128.prototype.checkRequired = function checkRequired(value, doc) { + if (SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + const _checkRequired = typeof this.constructor.checkRequired === "function" ? this.constructor.checkRequired() : SchemaDecimal128.checkRequired(); + return _checkRequired(value); + }; + SchemaDecimal128.prototype.cast = function(value, doc, init, prev, options) { + if (SchemaType._isRef(this, value, doc, init)) { + if (isBsonType(value, "Decimal128")) { + return value; + } + return this._castRef(value, doc, init, options); + } + let castDecimal1282; + if (typeof this._castFunction === "function") { + castDecimal1282 = this._castFunction; + } else if (typeof this.constructor.cast === "function") { + castDecimal1282 = this.constructor.cast(); + } else { + castDecimal1282 = SchemaDecimal128.cast(); + } + try { + return castDecimal1282(value); + } catch (error2) { + throw new CastError("Decimal128", value, this.path, error2, this); + } + }; + function handleSingle(val) { + return this.cast(val); + } + var $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle + }; + Object.defineProperty(SchemaDecimal128.prototype, "$conditionalHandlers", { + enumerable: false, + value: $conditionalHandlers + }); + SchemaDecimal128.prototype.toJSONSchema = function toJSONSchema(options) { + const isRequired = this.options.required && typeof this.options.required !== "function"; + return createJSONSchemaTypeDefinition("string", "decimal", options?.useBsonType, isRequired); + }; + SchemaDecimal128.prototype.autoEncryptionType = function autoEncryptionType() { + return "decimal"; + }; + module2.exports = SchemaDecimal128; + } +}); + +// node_modules/mongoose/lib/options/schemaSubdocumentOptions.js +var require_schemaSubdocumentOptions = __commonJS({ + "node_modules/mongoose/lib/options/schemaSubdocumentOptions.js"(exports2, module2) { + "use strict"; + var SchemaTypeOptions = require_schemaTypeOptions(); + var SchemaSubdocumentOptions = class extends SchemaTypeOptions { + }; + var opts = require_propertyOptions(); + Object.defineProperty(SchemaSubdocumentOptions.prototype, "_id", opts); + Object.defineProperty(SchemaSubdocumentOptions.prototype, "minimize", opts); + module2.exports = SchemaSubdocumentOptions; + } +}); + +// node_modules/mongoose/lib/helpers/each.js +var require_each = __commonJS({ + "node_modules/mongoose/lib/helpers/each.js"(exports2, module2) { + "use strict"; + module2.exports = function each(arr, cb, done) { + if (arr.length === 0) { + return done(); + } + let remaining = arr.length; + let err = null; + for (const v4 of arr) { + cb(v4, function(_err) { + if (err != null) { + return; + } + if (_err != null) { + err = _err; + return done(err); + } + if (--remaining <= 0) { + return done(); + } + }); + } + }; + } +}); + +// node_modules/mongoose/lib/plugins/saveSubdocs.js +var require_saveSubdocs = __commonJS({ + "node_modules/mongoose/lib/plugins/saveSubdocs.js"(exports2, module2) { + "use strict"; + var each = require_each(); + module2.exports = function saveSubdocs(schema) { + const unshift = true; + schema.s.hooks.pre("save", false, function saveSubdocsPreSave(next) { + if (this.$isSubdocument) { + next(); + return; + } + const _this = this; + const subdocs = this.$getAllSubdocs({ useCache: true }); + if (!subdocs.length) { + next(); + return; + } + each(subdocs, function(subdoc, cb) { + subdoc.$__schema.s.hooks.execPre("save", subdoc, function(err) { + cb(err); + }); + }, function(error2) { + if (_this.$__.saveOptions) { + _this.$__.saveOptions.__subdocs = null; + } + if (error2) { + return _this.$__schema.s.hooks.execPost("save:error", _this, [_this], { error: error2 }, function(error3) { + next(error3); + }); + } + next(); + }); + }, null, unshift); + schema.s.hooks.post("save", async function saveSubdocsPostDeleteOne() { + const removedSubdocs = this.$__.removedSubdocs; + if (!removedSubdocs || !removedSubdocs.length) { + return; + } + const promises = []; + for (const subdoc of removedSubdocs) { + promises.push(new Promise((resolve, reject) => { + subdoc.$__schema.s.hooks.execPost("deleteOne", subdoc, [subdoc], function(err) { + if (err) { + return reject(err); + } + resolve(); + }); + })); + } + this.$__.removedSubdocs = null; + await Promise.all(promises); + }); + schema.s.hooks.post("save", async function saveSubdocsPostSave() { + if (this.$isSubdocument) { + return; + } + const _this = this; + const subdocs = this.$getAllSubdocs({ useCache: true }); + if (!subdocs.length) { + return; + } + const promises = []; + for (const subdoc of subdocs) { + promises.push(new Promise((resolve, reject) => { + subdoc.$__schema.s.hooks.execPost("save", subdoc, [subdoc], function(err) { + if (err) { + return reject(err); + } + resolve(); + }); + })); + } + try { + await Promise.all(promises); + } catch (error2) { + await new Promise((resolve, reject) => { + this.$__schema.s.hooks.execPost("save:error", _this, [_this], { error: error2 }, function(error3) { + if (error3) { + return reject(error3); + } + resolve(); + }); + }); + } + }, null, unshift); + }; + } +}); + +// node_modules/mongoose/lib/plugins/sharding.js +var require_sharding = __commonJS({ + "node_modules/mongoose/lib/plugins/sharding.js"(exports2, module2) { + "use strict"; + var objectIdSymbol = require_symbols().objectIdSymbol; + var utils = require_utils6(); + module2.exports = function shardingPlugin(schema) { + schema.post("init", function shardingPluginPostInit() { + storeShard.call(this); + return this; + }); + schema.pre("save", function shardingPluginPreSave(next) { + applyWhere.call(this); + next(); + }); + schema.pre("deleteOne", { document: true, query: false }, function shardingPluginPreRemove(next) { + applyWhere.call(this); + next(); + }); + schema.post("save", function shardingPluginPostSave() { + storeShard.call(this); + }); + }; + function applyWhere() { + let paths; + let len; + if (this.$__.shardval) { + paths = Object.keys(this.$__.shardval); + len = paths.length; + this.$where = this.$where || {}; + for (let i4 = 0; i4 < len; ++i4) { + this.$where[paths[i4]] = this.$__.shardval[paths[i4]]; + } + } + } + module2.exports.storeShard = storeShard; + function storeShard() { + const key = this.$__schema.options.shardKey || this.$__schema.options.shardkey; + if (!utils.isPOJO(key)) { + return; + } + const orig = this.$__.shardval = {}; + const paths = Object.keys(key); + const len = paths.length; + let val; + for (let i4 = 0; i4 < len; ++i4) { + val = this.$__getValue(paths[i4]); + if (val == null) { + orig[paths[i4]] = val; + } else if (utils.isMongooseObject(val)) { + orig[paths[i4]] = val.toObject({ depopulate: true, _isNested: true }); + } else if (val instanceof Date || val[objectIdSymbol]) { + orig[paths[i4]] = val; + } else if (typeof val.valueOf === "function") { + orig[paths[i4]] = val.valueOf(); + } else { + orig[paths[i4]] = val; + } + } + } + } +}); + +// node_modules/mongoose/lib/plugins/trackTransaction.js +var require_trackTransaction = __commonJS({ + "node_modules/mongoose/lib/plugins/trackTransaction.js"(exports2, module2) { + "use strict"; + var arrayAtomicsSymbol = require_symbols().arrayAtomicsSymbol; + var sessionNewDocuments = require_symbols().sessionNewDocuments; + var utils = require_utils6(); + module2.exports = function trackTransaction(schema) { + schema.pre("save", function trackTransactionPreSave() { + const session = this.$session(); + if (session == null) { + return; + } + if (session.transaction == null || session[sessionNewDocuments] == null) { + return; + } + if (!session[sessionNewDocuments].has(this)) { + const initialState = {}; + if (this.isNew) { + initialState.isNew = true; + } + if (this.$__schema.options.versionKey) { + initialState.versionKey = this.get(this.$__schema.options.versionKey); + } + initialState.modifiedPaths = new Set(Object.keys(this.$__.activePaths.getStatePaths("modify"))); + initialState.atomics = _getAtomics(this); + session[sessionNewDocuments].set(this, initialState); + } + }); + }; + function _getAtomics(doc, previous) { + const pathToAtomics = /* @__PURE__ */ new Map(); + previous = previous || /* @__PURE__ */ new Map(); + const pathsToCheck = Object.keys(doc.$__.activePaths.init).concat(Object.keys(doc.$__.activePaths.modify)); + for (const path of pathsToCheck) { + const val = doc.$__getValue(path); + if (val != null && Array.isArray(val) && utils.isMongooseDocumentArray(val) && val.length && val[arrayAtomicsSymbol] != null && Object.keys(val[arrayAtomicsSymbol]).length !== 0) { + const existing = previous.get(path) || {}; + pathToAtomics.set(path, mergeAtomics(existing, val[arrayAtomicsSymbol])); + } + } + const dirty = doc.$__dirty(); + for (const dirt of dirty) { + const path = dirt.path; + const val = dirt.value; + if (val != null && val[arrayAtomicsSymbol] != null && Object.keys(val[arrayAtomicsSymbol]).length !== 0) { + const existing = previous.get(path) || {}; + pathToAtomics.set(path, mergeAtomics(existing, val[arrayAtomicsSymbol])); + } + } + return pathToAtomics; + } + function mergeAtomics(destination, source) { + destination = destination || {}; + if (source.$pullAll != null) { + destination.$pullAll = (destination.$pullAll || []).concat(source.$pullAll); + } + if (source.$push != null) { + destination.$push = destination.$push || {}; + destination.$push.$each = (destination.$push.$each || []).concat(source.$push.$each); + } + if (source.$addToSet != null) { + destination.$addToSet = (destination.$addToSet || []).concat(source.$addToSet); + } + if (source.$set != null) { + destination.$set = Array.isArray(source.$set) ? [...source.$set] : Object.assign({}, source.$set); + } + return destination; + } + } +}); + +// node_modules/mongoose/lib/plugins/validateBeforeSave.js +var require_validateBeforeSave = __commonJS({ + "node_modules/mongoose/lib/plugins/validateBeforeSave.js"(exports2, module2) { + "use strict"; + module2.exports = function validateBeforeSave(schema) { + const unshift = true; + schema.pre("save", false, function validateBeforeSave2(next, options) { + const _this = this; + if (this.$isSubdocument) { + return next(); + } + const hasValidateBeforeSaveOption = options && typeof options === "object" && "validateBeforeSave" in options; + let shouldValidate; + if (hasValidateBeforeSaveOption) { + shouldValidate = !!options.validateBeforeSave; + } else { + shouldValidate = this.$__schema.options.validateBeforeSave; + } + if (shouldValidate) { + const hasValidateModifiedOnlyOption = options && typeof options === "object" && "validateModifiedOnly" in options; + const validateOptions = hasValidateModifiedOnlyOption ? { validateModifiedOnly: options.validateModifiedOnly } : null; + this.$validate(validateOptions).then( + () => { + this.$op = "save"; + next(); + }, + (error2) => { + _this.$__schema.s.hooks.execPost("save:error", _this, [_this], { error: error2 }, function(error3) { + _this.$op = "save"; + next(error3); + }); + } + ); + } else { + next(); + } + }, null, unshift); + }; + } +}); + +// node_modules/mongoose/lib/plugins/index.js +var require_plugins = __commonJS({ + "node_modules/mongoose/lib/plugins/index.js"(exports2) { + "use strict"; + exports2.saveSubdocs = require_saveSubdocs(); + exports2.sharding = require_sharding(); + exports2.trackTransaction = require_trackTransaction(); + exports2.validateBeforeSave = require_validateBeforeSave(); + } +}); + +// node_modules/mongoose/lib/helpers/schema/applyBuiltinPlugins.js +var require_applyBuiltinPlugins = __commonJS({ + "node_modules/mongoose/lib/helpers/schema/applyBuiltinPlugins.js"(exports2, module2) { + "use strict"; + var builtinPlugins = require_plugins(); + module2.exports = function applyBuiltinPlugins(schema) { + for (const plugin of Object.values(builtinPlugins)) { + plugin(schema, { deduplicate: true }); + } + schema.plugins = Object.values(builtinPlugins).map((fn2) => ({ fn: fn2, opts: { deduplicate: true } })).concat(schema.plugins); + }; + } +}); + +// node_modules/mongoose/lib/helpers/discriminator/mergeDiscriminatorSchema.js +var require_mergeDiscriminatorSchema = __commonJS({ + "node_modules/mongoose/lib/helpers/discriminator/mergeDiscriminatorSchema.js"(exports2, module2) { + "use strict"; + var schemaMerge = require_merge(); + var specialProperties = require_specialProperties(); + var isBsonType = require_isBsonType(); + var ObjectId2 = require_objectid(); + var SchemaType = require_schemaType(); + var isObject = require_isObject(); + module2.exports = function mergeDiscriminatorSchema(to, from, path, seen) { + const keys = Object.keys(from); + let i4 = 0; + const len = keys.length; + let key; + path = path || ""; + seen = seen || /* @__PURE__ */ new WeakSet(); + if (seen.has(from)) { + return; + } + seen.add(from); + while (i4 < len) { + key = keys[i4++]; + if (!path) { + if (key === "discriminators" || key === "base" || key === "_applyDiscriminators" || key === "_userProvidedOptions" || key === "options" || key === "tree") { + continue; + } + } + if (path === "tree" && from != null && from.instanceOfSchema) { + continue; + } + if (specialProperties.has(key)) { + continue; + } + if (to[key] == null) { + to[key] = from[key]; + } else if (isObject(from[key])) { + if (!isObject(to[key])) { + to[key] = {}; + } + if (from[key] != null) { + if (from[key].$isSingleNested && to[key].$isMongooseDocumentArray || from[key].$isMongooseDocumentArray && to[key].$isSingleNested || from[key].$isMongooseDocumentArrayElement && to[key].$isMongooseDocumentArrayElement) { + continue; + } else if (from[key].instanceOfSchema) { + if (to[key].instanceOfSchema) { + schemaMerge(to[key], from[key].clone(), true); + } else { + to[key] = from[key].clone(); + } + continue; + } else if (isBsonType(from[key], "ObjectId")) { + to[key] = new ObjectId2(from[key]); + continue; + } else if (from[key] instanceof SchemaType) { + if (to[key] == null) { + to[key] = from[key].clone(); + } + if (!from[key].$isMongooseDocumentArray && !from[key].$isSingleNested) { + continue; + } + } + } + mergeDiscriminatorSchema(to[key], from[key], path ? path + "." + key : key, seen); + } + } + if (from != null && from.instanceOfSchema) { + to.tree = Object.assign({}, from.tree, to.tree); + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/model/discriminator.js +var require_discriminator = __commonJS({ + "node_modules/mongoose/lib/helpers/model/discriminator.js"(exports2, module2) { + "use strict"; + var Mixed = require_mixed(); + var applyBuiltinPlugins = require_applyBuiltinPlugins(); + var clone = require_clone(); + var defineKey = require_compile().defineKey; + var get2 = require_get(); + var utils = require_utils6(); + var mergeDiscriminatorSchema = require_mergeDiscriminatorSchema(); + var CUSTOMIZABLE_DISCRIMINATOR_OPTIONS = { + toJSON: true, + toObject: true, + _id: true, + id: true, + virtuals: true, + methods: true, + statics: true + }; + function validateDiscriminatorSchemasForEncryption(parentSchema, childSchema) { + if (parentSchema.encryptionType() == null && childSchema.encryptionType() == null) return; + const allSharedNestedPaths = setIntersection( + allNestedPaths(parentSchema), + allNestedPaths(childSchema) + ); + for (const path of allSharedNestedPaths) { + if (parentSchema._hasEncryptedField(path) && childSchema._hasEncryptedField(path)) { + throw new Error(`encrypted fields cannot be declared on both the base schema and the child schema in a discriminator. path=${path}`); + } + if (parentSchema._hasEncryptedField(path) || childSchema._hasEncryptedField(path)) { + throw new Error(`encrypted fields cannot have the same path as a non-encrypted field for discriminators. path=${path}`); + } + } + function allNestedPaths(schema) { + return [...Object.keys(schema.paths), ...Object.keys(schema.singleNestedPaths)]; + } + function* setIntersection(i1, i22) { + const s1 = new Set(i1); + for (const item of i22) { + if (s1.has(item)) { + yield item; + } + } + } + } + module2.exports = function discriminator(model, name, schema, tiedValue, applyPlugins, mergeHooks, overwriteExisting) { + if (!(schema && schema.instanceOfSchema)) { + throw new Error("You must pass a valid discriminator Schema"); + } + mergeHooks = mergeHooks == null ? true : mergeHooks; + if (model.schema.discriminatorMapping && !model.schema.discriminatorMapping.isRoot) { + throw new Error('Discriminator "' + name + '" can only be a discriminator of the root model'); + } + if (applyPlugins) { + const applyPluginsToDiscriminators = get2( + model.base, + "options.applyPluginsToDiscriminators", + false + ) || !mergeHooks; + model.base._applyPlugins(schema, { + skipTopLevel: !applyPluginsToDiscriminators + }); + } else if (!mergeHooks) { + applyBuiltinPlugins(schema); + } + const key = model.schema.options.discriminatorKey; + const existingPath = model.schema.path(key); + if (existingPath != null) { + if (!utils.hasUserDefinedProperty(existingPath.options, "select")) { + existingPath.options.select = true; + } + existingPath.options.$skipDiscriminatorCheck = true; + } else { + const baseSchemaAddition = {}; + baseSchemaAddition[key] = { + default: void 0, + select: true, + $skipDiscriminatorCheck: true + }; + baseSchemaAddition[key][model.schema.options.typeKey] = String; + model.schema.add(baseSchemaAddition); + defineKey({ + prop: key, + prototype: model.prototype, + options: model.schema.options + }); + } + if (schema.path(key) && schema.path(key).options.$skipDiscriminatorCheck !== true) { + throw new Error('Discriminator "' + name + '" cannot have field with name "' + key + '"'); + } + let value = name; + if (typeof tiedValue === "string" && tiedValue.length || tiedValue != null) { + value = tiedValue; + } + validateDiscriminatorSchemasForEncryption(model.schema, schema); + function merge(schema2, baseSchema) { + schema2._baseSchema = baseSchema; + if (baseSchema.paths._id && baseSchema.paths._id.options && !baseSchema.paths._id.options.auto) { + schema2.remove("_id"); + } + const baseSchemaPaths = Object.keys(baseSchema.paths); + const conflictingPaths = []; + for (const path of baseSchemaPaths) { + if (schema2.nested[path]) { + conflictingPaths.push(path); + continue; + } + if (path.indexOf(".") === -1) { + continue; + } + const sp = path.split(".").slice(0, -1); + let cur = ""; + for (const piece of sp) { + cur += (cur.length ? "." : "") + piece; + if (schema2.paths[cur] instanceof Mixed || schema2.singleNestedPaths[cur] instanceof Mixed) { + conflictingPaths.push(path); + } + } + } + schema2.obj = { ...schema2.obj }; + mergeDiscriminatorSchema(schema2, baseSchema); + schema2._gatherChildSchemas(); + for (const conflictingPath of conflictingPaths) { + delete schema2.paths[conflictingPath]; + } + schema2.childSchemas.forEach((obj2) => { + obj2.model.prototype.$__setSchema(obj2.schema); + }); + const obj = {}; + obj[key] = { + default: value, + select: true, + set: function(newName) { + if (newName === value || Array.isArray(value) && utils.deepEqual(newName, value)) { + return value; + } + throw new Error(`Can't set discriminator key "` + key + '"'); + }, + $skipDiscriminatorCheck: true + }; + obj[key][schema2.options.typeKey] = existingPath ? existingPath.options[schema2.options.typeKey] : String; + schema2.add(obj); + schema2.discriminatorMapping = { key, value, isRoot: false }; + if (baseSchema.options.collection) { + schema2.options.collection = baseSchema.options.collection; + } + const toJSON = schema2.options.toJSON; + const toObject = schema2.options.toObject; + const _id = schema2.options._id; + const id = schema2.options.id; + const keys = Object.keys(schema2.options); + schema2.options.discriminatorKey = baseSchema.options.discriminatorKey; + const userProvidedOptions = schema2._userProvidedOptions; + for (const _key of keys) { + if (!CUSTOMIZABLE_DISCRIMINATOR_OPTIONS[_key]) { + if (_key in userProvidedOptions && !utils.deepEqual(schema2.options[_key], baseSchema.options[_key])) { + throw new Error("Can't customize discriminator option " + _key + " (can only modify " + Object.keys(CUSTOMIZABLE_DISCRIMINATOR_OPTIONS).join(", ") + ")"); + } + } + } + schema2.options = clone(baseSchema.options); + for (const _key of Object.keys(userProvidedOptions)) { + schema2.options[_key] = userProvidedOptions[_key]; + } + if (toJSON) schema2.options.toJSON = toJSON; + if (toObject) schema2.options.toObject = toObject; + if (typeof _id !== "undefined") { + schema2.options._id = _id; + } + schema2.options.id = id; + if (mergeHooks) { + schema2.s.hooks = model.schema.s.hooks.merge(schema2.s.hooks); + } + if (applyPlugins) { + schema2.plugins = Array.prototype.slice.call(baseSchema.plugins); + } + schema2.callQueue = baseSchema.callQueue.concat(schema2.callQueue); + delete schema2._requiredpaths; + } + merge(schema, model.schema); + if (!model.discriminators) { + model.discriminators = {}; + } + if (!model.schema.discriminatorMapping) { + model.schema.discriminatorMapping = { key, value: null, isRoot: true }; + } + if (!model.schema.discriminators) { + model.schema.discriminators = {}; + } + model.schema.discriminators[name] = schema; + if (model.discriminators[name] && !schema.options.overwriteModels && !overwriteExisting) { + throw new Error('Discriminator with name "' + name + '" already exists'); + } + return schema; + }; + } +}); + +// node_modules/mongoose/lib/helpers/discriminator/getConstructor.js +var require_getConstructor = __commonJS({ + "node_modules/mongoose/lib/helpers/discriminator/getConstructor.js"(exports2, module2) { + "use strict"; + var getDiscriminatorByValue = require_getDiscriminatorByValue(); + module2.exports = function getConstructor(Constructor, value, defaultDiscriminatorValue) { + const discriminatorKey = Constructor.schema.options.discriminatorKey; + let discriminatorValue = value != null && value[discriminatorKey]; + if (discriminatorValue == null) { + discriminatorValue = defaultDiscriminatorValue; + } + if (Constructor.discriminators && discriminatorValue != null) { + if (Constructor.discriminators[discriminatorValue]) { + Constructor = Constructor.discriminators[discriminatorValue]; + } else { + const constructorByValue = getDiscriminatorByValue(Constructor.discriminators, discriminatorValue); + if (constructorByValue) { + Constructor = constructorByValue; + } + } + } + return Constructor; + }; + } +}); + +// node_modules/mongoose/lib/helpers/schema/handleIdOption.js +var require_handleIdOption = __commonJS({ + "node_modules/mongoose/lib/helpers/schema/handleIdOption.js"(exports2, module2) { + "use strict"; + var addAutoId = require_addAutoId(); + module2.exports = function handleIdOption(schema, options) { + if (options == null || options._id == null) { + return schema; + } + schema = schema.clone(); + if (!options._id) { + schema.remove("_id"); + schema.options._id = false; + } else if (!schema.paths["_id"]) { + addAutoId(schema); + schema.options._id = true; + } + return schema; + }; + } +}); + +// node_modules/mongoose/lib/error/invalidSchemaOption.js +var require_invalidSchemaOption = __commonJS({ + "node_modules/mongoose/lib/error/invalidSchemaOption.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var InvalidSchemaOptionError = class extends MongooseError { + constructor(name, option) { + const msg = `Cannot create use schema for property "${name}" because the schema has the ${option} option enabled.`; + super(msg); + } + }; + Object.defineProperty(InvalidSchemaOptionError.prototype, "name", { + value: "InvalidSchemaOptionError" + }); + module2.exports = InvalidSchemaOptionError; + } +}); + +// node_modules/mongoose/lib/schema/subdocument.js +var require_subdocument2 = __commonJS({ + "node_modules/mongoose/lib/schema/subdocument.js"(exports2, module2) { + "use strict"; + var CastError = require_cast(); + var EventEmitter = require("events").EventEmitter; + var ObjectExpectedError = require_objectExpected(); + var SchemaSubdocumentOptions = require_schemaSubdocumentOptions(); + var SchemaType = require_schemaType(); + var applyDefaults = require_applyDefaults(); + var $exists = require_exists(); + var castToNumber = require_helpers3().castToNumber; + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + var discriminator = require_discriminator(); + var geospatial = require_geospatial(); + var getConstructor = require_getConstructor(); + var handleIdOption = require_handleIdOption(); + var internalToObjectOptions = require_options().internalToObjectOptions; + var isExclusive = require_isExclusive(); + var utils = require_utils6(); + var InvalidSchemaOptionError = require_invalidSchemaOption(); + var SubdocumentType; + module2.exports = SchemaSubdocument; + function SchemaSubdocument(schema, path, options, parentSchema) { + if (schema.options.timeseries) { + throw new InvalidSchemaOptionError(path, "timeseries"); + } + const schemaTypeIdOption = SchemaSubdocument.defaultOptions && SchemaSubdocument.defaultOptions._id; + if (schemaTypeIdOption != null) { + options = options || {}; + options._id = schemaTypeIdOption; + } + schema = handleIdOption(schema, options); + this.caster = _createConstructor(schema, null, options); + this.caster.path = path; + this.caster.prototype.$basePath = path; + this.schema = schema; + this.$isSingleNested = true; + this.base = schema.base; + SchemaType.call(this, path, options, "Embedded", parentSchema); + } + SchemaSubdocument.prototype = Object.create(SchemaType.prototype); + SchemaSubdocument.prototype.constructor = SchemaSubdocument; + SchemaSubdocument.prototype.OptionsConstructor = SchemaSubdocumentOptions; + function _createConstructor(schema, baseClass, options) { + SubdocumentType || (SubdocumentType = require_subdocument()); + const _embedded = function SingleNested(value, path, parent) { + this.$__parent = parent; + SubdocumentType.apply(this, arguments); + if (parent == null) { + return; + } + this.$session(parent.$session()); + }; + schema._preCompile(); + const proto = baseClass != null ? baseClass.prototype : SubdocumentType.prototype; + _embedded.prototype = Object.create(proto); + _embedded.prototype.$__setSchema(schema); + _embedded.prototype.constructor = _embedded; + _embedded.prototype.$__schemaTypeOptions = options; + _embedded.$__required = options?.required; + _embedded.base = schema.base; + _embedded.schema = schema; + _embedded.$isSingleNested = true; + _embedded.events = new EventEmitter(); + _embedded.prototype.toBSON = function() { + return this.toObject(internalToObjectOptions); + }; + for (const i4 in schema.methods) { + _embedded.prototype[i4] = schema.methods[i4]; + } + for (const i4 in schema.statics) { + _embedded[i4] = schema.statics[i4]; + } + for (const i4 in EventEmitter.prototype) { + _embedded[i4] = EventEmitter.prototype[i4]; + } + return _embedded; + } + var $conditionalHandlers = { ...SchemaType.prototype.$conditionalHandlers }; + $conditionalHandlers.$geoWithin = function handle$geoWithin(val, context) { + return { $geometry: this.castForQuery(null, val.$geometry, context) }; + }; + $conditionalHandlers.$near = $conditionalHandlers.$nearSphere = geospatial.cast$near; + $conditionalHandlers.$within = $conditionalHandlers.$geoWithin = geospatial.cast$within; + $conditionalHandlers.$geoIntersects = geospatial.cast$geoIntersects; + $conditionalHandlers.$minDistance = castToNumber; + $conditionalHandlers.$maxDistance = castToNumber; + $conditionalHandlers.$exists = $exists; + Object.defineProperty(SchemaSubdocument.prototype, "$conditionalHandlers", { + enumerable: false, + value: $conditionalHandlers + }); + SchemaSubdocument.prototype.cast = function(val, doc, init, priorVal, options) { + if (val && val.$isSingleNested && val.parent === doc) { + return val; + } + if (val != null && (typeof val !== "object" || Array.isArray(val))) { + throw new ObjectExpectedError(this.path, val); + } + const discriminatorKeyPath = this.schema.path(this.schema.options.discriminatorKey); + const defaultDiscriminatorValue = discriminatorKeyPath == null ? null : discriminatorKeyPath.getDefault(doc); + const Constructor = getConstructor(this.caster, val, defaultDiscriminatorValue); + let subdoc; + const parentSelected = doc && doc.$__ && doc.$__.selected; + const path = this.path; + const selected = parentSelected == null ? null : Object.keys(parentSelected).reduce((obj, key) => { + if (key.startsWith(path + ".")) { + obj = obj || {}; + obj[key.substring(path.length + 1)] = parentSelected[key]; + } + return obj; + }, null); + if (init) { + subdoc = new Constructor(void 0, selected, doc, false, { defaults: false }); + delete subdoc.$__.defaults; + if (options.path != null) { + options = { ...options }; + delete options.path; + } + subdoc.$init(val, options); + const exclude = isExclusive(selected); + applyDefaults(subdoc, selected, exclude); + } else { + options = Object.assign({}, options, { priorDoc: priorVal }); + if (Object.keys(val).length === 0) { + return new Constructor({}, selected, doc, void 0, options); + } + return new Constructor(val, selected, doc, void 0, options); + } + return subdoc; + }; + SchemaSubdocument.prototype.castForQuery = function($conditional, val, context, options) { + let handler2; + if ($conditional != null) { + handler2 = this.$conditionalHandlers[$conditional]; + if (!handler2) { + throw new Error("Can't use " + $conditional); + } + return handler2.call(this, val); + } + if (val == null) { + return val; + } + const Constructor = getConstructor(this.caster, val); + if (val instanceof Constructor) { + return val; + } + if (this.options.runSetters) { + val = this._applySetters(val, context); + } + const overrideStrict = options != null && options.strict != null ? options.strict : void 0; + try { + val = new Constructor(val, overrideStrict); + } catch (error2) { + if (!(error2 instanceof CastError)) { + throw new CastError("Embedded", val, this.path, error2, this); + } + throw error2; + } + return val; + }; + SchemaSubdocument.prototype.doValidate = function(value, fn2, scope, options) { + const Constructor = getConstructor(this.caster, value); + if (value && !(value instanceof Constructor)) { + value = new Constructor(value, null, scope != null && scope.$__ != null ? scope : null); + } + if (options && options.skipSchemaValidators) { + if (!value) { + return fn2(null); + } + return value.validate().then(() => fn2(null), (err) => fn2(err)); + } + SchemaType.prototype.doValidate.call(this, value, function(error2) { + if (error2) { + return fn2(error2); + } + if (!value) { + return fn2(null); + } + value.validate().then(() => fn2(null), (err) => fn2(err)); + }, scope, options); + }; + SchemaSubdocument.prototype.doValidateSync = function(value, scope, options) { + if (!options || !options.skipSchemaValidators) { + const schemaTypeError = SchemaType.prototype.doValidateSync.call(this, value, scope); + if (schemaTypeError) { + return schemaTypeError; + } + } + if (!value) { + return; + } + return value.validateSync(); + }; + SchemaSubdocument.prototype.discriminator = function(name, schema, options) { + options = options || {}; + const value = utils.isPOJO(options) ? options.value : options; + const clone = typeof options.clone === "boolean" ? options.clone : true; + if (schema.instanceOfSchema && clone) { + schema = schema.clone(); + } + schema = discriminator(this.caster, name, schema, value, null, null, options.overwriteExisting); + this.caster.discriminators[name] = _createConstructor(schema, this.caster); + return this.caster.discriminators[name]; + }; + SchemaSubdocument.defaultOptions = {}; + SchemaSubdocument.set = SchemaType.set; + SchemaSubdocument.setters = []; + SchemaSubdocument.get = SchemaType.get; + SchemaSubdocument.prototype.toJSON = function toJSON() { + return { path: this.path, options: this.options }; + }; + SchemaSubdocument.prototype.clone = function() { + const schematype = new this.constructor( + this.schema, + this.path, + { ...this.options, _skipApplyDiscriminators: true }, + this.parentSchema + ); + schematype.validators = this.validators.slice(); + if (this.requiredValidator !== void 0) { + schematype.requiredValidator = this.requiredValidator; + } + schematype.caster.discriminators = Object.assign({}, this.caster.discriminators); + schematype._appliedDiscriminators = this._appliedDiscriminators; + return schematype; + }; + SchemaSubdocument.prototype.toJSONSchema = function toJSONSchema(options) { + const isRequired = this.options.required && typeof this.options.required !== "function"; + return { + ...this.schema.toJSONSchema(options), + ...createJSONSchemaTypeDefinition("object", "object", options?.useBsonType, isRequired) + }; + }; + } +}); + +// node_modules/mongoose/lib/schema/documentArrayElement.js +var require_documentArrayElement = __commonJS({ + "node_modules/mongoose/lib/schema/documentArrayElement.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var SchemaType = require_schemaType(); + var SchemaSubdocument = require_subdocument2(); + var getConstructor = require_getConstructor(); + function SchemaDocumentArrayElement(path, options, _schemaOptions, parentSchema) { + this.$parentSchemaType = options && options.$parentSchemaType; + if (!this.$parentSchemaType) { + throw new MongooseError("Cannot create DocumentArrayElement schematype without a parent"); + } + delete options.$parentSchemaType; + SchemaType.call(this, path, options, "DocumentArrayElement", parentSchema); + this.$isMongooseDocumentArrayElement = true; + } + SchemaDocumentArrayElement.schemaName = "DocumentArrayElement"; + SchemaDocumentArrayElement.defaultOptions = {}; + SchemaDocumentArrayElement.prototype = Object.create(SchemaType.prototype); + SchemaDocumentArrayElement.prototype.constructor = SchemaDocumentArrayElement; + SchemaDocumentArrayElement.prototype.cast = function(...args2) { + return this.$parentSchemaType.cast(...args2)[0]; + }; + SchemaDocumentArrayElement.prototype.doValidate = function(value, fn2, scope, options) { + const Constructor = getConstructor(this.caster, value); + if (value && !(value instanceof Constructor)) { + value = new Constructor(value, scope, null, null, options && options.index != null ? options.index : null); + } + return SchemaSubdocument.prototype.doValidate.call(this, value, fn2, scope, options); + }; + SchemaDocumentArrayElement.prototype.clone = function() { + this.options.$parentSchemaType = this.$parentSchemaType; + const ret = SchemaType.prototype.clone.apply(this, arguments); + delete this.options.$parentSchemaType; + ret.caster = this.caster; + ret.schema = this.schema; + return ret; + }; + module2.exports = SchemaDocumentArrayElement; + } +}); + +// node_modules/mongoose/lib/options/schemaDocumentArrayOptions.js +var require_schemaDocumentArrayOptions = __commonJS({ + "node_modules/mongoose/lib/options/schemaDocumentArrayOptions.js"(exports2, module2) { + "use strict"; + var SchemaTypeOptions = require_schemaTypeOptions(); + var SchemaDocumentArrayOptions = class extends SchemaTypeOptions { + }; + var opts = require_propertyOptions(); + Object.defineProperty(SchemaDocumentArrayOptions.prototype, "excludeIndexes", opts); + Object.defineProperty(SchemaDocumentArrayOptions.prototype, "_id", opts); + module2.exports = SchemaDocumentArrayOptions; + } +}); + +// node_modules/mongoose/lib/schema/documentArray.js +var require_documentArray2 = __commonJS({ + "node_modules/mongoose/lib/schema/documentArray.js"(exports2, module2) { + "use strict"; + var CastError = require_cast(); + var DocumentArrayElement = require_documentArrayElement(); + var EventEmitter = require("events").EventEmitter; + var SchemaArray = require_array2(); + var SchemaDocumentArrayOptions = require_schemaDocumentArrayOptions(); + var SchemaType = require_schemaType(); + var cast = require_cast2(); + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + var discriminator = require_discriminator(); + var handleIdOption = require_handleIdOption(); + var handleSpreadDoc = require_handleSpreadDoc(); + var isOperator = require_isOperator(); + var utils = require_utils6(); + var getConstructor = require_getConstructor(); + var InvalidSchemaOptionError = require_invalidSchemaOption(); + var arrayAtomicsSymbol = require_symbols().arrayAtomicsSymbol; + var arrayPathSymbol = require_symbols().arrayPathSymbol; + var documentArrayParent = require_symbols().documentArrayParent; + var MongooseDocumentArray; + var Subdocument; + function SchemaDocumentArray(key, schema, options, schemaOptions, parentSchema) { + if (schema.options && schema.options.timeseries) { + throw new InvalidSchemaOptionError(key, "timeseries"); + } + const schemaTypeIdOption = SchemaDocumentArray.defaultOptions && SchemaDocumentArray.defaultOptions._id; + if (schemaTypeIdOption != null) { + schemaOptions = schemaOptions || {}; + schemaOptions._id = schemaTypeIdOption; + } + if (schemaOptions != null && schemaOptions._id != null) { + schema = handleIdOption(schema, schemaOptions); + } else if (options != null && options._id != null) { + schema = handleIdOption(schema, options); + } + const EmbeddedDocument = _createConstructor(schema, options); + EmbeddedDocument.prototype.$basePath = key; + SchemaArray.call(this, key, EmbeddedDocument, options, null, parentSchema); + this.schema = schema; + this.schemaOptions = schemaOptions || {}; + this.$isMongooseDocumentArray = true; + this.Constructor = EmbeddedDocument; + EmbeddedDocument.base = schema.base; + const fn2 = this.defaultValue; + if (!("defaultValue" in this) || fn2 != null) { + this.default(function() { + let arr = fn2.call(this); + if (arr != null && !Array.isArray(arr)) { + arr = [arr]; + } + return arr; + }); + } + const $parentSchemaType = this; + this.$embeddedSchemaType = new DocumentArrayElement( + key + ".$", + { + ...schemaOptions || {}, + $parentSchemaType + }, + schemaOptions, + parentSchema + ); + this.$embeddedSchemaType.caster = this.Constructor; + this.$embeddedSchemaType.schema = this.schema; + } + SchemaDocumentArray.schemaName = "DocumentArray"; + SchemaDocumentArray.options = { castNonArrays: true }; + SchemaDocumentArray.prototype = Object.create(SchemaArray.prototype); + SchemaDocumentArray.prototype.constructor = SchemaDocumentArray; + SchemaDocumentArray.prototype.OptionsConstructor = SchemaDocumentArrayOptions; + Object.defineProperty(SchemaDocumentArray.prototype, "$conditionalHandlers", { + enumerable: false, + value: { ...SchemaArray.prototype.$conditionalHandlers } + }); + function _createConstructor(schema, options, baseClass) { + Subdocument || (Subdocument = require_arraySubdocument()); + function EmbeddedDocument() { + Subdocument.apply(this, arguments); + if (this.__parentArray == null || this.__parentArray.getArrayParent() == null) { + return; + } + this.$session(this.__parentArray.getArrayParent().$session()); + } + schema._preCompile(); + const proto = baseClass != null ? baseClass.prototype : Subdocument.prototype; + EmbeddedDocument.prototype = Object.create(proto); + EmbeddedDocument.prototype.$__setSchema(schema); + EmbeddedDocument.schema = schema; + EmbeddedDocument.prototype.constructor = EmbeddedDocument; + EmbeddedDocument.$isArraySubdocument = true; + EmbeddedDocument.events = new EventEmitter(); + EmbeddedDocument.base = schema.base; + for (const i4 in schema.methods) { + EmbeddedDocument.prototype[i4] = schema.methods[i4]; + } + for (const i4 in schema.statics) { + EmbeddedDocument[i4] = schema.statics[i4]; + } + for (const i4 in EventEmitter.prototype) { + EmbeddedDocument[i4] = EventEmitter.prototype[i4]; + } + EmbeddedDocument.options = options; + return EmbeddedDocument; + } + SchemaDocumentArray.prototype.discriminator = function(name, schema, options) { + if (typeof name === "function") { + name = utils.getFunctionName(name); + } + options = options || {}; + const tiedValue = utils.isPOJO(options) ? options.value : options; + const clone = typeof options.clone === "boolean" ? options.clone : true; + if (schema.instanceOfSchema && clone) { + schema = schema.clone(); + } + schema = discriminator(this.casterConstructor, name, schema, tiedValue, null, null, options?.overwriteExisting); + const EmbeddedDocument = _createConstructor(schema, null, this.casterConstructor); + EmbeddedDocument.baseCasterConstructor = this.casterConstructor; + try { + Object.defineProperty(EmbeddedDocument, "name", { + value: name + }); + } catch (error2) { + } + this.casterConstructor.discriminators[name] = EmbeddedDocument; + return this.casterConstructor.discriminators[name]; + }; + SchemaDocumentArray.prototype.doValidate = function(array, fn2, scope, options) { + MongooseDocumentArray || (MongooseDocumentArray = require_documentArray()); + const _this = this; + try { + SchemaType.prototype.doValidate.call(this, array, cb, scope); + } catch (err) { + return fn2(err); + } + function cb(err) { + if (err) { + return fn2(err); + } + let count = array && array.length; + let error2; + if (!count) { + return fn2(); + } + if (options && options.updateValidator) { + return fn2(); + } + if (!utils.isMongooseDocumentArray(array)) { + array = new MongooseDocumentArray(array, _this.path, scope); + } + function callback(err2) { + if (err2 != null) { + error2 = err2; + } + --count || fn2(error2); + } + for (let i4 = 0, len = count; i4 < len; ++i4) { + let doc = array[i4]; + if (doc == null) { + --count || fn2(error2); + continue; + } + if (!(doc instanceof Subdocument)) { + const Constructor = getConstructor(_this.casterConstructor, array[i4]); + doc = array[i4] = new Constructor(doc, array, void 0, void 0, i4); + } + if (options != null && options.validateModifiedOnly && !doc.$isModified()) { + --count || fn2(error2); + continue; + } + doc.$__validate(null, options, callback); + } + } + }; + SchemaDocumentArray.prototype.doValidateSync = function(array, scope, options) { + const schemaTypeError = SchemaType.prototype.doValidateSync.call(this, array, scope); + if (schemaTypeError != null) { + return schemaTypeError; + } + const count = array && array.length; + let resultError = null; + if (!count) { + return; + } + for (let i4 = 0, len = count; i4 < len; ++i4) { + let doc = array[i4]; + if (!doc) { + continue; + } + if (!(doc instanceof Subdocument)) { + const Constructor = getConstructor(this.casterConstructor, array[i4]); + doc = array[i4] = new Constructor(doc, array, void 0, void 0, i4); + } + if (options != null && options.validateModifiedOnly && !doc.$isModified()) { + continue; + } + const subdocValidateError = doc.validateSync(options); + if (subdocValidateError && resultError == null) { + resultError = subdocValidateError; + } + } + return resultError; + }; + SchemaDocumentArray.prototype.getDefault = function(scope, init, options) { + let ret = typeof this.defaultValue === "function" ? this.defaultValue.call(scope) : this.defaultValue; + if (ret == null) { + return ret; + } + if (options && options.skipCast) { + return ret; + } + MongooseDocumentArray || (MongooseDocumentArray = require_documentArray()); + if (!Array.isArray(ret)) { + ret = [ret]; + } + ret = new MongooseDocumentArray(ret, this.path, scope); + for (let i4 = 0; i4 < ret.length; ++i4) { + const Constructor = getConstructor(this.casterConstructor, ret[i4]); + const _subdoc = new Constructor( + {}, + ret, + void 0, + void 0, + i4 + ); + _subdoc.$init(ret[i4]); + _subdoc.isNew = true; + Object.assign(_subdoc.$__.activePaths.default, _subdoc.$__.activePaths.init); + _subdoc.$__.activePaths.init = {}; + ret[i4] = _subdoc; + } + return ret; + }; + var _toObjectOptions = Object.freeze({ transform: false, virtuals: false }); + var initDocumentOptions = Object.freeze({ skipId: false, willInit: true }); + SchemaDocumentArray.prototype.cast = function(value, doc, init, prev, options) { + MongooseDocumentArray || (MongooseDocumentArray = require_documentArray()); + if (value != null && value[arrayPathSymbol] != null && value === prev) { + return value; + } + let selected; + let subdoc; + options = options || {}; + const path = options.path || this.path; + if (!Array.isArray(value)) { + if (!init && !SchemaDocumentArray.options.castNonArrays) { + throw new CastError("DocumentArray", value, this.path, null, this); + } + if (!!doc && init) { + doc.markModified(path); + } + return this.cast([value], doc, init, prev, options); + } + if (!options.skipDocumentArrayCast || utils.isMongooseDocumentArray(value)) { + value = new MongooseDocumentArray(value, path, doc, this); + } + if (prev != null) { + value[arrayAtomicsSymbol] = prev[arrayAtomicsSymbol] || {}; + } + if (options.arrayPathIndex != null) { + value[arrayPathSymbol] = path + "." + options.arrayPathIndex; + } + const rawArray = utils.isMongooseDocumentArray(value) ? value.__array : value; + const len = rawArray.length; + for (let i4 = 0; i4 < len; ++i4) { + if (!rawArray[i4]) { + continue; + } + const Constructor = getConstructor(this.casterConstructor, rawArray[i4]); + const spreadDoc = handleSpreadDoc(rawArray[i4], true); + if (rawArray[i4] !== spreadDoc) { + rawArray[i4] = spreadDoc; + } + if (rawArray[i4] instanceof Subdocument) { + if (rawArray[i4][documentArrayParent] !== doc) { + if (init) { + const subdoc2 = new Constructor(null, value, initDocumentOptions, selected, i4); + rawArray[i4] = subdoc2.$init(rawArray[i4]); + } else { + const subdoc2 = new Constructor(rawArray[i4], value, void 0, void 0, i4); + rawArray[i4] = subdoc2; + } + } + if (rawArray[i4].__index == null) { + rawArray[i4].$setIndex(i4); + } + } else if (rawArray[i4] != null) { + if (init) { + if (doc) { + selected || (selected = scopePaths(this, doc.$__.selected, init)); + } else { + selected = true; + } + subdoc = new Constructor(null, value, initDocumentOptions, selected, i4); + rawArray[i4] = subdoc.$init(rawArray[i4], options); + } else { + if (prev && typeof prev.id === "function") { + subdoc = prev.id(rawArray[i4]._id); + } + if (prev && subdoc && utils.deepEqual(subdoc.toObject(_toObjectOptions), rawArray[i4])) { + subdoc.set(rawArray[i4]); + rawArray[i4] = subdoc; + } else { + try { + subdoc = new Constructor( + rawArray[i4], + value, + void 0, + void 0, + i4 + ); + rawArray[i4] = subdoc; + } catch (error2) { + throw new CastError( + "embedded", + rawArray[i4], + value[arrayPathSymbol], + error2, + this + ); + } + } + } + } + } + return value; + }; + SchemaDocumentArray.prototype.clone = function() { + const options = Object.assign({}, this.options); + const schematype = new this.constructor( + this.path, + this.schema, + options, + this.schemaOptions, + this.parentSchema + ); + schematype.validators = this.validators.slice(); + if (this.requiredValidator !== void 0) { + schematype.requiredValidator = this.requiredValidator; + } + schematype.Constructor.discriminators = Object.assign( + {}, + this.Constructor.discriminators + ); + schematype._appliedDiscriminators = this._appliedDiscriminators; + return schematype; + }; + SchemaDocumentArray.prototype.applyGetters = function(value, scope) { + return SchemaType.prototype.applyGetters.call(this, value, scope); + }; + function scopePaths(array, fields, init) { + if (!(init && fields)) { + return void 0; + } + const path = array.path + "."; + const keys = Object.keys(fields); + let i4 = keys.length; + const selected = {}; + let hasKeys; + let key; + let sub; + while (i4--) { + key = keys[i4]; + if (key.startsWith(path)) { + sub = key.substring(path.length); + if (sub === "$") { + continue; + } + if (sub.startsWith("$.")) { + sub = sub.substring(2); + } + hasKeys || (hasKeys = true); + selected[sub] = fields[key]; + } + } + return hasKeys && selected || void 0; + } + SchemaDocumentArray.defaultOptions = {}; + SchemaDocumentArray.set = SchemaType.set; + SchemaDocumentArray.setters = []; + SchemaDocumentArray.get = SchemaType.get; + SchemaDocumentArray.prototype.$conditionalHandlers.$elemMatch = cast$elemMatch; + function cast$elemMatch(val, context) { + const keys = Object.keys(val); + const numKeys = keys.length; + for (let i4 = 0; i4 < numKeys; ++i4) { + const key = keys[i4]; + const value = val[key]; + if (isOperator(key) && value != null) { + val[key] = this.castForQuery(key, value, context); + } + } + const discriminatorKey = this && this.casterConstructor && this.casterConstructor.schema && this.casterConstructor.schema.options && this.casterConstructor.schema.options.discriminatorKey; + const discriminators = this && this.casterConstructor && this.casterConstructor.schema && this.casterConstructor.schema.discriminators || {}; + if (discriminatorKey != null && val[discriminatorKey] != null && discriminators[val[discriminatorKey]] != null) { + return cast(discriminators[val[discriminatorKey]], val, null, this && this.$$context); + } + const schema = this.casterConstructor.schema ?? context.schema; + return cast(schema, val, null, this && this.$$context); + } + SchemaDocumentArray.prototype.toJSONSchema = function toJSONSchema(options) { + const itemsTypeDefinition = createJSONSchemaTypeDefinition("object", "object", options?.useBsonType, false); + const isRequired = this.options.required && typeof this.options.required !== "function"; + return { + ...createJSONSchemaTypeDefinition("array", "array", options?.useBsonType, isRequired), + items: { ...itemsTypeDefinition, ...this.schema.toJSONSchema(options) } + }; + }; + module2.exports = SchemaDocumentArray; + } +}); + +// node_modules/mongoose/lib/cast/double.js +var require_double2 = __commonJS({ + "node_modules/mongoose/lib/cast/double.js"(exports2, module2) { + "use strict"; + var assert = require("assert"); + var BSON = require_bson(); + var isBsonType = require_isBsonType(); + module2.exports = function castDouble(val) { + if (val == null || val === "") { + return null; + } + let coercedVal; + if (isBsonType(val, "Long")) { + coercedVal = val.toNumber(); + } else if (typeof val === "string") { + try { + coercedVal = BSON.Double.fromString(val); + return coercedVal; + } catch { + assert.ok(false); + } + } else if (typeof val === "object") { + const tempVal = val.valueOf() ?? val.toString(); + if (typeof tempVal === "string") { + try { + coercedVal = BSON.Double.fromString(val); + return coercedVal; + } catch { + assert.ok(false); + } + } else { + coercedVal = Number(tempVal); + } + } else { + coercedVal = Number(val); + } + return new BSON.Double(coercedVal); + }; + } +}); + +// node_modules/mongoose/lib/schema/double.js +var require_double3 = __commonJS({ + "node_modules/mongoose/lib/schema/double.js"(exports2, module2) { + "use strict"; + var CastError = require_cast(); + var SchemaType = require_schemaType(); + var castDouble = require_double2(); + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + function SchemaDouble(path, options, _schemaOptions, parentSchema) { + SchemaType.call(this, path, options, "Double", parentSchema); + } + SchemaDouble.schemaName = "Double"; + SchemaDouble.defaultOptions = {}; + SchemaDouble.prototype = Object.create(SchemaType.prototype); + SchemaDouble.prototype.constructor = SchemaDouble; + SchemaDouble._cast = castDouble; + SchemaDouble.set = SchemaType.set; + SchemaDouble.setters = []; + SchemaDouble.get = SchemaType.get; + SchemaDouble._defaultCaster = (v4) => { + if (v4 != null) { + if (v4._bsontype !== "Double") { + throw new Error(); + } + } + return v4; + }; + SchemaDouble.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + return this._cast; + }; + SchemaDouble._checkRequired = (v4) => v4 != null; + SchemaDouble.checkRequired = SchemaType.checkRequired; + SchemaDouble.prototype.checkRequired = function(value) { + return this.constructor._checkRequired(value); + }; + SchemaDouble.prototype.cast = function(value) { + let castDouble2; + if (typeof this._castFunction === "function") { + castDouble2 = this._castFunction; + } else if (typeof this.constructor.cast === "function") { + castDouble2 = this.constructor.cast(); + } else { + castDouble2 = SchemaDouble.cast(); + } + try { + return castDouble2(value); + } catch (error2) { + throw new CastError("Double", value, this.path, error2, this); + } + }; + function handleSingle(val) { + return this.cast(val); + } + var $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle + }; + Object.defineProperty(SchemaDouble.prototype, "$conditionalHandlers", { + enumerable: false, + value: $conditionalHandlers + }); + SchemaDouble.prototype.toJSONSchema = function toJSONSchema(options) { + const isRequired = this.options.required && typeof this.options.required !== "function"; + return createJSONSchemaTypeDefinition("number", "double", options?.useBsonType, isRequired); + }; + SchemaDouble.prototype.autoEncryptionType = function autoEncryptionType() { + return "double"; + }; + module2.exports = SchemaDouble; + } +}); + +// node_modules/mongoose/lib/cast/int32.js +var require_int32 = __commonJS({ + "node_modules/mongoose/lib/cast/int32.js"(exports2, module2) { + "use strict"; + var isBsonType = require_isBsonType(); + var assert = require("assert"); + module2.exports = function castInt32(val) { + if (val == null) { + return val; + } + if (val === "") { + return null; + } + const coercedVal = isBsonType(val, "Long") ? val.toNumber() : Number(val); + const INT32_MAX = 2147483647; + const INT32_MIN = -2147483648; + if (coercedVal === (coercedVal | 0) && coercedVal >= INT32_MIN && coercedVal <= INT32_MAX) { + return coercedVal; + } + assert.ok(false); + }; + } +}); + +// node_modules/mongoose/lib/schema/int32.js +var require_int322 = __commonJS({ + "node_modules/mongoose/lib/schema/int32.js"(exports2, module2) { + "use strict"; + var CastError = require_cast(); + var SchemaType = require_schemaType(); + var castInt32 = require_int32(); + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + var handleBitwiseOperator = require_bitwise(); + function SchemaInt32(path, options, _schemaOptions, parentSchema) { + SchemaType.call(this, path, options, "Int32", parentSchema); + } + SchemaInt32.schemaName = "Int32"; + SchemaInt32.defaultOptions = {}; + SchemaInt32.prototype = Object.create(SchemaType.prototype); + SchemaInt32.prototype.constructor = SchemaInt32; + SchemaInt32._cast = castInt32; + SchemaInt32.set = SchemaType.set; + SchemaInt32.setters = []; + SchemaInt32.get = SchemaType.get; + SchemaInt32._defaultCaster = (v4) => { + const INT32_MAX = 2147483647; + const INT32_MIN = -2147483648; + if (v4 != null) { + if (typeof v4 !== "number" || v4 !== (v4 | 0) || v4 < INT32_MIN || v4 > INT32_MAX) { + throw new Error(); + } + } + return v4; + }; + SchemaInt32.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + return this._cast; + }; + SchemaInt32._checkRequired = (v4) => v4 != null; + SchemaInt32.checkRequired = SchemaType.checkRequired; + SchemaInt32.prototype.checkRequired = function(value) { + return this.constructor._checkRequired(value); + }; + SchemaInt32.prototype.cast = function(value) { + let castInt322; + if (typeof this._castFunction === "function") { + castInt322 = this._castFunction; + } else if (typeof this.constructor.cast === "function") { + castInt322 = this.constructor.cast(); + } else { + castInt322 = SchemaInt32.cast(); + } + try { + return castInt322(value); + } catch (error2) { + throw new CastError("Int32", value, this.path, error2, this); + } + }; + var $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle, + $bitsAllClear: handleBitwiseOperator, + $bitsAnyClear: handleBitwiseOperator, + $bitsAllSet: handleBitwiseOperator, + $bitsAnySet: handleBitwiseOperator + }; + Object.defineProperty(SchemaInt32.prototype, "$conditionalHandlers", { + enumerable: false, + value: $conditionalHandlers + }); + function handleSingle(val, context) { + return this.castForQuery(null, val, context); + } + SchemaInt32.prototype.castForQuery = function($conditional, val, context) { + let handler2; + if ($conditional != null) { + handler2 = this.$conditionalHandlers[$conditional]; + if (handler2) { + return handler2.call(this, val); + } + return this.applySetters(val, context); + } + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } + }; + SchemaInt32.prototype.toJSONSchema = function toJSONSchema(options) { + const isRequired = this.options.required && typeof this.options.required !== "function"; + return createJSONSchemaTypeDefinition("number", "int", options?.useBsonType, isRequired); + }; + SchemaInt32.prototype.autoEncryptionType = function autoEncryptionType() { + return "int"; + }; + module2.exports = SchemaInt32; + } +}); + +// node_modules/mongoose/lib/options/schemaMapOptions.js +var require_schemaMapOptions = __commonJS({ + "node_modules/mongoose/lib/options/schemaMapOptions.js"(exports2, module2) { + "use strict"; + var SchemaTypeOptions = require_schemaTypeOptions(); + var SchemaMapOptions = class extends SchemaTypeOptions { + }; + var opts = require_propertyOptions(); + Object.defineProperty(SchemaMapOptions.prototype, "of", opts); + module2.exports = SchemaMapOptions; + } +}); + +// node_modules/mongoose/lib/schema/map.js +var require_map2 = __commonJS({ + "node_modules/mongoose/lib/schema/map.js"(exports2, module2) { + "use strict"; + var MongooseMap = require_map(); + var SchemaMapOptions = require_schemaMapOptions(); + var SchemaType = require_schemaType(); + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + var MongooseError = require_mongooseError(); + var Schema2 = require_schema2(); + var utils = require_utils6(); + var SchemaMap = class extends SchemaType { + /** + * Map SchemaType constructor. + * + * @param {String} path + * @param {Object} options + * @param {Object} schemaOptions + * @param {Schema} parentSchema + * @inherits SchemaType + * @api public + */ + constructor(key, options, schemaOptions, parentSchema) { + super(key, options, "Map", parentSchema); + this.$isSchemaMap = true; + this._createNestedSchemaType(parentSchema, key, options, schemaOptions); + } + /** + * Sets a default option for all Map instances. + * + * @param {String} option The option you'd like to set the value for + * @param {Any} value value for option + * @return {undefined} + * @function set + * @api public + */ + set(option, value) { + return SchemaType.set(option, value); + } + /** + * Casts to Map + * + * @param {Object} value + * @param {Object} model this value is optional + * @api private + */ + cast(val, doc, init, prev, options) { + if (val instanceof MongooseMap) { + return val; + } + const path = this.path; + if (init) { + const map2 = new MongooseMap({}, path, doc, this.$__schemaType, options); + const mapPath = map2.$__pathRelativeToParent != null ? map2.$__pathRelativeToParent : map2.$__path; + if (val instanceof global.Map) { + for (const key of val.keys()) { + let _val = val.get(key); + if (_val == null) { + _val = map2.$__schemaType._castNullish(_val); + } else { + _val = map2.$__schemaType.cast(_val, doc, true, null, { ...options, path: mapPath + "." + key }); + } + map2.$init(key, _val); + } + } else { + for (const key of Object.keys(val)) { + let _val = val[key]; + if (_val == null) { + _val = map2.$__schemaType._castNullish(_val); + } else { + _val = map2.$__schemaType.cast(_val, doc, true, null, { ...options, path: mapPath + "." + key }); + } + map2.$init(key, _val); + } + } + return map2; + } + return new MongooseMap(val, path, doc, this.$__schemaType, options); + } + /** + * Creates a copy of this map schema type. + * + * @api private + */ + clone() { + const schematype = super.clone(); + if (this.$__schemaType != null) { + schematype.$__schemaType = this.$__schemaType.clone(); + } + return schematype; + } + /** + * Returns the embedded schema type (i.e. the `.$*` path) + * + * @api public + */ + getEmbeddedSchemaType() { + return this.$__schemaType; + } + /** + * Returns this schema type's representation in a JSON schema. + * + * @param [options] + * @param [options.useBsonType=false] If true, return a representation with `bsonType` for use with MongoDB's `$jsonSchema`. + * @returns {Object} JSON schema properties + */ + toJSONSchema(options) { + const useBsonType = options?.useBsonType; + const embeddedSchemaType = this.getEmbeddedSchemaType(); + const isRequired = this.options.required && typeof this.options.required !== "function"; + const result = createJSONSchemaTypeDefinition("object", "object", useBsonType, isRequired); + result.additionalProperties = embeddedSchemaType.toJSONSchema(options); + return result; + } + /** + * Returns the auto encryption type for this schema type. + * + * @api public + */ + autoEncryptionType() { + return "object"; + } + }; + SchemaMap.schemaName = "Map"; + SchemaMap.prototype.OptionsConstructor = SchemaMapOptions; + SchemaMap.defaultOptions = {}; + SchemaMap.prototype._createNestedSchemaType = function _createNestedSchemaType(schema, path, obj, options) { + const mapPath = path + ".$*"; + let _mapType = { type: {} }; + if (utils.hasUserDefinedProperty(obj, "of")) { + const isInlineSchema = utils.isPOJO(obj.of) && Object.keys(obj.of).length > 0 && !utils.hasUserDefinedProperty(obj.of, schema.options.typeKey); + if (isInlineSchema) { + _mapType = { [schema.options.typeKey]: new Schema2(obj.of) }; + } else if (utils.isPOJO(obj.of)) { + _mapType = Object.assign({}, obj.of); + } else { + _mapType = { [schema.options.typeKey]: obj.of }; + } + if (_mapType[schema.options.typeKey] && _mapType[schema.options.typeKey].instanceOfSchema) { + const subdocumentSchema = _mapType[schema.options.typeKey]; + subdocumentSchema.eachPath((subpath, type) => { + if (type.options.select === true || type.options.select === false) { + throw new MongooseError('Cannot use schema-level projections (`select: true` or `select: false`) within maps at path "' + path + "." + subpath + '"'); + } + }); + } + if (utils.hasUserDefinedProperty(obj, "ref")) { + _mapType.ref = obj.ref; + } + } + this.$__schemaType = schema.interpretAsType(mapPath, _mapType, options); + }; + module2.exports = SchemaMap; + } +}); + +// node_modules/mongoose/lib/options/schemaObjectIdOptions.js +var require_schemaObjectIdOptions = __commonJS({ + "node_modules/mongoose/lib/options/schemaObjectIdOptions.js"(exports2, module2) { + "use strict"; + var SchemaTypeOptions = require_schemaTypeOptions(); + var SchemaObjectIdOptions = class extends SchemaTypeOptions { + }; + var opts = require_propertyOptions(); + Object.defineProperty(SchemaObjectIdOptions.prototype, "auto", opts); + Object.defineProperty(SchemaObjectIdOptions.prototype, "populate", opts); + module2.exports = SchemaObjectIdOptions; + } +}); + +// node_modules/mongoose/lib/cast/objectid.js +var require_objectid2 = __commonJS({ + "node_modules/mongoose/lib/cast/objectid.js"(exports2, module2) { + "use strict"; + var isBsonType = require_isBsonType(); + var ObjectId2 = require_objectid(); + module2.exports = function castObjectId(value) { + if (value == null) { + return value; + } + if (isBsonType(value, "ObjectId")) { + return value; + } + if (value._id) { + if (isBsonType(value._id, "ObjectId")) { + return value._id; + } + if (value._id.toString instanceof Function) { + return new ObjectId2(value._id.toString()); + } + } + if (value.toString instanceof Function) { + return new ObjectId2(value.toString()); + } + return new ObjectId2(value); + }; + } +}); + +// node_modules/mongoose/lib/schema/objectId.js +var require_objectId = __commonJS({ + "node_modules/mongoose/lib/schema/objectId.js"(exports2, module2) { + "use strict"; + var SchemaObjectIdOptions = require_schemaObjectIdOptions(); + var SchemaType = require_schemaType(); + var castObjectId = require_objectid2(); + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + var getConstructorName = require_getConstructorName(); + var oid = require_objectid(); + var isBsonType = require_isBsonType(); + var utils = require_utils6(); + var CastError = SchemaType.CastError; + var Document; + function SchemaObjectId(key, options, _schemaOptions, parentSchema) { + const isKeyHexStr = typeof key === "string" && key.length === 24 && /^[a-f0-9]+$/i.test(key); + const suppressWarning = options && options.suppressWarning; + if ((isKeyHexStr || typeof key === "undefined") && !suppressWarning) { + utils.warn("mongoose: To create a new ObjectId please try `Mongoose.Types.ObjectId` instead of using `Mongoose.Schema.ObjectId`. Set the `suppressWarning` option if you're trying to create a hex char path in your schema."); + } + SchemaType.call(this, key, options, "ObjectId", parentSchema); + } + SchemaObjectId.schemaName = "ObjectId"; + SchemaObjectId.defaultOptions = {}; + SchemaObjectId.prototype = Object.create(SchemaType.prototype); + SchemaObjectId.prototype.constructor = SchemaObjectId; + SchemaObjectId.prototype.OptionsConstructor = SchemaObjectIdOptions; + SchemaObjectId.get = SchemaType.get; + SchemaObjectId.set = SchemaType.set; + SchemaObjectId.setters = []; + SchemaObjectId.prototype.auto = function(turnOn) { + if (turnOn) { + this.default(defaultId); + this.set(resetId); + } + return this; + }; + SchemaObjectId._checkRequired = (v4) => isBsonType(v4, "ObjectId"); + SchemaObjectId._cast = castObjectId; + SchemaObjectId.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + return this._cast; + }; + SchemaObjectId._defaultCaster = (v4) => { + if (!isBsonType(v4, "ObjectId")) { + throw new Error(v4 + " is not an instance of ObjectId"); + } + return v4; + }; + SchemaObjectId.checkRequired = SchemaType.checkRequired; + SchemaObjectId.prototype.checkRequired = function checkRequired(value, doc) { + if (SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + const _checkRequired = typeof this.constructor.checkRequired === "function" ? this.constructor.checkRequired() : SchemaObjectId.checkRequired(); + return _checkRequired(value); + }; + SchemaObjectId.prototype.cast = function(value, doc, init, prev, options) { + if (!isBsonType(value, "ObjectId") && SchemaType._isRef(this, value, doc, init)) { + if ((getConstructorName(value) || "").toLowerCase() === "objectid") { + return new oid(value.toHexString()); + } + if (value == null || utils.isNonBuiltinObject(value)) { + return this._castRef(value, doc, init, options); + } + } + let castObjectId2; + if (typeof this._castFunction === "function") { + castObjectId2 = this._castFunction; + } else if (typeof this.constructor.cast === "function") { + castObjectId2 = this.constructor.cast(); + } else { + castObjectId2 = SchemaObjectId.cast(); + } + try { + return castObjectId2(value); + } catch (error2) { + throw new CastError("ObjectId", value, this.path, error2, this); + } + }; + function handleSingle(val) { + return this.cast(val); + } + var $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle + }; + Object.defineProperty(SchemaObjectId.prototype, "$conditionalHandlers", { + enumerable: false, + value: $conditionalHandlers + }); + function defaultId() { + return new oid(); + } + defaultId.$runBeforeSetters = true; + function resetId(v4) { + Document || (Document = require_document2()); + if (this instanceof Document) { + if (v4 === void 0) { + const _v = new oid(); + return _v; + } + } + return v4; + } + SchemaObjectId.prototype.toJSONSchema = function toJSONSchema(options) { + const isRequired = this.options.required && typeof this.options.required !== "function" || this.path === "_id"; + return createJSONSchemaTypeDefinition("string", "objectId", options?.useBsonType, isRequired); + }; + SchemaObjectId.prototype.autoEncryptionType = function autoEncryptionType() { + return "objectId"; + }; + module2.exports = SchemaObjectId; + } +}); + +// node_modules/mongoose/lib/options/schemaStringOptions.js +var require_schemaStringOptions = __commonJS({ + "node_modules/mongoose/lib/options/schemaStringOptions.js"(exports2, module2) { + "use strict"; + var SchemaTypeOptions = require_schemaTypeOptions(); + var SchemaStringOptions = class extends SchemaTypeOptions { + }; + var opts = require_propertyOptions(); + Object.defineProperty(SchemaStringOptions.prototype, "enum", opts); + Object.defineProperty(SchemaStringOptions.prototype, "match", opts); + Object.defineProperty(SchemaStringOptions.prototype, "lowercase", opts); + Object.defineProperty(SchemaStringOptions.prototype, "trim", opts); + Object.defineProperty(SchemaStringOptions.prototype, "uppercase", opts); + Object.defineProperty(SchemaStringOptions.prototype, "minLength", opts); + Object.defineProperty(SchemaStringOptions.prototype, "minlength", opts); + Object.defineProperty(SchemaStringOptions.prototype, "maxLength", opts); + Object.defineProperty(SchemaStringOptions.prototype, "maxlength", opts); + Object.defineProperty(SchemaStringOptions.prototype, "populate", opts); + module2.exports = SchemaStringOptions; + } +}); + +// node_modules/mongoose/lib/schema/string.js +var require_string2 = __commonJS({ + "node_modules/mongoose/lib/schema/string.js"(exports2, module2) { + "use strict"; + var SchemaType = require_schemaType(); + var MongooseError = require_error2(); + var SchemaStringOptions = require_schemaStringOptions(); + var castString = require_string(); + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + var utils = require_utils6(); + var isBsonType = require_isBsonType(); + var CastError = SchemaType.CastError; + function SchemaString(key, options, _schemaOptions, parentSchema) { + this.enumValues = []; + this.regExp = null; + SchemaType.call(this, key, options, "String", parentSchema); + } + SchemaString.schemaName = "String"; + SchemaString.defaultOptions = {}; + SchemaString.prototype = Object.create(SchemaType.prototype); + SchemaString.prototype.constructor = SchemaString; + Object.defineProperty(SchemaString.prototype, "OptionsConstructor", { + configurable: false, + enumerable: false, + writable: false, + value: SchemaStringOptions + }); + SchemaString._cast = castString; + SchemaString.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + return this._cast; + }; + SchemaString._defaultCaster = (v4) => { + if (v4 != null && typeof v4 !== "string") { + throw new Error(); + } + return v4; + }; + SchemaString.get = SchemaType.get; + SchemaString.set = SchemaType.set; + SchemaString.setters = []; + SchemaString._checkRequired = (v4) => (v4 instanceof String || typeof v4 === "string") && v4.length; + SchemaString.checkRequired = SchemaType.checkRequired; + SchemaString.prototype.enum = function() { + if (this.enumValidator) { + this.validators = this.validators.filter(function(v4) { + return v4.validator !== this.enumValidator; + }, this); + this.enumValidator = false; + } + if (arguments[0] === void 0 || arguments[0] === false) { + return this; + } + let values; + let errorMessage; + if (utils.isObject(arguments[0])) { + if (Array.isArray(arguments[0].values)) { + values = arguments[0].values; + errorMessage = arguments[0].message; + } else { + values = utils.object.vals(arguments[0]); + errorMessage = MongooseError.messages.String.enum; + } + } else { + values = arguments; + errorMessage = MongooseError.messages.String.enum; + } + for (const value of values) { + if (value !== void 0) { + this.enumValues.push(this.cast(value)); + } + } + const vals = this.enumValues; + this.enumValidator = function(v4) { + return null == v4 || ~vals.indexOf(v4); + }; + this.validators.push({ + validator: this.enumValidator, + message: errorMessage, + type: "enum", + enumValues: vals + }); + return this; + }; + SchemaString.prototype.lowercase = function(shouldApply) { + if (arguments.length > 0 && !shouldApply) { + return this; + } + return this.set((v4) => { + if (typeof v4 !== "string") { + v4 = this.cast(v4); + } + if (v4) { + return v4.toLowerCase(); + } + return v4; + }); + }; + SchemaString.prototype.uppercase = function(shouldApply) { + if (arguments.length > 0 && !shouldApply) { + return this; + } + return this.set((v4) => { + if (typeof v4 !== "string") { + v4 = this.cast(v4); + } + if (v4) { + return v4.toUpperCase(); + } + return v4; + }); + }; + SchemaString.prototype.trim = function(shouldTrim) { + if (arguments.length > 0 && !shouldTrim) { + return this; + } + return this.set((v4) => { + if (typeof v4 !== "string") { + v4 = this.cast(v4); + } + if (v4) { + return v4.trim(); + } + return v4; + }); + }; + SchemaString.prototype.minlength = function(value, message2) { + if (this.minlengthValidator) { + this.validators = this.validators.filter(function(v4) { + return v4.validator !== this.minlengthValidator; + }, this); + } + if (value !== null && value !== void 0) { + let msg = message2 || MongooseError.messages.String.minlength; + msg = msg.replace(/{MINLENGTH}/, value); + this.validators.push({ + validator: this.minlengthValidator = function(v4) { + return v4 === null || v4.length >= value; + }, + message: msg, + type: "minlength", + minlength: value + }); + } + return this; + }; + SchemaString.prototype.minLength = SchemaString.prototype.minlength; + SchemaString.prototype.maxlength = function(value, message2) { + if (this.maxlengthValidator) { + this.validators = this.validators.filter(function(v4) { + return v4.validator !== this.maxlengthValidator; + }, this); + } + if (value !== null && value !== void 0) { + let msg = message2 || MongooseError.messages.String.maxlength; + msg = msg.replace(/{MAXLENGTH}/, value); + this.validators.push({ + validator: this.maxlengthValidator = function(v4) { + return v4 === null || v4.length <= value; + }, + message: msg, + type: "maxlength", + maxlength: value + }); + } + return this; + }; + SchemaString.prototype.maxLength = SchemaString.prototype.maxlength; + SchemaString.prototype.match = function match(regExp, message2) { + const msg = message2 || MongooseError.messages.String.match; + const matchValidator = function(v4) { + if (!regExp) { + return false; + } + regExp.lastIndex = 0; + const ret = v4 != null && v4 !== "" ? regExp.test(v4) : true; + return ret; + }; + this.validators.push({ + validator: matchValidator, + message: msg, + type: "regexp", + regexp: regExp + }); + return this; + }; + SchemaString.prototype.checkRequired = function checkRequired(value, doc) { + if (typeof value === "object" && SchemaType._isRef(this, value, doc, true)) { + return value != null; + } + const _checkRequired = typeof this.constructor.checkRequired === "function" ? this.constructor.checkRequired() : SchemaString.checkRequired(); + return _checkRequired(value); + }; + SchemaString.prototype.cast = function(value, doc, init, prev, options) { + if (typeof value !== "string" && SchemaType._isRef(this, value, doc, init)) { + return this._castRef(value, doc, init, options); + } + let castString2; + if (typeof this._castFunction === "function") { + castString2 = this._castFunction; + } else if (typeof this.constructor.cast === "function") { + castString2 = this.constructor.cast(); + } else { + castString2 = SchemaString.cast(); + } + try { + return castString2(value); + } catch (error2) { + throw new CastError("string", value, this.path, null, this); + } + }; + function handleSingle(val, context) { + return this.castForQuery(null, val, context); + } + function handleArray(val, context) { + const _this = this; + if (!Array.isArray(val)) { + return [this.castForQuery(null, val, context)]; + } + return val.map(function(m4) { + return _this.castForQuery(null, m4, context); + }); + } + function handleSingleNoSetters(val) { + if (val == null) { + return this._castNullish(val); + } + return this.cast(val, this); + } + var $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $all: handleArray, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle, + $options: handleSingleNoSetters, + $regex: function handle$regex(val) { + if (Object.prototype.toString.call(val) === "[object RegExp]") { + return val; + } + return handleSingleNoSetters.call(this, val); + }, + $not: handleSingle + }; + Object.defineProperty(SchemaString.prototype, "$conditionalHandlers", { + enumerable: false, + value: $conditionalHandlers + }); + SchemaString.prototype.castForQuery = function($conditional, val, context) { + let handler2; + if ($conditional != null) { + handler2 = this.$conditionalHandlers[$conditional]; + if (!handler2) { + throw new Error("Can't use " + $conditional + " with String."); + } + return handler2.call(this, val, context); + } + if (Object.prototype.toString.call(val) === "[object RegExp]" || isBsonType(val, "BSONRegExp")) { + return val; + } + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } + }; + SchemaString.prototype.toJSONSchema = function toJSONSchema(options) { + const isRequired = this.options.required && typeof this.options.required !== "function"; + return createJSONSchemaTypeDefinition("string", "string", options?.useBsonType, isRequired); + }; + SchemaString.prototype.autoEncryptionType = function autoEncryptionType() { + return "string"; + }; + module2.exports = SchemaString; + } +}); + +// node_modules/mongoose/lib/cast/uuid.js +var require_uuid2 = __commonJS({ + "node_modules/mongoose/lib/cast/uuid.js"(exports2, module2) { + "use strict"; + var MongooseBuffer = require_buffer(); + var UUID_FORMAT = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i; + var Binary = MongooseBuffer.Binary; + module2.exports = function castUUID(value) { + if (value == null) { + return value; + } + function newBuffer(initbuff) { + const buff = new MongooseBuffer(initbuff); + buff._subtype = 4; + return buff; + } + if (typeof value === "string") { + if (UUID_FORMAT.test(value)) { + return stringToBinary(value); + } else { + throw new Error(`"${value}" is not a valid UUID string`); + } + } + if (Buffer.isBuffer(value)) { + return newBuffer(value); + } + if (value instanceof Binary) { + return newBuffer(value.value(true)); + } + if (value.toString && value.toString !== Object.prototype.toString) { + if (UUID_FORMAT.test(value.toString())) { + return stringToBinary(value.toString()); + } + } + throw new Error(`"${value}" cannot be casted to a UUID`); + }; + module2.exports.UUID_FORMAT = UUID_FORMAT; + function hex2buffer(hex) { + const buff = hex != null && Buffer.from(hex, "hex"); + return buff; + } + function stringToBinary(uuidStr) { + if (typeof uuidStr !== "string") uuidStr = ""; + const hex = uuidStr.replace(/[{}-]/g, ""); + const bytes = hex2buffer(hex); + const buff = new MongooseBuffer(bytes); + buff._subtype = 4; + return buff; + } + } +}); + +// node_modules/mongoose/lib/schema/uuid.js +var require_uuid3 = __commonJS({ + "node_modules/mongoose/lib/schema/uuid.js"(exports2, module2) { + "use strict"; + var MongooseBuffer = require_buffer(); + var SchemaType = require_schemaType(); + var CastError = SchemaType.CastError; + var castUUID = require_uuid2(); + var createJSONSchemaTypeDefinition = require_createJSONSchemaTypeDefinition(); + var utils = require_utils6(); + var handleBitwiseOperator = require_bitwise(); + var UUID_FORMAT = castUUID.UUID_FORMAT; + var Binary = MongooseBuffer.Binary; + function binaryToString(uuidBin) { + let hex; + if (typeof uuidBin !== "string" && uuidBin != null) { + hex = uuidBin.toString("hex"); + const uuidStr = hex.substring(0, 8) + "-" + hex.substring(8, 8 + 4) + "-" + hex.substring(12, 12 + 4) + "-" + hex.substring(16, 16 + 4) + "-" + hex.substring(20, 20 + 12); + return uuidStr; + } + return uuidBin; + } + function SchemaUUID(key, options, _schemaOptions, parentSchema) { + SchemaType.call(this, key, options, "UUID", parentSchema); + this.getters.push(function(value) { + if (value != null && value.$__ != null) { + return value; + } + if (Buffer.isBuffer(value)) { + return binaryToString(value); + } else if (value instanceof Binary) { + return binaryToString(value.buffer); + } else if (utils.isPOJO(value) && value.type === "Buffer" && Array.isArray(value.data)) { + return binaryToString(Buffer.from(value.data)); + } + return value; + }); + } + SchemaUUID.schemaName = "UUID"; + SchemaUUID.defaultOptions = {}; + SchemaUUID.prototype = Object.create(SchemaType.prototype); + SchemaUUID.prototype.constructor = SchemaUUID; + SchemaUUID._cast = castUUID; + SchemaUUID.get = SchemaType.get; + SchemaUUID.set = SchemaType.set; + SchemaUUID.setters = []; + SchemaUUID.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + return this._cast; + }; + SchemaUUID._checkRequired = (v4) => v4 != null; + SchemaUUID.checkRequired = SchemaType.checkRequired; + SchemaUUID.prototype.checkRequired = function checkRequired(value) { + if (Buffer.isBuffer(value)) { + value = binaryToString(value); + } + return value != null && UUID_FORMAT.test(value); + }; + SchemaUUID.prototype.cast = function(value, doc, init, prev, options) { + if (utils.isNonBuiltinObject(value) && SchemaType._isRef(this, value, doc, init)) { + return this._castRef(value, doc, init, options); + } + let castFn; + if (typeof this._castFunction === "function") { + castFn = this._castFunction; + } else if (typeof this.constructor.cast === "function") { + castFn = this.constructor.cast(); + } else { + castFn = SchemaUUID.cast(); + } + try { + return castFn(value); + } catch (error2) { + throw new CastError(SchemaUUID.schemaName, value, this.path, error2, this); + } + }; + function handleSingle(val) { + return this.cast(val); + } + function handleArray(val) { + return val.map((m4) => { + return this.cast(m4); + }); + } + var $conditionalHandlers = { + ...SchemaType.prototype.$conditionalHandlers, + $bitsAllClear: handleBitwiseOperator, + $bitsAnyClear: handleBitwiseOperator, + $bitsAllSet: handleBitwiseOperator, + $bitsAnySet: handleBitwiseOperator, + $all: handleArray, + $gt: handleSingle, + $gte: handleSingle, + $in: handleArray, + $lt: handleSingle, + $lte: handleSingle, + $ne: handleSingle, + $nin: handleArray + }; + Object.defineProperty(SchemaUUID.prototype, "$conditionalHandlers", { + enumerable: false, + value: $conditionalHandlers + }); + SchemaUUID.prototype.castForQuery = function($conditional, val, context) { + let handler2; + if ($conditional != null) { + handler2 = this.$conditionalHandlers[$conditional]; + if (!handler2) + throw new Error("Can't use " + $conditional + " with UUID."); + return handler2.call(this, val, context); + } + try { + return this.applySetters(val, context); + } catch (err) { + if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { + err.path = this.$fullPath; + } + throw err; + } + }; + SchemaUUID.prototype.toJSONSchema = function toJSONSchema(options) { + const isRequired = this.options.required && typeof this.options.required !== "function"; + return createJSONSchemaTypeDefinition("string", "binData", options?.useBsonType, isRequired); + }; + SchemaUUID.prototype.autoEncryptionType = function autoEncryptionType() { + return "binData"; + }; + module2.exports = SchemaUUID; + } +}); + +// node_modules/mongoose/lib/options/schemaUnionOptions.js +var require_schemaUnionOptions = __commonJS({ + "node_modules/mongoose/lib/options/schemaUnionOptions.js"(exports2, module2) { + "use strict"; + var SchemaTypeOptions = require_schemaTypeOptions(); + var SchemaUnionOptions = class extends SchemaTypeOptions { + }; + var opts = require_propertyOptions(); + Object.defineProperty(SchemaUnionOptions.prototype, "of", opts); + module2.exports = SchemaUnionOptions; + } +}); + +// node_modules/mongoose/lib/schema/union.js +var require_union = __commonJS({ + "node_modules/mongoose/lib/schema/union.js"(exports2, module2) { + "use strict"; + var SchemaUnionOptions = require_schemaUnionOptions(); + var SchemaType = require_schemaType(); + var firstValueSymbol = /* @__PURE__ */ Symbol("firstValue"); + var Union = class extends SchemaType { + /** + * Create a Union schema type. + * + * @param {String} key the path in the schema for this schema type + * @param {Object} options SchemaType-specific options (must have 'of' as array) + * @param {Object} schemaOptions additional options from the schema this schematype belongs to + * @param {Schema} parentSchema the schema this schematype belongs to + */ + constructor(key, options, schemaOptions, parentSchema) { + super(key, options, "Union", parentSchema); + if (!options || !Array.isArray(options.of) || options.of.length === 0) { + throw new Error("Union schema type requires an array of types"); + } + this.schemaTypes = options.of.map((obj) => parentSchema.interpretAsType(key, obj, schemaOptions)); + } + cast(val, doc, init, prev, options) { + let firstValue = firstValueSymbol; + let lastError; + for (let i4 = 0; i4 < this.schemaTypes.length; ++i4) { + try { + const casted = this.schemaTypes[i4].cast(val, doc, init, prev, options); + if (casted === val) { + return casted; + } + if (firstValue === firstValueSymbol) { + firstValue = casted; + } + } catch (error2) { + lastError = error2; + } + } + if (firstValue !== firstValueSymbol) { + return firstValue; + } + throw lastError; + } + // Setters also need to be aware of casting - we need to apply the setters of the entry in the union we choose. + applySetters(val, doc, init, prev, options) { + let firstValue = firstValueSymbol; + let lastError; + for (let i4 = 0; i4 < this.schemaTypes.length; ++i4) { + try { + let castedVal = this.schemaTypes[i4]._applySetters(val, doc, init, prev, options); + if (castedVal == null) { + castedVal = this.schemaTypes[i4]._castNullish(castedVal); + } else { + castedVal = this.schemaTypes[i4].cast(castedVal, doc, init, prev, options); + } + if (castedVal === val) { + return castedVal; + } + if (firstValue === firstValueSymbol) { + firstValue = castedVal; + } + } catch (error2) { + lastError = error2; + } + } + if (firstValue !== firstValueSymbol) { + return firstValue; + } + throw lastError; + } + clone() { + const schematype = super.clone(); + schematype.schemaTypes = this.schemaTypes.map((schemaType) => schemaType.clone()); + return schematype; + } + }; + Union.schemaName = "Union"; + Union.defaultOptions = {}; + Union.prototype.OptionsConstructor = SchemaUnionOptions; + module2.exports = Union; + } +}); + +// node_modules/mongoose/lib/schema/index.js +var require_schema = __commonJS({ + "node_modules/mongoose/lib/schema/index.js"(exports2) { + "use strict"; + exports2.Array = require_array2(); + exports2.BigInt = require_bigint2(); + exports2.Boolean = require_boolean2(); + exports2.Buffer = require_buffer2(); + exports2.Date = require_date2(); + exports2.Decimal128 = exports2.Decimal = require_decimal1283(); + exports2.DocumentArray = require_documentArray2(); + exports2.Double = require_double3(); + exports2.Int32 = require_int322(); + exports2.Map = require_map2(); + exports2.Mixed = require_mixed(); + exports2.Number = require_number2(); + exports2.ObjectId = require_objectId(); + exports2.String = require_string2(); + exports2.Subdocument = require_subdocument2(); + exports2.UUID = require_uuid3(); + exports2.Union = require_union(); + exports2.Oid = exports2.ObjectId; + exports2.Object = exports2.Mixed; + exports2.Bool = exports2.Boolean; + exports2.ObjectID = exports2.ObjectId; + } +}); + +// node_modules/mongoose/lib/schema.js +var require_schema2 = __commonJS({ + "node_modules/mongoose/lib/schema.js"(exports2, module2) { + "use strict"; + var EventEmitter = require("events").EventEmitter; + var Kareem = require_kareem(); + var MongooseError = require_mongooseError(); + var SchemaType = require_schemaType(); + var SchemaTypeOptions = require_schemaTypeOptions(); + var VirtualOptions = require_virtualOptions(); + var VirtualType = require_virtualType(); + var addAutoId = require_addAutoId(); + var clone = require_clone(); + var get2 = require_get(); + var getConstructorName = require_getConstructorName(); + var getIndexes = require_getIndexes(); + var handleReadPreferenceAliases = require_handleReadPreferenceAliases(); + var idGetter = require_idGetter(); + var isIndexSpecEqual = require_isIndexSpecEqual(); + var merge = require_merge(); + var mpath = require_mpath(); + var setPopulatedVirtualValue = require_setPopulatedVirtualValue(); + var setupTimestamps = require_setupTimestamps(); + var utils = require_utils6(); + var validateRef = require_validateRef(); + var hasNumericSubpathRegex = /\.\d+(\.|$)/; + var MongooseTypes; + var queryHooks = require_constants6().queryMiddlewareFunctions; + var documentHooks = require_applyHooks().middlewareFunctions; + var hookNames = queryHooks.concat(documentHooks).reduce((s4, hook) => s4.add(hook), /* @__PURE__ */ new Set()); + var isPOJO = utils.isPOJO; + var id = 0; + var numberRE = /^\d+$/; + function Schema2(obj, options) { + if (!(this instanceof Schema2)) { + return new Schema2(obj, options); + } + this.obj = obj; + this.paths = {}; + this.aliases = {}; + this.subpaths = {}; + this.virtuals = {}; + this.singleNestedPaths = {}; + this.nested = {}; + this.inherits = {}; + this.callQueue = []; + this._indexes = []; + this._searchIndexes = []; + this.methods = options && options.methods || {}; + this.methodOptions = {}; + this.statics = options && options.statics || {}; + this.tree = {}; + this.query = options && options.query || {}; + this.childSchemas = []; + this.plugins = []; + this.$id = ++id; + this.mapPaths = []; + this.encryptedFields = {}; + this.s = { + hooks: new Kareem() + }; + this.options = this.defaultOptions(options); + if (Array.isArray(obj)) { + for (const definition of obj) { + this.add(definition); + } + } else if (obj) { + this.add(obj); + } + if (options && options.virtuals) { + const virtuals = options.virtuals; + const pathNames = Object.keys(virtuals); + for (const pathName of pathNames) { + const pathOptions = virtuals[pathName].options ? virtuals[pathName].options : void 0; + const virtual = this.virtual(pathName, pathOptions); + if (virtuals[pathName].get) { + virtual.get(virtuals[pathName].get); + } + if (virtuals[pathName].set) { + virtual.set(virtuals[pathName].set); + } + } + } + const _idSubDoc = obj && obj._id && utils.isObject(obj._id); + const auto_id = !this.paths["_id"] && this.options._id && !_idSubDoc; + if (auto_id) { + addAutoId(this); + } + this.setupTimestamp(this.options.timestamps); + } + function aliasFields(schema, paths) { + for (const path of Object.keys(paths)) { + let alias = null; + if (paths[path] != null) { + alias = paths[path]; + } else { + const options = get2(schema.paths[path], "options"); + if (options == null) { + continue; + } + alias = options.alias; + } + if (!alias) { + continue; + } + const prop = schema.paths[path].path; + if (Array.isArray(alias)) { + for (const a4 of alias) { + if (typeof a4 !== "string") { + throw new Error("Invalid value for alias option on " + prop + ", got " + a4); + } + schema.aliases[a4] = prop; + schema.virtual(a4).get(/* @__PURE__ */ (function(p4) { + return function() { + if (typeof this.get === "function") { + return this.get(p4); + } + return this[p4]; + }; + })(prop)).set(/* @__PURE__ */ (function(p4) { + return function(v4) { + return this.$set(p4, v4); + }; + })(prop)); + } + continue; + } + if (typeof alias !== "string") { + throw new Error("Invalid value for alias option on " + prop + ", got " + alias); + } + schema.aliases[alias] = prop; + schema.virtual(alias).get(/* @__PURE__ */ (function(p4) { + return function() { + if (typeof this.get === "function") { + return this.get(p4); + } + return this[p4]; + }; + })(prop)).set(/* @__PURE__ */ (function(p4) { + return function(v4) { + return this.$set(p4, v4); + }; + })(prop)); + } + } + Schema2.prototype = Object.create(EventEmitter.prototype); + Schema2.prototype.constructor = Schema2; + Schema2.prototype.instanceOfSchema = true; + Object.defineProperty(Schema2.prototype, "$schemaType", { + configurable: false, + enumerable: false, + writable: true + }); + Object.defineProperty(Schema2.prototype, "childSchemas", { + configurable: false, + enumerable: true, + writable: true + }); + Object.defineProperty(Schema2.prototype, "virtuals", { + configurable: false, + enumerable: true, + writable: true + }); + Schema2.prototype.obj; + Schema2.prototype.paths; + Schema2.prototype.tree; + Schema2.prototype.clone = function() { + const s4 = this._clone(); + s4.on("init", (v4) => this.emit("init", v4)); + return s4; + }; + Schema2.prototype._clone = function _clone(Constructor) { + Constructor = Constructor || (this.base == null ? Schema2 : this.base.Schema); + const s4 = new Constructor({}, this._userProvidedOptions); + s4.base = this.base; + s4.obj = this.obj; + s4.options = clone(this.options); + s4.callQueue = this.callQueue.map(function(f4) { + return f4; + }); + s4.methods = clone(this.methods); + s4.methodOptions = clone(this.methodOptions); + s4.statics = clone(this.statics); + s4.query = clone(this.query); + s4.plugins = Array.prototype.slice.call(this.plugins); + s4._indexes = clone(this._indexes); + s4._searchIndexes = clone(this._searchIndexes); + s4.s.hooks = this.s.hooks.clone(); + s4.tree = clone(this.tree); + s4.paths = Object.fromEntries( + Object.entries(this.paths).map(([key, value]) => [key, value.clone()]) + ); + s4.nested = clone(this.nested); + s4.subpaths = clone(this.subpaths); + for (const schemaType of Object.values(s4.paths)) { + if (schemaType.$isSingleNested) { + const path = schemaType.path; + for (const key of Object.keys(schemaType.schema.paths)) { + s4.singleNestedPaths[path + "." + key] = schemaType.schema.paths[key]; + } + for (const key of Object.keys(schemaType.schema.singleNestedPaths)) { + s4.singleNestedPaths[path + "." + key] = schemaType.schema.singleNestedPaths[key]; + } + for (const key of Object.keys(schemaType.schema.subpaths)) { + s4.singleNestedPaths[path + "." + key] = schemaType.schema.subpaths[key]; + } + for (const key of Object.keys(schemaType.schema.nested)) { + s4.singleNestedPaths[path + "." + key] = "nested"; + } + } + } + s4._gatherChildSchemas(); + s4.virtuals = clone(this.virtuals); + s4.$globalPluginsApplied = this.$globalPluginsApplied; + s4.$isRootDiscriminator = this.$isRootDiscriminator; + s4.$implicitlyCreated = this.$implicitlyCreated; + s4.$id = ++id; + s4.$originalSchemaId = this.$id; + s4.mapPaths = [].concat(this.mapPaths); + if (this.discriminatorMapping != null) { + s4.discriminatorMapping = Object.assign({}, this.discriminatorMapping); + } + if (this.discriminators != null) { + s4.discriminators = Object.assign({}, this.discriminators); + } + if (this._applyDiscriminators != null) { + s4._applyDiscriminators = new Map(this._applyDiscriminators); + } + s4.aliases = Object.assign({}, this.aliases); + s4.encryptedFields = clone(this.encryptedFields); + return s4; + }; + Schema2.prototype.pick = function(paths, options) { + const newSchema = new Schema2({}, options || this.options); + if (!Array.isArray(paths)) { + throw new MongooseError('Schema#pick() only accepts an array argument, got "' + typeof paths + '"'); + } + for (const path of paths) { + if (this._hasEncryptedField(path)) { + const encrypt = this.encryptedFields[path]; + const schemaType = this.path(path); + newSchema.add({ + [path]: { + encrypt, + [this.options.typeKey]: schemaType + } + }); + } else if (this.nested[path]) { + newSchema.add({ [path]: get2(this.tree, path) }); + } else { + const schematype = this.path(path); + if (schematype == null) { + throw new MongooseError("Path `" + path + "` is not in the schema"); + } + newSchema.add({ [path]: schematype }); + } + } + if (!this._hasEncryptedFields()) { + newSchema.options.encryptionType = null; + } + return newSchema; + }; + Schema2.prototype.omit = function(paths, options) { + const newSchema = new Schema2(this, options || this.options); + if (!Array.isArray(paths)) { + throw new MongooseError( + 'Schema#omit() only accepts an array argument, got "' + typeof paths + '"' + ); + } + newSchema.remove(paths); + for (const nested in newSchema.singleNestedPaths) { + if (paths.includes(nested)) { + delete newSchema.singleNestedPaths[nested]; + } + } + return newSchema; + }; + Schema2.prototype.defaultOptions = function(options) { + this._userProvidedOptions = options == null ? {} : clone(options); + const baseOptions = this.base && this.base.options || {}; + const strict = "strict" in baseOptions ? baseOptions.strict : true; + const strictQuery = "strictQuery" in baseOptions ? baseOptions.strictQuery : false; + const id2 = "id" in baseOptions ? baseOptions.id : true; + options = { + strict, + strictQuery, + bufferCommands: true, + capped: false, + // { size, max, autoIndexId } + versionKey: "__v", + optimisticConcurrency: false, + minimize: true, + autoIndex: null, + discriminatorKey: "__t", + shardKey: null, + read: null, + validateBeforeSave: true, + validateModifiedOnly: false, + // the following are only applied at construction time + _id: true, + id: id2, + typeKey: "type", + ...options + }; + if (options.versionKey && typeof options.versionKey !== "string") { + throw new MongooseError("`versionKey` must be falsy or string, got `" + typeof options.versionKey + "`"); + } + if (typeof options.read === "string") { + options.read = handleReadPreferenceAliases(options.read); + } else if (Array.isArray(options.read) && typeof options.read[0] === "string") { + options.read = { + mode: handleReadPreferenceAliases(options.read[0]), + tags: options.read[1] + }; + } + if (options.optimisticConcurrency && !options.versionKey) { + throw new MongooseError("Must set `versionKey` if using `optimisticConcurrency`"); + } + return options; + }; + Schema2.prototype.discriminator = function(name, schema, options) { + this._applyDiscriminators = this._applyDiscriminators || /* @__PURE__ */ new Map(); + this._applyDiscriminators.set(name, { schema, options }); + return this; + }; + Schema2.prototype._defaultToObjectOptions = function(json) { + const path = json ? "toJSON" : "toObject"; + if (this._defaultToObjectOptionsMap && this._defaultToObjectOptionsMap[path]) { + return this._defaultToObjectOptionsMap[path]; + } + const baseOptions = this.base && this.base.options && this.base.options[path] || {}; + const schemaOptions = this.options[path] || {}; + const defaultOptions = Object.assign({}, baseOptions, schemaOptions); + this._defaultToObjectOptionsMap = this._defaultToObjectOptionsMap || {}; + this._defaultToObjectOptionsMap[path] = defaultOptions; + return defaultOptions; + }; + Schema2.prototype.encryptionType = function encryptionType(encryptionType) { + if (arguments.length === 0) { + return this.options.encryptionType; + } + if (!(typeof encryptionType === "string" || encryptionType === null)) { + throw new Error("invalid `encryptionType`: ${encryptionType}"); + } + this.options.encryptionType = encryptionType; + }; + Schema2.prototype.add = function add(obj, prefix) { + if (obj instanceof Schema2 || obj != null && obj.instanceOfSchema) { + merge(this, obj); + return this; + } + if (obj._id === false && prefix == null) { + this.options._id = false; + } + prefix = prefix || ""; + if (prefix === "__proto__." || prefix === "constructor." || prefix === "prototype.") { + return this; + } + const keys = Object.keys(obj); + const typeKey = this.options.typeKey; + for (const key of keys) { + if (utils.specialProperties.has(key)) { + continue; + } + const fullPath = prefix + key; + const val = obj[key]; + if (val == null) { + throw new TypeError("Invalid value for schema path `" + fullPath + '`, got value "' + val + '"'); + } + if (key === "_id" && val === false) { + continue; + } + let isMongooseTypeString = false; + if (typeof val === "string") { + const MongooseTypes2 = this.base != null ? this.base.Schema.Types : Schema2.Types; + const upperVal = val.charAt(0).toUpperCase() + val.substring(1); + isMongooseTypeString = MongooseTypes2[upperVal] != null; + } + if (key !== "_id" && (typeof val !== "object" && typeof val !== "function" && !isMongooseTypeString || val == null)) { + throw new TypeError(`Invalid schema configuration: \`${val}\` is not a valid type at path \`${key}\`. See https://bit.ly/mongoose-schematypes for a list of valid schema types.`); + } + if (val instanceof VirtualType || (val.constructor && val.constructor.name || null) === "VirtualType") { + this.virtual(val); + continue; + } + if (Array.isArray(val) && val.length === 1 && val[0] == null) { + throw new TypeError("Invalid value for schema Array path `" + fullPath + '`, got value "' + val[0] + '"'); + } + if (!(isPOJO(val) || val instanceof SchemaTypeOptions)) { + if (prefix) { + this.nested[prefix.substring(0, prefix.length - 1)] = true; + } + this.path(prefix + key, val); + if (val[0] != null && !val[0].instanceOfSchema && utils.isPOJO(val[0].discriminators)) { + const schemaType = this.path(prefix + key); + for (const key2 in val[0].discriminators) { + schemaType.discriminator(key2, val[0].discriminators[key2]); + } + } + } else if (Object.keys(val).length < 1) { + if (prefix) { + this.nested[prefix.substring(0, prefix.length - 1)] = true; + } + this.path(fullPath, val); + } else if (!val[typeKey] || typeKey === "type" && isPOJO(val.type) && val.type.type) { + this.nested[fullPath] = true; + this.add(val, fullPath + "."); + } else { + const _typeDef = val[typeKey]; + if (isPOJO(_typeDef) && Object.keys(_typeDef).length > 0) { + if (prefix) { + this.nested[prefix.substring(0, prefix.length - 1)] = true; + } + const childSchemaOptions = {}; + if (this._userProvidedOptions.typeKey) { + childSchemaOptions.typeKey = this._userProvidedOptions.typeKey; + } + if (this._userProvidedOptions.strict != null) { + childSchemaOptions.strict = this._userProvidedOptions.strict; + } + if (this._userProvidedOptions.toObject != null) { + childSchemaOptions.toObject = utils.omit(this._userProvidedOptions.toObject, ["transform"]); + } + if (this._userProvidedOptions.toJSON != null) { + childSchemaOptions.toJSON = utils.omit(this._userProvidedOptions.toJSON, ["transform"]); + } + const _schema = new Schema2(_typeDef, childSchemaOptions); + _schema.$implicitlyCreated = true; + const schemaWrappedPath = Object.assign({}, val, { [typeKey]: _schema }); + this.path(prefix + key, schemaWrappedPath); + } else { + if (prefix) { + this.nested[prefix.substring(0, prefix.length - 1)] = true; + } + this.path(prefix + key, val); + if (val != null && !val.instanceOfSchema && utils.isPOJO(val.discriminators)) { + const schemaType = this.path(prefix + key); + for (const key2 in val.discriminators) { + schemaType.discriminator(key2, val.discriminators[key2]); + } + } + } + } + if (val.instanceOfSchema && val.encryptionType() != null) { + if (this.encryptionType() != val.encryptionType()) { + throw new Error("encryptionType of a nested schema must match the encryption type of the parent schema."); + } + for (const [encryptedField, encryptedFieldConfig] of Object.entries(val.encryptedFields)) { + const path = fullPath + "." + encryptedField; + this._addEncryptedField(path, encryptedFieldConfig); + } + } else if (typeof val === "object" && "encrypt" in val) { + const { encrypt } = val; + if (this.encryptionType() == null) { + throw new Error("encryptionType must be provided"); + } + this._addEncryptedField(fullPath, encrypt); + } else { + this._removeEncryptedField(fullPath); + } + } + const aliasObj = Object.fromEntries( + Object.entries(obj).map(([key]) => [prefix + key, null]) + ); + aliasFields(this, aliasObj); + return this; + }; + Schema2.prototype._addEncryptedField = function _addEncryptedField(path, fieldConfig) { + const type = this.path(path).autoEncryptionType(); + if (type == null) { + throw new Error(`Invalid BSON type for FLE field: '${path}'`); + } + this.encryptedFields[path] = clone(fieldConfig); + }; + Schema2.prototype._removeEncryptedField = function _removeEncryptedField(path) { + delete this.encryptedFields[path]; + }; + Schema2.prototype._hasEncryptedFields = function _hasEncryptedFields() { + return Object.keys(this.encryptedFields).length > 0; + }; + Schema2.prototype._hasEncryptedField = function _hasEncryptedField(path) { + return path in this.encryptedFields; + }; + Schema2.prototype._buildEncryptedFields = function() { + const fields = Object.entries(this.encryptedFields).map( + ([path, config]) => { + const bsonType = this.path(path).autoEncryptionType(); + return { path, bsonType, ...config }; + } + ); + return { fields }; + }; + Schema2.prototype._buildSchemaMap = function() { + function buildNestedPath(path, object, value) { + let i4 = 0, component = path[i4]; + for (; i4 < path.length - 1; ++i4, component = path[i4]) { + object[component] = object[component] == null ? { + bsonType: "object", + properties: {} + } : object[component]; + object = object[component].properties; + } + object[component] = value; + } + const schemaMapPropertyReducer = (accum, [path, propertyConfig]) => { + const bsonType = this.path(path).autoEncryptionType(); + const pathComponents = path.split("."); + const configuration = { encrypt: { ...propertyConfig, bsonType } }; + buildNestedPath(pathComponents, accum, configuration); + return accum; + }; + const properties = Object.entries(this.encryptedFields).reduce( + schemaMapPropertyReducer, + {} + ); + return { + bsonType: "object", + properties + }; + }; + Schema2.prototype.alias = function alias(path, alias) { + aliasFields(this, { [path]: alias }); + return this; + }; + Schema2.prototype.removeIndex = function removeIndex(index) { + if (arguments.length > 1) { + throw new Error("removeIndex() takes only 1 argument"); + } + if (typeof index !== "object" && typeof index !== "string") { + throw new Error("removeIndex() may only take either an object or a string as an argument"); + } + if (typeof index === "object") { + for (let i4 = this._indexes.length - 1; i4 >= 0; --i4) { + if (isIndexSpecEqual(this._indexes[i4][0], index)) { + this._indexes.splice(i4, 1); + } + } + } else { + for (let i4 = this._indexes.length - 1; i4 >= 0; --i4) { + if (this._indexes[i4][1] != null && this._indexes[i4][1].name === index) { + this._indexes.splice(i4, 1); + } + } + } + return this; + }; + Schema2.prototype.clearIndexes = function clearIndexes() { + this._indexes.length = 0; + return this; + }; + Schema2.prototype.searchIndex = function searchIndex(description) { + this._searchIndexes.push(description); + return this; + }; + Schema2.reserved = /* @__PURE__ */ Object.create(null); + Schema2.prototype.reserved = Schema2.reserved; + var reserved = Schema2.reserved; + reserved["prototype"] = // EventEmitter + reserved.emit = reserved.listeners = reserved.removeListener = // document properties and functions + reserved.collection = reserved.errors = reserved.get = reserved.init = reserved.isModified = reserved.isNew = reserved.populated = reserved.remove = reserved.save = reserved.toObject = reserved.validate = 1; + reserved.collection = 1; + Schema2.prototype.path = function(path, obj) { + if (obj === void 0) { + if (this.paths[path] != null) { + return this.paths[path]; + } + const cleanPath = _pathToPositionalSyntax(path); + let schematype = _getPath(this, path, cleanPath); + if (schematype != null) { + return schematype; + } + const mapPath = getMapPath(this, path); + if (mapPath != null) { + return mapPath; + } + schematype = this.hasMixedParent(cleanPath); + if (schematype != null) { + return schematype; + } + return hasNumericSubpathRegex.test(path) ? getPositionalPath(this, path, cleanPath) : void 0; + } + const firstPieceOfPath = path.split(".")[0]; + if (reserved[firstPieceOfPath] && !this.options.suppressReservedKeysWarning) { + const errorMessage = `\`${firstPieceOfPath}\` is a reserved schema pathname and may break some functionality. You are allowed to use it, but use at your own risk. To disable this warning pass \`suppressReservedKeysWarning\` as a schema option.`; + utils.warn(errorMessage); + } + if (typeof obj === "object" && utils.hasUserDefinedProperty(obj, "ref")) { + validateRef(obj.ref, path); + } + const subpaths = path.split(/\./); + const last = subpaths.pop(); + let branch = this.tree; + let fullPath = ""; + for (const sub of subpaths) { + if (utils.specialProperties.has(sub)) { + throw new Error("Cannot set special property `" + sub + "` on a schema"); + } + fullPath = fullPath += (fullPath.length > 0 ? "." : "") + sub; + if (!branch[sub]) { + this.nested[fullPath] = true; + branch[sub] = {}; + } + if (typeof branch[sub] !== "object") { + const msg = "Cannot set nested path `" + path + "`. Parent path `" + fullPath + "` already set to type " + branch[sub].name + "."; + throw new Error(msg); + } + branch = branch[sub]; + } + branch[last] = clone(obj); + this.paths[path] = this.interpretAsType(path, obj, this.options); + const schemaType = this.paths[path]; + this.childSchemas = this.childSchemas.filter((childSchema) => childSchema.path !== path); + if (schemaType.$isSchemaMap) { + const mapPath = path + ".$*"; + this.paths[mapPath] = schemaType.$__schemaType; + this.mapPaths.push(this.paths[mapPath]); + if (schemaType.$__schemaType.$isSingleNested) { + this.childSchemas.push({ + schema: schemaType.$__schemaType.schema, + model: schemaType.$__schemaType.caster, + path + }); + } + } + if (schemaType.$isSingleNested) { + for (const key of Object.keys(schemaType.schema.paths)) { + this.singleNestedPaths[path + "." + key] = schemaType.schema.paths[key]; + } + for (const key of Object.keys(schemaType.schema.singleNestedPaths)) { + this.singleNestedPaths[path + "." + key] = schemaType.schema.singleNestedPaths[key]; + } + for (const key of Object.keys(schemaType.schema.subpaths)) { + this.singleNestedPaths[path + "." + key] = schemaType.schema.subpaths[key]; + } + for (const key of Object.keys(schemaType.schema.nested)) { + this.singleNestedPaths[path + "." + key] = "nested"; + } + Object.defineProperty(schemaType.schema, "base", { + configurable: true, + enumerable: false, + writable: false, + value: this.base + }); + schemaType.caster.base = this.base; + this.childSchemas.push({ + schema: schemaType.schema, + model: schemaType.caster, + path + }); + } else if (schemaType.$isMongooseDocumentArray) { + Object.defineProperty(schemaType.schema, "base", { + configurable: true, + enumerable: false, + writable: false, + value: this.base + }); + schemaType.casterConstructor.base = this.base; + this.childSchemas.push({ + schema: schemaType.schema, + model: schemaType.casterConstructor, + path + }); + } + if (schemaType.$isMongooseArray && schemaType.caster instanceof SchemaType) { + let arrayPath = path; + let _schemaType = schemaType; + const toAdd = []; + while (_schemaType.$isMongooseArray) { + arrayPath = arrayPath + ".$"; + if (_schemaType.$isMongooseDocumentArray) { + _schemaType.$embeddedSchemaType._arrayPath = arrayPath; + _schemaType.$embeddedSchemaType._arrayParentPath = path; + _schemaType = _schemaType.$embeddedSchemaType; + } else { + _schemaType.caster._arrayPath = arrayPath; + _schemaType.caster._arrayParentPath = path; + _schemaType = _schemaType.caster; + } + this.subpaths[arrayPath] = _schemaType; + } + for (const _schemaType2 of toAdd) { + this.subpaths[_schemaType2.path] = _schemaType2; + } + } + if (schemaType.$isMongooseDocumentArray) { + for (const key of Object.keys(schemaType.schema.paths)) { + const _schemaType = schemaType.schema.paths[key]; + this.subpaths[path + "." + key] = _schemaType; + if (typeof _schemaType === "object" && _schemaType != null && _schemaType.$parentSchemaDocArray == null) { + _schemaType.$parentSchemaDocArray = schemaType; + } + } + for (const key of Object.keys(schemaType.schema.subpaths)) { + const _schemaType = schemaType.schema.subpaths[key]; + this.subpaths[path + "." + key] = _schemaType; + if (typeof _schemaType === "object" && _schemaType != null && _schemaType.$parentSchemaDocArray == null) { + _schemaType.$parentSchemaDocArray = schemaType; + } + } + for (const key of Object.keys(schemaType.schema.singleNestedPaths)) { + const _schemaType = schemaType.schema.singleNestedPaths[key]; + this.subpaths[path + "." + key] = _schemaType; + if (typeof _schemaType === "object" && _schemaType != null && _schemaType.$parentSchemaDocArray == null) { + _schemaType.$parentSchemaDocArray = schemaType; + } + } + } + return this; + }; + Schema2.prototype._gatherChildSchemas = function _gatherChildSchemas() { + const childSchemas = []; + for (const path of Object.keys(this.paths)) { + if (typeof path !== "string") { + continue; + } + const schematype = this.paths[path]; + if (schematype.$isMongooseDocumentArray || schematype.$isSingleNested) { + childSchemas.push({ + schema: schematype.schema, + model: schematype.caster, + path + }); + } else if (schematype.$isSchemaMap && schematype.$__schemaType.$isSingleNested) { + childSchemas.push({ + schema: schematype.$__schemaType.schema, + model: schematype.$__schemaType.caster, + path + }); + } + } + this.childSchemas = childSchemas; + return childSchemas; + }; + function _getPath(schema, path, cleanPath) { + if (Object.hasOwn(schema.paths, path)) { + return schema.paths[path]; + } + if (Object.hasOwn(schema.subpaths, cleanPath)) { + const subpath = schema.subpaths[cleanPath]; + if (subpath === "nested") { + return void 0; + } + return subpath; + } + if (Object.hasOwn(schema.singleNestedPaths, cleanPath) && typeof schema.singleNestedPaths[cleanPath] === "object") { + const singleNestedPath = schema.singleNestedPaths[cleanPath]; + if (singleNestedPath === "nested") { + return void 0; + } + return singleNestedPath; + } + return null; + } + function _pathToPositionalSyntax(path) { + if (!/\.\d+/.test(path)) { + return path; + } + return path.replace(/\.\d+\./g, ".$.").replace(/\.\d+$/, ".$"); + } + function getMapPath(schema, path) { + if (schema.mapPaths.length === 0) { + return null; + } + for (const val of schema.mapPaths) { + const cleanPath = val.path.replace(/\.\$\*/g, ""); + if (path === cleanPath || path.startsWith(cleanPath + ".") && path.slice(cleanPath.length + 1).indexOf(".") === -1) { + return val; + } else if (val.schema && path.startsWith(cleanPath + ".")) { + let remnant = path.slice(cleanPath.length + 1); + remnant = remnant.slice(remnant.indexOf(".") + 1); + return val.schema.paths[remnant]; + } else if (val.$isSchemaMap && path.startsWith(cleanPath + ".")) { + let remnant = path.slice(cleanPath.length + 1); + remnant = remnant.slice(remnant.indexOf(".") + 1); + const presplitPath = val.$__schemaType._presplitPath; + if (remnant.indexOf(".") === -1 && presplitPath[presplitPath.length - 1] === "$*") { + return val.$__schemaType; + } else if (remnant.indexOf(".") !== -1 && val.$__schemaType.schema && presplitPath[presplitPath.length - 1] === "$*") { + return val.$__schemaType.schema.path(remnant.slice(remnant.indexOf(".") + 1)); + } + } + } + return null; + } + Object.defineProperty(Schema2.prototype, "base", { + configurable: true, + enumerable: false, + writable: true, + value: null + }); + Schema2.prototype.interpretAsType = function(path, obj, options) { + if (obj instanceof SchemaType) { + if (obj.path === path) { + return obj; + } + const clone2 = obj.clone(); + clone2.path = path; + return clone2; + } + const MongooseTypes2 = this.base != null ? this.base.Schema.Types : Schema2.Types; + const Types = this.base != null ? this.base.Types : require_types2(); + if (!utils.isPOJO(obj) && !(obj instanceof SchemaTypeOptions)) { + const constructorName = utils.getFunctionName(obj.constructor); + if (constructorName !== "Object") { + const oldObj = obj; + obj = {}; + obj[options.typeKey] = oldObj; + } + } + let type = obj[options.typeKey] && (obj[options.typeKey] instanceof Function || options.typeKey !== "type" || !obj.type.type) ? obj[options.typeKey] : {}; + if (type instanceof SchemaType) { + if (type.path === path) { + return type; + } + const clone2 = type.clone(); + clone2.path = path; + return clone2; + } + let name; + if (utils.isPOJO(type) || type === "mixed") { + return new MongooseTypes2.Mixed(path, obj, null, this); + } + if (Array.isArray(type) || type === Array || type === "array" || type === MongooseTypes2.Array) { + let cast = type === Array || type === "array" ? obj.cast || obj.of : type[0]; + if (cast && cast.instanceOfSchema) { + if (!(cast instanceof Schema2)) { + if (this.options._isMerging) { + cast = new Schema2(cast); + } else { + throw new TypeError("Schema for array path `" + path + `\` is from a different copy of the Mongoose module. Please make sure you're using the same version of Mongoose everywhere with \`npm list mongoose\`. If you are still getting this error, please add \`new Schema()\` around the path: ${path}: new Schema(...)`); + } + } + return new MongooseTypes2.DocumentArray(path, cast, obj, null, this); + } + if (cast && cast[options.typeKey] && cast[options.typeKey].instanceOfSchema) { + if (!(cast[options.typeKey] instanceof Schema2)) { + if (this.options._isMerging) { + cast[options.typeKey] = new Schema2(cast[options.typeKey]); + } else { + throw new TypeError("Schema for array path `" + path + `\` is from a different copy of the Mongoose module. Please make sure you're using the same version of Mongoose everywhere with \`npm list mongoose\`. If you are still getting this error, please add \`new Schema()\` around the path: ${path}: new Schema(...)`); + } + } + return new MongooseTypes2.DocumentArray(path, cast[options.typeKey], obj, cast, this); + } + if (typeof cast !== "undefined") { + if (Array.isArray(cast) || cast.type === Array || cast.type == "Array") { + if (cast && cast.type == "Array") { + cast.type = Array; + } + return new MongooseTypes2.Array(path, this.interpretAsType(path, cast, options), obj, null, this); + } + } + const castFromTypeKey = cast != null && cast[options.typeKey] && (options.typeKey !== "type" || !cast.type.type) ? cast[options.typeKey] : cast; + if (typeof cast === "string") { + cast = MongooseTypes2[cast.charAt(0).toUpperCase() + cast.substring(1)]; + } else if (utils.isPOJO(castFromTypeKey)) { + if (Object.keys(castFromTypeKey).length) { + const childSchemaOptions = { minimize: options.minimize }; + if (options.typeKey) { + childSchemaOptions.typeKey = options.typeKey; + } + if (Object.hasOwn(options, "strict")) { + childSchemaOptions.strict = options.strict; + } + if (Object.hasOwn(options, "strictQuery")) { + childSchemaOptions.strictQuery = options.strictQuery; + } + if (Object.hasOwn(options, "toObject")) { + childSchemaOptions.toObject = utils.omit(options.toObject, ["transform"]); + } + if (Object.hasOwn(options, "toJSON")) { + childSchemaOptions.toJSON = utils.omit(options.toJSON, ["transform"]); + } + if (Object.hasOwn(this._userProvidedOptions, "_id")) { + childSchemaOptions._id = this._userProvidedOptions._id; + } else if (Schema2.Types.DocumentArray.defaultOptions._id != null) { + childSchemaOptions._id = Schema2.Types.DocumentArray.defaultOptions._id; + } + const childSchema = new Schema2(castFromTypeKey, childSchemaOptions); + childSchema.$implicitlyCreated = true; + return new MongooseTypes2.DocumentArray(path, childSchema, obj, null, this); + } else { + return new MongooseTypes2.Array(path, MongooseTypes2.Mixed, obj, null, this); + } + } + if (cast) { + type = cast[options.typeKey] && (options.typeKey !== "type" || !cast.type.type) ? cast[options.typeKey] : cast; + if (Array.isArray(type)) { + return new MongooseTypes2.Array(path, this.interpretAsType(path, type, options), obj, null, this); + } + name = typeof type === "string" ? type : type.schemaName || utils.getFunctionName(type); + if (name === "ClockDate") { + name = "Date"; + } + if (name === void 0) { + throw new TypeError(`Invalid schema configuration: Could not determine the embedded type for array \`${path}\`. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.`); + } + if (!Object.hasOwn(MongooseTypes2, name)) { + throw new TypeError(`Invalid schema configuration: \`${name}\` is not a valid type within the array \`${path}\`.See https://bit.ly/mongoose-schematypes for a list of valid schema types.`); + } + if (name === "Union" && typeof cast === "object") { + cast.parentSchema = this; + } + } + return new MongooseTypes2.Array(path, cast || MongooseTypes2.Mixed, obj, options, this); + } + if (type && type.instanceOfSchema) { + return new MongooseTypes2.Subdocument(type, path, obj, this); + } + if (Buffer.isBuffer(type)) { + name = "Buffer"; + } else if (typeof type === "function" || typeof type === "object") { + name = type.schemaName || utils.getFunctionName(type); + } else if (type === Types.ObjectId) { + name = "ObjectId"; + } else if (type === Types.Decimal128) { + name = "Decimal128"; + } else { + name = type == null ? "" + type : type.toString(); + } + if (name) { + name = name.charAt(0).toUpperCase() + name.substring(1); + } + if (name === "ObjectID") { + name = "ObjectId"; + } + if (name === "ClockDate") { + name = "Date"; + } + if (name === void 0) { + throw new TypeError(`Invalid schema configuration: \`${path}\` schematype definition is invalid. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.`); + } + if (MongooseTypes2[name] == null) { + throw new TypeError(`Invalid schema configuration: \`${name}\` is not a valid type at path \`${path}\`. See https://bit.ly/mongoose-schematypes for a list of valid schema types.`); + } + const schemaType = new MongooseTypes2[name](path, obj, options, this); + return schemaType; + }; + Schema2.prototype.eachPath = function(fn2) { + const keys = Object.keys(this.paths); + const len = keys.length; + for (let i4 = 0; i4 < len; ++i4) { + fn2(keys[i4], this.paths[keys[i4]]); + } + return this; + }; + Schema2.prototype.requiredPaths = function requiredPaths(invalidate) { + if (this._requiredpaths && !invalidate) { + return this._requiredpaths; + } + const paths = Object.keys(this.paths); + let i4 = paths.length; + const ret = []; + while (i4--) { + const path = paths[i4]; + if (this.paths[path].isRequired) { + ret.push(path); + } + } + this._requiredpaths = ret; + return this._requiredpaths; + }; + Schema2.prototype.indexedPaths = function indexedPaths() { + if (this._indexedpaths) { + return this._indexedpaths; + } + this._indexedpaths = this.indexes(); + return this._indexedpaths; + }; + Schema2.prototype.pathType = function(path) { + if (Object.hasOwn(this.paths, path)) { + return "real"; + } + if (Object.hasOwn(this.virtuals, path)) { + return "virtual"; + } + if (Object.hasOwn(this.nested, path)) { + return "nested"; + } + const cleanPath = _pathToPositionalSyntax(path); + if (Object.hasOwn(this.subpaths, cleanPath) || Object.hasOwn(this.subpaths, path)) { + return "real"; + } + const singleNestedPath = Object.hasOwn(this.singleNestedPaths, cleanPath) || Object.hasOwn(this.singleNestedPaths, path); + if (singleNestedPath) { + return singleNestedPath === "nested" ? "nested" : "real"; + } + const mapPath = getMapPath(this, path); + if (mapPath != null) { + return "real"; + } + if (/\.\d+\.|\.\d+$/.test(path)) { + return getPositionalPathType(this, path, cleanPath); + } + return "adhocOrUndefined"; + }; + Schema2.prototype.hasMixedParent = function(path) { + const subpaths = path.split(/\./g); + path = ""; + for (let i4 = 0; i4 < subpaths.length; ++i4) { + path = i4 > 0 ? path + "." + subpaths[i4] : subpaths[i4]; + if (Object.hasOwn(this.paths, path) && this.paths[path] instanceof MongooseTypes.Mixed) { + return this.paths[path]; + } + } + return null; + }; + Schema2.prototype.setupTimestamp = function(timestamps) { + return setupTimestamps(this, timestamps); + }; + function getPositionalPathType(self2, path, cleanPath) { + const subpaths = path.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean); + if (subpaths.length < 2) { + return Object.hasOwn(self2.paths, subpaths[0]) ? self2.paths[subpaths[0]] : "adhocOrUndefined"; + } + let val = self2.path(subpaths[0]); + let isNested = false; + if (!val) { + return "adhocOrUndefined"; + } + const last = subpaths.length - 1; + for (let i4 = 1; i4 < subpaths.length; ++i4) { + isNested = false; + const subpath = subpaths[i4]; + if (i4 === last && val && !/\D/.test(subpath)) { + if (val.$isMongooseDocumentArray) { + val = val.$embeddedSchemaType; + } else if (val instanceof MongooseTypes.Array) { + val = val.caster; + } else { + val = void 0; + } + break; + } + if (!/\D/.test(subpath)) { + if (val instanceof MongooseTypes.Array && i4 !== last) { + val = val.caster; + } + continue; + } + if (!(val && val.schema)) { + val = void 0; + break; + } + const type = val.schema.pathType(subpath); + isNested = type === "nested"; + val = val.schema.path(subpath); + } + self2.subpaths[cleanPath] = val; + if (val) { + return "real"; + } + if (isNested) { + return "nested"; + } + return "adhocOrUndefined"; + } + function getPositionalPath(self2, path, cleanPath) { + getPositionalPathType(self2, path, cleanPath); + return self2.subpaths[cleanPath]; + } + Schema2.prototype.queue = function(name, args2) { + this.callQueue.push([name, args2]); + return this; + }; + Schema2.prototype.pre = function(name) { + if (name instanceof RegExp) { + const remainingArgs = Array.prototype.slice.call(arguments, 1); + for (const fn2 of hookNames) { + if (name.test(fn2)) { + this.pre.apply(this, [fn2].concat(remainingArgs)); + } + } + return this; + } + if (Array.isArray(name)) { + const remainingArgs = Array.prototype.slice.call(arguments, 1); + for (const el of name) { + this.pre.apply(this, [el].concat(remainingArgs)); + } + return this; + } + this.s.hooks.pre.apply(this.s.hooks, arguments); + return this; + }; + Schema2.prototype.post = function(name) { + if (name instanceof RegExp) { + const remainingArgs = Array.prototype.slice.call(arguments, 1); + for (const fn2 of hookNames) { + if (name.test(fn2)) { + this.post.apply(this, [fn2].concat(remainingArgs)); + } + } + return this; + } + if (Array.isArray(name)) { + const remainingArgs = Array.prototype.slice.call(arguments, 1); + for (const el of name) { + this.post.apply(this, [el].concat(remainingArgs)); + } + return this; + } + this.s.hooks.post.apply(this.s.hooks, arguments); + return this; + }; + Schema2.prototype.plugin = function(fn2, opts) { + if (typeof fn2 !== "function") { + throw new Error('First param to `schema.plugin()` must be a function, got "' + typeof fn2 + '"'); + } + if (opts && opts.deduplicate) { + for (const plugin of this.plugins) { + if (plugin.fn === fn2) { + return this; + } + } + } + this.plugins.push({ fn: fn2, opts }); + fn2(this, opts); + return this; + }; + Schema2.prototype.method = function(name, fn2, options) { + if (typeof name !== "string") { + for (const i4 in name) { + this.methods[i4] = name[i4]; + this.methodOptions[i4] = clone(options); + } + } else { + this.methods[name] = fn2; + this.methodOptions[name] = clone(options); + } + return this; + }; + Schema2.prototype.static = function(name, fn2) { + if (typeof name !== "string") { + for (const i4 in name) { + this.statics[i4] = name[i4]; + } + } else { + this.statics[name] = fn2; + } + return this; + }; + Schema2.prototype.index = function(fields, options) { + fields || (fields = {}); + options || (options = {}); + if (options.expires) { + utils.expires(options); + } + for (const key in fields) { + if (this.aliases[key]) { + fields = utils.renameObjKey(fields, key, this.aliases[key]); + } + } + for (const field of Object.keys(fields)) { + if (fields[field] === "ascending" || fields[field] === "asc") { + fields[field] = 1; + } else if (fields[field] === "descending" || fields[field] === "desc") { + fields[field] = -1; + } + } + for (const existingIndex of this.indexes()) { + if (options.name == null && existingIndex[1].name == null && isIndexSpecEqual(existingIndex[0], fields)) { + utils.warn(`Duplicate schema index on ${JSON.stringify(fields)} found. This is often due to declaring an index using both "index: true" and "schema.index()". Please remove the duplicate index definition.`); + } + } + this._indexes.push([fields, options]); + return this; + }; + Schema2.prototype.set = function(key, value, tags) { + if (arguments.length === 1) { + return this.options[key]; + } + switch (key) { + case "read": + if (typeof value === "string") { + this.options[key] = { mode: handleReadPreferenceAliases(value), tags }; + } else if (Array.isArray(value) && typeof value[0] === "string") { + this.options[key] = { + mode: handleReadPreferenceAliases(value[0]), + tags: value[1] + }; + } else { + this.options[key] = value; + } + this._userProvidedOptions[key] = this.options[key]; + break; + case "timestamps": + this.setupTimestamp(value); + this.options[key] = value; + this._userProvidedOptions[key] = this.options[key]; + break; + case "_id": + this.options[key] = value; + this._userProvidedOptions[key] = this.options[key]; + if (value && !this.paths["_id"]) { + addAutoId(this); + } else if (!value && this.paths["_id"] != null && this.paths["_id"].auto) { + this.remove("_id"); + } + break; + default: + this.options[key] = value; + this._userProvidedOptions[key] = this.options[key]; + break; + } + if (key === "strict") { + _propagateOptionsToImplicitlyCreatedSchemas(this, { strict: value }); + } + if (key === "strictQuery") { + _propagateOptionsToImplicitlyCreatedSchemas(this, { strictQuery: value }); + } + if (key === "toObject") { + value = { ...value }; + delete value.transform; + _propagateOptionsToImplicitlyCreatedSchemas(this, { toObject: value }); + } + if (key === "toJSON") { + value = { ...value }; + delete value.transform; + _propagateOptionsToImplicitlyCreatedSchemas(this, { toJSON: value }); + } + return this; + }; + function _propagateOptionsToImplicitlyCreatedSchemas(baseSchema, options) { + for (const { schema } of baseSchema.childSchemas) { + if (!schema.$implicitlyCreated) { + continue; + } + Object.assign(schema.options, options); + _propagateOptionsToImplicitlyCreatedSchemas(schema, options); + } + } + Schema2.prototype.get = function(key) { + return this.options[key]; + }; + var indexTypes = "2d 2dsphere hashed text".split(" "); + Object.defineProperty(Schema2, "indexTypes", { + get: function() { + return indexTypes; + }, + set: function() { + throw new Error("Cannot overwrite Schema.indexTypes"); + } + }); + Schema2.prototype.indexes = function() { + return getIndexes(this); + }; + Schema2.prototype.virtual = function(name, options) { + if (name instanceof VirtualType || getConstructorName(name) === "VirtualType") { + return this.virtual(name.path, name.options); + } + options = new VirtualOptions(options); + if (utils.hasUserDefinedProperty(options, ["ref", "refPath"])) { + if (options.localField == null) { + throw new Error("Reference virtuals require `localField` option"); + } + if (options.foreignField == null) { + throw new Error("Reference virtuals require `foreignField` option"); + } + const virtual = this.virtual(name); + virtual.options = options; + this.pre("init", function virtualPreInit(obj, opts) { + if (mpath.has(name, obj)) { + const _v = mpath.get(name, obj); + if (!this.$$populatedVirtuals) { + this.$$populatedVirtuals = {}; + } + if (options.justOne || options.count) { + this.$$populatedVirtuals[name] = Array.isArray(_v) ? _v[0] : _v; + } else { + this.$$populatedVirtuals[name] = Array.isArray(_v) ? _v : _v == null ? [] : [_v]; + } + if (opts?.hydratedPopulatedDocs && !options.count) { + const modelNames = virtual._getModelNamesForPopulate(this); + const populatedVal = this.$$populatedVirtuals[name]; + if (!Array.isArray(populatedVal) && !populatedVal.$__ && modelNames?.length === 1) { + const PopulateModel = this.db.model(modelNames[0]); + this.$$populatedVirtuals[name] = PopulateModel.hydrate(populatedVal); + } else if (Array.isArray(populatedVal) && modelNames?.length === 1) { + const PopulateModel = this.db.model(modelNames[0]); + for (let i4 = 0; i4 < populatedVal.length; ++i4) { + if (!populatedVal[i4].$__) { + populatedVal[i4] = PopulateModel.hydrate(populatedVal[i4], null, { hydratedPopulatedDocs: true }); + } + } + const foreignField = options.foreignField; + this.$populated( + name, + populatedVal.map((doc) => doc == null ? doc : doc.get(typeof foreignField === "function" ? foreignField.call(doc, doc) : foreignField)), + { populateModelSymbol: PopulateModel } + ); + } + } + mpath.unset(name, obj); + } + }); + virtual.set(function(v4) { + if (!this.$$populatedVirtuals) { + this.$$populatedVirtuals = {}; + } + return setPopulatedVirtualValue( + this.$$populatedVirtuals, + name, + v4, + options + ); + }); + if (typeof options.get === "function") { + virtual.get(options.get); + } + const parts2 = name.split("."); + let cur = parts2[0]; + for (let i4 = 0; i4 < parts2.length - 1; ++i4) { + if (this.paths[cur] == null) { + continue; + } + if (this.paths[cur].$isMongooseDocumentArray || this.paths[cur].$isSingleNested) { + const remnant = parts2.slice(i4 + 1).join("."); + this.paths[cur].schema.virtual(remnant, options); + break; + } else if (this.paths[cur].$isSchemaMap) { + const remnant = parts2.slice(i4 + 2).join("."); + this.paths[cur].$__schemaType.schema.virtual(remnant, options); + break; + } + cur += "." + parts2[i4 + 1]; + } + return virtual; + } + const virtuals = this.virtuals; + const parts = name.split("."); + if (this.pathType(name) === "real") { + throw new Error('Virtual path "' + name + '" conflicts with a real path in the schema'); + } + virtuals[name] = parts.reduce(function(mem, part, i4) { + mem[part] || (mem[part] = i4 === parts.length - 1 ? new VirtualType(options, name) : {}); + return mem[part]; + }, this.tree); + if (options && options.applyToArray && parts.length > 1) { + const path = this.path(parts.slice(0, -1).join(".")); + if (path && path.$isMongooseArray) { + return path.virtual(parts[parts.length - 1], options); + } else { + throw new MongooseError(`Path "${path}" is not an array`); + } + } + return virtuals[name]; + }; + Schema2.prototype.virtualpath = function(name) { + return Object.hasOwn(this.virtuals, name) ? this.virtuals[name] : null; + }; + Schema2.prototype.remove = function(path) { + if (typeof path === "string") { + path = [path]; + } + if (Array.isArray(path)) { + path.forEach(function(name) { + if (this.path(name) == null && !this.nested[name]) { + return; + } + if (this.nested[name]) { + const allKeys = Object.keys(this.paths).concat(Object.keys(this.nested)); + for (const path2 of allKeys) { + if (path2.startsWith(name + ".")) { + delete this.paths[path2]; + delete this.nested[path2]; + _deletePath(this, path2); + } + } + delete this.nested[name]; + _deletePath(this, name); + return; + } + delete this.paths[name]; + _deletePath(this, name); + this._removeEncryptedField(name); + }, this); + } + return this; + }; + function _deletePath(schema, name) { + const pieces = name.split("."); + const last = pieces.pop(); + let branch = schema.tree; + for (const piece of pieces) { + branch = branch[piece]; + } + delete branch[last]; + } + Schema2.prototype.removeVirtual = function(path) { + if (typeof path === "string") { + path = [path]; + } + if (Array.isArray(path)) { + for (const virtual of path) { + if (this.virtuals[virtual] == null) { + throw new MongooseError(`Attempting to remove virtual "${virtual}" that does not exist.`); + } + } + for (const virtual of path) { + delete this.paths[virtual]; + delete this.virtuals[virtual]; + if (virtual.indexOf(".") !== -1) { + mpath.unset(virtual, this.tree); + } else { + delete this.tree[virtual]; + } + } + } + return this; + }; + Schema2.prototype.loadClass = function(model, virtualsOnly) { + if (model === Object.prototype || model === Function.prototype || Object.hasOwn(model.prototype, "$isMongooseModelPrototype") || Object.hasOwn(model.prototype, "$isMongooseDocumentPrototype")) { + return this; + } + this.loadClass(Object.getPrototypeOf(model), virtualsOnly); + if (!virtualsOnly) { + Object.getOwnPropertyNames(model).forEach(function(name) { + if (name.match(/^(length|name|prototype|constructor|__proto__)$/)) { + return; + } + const prop = Object.getOwnPropertyDescriptor(model, name); + if (Object.hasOwn(prop, "value")) { + this.static(name, prop.value); + } + }, this); + } + Object.getOwnPropertyNames(model.prototype).forEach(function(name) { + if (name.match(/^(constructor)$/)) { + return; + } + const method = Object.getOwnPropertyDescriptor(model.prototype, name); + if (!virtualsOnly) { + if (typeof method.value === "function") { + this.method(name, method.value); + } + } + if (typeof method.get === "function") { + if (this.virtuals[name]) { + this.virtuals[name].getters = []; + } + this.virtual(name).get(method.get); + } + if (typeof method.set === "function") { + if (this.virtuals[name]) { + this.virtuals[name].setters = []; + } + this.virtual(name).set(method.set); + } + }, this); + return this; + }; + Schema2.prototype._getSchema = function(path) { + const _this = this; + const pathschema = _this.path(path); + const resultPath = []; + if (pathschema) { + pathschema.$fullPath = path; + return pathschema; + } + function search(parts2, schema) { + let p4 = parts2.length + 1; + let foundschema; + let trypath; + while (p4--) { + trypath = parts2.slice(0, p4).join("."); + foundschema = schema.path(trypath); + if (foundschema) { + resultPath.push(trypath); + if (foundschema.caster) { + if (foundschema.caster instanceof MongooseTypes.Mixed) { + foundschema.caster.$fullPath = resultPath.join("."); + return foundschema.caster; + } + if (p4 !== parts2.length) { + if (p4 + 1 === parts2.length && foundschema.$embeddedSchemaType && (parts2[p4] === "$" || isArrayFilter(parts2[p4]))) { + return foundschema.$embeddedSchemaType; + } + if (foundschema.schema) { + let ret; + if (parts2[p4] === "$" || isArrayFilter(parts2[p4])) { + if (p4 + 1 === parts2.length) { + return foundschema.$embeddedSchemaType; + } + ret = search(parts2.slice(p4 + 1), foundschema.schema); + if (ret) { + ret.$parentSchemaDocArray = ret.$parentSchemaDocArray || (foundschema.schema.$isSingleNested ? null : foundschema); + } + return ret; + } + ret = search(parts2.slice(p4), foundschema.schema); + if (ret) { + ret.$parentSchemaDocArray = ret.$parentSchemaDocArray || (foundschema.schema.$isSingleNested ? null : foundschema); + } + return ret; + } + } + } else if (foundschema.$isSchemaMap) { + if (p4 >= parts2.length) { + return foundschema; + } + if (p4 + 1 >= parts2.length) { + return foundschema.$__schemaType; + } + if (foundschema.$__schemaType instanceof MongooseTypes.Mixed) { + return foundschema.$__schemaType; + } + if (foundschema.$__schemaType.schema != null) { + const ret = search(parts2.slice(p4 + 1), foundschema.$__schemaType.schema); + return ret; + } + } + foundschema.$fullPath = resultPath.join("."); + return foundschema; + } + } + } + const parts = path.split("."); + for (let i4 = 0; i4 < parts.length; ++i4) { + if (parts[i4] === "$" || isArrayFilter(parts[i4])) { + parts[i4] = "0"; + } + if (numberRE.test(parts[i4])) { + parts[i4] = "$"; + } + } + return search(parts, _this); + }; + Schema2.prototype._getPathType = function(path) { + const _this = this; + const pathschema = _this.path(path); + if (pathschema) { + return "real"; + } + function search(parts, schema) { + let p4 = parts.length + 1, foundschema, trypath; + while (p4--) { + trypath = parts.slice(0, p4).join("."); + foundschema = schema.path(trypath); + if (foundschema) { + if (foundschema.caster) { + if (foundschema.caster instanceof MongooseTypes.Mixed) { + return { schema: foundschema, pathType: "mixed" }; + } + if (p4 !== parts.length && foundschema.schema) { + if (parts[p4] === "$" || isArrayFilter(parts[p4])) { + if (p4 === parts.length - 1) { + return { schema: foundschema, pathType: "nested" }; + } + return search(parts.slice(p4 + 1), foundschema.schema); + } + return search(parts.slice(p4), foundschema.schema); + } + return { + schema: foundschema, + pathType: foundschema.$isSingleNested ? "nested" : "array" + }; + } + return { schema: foundschema, pathType: "real" }; + } else if (p4 === parts.length && schema.nested[trypath]) { + return { schema, pathType: "nested" }; + } + } + return { schema: foundschema || schema, pathType: "undefined" }; + } + return search(path.split("."), _this); + }; + Schema2.prototype._transformDuplicateKeyError = function _transformDuplicateKeyError(error2) { + if (!this._duplicateKeyErrorMessagesByPath) { + return error2; + } + if (error2.code !== 11e3 && error2.code !== 11001) { + return error2; + } + if (error2.keyPattern != null) { + const keyPattern = error2.keyPattern; + const keys = Object.keys(keyPattern); + if (keys.length !== 1) { + return error2; + } + const firstKey = keys[0]; + if (!Object.hasOwn(this._duplicateKeyErrorMessagesByPath, firstKey)) { + return error2; + } + return new MongooseError(this._duplicateKeyErrorMessagesByPath[firstKey], { cause: error2 }); + } + return error2; + }; + function isArrayFilter(piece) { + return piece.startsWith("$[") && piece.endsWith("]"); + } + Schema2.prototype._preCompile = function _preCompile() { + this.plugin(idGetter, { deduplicate: true }); + }; + Schema2.prototype.toJSONSchema = function toJSONSchema(options) { + const useBsonType = options?.useBsonType ?? false; + const result = useBsonType ? { required: [], properties: {} } : { type: "object", required: [], properties: {} }; + for (const path of Object.keys(this.paths)) { + const schemaType = this.paths[path]; + if (schemaType._presplitPath.indexOf("$*") !== -1) { + continue; + } + const isNested = schemaType._presplitPath.length > 1; + let jsonSchemaForPath = result; + if (isNested) { + for (let i4 = 0; i4 < schemaType._presplitPath.length - 1; ++i4) { + const subpath = schemaType._presplitPath[i4]; + if (jsonSchemaForPath.properties[subpath] == null) { + jsonSchemaForPath.properties[subpath] = useBsonType ? { + bsonType: ["object", "null"], + properties: {} + } : { + type: ["object", "null"], + properties: {} + }; + } + jsonSchemaForPath = jsonSchemaForPath.properties[subpath]; + } + } + const lastSubpath = schemaType._presplitPath[schemaType._presplitPath.length - 1]; + let isRequired = false; + if (path === "_id") { + if (!jsonSchemaForPath.required) { + jsonSchemaForPath.required = []; + } + jsonSchemaForPath.required.push("_id"); + isRequired = true; + } else if (schemaType.options.required && typeof schemaType.options.required !== "function") { + if (!jsonSchemaForPath.required) { + jsonSchemaForPath.required = []; + } + jsonSchemaForPath.required.push(lastSubpath); + isRequired = true; + } + jsonSchemaForPath.properties[lastSubpath] = schemaType.toJSONSchema(options); + if (schemaType.options.enum) { + jsonSchemaForPath.properties[lastSubpath].enum = isRequired ? schemaType.options.enum : [...schemaType.options.enum, null]; + } + } + if (result.required.length === 0) { + delete result.required; + } + return result; + }; + module2.exports = exports2 = Schema2; + Schema2.Types = MongooseTypes = require_schema(); + exports2.ObjectId = MongooseTypes.ObjectId; + } +}); + +// node_modules/mongoose/lib/error/bulkWriteError.js +var require_bulkWriteError = __commonJS({ + "node_modules/mongoose/lib/error/bulkWriteError.js"(exports2, module2) { + "use strict"; + var MongooseError = require_error2(); + var MongooseBulkWriteError = class extends MongooseError { + constructor(validationErrors, results, rawResult, operation2) { + let preview = validationErrors.map((e4) => e4.message).join(", "); + if (preview.length > 200) { + preview = preview.slice(0, 200) + "..."; + } + super(`${operation2} failed with ${validationErrors.length} Mongoose validation errors: ${preview}`); + this.validationErrors = validationErrors; + this.results = results; + this.rawResult = rawResult; + this.operation = operation2; + } + }; + Object.defineProperty(MongooseBulkWriteError.prototype, "name", { + value: "MongooseBulkWriteError" + }); + module2.exports = MongooseBulkWriteError; + } +}); + +// node_modules/mongoose/lib/error/syncIndexes.js +var require_syncIndexes = __commonJS({ + "node_modules/mongoose/lib/error/syncIndexes.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var SyncIndexesError = class extends MongooseError { + constructor(message2, errorsMap) { + super(message2); + this.errors = errorsMap; + } + }; + Object.defineProperty(SyncIndexesError.prototype, "name", { + value: "SyncIndexesError" + }); + module2.exports = SyncIndexesError; + } +}); + +// node_modules/mongoose/lib/helpers/schema/applyPlugins.js +var require_applyPlugins = __commonJS({ + "node_modules/mongoose/lib/helpers/schema/applyPlugins.js"(exports2, module2) { + "use strict"; + module2.exports = function applyPlugins(schema, plugins, options, cacheKey) { + if (schema[cacheKey]) { + return; + } + schema[cacheKey] = true; + if (!options || !options.skipTopLevel) { + let pluginTags = null; + for (const plugin of plugins) { + const tags = plugin[1] == null ? null : plugin[1].tags; + if (!Array.isArray(tags)) { + schema.plugin(plugin[0], plugin[1]); + continue; + } + pluginTags = pluginTags || new Set(schema.options.pluginTags || []); + if (!tags.find((tag2) => pluginTags.has(tag2))) { + continue; + } + schema.plugin(plugin[0], plugin[1]); + } + } + options = Object.assign({}, options); + delete options.skipTopLevel; + if (options.applyPluginsToChildSchemas !== false) { + for (const path of Object.keys(schema.paths)) { + const type = schema.paths[path]; + if (type.schema != null) { + applyPlugins(type.schema, plugins, options, cacheKey); + type.caster.prototype.$__setSchema(type.schema); + } + } + } + const discriminators = schema.discriminators; + if (discriminators == null) { + return; + } + const applyPluginsToDiscriminators = options.applyPluginsToDiscriminators; + const keys = Object.keys(discriminators); + for (const discriminatorKey of keys) { + const discriminatorSchema = discriminators[discriminatorKey]; + applyPlugins( + discriminatorSchema, + plugins, + { skipTopLevel: !applyPluginsToDiscriminators }, + cacheKey + ); + } + }; + } +}); + +// node_modules/mongoose/lib/driver.js +var require_driver = __commonJS({ + "node_modules/mongoose/lib/driver.js"(exports2, module2) { + "use strict"; + var driver = null; + module2.exports.get = function() { + return driver; + }; + module2.exports.set = function(v4) { + driver = v4; + }; + } +}); + +// node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js +var require_getDefaultBulkwriteResult = __commonJS({ + "node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js"(exports2, module2) { + "use strict"; + function getDefaultBulkwriteResult() { + return { + ok: 1, + nInserted: 0, + nUpserted: 0, + nMatched: 0, + nModified: 0, + nRemoved: 0, + upserted: [], + writeErrors: [], + insertedIds: [], + writeConcernErrors: [] + }; + } + module2.exports = getDefaultBulkwriteResult; + } +}); + +// node_modules/mongoose/lib/error/createCollectionsError.js +var require_createCollectionsError = __commonJS({ + "node_modules/mongoose/lib/error/createCollectionsError.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var CreateCollectionsError = class extends MongooseError { + constructor(message2, errorsMap) { + super(message2); + this.errors = errorsMap; + } + }; + Object.defineProperty(CreateCollectionsError.prototype, "name", { + value: "CreateCollectionsError" + }); + module2.exports = CreateCollectionsError; + } +}); + +// node_modules/mongoose/lib/helpers/update/modifiedPaths.js +var require_modifiedPaths = __commonJS({ + "node_modules/mongoose/lib/helpers/update/modifiedPaths.js"(exports2, module2) { + "use strict"; + var _modifiedPaths = require_common4().modifiedPaths; + module2.exports = function modifiedPaths(update) { + const keys = Object.keys(update); + const res = {}; + const withoutDollarKeys = {}; + for (const key of keys) { + if (key.startsWith("$")) { + _modifiedPaths(update[key], "", res); + continue; + } + withoutDollarKeys[key] = update[key]; + } + _modifiedPaths(withoutDollarKeys, "", res); + return res; + }; + } +}); + +// node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js +var require_updatedPathsByArrayFilter = __commonJS({ + "node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js"(exports2, module2) { + "use strict"; + var modifiedPaths = require_modifiedPaths(); + module2.exports = function updatedPathsByArrayFilter(update) { + if (update == null) { + return {}; + } + const updatedPaths = modifiedPaths(update); + return Object.keys(updatedPaths).reduce((cur, path) => { + const matches = path.match(/\$\[[^\]]+\]/g); + if (matches == null) { + return cur; + } + for (const match of matches) { + const firstMatch = path.indexOf(match); + if (firstMatch !== path.lastIndexOf(match)) { + throw new Error(`Path '${path}' contains the same array filter multiple times`); + } + cur[match.substring(2, match.length - 1)] = path.substring(0, firstMatch - 1).replace(/\$\[[^\]]+\]/g, "0"); + } + return cur; + }, {}); + }; + } +}); + +// node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js +var require_getEmbeddedDiscriminatorPath2 = __commonJS({ + "node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js"(exports2, module2) { + "use strict"; + var cleanPositionalOperators = require_cleanPositionalOperators(); + var get2 = require_get(); + var getDiscriminatorByValue = require_getDiscriminatorByValue(); + var updatedPathsByArrayFilter = require_updatedPathsByArrayFilter(); + module2.exports = function getEmbeddedDiscriminatorPath(schema, update, filter, path, options) { + const parts = path.indexOf(".") === -1 ? [path] : path.split("."); + let schematype = null; + let type = "adhocOrUndefined"; + filter = filter || {}; + update = update || {}; + const arrayFilters = options != null && Array.isArray(options.arrayFilters) ? options.arrayFilters : []; + const updatedPathsByFilter = updatedPathsByArrayFilter(update); + let startIndex = 0; + for (let i4 = 0; i4 < parts.length; ++i4) { + const originalSubpath = parts.slice(startIndex, i4 + 1).join("."); + const subpath = cleanPositionalOperators(originalSubpath); + schematype = schema.path(subpath); + if (schematype == null) { + continue; + } + type = schema.pathType(subpath); + if ((schematype.$isSingleNested || schematype.$isMongooseDocumentArrayElement) && schematype.schema.discriminators != null) { + const key = get2(schematype, "schema.options.discriminatorKey"); + const discriminatorValuePath = subpath + "." + key; + const discriminatorFilterPath = discriminatorValuePath.replace(/\.\d+\./, "."); + let discriminatorKey = null; + if (discriminatorValuePath in filter) { + discriminatorKey = filter[discriminatorValuePath]; + } + if (discriminatorFilterPath in filter) { + discriminatorKey = filter[discriminatorFilterPath]; + } + const wrapperPath = subpath.replace(/\.\d+$/, ""); + if (schematype.$isMongooseDocumentArrayElement && get2(filter[wrapperPath], "$elemMatch." + key) != null) { + discriminatorKey = filter[wrapperPath].$elemMatch[key]; + } + const discriminatorKeyUpdatePath = originalSubpath + "." + key; + if (discriminatorKeyUpdatePath in update) { + discriminatorKey = update[discriminatorKeyUpdatePath]; + } + if (discriminatorValuePath in update) { + discriminatorKey = update[discriminatorValuePath]; + } + for (const filterKey of Object.keys(updatedPathsByFilter)) { + const schemaKey = updatedPathsByFilter[filterKey] + "." + key; + const arrayFilterKey = filterKey + "." + key; + if (schemaKey === discriminatorFilterPath) { + const filter2 = arrayFilters.find((filter3) => Object.hasOwn(filter3, arrayFilterKey)); + if (filter2 != null) { + discriminatorKey = filter2[arrayFilterKey]; + } + } + } + if (discriminatorKey == null) { + continue; + } + const discriminator = getDiscriminatorByValue(schematype.caster.discriminators, discriminatorKey); + const discriminatorSchema = discriminator && discriminator.schema; + if (discriminatorSchema == null) { + continue; + } + const rest = parts.slice(i4 + 1).join("."); + schematype = discriminatorSchema.path(rest); + schema = discriminatorSchema; + startIndex = i4 + 1; + if (schematype != null) { + type = discriminatorSchema._getPathType(rest); + break; + } + } + } + return { type, schematype }; + }; + } +}); + +// node_modules/mongoose/lib/helpers/query/handleImmutable.js +var require_handleImmutable2 = __commonJS({ + "node_modules/mongoose/lib/helpers/query/handleImmutable.js"(exports2, module2) { + "use strict"; + var StrictModeError = require_strict(); + module2.exports = function handleImmutable(schematype, strict, obj, key, fullPath, options, ctx) { + if (schematype == null || !schematype.options || !schematype.options.immutable) { + return false; + } + let immutable = schematype.options.immutable; + if (typeof immutable === "function") { + immutable = immutable.call(ctx, ctx); + } + if (!immutable) { + return false; + } + if (options && options.overwriteImmutable) { + return false; + } + if (strict === false) { + return false; + } + if (strict === "throw") { + throw new StrictModeError( + null, + `Field ${fullPath} is immutable and strict = 'throw'` + ); + } + delete obj[key]; + return true; + }; + } +}); + +// node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js +var require_moveImmutableProperties = __commonJS({ + "node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js"(exports2, module2) { + "use strict"; + var get2 = require_get(); + module2.exports = function moveImmutableProperties(schema, update, ctx) { + if (update == null) { + return; + } + const keys = Object.keys(update); + for (const key of keys) { + const isDollarKey = key.startsWith("$"); + if (key === "$set") { + const updatedPaths = Object.keys(update[key]); + for (const path of updatedPaths) { + _walkUpdatePath(schema, update[key], path, update, ctx); + } + } else if (!isDollarKey) { + _walkUpdatePath(schema, update, key, update, ctx); + } + } + }; + function _walkUpdatePath(schema, op2, path, update, ctx) { + const schematype = schema.path(path); + if (schematype == null) { + return; + } + let immutable = get2(schematype, "options.immutable", null); + if (immutable == null) { + return; + } + if (typeof immutable === "function") { + immutable = immutable.call(ctx, ctx); + } + if (!immutable) { + return; + } + update.$setOnInsert = update.$setOnInsert || {}; + update.$setOnInsert[path] = op2[path]; + delete op2[path]; + } + } +}); + +// node_modules/mongoose/lib/helpers/path/setDottedPath.js +var require_setDottedPath = __commonJS({ + "node_modules/mongoose/lib/helpers/path/setDottedPath.js"(exports2, module2) { + "use strict"; + var specialProperties = require_specialProperties(); + module2.exports = function setDottedPath(obj, path, val) { + if (path.indexOf(".") === -1) { + if (specialProperties.has(path)) { + return; + } + obj[path] = val; + return; + } + const parts = path.split("."); + const last = parts.pop(); + let cur = obj; + for (const part of parts) { + if (specialProperties.has(part)) { + continue; + } + if (cur[part] == null) { + cur[part] = {}; + } + cur = cur[part]; + } + if (!specialProperties.has(last)) { + cur[last] = val; + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/query/castUpdate.js +var require_castUpdate = __commonJS({ + "node_modules/mongoose/lib/helpers/query/castUpdate.js"(exports2, module2) { + "use strict"; + var CastError = require_cast(); + var MongooseError = require_mongooseError(); + var SchemaString = require_string2(); + var StrictModeError = require_strict(); + var ValidationError = require_validation(); + var castNumber = require_number(); + var cast = require_cast2(); + var getConstructorName = require_getConstructorName(); + var getDiscriminatorByValue = require_getDiscriminatorByValue(); + var getEmbeddedDiscriminatorPath = require_getEmbeddedDiscriminatorPath2(); + var handleImmutable = require_handleImmutable2(); + var moveImmutableProperties = require_moveImmutableProperties(); + var schemaMixedSymbol = require_symbols2().schemaMixedSymbol; + var setDottedPath = require_setDottedPath(); + var utils = require_utils6(); + var { internalToObjectOptions } = require_options(); + var mongodbUpdateOperators = /* @__PURE__ */ new Set([ + "$currentDate", + "$inc", + "$min", + "$max", + "$mul", + "$rename", + "$set", + "$setOnInsert", + "$unset", + "$addToSet", + "$pop", + "$pull", + "$push", + "$pullAll", + "$bit" + ]); + module2.exports = function castUpdate(schema, obj, options, context, filter) { + if (obj == null) { + return void 0; + } + options = options || {}; + if (Array.isArray(obj)) { + const len = obj.length; + for (let i5 = 0; i5 < len; ++i5) { + const ops2 = Object.keys(obj[i5]); + for (const op2 of ops2) { + obj[i5][op2] = castPipelineOperator(op2, obj[i5][op2]); + } + } + return obj; + } + if (schema != null && filter != null && utils.hasUserDefinedProperty(filter, schema.options.discriminatorKey) && typeof filter[schema.options.discriminatorKey] !== "object" && schema.discriminators != null) { + const discriminatorValue = filter[schema.options.discriminatorKey]; + const byValue = getDiscriminatorByValue(context.model.discriminators, discriminatorValue); + schema = schema.discriminators[discriminatorValue] || byValue && byValue.schema || schema; + } else if (schema != null && options.overwriteDiscriminatorKey && utils.hasUserDefinedProperty(obj, schema.options.discriminatorKey) && schema.discriminators != null) { + const discriminatorValue = obj[schema.options.discriminatorKey]; + const byValue = getDiscriminatorByValue(context.model.discriminators, discriminatorValue); + schema = schema.discriminators[discriminatorValue] || byValue && byValue.schema || schema; + } else if (schema != null && options.overwriteDiscriminatorKey && obj.$set != null && utils.hasUserDefinedProperty(obj.$set, schema.options.discriminatorKey) && schema.discriminators != null) { + const discriminatorValue = obj.$set[schema.options.discriminatorKey]; + const byValue = getDiscriminatorByValue(context.model.discriminators, discriminatorValue); + schema = schema.discriminators[discriminatorValue] || byValue && byValue.schema || schema; + } + if (options.upsert) { + moveImmutableProperties(schema, obj, context); + } + const ops = Object.keys(obj); + let i4 = ops.length; + const ret = {}; + let val; + let hasDollarKey = false; + filter = filter || {}; + while (i4--) { + const op2 = ops[i4]; + if (!mongodbUpdateOperators.has(op2)) { + if (!ret.$set) { + if (obj.$set) { + ret.$set = obj.$set; + } else { + ret.$set = {}; + } + } + ret.$set[op2] = obj[op2]; + ops.splice(i4, 1); + if (!~ops.indexOf("$set")) ops.push("$set"); + } else if (op2 === "$set") { + if (!ret.$set) { + ret[op2] = obj[op2]; + } + } else { + ret[op2] = obj[op2]; + } + } + i4 = ops.length; + while (i4--) { + const op2 = ops[i4]; + val = ret[op2]; + hasDollarKey = hasDollarKey || op2.startsWith("$"); + if (val != null && val.$__) { + val = val.toObject(internalToObjectOptions); + ret[op2] = val; + } + if (val && typeof val === "object" && !Buffer.isBuffer(val) && mongodbUpdateOperators.has(op2)) { + walkUpdatePath(schema, val, op2, options, context, filter); + } else { + const msg = "Invalid atomic update value for " + op2 + ". Expected an object, received " + typeof val; + throw new Error(msg); + } + if (op2.startsWith("$") && utils.isEmptyObject(val)) { + delete ret[op2]; + } + } + if (Object.keys(ret).length === 0 && options.upsert && Object.keys(filter).length > 0) { + return { $setOnInsert: { ...filter } }; + } + return ret; + }; + function castPipelineOperator(op2, val) { + if (op2 === "$unset") { + if (typeof val !== "string" && (!Array.isArray(val) || val.find((v4) => typeof v4 !== "string"))) { + throw new MongooseError("Invalid $unset in pipeline, must be a string or an array of strings"); + } + return val; + } + if (op2 === "$project") { + if (val == null || typeof val !== "object") { + throw new MongooseError("Invalid $project in pipeline, must be an object"); + } + return val; + } + if (op2 === "$addFields" || op2 === "$set") { + if (val == null || typeof val !== "object") { + throw new MongooseError("Invalid " + op2 + " in pipeline, must be an object"); + } + return val; + } else if (op2 === "$replaceRoot" || op2 === "$replaceWith") { + if (val == null || typeof val !== "object") { + throw new MongooseError("Invalid " + op2 + " in pipeline, must be an object"); + } + return val; + } + throw new MongooseError('Invalid update pipeline operator: "' + op2 + '"'); + } + function walkUpdatePath(schema, obj, op2, options, context, filter, prefix) { + const strict = options.strict; + prefix = prefix ? prefix + "." : ""; + const keys = Object.keys(obj); + let i4 = keys.length; + let hasKeys = false; + let schematype; + let key; + let val; + let aggregatedError = null; + const strictMode = strict != null ? strict : schema.options.strict; + while (i4--) { + key = keys[i4]; + val = obj[key]; + if (op2 === "$pull") { + schematype = schema._getSchema(prefix + key); + if (schematype == null) { + const _res = getEmbeddedDiscriminatorPath(schema, obj, filter, prefix + key, options); + if (_res.schematype != null) { + schematype = _res.schematype; + } + } + if (schematype != null && schematype.schema != null) { + obj[key] = cast(schematype.schema, obj[key], options, context); + hasKeys = true; + continue; + } + } + const discriminatorKey = prefix ? prefix + key : key; + if (schema.discriminatorMapping != null && discriminatorKey === schema.options.discriminatorKey && schema.discriminatorMapping.value !== obj[key] && !options.overwriteDiscriminatorKey) { + if (strictMode === "throw") { + const err = new Error(`Can't modify discriminator key "` + discriminatorKey + '" on discriminator model'); + aggregatedError = _appendError(err, context, discriminatorKey, aggregatedError); + continue; + } else if (strictMode) { + delete obj[key]; + continue; + } + } + if (getConstructorName(val) === "Object") { + schematype = schema._getSchema(prefix + key); + if (schematype == null) { + const _res = getEmbeddedDiscriminatorPath(schema, obj, filter, prefix + key, options); + if (_res.schematype != null) { + schematype = _res.schematype; + } + } + if (op2 !== "$setOnInsert" && handleImmutable(schematype, strict, obj, key, prefix + key, options, context)) { + continue; + } + if (schematype && schematype.caster && op2 in castOps) { + if ("$each" in val) { + hasKeys = true; + try { + obj[key] = { + $each: castUpdateVal(schematype, val.$each, op2, key, context, prefix + key) + }; + } catch (error2) { + aggregatedError = _appendError(error2, context, key, aggregatedError); + } + if (val.$slice != null) { + obj[key].$slice = val.$slice | 0; + } + if (val.$sort) { + obj[key].$sort = val.$sort; + } + if (val.$position != null) { + obj[key].$position = castNumber(val.$position); + } + } else { + if (schematype != null && schematype.$isSingleNested) { + const _strict = strict == null ? schematype.schema.options.strict : strict; + try { + obj[key] = schematype.castForQuery(null, val, context, { strict: _strict }); + } catch (error2) { + aggregatedError = _appendError(error2, context, key, aggregatedError); + } + } else { + try { + obj[key] = castUpdateVal(schematype, val, op2, key, context, prefix + key); + } catch (error2) { + aggregatedError = _appendError(error2, context, key, aggregatedError); + } + } + if (obj[key] === void 0) { + delete obj[key]; + continue; + } + hasKeys = true; + } + } else if (op2 === "$currentDate" || op2 in castOps && schematype) { + try { + obj[key] = castUpdateVal(schematype, val, op2, key, context, prefix + key); + } catch (error2) { + aggregatedError = _appendError(error2, context, key, aggregatedError); + } + if (obj[key] === void 0) { + delete obj[key]; + continue; + } + hasKeys = true; + } else if (op2 === "$rename") { + const schematype2 = new SchemaString(`${prefix}${key}.$rename`); + try { + obj[key] = castUpdateVal(schematype2, val, op2, key, context, prefix + key); + } catch (error2) { + aggregatedError = _appendError(error2, context, key, aggregatedError); + } + if (obj[key] === void 0) { + delete obj[key]; + continue; + } + hasKeys = true; + } else { + const pathToCheck = prefix + key; + const v4 = schema._getPathType(pathToCheck); + let _strict = strict; + if (v4 && v4.schema && _strict == null) { + _strict = v4.schema.options.strict; + } + if (v4.pathType === "undefined") { + if (_strict === "throw") { + throw new StrictModeError(pathToCheck); + } else if (_strict) { + delete obj[key]; + continue; + } + } + hasKeys |= walkUpdatePath(schema, val, op2, options, context, filter, prefix + key) || utils.isObject(val) && Object.keys(val).length === 0; + } + } else { + const isModifier = key === "$each" || key === "$or" || key === "$and" || key === "$in"; + if (isModifier && !prefix) { + throw new MongooseError('Invalid update: Unexpected modifier "' + key + '" as a key in operator. Did you mean something like { $addToSet: { fieldName: { $each: [...] } } }? Modifiers such as "$each", "$or", "$and", "$in" must appear under a valid field path.'); + } + const checkPath = isModifier ? prefix : prefix + key; + schematype = schema._getSchema(checkPath); + if (op2 !== "$setOnInsert" && handleImmutable(schematype, strict, obj, key, prefix + key, options, context)) { + continue; + } + let pathDetails = schema._getPathType(checkPath); + if (schematype == null) { + const _res = getEmbeddedDiscriminatorPath(schema, obj, filter, checkPath, options); + if (_res.schematype != null) { + schematype = _res.schematype; + pathDetails = _res.type; + } + } + let isStrict = strict; + if (pathDetails && pathDetails.schema && strict == null) { + isStrict = pathDetails.schema.options.strict; + } + const skip = isStrict && !schematype && !/real|nested/.test(pathDetails.pathType); + if (skip) { + if (isStrict === "throw" && schema.virtuals[checkPath] == null) { + throw new StrictModeError(prefix + key); + } else { + delete obj[key]; + } + } else { + if (op2 === "$rename") { + if (obj[key] == null) { + throw new CastError("String", obj[key], `${prefix}${key}.$rename`); + } + const schematype2 = new SchemaString(`${prefix}${key}.$rename`, null, null, schema); + obj[key] = schematype2.castForQuery(null, obj[key], context); + continue; + } + try { + if (prefix.length === 0 || key.indexOf(".") === -1) { + obj[key] = castUpdateVal(schematype, val, op2, key, context, prefix + key); + } else if (isStrict !== false || schematype != null) { + setDottedPath(obj, key, castUpdateVal(schematype, val, op2, key, context, prefix + key)); + delete obj[key]; + } + } catch (error2) { + aggregatedError = _appendError(error2, context, key, aggregatedError); + } + if (Array.isArray(obj[key]) && (op2 === "$addToSet" || op2 === "$push") && key !== "$each") { + if (schematype && schematype.caster && !schematype.caster.$isMongooseArray && !schematype.caster[schemaMixedSymbol]) { + obj[key] = { $each: obj[key] }; + } + } + if (obj[key] === void 0) { + delete obj[key]; + continue; + } + hasKeys = true; + } + } + } + if (aggregatedError != null) { + throw aggregatedError; + } + return hasKeys; + } + function _appendError(error2, query, key, aggregatedError) { + if (typeof query !== "object" || !query.options.multipleCastError) { + throw error2; + } + aggregatedError = aggregatedError || new ValidationError(); + aggregatedError.addError(key, error2); + return aggregatedError; + } + var numberOps = { + $pop: 1, + $inc: 1 + }; + var noCastOps = { + $unset: 1 + }; + var castOps = { + $push: 1, + $addToSet: 1, + $set: 1, + $setOnInsert: 1 + }; + var overwriteOps = { + $set: 1, + $setOnInsert: 1 + }; + function castUpdateVal(schema, val, op2, $conditional, context, path) { + if (!schema) { + if (op2 in numberOps) { + try { + return castNumber(val); + } catch (err) { + throw new CastError("number", val, path); + } + } + return val; + } + const cond = schema.caster && op2 in castOps && (utils.isObject(val) || Array.isArray(val)); + if (cond && !overwriteOps[op2]) { + let schemaArrayDepth = 0; + let cur = schema; + while (cur.$isMongooseArray) { + ++schemaArrayDepth; + cur = cur.caster; + } + let arrayDepth = 0; + let _val = val; + while (Array.isArray(_val)) { + ++arrayDepth; + _val = _val[0]; + } + const additionalNesting = schemaArrayDepth - arrayDepth; + while (arrayDepth < schemaArrayDepth) { + val = [val]; + ++arrayDepth; + } + let tmp = schema.applySetters(Array.isArray(val) ? val : [val], context); + for (let i4 = 0; i4 < additionalNesting; ++i4) { + tmp = tmp[0]; + } + return tmp; + } + if (op2 in noCastOps) { + return val; + } + if (op2 in numberOps) { + if (val == null) { + throw new CastError("number", val, schema.path); + } + if (op2 === "$inc") { + return schema.castForQuery( + null, + val, + context + ); + } + try { + return castNumber(val); + } catch (error2) { + throw new CastError("number", val, schema.path); + } + } + if (op2 === "$currentDate") { + if (typeof val === "object") { + return { $type: val.$type }; + } + return Boolean(val); + } + if (mongodbUpdateOperators.has($conditional)) { + return schema.castForQuery( + $conditional, + val, + context + ); + } + if (overwriteOps[op2]) { + const skipQueryCastForUpdate = val != null && schema.$isMongooseArray && schema.$fullPath != null && !schema.$fullPath.match(/\d+$/); + const applySetters = schema[schemaMixedSymbol] != null; + if (skipQueryCastForUpdate || applySetters) { + return schema.applySetters(val, context); + } + return schema.castForQuery( + null, + val, + context + ); + } + return schema.castForQuery(null, val, context); + } + } +}); + +// node_modules/mongoose/lib/helpers/update/decorateUpdateWithVersionKey.js +var require_decorateUpdateWithVersionKey = __commonJS({ + "node_modules/mongoose/lib/helpers/update/decorateUpdateWithVersionKey.js"(exports2, module2) { + "use strict"; + module2.exports = function decorateUpdateWithVersionKey(update, options, versionKey) { + if (!versionKey || !(options && options.upsert || false)) { + return; + } + if (options.overwrite) { + if (!hasKey(update, versionKey)) { + update[versionKey] = 0; + } + } else if (!hasKey(update, versionKey) && !hasKey(update?.$set, versionKey) && !hasKey(update?.$inc, versionKey) && !hasKey(update?.$setOnInsert, versionKey)) { + if (!update.$setOnInsert) { + update.$setOnInsert = {}; + } + update.$setOnInsert[versionKey] = 0; + } + }; + function hasKey(obj, key) { + if (obj == null || typeof obj !== "object") { + return false; + } + return Object.hasOwn(obj, key); + } + } +}); + +// node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js +var require_setDefaultsOnInsert = __commonJS({ + "node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js"(exports2, module2) { + "use strict"; + var get2 = require_get(); + module2.exports = function(filter, schema, castedDoc, options) { + options = options || {}; + const shouldSetDefaultsOnInsert = options.setDefaultsOnInsert != null ? options.setDefaultsOnInsert : schema.base.options.setDefaultsOnInsert; + if (!options.upsert || shouldSetDefaultsOnInsert === false) { + return castedDoc; + } + const keys = Object.keys(castedDoc || {}); + const updatedKeys = {}; + const updatedValues = {}; + const numKeys = keys.length; + let hasDollarUpdate = false; + for (let i4 = 0; i4 < numKeys; ++i4) { + if (keys[i4].charAt(0) === "$") { + hasDollarUpdate = true; + break; + } + } + const paths = Object.keys(filter); + const numPaths = paths.length; + for (let i4 = 0; i4 < numPaths; ++i4) { + const path = paths[i4]; + const condition = filter[path]; + if (condition && typeof condition === "object") { + const conditionKeys = Object.keys(condition); + const numConditionKeys = conditionKeys.length; + let hasDollarKey = false; + for (let j4 = 0; j4 < numConditionKeys; ++j4) { + if (conditionKeys[j4].charAt(0) === "$") { + hasDollarKey = true; + break; + } + } + if (hasDollarKey) { + continue; + } + } + updatedKeys[path] = true; + } + if (options && options.overwrite && !hasDollarUpdate) { + return castedDoc; + } + schema.eachPath(function(path, schemaType) { + if (schemaType.path === "_id" && schemaType.options.auto) { + return; + } + const def = schemaType.getDefault(null, true); + if (typeof def === "undefined") { + return; + } + const pathPieces = schemaType.splitPath(); + if (pathPieces.includes("$*")) { + return; + } + if (isModified(castedDoc, updatedKeys, path, pathPieces, hasDollarUpdate)) { + return; + } + castedDoc = castedDoc || {}; + castedDoc.$setOnInsert = castedDoc.$setOnInsert || {}; + if (get2(castedDoc, path) == null) { + castedDoc.$setOnInsert[path] = def; + } + updatedValues[path] = def; + }); + return castedDoc; + }; + function isModified(castedDoc, updatedKeys, path, pathPieces, hasDollarUpdate) { + if (updatedKeys[path]) { + return true; + } + let cur = pathPieces[0]; + for (let i4 = 1; i4 < pathPieces.length; ++i4) { + if (updatedKeys[cur]) { + return true; + } + cur += "." + pathPieces[i4]; + } + if (hasDollarUpdate) { + for (const key in castedDoc) { + if (key.charAt(0) === "$") { + if (pathExistsInUpdate(castedDoc[key], path, pathPieces)) { + return true; + } + } + } + } else { + if (pathExistsInUpdate(castedDoc, path, pathPieces)) { + return true; + } + } + return false; + } + function pathExistsInUpdate(update, targetPath, pathPieces) { + if (update == null || typeof update !== "object") { + return false; + } + if (Object.hasOwn(update, targetPath)) { + return true; + } + let cur = pathPieces[0]; + for (let i4 = 1; i4 < pathPieces.length; ++i4) { + if (Object.hasOwn(update, cur)) { + return true; + } + cur += "." + pathPieces[i4]; + } + const prefix = targetPath + "."; + for (const key in update) { + if (key.startsWith(prefix)) { + return true; + } + } + return false; + } + } +}); + +// node_modules/mongoose/lib/helpers/model/castBulkWrite.js +var require_castBulkWrite = __commonJS({ + "node_modules/mongoose/lib/helpers/model/castBulkWrite.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var getDiscriminatorByValue = require_getDiscriminatorByValue(); + var applyTimestampsToChildren = require_applyTimestampsToChildren(); + var applyTimestampsToUpdate = require_applyTimestampsToUpdate(); + var cast = require_cast2(); + var castUpdate = require_castUpdate(); + var clone = require_clone(); + var decorateUpdateWithVersionKey = require_decorateUpdateWithVersionKey(); + var { inspect } = require("util"); + var setDefaultsOnInsert = require_setDefaultsOnInsert(); + module2.exports = function castBulkWrite(originalModel, op2, options) { + const now = originalModel.base.now(); + if (op2["insertOne"]) { + return (callback) => module2.exports.castInsertOne(originalModel, op2["insertOne"], options).then(() => callback(null), (err) => callback(err)); + } else if (op2["updateOne"]) { + return (callback) => { + try { + module2.exports.castUpdateOne(originalModel, op2["updateOne"], options, now); + callback(null); + } catch (err) { + callback(err); + } + }; + } else if (op2["updateMany"]) { + return (callback) => { + try { + module2.exports.castUpdateMany(originalModel, op2["updateMany"], options, now); + callback(null); + } catch (err) { + callback(err); + } + }; + } else if (op2["replaceOne"]) { + return (callback) => { + module2.exports.castReplaceOne(originalModel, op2["replaceOne"], options).then(() => callback(null), (err) => callback(err)); + }; + } else if (op2["deleteOne"]) { + return (callback) => { + try { + module2.exports.castDeleteOne(originalModel, op2["deleteOne"]); + callback(null); + } catch (err) { + callback(err); + } + }; + } else if (op2["deleteMany"]) { + return (callback) => { + try { + module2.exports.castDeleteMany(originalModel, op2["deleteMany"]); + callback(null); + } catch (err) { + callback(err); + } + }; + } else { + return (callback) => { + const error2 = new MongooseError(`Invalid op passed to \`bulkWrite()\`: ${inspect(op2)}`); + callback(error2, null); + }; + } + }; + module2.exports.castInsertOne = async function castInsertOne(originalModel, insertOne, options) { + const model = decideModelByObject(originalModel, insertOne["document"]); + const doc = new model(insertOne["document"]); + if (model.schema.options.timestamps && getTimestampsOpt(insertOne, options)) { + doc.initializeTimestamps(); + } + if (options.session != null) { + doc.$session(options.session); + } + const versionKey = model?.schema?.options?.versionKey; + if (versionKey && doc[versionKey] == null) { + doc[versionKey] = 0; + } + insertOne["document"] = doc; + if (options.skipValidation || insertOne.skipValidation) { + return insertOne; + } + await insertOne["document"].$validate(); + return insertOne; + }; + module2.exports.castUpdateOne = function castUpdateOne(originalModel, updateOne, options, now) { + if (!updateOne["filter"]) { + throw new Error("Must provide a filter object."); + } + if (!updateOne["update"]) { + throw new Error("Must provide an update object."); + } + const model = decideModelByObject(originalModel, updateOne["filter"]); + const schema = model.schema; + const strict = options.strict != null ? options.strict : model.schema.options.strict; + const update = clone(updateOne["update"]); + _addDiscriminatorToObject(schema, updateOne["filter"]); + const doInitTimestamps = getTimestampsOpt(updateOne, options); + if (model.schema.$timestamps != null && doInitTimestamps) { + const createdAt = model.schema.$timestamps.createdAt; + const updatedAt = model.schema.$timestamps.updatedAt; + applyTimestampsToUpdate(now, createdAt, updatedAt, update, { + timestamps: updateOne.timestamps, + overwriteImmutable: updateOne.overwriteImmutable + }); + } + if (doInitTimestamps) { + applyTimestampsToChildren(now, update, model.schema); + } + const globalSetDefaultsOnInsert = originalModel.base.options.setDefaultsOnInsert; + const shouldSetDefaultsOnInsert = updateOne.setDefaultsOnInsert == null ? globalSetDefaultsOnInsert : updateOne.setDefaultsOnInsert; + if (shouldSetDefaultsOnInsert !== false) { + setDefaultsOnInsert(updateOne["filter"], model.schema, update, { + setDefaultsOnInsert: true, + upsert: updateOne.upsert + }); + } + decorateUpdateWithVersionKey( + update, + updateOne, + model.schema.options.versionKey + ); + updateOne["filter"] = cast(model.schema, updateOne["filter"], { + strict, + upsert: updateOne.upsert + }); + updateOne["update"] = castUpdate(model.schema, update, { + strict, + upsert: updateOne.upsert, + arrayFilters: updateOne.arrayFilters, + overwriteDiscriminatorKey: updateOne.overwriteDiscriminatorKey, + overwriteImmutable: updateOne.overwriteImmutable + }, model, updateOne["filter"]); + return updateOne; + }; + module2.exports.castUpdateMany = function castUpdateMany(originalModel, updateMany, options, now) { + if (!updateMany["filter"]) { + throw new Error("Must provide a filter object."); + } + if (!updateMany["update"]) { + throw new Error("Must provide an update object."); + } + const model = decideModelByObject(originalModel, updateMany["filter"]); + const schema = model.schema; + const strict = options.strict != null ? options.strict : model.schema.options.strict; + const globalSetDefaultsOnInsert = originalModel.base.options.setDefaultsOnInsert; + const shouldSetDefaultsOnInsert = updateMany.setDefaultsOnInsert == null ? globalSetDefaultsOnInsert : updateMany.setDefaultsOnInsert; + if (shouldSetDefaultsOnInsert !== false) { + setDefaultsOnInsert(updateMany["filter"], model.schema, updateMany["update"], { + setDefaultsOnInsert: true, + upsert: updateMany.upsert + }); + } + const doInitTimestamps = getTimestampsOpt(updateMany, options); + if (model.schema.$timestamps != null && doInitTimestamps) { + const createdAt = model.schema.$timestamps.createdAt; + const updatedAt = model.schema.$timestamps.updatedAt; + applyTimestampsToUpdate(now, createdAt, updatedAt, updateMany["update"], { + timestamps: updateMany.timestamps, + overwriteImmutable: updateMany.overwriteImmutable + }); + } + if (doInitTimestamps) { + applyTimestampsToChildren(now, updateMany["update"], model.schema); + } + _addDiscriminatorToObject(schema, updateMany["filter"]); + decorateUpdateWithVersionKey( + updateMany["update"], + updateMany, + model.schema.options.versionKey + ); + updateMany["filter"] = cast(model.schema, updateMany["filter"], { + strict, + upsert: updateMany.upsert + }); + updateMany["update"] = castUpdate(model.schema, updateMany["update"], { + strict, + upsert: updateMany.upsert, + arrayFilters: updateMany.arrayFilters, + overwriteDiscriminatorKey: updateMany.overwriteDiscriminatorKey, + overwriteImmutable: updateMany.overwriteImmutable + }, model, updateMany["filter"]); + }; + module2.exports.castReplaceOne = async function castReplaceOne(originalModel, replaceOne, options) { + const model = decideModelByObject(originalModel, replaceOne["filter"]); + const schema = model.schema; + const strict = options.strict != null ? options.strict : model.schema.options.strict; + _addDiscriminatorToObject(schema, replaceOne["filter"]); + replaceOne["filter"] = cast(model.schema, replaceOne["filter"], { + strict, + upsert: replaceOne.upsert + }); + const doc = new model(replaceOne["replacement"], strict, true); + if (model.schema.options.timestamps && getTimestampsOpt(replaceOne, options)) { + doc.initializeTimestamps(); + } + if (options.session != null) { + doc.$session(options.session); + } + const versionKey = model?.schema?.options?.versionKey; + if (versionKey && doc[versionKey] == null) { + doc[versionKey] = 0; + } + replaceOne["replacement"] = doc; + if (options.skipValidation || replaceOne.skipValidation) { + replaceOne["replacement"] = replaceOne["replacement"].toBSON(); + return; + } + await replaceOne["replacement"].$validate(); + replaceOne["replacement"] = replaceOne["replacement"].toBSON(); + }; + module2.exports.castDeleteOne = function castDeleteOne(originalModel, deleteOne) { + const model = decideModelByObject(originalModel, deleteOne["filter"]); + const schema = model.schema; + _addDiscriminatorToObject(schema, deleteOne["filter"]); + deleteOne["filter"] = cast(model.schema, deleteOne["filter"]); + }; + module2.exports.castDeleteMany = function castDeleteMany(originalModel, deleteMany) { + const model = decideModelByObject(originalModel, deleteMany["filter"]); + const schema = model.schema; + _addDiscriminatorToObject(schema, deleteMany["filter"]); + deleteMany["filter"] = cast(model.schema, deleteMany["filter"]); + }; + module2.exports.cast = { + insertOne: module2.exports.castInsertOne, + updateOne: module2.exports.castUpdateOne, + updateMany: module2.exports.castUpdateMany, + replaceOne: module2.exports.castReplaceOne, + deleteOne: module2.exports.castDeleteOne, + deleteMany: module2.exports.castDeleteMany + }; + function _addDiscriminatorToObject(schema, obj) { + if (schema == null) { + return; + } + if (schema.discriminatorMapping && !schema.discriminatorMapping.isRoot) { + obj[schema.discriminatorMapping.key] = schema.discriminatorMapping.value; + } + } + function decideModelByObject(model, object) { + const discriminatorKey = model.schema.options.discriminatorKey; + if (object != null && Object.hasOwn(object, discriminatorKey)) { + model = getDiscriminatorByValue(model.discriminators, object[discriminatorKey]) || model; + } + return model; + } + function getTimestampsOpt(opCommand, options) { + const opLevelOpt = opCommand.timestamps; + const bulkLevelOpt = options.timestamps; + if (opLevelOpt != null) { + return opLevelOpt; + } else if (bulkLevelOpt != null) { + return bulkLevelOpt; + } + return true; + } + } +}); + +// node_modules/mongoose/lib/helpers/model/decorateBulkWriteResult.js +var require_decorateBulkWriteResult = __commonJS({ + "node_modules/mongoose/lib/helpers/model/decorateBulkWriteResult.js"(exports2, module2) { + "use strict"; + module2.exports = function decorateBulkWriteResult(resultOrError, validationErrors, results) { + resultOrError.mongoose = resultOrError.mongoose || {}; + resultOrError.mongoose.validationErrors = validationErrors; + resultOrError.mongoose.results = results; + return resultOrError; + }; + } +}); + +// node_modules/mongoose/lib/connection.js +var require_connection2 = __commonJS({ + "node_modules/mongoose/lib/connection.js"(exports2, module2) { + "use strict"; + var ChangeStream = require_changeStream(); + var EventEmitter = require("events").EventEmitter; + var Schema2 = require_schema2(); + var STATES = require_connectionState(); + var MongooseBulkWriteError = require_bulkWriteError(); + var MongooseError = require_error2(); + var ServerSelectionError = require_serverSelection(); + var SyncIndexesError = require_syncIndexes(); + var applyPlugins = require_applyPlugins(); + var clone = require_clone(); + var driver = require_driver(); + var get2 = require_get(); + var getDefaultBulkwriteResult = require_getDefaultBulkwriteResult(); + var immediate = require_immediate(); + var utils = require_utils6(); + var CreateCollectionsError = require_createCollectionsError(); + var castBulkWrite = require_castBulkWrite(); + var { modelSymbol } = require_symbols(); + var isPromise = require_isPromise(); + var decorateBulkWriteResult = require_decorateBulkWriteResult(); + var arrayAtomicsSymbol = require_symbols().arrayAtomicsSymbol; + var sessionNewDocuments = require_symbols().sessionNewDocuments; + var Date2 = globalThis.Date; + var noPasswordAuthMechanisms = [ + "MONGODB-X509" + ]; + function Connection(base) { + this.base = base; + this.collections = {}; + this.models = {}; + this.config = {}; + this.replica = false; + this.options = null; + this.otherDbs = []; + this.relatedDbs = {}; + this.states = STATES; + this._readyState = STATES.disconnected; + this._closeCalled = false; + this._hasOpened = false; + this.plugins = []; + if (typeof base === "undefined" || !base.connections.length) { + this.id = 0; + } else { + this.id = base.nextConnectionId; + } + this._queue = []; + } + Object.setPrototypeOf(Connection.prototype, EventEmitter.prototype); + Object.defineProperty(Connection.prototype, "readyState", { + get: function() { + if (this._readyState === STATES.connected && this._lastHeartbeatAt != null && // LoadBalanced topology (behind haproxy, including Atlas serverless instances) don't use heartbeats, + // so we can't use this check in that case. + this.client?.topology?.s?.description?.type !== "LoadBalanced" && typeof this.client?.topology?.s?.description?.heartbeatFrequencyMS === "number" && Date2.now() - this._lastHeartbeatAt >= this.client.topology.s.description.heartbeatFrequencyMS * 2) { + return STATES.disconnected; + } + return this._readyState; + }, + set: function(val) { + if (!(val in STATES)) { + throw new Error("Invalid connection state: " + val); + } + if (this._readyState !== val) { + this._readyState = val; + for (const db of this.otherDbs) { + db.readyState = val; + } + if (STATES.connected === val) { + this._hasOpened = true; + } + this.emit(STATES[val]); + } + } + }); + Connection.prototype.get = function getOption(key) { + if (Object.hasOwn(this.config, key)) { + return this.config[key]; + } + return get2(this.options, key); + }; + Connection.prototype.set = function setOption(key, val) { + if (Object.hasOwn(this.config, key)) { + this.config[key] = val; + return val; + } + this.options = this.options || {}; + this.options[key] = val; + return val; + }; + Connection.prototype.collections; + Connection.prototype.name; + Connection.prototype.models; + Connection.prototype.id; + Object.defineProperty(Connection.prototype, "plugins", { + configurable: false, + enumerable: true, + writable: true + }); + Object.defineProperty(Connection.prototype, "host", { + configurable: true, + enumerable: true, + writable: true + }); + Object.defineProperty(Connection.prototype, "port", { + configurable: true, + enumerable: true, + writable: true + }); + Object.defineProperty(Connection.prototype, "user", { + configurable: true, + enumerable: true, + writable: true + }); + Object.defineProperty(Connection.prototype, "pass", { + configurable: true, + enumerable: true, + writable: true + }); + Connection.prototype.db; + Connection.prototype.client; + Connection.prototype.config; + Connection.prototype.createCollection = async function createCollection(collection, options) { + if (typeof options === "function" || arguments.length >= 3 && typeof arguments[2] === "function") { + throw new MongooseError("Connection.prototype.createCollection() no longer accepts a callback"); + } + await this._waitForConnect(); + return this.db.createCollection(collection, options); + }; + Connection.prototype.bulkWrite = async function bulkWrite(ops, options) { + await this._waitForConnect(); + options = options || {}; + const ordered = options.ordered == null ? true : options.ordered; + const asyncLocalStorage = this.base.transactionAsyncLocalStorage?.getStore(); + if ((!options || !Object.hasOwn(options, "session")) && asyncLocalStorage?.session != null) { + options = { ...options, session: asyncLocalStorage.session }; + } + const now = this.base.now(); + let res = null; + if (ordered) { + const opsToSend = []; + for (const op2 of ops) { + if (typeof op2.model !== "string" && !op2.model?.[modelSymbol]) { + throw new MongooseError("Must specify model in Connection.prototype.bulkWrite() operations"); + } + const Model = op2.model[modelSymbol] ? op2.model : this.model(op2.model); + if (op2.name == null) { + throw new MongooseError("Must specify operation name in Connection.prototype.bulkWrite()"); + } + if (!Object.hasOwn(castBulkWrite.cast, op2.name)) { + throw new MongooseError(`Unrecognized bulkWrite() operation name ${op2.name}`); + } + await castBulkWrite.cast[op2.name](Model, op2, options, now); + opsToSend.push({ ...op2, namespace: Model.namespace() }); + } + res = await this.client.bulkWrite(opsToSend, options); + } else { + const validOps = []; + const validOpIndexes = []; + let validationErrors = []; + const asyncValidations = []; + const results = []; + for (let i4 = 0; i4 < ops.length; ++i4) { + const op2 = ops[i4]; + if (typeof op2.model !== "string" && !op2.model?.[modelSymbol]) { + const error3 = new MongooseError("Must specify model in Connection.prototype.bulkWrite() operations"); + validationErrors.push({ index: i4, error: error3 }); + results[i4] = error3; + continue; + } + let Model; + try { + Model = op2.model[modelSymbol] ? op2.model : this.model(op2.model); + } catch (error3) { + validationErrors.push({ index: i4, error: error3 }); + continue; + } + if (op2.name == null) { + const error3 = new MongooseError("Must specify operation name in Connection.prototype.bulkWrite()"); + validationErrors.push({ index: i4, error: error3 }); + results[i4] = error3; + continue; + } + if (!Object.hasOwn(castBulkWrite.cast, op2.name)) { + const error3 = new MongooseError(`Unrecognized bulkWrite() operation name ${op2.name}`); + validationErrors.push({ index: i4, error: error3 }); + results[i4] = error3; + continue; + } + let maybePromise = null; + try { + maybePromise = castBulkWrite.cast[op2.name](Model, op2, options, now); + } catch (error3) { + validationErrors.push({ index: i4, error: error3 }); + results[i4] = error3; + continue; + } + if (isPromise(maybePromise)) { + asyncValidations.push( + maybePromise.then( + () => { + validOps.push({ ...op2, namespace: Model.namespace() }); + validOpIndexes.push(i4); + }, + (error3) => { + validationErrors.push({ index: i4, error: error3 }); + results[i4] = error3; + } + ) + ); + } else { + validOps.push({ ...op2, namespace: Model.namespace() }); + validOpIndexes.push(i4); + } + } + if (asyncValidations.length > 0) { + await Promise.all(asyncValidations); + } + validationErrors = validationErrors.sort((v1, v22) => v1.index - v22.index).map((v4) => v4.error); + if (validOps.length === 0) { + if (options.throwOnValidationError && validationErrors.length) { + throw new MongooseBulkWriteError( + validationErrors, + results, + res2, + "bulkWrite" + ); + } + const BulkWriteResult = this.base.driver.get().BulkWriteResult; + const res2 = new BulkWriteResult(getDefaultBulkwriteResult(), false); + return decorateBulkWriteResult(res2, validationErrors, results); + } + let error2; + [res, error2] = await this.client.bulkWrite(validOps, options).then((res2) => [res2, null]).catch((err) => [null, err]); + for (let i4 = 0; i4 < validOpIndexes.length; ++i4) { + results[validOpIndexes[i4]] = null; + } + if (error2) { + if (validationErrors.length > 0) { + decorateBulkWriteResult(error2, validationErrors, results); + error2.mongoose = error2.mongoose || {}; + error2.mongoose.validationErrors = validationErrors; + } + } + if (validationErrors.length > 0) { + if (options.throwOnValidationError) { + throw new MongooseBulkWriteError( + validationErrors, + results, + res, + "bulkWrite" + ); + } else { + decorateBulkWriteResult(res, validationErrors, results); + } + } + } + return res; + }; + Connection.prototype.createCollections = async function createCollections(options = {}) { + const result = {}; + const errorsMap = {}; + const { continueOnError } = options; + delete options.continueOnError; + for (const model of Object.values(this.models)) { + try { + result[model.modelName] = await model.createCollection({}); + } catch (err) { + if (!continueOnError) { + errorsMap[model.modelName] = err; + break; + } else { + result[model.modelName] = err; + } + } + } + if (!continueOnError && Object.keys(errorsMap).length) { + const message2 = Object.entries(errorsMap).map(([modelName, err]) => `${modelName}: ${err.message}`).join(", "); + const createCollectionsError = new CreateCollectionsError(message2, errorsMap); + throw createCollectionsError; + } + return result; + }; + Connection.prototype.withSession = async function withSession(executor) { + if (arguments.length === 0) { + throw new Error("Please provide an executor function"); + } + return await this.client.withSession(executor); + }; + Connection.prototype.startSession = async function startSession(options) { + if (arguments.length >= 2 && typeof arguments[1] === "function") { + throw new MongooseError("Connection.prototype.startSession() no longer accepts a callback"); + } + await this._waitForConnect(); + const session = this.client.startSession(options); + return session; + }; + Connection.prototype.transaction = function transaction(fn2, options) { + return this.startSession().then((session) => { + session[sessionNewDocuments] = /* @__PURE__ */ new Map(); + return session.withTransaction(() => _wrapUserTransaction(fn2, session, this.base), options).then((res) => { + delete session[sessionNewDocuments]; + return res; + }).catch((err) => { + delete session[sessionNewDocuments]; + throw err; + }).finally(() => { + session.endSession().catch(() => { + }); + }); + }); + }; + async function _wrapUserTransaction(fn2, session, mongoose2) { + try { + const res = mongoose2.transactionAsyncLocalStorage == null ? await fn2(session) : await new Promise((resolve) => { + mongoose2.transactionAsyncLocalStorage.run( + { session }, + () => resolve(fn2(session)) + ); + }); + return res; + } catch (err) { + _resetSessionDocuments(session); + throw err; + } + } + function _resetSessionDocuments(session) { + for (const doc of session[sessionNewDocuments].keys()) { + const state2 = session[sessionNewDocuments].get(doc); + if (Object.hasOwn(state2, "isNew")) { + doc.$isNew = state2.isNew; + } + if (Object.hasOwn(state2, "versionKey")) { + doc.set(doc.schema.options.versionKey, state2.versionKey); + } + if (state2.modifiedPaths.length > 0 && doc.$__.activePaths.states.modify == null) { + doc.$__.activePaths.states.modify = {}; + } + for (const path of state2.modifiedPaths) { + const currentState = doc.$__.activePaths.paths[path]; + if (currentState != null) { + delete doc.$__.activePaths[currentState][path]; + } + doc.$__.activePaths.paths[path] = "modify"; + doc.$__.activePaths.states.modify[path] = true; + } + for (const path of state2.atomics.keys()) { + const val = doc.$__getValue(path); + if (val == null) { + continue; + } + val[arrayAtomicsSymbol] = state2.atomics.get(path); + } + } + } + Connection.prototype.dropCollection = async function dropCollection(collection) { + if (arguments.length >= 2 && typeof arguments[1] === "function") { + throw new MongooseError("Connection.prototype.dropCollection() no longer accepts a callback"); + } + await this._waitForConnect(); + return this.db.dropCollection(collection); + }; + Connection.prototype._waitForConnect = async function _waitForConnect(noTimeout) { + if ((this.readyState === STATES.connecting || this.readyState === STATES.disconnected) && this._shouldBufferCommands()) { + const bufferTimeoutMS = this._getBufferTimeoutMS(); + let timeout = null; + let timedOut = false; + const queueElement = {}; + const waitForConnectPromise = new Promise((resolve) => { + queueElement.fn = resolve; + this._queue.push(queueElement); + }); + if (noTimeout) { + await waitForConnectPromise; + } else { + await Promise.race([ + waitForConnectPromise, + new Promise((resolve) => { + timeout = setTimeout( + () => { + timedOut = true; + resolve(); + }, + bufferTimeoutMS + ); + }) + ]); + } + if (timedOut) { + const index = this._queue.indexOf(queueElement); + if (index !== -1) { + this._queue.splice(index, 1); + } + const message2 = "Connection operation buffering timed out after " + bufferTimeoutMS + "ms"; + throw new MongooseError(message2); + } else if (timeout != null) { + clearTimeout(timeout); + } + } + }; + Connection.prototype._getBufferTimeoutMS = function _getBufferTimeoutMS() { + if (this.config.bufferTimeoutMS != null) { + return this.config.bufferTimeoutMS; + } + if (this.base != null && this.base.get("bufferTimeoutMS") != null) { + return this.base.get("bufferTimeoutMS"); + } + return 1e4; + }; + Connection.prototype.listCollections = async function listCollections() { + await this._waitForConnect(); + const cursor2 = this.db.listCollections(); + return await cursor2.toArray(); + }; + Connection.prototype.listDatabases = async function listDatabases() { + throw new MongooseError("listDatabases() not implemented by driver"); + }; + Connection.prototype.dropDatabase = async function dropDatabase() { + if (arguments.length >= 1 && typeof arguments[0] === "function") { + throw new MongooseError("Connection.prototype.dropDatabase() no longer accepts a callback"); + } + await this._waitForConnect(); + for (const model of Object.values(this.models)) { + delete model.$init; + } + return this.db.dropDatabase(); + }; + Connection.prototype._shouldBufferCommands = function _shouldBufferCommands() { + if (this.config.bufferCommands != null) { + return this.config.bufferCommands; + } + if (this.base.get("bufferCommands") != null) { + return this.base.get("bufferCommands"); + } + return true; + }; + Connection.prototype.error = function error2(err, callback) { + if (callback) { + callback(err); + return null; + } + if (this.listeners("error").length > 0) { + this.emit("error", err); + } + return Promise.reject(err); + }; + Connection.prototype.onOpen = function() { + this.readyState = STATES.connected; + for (const d4 of this._queue) { + d4.fn.apply(d4.ctx, d4.args); + } + this._queue = []; + for (const i4 in this.collections) { + if (Object.hasOwn(this.collections, i4)) { + this.collections[i4].onOpen(); + } + } + this.emit("open"); + }; + Connection.prototype.openUri = async function openUri(uri, options) { + if (this.readyState === STATES.connecting || this.readyState === STATES.connected) { + if (this._connectionString === uri) { + return this; + } + } + this._closeCalled = false; + let _fireAndForget = false; + if (options && "_fireAndForget" in options) { + _fireAndForget = options._fireAndForget; + delete options._fireAndForget; + } + try { + _validateArgs.apply(arguments); + } catch (err) { + if (_fireAndForget) { + throw err; + } + this.$initialConnection = Promise.reject(err); + throw err; + } + this.$initialConnection = this.createClient(uri, options).then(() => this).catch((err) => { + this.readyState = STATES.disconnected; + if (this.listeners("error").length > 0) { + immediate(() => this.emit("error", err)); + } + throw err; + }); + for (const model of Object.values(this.models)) { + model.init().catch(function $modelInitNoop() { + }); + } + if (_fireAndForget) { + return this; + } + try { + await this.$initialConnection; + } catch (err) { + throw _handleConnectionErrors(err); + } + return this; + }; + Connection.prototype.on = function on(event, callback) { + if (event === "error" && this.$initialConnection) { + this.$initialConnection.catch(() => { + }); + } + return EventEmitter.prototype.on.call(this, event, callback); + }; + Connection.prototype.once = function on(event, callback) { + if (event === "error" && this.$initialConnection) { + this.$initialConnection.catch(() => { + }); + } + return EventEmitter.prototype.once.call(this, event, callback); + }; + function _validateArgs(uri, options, callback) { + if (typeof options === "function" && callback == null) { + throw new MongooseError("Connection.prototype.openUri() no longer accepts a callback"); + } else if (typeof callback === "function") { + throw new MongooseError("Connection.prototype.openUri() no longer accepts a callback"); + } + } + function _handleConnectionErrors(err) { + if (err?.name === "MongoServerSelectionError") { + const originalError = err; + err = new ServerSelectionError(); + err.assimilateError(originalError); + } + return err; + } + Connection.prototype.destroy = async function destroy(force) { + if (typeof force === "function" || arguments.length === 2 && typeof arguments[1] === "function") { + throw new MongooseError("Connection.prototype.destroy() no longer accepts a callback"); + } + if (force != null && typeof force === "object") { + this.$wasForceClosed = !!force.force; + } else { + this.$wasForceClosed = !!force; + } + return this._close(force, true); + }; + Connection.prototype.close = async function close(force) { + if (typeof force === "function" || arguments.length === 2 && typeof arguments[1] === "function") { + throw new MongooseError("Connection.prototype.close() no longer accepts a callback"); + } + if (force != null && typeof force === "object") { + this.$wasForceClosed = !!force.force; + } else { + this.$wasForceClosed = !!force; + } + if (this._lastHeartbeatAt != null) { + this._lastHeartbeatAt = null; + } + for (const model of Object.values(this.models)) { + delete model.$init; + } + return this._close(force, false); + }; + Connection.prototype._close = async function _close(force, destroy) { + const _this = this; + const closeCalled = this._closeCalled; + this._closeCalled = true; + this._destroyCalled = destroy; + if (this.client != null) { + this.client._closeCalled = true; + this.client._destroyCalled = destroy; + } + const conn = this; + switch (this.readyState) { + case STATES.disconnected: + if (destroy && this.base.connections.indexOf(conn) !== -1) { + this.base.connections.splice(this.base.connections.indexOf(conn), 1); + } + if (!closeCalled) { + await this.doClose(force); + this.onClose(force); + } + break; + case STATES.connected: + this.readyState = STATES.disconnecting; + await this.doClose(force); + if (destroy && _this.base.connections.indexOf(conn) !== -1) { + this.base.connections.splice(this.base.connections.indexOf(conn), 1); + } + this.onClose(force); + break; + case STATES.connecting: + return new Promise((resolve, reject) => { + const _rerunClose = () => { + this.removeListener("open", _rerunClose); + this.removeListener("error", _rerunClose); + if (destroy) { + this.destroy(force).then(resolve, reject); + } else { + this.close(force).then(resolve, reject); + } + }; + this.once("open", _rerunClose); + this.once("error", _rerunClose); + }); + case STATES.disconnecting: + return new Promise((resolve) => { + this.once("close", () => { + if (destroy && this.base.connections.indexOf(conn) !== -1) { + this.base.connections.splice(this.base.connections.indexOf(conn), 1); + } + resolve(); + }); + }); + } + return this; + }; + Connection.prototype.doClose = function doClose() { + throw new Error("Connection#doClose unimplemented by driver"); + }; + Connection.prototype.onClose = function onClose(force) { + this.readyState = STATES.disconnected; + for (const i4 in this.collections) { + if (Object.hasOwn(this.collections, i4)) { + this.collections[i4].onClose(force); + } + } + this.emit("close", force); + const wasForceClosed = typeof force === "object" && force !== null ? force.force : force; + for (const db of this.otherDbs) { + this._destroyCalled ? db.destroy({ force: wasForceClosed, skipCloseClient: true }) : db.close({ force: wasForceClosed, skipCloseClient: true }); + } + }; + Connection.prototype.collection = function(name, options) { + const defaultOptions = { + autoIndex: this.config.autoIndex != null ? this.config.autoIndex : this.base.options.autoIndex, + autoCreate: this.config.autoCreate != null ? this.config.autoCreate : this.base.options.autoCreate, + autoSearchIndex: this.config.autoSearchIndex != null ? this.config.autoSearchIndex : this.base.options.autoSearchIndex + }; + options = Object.assign({}, defaultOptions, options ? clone(options) : {}); + options.$wasForceClosed = this.$wasForceClosed; + const Collection = this.base && this.base.__driver && this.base.__driver.Collection || driver.get().Collection; + if (!(name in this.collections)) { + this.collections[name] = new Collection(name, this, options); + } + return this.collections[name]; + }; + Connection.prototype.plugin = function(fn2, opts) { + this.plugins.push([fn2, opts]); + return this; + }; + Connection.prototype.model = function model(name, schema, collection, options) { + if (!(this instanceof Connection)) { + throw new MongooseError("`connection.model()` should not be run with `new`. If you are doing `new db.model(foo)(bar)`, use `db.model(foo)(bar)` instead"); + } + let fn2; + if (typeof name === "function") { + fn2 = name; + name = fn2.name; + } + if (typeof schema === "string") { + collection = schema; + schema = false; + } + if (utils.isObject(schema)) { + if (!schema.instanceOfSchema) { + schema = new Schema2(schema); + } else if (!(schema instanceof this.base.Schema)) { + schema = schema._clone(this.base.Schema); + } + } + if (schema && !schema.instanceOfSchema) { + throw new Error("The 2nd parameter to `mongoose.model()` should be a schema or a POJO"); + } + const defaultOptions = { cache: false, overwriteModels: this.base.options.overwriteModels }; + const opts = Object.assign(defaultOptions, options, { connection: this }); + if (this.models[name] && !collection && opts.overwriteModels !== true) { + if (schema && schema.instanceOfSchema && schema !== this.models[name].schema) { + throw new MongooseError.OverwriteModelError(name); + } + return this.models[name]; + } + let model2; + if (schema && schema.instanceOfSchema) { + applyPlugins(schema, this.plugins, null, "$connectionPluginsApplied"); + model2 = this.base._model(fn2 || name, schema, collection, opts); + if (!this.models[name]) { + this.models[name] = model2; + } + model2.init().catch(function $modelInitNoop() { + }); + return model2; + } + if (this.models[name] && collection) { + model2 = this.models[name]; + schema = model2.prototype.schema; + const sub = model2.__subclass(this, schema, collection); + return sub; + } + if (arguments.length === 1) { + model2 = this.models[name]; + if (!model2) { + throw new MongooseError.MissingSchemaError(name); + } + return model2; + } + if (!model2) { + throw new MongooseError.MissingSchemaError(name); + } + if (this === model2.prototype.db && (!collection || collection === model2.collection.name)) { + if (!this.models[name]) { + this.models[name] = model2; + } + return model2; + } + this.models[name] = model2.__subclass(this, schema, collection); + return this.models[name]; + }; + Connection.prototype.deleteModel = function deleteModel(name) { + if (typeof name === "string") { + const model = this.model(name); + if (model == null) { + return this; + } + const collectionName = model.collection.name; + delete this.models[name]; + delete this.collections[collectionName]; + this.emit("deleteModel", model); + } else if (name instanceof RegExp) { + const pattern = name; + const names = this.modelNames(); + for (const name2 of names) { + if (pattern.test(name2)) { + this.deleteModel(name2); + } + } + } else { + throw new Error('First parameter to `deleteModel()` must be a string or regexp, got "' + name + '"'); + } + return this; + }; + Connection.prototype.watch = function watch(pipeline, options) { + const changeStreamThunk = (cb) => { + immediate(() => { + if (this.readyState === STATES.connecting) { + this.once("open", function() { + const driverChangeStream = this.db.watch(pipeline, options); + cb(null, driverChangeStream); + }); + } else { + const driverChangeStream = this.db.watch(pipeline, options); + cb(null, driverChangeStream); + } + }); + }; + const changeStream = new ChangeStream(changeStreamThunk, pipeline, options); + return changeStream; + }; + Connection.prototype.asPromise = async function asPromise() { + try { + await this.$initialConnection; + return this; + } catch (err) { + throw _handleConnectionErrors(err); + } + }; + Connection.prototype.modelNames = function modelNames() { + return Object.keys(this.models); + }; + Connection.prototype.shouldAuthenticate = function shouldAuthenticate() { + return this.user != null && (this.pass != null || this.authMechanismDoesNotRequirePassword()); + }; + Connection.prototype.authMechanismDoesNotRequirePassword = function authMechanismDoesNotRequirePassword() { + if (this.options && this.options.auth) { + return noPasswordAuthMechanisms.indexOf(this.options.auth.authMechanism) >= 0; + } + return true; + }; + Connection.prototype.optionsProvideAuthenticationData = function optionsProvideAuthenticationData(options) { + return options && options.user && (options.pass || this.authMechanismDoesNotRequirePassword()); + }; + Connection.prototype.getClient = function getClient() { + return this.client; + }; + Connection.prototype.setClient = function setClient() { + throw new MongooseError("Connection#setClient not implemented by driver"); + }; + Connection.prototype.createClient = function createClient() { + throw new MongooseError("Connection#createClient not implemented by driver"); + }; + Connection.prototype.syncIndexes = async function syncIndexes(options = {}) { + const result = {}; + const errorsMap = {}; + const { continueOnError } = options; + delete options.continueOnError; + for (const model of Object.values(this.models)) { + try { + result[model.modelName] = await model.syncIndexes(options); + } catch (err) { + if (!continueOnError) { + errorsMap[model.modelName] = err; + break; + } else { + result[model.modelName] = err; + } + } + } + if (!continueOnError && Object.keys(errorsMap).length) { + const message2 = Object.entries(errorsMap).map(([modelName, err]) => `${modelName}: ${err.message}`).join(", "); + const syncIndexesError = new SyncIndexesError(message2, errorsMap); + throw syncIndexesError; + } + return result; + }; + Connection.STATES = STATES; + module2.exports = Connection; + } +}); + +// node_modules/mongoose/package.json +var require_package2 = __commonJS({ + "node_modules/mongoose/package.json"(exports2, module2) { + module2.exports = { + name: "mongoose", + description: "Mongoose MongoDB ODM", + version: "8.21.0", + author: "Guillermo Rauch ", + keywords: [ + "mongodb", + "document", + "model", + "schema", + "database", + "odm", + "data", + "datastore", + "query", + "nosql", + "orm", + "db" + ], + type: "commonjs", + license: "MIT", + dependencies: { + bson: "^6.10.4", + kareem: "2.6.3", + mongodb: "~6.20.0", + mpath: "0.9.0", + mquery: "5.0.0", + ms: "2.1.3", + sift: "17.1.3" + }, + devDependencies: { + "@ark/attest": "0.53.0", + "@babel/core": "7.28.5", + "@babel/preset-env": "7.28.5", + "@mongodb-js/mongodb-downloader": "^1.0.0", + "@typescript-eslint/eslint-plugin": "^8.19.1", + "@typescript-eslint/parser": "^8.19.1", + acquit: "1.4.0", + "acquit-ignore": "0.2.1", + "acquit-require": "0.1.1", + ajv: "8.17.1", + "assert-browserify": "2.0.0", + "babel-loader": "8.2.5", + "broken-link-checker": "^0.7.8", + buffer: "^5.6.0", + cheerio: "1.1.2", + "crypto-browserify": "3.12.1", + dox: "1.0.0", + eslint: "8.57.1", + "eslint-plugin-markdown": "^5.1.0", + "eslint-plugin-mocha-no-only": "1.2.0", + express: "^4.19.2", + "fs-extra": "~11.3.0", + "highlight.js": "11.11.1", + "lodash.isequal": "4.5.0", + "lodash.isequalwith": "4.4.0", + "markdownlint-cli2": "^0.18.1", + marked: "15.x", + mkdirp: "^3.0.1", + mocha: "11.7.4", + moment: "2.30.1", + "mongodb-memory-server": "10.3.0", + "mongodb-runner": "^6.0.0", + ncp: "^2.0.0", + nyc: "15.1.0", + pug: "3.0.3", + q: "1.5.1", + sinon: "21.0.0", + "stream-browserify": "3.0.0", + tsd: "0.33.0", + typescript: "5.9.3", + uuid: "11.1.0", + webpack: "5.102.1" + }, + directories: { + lib: "./lib/mongoose" + }, + scripts: { + "docs:clean": "npm run docs:clean:stable", + "docs:clean:stable": "rimraf index.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/api && rimraf -rf ./docs/tutorials/*.html && rimraf -rf ./docs/typescript/*.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp", + "docs:clean:5x": "rimraf index.html && rimraf -rf ./docs/5.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp", + "docs:clean:6x": "rimraf index.html && rimraf -rf ./docs/6.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp", + "docs:copy:tmp": "mkdirp ./tmp/docs/css && mkdirp ./tmp/docs/js && mkdirp ./tmp/docs/images && mkdirp ./tmp/docs/tutorials && mkdirp ./tmp/docs/typescript && mkdirp ./tmp/docs/api && ncp ./docs/css ./tmp/docs/css --filter=.css$ && ncp ./docs/js ./tmp/docs/js --filter=.js$ && ncp ./docs/images ./tmp/docs/images && ncp ./docs/tutorials ./tmp/docs/tutorials && ncp ./docs/typescript ./tmp/docs/typescript && ncp ./docs/api ./tmp/docs/api && cp index.html ./tmp && cp docs/*.html ./tmp/docs/", + "docs:copy:tmp:5x": "rimraf ./docs/5.x && ncp ./tmp ./docs/5.x", + "docs:copy:tmp:6x": "rimraf ./docs/6.x && ncp ./tmp ./docs/6.x", + "docs:generate": "node ./scripts/website.js", + "docs:generate:sponsorData": "node ./scripts/loadSponsorData.js", + "docs:test": "npm run docs:generate", + "docs:view": "node ./scripts/static.js", + "docs:prepare:publish:stable": "git checkout gh-pages && git merge master && npm run docs:generate", + "docs:prepare:publish:5x": "git checkout 5.x && git merge 5.x && npm run docs:clean:stable && npm run docs:generate && npm run docs:copy:tmp && git checkout gh-pages && npm run docs:copy:tmp:5x", + "docs:prepare:publish:6x": "git checkout 6.x && git merge 6.x && npm run docs:clean:stable && env DOCS_DEPLOY=true npm run docs:generate && mv ./docs/6.x ./tmp && git checkout gh-pages && npm run docs:copy:tmp:6x", + "docs:prepare:publish:7x": "env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rimraf ./docs/7.x && mv ./tmp ./docs/7.x", + "docs:prepare:publish:8x": "env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rimraf ./docs/8.x && mv ./tmp ./docs/8.x", + "docs:check-links": "blc http://127.0.0.1:8089 -ro", + lint: "eslint .", + "lint-js": "eslint . --ext .js --ext .cjs", + "lint-ts": "eslint . --ext .ts", + "lint-md": 'markdownlint-cli2 "**/*.md" "#node_modules" "#benchmarks"', + "build-browser": "(rm ./dist/* || true) && node ./scripts/build-browser.js", + prepublishOnly: "npm run build-browser", + release: "git pull && git push origin master --tags && npm publish", + "release-5x": "git pull origin 5.x && git push origin 5.x && git push origin 5.x --tags && npm publish --tag 5x", + "release-6x": "git pull origin 6.x && git push origin 6.x && git push origin 6.x --tags && npm publish --tag 6x", + mongo: "node ./tools/repl.js", + "publish-7x": "npm publish --tag 7x", + "create-separate-require-instance": "rm -rf ./node_modules/mongoose-separate-require-instance && node ./scripts/create-tarball && tar -xzf mongoose.tgz -C ./node_modules && mv ./node_modules/package ./node_modules/mongoose-separate-require-instance", + test: "mocha --exit ./test/*.test.js", + "test-deno": "deno run --allow-env --allow-read --allow-net --allow-run --allow-sys --allow-write ./test/deno.mjs", + "test-rs": "START_REPLICA_SET=1 mocha --timeout 30000 --exit ./test/*.test.js", + "test-tsd": "node ./test/types/check-types-filename && tsd", + "setup-test-encryption": "node scripts/setup-encryption-tests.js", + "test-encryption": "mocha --exit ./test/encryption/*.test.js", + tdd: "mocha ./test/*.test.js --inspect --watch --recursive --watch-files ./**/*.{js,ts}", + "test-coverage": "nyc --reporter=html --reporter=text npm test", + "ts-benchmark": "cd ./benchmarks/typescript/simple && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check", + "ts-benchmark:local": "node ./scripts/create-tarball && cd ./benchmarks/typescript/simple && rm -rf ./node_modules && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check", + "attest-benchmark": "node ./benchmarks/typescript/infer.bench.mts" + }, + main: "./index.js", + types: "./types/index.d.ts", + engines: { + node: ">=16.20.1" + }, + bugs: { + url: "https://github.com/Automattic/mongoose/issues/new" + }, + repository: { + type: "git", + url: "git://github.com/Automattic/mongoose.git" + }, + homepage: "https://mongoosejs.com", + browser: "./dist/browser.umd.js", + config: { + mongodbMemoryServer: { + disablePostinstall: true + } + }, + funding: { + type: "opencollective", + url: "https://opencollective.com/mongoose" + }, + tsd: { + directory: "test/types", + compilerOptions: { + esModuleInterop: false, + strict: true, + allowSyntheticDefaultImports: true, + strictPropertyInitialization: false, + noImplicitAny: false, + strictNullChecks: true, + module: "commonjs", + target: "ES2017" + } + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/processConnectionOptions.js +var require_processConnectionOptions = __commonJS({ + "node_modules/mongoose/lib/helpers/processConnectionOptions.js"(exports2, module2) { + "use strict"; + var clone = require_clone(); + var MongooseError = require_error2(); + function processConnectionOptions(uri, options) { + const opts = options ? options : {}; + const readPreference = opts.readPreference ? opts.readPreference : getUriReadPreference(uri); + const clonedOpts = clone(opts); + const resolvedOpts = readPreference && readPreference !== "primary" && readPreference !== "primaryPreferred" ? resolveOptsConflicts(readPreference, clonedOpts) : clonedOpts; + return resolvedOpts; + } + function resolveOptsConflicts(pref, opts) { + if (setsIndexOptions(opts) && setsSecondaryRead(pref)) { + throwReadPreferenceError(); + } else { + return defaultIndexOptsToFalse(opts); + } + } + function setsIndexOptions(opts) { + const configIdx = opts.config && opts.config.autoIndex; + const { autoCreate, autoIndex } = opts; + return !!(configIdx || autoCreate || autoIndex); + } + function setsSecondaryRead(prefString) { + return !!(prefString === "secondary" || prefString === "secondaryPreferred"); + } + function getUriReadPreference(connectionString) { + const exp = /(?:&|\?)readPreference=(\w+)(?:&|$)/; + const match = exp.exec(connectionString); + return match ? match[1] : null; + } + function defaultIndexOptsToFalse(opts) { + opts.config = { autoIndex: false }; + opts.autoCreate = false; + opts.autoIndex = false; + return opts; + } + function throwReadPreferenceError() { + throw new MongooseError( + 'MongoDB prohibits index creation on connections that read from non-primary replicas. Connections that set "readPreference" to "secondary" or "secondaryPreferred" may not opt-in to the following connection options: autoCreate, autoIndex' + ); + } + module2.exports = processConnectionOptions; + } +}); + +// node_modules/mongoose/lib/helpers/timers.js +var require_timers = __commonJS({ + "node_modules/mongoose/lib/helpers/timers.js"(exports2) { + "use strict"; + exports2.setTimeout = setTimeout; + } +}); + +// node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js +var require_connection3 = __commonJS({ + "node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js"(exports2, module2) { + "use strict"; + var MongooseConnection = require_connection2(); + var MongooseError = require_error2(); + var STATES = require_connectionState(); + var mongodb = require_lib6(); + var pkg = require_package2(); + var processConnectionOptions = require_processConnectionOptions(); + var setTimeout2 = require_timers().setTimeout; + var utils = require_utils6(); + var Schema2 = require_schema2(); + function NativeConnection() { + MongooseConnection.apply(this, arguments); + this._listening = false; + this._lastHeartbeatAt = null; + } + NativeConnection.STATES = STATES; + Object.setPrototypeOf(NativeConnection.prototype, MongooseConnection.prototype); + NativeConnection.prototype.useDb = function(name, options) { + options = options || {}; + if (options.useCache && this.relatedDbs[name]) { + return this.relatedDbs[name]; + } + const newConn = new this.constructor(); + newConn.name = name; + newConn.base = this.base; + newConn.collections = {}; + newConn.models = {}; + newConn.replica = this.replica; + newConn.config = Object.assign({}, this.config, newConn.config); + newConn.name = this.name; + newConn.options = this.options; + newConn._readyState = this._readyState; + newConn._closeCalled = this._closeCalled; + newConn._hasOpened = this._hasOpened; + newConn._listening = false; + newConn._parent = this; + newConn.host = this.host; + newConn.port = this.port; + newConn.user = this.user; + newConn.pass = this.pass; + const _this = this; + newConn.client = _this.client; + if (this.db && this._readyState === STATES.connected) { + wireup(); + } else { + this._queue.push({ fn: wireup }); + } + function wireup() { + newConn.client = _this.client; + const _opts = {}; + if (Object.hasOwn(options, "noListener")) { + _opts.noListener = options.noListener; + } + newConn.db = _this.client.db(name, _opts); + newConn._lastHeartbeatAt = _this._lastHeartbeatAt; + newConn.onOpen(); + } + newConn.name = name; + if (options.noListener !== true) { + this.otherDbs.push(newConn); + } + newConn.otherDbs.push(this); + if (options && options.useCache) { + this.relatedDbs[newConn.name] = newConn; + newConn.relatedDbs = this.relatedDbs; + } + return newConn; + }; + NativeConnection.prototype.aggregate = function aggregate(pipeline, options) { + return new this.base.Aggregate(null, this).append(pipeline).option(options ?? {}); + }; + NativeConnection.prototype.removeDb = function removeDb(name) { + const dbs = this.otherDbs.filter((db) => db.name === name); + if (!dbs.length) { + throw new MongooseError(`No connections to database "${name}" found`); + } + for (const db of dbs) { + db._closeCalled = true; + db._destroyCalled = true; + db._readyState = STATES.disconnected; + db.$wasForceClosed = true; + } + delete this.relatedDbs[name]; + this.otherDbs = this.otherDbs.filter((db) => db.name !== name); + }; + NativeConnection.prototype.doClose = async function doClose(force) { + if (this.client == null) { + return this; + } + let skipCloseClient = false; + if (force != null && typeof force === "object") { + skipCloseClient = force.skipCloseClient; + force = force.force; + } + if (skipCloseClient) { + return this; + } + await this.client.close(force); + await new Promise((resolve) => setTimeout2(resolve, 1)); + return this; + }; + NativeConnection.prototype.listDatabases = async function listDatabases() { + await this._waitForConnect(); + return await this.db.admin().listDatabases(); + }; + NativeConnection.prototype.createClient = async function createClient(uri, options) { + if (typeof uri !== "string") { + throw new MongooseError(`The \`uri\` parameter to \`openUri()\` must be a string, got "${typeof uri}". Make sure the first parameter to \`mongoose.connect()\` or \`mongoose.createConnection()\` is a string.`); + } + if (this._destroyCalled) { + throw new MongooseError( + "Connection has been closed and destroyed, and cannot be used for re-opening the connection. Please create a new connection with `mongoose.createConnection()` or `mongoose.connect()`." + ); + } + if (this.readyState === STATES.connecting || this.readyState === STATES.connected) { + if (this._connectionString !== uri) { + throw new MongooseError("Can't call `openUri()` on an active connection with different connection strings. Make sure you aren't calling `mongoose.connect()` multiple times. See: https://mongoosejs.com/docs/connections.html#multiple_connections"); + } + } + options = processConnectionOptions(uri, options); + if (options) { + const autoIndex = options.config && options.config.autoIndex != null ? options.config.autoIndex : options.autoIndex; + if (autoIndex != null) { + this.config.autoIndex = autoIndex !== false; + delete options.config; + delete options.autoIndex; + } + if ("autoCreate" in options) { + this.config.autoCreate = !!options.autoCreate; + delete options.autoCreate; + } + if ("sanitizeFilter" in options) { + this.config.sanitizeFilter = options.sanitizeFilter; + delete options.sanitizeFilter; + } + if ("autoSearchIndex" in options) { + this.config.autoSearchIndex = options.autoSearchIndex; + delete options.autoSearchIndex; + } + if ("bufferTimeoutMS" in options) { + this.config.bufferTimeoutMS = options.bufferTimeoutMS; + delete options.bufferTimeoutMS; + } + if (options.user || options.pass) { + options.auth = options.auth || {}; + options.auth.username = options.user; + options.auth.password = options.pass; + this.user = options.user; + this.pass = options.pass; + } + delete options.user; + delete options.pass; + if (options.bufferCommands != null) { + this.config.bufferCommands = options.bufferCommands; + delete options.bufferCommands; + } + } else { + options = {}; + } + this._connectionOptions = options; + const dbName = options.dbName; + if (dbName != null) { + this.$dbName = dbName; + } + delete options.dbName; + if (!utils.hasUserDefinedProperty(options, "driverInfo")) { + options.driverInfo = { + name: "Mongoose", + version: pkg.version + }; + } + const { schemaMap, encryptedFieldsMap } = this._buildEncryptionSchemas(); + if ((Object.keys(schemaMap).length > 0 || Object.keys(encryptedFieldsMap).length) && !options.autoEncryption) { + throw new Error("Must provide `autoEncryption` when connecting with encrypted schemas."); + } + if (Object.keys(schemaMap).length > 0) { + options.autoEncryption.schemaMap = schemaMap; + } + if (Object.keys(encryptedFieldsMap).length > 0) { + options.autoEncryption.encryptedFieldsMap = encryptedFieldsMap; + } + this.readyState = STATES.connecting; + this._connectionString = uri; + let client; + try { + client = new mongodb.MongoClient(uri, options); + } catch (error2) { + this.readyState = STATES.disconnected; + throw error2; + } + this.client = client; + client.setMaxListeners(0); + await client.connect(); + _setClient(this, client, options, dbName); + for (const db of this.otherDbs) { + _setClient(db, client, {}, db.name); + } + return this; + }; + NativeConnection.prototype._buildEncryptionSchemas = function() { + const qeMappings = {}; + const csfleMappings = {}; + const encryptedModels = Object.values(this.models).filter((model) => model.schema._hasEncryptedFields()); + for (const model of encryptedModels) { + const { schema, collection: { collectionName } } = model; + const namespace = `${this.$dbName}.${collectionName}`; + const mappings = schema.encryptionType() === "csfle" ? csfleMappings : qeMappings; + mappings[namespace] ??= new Schema2({}, { encryptionType: schema.encryptionType() }); + const isNonRootDiscriminator = schema.discriminatorMapping && !schema.discriminatorMapping.isRoot; + if (isNonRootDiscriminator) { + const rootSchema = schema._baseSchema; + schema.eachPath((pathname) => { + if (rootSchema.path(pathname)) return; + if (!mappings[namespace]._hasEncryptedField(pathname)) return; + throw new Error(`Cannot have duplicate keys in discriminators with encryption. key=${pathname}`); + }); + } + mappings[namespace].add(schema); + } + const schemaMap = Object.fromEntries(Object.entries(csfleMappings).map( + ([namespace, schema]) => [namespace, schema._buildSchemaMap()] + )); + const encryptedFieldsMap = Object.fromEntries(Object.entries(qeMappings).map( + ([namespace, schema]) => [namespace, schema._buildEncryptedFields()] + )); + return { + schemaMap, + encryptedFieldsMap + }; + }; + NativeConnection.prototype.setClient = function setClient(client) { + if (!(client instanceof mongodb.MongoClient)) { + throw new MongooseError("Must call `setClient()` with an instance of MongoClient"); + } + if (this.readyState !== STATES.disconnected) { + throw new MongooseError("Cannot call `setClient()` on a connection that is already connected."); + } + if (client.topology == null) { + throw new MongooseError("Cannot call `setClient()` with a MongoClient that you have not called `connect()` on yet."); + } + this._connectionString = client.s.url; + _setClient(this, client, {}, client.s.options.dbName); + for (const model of Object.values(this.models)) { + model.init().catch(function $modelInitNoop() { + }); + } + return this; + }; + function _setClient(conn, client, options, dbName) { + const db = dbName != null ? client.db(dbName) : client.db(); + conn.db = db; + conn.client = client; + conn.host = client && client.s && client.s.options && client.s.options.hosts && client.s.options.hosts[0] && client.s.options.hosts[0].host || void 0; + conn.port = client && client.s && client.s.options && client.s.options.hosts && client.s.options.hosts[0] && client.s.options.hosts[0].port || void 0; + conn.name = dbName != null ? dbName : db.databaseName; + conn._closeCalled = client._closeCalled; + const _handleReconnect = () => { + if (conn.readyState !== STATES.connected) { + conn.readyState = STATES.connected; + conn.emit("reconnect"); + conn.emit("reconnected"); + conn.onOpen(); + } + }; + const type = client && client.topology && client.topology.description && client.topology.description.type || ""; + if (type === "Single") { + client.on("serverDescriptionChanged", (ev) => { + const newDescription = ev.newDescription; + if (newDescription.type === "Unknown") { + conn.readyState = STATES.disconnected; + } else { + _handleReconnect(); + } + }); + } else if (type.startsWith("ReplicaSet")) { + client.on("topologyDescriptionChanged", (ev) => { + const description = ev.newDescription; + if (conn.readyState === STATES.connected && description.type !== "ReplicaSetWithPrimary") { + conn.readyState = STATES.disconnected; + } else if (conn.readyState === STATES.disconnected && description.type === "ReplicaSetWithPrimary") { + _handleReconnect(); + } + }); + } + conn._lastHeartbeatAt = null; + client.on("serverHeartbeatSucceeded", () => { + conn._lastHeartbeatAt = Date.now(); + for (const otherDb of conn.otherDbs) { + otherDb._lastHeartbeatAt = conn._lastHeartbeatAt; + } + }); + if (options.monitorCommands) { + client.on("commandStarted", (data2) => conn.emit("commandStarted", data2)); + client.on("commandFailed", (data2) => conn.emit("commandFailed", data2)); + client.on("commandSucceeded", (data2) => conn.emit("commandSucceeded", data2)); + } + conn.onOpen(); + for (const i4 in conn.collections) { + if (Object.hasOwn(conn.collections, i4)) { + conn.collections[i4].onOpen(); + } + } + } + module2.exports = NativeConnection; + } +}); + +// node_modules/mongoose/lib/drivers/node-mongodb-native/index.js +var require_node_mongodb_native = __commonJS({ + "node_modules/mongoose/lib/drivers/node-mongodb-native/index.js"(exports2) { + "use strict"; + exports2.BulkWriteResult = require_bulkWriteResult(); + exports2.Collection = require_collection3(); + exports2.Connection = require_connection3(); + exports2.ClientEncryption = require_lib6().ClientEncryption; + } +}); + +// node_modules/mongoose/lib/validOptions.js +var require_validOptions = __commonJS({ + "node_modules/mongoose/lib/validOptions.js"(exports2, module2) { + "use strict"; + var VALID_OPTIONS = Object.freeze([ + "allowDiskUse", + "applyPluginsToChildSchemas", + "applyPluginsToDiscriminators", + "autoCreate", + "autoIndex", + "autoSearchIndex", + "bufferCommands", + "bufferTimeoutMS", + "cloneSchemas", + "createInitialConnection", + "debug", + "forceRepopulate", + "id", + "timestamps.createdAt.immutable", + "maxTimeMS", + "objectIdGetter", + "overwriteModels", + "returnOriginal", + "runValidators", + "sanitizeFilter", + "sanitizeProjection", + "selectPopulatedPaths", + "setDefaultsOnInsert", + "skipOriginalStackTraces", + "strict", + "strictPopulate", + "strictQuery", + "toJSON", + "toObject", + "transactionAsyncLocalStorage", + "translateAliases" + ]); + module2.exports = VALID_OPTIONS; + } +}); + +// node_modules/mongoose/lib/error/eachAsyncMultiError.js +var require_eachAsyncMultiError = __commonJS({ + "node_modules/mongoose/lib/error/eachAsyncMultiError.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var EachAsyncMultiError = class extends MongooseError { + /** + * @param {String} connectionString + */ + constructor(errors) { + let preview = errors.map((e4) => e4.message).join(", "); + if (preview.length > 50) { + preview = preview.slice(0, 50) + "..."; + } + super(`eachAsync() finished with ${errors.length} errors: ${preview}`); + this.errors = errors; + } + }; + Object.defineProperty(EachAsyncMultiError.prototype, "name", { + value: "EachAsyncMultiError" + }); + module2.exports = EachAsyncMultiError; + } +}); + +// node_modules/mongoose/lib/helpers/cursor/eachAsync.js +var require_eachAsync = __commonJS({ + "node_modules/mongoose/lib/helpers/cursor/eachAsync.js"(exports2, module2) { + "use strict"; + var EachAsyncMultiError = require_eachAsyncMultiError(); + var immediate = require_immediate(); + module2.exports = async function eachAsync(next, fn2, options) { + const parallel = options.parallel || 1; + const batchSize = options.batchSize; + const signal = options.signal; + const continueOnError = options.continueOnError; + const aggregatedErrors = []; + const enqueue = asyncQueue(); + let aborted = false; + return new Promise((resolve, reject) => { + if (signal != null) { + if (signal.aborted) { + return resolve(null); + } + signal.addEventListener("abort", () => { + aborted = true; + return resolve(null); + }, { once: true }); + } + if (batchSize != null) { + if (typeof batchSize !== "number") { + throw new TypeError("batchSize must be a number"); + } else if (!Number.isInteger(batchSize)) { + throw new TypeError("batchSize must be an integer"); + } else if (batchSize < 1) { + throw new TypeError("batchSize must be at least 1"); + } + } + iterate((err, res) => { + if (err != null) { + return reject(err); + } + resolve(res); + }); + }); + function iterate(finalCallback) { + let handleResultsInProgress = 0; + let currentDocumentIndex = 0; + let error2 = null; + for (let i4 = 0; i4 < parallel; ++i4) { + enqueue(createFetch()); + } + function createFetch() { + let documentsBatch = []; + let drained = false; + return fetch2; + function fetch2(done) { + if (drained || aborted) { + return done(); + } else if (error2) { + return done(); + } + next(function(err, doc) { + if (error2 != null) { + return done(); + } + if (err != null) { + if (err.name === "MongoCursorExhaustedError") { + doc = null; + } else if (continueOnError) { + aggregatedErrors.push(err); + } else { + error2 = err; + finalCallback(err); + return done(); + } + } + if (doc == null) { + drained = true; + if (handleResultsInProgress <= 0) { + const finalErr = continueOnError ? createEachAsyncMultiError(aggregatedErrors) : error2; + finalCallback(finalErr); + } else if (batchSize && documentsBatch.length) { + handleNextResult(documentsBatch, currentDocumentIndex++, handleNextResultCallBack); + } + return done(); + } + ++handleResultsInProgress; + immediate(() => done()); + if (batchSize) { + documentsBatch.push(doc); + } + if (batchSize && documentsBatch.length !== batchSize) { + immediate(() => enqueue(fetch2)); + return; + } + const docsToProcess = batchSize ? documentsBatch : doc; + function handleNextResultCallBack(err2) { + if (batchSize) { + handleResultsInProgress -= documentsBatch.length; + documentsBatch = []; + } else { + --handleResultsInProgress; + } + if (err2 != null) { + if (continueOnError) { + aggregatedErrors.push(err2); + } else { + error2 = err2; + return finalCallback(err2); + } + } + if ((drained || aborted) && handleResultsInProgress <= 0) { + const finalErr = continueOnError ? createEachAsyncMultiError(aggregatedErrors) : error2; + return finalCallback(finalErr); + } + immediate(() => enqueue(fetch2)); + } + handleNextResult(docsToProcess, currentDocumentIndex++, handleNextResultCallBack); + }); + } + } + } + function handleNextResult(doc, i4, callback) { + let maybePromise; + try { + maybePromise = fn2(doc, i4); + } catch (err) { + return callback(err); + } + if (maybePromise && typeof maybePromise.then === "function") { + maybePromise.then( + function() { + callback(null); + }, + function(error2) { + callback(error2 || new Error("`eachAsync()` promise rejected without error")); + } + ); + } else { + callback(null); + } + } + }; + function asyncQueue() { + const _queue = []; + let inProgress = null; + let id = 0; + return function enqueue(fn2) { + if (inProgress === null && _queue.length === 0) { + inProgress = id++; + return fn2(_step); + } + _queue.push(fn2); + }; + function _step() { + if (_queue.length !== 0) { + inProgress = id++; + const fn2 = _queue.shift(); + fn2(_step); + } else { + inProgress = null; + } + } + } + function createEachAsyncMultiError(aggregatedErrors) { + if (aggregatedErrors.length === 0) { + return null; + } + return new EachAsyncMultiError(aggregatedErrors); + } + } +}); + +// node_modules/mongoose/lib/cursor/queryCursor.js +var require_queryCursor = __commonJS({ + "node_modules/mongoose/lib/cursor/queryCursor.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var Readable = require("stream").Readable; + var eachAsync = require_eachAsync(); + var helpers = require_queryHelpers(); + var kareem = require_kareem(); + var immediate = require_immediate(); + var { once } = require("events"); + var util = require("util"); + function QueryCursor(query) { + Readable.call(this, { autoDestroy: true, objectMode: true }); + this.cursor = null; + this.skipped = false; + this.query = query; + this._closed = false; + const model = query.model; + this._mongooseOptions = {}; + this._transforms = []; + this.model = model; + this.options = {}; + model.hooks.execPre("find", query, (err) => { + if (err != null) { + if (err instanceof kareem.skipWrappedFunction) { + const resultValue = err.args[0]; + if (resultValue != null && (!Array.isArray(resultValue) || resultValue.length)) { + const err2 = new MongooseError( + 'Cannot `skipMiddlewareFunction()` with a value when using `.find().cursor()`, value must be nullish or empty array, got "' + util.inspect(resultValue) + '".' + ); + this._markError(err2); + this.listeners("error").length > 0 && this.emit("error", err2); + return; + } + this.skipped = true; + this.emit("cursor", null); + return; + } + this._markError(err); + this.listeners("error").length > 0 && this.emit("error", err); + return; + } + Object.assign(this.options, query._optionsForExec()); + this._transforms = this._transforms.concat(query._transforms.slice()); + if (this.options.transform) { + this._transforms.push(this.options.transform); + } + if (this.options.batchSize) { + this.options._populateBatchSize = Math.min(this.options.batchSize, 5e3); + } + if (query._mongooseOptions._asyncIterator) { + this._mongooseOptions._asyncIterator = true; + } + if (model.collection._shouldBufferCommands() && model.collection.buffer) { + model.collection.queue.push([ + () => _getRawCursor(query, this) + ]); + } else { + _getRawCursor(query, this); + } + }); + } + util.inherits(QueryCursor, Readable); + function _getRawCursor(query, queryCursor) { + try { + const cursor2 = query.model.collection.find(query._conditions, queryCursor.options); + queryCursor.cursor = cursor2; + queryCursor.emit("cursor", cursor2); + } catch (err) { + queryCursor._markError(err); + queryCursor.listeners("error").length > 0 && queryCursor.emit("error", queryCursor._error); + } + } + QueryCursor.prototype._read = function() { + _next(this, (error2, doc) => { + if (error2) { + return this.emit("error", error2); + } + if (!doc) { + this.push(null); + this.cursor.close(function(error3) { + if (error3) { + return this.emit("error", error3); + } + }); + return; + } + this.push(doc); + }); + }; + QueryCursor.prototype.getDriverCursor = async function getDriverCursor() { + if (this.cursor) { + return this.cursor; + } + await once(this, "cursor"); + return this.cursor; + }; + Object.defineProperty(QueryCursor.prototype, "map", { + value: function(fn2) { + this._transforms.push(fn2); + return this; + }, + enumerable: true, + configurable: true, + writable: true + }); + QueryCursor.prototype._markError = function(error2) { + this._error = error2; + return this; + }; + QueryCursor.prototype.close = async function close() { + if (typeof arguments[0] === "function") { + throw new MongooseError("QueryCursor.prototype.close() no longer accepts a callback"); + } + try { + await this.cursor.close(); + this._closed = true; + this.emit("close"); + } catch (error2) { + this.listeners("error").length > 0 && this.emit("error", error2); + throw error2; + } + }; + QueryCursor.prototype._destroy = function _destroy(_err, callback) { + let waitForCursor = null; + if (!this.cursor) { + waitForCursor = new Promise((resolve) => { + this.once("cursor", resolve); + }); + } else { + waitForCursor = Promise.resolve(); + } + waitForCursor.then(() => { + this.cursor.close(); + }).then(() => { + this._closed = true; + callback(); + }).catch((error2) => { + callback(error2); + }); + return this; + }; + QueryCursor.prototype.rewind = function() { + _waitForCursor(this, () => { + this.cursor.rewind(); + }); + return this; + }; + QueryCursor.prototype.next = async function next() { + if (typeof arguments[0] === "function") { + throw new MongooseError("QueryCursor.prototype.next() no longer accepts a callback"); + } + if (this._closed) { + throw new MongooseError("Cannot call `next()` on a closed cursor"); + } + return new Promise((resolve, reject) => { + _next(this, function(error2, doc) { + if (error2) { + return reject(error2); + } + resolve(doc); + }); + }); + }; + QueryCursor.prototype.eachAsync = function(fn2, opts) { + if (typeof arguments[2] === "function") { + throw new MongooseError("QueryCursor.prototype.eachAsync() no longer accepts a callback"); + } + if (typeof opts === "function") { + opts = {}; + } + opts = opts || {}; + return eachAsync((cb) => _next(this, cb), fn2, opts); + }; + QueryCursor.prototype.options; + QueryCursor.prototype.addCursorFlag = function(flag, value) { + _waitForCursor(this, () => { + this.cursor.addCursorFlag(flag, value); + }); + return this; + }; + if (Symbol.asyncIterator != null) { + QueryCursor.prototype[Symbol.asyncIterator] = function queryCursorAsyncIterator() { + this._mongooseOptions._asyncIterator = true; + return this; + }; + } + function _next(ctx, cb) { + let callback = cb; + callback = function(err, doc) { + if (err) { + return cb(err); + } + if (doc === null) { + if (ctx._mongooseOptions._asyncIterator) { + return cb(null, { done: true }); + } else { + return cb(null, null); + } + } + if (ctx._transforms.length && doc !== null) { + doc = ctx._transforms.reduce(function(doc2, fn2) { + return fn2.call(ctx, doc2); + }, doc); + } + if (ctx._mongooseOptions._asyncIterator) { + return cb(null, { value: doc, done: false }); + } + return cb(null, doc); + }; + if (ctx._error) { + return immediate(function() { + callback(ctx._error); + }); + } + if (ctx.skipped) { + return immediate(() => callback(null, null)); + } + if (ctx.cursor) { + if (ctx.query._mongooseOptions.populate && !ctx._pop) { + ctx._pop = helpers.preparePopulationOptionsMQ( + ctx.query, + ctx.query._mongooseOptions + ); + ctx._pop.__noPromise = true; + } + if (ctx.query._mongooseOptions.populate && ctx.options._populateBatchSize > 1) { + if (ctx._batchDocs && ctx._batchDocs.length) { + return _nextDoc(ctx, ctx._batchDocs.shift(), ctx._pop, callback); + } else if (ctx._batchExhausted) { + return callback(null, null); + } else { + ctx._batchDocs = []; + ctx.cursor.next().then( + (res) => { + _onNext.call({ ctx, callback }, null, res); + }, + (err) => { + _onNext.call({ ctx, callback }, err); + } + ); + return; + } + } else { + return ctx.cursor.next().then( + (doc) => { + if (!doc) { + callback(null, null); + return; + } + if (!ctx.query._mongooseOptions.populate) { + return _nextDoc(ctx, doc, null, callback); + } + _nextDoc(ctx, doc, ctx._pop, (err, doc2) => { + if (err != null) { + return callback(err); + } + ctx.query.model.populate(doc2, ctx._pop).then( + (doc3) => callback(null, doc3), + (err2) => callback(err2) + ); + }); + }, + (error2) => { + callback(error2); + } + ); + } + } else { + ctx.once("error", cb); + ctx.once("cursor", function(cursor2) { + ctx.removeListener("error", cb); + if (cursor2 == null) { + if (ctx.skipped) { + return cb(null, null); + } + return; + } + _next(ctx, cb); + }); + } + } + function _onNext(error2, doc) { + if (error2) { + return this.callback(error2); + } + if (!doc) { + this.ctx._batchExhausted = true; + return _populateBatch.call(this); + } + this.ctx._batchDocs.push(doc); + if (this.ctx._batchDocs.length < this.ctx.options._populateBatchSize) { + immediate(() => this.ctx.cursor.next().then( + (res) => { + _onNext.call(this, null, res); + }, + (err) => { + _onNext.call(this, err); + } + )); + } else { + _populateBatch.call(this); + } + } + function _populateBatch() { + if (!this.ctx._batchDocs.length) { + return this.callback(null, null); + } + this.ctx.query.model.populate(this.ctx._batchDocs, this.ctx._pop).then( + () => { + _nextDoc(this.ctx, this.ctx._batchDocs.shift(), this.ctx._pop, this.callback); + }, + (err) => { + this.callback(err); + } + ); + } + function _nextDoc(ctx, doc, pop, callback) { + if (ctx.query._mongooseOptions.lean) { + return ctx.model.hooks.execPost("find", ctx.query, [[doc]], (err) => { + if (err != null) { + return callback(err); + } + callback(null, doc); + }); + } + const { model, _fields, _userProvidedFields, options } = ctx.query; + helpers.createModelAndInit(model, doc, _fields, _userProvidedFields, options, pop, (err, doc2) => { + if (err != null) { + return callback(err); + } + ctx.model.hooks.execPost("find", ctx.query, [[doc2]], (err2) => { + if (err2 != null) { + return callback(err2); + } + callback(null, doc2); + }); + }); + } + function _waitForCursor(ctx, cb) { + if (ctx.cursor) { + return cb(); + } + ctx.once("cursor", function(cursor2) { + if (cursor2 == null) { + return; + } + cb(); + }); + } + module2.exports = QueryCursor; + } +}); + +// node_modules/mongoose/lib/helpers/query/applyGlobalOption.js +var require_applyGlobalOption = __commonJS({ + "node_modules/mongoose/lib/helpers/query/applyGlobalOption.js"(exports2, module2) { + "use strict"; + var utils = require_utils6(); + function applyGlobalMaxTimeMS(options, connectionOptions, baseOptions) { + applyGlobalOption(options, connectionOptions, baseOptions, "maxTimeMS"); + } + function applyGlobalDiskUse(options, connectionOptions, baseOptions) { + applyGlobalOption(options, connectionOptions, baseOptions, "allowDiskUse"); + } + module2.exports = { + applyGlobalMaxTimeMS, + applyGlobalDiskUse + }; + function applyGlobalOption(options, connectionOptions, baseOptions, optionName) { + if (utils.hasUserDefinedProperty(options, optionName)) { + return; + } + if (utils.hasUserDefinedProperty(connectionOptions, optionName)) { + options[optionName] = connectionOptions[optionName]; + } else if (utils.hasUserDefinedProperty(baseOptions, optionName)) { + options[optionName] = baseOptions[optionName]; + } + } + } +}); + +// node_modules/mongoose/lib/helpers/schema/applyReadConcern.js +var require_applyReadConcern = __commonJS({ + "node_modules/mongoose/lib/helpers/schema/applyReadConcern.js"(exports2, module2) { + "use strict"; + module2.exports = function applyReadConcern(schema, options) { + if (options.readConcern !== void 0) { + return; + } + if (options && options.session && options.session.transaction) { + return; + } + const level = schema.options?.readConcern?.level; + if (level != null) { + options.readConcern = { level }; + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js +var require_applyWriteConcern = __commonJS({ + "node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js"(exports2, module2) { + "use strict"; + module2.exports = function applyWriteConcern(schema, options) { + if (options.writeConcern != null) { + return; + } + if (options && options.session && options.session.transaction) { + return; + } + const writeConcern = schema.options.writeConcern ?? {}; + if (Object.keys(writeConcern).length != 0) { + options.writeConcern = {}; + if (!("w" in options) && writeConcern.w != null) { + options.writeConcern.w = writeConcern.w; + } + if (!("j" in options) && writeConcern.j != null) { + options.writeConcern.j = writeConcern.j; + } + if (!("wtimeout" in options) && writeConcern.wtimeout != null) { + options.writeConcern.wtimeout = writeConcern.wtimeout; + } + } else { + if (!("w" in options) && writeConcern.w != null) { + options.w = writeConcern.w; + } + if (!("j" in options) && writeConcern.j != null) { + options.j = writeConcern.j; + } + if (!("wtimeout" in options) && writeConcern.wtimeout != null) { + options.wtimeout = writeConcern.wtimeout; + } + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/query/castFilterPath.js +var require_castFilterPath = __commonJS({ + "node_modules/mongoose/lib/helpers/query/castFilterPath.js"(exports2, module2) { + "use strict"; + var isOperator = require_isOperator(); + module2.exports = function castFilterPath(ctx, schematype, val) { + const any$conditionals = Object.keys(val).some(isOperator); + if (!any$conditionals) { + return schematype.castForQuery( + null, + val, + ctx + ); + } + const ks = Object.keys(val); + let k4 = ks.length; + while (k4--) { + const $cond = ks[k4]; + const nested = val[$cond]; + if ($cond === "$not") { + if (nested && schematype && !schematype.caster) { + const _keys = Object.keys(nested); + if (_keys.length && isOperator(_keys[0])) { + for (const key of Object.keys(nested)) { + nested[key] = schematype.castForQuery( + key, + nested[key], + ctx + ); + } + } else { + val[$cond] = schematype.castForQuery( + $cond, + nested, + ctx + ); + } + continue; + } + } else { + val[$cond] = schematype.castForQuery( + $cond, + nested, + ctx + ); + } + } + return val; + }; + } +}); + +// node_modules/mongoose/lib/helpers/schema/getPath.js +var require_getPath = __commonJS({ + "node_modules/mongoose/lib/helpers/schema/getPath.js"(exports2, module2) { + "use strict"; + var numberRE = /^\d+$/; + module2.exports = function getPath(schema, path, discriminatorValueMap) { + let schematype = schema.path(path); + if (schematype != null) { + return schematype; + } + const pieces = path.split("."); + let cur = ""; + let isArray = false; + for (const piece of pieces) { + if (isArray && numberRE.test(piece)) { + continue; + } + cur = cur.length === 0 ? piece : cur + "." + piece; + schematype = schema.path(cur); + if (schematype?.schema) { + schema = schematype.schema; + if (!isArray && schematype.$isMongooseDocumentArray) { + isArray = true; + } + if (discriminatorValueMap && discriminatorValueMap[cur]) { + schema = schema.discriminators[discriminatorValueMap[cur]] ?? schema; + } + cur = ""; + } else if (schematype?.instance === "Mixed") { + break; + } + } + return schematype; + }; + } +}); + +// node_modules/mongoose/lib/helpers/update/castArrayFilters.js +var require_castArrayFilters = __commonJS({ + "node_modules/mongoose/lib/helpers/update/castArrayFilters.js"(exports2, module2) { + "use strict"; + var castFilterPath = require_castFilterPath(); + var cleanPositionalOperators = require_cleanPositionalOperators(); + var getPath = require_getPath(); + var updatedPathsByArrayFilter = require_updatedPathsByArrayFilter(); + module2.exports = function castArrayFilters(query) { + const arrayFilters = query.options.arrayFilters; + if (!Array.isArray(arrayFilters)) { + return; + } + const update = query.getUpdate(); + const schema = query.schema; + const updatedPathsByFilter = updatedPathsByArrayFilter(update); + let strictQuery = schema.options.strict; + if (query._mongooseOptions.strict != null) { + strictQuery = query._mongooseOptions.strict; + } + if (query.model && query.model.base.options.strictQuery != null) { + strictQuery = query.model.base.options.strictQuery; + } + if (schema._userProvidedOptions.strictQuery != null) { + strictQuery = schema._userProvidedOptions.strictQuery; + } + if (query._mongooseOptions.strictQuery != null) { + strictQuery = query._mongooseOptions.strictQuery; + } + _castArrayFilters(arrayFilters, schema, strictQuery, updatedPathsByFilter, query); + }; + function _castArrayFilters(arrayFilters, schema, strictQuery, updatedPathsByFilter, query) { + const discriminatorValueMap = {}; + for (const filter of arrayFilters) { + if (filter == null) { + throw new Error(`Got null array filter in ${arrayFilters}`); + } + const keys = Object.keys(filter).filter((key) => filter[key] != null); + if (keys.length === 0) { + continue; + } + const firstKey = keys[0]; + if (firstKey === "$and" || firstKey === "$or") { + for (const key of keys) { + _castArrayFilters(filter[key], schema, strictQuery, updatedPathsByFilter, query); + } + continue; + } + const dot = firstKey.indexOf("."); + const filterWildcardPath = dot === -1 ? firstKey : firstKey.substring(0, dot); + if (updatedPathsByFilter[filterWildcardPath] == null) { + continue; + } + const baseFilterPath = cleanPositionalOperators( + updatedPathsByFilter[filterWildcardPath] + ); + const baseSchematype = getPath(schema, baseFilterPath, discriminatorValueMap); + let filterBaseSchema = baseSchematype != null ? baseSchematype.schema : null; + if (filterBaseSchema != null && filterBaseSchema.discriminators != null && filter[filterWildcardPath + "." + filterBaseSchema.options.discriminatorKey]) { + filterBaseSchema = filterBaseSchema.discriminators[filter[filterWildcardPath + "." + filterBaseSchema.options.discriminatorKey]] || filterBaseSchema; + discriminatorValueMap[baseFilterPath] = filter[filterWildcardPath + "." + filterBaseSchema.options.discriminatorKey]; + } + for (const key of keys) { + if (updatedPathsByFilter[key] === null) { + continue; + } + if (Object.keys(updatedPathsByFilter).length === 0) { + continue; + } + const dot2 = key.indexOf("."); + let filterPathRelativeToBase = dot2 === -1 ? null : key.substring(dot2); + let schematype; + if (filterPathRelativeToBase == null || filterBaseSchema == null) { + schematype = baseSchematype; + } else { + filterPathRelativeToBase = cleanPositionalOperators(filterPathRelativeToBase); + schematype = getPath(filterBaseSchema, filterPathRelativeToBase, discriminatorValueMap); + } + if (schematype == null) { + if (!strictQuery) { + return; + } + const filterPath = filterPathRelativeToBase == null ? baseFilterPath + ".0" : baseFilterPath + ".0" + filterPathRelativeToBase; + throw new Error(`Could not find path "${filterPath}" in schema`); + } + if (typeof filter[key] === "object") { + filter[key] = castFilterPath(query, schematype, filter[key]); + } else { + filter[key] = schematype.castForQuery(null, filter[key]); + } + } + } + } + } +}); + +// node_modules/mongoose/lib/helpers/projection/isInclusive.js +var require_isInclusive = __commonJS({ + "node_modules/mongoose/lib/helpers/projection/isInclusive.js"(exports2, module2) { + "use strict"; + var isDefiningProjection = require_isDefiningProjection(); + var isPOJO = require_isPOJO(); + module2.exports = function isInclusive(projection) { + if (projection == null) { + return false; + } + const props = Object.keys(projection); + const numProps = props.length; + if (numProps === 0) { + return false; + } + for (let i4 = 0; i4 < numProps; ++i4) { + const prop = props[i4]; + if (prop.startsWith("+")) { + continue; + } + if (isDefiningProjection(projection[prop]) && !!projection[prop]) { + if (isPOJO(projection[prop])) { + return isInclusive(projection[prop]); + } else { + return !!projection[prop]; + } + } + } + return false; + }; + } +}); + +// node_modules/mongoose/lib/helpers/projection/isSubpath.js +var require_isSubpath = __commonJS({ + "node_modules/mongoose/lib/helpers/projection/isSubpath.js"(exports2, module2) { + "use strict"; + module2.exports = function isSubpath(path1, path2) { + return path1 === path2 || path2.startsWith(path1 + "."); + }; + } +}); + +// node_modules/mquery/lib/utils.js +var require_utils7 = __commonJS({ + "node_modules/mquery/lib/utils.js"(exports2) { + "use strict"; + var specialProperties = ["__proto__", "constructor", "prototype"]; + var clone = exports2.clone = function clone2(obj, options) { + if (obj === void 0 || obj === null) + return obj; + if (Array.isArray(obj)) + return exports2.cloneArray(obj, options); + if (obj.constructor) { + if (/ObjectI[dD]$/.test(obj.constructor.name)) { + return "function" == typeof obj.clone ? obj.clone() : new obj.constructor(obj.id); + } + if (obj.constructor.name === "ReadPreference") { + return new obj.constructor(obj.mode, clone2(obj.tags, options)); + } + if ("Binary" == obj._bsontype && obj.buffer && obj.value) { + return "function" == typeof obj.clone ? obj.clone() : new obj.constructor(obj.value(true), obj.sub_type); + } + if ("Date" === obj.constructor.name || "Function" === obj.constructor.name) + return new obj.constructor(+obj); + if ("RegExp" === obj.constructor.name) + return new RegExp(obj); + if ("Buffer" === obj.constructor.name) + return Buffer.from(obj); + } + if (isObject(obj)) + return exports2.cloneObject(obj, options); + if (obj.valueOf) + return obj.valueOf(); + }; + exports2.cloneObject = function cloneObject(obj, options) { + const minimize = options && options.minimize, ret = {}, keys = Object.keys(obj), len = keys.length; + let hasKeys = false, val, k4 = "", i4 = 0; + for (i4 = 0; i4 < len; ++i4) { + k4 = keys[i4]; + if (specialProperties.indexOf(k4) !== -1) { + continue; + } + val = clone(obj[k4], options); + if (!minimize || "undefined" !== typeof val) { + hasKeys || (hasKeys = true); + ret[k4] = val; + } + } + return minimize ? hasKeys && ret : ret; + }; + exports2.cloneArray = function cloneArray(arr, options) { + const ret = [], l4 = arr.length; + let i4 = 0; + for (; i4 < l4; i4++) + ret.push(clone(arr[i4], options)); + return ret; + }; + exports2.merge = function merge(to, from) { + const keys = Object.keys(from); + for (const key of keys) { + if (specialProperties.indexOf(key) !== -1) { + continue; + } + if ("undefined" === typeof to[key]) { + to[key] = from[key]; + } else { + if (exports2.isObject(from[key])) { + merge(to[key], from[key]); + } else { + to[key] = from[key]; + } + } + } + }; + exports2.mergeClone = function mergeClone(to, from) { + const keys = Object.keys(from); + for (const key of keys) { + if (specialProperties.indexOf(key) !== -1) { + continue; + } + if ("undefined" === typeof to[key]) { + to[key] = clone(from[key]); + } else { + if (exports2.isObject(from[key])) { + mergeClone(to[key], from[key]); + } else { + to[key] = clone(from[key]); + } + } + } + }; + exports2.readPref = function readPref(pref) { + switch (pref) { + case "p": + pref = "primary"; + break; + case "pp": + pref = "primaryPreferred"; + break; + case "s": + pref = "secondary"; + break; + case "sp": + pref = "secondaryPreferred"; + break; + case "n": + pref = "nearest"; + break; + } + return pref; + }; + exports2.readConcern = function readConcern(concern) { + if ("string" === typeof concern) { + switch (concern) { + case "l": + concern = "local"; + break; + case "a": + concern = "available"; + break; + case "m": + concern = "majority"; + break; + case "lz": + concern = "linearizable"; + break; + case "s": + concern = "snapshot"; + break; + } + concern = { level: concern }; + } + return concern; + }; + var _toString = Object.prototype.toString; + exports2.toString = function(arg) { + return _toString.call(arg); + }; + var isObject = exports2.isObject = function(arg) { + return "[object Object]" == exports2.toString(arg); + }; + exports2.keys = Object.keys; + exports2.create = "function" == typeof Object.create ? Object.create : create; + function create(proto) { + if (arguments.length > 1) { + throw new Error("Adding properties is not supported"); + } + function F2() { + } + F2.prototype = proto; + return new F2(); + } + exports2.inherits = function(ctor, superCtor) { + ctor.prototype = exports2.create(superCtor.prototype); + ctor.prototype.constructor = ctor; + }; + exports2.isArgumentsObject = function(v4) { + return Object.prototype.toString.call(v4) === "[object Arguments]"; + }; + } +}); + +// node_modules/mquery/node_modules/ms/index.js +var require_ms3 = __commonJS({ + "node_modules/mquery/node_modules/ms/index.js"(exports2, module2) { + var s4 = 1e3; + var m4 = s4 * 60; + var h4 = m4 * 60; + var d4 = h4 * 24; + var w4 = d4 * 7; + var y2 = d4 * 365.25; + module2.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === "string" && val.length > 0) { + return parse(val); + } else if (type === "number" && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) + ); + }; + function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n4 = parseFloat(match[1]); + var type = (match[2] || "ms").toLowerCase(); + switch (type) { + case "years": + case "year": + case "yrs": + case "yr": + case "y": + return n4 * y2; + case "weeks": + case "week": + case "w": + return n4 * w4; + case "days": + case "day": + case "d": + return n4 * d4; + case "hours": + case "hour": + case "hrs": + case "hr": + case "h": + return n4 * h4; + case "minutes": + case "minute": + case "mins": + case "min": + case "m": + return n4 * m4; + case "seconds": + case "second": + case "secs": + case "sec": + case "s": + return n4 * s4; + case "milliseconds": + case "millisecond": + case "msecs": + case "msec": + case "ms": + return n4; + default: + return void 0; + } + } + function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d4) { + return Math.round(ms / d4) + "d"; + } + if (msAbs >= h4) { + return Math.round(ms / h4) + "h"; + } + if (msAbs >= m4) { + return Math.round(ms / m4) + "m"; + } + if (msAbs >= s4) { + return Math.round(ms / s4) + "s"; + } + return ms + "ms"; + } + function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d4) { + return plural(ms, msAbs, d4, "day"); + } + if (msAbs >= h4) { + return plural(ms, msAbs, h4, "hour"); + } + if (msAbs >= m4) { + return plural(ms, msAbs, m4, "minute"); + } + if (msAbs >= s4) { + return plural(ms, msAbs, s4, "second"); + } + return ms + " ms"; + } + function plural(ms, msAbs, n4, name) { + var isPlural = msAbs >= n4 * 1.5; + return Math.round(ms / n4) + " " + name + (isPlural ? "s" : ""); + } + } +}); + +// node_modules/mquery/node_modules/debug/src/common.js +var require_common5 = __commonJS({ + "node_modules/mquery/node_modules/debug/src/common.js"(exports2, module2) { + function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require_ms3(); + createDebug.destroy = destroy; + Object.keys(env).forEach((key) => { + createDebug[key] = env[key]; + }); + createDebug.names = []; + createDebug.skips = []; + createDebug.formatters = {}; + function selectColor(namespace) { + let hash = 0; + for (let i4 = 0; i4 < namespace.length; i4++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i4); + hash |= 0; + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug(...args2) { + if (!debug.enabled) { + return; + } + const self2 = debug; + const curr = Number(/* @__PURE__ */ new Date()); + const ms = curr - (prevTime || curr); + self2.diff = ms; + self2.prev = prevTime; + self2.curr = curr; + prevTime = curr; + args2[0] = createDebug.coerce(args2[0]); + if (typeof args2[0] !== "string") { + args2.unshift("%O"); + } + let index = 0; + args2[0] = args2[0].replace(/%([a-zA-Z%])/g, (match, format2) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format2]; + if (typeof formatter === "function") { + const val = args2[index]; + match = formatter.call(self2, val); + args2.splice(index, 1); + index--; + } + return match; + }); + createDebug.formatArgs.call(self2, args2); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args2); + } + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; + Object.defineProperty(debug, "enabled", { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + return enabledCache; + }, + set: (v4) => { + enableOverride = v4; + } + }); + if (typeof createDebug.init === "function") { + createDebug.init(debug); + } + return debug; + } + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + createDebug.names = []; + createDebug.skips = []; + const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); + for (const ns of split) { + if (ns[0] === "-") { + createDebug.skips.push(ns.slice(1)); + } else { + createDebug.names.push(ns); + } + } + } + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { + if (template[templateIndex] === "*") { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; + } else { + searchIndex++; + templateIndex++; + } + } else if (starIndex !== -1) { + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; + } else { + return false; + } + } + while (templateIndex < template.length && template[templateIndex] === "*") { + templateIndex++; + } + return templateIndex === template.length; + } + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map((namespace) => "-" + namespace) + ].join(","); + createDebug.enable(""); + return namespaces; + } + function enabled(name) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { + return false; + } + } + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { + return true; + } + } + return false; + } + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + function destroy() { + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + } + createDebug.enable(createDebug.load()); + return createDebug; + } + module2.exports = setup; + } +}); + +// node_modules/mquery/node_modules/debug/src/browser.js +var require_browser2 = __commonJS({ + "node_modules/mquery/node_modules/debug/src/browser.js"(exports2, module2) { + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load; + exports2.useColors = useColors; + exports2.storage = localstorage(); + exports2.destroy = /* @__PURE__ */ (() => { + let warned = false; + return () => { + if (!warned) { + warned = true; + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + } + }; + })(); + exports2.colors = [ + "#0000CC", + "#0000FF", + "#0033CC", + "#0033FF", + "#0066CC", + "#0066FF", + "#0099CC", + "#0099FF", + "#00CC00", + "#00CC33", + "#00CC66", + "#00CC99", + "#00CCCC", + "#00CCFF", + "#3300CC", + "#3300FF", + "#3333CC", + "#3333FF", + "#3366CC", + "#3366FF", + "#3399CC", + "#3399FF", + "#33CC00", + "#33CC33", + "#33CC66", + "#33CC99", + "#33CCCC", + "#33CCFF", + "#6600CC", + "#6600FF", + "#6633CC", + "#6633FF", + "#66CC00", + "#66CC33", + "#9900CC", + "#9900FF", + "#9933CC", + "#9933FF", + "#99CC00", + "#99CC33", + "#CC0000", + "#CC0033", + "#CC0066", + "#CC0099", + "#CC00CC", + "#CC00FF", + "#CC3300", + "#CC3333", + "#CC3366", + "#CC3399", + "#CC33CC", + "#CC33FF", + "#CC6600", + "#CC6633", + "#CC9900", + "#CC9933", + "#CCCC00", + "#CCCC33", + "#FF0000", + "#FF0033", + "#FF0066", + "#FF0099", + "#FF00CC", + "#FF00FF", + "#FF3300", + "#FF3333", + "#FF3366", + "#FF3399", + "#FF33CC", + "#FF33FF", + "#FF6600", + "#FF6633", + "#FF9900", + "#FF9933", + "#FFCC00", + "#FFCC33" + ]; + function useColors() { + if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { + return true; + } + if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + let m4; + return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== "undefined" && navigator.userAgent && (m4 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m4[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker + typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); + } + function formatArgs(args2) { + args2[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args2[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); + if (!this.useColors) { + return; + } + const c4 = "color: " + this.color; + args2.splice(1, 0, c4, "color: inherit"); + let index = 0; + let lastC = 0; + args2[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } + }); + args2.splice(lastC, 0, c4); + } + exports2.log = console.debug || console.log || (() => { + }); + function save(namespaces) { + try { + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error2) { + } + } + function load() { + let r4; + try { + r4 = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); + } catch (error2) { + } + if (!r4 && typeof process !== "undefined" && "env" in process) { + r4 = process.env.DEBUG; + } + return r4; + } + function localstorage() { + try { + return localStorage; + } catch (error2) { + } + } + module2.exports = require_common5()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v4) { + try { + return JSON.stringify(v4); + } catch (error2) { + return "[UnexpectedJSONParseError]: " + error2.message; + } + }; + } +}); + +// node_modules/has-flag/index.js +var require_has_flag = __commonJS({ + "node_modules/has-flag/index.js"(exports2, module2) { + "use strict"; + module2.exports = (flag, argv) => { + argv = argv || process.argv; + const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; + const pos = argv.indexOf(prefix + flag); + const terminatorPos = argv.indexOf("--"); + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); + }; + } +}); + +// node_modules/supports-color/index.js +var require_supports_color = __commonJS({ + "node_modules/supports-color/index.js"(exports2, module2) { + "use strict"; + var os = require("os"); + var hasFlag = require_has_flag(); + var env = process.env; + var forceColor; + if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) { + forceColor = false; + } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + forceColor = true; + } + if ("FORCE_COLOR" in env) { + forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; + } + function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; + } + function supportsColor(stream) { + if (forceColor === false) { + return 0; + } + if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + return 3; + } + if (hasFlag("color=256")) { + return 2; + } + if (stream && !stream.isTTY && forceColor !== true) { + return 0; + } + const min = forceColor ? 1 : 0; + if (process.platform === "win32") { + const osRelease = os.release().split("."); + if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + return 1; + } + if ("CI" in env) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + return 1; + } + return min; + } + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + if (env.COLORTERM === "truecolor") { + return 3; + } + if ("TERM_PROGRAM" in env) { + const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env.TERM_PROGRAM) { + case "iTerm.app": + return version >= 3 ? 3 : 2; + case "Apple_Terminal": + return 2; + } + } + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + if ("COLORTERM" in env) { + return 1; + } + if (env.TERM === "dumb") { + return min; + } + return min; + } + function getSupportLevel(stream) { + const level = supportsColor(stream); + return translateLevel(level); + } + module2.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr) + }; + } +}); + +// node_modules/mquery/node_modules/debug/src/node.js +var require_node3 = __commonJS({ + "node_modules/mquery/node_modules/debug/src/node.js"(exports2, module2) { + var tty = require("tty"); + var util = require("util"); + exports2.init = init; + exports2.log = log2; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load; + exports2.useColors = useColors; + exports2.destroy = util.deprecate( + () => { + }, + "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." + ); + exports2.colors = [6, 2, 3, 4, 5, 1]; + try { + const supportsColor = require_supports_color(); + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports2.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } + } catch (error2) { + } + exports2.inspectOpts = Object.keys(process.env).filter((key) => { + return /^debug_/i.test(key); + }).reduce((obj, key) => { + const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k4) => { + return k4.toUpperCase(); + }); + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === "null") { + val = null; + } else { + val = Number(val); + } + obj[prop] = val; + return obj; + }, {}); + function useColors() { + return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd); + } + function formatArgs(args2) { + const { namespace: name, useColors: useColors2 } = this; + if (useColors2) { + const c4 = this.color; + const colorCode = "\x1B[3" + (c4 < 8 ? c4 : "8;5;" + c4); + const prefix = ` ${colorCode};1m${name} \x1B[0m`; + args2[0] = prefix + args2[0].split("\n").join("\n" + prefix); + args2.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); + } else { + args2[0] = getDate() + name + " " + args2[0]; + } + } + function getDate() { + if (exports2.inspectOpts.hideDate) { + return ""; + } + return (/* @__PURE__ */ new Date()).toISOString() + " "; + } + function log2(...args2) { + return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args2) + "\n"); + } + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + delete process.env.DEBUG; + } + } + function load() { + return process.env.DEBUG; + } + function init(debug) { + debug.inspectOpts = {}; + const keys = Object.keys(exports2.inspectOpts); + for (let i4 = 0; i4 < keys.length; i4++) { + debug.inspectOpts[keys[i4]] = exports2.inspectOpts[keys[i4]]; + } + } + module2.exports = require_common5()(exports2); + var { formatters } = module2.exports; + formatters.o = function(v4) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v4, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); + }; + formatters.O = function(v4) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v4, this.inspectOpts); + }; + } +}); + +// node_modules/mquery/node_modules/debug/src/index.js +var require_src2 = __commonJS({ + "node_modules/mquery/node_modules/debug/src/index.js"(exports2, module2) { + if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { + module2.exports = require_browser2(); + } else { + module2.exports = require_node3(); + } + } +}); + +// node_modules/mquery/lib/permissions.js +var require_permissions = __commonJS({ + "node_modules/mquery/lib/permissions.js"(exports2) { + "use strict"; + var denied = exports2; + denied.distinct = function(self2) { + if (self2._fields && Object.keys(self2._fields).length > 0) { + return "field selection and slice"; + } + const keys = Object.keys(denied.distinct); + let err; + keys.every(function(option) { + if (self2.options[option]) { + err = option; + return false; + } + return true; + }); + return err; + }; + denied.distinct.select = denied.distinct.slice = denied.distinct.sort = denied.distinct.limit = denied.distinct.skip = denied.distinct.batchSize = denied.distinct.hint = denied.distinct.tailable = true; + denied.findOneAndUpdate = denied.findOneAndRemove = function(self2) { + const keys = Object.keys(denied.findOneAndUpdate); + let err; + keys.every(function(option) { + if (self2.options[option]) { + err = option; + return false; + } + return true; + }); + return err; + }; + denied.findOneAndUpdate.limit = denied.findOneAndUpdate.skip = denied.findOneAndUpdate.batchSize = denied.findOneAndUpdate.tailable = true; + denied.count = function(self2) { + if (self2._fields && Object.keys(self2._fields).length > 0) { + return "field selection and slice"; + } + const keys = Object.keys(denied.count); + let err; + keys.every(function(option) { + if (self2.options[option]) { + err = option; + return false; + } + return true; + }); + return err; + }; + denied.count.slice = denied.count.batchSize = denied.count.tailable = true; + } +}); + +// node_modules/mquery/lib/env.js +var require_env = __commonJS({ + "node_modules/mquery/lib/env.js"(exports2, module2) { + "use strict"; + exports2.isNode = "undefined" != typeof process && "object" == typeof module2 && "object" == typeof global && "function" == typeof Buffer && process.argv; + exports2.isMongo = !exports2.isNode && "function" == typeof printjson && "function" == typeof ObjectId && "function" == typeof rs && "function" == typeof sh; + exports2.isBrowser = !exports2.isNode && !exports2.isMongo && "undefined" != typeof window; + exports2.type = exports2.isNode ? "node" : exports2.isMongo ? "mongo" : exports2.isBrowser ? "browser" : "unknown"; + } +}); + +// node_modules/mquery/lib/collection/collection.js +var require_collection4 = __commonJS({ + "node_modules/mquery/lib/collection/collection.js"(exports2, module2) { + "use strict"; + var methods = [ + "find", + "findOne", + "updateMany", + "updateOne", + "replaceOne", + "count", + "distinct", + "findOneAndDelete", + "findOneAndUpdate", + "aggregate", + "findCursor", + "deleteOne", + "deleteMany" + ]; + function Collection() { + } + for (let i4 = 0, len = methods.length; i4 < len; ++i4) { + const method = methods[i4]; + Collection.prototype[method] = notImplemented(method); + } + module2.exports = exports2 = Collection; + Collection.methods = methods; + function notImplemented(method) { + return function() { + throw new Error("collection." + method + " not implemented"); + }; + } + } +}); + +// node_modules/mquery/lib/collection/node.js +var require_node4 = __commonJS({ + "node_modules/mquery/lib/collection/node.js"(exports2, module2) { + "use strict"; + var Collection = require_collection4(); + var NodeCollection = class extends Collection { + constructor(col) { + super(); + this.collection = col; + this.collectionName = col.collectionName; + } + /** + * find(match, options) + */ + async find(match, options) { + const cursor2 = this.collection.find(match, options); + return cursor2.toArray(); + } + /** + * findOne(match, options) + */ + async findOne(match, options) { + return this.collection.findOne(match, options); + } + /** + * count(match, options) + */ + async count(match, options) { + return this.collection.count(match, options); + } + /** + * distinct(prop, match, options) + */ + async distinct(prop, match, options) { + return this.collection.distinct(prop, match, options); + } + /** + * updateMany(match, update, options) + */ + async updateMany(match, update, options) { + return this.collection.updateMany(match, update, options); + } + /** + * updateOne(match, update, options) + */ + async updateOne(match, update, options) { + return this.collection.updateOne(match, update, options); + } + /** + * replaceOne(match, update, options) + */ + async replaceOne(match, update, options) { + return this.collection.replaceOne(match, update, options); + } + /** + * deleteOne(match, options) + */ + async deleteOne(match, options) { + return this.collection.deleteOne(match, options); + } + /** + * deleteMany(match, options) + */ + async deleteMany(match, options) { + return this.collection.deleteMany(match, options); + } + /** + * findOneAndDelete(match, options, function(err[, result]) + */ + async findOneAndDelete(match, options) { + return this.collection.findOneAndDelete(match, options); + } + /** + * findOneAndUpdate(match, update, options) + */ + async findOneAndUpdate(match, update, options) { + return this.collection.findOneAndUpdate(match, update, options); + } + /** + * var cursor = findCursor(match, options) + */ + findCursor(match, options) { + return this.collection.find(match, options); + } + /** + * aggregation(operators...) + * TODO + */ + }; + module2.exports = exports2 = NodeCollection; + } +}); + +// node_modules/mquery/lib/collection/index.js +var require_collection5 = __commonJS({ + "node_modules/mquery/lib/collection/index.js"(exports2, module2) { + "use strict"; + var env = require_env(); + if ("unknown" == env.type) { + throw new Error("Unknown environment"); + } + module2.exports = env.isNode ? require_node4() : env.isMongo ? require_collection4() : require_collection4(); + } +}); + +// node_modules/mquery/lib/mquery.js +var require_mquery = __commonJS({ + "node_modules/mquery/lib/mquery.js"(exports2, module2) { + "use strict"; + var assert = require("assert"); + var util = require("util"); + var utils = require_utils7(); + var debug = require_src2()("mquery"); + function Query(criteria, options) { + if (!(this instanceof Query)) + return new Query(criteria, options); + const proto = this.constructor.prototype; + this.op = proto.op || void 0; + this.options = Object.assign({}, proto.options); + this._conditions = proto._conditions ? utils.clone(proto._conditions) : {}; + this._fields = proto._fields ? utils.clone(proto._fields) : void 0; + this._updateDoc = proto._updateDoc ? utils.clone(proto._updateDoc) : void 0; + this._path = proto._path || void 0; + this._distinctDoc = proto._distinctDoc || void 0; + this._collection = proto._collection || void 0; + this._traceFunction = proto._traceFunction || void 0; + if (options) { + this.setOptions(options); + } + if (criteria) { + this.find(criteria); + } + } + var $withinCmd = "$geoWithin"; + Object.defineProperty(Query, "use$geoWithin", { + get: function() { + return $withinCmd == "$geoWithin"; + }, + set: function(v4) { + if (true === v4) { + $withinCmd = "$geoWithin"; + } else { + $withinCmd = "$within"; + } + } + }); + Query.prototype.toConstructor = function toConstructor() { + function CustomQuery(criteria, options) { + if (!(this instanceof CustomQuery)) + return new CustomQuery(criteria, options); + Query.call(this, criteria, options); + } + utils.inherits(CustomQuery, Query); + const p4 = CustomQuery.prototype; + p4.options = {}; + p4.setOptions(this.options); + p4.op = this.op; + p4._conditions = utils.clone(this._conditions); + p4._fields = utils.clone(this._fields); + p4._updateDoc = utils.clone(this._updateDoc); + p4._path = this._path; + p4._distinctDoc = this._distinctDoc; + p4._collection = this._collection; + p4._traceFunction = this._traceFunction; + return CustomQuery; + }; + Query.prototype.setOptions = function(options) { + if (!(options && utils.isObject(options))) + return this; + const methods = utils.keys(options); + let method; + for (let i4 = 0; i4 < methods.length; ++i4) { + method = methods[i4]; + if ("function" == typeof this[method]) { + const args2 = Array.isArray(options[method]) ? options[method] : [options[method]]; + this[method].apply(this, args2); + } else { + this.options[method] = options[method]; + } + } + return this; + }; + Query.prototype.collection = function collection(coll) { + this._collection = new Query.Collection(coll); + return this; + }; + Query.prototype.collation = function(value) { + this.options.collation = value; + return this; + }; + Query.prototype.$where = function(js) { + this._conditions.$where = js; + return this; + }; + Query.prototype.where = function() { + if (!arguments.length) return this; + if (!this.op) this.op = "find"; + const type = typeof arguments[0]; + if ("string" == type) { + this._path = arguments[0]; + if (2 === arguments.length) { + this._conditions[this._path] = arguments[1]; + } + return this; + } + if ("object" == type && !Array.isArray(arguments[0])) { + return this.merge(arguments[0]); + } + throw new TypeError("path must be a string or object"); + }; + Query.prototype.equals = function equals(val) { + this._ensurePath("equals"); + const path = this._path; + this._conditions[path] = val; + return this; + }; + Query.prototype.eq = function eq(val) { + this._ensurePath("eq"); + const path = this._path; + this._conditions[path] = val; + return this; + }; + Query.prototype.or = function or(array) { + const or2 = this._conditions.$or || (this._conditions.$or = []); + if (!Array.isArray(array)) array = [array]; + or2.push.apply(or2, array); + return this; + }; + Query.prototype.nor = function nor(array) { + const nor2 = this._conditions.$nor || (this._conditions.$nor = []); + if (!Array.isArray(array)) array = [array]; + nor2.push.apply(nor2, array); + return this; + }; + Query.prototype.and = function and(array) { + const and2 = this._conditions.$and || (this._conditions.$and = []); + if (!Array.isArray(array)) array = [array]; + and2.push.apply(and2, array); + return this; + }; + "gt gte lt lte ne in nin all regex size maxDistance minDistance".split(" ").forEach(function($conditional) { + Query.prototype[$conditional] = function() { + let path, val; + if (1 === arguments.length) { + this._ensurePath($conditional); + val = arguments[0]; + path = this._path; + } else { + val = arguments[1]; + path = arguments[0]; + } + const conds = this._conditions[path] === null || typeof this._conditions[path] === "object" ? this._conditions[path] : this._conditions[path] = {}; + conds["$" + $conditional] = val; + return this; + }; + }); + Query.prototype.mod = function() { + let val, path; + if (1 === arguments.length) { + this._ensurePath("mod"); + val = arguments[0]; + path = this._path; + } else if (2 === arguments.length && !Array.isArray(arguments[1])) { + this._ensurePath("mod"); + val = [arguments[0], arguments[1]]; + path = this._path; + } else if (3 === arguments.length) { + val = [arguments[1], arguments[2]]; + path = arguments[0]; + } else { + val = arguments[1]; + path = arguments[0]; + } + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds.$mod = val; + return this; + }; + Query.prototype.exists = function() { + let path, val; + if (0 === arguments.length) { + this._ensurePath("exists"); + path = this._path; + val = true; + } else if (1 === arguments.length) { + if ("boolean" === typeof arguments[0]) { + this._ensurePath("exists"); + path = this._path; + val = arguments[0]; + } else { + path = arguments[0]; + val = true; + } + } else if (2 === arguments.length) { + path = arguments[0]; + val = arguments[1]; + } + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds.$exists = val; + return this; + }; + Query.prototype.elemMatch = function() { + if (null == arguments[0]) + throw new TypeError("Invalid argument"); + let fn2, path, criteria; + if ("function" === typeof arguments[0]) { + this._ensurePath("elemMatch"); + path = this._path; + fn2 = arguments[0]; + } else if (utils.isObject(arguments[0])) { + this._ensurePath("elemMatch"); + path = this._path; + criteria = arguments[0]; + } else if ("function" === typeof arguments[1]) { + path = arguments[0]; + fn2 = arguments[1]; + } else if (arguments[1] && utils.isObject(arguments[1])) { + path = arguments[0]; + criteria = arguments[1]; + } else { + throw new TypeError("Invalid argument"); + } + if (fn2) { + criteria = new Query(); + fn2(criteria); + criteria = criteria._conditions; + } + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds.$elemMatch = criteria; + return this; + }; + Query.prototype.within = function within() { + this._ensurePath("within"); + this._geoComparison = $withinCmd; + if (0 === arguments.length) { + return this; + } + if (2 === arguments.length) { + return this.box.apply(this, arguments); + } else if (2 < arguments.length) { + return this.polygon.apply(this, arguments); + } + const area = arguments[0]; + if (!area) + throw new TypeError("Invalid argument"); + if (area.center) + return this.circle(area); + if (area.box) + return this.box.apply(this, area.box); + if (area.polygon) + return this.polygon.apply(this, area.polygon); + if (area.type && area.coordinates) + return this.geometry(area); + throw new TypeError("Invalid argument"); + }; + Query.prototype.box = function() { + let path, box; + if (3 === arguments.length) { + path = arguments[0]; + box = [arguments[1], arguments[2]]; + } else if (2 === arguments.length) { + this._ensurePath("box"); + path = this._path; + box = [arguments[0], arguments[1]]; + } else { + throw new TypeError("Invalid argument"); + } + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds[this._geoComparison || $withinCmd] = { $box: box }; + return this; + }; + Query.prototype.polygon = function() { + let val, path; + if ("string" == typeof arguments[0]) { + val = Array.from(arguments); + path = val.shift(); + } else { + this._ensurePath("polygon"); + path = this._path; + val = Array.from(arguments); + } + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds[this._geoComparison || $withinCmd] = { $polygon: val }; + return this; + }; + Query.prototype.circle = function() { + let path, val; + if (1 === arguments.length) { + this._ensurePath("circle"); + path = this._path; + val = arguments[0]; + } else if (2 === arguments.length) { + path = arguments[0]; + val = arguments[1]; + } else { + throw new TypeError("Invalid argument"); + } + if (!("radius" in val && val.center)) + throw new Error("center and radius are required"); + const conds = this._conditions[path] || (this._conditions[path] = {}); + const type = val.spherical ? "$centerSphere" : "$center"; + const wKey = this._geoComparison || $withinCmd; + conds[wKey] = {}; + conds[wKey][type] = [val.center, val.radius]; + if ("unique" in val) + conds[wKey].$uniqueDocs = !!val.unique; + return this; + }; + Query.prototype.near = function near() { + let path, val; + this._geoComparison = "$near"; + if (0 === arguments.length) { + return this; + } else if (1 === arguments.length) { + this._ensurePath("near"); + path = this._path; + val = arguments[0]; + } else if (2 === arguments.length) { + path = arguments[0]; + val = arguments[1]; + } else { + throw new TypeError("Invalid argument"); + } + if (!val.center) { + throw new Error("center is required"); + } + const conds = this._conditions[path] || (this._conditions[path] = {}); + const type = val.spherical ? "$nearSphere" : "$near"; + if (Array.isArray(val.center)) { + conds[type] = val.center; + const radius = "maxDistance" in val ? val.maxDistance : null; + if (null != radius) { + conds.$maxDistance = radius; + } + if (null != val.minDistance) { + conds.$minDistance = val.minDistance; + } + } else { + if (val.center.type != "Point" || !Array.isArray(val.center.coordinates)) { + throw new Error(util.format("Invalid GeoJSON specified for %s", type)); + } + conds[type] = { $geometry: val.center }; + if ("maxDistance" in val) { + conds[type]["$maxDistance"] = val.maxDistance; + } + if ("minDistance" in val) { + conds[type]["$minDistance"] = val.minDistance; + } + } + return this; + }; + Query.prototype.intersects = function intersects() { + this._ensurePath("intersects"); + this._geoComparison = "$geoIntersects"; + if (0 === arguments.length) { + return this; + } + const area = arguments[0]; + if (null != area && area.type && area.coordinates) + return this.geometry(area); + throw new TypeError("Invalid argument"); + }; + Query.prototype.geometry = function geometry() { + if (!("$within" == this._geoComparison || "$geoWithin" == this._geoComparison || "$near" == this._geoComparison || "$geoIntersects" == this._geoComparison)) { + throw new Error("geometry() must come after `within()`, `intersects()`, or `near()"); + } + let val, path; + if (1 === arguments.length) { + this._ensurePath("geometry"); + path = this._path; + val = arguments[0]; + } else { + throw new TypeError("Invalid argument"); + } + if (!(val.type && Array.isArray(val.coordinates))) { + throw new TypeError("Invalid argument"); + } + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds[this._geoComparison] = { $geometry: val }; + return this; + }; + Query.prototype.select = function select() { + let arg = arguments[0]; + if (!arg) return this; + if (arguments.length !== 1) { + throw new Error("Invalid select: select only takes 1 argument"); + } + this._validate("select"); + const fields = this._fields || (this._fields = {}); + const type = typeof arg; + let i4, len; + if (("string" == type || utils.isArgumentsObject(arg)) && "number" == typeof arg.length || Array.isArray(arg)) { + if ("string" == type) + arg = arg.split(/\s+/); + for (i4 = 0, len = arg.length; i4 < len; ++i4) { + let field = arg[i4]; + if (!field) continue; + const include = "-" == field[0] ? 0 : 1; + if (include === 0) field = field.substring(1); + fields[field] = include; + } + return this; + } + if (utils.isObject(arg)) { + const keys = utils.keys(arg); + for (i4 = 0; i4 < keys.length; ++i4) { + fields[keys[i4]] = arg[keys[i4]]; + } + return this; + } + throw new TypeError("Invalid select() argument. Must be string or object."); + }; + Query.prototype.slice = function() { + if (0 === arguments.length) + return this; + this._validate("slice"); + let path, val; + if (1 === arguments.length) { + const arg = arguments[0]; + if (typeof arg === "object" && !Array.isArray(arg)) { + const keys = Object.keys(arg); + const numKeys = keys.length; + for (let i4 = 0; i4 < numKeys; ++i4) { + this.slice(keys[i4], arg[keys[i4]]); + } + return this; + } + this._ensurePath("slice"); + path = this._path; + val = arguments[0]; + } else if (2 === arguments.length) { + if ("number" === typeof arguments[0]) { + this._ensurePath("slice"); + path = this._path; + val = [arguments[0], arguments[1]]; + } else { + path = arguments[0]; + val = arguments[1]; + } + } else if (3 === arguments.length) { + path = arguments[0]; + val = [arguments[1], arguments[2]]; + } + const myFields = this._fields || (this._fields = {}); + myFields[path] = { $slice: val }; + return this; + }; + Query.prototype.sort = function(arg) { + if (!arg) return this; + let i4, len, field; + this._validate("sort"); + const type = typeof arg; + if (Array.isArray(arg)) { + len = arg.length; + for (i4 = 0; i4 < arg.length; ++i4) { + if (!Array.isArray(arg[i4])) { + throw new Error("Invalid sort() argument, must be array of arrays"); + } + _pushArr(this.options, arg[i4][0], arg[i4][1]); + } + return this; + } + if (1 === arguments.length && "string" == type) { + arg = arg.split(/\s+/); + len = arg.length; + for (i4 = 0; i4 < len; ++i4) { + field = arg[i4]; + if (!field) continue; + const ascend = "-" == field[0] ? -1 : 1; + if (ascend === -1) field = field.substring(1); + push(this.options, field, ascend); + } + return this; + } + if (utils.isObject(arg)) { + const keys = utils.keys(arg); + for (i4 = 0; i4 < keys.length; ++i4) { + field = keys[i4]; + push(this.options, field, arg[field]); + } + return this; + } + if (typeof Map !== "undefined" && arg instanceof Map) { + _pushMap(this.options, arg); + return this; + } + throw new TypeError("Invalid sort() argument. Must be a string, object, or array."); + }; + var _validSortValue = { + 1: 1, + "-1": -1, + asc: 1, + ascending: 1, + desc: -1, + descending: -1 + }; + function push(opts, field, value) { + if (Array.isArray(opts.sort)) { + throw new TypeError("Can't mix sort syntaxes. Use either array or object:\n- `.sort([['field', 1], ['test', -1]])`\n- `.sort({ field: 1, test: -1 })`"); + } + let s4; + if (value && value.$meta) { + s4 = opts.sort || (opts.sort = {}); + s4[field] = { $meta: value.$meta }; + return; + } + s4 = opts.sort || (opts.sort = {}); + let val = String(value || 1).toLowerCase(); + val = _validSortValue[val]; + if (!val) throw new TypeError("Invalid sort value: { " + field + ": " + value + " }"); + s4[field] = val; + } + function _pushArr(opts, field, value) { + opts.sort = opts.sort || []; + if (!Array.isArray(opts.sort)) { + throw new TypeError("Can't mix sort syntaxes. Use either array or object:\n- `.sort([['field', 1], ['test', -1]])`\n- `.sort({ field: 1, test: -1 })`"); + } + let val = String(value || 1).toLowerCase(); + val = _validSortValue[val]; + if (!val) throw new TypeError("Invalid sort value: [ " + field + ", " + value + " ]"); + opts.sort.push([field, val]); + } + function _pushMap(opts, map2) { + opts.sort = opts.sort || /* @__PURE__ */ new Map(); + if (!(opts.sort instanceof Map)) { + throw new TypeError("Can't mix sort syntaxes. Use either array or object or map consistently"); + } + map2.forEach(function(value, key) { + let val = String(value || 1).toLowerCase(); + val = _validSortValue[val]; + if (!val) throw new TypeError("Invalid sort value: < " + key + ": " + value + " >"); + opts.sort.set(key, val); + }); + } + ["limit", "skip", "batchSize", "comment"].forEach(function(method) { + Query.prototype[method] = function(v4) { + this._validate(method); + this.options[method] = v4; + return this; + }; + }); + Query.prototype.maxTime = Query.prototype.maxTimeMS = function(ms) { + this._validate("maxTime"); + this.options.maxTimeMS = ms; + return this; + }; + Query.prototype.hint = function() { + if (0 === arguments.length) return this; + this._validate("hint"); + const arg = arguments[0]; + if (utils.isObject(arg)) { + const hint = this.options.hint || (this.options.hint = {}); + for (const k4 in arg) { + hint[k4] = arg[k4]; + } + return this; + } + if (typeof arg === "string") { + this.options.hint = arg; + return this; + } + throw new TypeError("Invalid hint. " + arg); + }; + Query.prototype.j = function j4(val) { + this.options.j = val; + return this; + }; + Query.prototype.slaveOk = function(v4) { + this.options.slaveOk = arguments.length ? !!v4 : true; + return this; + }; + Query.prototype.read = Query.prototype.setReadPreference = function(pref) { + if (arguments.length > 1 && !Query.prototype.read.deprecationWarningIssued) { + console.error("Deprecation warning: 'tags' argument is not supported anymore in Query.read() method. Please use mongodb.ReadPreference object instead."); + Query.prototype.read.deprecationWarningIssued = true; + } + this.options.readPreference = utils.readPref(pref); + return this; + }; + Query.prototype.readConcern = Query.prototype.r = function(level) { + this.options.readConcern = utils.readConcern(level); + return this; + }; + Query.prototype.tailable = function() { + this._validate("tailable"); + this.options.tailable = arguments.length ? !!arguments[0] : true; + return this; + }; + Query.prototype.writeConcern = Query.prototype.w = function writeConcern(concern) { + if ("object" === typeof concern) { + if ("undefined" !== typeof concern.j) this.options.j = concern.j; + if ("undefined" !== typeof concern.w) this.options.w = concern.w; + if ("undefined" !== typeof concern.wtimeout) this.options.wtimeout = concern.wtimeout; + } else { + this.options.w = "m" === concern ? "majority" : concern; + } + return this; + }; + Query.prototype.wtimeout = Query.prototype.wTimeout = function wtimeout(ms) { + this.options.wtimeout = ms; + return this; + }; + Query.prototype.merge = function(source) { + if (!source) + return this; + if (!Query.canMerge(source)) + throw new TypeError("Invalid argument. Expected instanceof mquery or plain object"); + if (source instanceof Query) { + if (source._conditions) { + utils.merge(this._conditions, source._conditions); + } + if (source._fields) { + this._fields || (this._fields = {}); + utils.merge(this._fields, source._fields); + } + if (source.options) { + this.options || (this.options = {}); + utils.merge(this.options, source.options); + } + if (source._updateDoc) { + this._updateDoc || (this._updateDoc = {}); + utils.mergeClone(this._updateDoc, source._updateDoc); + } + if (source._distinctDoc) { + this._distinctDoc = source._distinctDoc; + } + return this; + } + utils.merge(this._conditions, source); + return this; + }; + Query.prototype.find = function(criteria) { + this.op = "find"; + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + return this; + }; + Query.prototype._find = async function _find() { + const conds = this._conditions; + const options = this._optionsForExec(); + if (this.$useProjection) { + options.projection = this._fieldsForExec(); + } else { + options.fields = this._fieldsForExec(); + } + debug("_find", this._collection.collectionName, conds, options); + return this._collection.find(conds, options); + }; + Query.prototype.cursor = function cursor2(criteria) { + if (this.op) { + if (this.op !== "find") { + throw new TypeError(".cursor only support .find method"); + } + } else { + this.find(criteria); + } + const conds = this._conditions; + const options = this._optionsForExec(); + if (this.$useProjection) { + options.projection = this._fieldsForExec(); + } else { + options.fields = this._fieldsForExec(); + } + debug("findCursor", this._collection.collectionName, conds, options); + return this._collection.findCursor(conds, options); + }; + Query.prototype.findOne = function(criteria) { + this.op = "findOne"; + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + return this; + }; + Query.prototype._findOne = async function _findOne() { + const conds = this._conditions; + const options = this._optionsForExec(); + if (this.$useProjection) { + options.projection = this._fieldsForExec(); + } else { + options.fields = this._fieldsForExec(); + } + debug("findOne", this._collection.collectionName, conds, options); + return this._collection.findOne(conds, options); + }; + Query.prototype.count = function(criteria) { + this.op = "count"; + this._validate(); + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + return this; + }; + Query.prototype._count = async function _count() { + const conds = this._conditions, options = this._optionsForExec(); + debug("count", this._collection.collectionName, conds, options); + return this._collection.count(conds, options); + }; + Query.prototype.distinct = function(criteria, field) { + this.op = "distinct"; + this._validate(); + if (!field && typeof criteria === "string") { + field = criteria; + criteria = void 0; + } + if ("string" == typeof field) { + this._distinctDoc = field; + } + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + return this; + }; + Query.prototype._distinct = async function _distinct() { + if (!this._distinctDoc) { + throw new Error("No value for `distinct` has been declared"); + } + const conds = this._conditions, options = this._optionsForExec(); + debug("distinct", this._collection.collectionName, conds, options); + return this._collection.distinct(this._distinctDoc, conds, options); + }; + Query.prototype.updateMany = function updateMany(criteria, doc, options) { + if (arguments.length === 1) { + doc = criteria; + criteria = options = void 0; + } + return _update(this, "updateMany", criteria, doc, options); + }; + Query.prototype._updateMany = async function() { + return _updateExec(this, "updateMany"); + }; + Query.prototype.updateOne = function updateOne(criteria, doc, options) { + if (arguments.length === 1) { + doc = criteria; + criteria = options = void 0; + } + return _update(this, "updateOne", criteria, doc, options); + }; + Query.prototype._updateOne = async function() { + return _updateExec(this, "updateOne"); + }; + Query.prototype.replaceOne = function replaceOne(criteria, doc, options) { + if (arguments.length === 1) { + doc = criteria; + criteria = options = void 0; + } + this.setOptions({ overwrite: true }); + return _update(this, "replaceOne", criteria, doc, options); + }; + Query.prototype._replaceOne = async function() { + return _updateExec(this, "replaceOne"); + }; + function _update(query, op2, criteria, doc, options) { + query.op = op2; + if (Query.canMerge(criteria)) { + query.merge(criteria); + } + if (doc) { + query._mergeUpdate(doc); + } + if (utils.isObject(options)) { + query.setOptions(options); + } + return query; + } + async function _updateExec(query, op2) { + const options = query._optionsForExec(); + const criteria = query._conditions; + const doc = query._updateForExec(); + debug("update", query._collection.collectionName, criteria, doc, options); + return query._collection[op2](criteria, doc, options); + } + Query.prototype.deleteOne = function(criteria) { + this.op = "deleteOne"; + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + return this; + }; + Query.prototype._deleteOne = async function() { + const options = this._optionsForExec(); + delete options.justOne; + const conds = this._conditions; + debug("deleteOne", this._collection.collectionName, conds, options); + return this._collection.deleteOne(conds, options); + }; + Query.prototype.deleteMany = function(criteria) { + this.op = "deleteMany"; + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + return this; + }; + Query.prototype._deleteMany = async function() { + const options = this._optionsForExec(); + delete options.justOne; + const conds = this._conditions; + debug("deleteOne", this._collection.collectionName, conds, options); + return this._collection.deleteMany(conds, options); + }; + Query.prototype.findOneAndUpdate = function(criteria, doc, options) { + this.op = "findOneAndUpdate"; + this._validate(); + if (arguments.length === 1) { + doc = criteria; + criteria = options = void 0; + } + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + if (doc) { + this._mergeUpdate(doc); + } + options && this.setOptions(options); + return this; + }; + Query.prototype._findOneAndUpdate = async function() { + const conds = this._conditions; + const update = this._updateForExec(); + const options = this._optionsForExec(); + return this._collection.findOneAndUpdate(conds, update, options); + }; + Query.prototype.findOneAndRemove = Query.prototype.findOneAndDelete = function(conditions, options) { + this.op = "findOneAndRemove"; + this._validate(); + if (Query.canMerge(conditions)) { + this.merge(conditions); + } + options && this.setOptions(options); + return this; + }; + Query.prototype._findOneAndRemove = async function() { + const options = this._optionsForExec(); + const conds = this._conditions; + return this._collection.findOneAndDelete(conds, options); + }; + Query.prototype.setTraceFunction = function(traceFunction) { + this._traceFunction = traceFunction; + return this; + }; + Query.prototype.exec = async function exec(op2) { + if (typeof op2 === "string") { + this.op = op2; + } + assert.ok(this.op, "Missing query type: (find, etc)"); + const fnName = "_" + this.op; + if (typeof this[fnName] !== "function") { + throw new TypeError(`this[${fnName}] is not a function`); + } + return this[fnName](); + }; + Query.prototype.then = async function(res, rej) { + return this.exec().then(res, rej); + }; + Query.prototype.cursor = function() { + if ("find" != this.op) + throw new Error("cursor() is only available for find"); + const conds = this._conditions; + const options = this._optionsForExec(); + if (this.$useProjection) { + options.projection = this._fieldsForExec(); + } else { + options.fields = this._fieldsForExec(); + } + debug("cursor", this._collection.collectionName, conds, options); + return this._collection.findCursor(conds, options); + }; + Query.prototype.selected = function selected() { + return !!(this._fields && Object.keys(this._fields).length > 0); + }; + Query.prototype.selectedInclusively = function selectedInclusively() { + if (!this._fields) return false; + const keys = Object.keys(this._fields); + if (0 === keys.length) return false; + for (let i4 = 0; i4 < keys.length; ++i4) { + const key = keys[i4]; + if (0 === this._fields[key]) return false; + if (this._fields[key] && typeof this._fields[key] === "object" && this._fields[key].$meta) { + return false; + } + } + return true; + }; + Query.prototype.selectedExclusively = function selectedExclusively() { + if (!this._fields) return false; + const keys = Object.keys(this._fields); + if (0 === keys.length) return false; + for (let i4 = 0; i4 < keys.length; ++i4) { + const key = keys[i4]; + if (0 === this._fields[key]) return true; + } + return false; + }; + Query.prototype._mergeUpdate = function(doc) { + if (!this._updateDoc) this._updateDoc = {}; + if (doc instanceof Query) { + if (doc._updateDoc) { + utils.mergeClone(this._updateDoc, doc._updateDoc); + } + } else { + utils.mergeClone(this._updateDoc, doc); + } + }; + Query.prototype._optionsForExec = function() { + const options = utils.clone(this.options); + return options; + }; + Query.prototype._fieldsForExec = function() { + return utils.clone(this._fields); + }; + Query.prototype._updateForExec = function() { + const update = utils.clone(this._updateDoc); + const ops = utils.keys(update); + const ret = {}; + for (const op2 of ops) { + if (this.options.overwrite) { + ret[op2] = update[op2]; + continue; + } + if ("$" !== op2[0]) { + if (!ret.$set) { + if (update.$set) { + ret.$set = update.$set; + } else { + ret.$set = {}; + } + } + ret.$set[op2] = update[op2]; + if (!~ops.indexOf("$set")) ops.push("$set"); + } else if ("$set" === op2) { + if (!ret.$set) { + ret[op2] = update[op2]; + } + } else { + ret[op2] = update[op2]; + } + } + this._compiledUpdate = ret; + return ret; + }; + Query.prototype._ensurePath = function(method) { + if (!this._path) { + const msg = method + "() must be used after where() when called with these arguments"; + throw new Error(msg); + } + }; + Query.permissions = require_permissions(); + Query._isPermitted = function(a4, b4) { + const denied = Query.permissions[b4]; + if (!denied) return true; + return true !== denied[a4]; + }; + Query.prototype._validate = function(action) { + let fail; + let validator; + if (void 0 === action) { + validator = Query.permissions[this.op]; + if ("function" != typeof validator) return true; + fail = validator(this); + } else if (!Query._isPermitted(action, this.op)) { + fail = action; + } + if (fail) { + throw new Error(fail + " cannot be used with " + this.op); + } + }; + Query.canMerge = function(conds) { + return conds instanceof Query || utils.isObject(conds); + }; + Query.setGlobalTraceFunction = function(traceFunction) { + Query.traceFunction = traceFunction; + }; + Query.utils = utils; + Query.env = require_env(); + Query.Collection = require_collection5(); + Query.BaseCollection = require_collection4(); + module2.exports = exports2 = Query; + } +}); + +// node_modules/mongoose/lib/helpers/projection/parseProjection.js +var require_parseProjection = __commonJS({ + "node_modules/mongoose/lib/helpers/projection/parseProjection.js"(exports2, module2) { + "use strict"; + module2.exports = function parseProjection(v4, retainMinusPaths) { + const type = typeof v4; + if (type === "string") { + v4 = v4.split(/\s+/); + } + if (!Array.isArray(v4) && Object.prototype.toString.call(v4) !== "[object Arguments]") { + return v4; + } + const len = v4.length; + const ret = {}; + for (let i4 = 0; i4 < len; ++i4) { + let field = v4[i4]; + if (!field) { + continue; + } + const include = "-" == field[0] ? 0 : 1; + if (!retainMinusPaths && include === 0) { + field = field.substring(1); + } + ret[field] = include; + } + return ret; + }; + } +}); + +// node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js +var require_removeUnusedArrayFilters = __commonJS({ + "node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js"(exports2, module2) { + "use strict"; + module2.exports = function removeUnusedArrayFilters(update, arrayFilters) { + const updateKeys = Object.keys(update).map((key) => Object.keys(update[key])).reduce((cur, arr) => cur.concat(arr), []); + return arrayFilters.filter((obj) => { + return _checkSingleFilterKey(obj, updateKeys); + }); + }; + function _checkSingleFilterKey(arrayFilter, updateKeys) { + const firstKey = Object.keys(arrayFilter)[0]; + if (firstKey === "$and" || firstKey === "$or") { + if (!Array.isArray(arrayFilter[firstKey])) { + return false; + } + return arrayFilter[firstKey].find((filter) => _checkSingleFilterKey(filter, updateKeys)) != null; + } + const firstDot = firstKey.indexOf("."); + const arrayFilterKey = firstDot === -1 ? firstKey : firstKey.slice(0, firstDot); + return updateKeys.find((key) => key.includes("$[" + arrayFilterKey + "]")) != null; + } + } +}); + +// node_modules/mongoose/lib/helpers/query/hasDollarKeys.js +var require_hasDollarKeys = __commonJS({ + "node_modules/mongoose/lib/helpers/query/hasDollarKeys.js"(exports2, module2) { + "use strict"; + module2.exports = function hasDollarKeys(obj) { + if (typeof obj !== "object" || obj === null) { + return false; + } + const keys = Object.keys(obj); + const len = keys.length; + for (let i4 = 0; i4 < len; ++i4) { + if (keys[i4][0] === "$") { + return true; + } + } + return false; + }; + } +}); + +// node_modules/mongoose/lib/helpers/query/sanitizeFilter.js +var require_sanitizeFilter = __commonJS({ + "node_modules/mongoose/lib/helpers/query/sanitizeFilter.js"(exports2, module2) { + "use strict"; + var hasDollarKeys = require_hasDollarKeys(); + var { trustedSymbol } = require_trusted(); + module2.exports = function sanitizeFilter(filter) { + if (filter == null || typeof filter !== "object") { + return filter; + } + if (Array.isArray(filter)) { + for (const subfilter of filter) { + sanitizeFilter(subfilter); + } + return filter; + } + const filterKeys = Object.keys(filter); + for (const key of filterKeys) { + const value = filter[key]; + if (value != null && value[trustedSymbol]) { + continue; + } + if (key === "$and" || key === "$or") { + sanitizeFilter(value); + continue; + } + if (hasDollarKeys(value)) { + const keys = Object.keys(value); + if (keys.length === 1 && keys[0] === "$eq") { + continue; + } + filter[key] = { $eq: filter[key] }; + } + } + return filter; + }; + } +}); + +// node_modules/mongoose/lib/helpers/query/sanitizeProjection.js +var require_sanitizeProjection = __commonJS({ + "node_modules/mongoose/lib/helpers/query/sanitizeProjection.js"(exports2, module2) { + "use strict"; + module2.exports = function sanitizeProjection(projection) { + if (projection == null) { + return; + } + const keys = Object.keys(projection); + for (let i4 = 0; i4 < keys.length; ++i4) { + if (typeof projection[keys[i4]] === "string") { + projection[keys[i4]] = 1; + } + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js +var require_selectPopulatedFields = __commonJS({ + "node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js"(exports2, module2) { + "use strict"; + var isExclusive = require_isExclusive(); + var isInclusive = require_isInclusive(); + module2.exports = function selectPopulatedFields(fields, userProvidedFields, populateOptions) { + if (populateOptions == null) { + return; + } + const paths = Object.keys(populateOptions); + userProvidedFields = userProvidedFields || {}; + if (isInclusive(fields)) { + for (const path of paths) { + if (!isPathInFields(userProvidedFields, path)) { + fields[path] = 1; + } else if (userProvidedFields[path] === 0) { + delete fields[path]; + } + const refPath = populateOptions[path]?.refPath; + if (typeof refPath === "string") { + if (!isPathInFields(userProvidedFields, refPath)) { + fields[refPath] = 1; + } else if (userProvidedFields[refPath] === 0) { + delete fields[refPath]; + } + } + } + } else if (isExclusive(fields)) { + for (const path of paths) { + if (userProvidedFields[path] == null) { + delete fields[path]; + } + const refPath = populateOptions[path]?.refPath; + if (typeof refPath === "string" && userProvidedFields[refPath] == null) { + delete fields[refPath]; + } + } + } + }; + function isPathInFields(userProvidedFields, path) { + const pieces = path.split("."); + const len = pieces.length; + let cur = pieces[0]; + for (let i4 = 1; i4 < len; ++i4) { + if (userProvidedFields[cur] != null || userProvidedFields[cur + ".$"] != null) { + return true; + } + cur += "." + pieces[i4]; + } + return userProvidedFields[cur] != null || userProvidedFields[cur + ".$"] != null; + } + } +}); + +// node_modules/mongoose/lib/helpers/updateValidators.js +var require_updateValidators = __commonJS({ + "node_modules/mongoose/lib/helpers/updateValidators.js"(exports2, module2) { + "use strict"; + var ValidationError = require_validation(); + var cleanPositionalOperators = require_cleanPositionalOperators(); + var flatten = require_common4().flatten; + module2.exports = function(query, schema, castedDoc, options, callback) { + const keys = Object.keys(castedDoc || {}); + let updatedKeys = {}; + let updatedValues = {}; + const isPull = {}; + const arrayAtomicUpdates = {}; + const numKeys = keys.length; + let hasDollarUpdate = false; + let currentUpdate; + let key; + let i4; + for (i4 = 0; i4 < numKeys; ++i4) { + if (keys[i4].startsWith("$")) { + hasDollarUpdate = true; + if (keys[i4] === "$push" || keys[i4] === "$addToSet") { + const _keys = Object.keys(castedDoc[keys[i4]]); + for (let ii = 0; ii < _keys.length; ++ii) { + currentUpdate = castedDoc[keys[i4]][_keys[ii]]; + if (currentUpdate && currentUpdate.$each) { + arrayAtomicUpdates[_keys[ii]] = (arrayAtomicUpdates[_keys[ii]] || []).concat(currentUpdate.$each); + } else { + arrayAtomicUpdates[_keys[ii]] = (arrayAtomicUpdates[_keys[ii]] || []).concat([currentUpdate]); + } + } + continue; + } + const flat = flatten(castedDoc[keys[i4]], null, null, schema); + const paths = Object.keys(flat); + const numPaths = paths.length; + for (let j4 = 0; j4 < numPaths; ++j4) { + const updatedPath = cleanPositionalOperators(paths[j4]); + key = keys[i4]; + if (updatedPath.includes("$")) { + continue; + } + if (key === "$set" || key === "$setOnInsert" || key === "$pull" || key === "$pullAll") { + updatedValues[updatedPath] = flat[paths[j4]]; + isPull[updatedPath] = key === "$pull" || key === "$pullAll"; + } else if (key === "$unset") { + updatedValues[updatedPath] = void 0; + } + updatedKeys[updatedPath] = true; + } + } + } + if (!hasDollarUpdate) { + updatedValues = flatten(castedDoc, null, null, schema); + updatedKeys = Object.keys(updatedValues); + } + const updates = Object.keys(updatedValues); + const numUpdates = updates.length; + const validatorsToExecute = []; + const validationErrors = []; + const alreadyValidated = []; + const context = query; + function iter(i5, v4) { + const schemaPath = schema._getSchema(updates[i5]); + if (schemaPath == null) { + return; + } + if (schemaPath.instance === "Mixed" && schemaPath.path !== updates[i5]) { + return; + } + if (v4 && Array.isArray(v4.$in)) { + v4.$in.forEach((v5, i6) => { + validatorsToExecute.push(function(callback2) { + schemaPath.doValidate( + v5, + function(err) { + if (err) { + err.path = updates[i6] + ".$in." + i6; + validationErrors.push(err); + } + callback2(null); + }, + context, + { updateValidator: true } + ); + }); + }); + } else { + if (isPull[updates[i5]] && schemaPath.$isMongooseArray) { + return; + } + if (schemaPath.$isMongooseDocumentArrayElement && v4 != null && v4.$__ != null) { + alreadyValidated.push(updates[i5]); + validatorsToExecute.push(function(callback2) { + schemaPath.doValidate(v4, function(err) { + if (err) { + if (err.errors) { + for (const key2 of Object.keys(err.errors)) { + const _err = err.errors[key2]; + _err.path = updates[i5] + "." + key2; + validationErrors.push(_err); + } + } else { + err.path = updates[i5]; + validationErrors.push(err); + } + } + return callback2(null); + }, context, { updateValidator: true }); + }); + } else { + validatorsToExecute.push(function(callback2) { + for (const path of alreadyValidated) { + if (updates[i5].startsWith(path + ".")) { + return callback2(null); + } + } + if (schemaPath.$isSingleNested) { + alreadyValidated.push(updates[i5]); + } + schemaPath.doValidate(v4, function(err) { + if (schemaPath.schema != null && schemaPath.schema.options.storeSubdocValidationError === false && err instanceof ValidationError) { + return callback2(null); + } + if (err) { + err.path = updates[i5]; + validationErrors.push(err); + } + callback2(null); + }, context, { updateValidator: true }); + }); + } + } + } + for (i4 = 0; i4 < numUpdates; ++i4) { + iter(i4, updatedValues[updates[i4]]); + } + const arrayUpdates = Object.keys(arrayAtomicUpdates); + for (const arrayUpdate of arrayUpdates) { + let schemaPath = schema._getSchema(arrayUpdate); + if (schemaPath && schemaPath.$isMongooseDocumentArray) { + validatorsToExecute.push(function(callback2) { + schemaPath.doValidate( + arrayAtomicUpdates[arrayUpdate], + getValidationCallback(arrayUpdate, validationErrors, callback2), + options && options.context === "query" ? query : null + ); + }); + } else { + schemaPath = schema._getSchema(arrayUpdate + ".0"); + for (const atomicUpdate of arrayAtomicUpdates[arrayUpdate]) { + validatorsToExecute.push(function(callback2) { + schemaPath.doValidate( + atomicUpdate, + getValidationCallback(arrayUpdate, validationErrors, callback2), + options && options.context === "query" ? query : null, + { updateValidator: true } + ); + }); + } + } + } + if (callback != null) { + let numValidators = validatorsToExecute.length; + if (numValidators === 0) { + return _done(callback); + } + for (const validator of validatorsToExecute) { + validator(function() { + if (--numValidators <= 0) { + _done(callback); + } + }); + } + return; + } + return function(callback2) { + let numValidators = validatorsToExecute.length; + if (numValidators === 0) { + return _done(callback2); + } + for (const validator of validatorsToExecute) { + validator(function() { + if (--numValidators <= 0) { + _done(callback2); + } + }); + } + }; + function _done(callback2) { + if (validationErrors.length) { + const err = new ValidationError(null); + for (const validationError of validationErrors) { + err.addError(validationError.path, validationError); + } + return callback2(err); + } + callback2(null); + } + function getValidationCallback(arrayUpdate, validationErrors2, callback2) { + return function(err) { + if (err) { + err.path = arrayUpdate; + validationErrors2.push(err); + } + callback2(null); + }; + } + }; + } +}); + +// node_modules/mongoose/lib/query.js +var require_query2 = __commonJS({ + "node_modules/mongoose/lib/query.js"(exports2, module2) { + "use strict"; + var CastError = require_cast(); + var DocumentNotFoundError = require_notFound(); + var Kareem = require_kareem(); + var MongooseError = require_mongooseError(); + var ObjectParameterError = require_objectParameter(); + var QueryCursor = require_queryCursor(); + var ValidationError = require_validation(); + var { applyGlobalMaxTimeMS, applyGlobalDiskUse } = require_applyGlobalOption(); + var handleReadPreferenceAliases = require_handleReadPreferenceAliases(); + var applyReadConcern = require_applyReadConcern(); + var applyWriteConcern = require_applyWriteConcern(); + var cast = require_cast2(); + var castArrayFilters = require_castArrayFilters(); + var castNumber = require_number(); + var castUpdate = require_castUpdate(); + var clone = require_clone(); + var getDiscriminatorByValue = require_getDiscriminatorByValue(); + var helpers = require_queryHelpers(); + var internalToObjectOptions = require_options().internalToObjectOptions; + var isExclusive = require_isExclusive(); + var isInclusive = require_isInclusive(); + var isPathSelectedInclusive = require_isPathSelectedInclusive(); + var isSubpath = require_isSubpath(); + var mpath = require_mpath(); + var mquery = require_mquery(); + var parseProjection = require_parseProjection(); + var removeUnusedArrayFilters = require_removeUnusedArrayFilters(); + var sanitizeFilter = require_sanitizeFilter(); + var sanitizeProjection = require_sanitizeProjection(); + var selectPopulatedFields = require_selectPopulatedFields(); + var setDefaultsOnInsert = require_setDefaultsOnInsert(); + var specialProperties = require_specialProperties(); + var updateValidators = require_updateValidators(); + var util = require("util"); + var utils = require_utils6(); + var queryMiddlewareFunctions = require_constants6().queryMiddlewareFunctions; + var queryOptionMethods = /* @__PURE__ */ new Set([ + "allowDiskUse", + "batchSize", + "collation", + "comment", + "explain", + "hint", + "j", + "lean", + "limit", + "maxTimeMS", + "populate", + "projection", + "read", + "select", + "skip", + "slice", + "sort", + "tailable", + "w", + "writeConcern", + "wtimeout" + ]); + var opToThunk = /* @__PURE__ */ new Map([ + ["countDocuments", "_countDocuments"], + ["distinct", "__distinct"], + ["estimatedDocumentCount", "_estimatedDocumentCount"], + ["find", "_find"], + ["findOne", "_findOne"], + ["findOneAndReplace", "_findOneAndReplace"], + ["findOneAndUpdate", "_findOneAndUpdate"], + ["replaceOne", "_replaceOne"], + ["updateMany", "_updateMany"], + ["updateOne", "_updateOne"], + ["deleteMany", "_deleteMany"], + ["deleteOne", "_deleteOne"], + ["findOneAndDelete", "_findOneAndDelete"] + ]); + function Query(conditions, options, model, collection) { + if (!this._mongooseOptions) { + this._mongooseOptions = {}; + } + options = options || {}; + this._transforms = []; + this._hooks = new Kareem(); + this._executionStack = null; + const keys = Object.keys(options); + for (const key of keys) { + this._mongooseOptions[key] = options[key]; + } + if (collection) { + this.mongooseCollection = collection; + } + if (model) { + this.model = model; + this.schema = model.schema; + } + if (this.model && this.model._mapreduce) { + this.lean(); + } + mquery.call(this, null, options); + if (collection) { + this.collection(collection); + } + if (conditions) { + this.find(conditions); + } + this.options = this.options || {}; + this.$useProjection = true; + const collation = this && this.schema && this.schema.options && this.schema.options.collation || null; + if (collation != null) { + this.options.collation = collation; + } + } + function isEmptyFilter(obj) { + if (obj == null) return true; + if (typeof obj !== "object") return true; + if (Object.keys(obj).length === 0) return true; + for (const key of ["$and", "$or", "$nor"]) { + if (Array.isArray(obj[key])) { + if (obj[key].length === 0 || obj[key].every((item) => isEmptyFilter(item))) { + return true; + } + } + } + return false; + } + function checkRequireFilter(filter, options) { + if (options && options.requireFilter && isEmptyFilter(filter)) { + throw new Error("Empty or invalid filter not allowed with requireFilter enabled"); + } + } + Query.prototype = new mquery(); + Query.prototype.constructor = Query; + Query.prototype.count = void 0; + Query.prototype.findOneAndRemove = void 0; + Query.base = mquery.prototype; + Object.defineProperty(Query.prototype, "_distinct", { + configurable: true, + writable: true, + enumerable: true, + value: void 0 + }); + Query.use$geoWithin = mquery.use$geoWithin; + Query.prototype.toConstructor = function toConstructor() { + const model = this.model; + const coll = this.mongooseCollection; + const CustomQuery = function(criteria, options2) { + if (!(this instanceof CustomQuery)) { + return new CustomQuery(criteria, options2); + } + this._mongooseOptions = clone(p4._mongooseOptions); + Query.call(this, criteria, options2 || null, model, coll); + }; + util.inherits(CustomQuery, model.Query); + const p4 = CustomQuery.prototype; + p4.options = {}; + const options = Object.assign({}, this.options); + if (options.sort != null) { + p4.sort(options.sort); + delete options.sort; + } + p4.setOptions(options); + p4.op = this.op; + p4._validateOp(); + p4._conditions = clone(this._conditions); + p4._fields = clone(this._fields); + p4._update = clone(this._update, { + flattenDecimals: false + }); + p4._path = this._path; + p4._distinct = this._distinct; + p4._collection = this._collection; + p4._mongooseOptions = this._mongooseOptions; + return CustomQuery; + }; + Query.prototype.clone = function() { + const model = this.model; + const collection = this.mongooseCollection; + const q4 = new this.model.Query({}, {}, model, collection); + const options = Object.assign({}, this.options); + if (options.sort != null) { + q4.sort(options.sort); + delete options.sort; + } + q4.setOptions(options); + q4.op = this.op; + q4._validateOp(); + q4._conditions = clone(this._conditions); + q4._fields = clone(this._fields); + q4._update = clone(this._update, { + flattenDecimals: false + }); + q4._path = this._path; + q4._distinct = this._distinct; + q4._collection = this._collection; + q4._mongooseOptions = this._mongooseOptions; + return q4; + }; + Query.prototype.slice = function() { + if (arguments.length === 0) { + return this; + } + this._validate("slice"); + let path; + let val; + if (arguments.length === 1) { + const arg = arguments[0]; + if (typeof arg === "object" && !Array.isArray(arg)) { + const keys = Object.keys(arg); + const numKeys = keys.length; + for (let i4 = 0; i4 < numKeys; ++i4) { + this.slice(keys[i4], arg[keys[i4]]); + } + return this; + } + this._ensurePath("slice"); + path = this._path; + val = arguments[0]; + } else if (arguments.length === 2) { + if ("number" === typeof arguments[0]) { + this._ensurePath("slice"); + path = this._path; + val = [arguments[0], arguments[1]]; + } else { + path = arguments[0]; + val = arguments[1]; + } + } else if (arguments.length === 3) { + path = arguments[0]; + val = [arguments[1], arguments[2]]; + } + const p4 = {}; + p4[path] = { $slice: val }; + this.select(p4); + return this; + }; + var validOpsSet = new Set(queryMiddlewareFunctions); + Query.prototype._validateOp = function() { + if (this.op != null && !validOpsSet.has(this.op)) { + this.error(new Error('Query has invalid `op`: "' + this.op + '"')); + } + }; + Query.prototype.mod = function() { + let val; + let path; + if (arguments.length === 1) { + this._ensurePath("mod"); + val = arguments[0]; + path = this._path; + } else if (arguments.length === 2 && !Array.isArray(arguments[1])) { + this._ensurePath("mod"); + val = [arguments[0], arguments[1]]; + path = this._path; + } else if (arguments.length === 3) { + val = [arguments[1], arguments[2]]; + path = arguments[0]; + } else { + val = arguments[1]; + path = arguments[0]; + } + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds.$mod = val; + return this; + }; + Query.prototype.limit = function limit(v4) { + this._validate("limit"); + if (typeof v4 === "string") { + try { + v4 = castNumber(v4); + } catch (err) { + throw new CastError("Number", v4, "limit"); + } + } + this.options.limit = v4; + return this; + }; + Query.prototype.skip = function skip(v4) { + this._validate("skip"); + if (typeof v4 === "string") { + try { + v4 = castNumber(v4); + } catch (err) { + throw new CastError("Number", v4, "skip"); + } + } + this.options.skip = v4; + return this; + }; + Query.prototype.projection = function(arg) { + if (arguments.length === 0) { + return this._fields; + } + this._fields = {}; + this._userProvidedFields = {}; + this.select(arg); + return this._fields; + }; + Query.prototype.select = function select() { + let arg = arguments[0]; + if (!arg) return this; + if (arguments.length !== 1) { + throw new Error("Invalid select: select only takes 1 argument"); + } + this._validate("select"); + const fields = this._fields || (this._fields = {}); + const userProvidedFields = this._userProvidedFields || (this._userProvidedFields = {}); + let sanitizeProjection2 = void 0; + if (this.model != null && utils.hasUserDefinedProperty(this.model.db.options, "sanitizeProjection")) { + sanitizeProjection2 = this.model.db.options.sanitizeProjection; + } else if (this.model != null && utils.hasUserDefinedProperty(this.model.base.options, "sanitizeProjection")) { + sanitizeProjection2 = this.model.base.options.sanitizeProjection; + } else { + sanitizeProjection2 = this._mongooseOptions.sanitizeProjection; + } + function sanitizeValue(value) { + return typeof value === "string" && sanitizeProjection2 ? value = 1 : value; + } + arg = parseProjection(arg, true); + if (utils.isObject(arg)) { + if (this.selectedInclusively()) { + Object.entries(arg).forEach(([key, value]) => { + if (value) { + if (fields["-" + key] != null) { + delete fields["-" + key]; + } + fields[key] = userProvidedFields[key] = sanitizeValue(value); + } else { + Object.keys(userProvidedFields).forEach((field) => { + if (isSubpath(key, field)) { + delete fields[field]; + delete userProvidedFields[field]; + } + }); + } + }); + } else if (this.selectedExclusively()) { + Object.entries(arg).forEach(([key, value]) => { + if (!value) { + if (fields["+" + key] != null) { + delete fields["+" + key]; + } + fields[key] = userProvidedFields[key] = sanitizeValue(value); + } else { + Object.keys(userProvidedFields).forEach((field) => { + if (isSubpath(key, field)) { + delete fields[field]; + delete userProvidedFields[field]; + } + }); + } + }); + } else { + const keys = Object.keys(arg); + for (let i4 = 0; i4 < keys.length; ++i4) { + const value = arg[keys[i4]]; + const key = keys[i4]; + fields[key] = sanitizeValue(value); + userProvidedFields[key] = sanitizeValue(value); + } + } + return this; + } + throw new TypeError("Invalid select() argument. Must be string or object."); + }; + Query.prototype.schemaLevelProjections = function schemaLevelProjections(value) { + this._mongooseOptions.schemaLevelProjections = value; + return this; + }; + Query.prototype.sanitizeProjection = function sanitizeProjection2(value) { + this._mongooseOptions.sanitizeProjection = value; + return this; + }; + Query.prototype.read = function read(mode, tags) { + if (typeof mode === "string") { + mode = handleReadPreferenceAliases(mode); + this.options.readPreference = { mode, tags }; + } else { + this.options.readPreference = mode; + } + return this; + }; + Query.prototype.toString = function toString() { + if (this.op === "count" || this.op === "countDocuments" || this.op === "find" || this.op === "findOne" || this.op === "deleteMany" || this.op === "deleteOne" || this.op === "findOneAndDelete" || this.op === "remove") { + return `${this.model.modelName}.${this.op}(${util.inspect(this._conditions)})`; + } + if (this.op === "distinct") { + return `${this.model.modelName}.distinct('${this._distinct}', ${util.inspect(this._conditions)})`; + } + if (this.op === "findOneAndReplace" || this.op === "findOneAndUpdate" || this.op === "replaceOne" || this.op === "update" || this.op === "updateMany" || this.op === "updateOne") { + return `${this.model.modelName}.${this.op}(${util.inspect(this._conditions)}, ${util.inspect(this._update)})`; + } + return `${this.model.modelName}.${this.op}()`; + }; + Query.prototype.session = function session(v4) { + if (v4 == null) { + delete this.options.session; + } + this.options.session = v4; + return this; + }; + Query.prototype.writeConcern = function writeConcern(val) { + if (val == null) { + delete this.options.writeConcern; + return this; + } + this.options.writeConcern = val; + return this; + }; + Query.prototype.w = function w4(val) { + if (val == null) { + delete this.options.w; + } + if (this.options.writeConcern != null) { + this.options.writeConcern.w = val; + } else { + this.options.w = val; + } + return this; + }; + Query.prototype.j = function j4(val) { + if (val == null) { + delete this.options.j; + } + if (this.options.writeConcern != null) { + this.options.writeConcern.j = val; + } else { + this.options.j = val; + } + return this; + }; + Query.prototype.wtimeout = function wtimeout(ms) { + if (ms == null) { + delete this.options.wtimeout; + } + if (this.options.writeConcern != null) { + this.options.writeConcern.wtimeout = ms; + } else { + this.options.wtimeout = ms; + } + return this; + }; + Query.prototype.getOptions = function() { + return this.options; + }; + Query.prototype.setOptions = function(options, overwrite) { + if (overwrite) { + this._mongooseOptions = options && clone(options) || {}; + this.options = options || {}; + if ("populate" in options) { + this.populate(this._mongooseOptions); + } + return this; + } + if (options == null) { + return this; + } + if (typeof options !== "object") { + throw new Error('Options must be an object, got "' + options + '"'); + } + options = Object.assign({}, options); + if (Array.isArray(options.populate)) { + const populate = options.populate; + delete options.populate; + const _numPopulate = populate.length; + for (let i4 = 0; i4 < _numPopulate; ++i4) { + this.populate(populate[i4]); + } + } + if ("setDefaultsOnInsert" in options) { + this._mongooseOptions.setDefaultsOnInsert = options.setDefaultsOnInsert; + delete options.setDefaultsOnInsert; + } + if ("overwriteDiscriminatorKey" in options) { + this._mongooseOptions.overwriteDiscriminatorKey = options.overwriteDiscriminatorKey; + delete options.overwriteDiscriminatorKey; + } + if ("overwriteImmutable" in options) { + this._mongooseOptions.overwriteImmutable = options.overwriteImmutable; + delete options.overwriteImmutable; + } + if ("sanitizeProjection" in options) { + if (options.sanitizeProjection && !this._mongooseOptions.sanitizeProjection) { + sanitizeProjection(this._fields); + } + this._mongooseOptions.sanitizeProjection = options.sanitizeProjection; + delete options.sanitizeProjection; + } + if ("sanitizeFilter" in options) { + this._mongooseOptions.sanitizeFilter = options.sanitizeFilter; + delete options.sanitizeFilter; + } + if ("timestamps" in options) { + this._mongooseOptions.timestamps = options.timestamps; + delete options.timestamps; + } + if ("defaults" in options) { + this._mongooseOptions.defaults = options.defaults; + } + if ("translateAliases" in options) { + this._mongooseOptions.translateAliases = options.translateAliases; + delete options.translateAliases; + } + if ("schemaLevelProjections" in options) { + this._mongooseOptions.schemaLevelProjections = options.schemaLevelProjections; + delete options.schemaLevelProjections; + } + if (options.lean == null && this.schema && "lean" in this.schema.options) { + this._mongooseOptions.lean = this.schema.options.lean; + } + if (typeof options.limit === "string") { + try { + options.limit = castNumber(options.limit); + } catch (err) { + throw new CastError("Number", options.limit, "limit"); + } + } + if (typeof options.skip === "string") { + try { + options.skip = castNumber(options.skip); + } catch (err) { + throw new CastError("Number", options.skip, "skip"); + } + } + for (const key of Object.keys(options)) { + if (queryOptionMethods.has(key)) { + const args2 = Array.isArray(options[key]) ? options[key] : [options[key]]; + this[key].apply(this, args2); + } else { + this.options[key] = options[key]; + } + } + return this; + }; + Query.prototype.explain = function explain(verbose) { + if (arguments.length === 0) { + this.options.explain = true; + } else if (verbose === false) { + delete this.options.explain; + } else { + this.options.explain = verbose; + } + return this; + }; + Query.prototype.allowDiskUse = function(v4) { + if (arguments.length === 0) { + this.options.allowDiskUse = true; + } else if (v4 === false) { + delete this.options.allowDiskUse; + } else { + this.options.allowDiskUse = v4; + } + return this; + }; + Query.prototype.maxTimeMS = function(ms) { + this.options.maxTimeMS = ms; + return this; + }; + Query.prototype.getFilter = function() { + return this._conditions; + }; + Query.prototype.getQuery = function() { + return this._conditions; + }; + Query.prototype.setQuery = function(val) { + this._conditions = val; + }; + Query.prototype.getUpdate = function() { + return this._update; + }; + Query.prototype.setUpdate = function(val) { + this._update = val; + }; + Query.prototype._fieldsForExec = function() { + if (this._fields == null) { + return null; + } + if (Object.keys(this._fields).length === 0) { + return null; + } + return clone(this._fields); + }; + Query.prototype._updateForExec = function() { + const update = clone(this._update, { + transform: false, + depopulate: true + }); + const ops = Object.keys(update); + let i4 = ops.length; + const ret = {}; + while (i4--) { + const op2 = ops[i4]; + if ("$" !== op2[0]) { + if (!ret.$set) { + if (update.$set) { + ret.$set = update.$set; + } else { + ret.$set = {}; + } + } + ret.$set[op2] = update[op2]; + ops.splice(i4, 1); + if (!~ops.indexOf("$set")) ops.push("$set"); + } else if ("$set" === op2) { + if (!ret.$set) { + ret[op2] = update[op2]; + } + } else { + ret[op2] = update[op2]; + } + } + return ret; + }; + Query.prototype._optionsForExec = function(model) { + const options = clone(this.options); + delete options.populate; + model = model || this.model; + if (!model) { + return options; + } + applyReadConcern(model.schema, options); + applyWriteConcern(model.schema, options); + const asyncLocalStorage = this.model?.db?.base.transactionAsyncLocalStorage?.getStore(); + if (!Object.hasOwn(this.options, "session") && asyncLocalStorage?.session != null) { + options.session = asyncLocalStorage.session; + } + const readPreference = model && model.schema && model.schema.options && model.schema.options.read; + if (!("readPreference" in options) && readPreference) { + options.readPreference = readPreference; + } + if (options.upsert !== void 0) { + options.upsert = !!options.upsert; + } + if (options.writeConcern) { + if (options.j) { + options.writeConcern.j = options.j; + delete options.j; + } + if (options.w) { + options.writeConcern.w = options.w; + delete options.w; + } + if (options.wtimeout) { + options.writeConcern.wtimeout = options.wtimeout; + delete options.wtimeout; + } + } + this._applyPaths(); + if (this._fields != null) { + this._fields = this._castFields(this._fields); + const projection = this._fieldsForExec(); + if (projection != null) { + options.projection = projection; + } + } + if (this._mongooseOptions.populate) { + if (options.readPreference) { + for (const pop of Object.values(this._mongooseOptions.populate)) { + if (pop.options?.readPreference === void 0) { + if (!pop.options) { + pop.options = {}; + } + pop.options.readPreference = options.readPreference; + } + } + } + if (options.readConcern) { + for (const pop of Object.values(this._mongooseOptions.populate)) { + if (pop.options?.readConcern === void 0) { + if (!pop.options) { + pop.options = {}; + } + pop.options.readConcern = options.readConcern; + } + } + } + } + return options; + }; + Query.prototype.lean = function(v4) { + this._mongooseOptions.lean = arguments.length ? v4 : true; + return this; + }; + Query.prototype.set = function(path, val) { + if (typeof path === "object") { + const keys = Object.keys(path); + for (const key of keys) { + this.set(key, path[key]); + } + return this; + } + this._update = this._update || {}; + if (path in this._update) { + delete this._update[path]; + } + this._update.$set = this._update.$set || {}; + this._update.$set[path] = val; + return this; + }; + Query.prototype.get = function get2(path) { + const update = this._update; + if (update == null) { + return void 0; + } + const $set = update.$set; + if ($set == null) { + return update[path]; + } + if (utils.hasUserDefinedProperty(update, path)) { + return update[path]; + } + if (utils.hasUserDefinedProperty($set, path)) { + return $set[path]; + } + return void 0; + }; + Query.prototype.error = function error2(err) { + if (arguments.length === 0) { + return this._error; + } + this._error = err; + return this; + }; + Query.prototype._unsetCastError = function _unsetCastError() { + if (this._error == null || !(this._error instanceof CastError)) { + return; + } + return this.error(null); + }; + Query.prototype.mongooseOptions = function(v4) { + if (arguments.length > 0) { + this._mongooseOptions = v4; + } + return this._mongooseOptions; + }; + Query.prototype._castConditions = function() { + let sanitizeFilterOpt = void 0; + if (this.model?.db.options?.sanitizeFilter != null) { + sanitizeFilterOpt = this.model.db.options.sanitizeFilter; + } else if (this.model?.base.options?.sanitizeFilter != null) { + sanitizeFilterOpt = this.model.base.options.sanitizeFilter; + } else { + sanitizeFilterOpt = this._mongooseOptions.sanitizeFilter; + } + if (sanitizeFilterOpt) { + sanitizeFilter(this._conditions); + } + try { + this.cast(this.model); + this._unsetCastError(); + } catch (err) { + this.error(err); + } + }; + function _castArrayFilters(query) { + try { + castArrayFilters(query); + } catch (err) { + query.error(err); + } + } + Query.prototype._find = async function _find() { + this._applyTranslateAliases(); + this._castConditions(); + if (this.error() != null) { + throw this.error(); + } + const mongooseOptions = this._mongooseOptions; + const userProvidedFields = this._userProvidedFields || {}; + applyGlobalMaxTimeMS(this.options, this.model.db.options, this.model.base.options); + applyGlobalDiskUse(this.options, this.model.db.options, this.model.base.options); + const completeManyOptions = { + session: this && this.options && this.options.session || null, + lean: mongooseOptions.lean || null + }; + const options = this._optionsForExec(); + const filter = this._conditions; + const fields = options.projection; + const cursor2 = await this.mongooseCollection.find(filter, options); + if (options.explain) { + return cursor2.explain(); + } + let docs = await cursor2.toArray(); + if (docs.length === 0) { + return docs; + } + if (!mongooseOptions.populate) { + const versionKey = this.schema.options.versionKey; + if (mongooseOptions.lean && mongooseOptions.lean.versionKey === false && versionKey) { + docs.forEach((doc) => { + if (versionKey in doc) { + delete doc[versionKey]; + } + }); + } + return mongooseOptions.lean ? _completeManyLean(this.model.schema, docs, null, completeManyOptions) : this._completeMany(docs, fields, userProvidedFields, completeManyOptions); + } + const pop = helpers.preparePopulationOptionsMQ(this, mongooseOptions); + if (mongooseOptions.lean) { + return this.model.populate(docs, pop); + } + docs = await this._completeMany(docs, fields, userProvidedFields, completeManyOptions); + await this.model.populate(docs, pop); + return docs; + }; + Query.prototype.find = function(conditions) { + if (typeof conditions === "function" || typeof arguments[1] === "function") { + throw new MongooseError("Query.prototype.find() no longer accepts a callback"); + } + this.op = "find"; + if (mquery.canMerge(conditions)) { + this.merge(conditions); + prepareDiscriminatorCriteria(this); + } else if (conditions != null) { + this.error(new ObjectParameterError(conditions, "filter", "find")); + } + return this; + }; + Query.prototype.merge = function(source) { + if (!source) { + return this; + } + const opts = { overwrite: true }; + if (source instanceof Query) { + if (source._conditions) { + opts.omit = {}; + if (this._conditions && this._conditions.$and && source._conditions.$and) { + opts.omit["$and"] = true; + this._conditions.$and = this._conditions.$and.concat(source._conditions.$and); + } + if (this._conditions && this._conditions.$or && source._conditions.$or) { + opts.omit["$or"] = true; + this._conditions.$or = this._conditions.$or.concat(source._conditions.$or); + } + utils.merge(this._conditions, source._conditions, opts); + } + if (source._fields) { + this._fields || (this._fields = {}); + utils.merge(this._fields, source._fields, opts); + } + if (source.options) { + this.options || (this.options = {}); + utils.merge(this.options, source.options, opts); + } + if (source._update) { + this._update || (this._update = {}); + utils.mergeClone(this._update, source._update); + } + if (source._distinct) { + this._distinct = source._distinct; + } + utils.merge(this._mongooseOptions, source._mongooseOptions); + return this; + } else if (this.model != null && source instanceof this.model.base.Types.ObjectId) { + utils.merge(this._conditions, { _id: source }, opts); + return this; + } else if (source && source.$__) { + source = source.toObject(internalToObjectOptions); + } + opts.omit = {}; + if (Array.isArray(source.$and)) { + opts.omit["$and"] = true; + if (!this._conditions) { + this._conditions = {}; + } + this._conditions.$and = (this._conditions.$and || []).concat( + source.$and.map((el) => utils.isPOJO(el) ? utils.merge({}, el) : el) + ); + } + if (Array.isArray(source.$or)) { + opts.omit["$or"] = true; + if (!this._conditions) { + this._conditions = {}; + } + this._conditions.$or = (this._conditions.$or || []).concat( + source.$or.map((el) => utils.isPOJO(el) ? utils.merge({}, el) : el) + ); + } + utils.merge(this._conditions, source, opts); + return this; + }; + Query.prototype.collation = function(value) { + if (this.options == null) { + this.options = {}; + } + this.options.collation = value; + return this; + }; + Query.prototype._completeOne = function(doc, res, projection, callback) { + if (!doc && !this.options.includeResultMetadata) { + return callback(null, null); + } + const model = this.model; + const userProvidedFields = this._userProvidedFields || {}; + const mongooseOptions = this._mongooseOptions; + const options = this.options; + if (!options.lean && mongooseOptions.lean) { + options.lean = mongooseOptions.lean; + } + if (options.explain) { + return callback(null, doc); + } + if (!mongooseOptions.populate) { + const versionKey = this.schema.options.versionKey; + if (mongooseOptions.lean && mongooseOptions.lean.versionKey === false && versionKey) { + if (versionKey in doc) { + delete doc[versionKey]; + } + } + return mongooseOptions.lean ? _completeOneLean(model.schema, doc, null, res, options, callback) : completeOne( + model, + doc, + res, + options, + projection, + userProvidedFields, + null, + callback + ); + } + const pop = helpers.preparePopulationOptionsMQ(this, this._mongooseOptions); + if (mongooseOptions.lean) { + return model.populate(doc, pop).then( + (doc2) => { + _completeOneLean(model.schema, doc2, null, res, options, callback); + }, + (error2) => { + callback(error2); + } + ); + } + completeOne(model, doc, res, options, projection, userProvidedFields, [], (err, doc2) => { + if (err != null) { + return callback(err); + } + model.populate(doc2, pop).then((res2) => { + callback(null, res2); + }, (err2) => { + callback(err2); + }); + }); + }; + Query.prototype._completeMany = async function _completeMany(docs, fields, userProvidedFields, opts) { + const model = this.model; + return Promise.all(docs.map((doc) => new Promise((resolve, reject) => { + const rawDoc = doc; + doc = helpers.createModel(model, doc, fields, userProvidedFields); + if (opts.session != null) { + doc.$session(opts.session); + } + doc.$init(rawDoc, opts, (err) => { + if (err != null) { + return reject(err); + } + resolve(doc); + }); + }))); + }; + Query.prototype._findOne = async function _findOne() { + this._applyTranslateAliases(); + this._castConditions(); + if (this.error()) { + const err = this.error(); + throw err; + } + applyGlobalMaxTimeMS(this.options, this.model.db.options, this.model.base.options); + applyGlobalDiskUse(this.options, this.model.db.options, this.model.base.options); + const options = this._optionsForExec(); + const doc = await this.mongooseCollection.findOne(this._conditions, options); + return new Promise((resolve, reject) => { + this._completeOne(doc, null, options.projection, (err, res) => { + if (err) { + return reject(err); + } + resolve(res); + }); + }); + }; + Query.prototype.findOne = function(conditions, projection, options) { + if (typeof conditions === "function" || typeof projection === "function" || typeof options === "function" || typeof arguments[3] === "function") { + throw new MongooseError("Query.prototype.findOne() no longer accepts a callback"); + } + this.op = "findOne"; + this._validateOp(); + if (options) { + this.setOptions(options); + } + if (projection) { + this.select(projection); + } + if (mquery.canMerge(conditions)) { + this.merge(conditions); + prepareDiscriminatorCriteria(this); + } else if (conditions != null) { + this.error(new ObjectParameterError(conditions, "filter", "findOne")); + } + return this; + }; + Query.prototype._countDocuments = async function _countDocuments() { + this._applyTranslateAliases(); + try { + this.cast(this.model); + } catch (err) { + this.error(err); + } + if (this.error()) { + throw this.error(); + } + applyGlobalMaxTimeMS(this.options, this.model.db.options, this.model.base.options); + applyGlobalDiskUse(this.options, this.model.db.options, this.model.base.options); + const options = this._optionsForExec(); + const conds = this._conditions; + return this.mongooseCollection.countDocuments(conds, options); + }; + Query.prototype._applyTranslateAliases = function _applyTranslateAliases() { + let applyTranslateAliases = false; + if ("translateAliases" in this._mongooseOptions) { + applyTranslateAliases = this._mongooseOptions.translateAliases; + } else if (this.model?.schema?._userProvidedOptions?.translateAliases != null) { + applyTranslateAliases = this.model.schema._userProvidedOptions.translateAliases; + } else if (this.model?.base?.options?.translateAliases != null) { + applyTranslateAliases = this.model.base.options.translateAliases; + } + if (!applyTranslateAliases) { + return; + } + if (this.model?.schema?.aliases && Object.keys(this.model.schema.aliases).length > 0) { + this.model.translateAliases(this._conditions, true); + this.model.translateAliases(this._fields, true); + this.model.translateAliases(this._update, true); + if (this._distinct != null && this.model.schema.aliases[this._distinct] != null) { + this._distinct = this.model.schema.aliases[this._distinct]; + } + } + }; + Query.prototype._estimatedDocumentCount = async function _estimatedDocumentCount() { + if (this.error()) { + throw this.error(); + } + const options = this._optionsForExec(); + return this.mongooseCollection.estimatedDocumentCount(options); + }; + Query.prototype.estimatedDocumentCount = function(options) { + if (typeof options === "function" || typeof arguments[1] === "function") { + throw new MongooseError("Query.prototype.estimatedDocumentCount() no longer accepts a callback"); + } + this.op = "estimatedDocumentCount"; + this._validateOp(); + if (options != null) { + this.setOptions(options); + } + return this; + }; + Query.prototype.countDocuments = function(conditions, options) { + if (typeof conditions === "function" || typeof options === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Query.prototype.countDocuments() no longer accepts a callback"); + } + this.op = "countDocuments"; + this._validateOp(); + if (mquery.canMerge(conditions)) { + this.merge(conditions); + } + if (options != null) { + this.setOptions(options); + } + return this; + }; + Query.prototype.__distinct = async function __distinct() { + this._applyTranslateAliases(); + this._castConditions(); + if (this.error()) { + throw this.error(); + } + applyGlobalMaxTimeMS(this.options, this.model.db.options, this.model.base.options); + applyGlobalDiskUse(this.options, this.model.db.options, this.model.base.options); + const options = this._optionsForExec(); + return this.mongooseCollection.distinct(this._distinct, this._conditions, options); + }; + Query.prototype.distinct = function(field, conditions, options) { + if (typeof field === "function" || typeof conditions === "function" || typeof options === "function" || typeof arguments[3] === "function") { + throw new MongooseError("Query.prototype.distinct() no longer accepts a callback"); + } + this.op = "distinct"; + this._validateOp(); + if (mquery.canMerge(conditions)) { + this.merge(conditions); + prepareDiscriminatorCriteria(this); + } else if (conditions != null) { + this.error(new ObjectParameterError(conditions, "filter", "distinct")); + } + if (field != null) { + this._distinct = field; + } + if (options != null) { + this.setOptions(options); + } + return this; + }; + Query.prototype.sort = function(arg, options) { + if (arguments.length > 2) { + throw new Error("sort() takes at most 2 arguments"); + } + if (options != null && typeof options !== "object") { + throw new Error("sort() options argument must be an object or nullish"); + } + if (this.options.sort == null) { + this.options.sort = {}; + } + if (options && options.override) { + this.options.sort = {}; + } + const sort = this.options.sort; + if (typeof arg === "string") { + const properties = arg.indexOf(" ") === -1 ? [arg] : arg.split(" "); + for (let property of properties) { + const ascend = "-" == property[0] ? -1 : 1; + if (ascend === -1) { + property = property.slice(1); + } + if (specialProperties.has(property)) { + continue; + } + sort[property] = ascend; + } + } else if (Array.isArray(arg)) { + for (const pair of arg) { + if (!Array.isArray(pair)) { + throw new TypeError("Invalid sort() argument, must be array of arrays"); + } + const key = "" + pair[0]; + if (specialProperties.has(key)) { + continue; + } + sort[key] = _handleSortValue(pair[1], key); + } + } else if (typeof arg === "object" && arg != null && !(arg instanceof Map)) { + for (const key of Object.keys(arg)) { + if (specialProperties.has(key)) { + continue; + } + sort[key] = _handleSortValue(arg[key], key); + } + } else if (arg instanceof Map) { + for (let key of arg.keys()) { + key = "" + key; + if (specialProperties.has(key)) { + continue; + } + sort[key] = _handleSortValue(arg.get(key), key); + } + } else if (arg != null) { + throw new TypeError("Invalid sort() argument. Must be a string, object, array, or map."); + } + return this; + }; + function _handleSortValue(val, key) { + if (val === 1 || val === "asc" || val === "ascending") { + return 1; + } + if (val === -1 || val === "desc" || val === "descending") { + return -1; + } + if (val?.$meta != null) { + return { $meta: val.$meta }; + } + throw new TypeError("Invalid sort value: { " + key + ": " + val + " }"); + } + Query.prototype.deleteOne = function deleteOne(filter, options) { + if (typeof filter === "function" || typeof options === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Query.prototype.deleteOne() no longer accepts a callback"); + } + this.op = "deleteOne"; + this.setOptions(options); + if (mquery.canMerge(filter)) { + this.merge(filter); + prepareDiscriminatorCriteria(this); + } else if (filter != null) { + this.error(new ObjectParameterError(filter, "filter", "deleteOne")); + } + return this; + }; + Query.prototype._deleteOne = async function _deleteOne() { + this._applyTranslateAliases(); + this._castConditions(); + checkRequireFilter(this._conditions, this.options); + if (this.error() != null) { + throw this.error(); + } + const options = this._optionsForExec(); + return this.mongooseCollection.deleteOne(this._conditions, options); + }; + Query.prototype.deleteMany = function(filter, options) { + if (typeof filter === "function" || typeof options === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Query.prototype.deleteMany() no longer accepts a callback"); + } + this.setOptions(options); + this.op = "deleteMany"; + if (mquery.canMerge(filter)) { + this.merge(filter); + prepareDiscriminatorCriteria(this); + } else if (filter != null) { + this.error(new ObjectParameterError(filter, "filter", "deleteMany")); + } + return this; + }; + Query.prototype._deleteMany = async function _deleteMany() { + this._applyTranslateAliases(); + this._castConditions(); + checkRequireFilter(this._conditions, this.options); + if (this.error() != null) { + throw this.error(); + } + const options = this._optionsForExec(); + return this.mongooseCollection.deleteMany(this._conditions, options); + }; + function completeOne(model, doc, res, options, fields, userProvidedFields, pop, callback) { + if (options.includeResultMetadata && doc == null) { + _init(null); + return null; + } + helpers.createModelAndInit(model, doc, fields, userProvidedFields, options, pop, _init); + function _init(err, casted) { + if (err) { + return callback(err); + } + if (options.includeResultMetadata) { + if (doc && casted) { + if (options.session != null) { + casted.$session(options.session); + } + res.value = casted; + } else { + res.value = null; + } + return callback(null, res); + } + if (options.session != null) { + casted.$session(options.session); + } + callback(null, casted); + } + } + function prepareDiscriminatorCriteria(query) { + if (!query || !query.model || !query.model.schema) { + return; + } + const schema = query.model.schema; + if (schema && schema.discriminatorMapping && !schema.discriminatorMapping.isRoot) { + query._conditions[schema.discriminatorMapping.key] = schema.discriminatorMapping.value; + } + } + Query.prototype.findOneAndUpdate = function(filter, doc, options) { + if (typeof filter === "function" || typeof doc === "function" || typeof options === "function" || typeof arguments[3] === "function") { + throw new MongooseError("Query.prototype.findOneAndUpdate() no longer accepts a callback"); + } + this.op = "findOneAndUpdate"; + this._validateOp(); + this._validate(); + switch (arguments.length) { + case 2: + options = void 0; + break; + case 1: + doc = filter; + filter = options = void 0; + break; + } + if (mquery.canMerge(filter)) { + this.merge(filter); + } else if (filter != null) { + this.error( + new ObjectParameterError(filter, "filter", "findOneAndUpdate") + ); + } + if (doc) { + this._mergeUpdate(doc); + } + options = options ? clone(options) : {}; + if (options.projection) { + this.select(options.projection); + delete options.projection; + } + if (options.fields) { + this.select(options.fields); + delete options.fields; + } + const returnOriginal = this && this.model && this.model.base && this.model.base.options && this.model.base.options.returnOriginal; + if (options.new == null && options.returnDocument == null && options.returnOriginal == null && returnOriginal != null) { + options.returnOriginal = returnOriginal; + } + this.setOptions(options); + return this; + }; + Query.prototype._findOneAndUpdate = async function _findOneAndUpdate() { + this._applyTranslateAliases(); + this._castConditions(); + checkRequireFilter(this._conditions, this.options); + _castArrayFilters(this); + if (this.error()) { + throw this.error(); + } + applyGlobalMaxTimeMS(this.options, this.model.db.options, this.model.base.options); + applyGlobalDiskUse(this.options, this.model.db.options, this.model.base.options); + if ("strict" in this.options) { + this._mongooseOptions.strict = this.options.strict; + } + const options = this._optionsForExec(this.model); + convertNewToReturnDocument(options); + this._update = this._castUpdate(this._update); + const _opts = Object.assign({}, options, { + setDefaultsOnInsert: this._mongooseOptions.setDefaultsOnInsert + }); + this._update = setDefaultsOnInsert( + this._conditions, + this.model.schema, + this._update, + _opts + ); + if (!this._update || Object.keys(this._update).length === 0) { + if (options.upsert) { + const $set = clone(this._update); + delete $set._id; + this._update = { $set }; + } else { + this._executionStack = null; + const res2 = await this._findOne(); + return res2; + } + } else if (this._update instanceof Error) { + throw this._update; + } else { + if (this._update.$set && Object.keys(this._update.$set).length === 0) { + delete this._update.$set; + } + } + const runValidators = _getOption(this, "runValidators", false); + if (runValidators) { + await this.validate(this._update, options, false); + } + if (this._update.toBSON) { + this._update = this._update.toBSON(); + } + let res = await this.mongooseCollection.findOneAndUpdate(this._conditions, this._update, options); + for (const fn2 of this._transforms) { + res = fn2(res); + } + const doc = !options.includeResultMetadata ? res : res.value; + return new Promise((resolve, reject) => { + this._completeOne(doc, res, options.projection, (err, res2) => { + if (err) { + return reject(err); + } + resolve(res2); + }); + }); + }; + Query.prototype.findOneAndDelete = function(filter, options) { + if (typeof filter === "function" || typeof options === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Query.prototype.findOneAndDelete() no longer accepts a callback"); + } + this.op = "findOneAndDelete"; + this._validateOp(); + this._validate(); + if (mquery.canMerge(filter)) { + this.merge(filter); + } + options && this.setOptions(options); + return this; + }; + Query.prototype._findOneAndDelete = async function _findOneAndDelete() { + this._applyTranslateAliases(); + this._castConditions(); + checkRequireFilter(this._conditions, this.options); + if (this.error() != null) { + throw this.error(); + } + const includeResultMetadata = this.options.includeResultMetadata; + const filter = this._conditions; + const options = this._optionsForExec(this.model); + let res = await this.mongooseCollection.findOneAndDelete(filter, options); + for (const fn2 of this._transforms) { + res = fn2(res); + } + const doc = !includeResultMetadata ? res : res.value; + return new Promise((resolve, reject) => { + this._completeOne(doc, res, options.projection, (err, res2) => { + if (err) { + return reject(err); + } + resolve(res2); + }); + }); + }; + Query.prototype.findOneAndReplace = function(filter, replacement, options) { + if (typeof filter === "function" || typeof replacement === "function" || typeof options === "function" || typeof arguments[4] === "function") { + throw new MongooseError("Query.prototype.findOneAndReplace() no longer accepts a callback"); + } + this.op = "findOneAndReplace"; + this._validateOp(); + this._validate(); + if (mquery.canMerge(filter)) { + this.merge(filter); + } else if (filter != null) { + this.error( + new ObjectParameterError(filter, "filter", "findOneAndReplace") + ); + } + if (replacement != null) { + this._mergeUpdate(replacement); + } + options = options || {}; + const returnOriginal = this && this.model && this.model.base && this.model.base.options && this.model.base.options.returnOriginal; + if (options.new == null && options.returnDocument == null && options.returnOriginal == null && returnOriginal != null) { + options.returnOriginal = returnOriginal; + } + this.setOptions(options); + return this; + }; + Query.prototype._findOneAndReplace = async function _findOneAndReplace() { + this._applyTranslateAliases(); + this._castConditions(); + checkRequireFilter(this._conditions, this.options); + if (this.error() != null) { + throw this.error(); + } + if ("strict" in this.options) { + this._mongooseOptions.strict = this.options.strict; + delete this.options.strict; + } + const filter = this._conditions; + const options = this._optionsForExec(); + convertNewToReturnDocument(options); + const includeResultMetadata = this.options.includeResultMetadata; + const modelOpts = { skipId: true }; + if ("strict" in this._mongooseOptions) { + modelOpts.strict = this._mongooseOptions.strict; + } + const runValidators = _getOption(this, "runValidators", false); + try { + const update = new this.model(this._update, null, modelOpts); + if (runValidators) { + await update.validate(); + } else if (update.$__.validationError) { + throw update.$__.validationError; + } + this._update = update.toBSON(); + } catch (err) { + if (err instanceof ValidationError) { + throw err; + } + const validationError = new ValidationError(); + validationError.errors[err.path] = err; + throw validationError; + } + let res = await this.mongooseCollection.findOneAndReplace(filter, this._update, options); + for (const fn2 of this._transforms) { + res = fn2(res); + } + const doc = !includeResultMetadata ? res : res.value; + return new Promise((resolve, reject) => { + this._completeOne(doc, res, options.projection, (err, res2) => { + if (err) { + return reject(err); + } + resolve(res2); + }); + }); + }; + Query.prototype.findById = function(id, projection, options) { + return this.findOne({ _id: id }, projection, options); + }; + Query.prototype.findByIdAndUpdate = function(id, update, options) { + return this.findOneAndUpdate({ _id: id }, update, options); + }; + Query.prototype.findByIdAndDelete = function(id, options) { + return this.findOneAndDelete({ _id: id }, options); + }; + function convertNewToReturnDocument(options) { + if ("new" in options) { + options.returnDocument = options["new"] ? "after" : "before"; + delete options["new"]; + } + if ("returnOriginal" in options) { + options.returnDocument = options["returnOriginal"] ? "before" : "after"; + delete options["returnOriginal"]; + } + if (typeof options.returnDocument === "string") { + options.returnOriginal = options.returnDocument === "before"; + } + } + function _getOption(query, option, def) { + const opts = query._optionsForExec(query.model); + if (option in opts) { + return opts[option]; + } + if (option in query.model.base.options) { + return query.model.base.options[option]; + } + return def; + } + function _completeOneLean(schema, doc, path, res, opts, callback) { + if (opts.lean && typeof opts.lean.transform === "function") { + opts.lean.transform(doc); + for (let i4 = 0; i4 < schema.childSchemas.length; i4++) { + const childPath = path ? path + "." + schema.childSchemas[i4].model.path : schema.childSchemas[i4].model.path; + const _schema = schema.childSchemas[i4].schema; + const obj = mpath.get(childPath, doc); + if (obj == null) { + continue; + } + if (Array.isArray(obj)) { + for (let i5 = 0; i5 < obj.length; i5++) { + opts.lean.transform(obj[i5]); + } + } else { + opts.lean.transform(obj); + } + _completeOneLean(_schema, obj, childPath, res, opts); + } + if (callback) { + return callback(null, doc); + } else { + return; + } + } + if (opts.includeResultMetadata) { + return callback(null, res); + } + return callback(null, doc); + } + function _completeManyLean(schema, docs, path, opts) { + if (opts.lean && typeof opts.lean.transform === "function") { + for (const doc of docs) { + opts.lean.transform(doc); + } + for (let i4 = 0; i4 < schema.childSchemas.length; i4++) { + const childPath = path ? path + "." + schema.childSchemas[i4].model.path : schema.childSchemas[i4].model.path; + const _schema = schema.childSchemas[i4].schema; + let doc = mpath.get(childPath, docs); + if (doc == null) { + continue; + } + doc = doc.flat(); + for (let i5 = 0; i5 < doc.length; i5++) { + opts.lean.transform(doc[i5]); + } + _completeManyLean(_schema, doc, childPath, opts); + } + } + return docs; + } + Query.prototype._mergeUpdate = function(doc) { + if (!this._update) { + this._update = Array.isArray(doc) ? [] : {}; + } + if (doc == null || typeof doc === "object" && Object.keys(doc).length === 0) { + return; + } + if (doc instanceof Query) { + if (Array.isArray(this._update)) { + throw new Error("Cannot mix array and object updates"); + } + if (doc._update) { + utils.mergeClone(this._update, doc._update); + } + } else if (Array.isArray(doc)) { + if (!Array.isArray(this._update)) { + throw new Error("Cannot mix array and object updates"); + } + this._update = this._update.concat(doc); + } else { + if (Array.isArray(this._update)) { + throw new Error("Cannot mix array and object updates"); + } + utils.mergeClone(this._update, doc); + } + }; + async function _updateThunk(op2) { + this._applyTranslateAliases(); + this._castConditions(); + checkRequireFilter(this._conditions, this.options); + _castArrayFilters(this); + if (this.error() != null) { + throw this.error(); + } + const castedQuery = this._conditions; + const options = this._optionsForExec(this.model); + this._update = clone(this._update, options); + const isOverwriting = op2 === "replaceOne"; + if (isOverwriting) { + this._update = new this.model(this._update, null, true); + } else { + this._update = this._castUpdate(this._update); + if (this._update == null || Object.keys(this._update).length === 0) { + return { acknowledged: false }; + } + const _opts = Object.assign({}, options, { + setDefaultsOnInsert: this._mongooseOptions.setDefaultsOnInsert + }); + this._update = setDefaultsOnInsert( + this._conditions, + this.model.schema, + this._update, + _opts + ); + } + if (Array.isArray(options.arrayFilters)) { + options.arrayFilters = removeUnusedArrayFilters(this._update, options.arrayFilters); + } + const runValidators = _getOption(this, "runValidators", false); + if (runValidators) { + await this.validate(this._update, options, isOverwriting); + } + if (this._update.toBSON) { + this._update = this._update.toBSON(); + } + return this.mongooseCollection[op2](castedQuery, this._update, options); + } + Query.prototype.validate = async function validate(castedDoc, options, isOverwriting) { + if (typeof arguments[3] === "function") { + throw new MongooseError("Query.prototype.validate() no longer accepts a callback"); + } + await _executePreHooks(this, "validate"); + if (isOverwriting) { + await castedDoc.$validate(); + } else { + await new Promise((resolve, reject) => { + updateValidators(this, this.model.schema, castedDoc, options, (err) => { + if (err != null) { + return reject(err); + } + resolve(); + }); + }); + } + await _executePostHooks(this, null, null, "validate"); + }; + Query.prototype._updateMany = async function _updateMany() { + return _updateThunk.call(this, "updateMany"); + }; + Query.prototype._updateOne = async function _updateOne() { + return _updateThunk.call(this, "updateOne"); + }; + Query.prototype._replaceOne = async function _replaceOne() { + return _updateThunk.call(this, "replaceOne"); + }; + Query.prototype.updateMany = function(conditions, doc, options, callback) { + if (typeof options === "function") { + callback = options; + options = null; + } else if (typeof doc === "function") { + callback = doc; + doc = conditions; + conditions = {}; + options = null; + } else if (typeof conditions === "function") { + callback = conditions; + conditions = void 0; + doc = void 0; + options = void 0; + } else if (typeof conditions === "object" && !doc && !options && !callback) { + doc = conditions; + conditions = void 0; + options = void 0; + callback = void 0; + } + return _update(this, "updateMany", conditions, doc, options, callback); + }; + Query.prototype.updateOne = function(conditions, doc, options, callback) { + if (typeof options === "function") { + callback = options; + options = null; + } else if (typeof doc === "function") { + callback = doc; + doc = conditions; + conditions = {}; + options = null; + } else if (typeof conditions === "function") { + callback = conditions; + conditions = void 0; + doc = void 0; + options = void 0; + } else if (typeof conditions === "object" && !doc && !options && !callback) { + doc = conditions; + conditions = void 0; + options = void 0; + callback = void 0; + } + return _update(this, "updateOne", conditions, doc, options, callback); + }; + Query.prototype.replaceOne = function(conditions, doc, options, callback) { + if (typeof options === "function") { + callback = options; + options = null; + } else if (typeof doc === "function") { + callback = doc; + doc = conditions; + conditions = {}; + options = null; + } else if (typeof conditions === "function") { + callback = conditions; + conditions = void 0; + doc = void 0; + options = void 0; + } else if (typeof conditions === "object" && !doc && !options && !callback) { + doc = conditions; + conditions = void 0; + options = void 0; + callback = void 0; + } + return _update(this, "replaceOne", conditions, doc, options, callback); + }; + function _update(query, op2, filter, doc, options, callback) { + query.op = op2; + query._validateOp(); + doc = doc || {}; + if (options != null) { + if ("strict" in options) { + query._mongooseOptions.strict = options.strict; + } + } + if (!(filter instanceof Query) && filter != null && filter.toString() !== "[object Object]") { + query.error(new ObjectParameterError(filter, "filter", op2)); + } else { + query.merge(filter); + } + if (utils.isObject(options)) { + query.setOptions(options); + } + query._mergeUpdate(doc); + if (callback) { + query.exec(callback); + return query; + } + return query; + } + Query.prototype.transform = function(fn2) { + this._transforms.push(fn2); + return this; + }; + Query.prototype.orFail = function(err) { + this.transform((res) => { + switch (this.op) { + case "find": + if (res.length === 0) { + throw _orFailError(err, this); + } + break; + case "findOne": + if (res == null) { + throw _orFailError(err, this); + } + break; + case "replaceOne": + case "updateMany": + case "updateOne": + if (res && res.matchedCount === 0) { + throw _orFailError(err, this); + } + break; + case "findOneAndDelete": + case "findOneAndUpdate": + case "findOneAndReplace": + if (this.options.includeResultMetadata && res != null && res.value == null) { + throw _orFailError(err, this); + } + if (!this.options.includeResultMetadata && res == null) { + throw _orFailError(err, this); + } + break; + case "deleteMany": + case "deleteOne": + if (res.deletedCount === 0) { + throw _orFailError(err, this); + } + break; + default: + break; + } + return res; + }); + return this; + }; + function _orFailError(err, query) { + if (typeof err === "function") { + err = err.call(query); + } + if (err == null) { + err = new DocumentNotFoundError(query.getQuery(), query.model.modelName); + } + return err; + } + Query.prototype.isPathSelectedInclusive = function(path) { + return isPathSelectedInclusive(this._fields, path); + }; + Query.prototype.exec = async function exec(op2) { + if (typeof op2 === "function" || arguments.length >= 2 && typeof arguments[1] === "function") { + throw new MongooseError("Query.prototype.exec() no longer accepts a callback"); + } + if (typeof op2 === "string") { + this.op = op2; + } + if (this.op == null) { + throw new MongooseError("Query must have `op` before executing"); + } + if (this.model == null) { + throw new MongooseError("Query must have an associated model before executing"); + } + const thunk = opToThunk.get(this.op); + if (!thunk) { + throw new MongooseError('Query has invalid `op`: "' + this.op + '"'); + } + if (this.options && this.options.sort && typeof this.options.sort === "object" && Object.hasOwn(this.options.sort, "")) { + throw new Error('Invalid field "" passed to sort()'); + } + if (this._executionStack != null) { + let str = this.toString(); + if (str.length > 60) { + str = str.slice(0, 60) + "..."; + } + const err = new MongooseError("Query was already executed: " + str); + if (!this.model.base.options.skipOriginalStackTraces) { + err.originalStack = this._executionStack; + } + throw err; + } else { + this._executionStack = this.model.base.options.skipOriginalStackTraces ? true : new Error().stack; + } + let skipWrappedFunction = null; + try { + await _executePreExecHooks(this); + } catch (err) { + if (err instanceof Kareem.skipWrappedFunction) { + skipWrappedFunction = err; + } else { + throw err; + } + } + let res; + let error2 = null; + try { + await _executePreHooks(this); + res = skipWrappedFunction ? skipWrappedFunction.args[0] : await this[thunk](); + for (const fn2 of this._transforms) { + res = fn2(res); + } + } catch (err) { + if (err instanceof Kareem.skipWrappedFunction) { + res = err.args[0]; + } else { + error2 = err; + } + error2 = this.model.schema._transformDuplicateKeyError(error2); + } + res = await _executePostHooks(this, res, error2); + await _executePostExecHooks(this); + return res; + }; + function _executePostExecHooks(query) { + return new Promise((resolve, reject) => { + query._hooks.execPost("exec", query, [], {}, (error2) => { + if (error2) { + return reject(error2); + } + resolve(); + }); + }); + } + function _executePostHooks(query, res, error2, op2) { + if (query._queryMiddleware == null) { + if (error2 != null) { + throw error2; + } + return res; + } + return new Promise((resolve, reject) => { + const opts = error2 ? { error: error2 } : {}; + query._queryMiddleware.execPost(op2 || query.op, query, [res], opts, (error3, res2) => { + if (error3) { + return reject(error3); + } + resolve(res2); + }); + }); + } + function _executePreExecHooks(query) { + return new Promise((resolve, reject) => { + query._hooks.execPre("exec", query, [], (error2) => { + if (error2 != null) { + return reject(error2); + } + resolve(); + }); + }); + } + function _executePreHooks(query, op2) { + if (query._queryMiddleware == null) { + return; + } + return new Promise((resolve, reject) => { + query._queryMiddleware.execPre(op2 || query.op, query, [], (error2) => { + if (error2 != null) { + return reject(error2); + } + resolve(); + }); + }); + } + Query.prototype.then = function(resolve, reject) { + return this.exec().then(resolve, reject); + }; + Query.prototype.catch = function(reject) { + return this.exec().then(null, reject); + }; + Query.prototype.finally = function(onFinally) { + return this.exec().finally(onFinally); + }; + Query.prototype[Symbol.toStringTag] = function toString() { + return `Query { ${this.op} }`; + }; + Query.prototype.pre = function(fn2) { + this._hooks.pre("exec", fn2); + return this; + }; + Query.prototype.post = function(fn2) { + this._hooks.post("exec", fn2); + return this; + }; + Query.prototype._castUpdate = function _castUpdate(obj) { + let schema = this.schema; + const discriminatorKey = schema.options.discriminatorKey; + const baseSchema = schema._baseSchema ? schema._baseSchema : schema; + if (this._mongooseOptions.overwriteDiscriminatorKey && obj[discriminatorKey] != null && baseSchema.discriminators) { + const _schema = Object.values(baseSchema.discriminators).find( + (discriminator) => discriminator.discriminatorMapping.value === obj[discriminatorKey] + ); + if (_schema != null) { + schema = _schema; + } + } + let upsert; + if ("upsert" in this.options) { + upsert = this.options.upsert; + } + return castUpdate(schema, obj, { + strict: this._mongooseOptions.strict, + upsert, + arrayFilters: this.options.arrayFilters, + overwriteDiscriminatorKey: this._mongooseOptions.overwriteDiscriminatorKey, + overwriteImmutable: this._mongooseOptions.overwriteImmutable + }, this, this._conditions); + }; + Query.prototype.populate = function() { + const args2 = Array.from(arguments); + if (!args2.some(Boolean)) { + return this; + } + const res = utils.populate.apply(null, args2); + const opts = this._mongooseOptions; + if (opts.lean != null) { + const lean = opts.lean; + for (const populateOptions of res) { + if ((populateOptions && populateOptions.options && populateOptions.options.lean) == null) { + populateOptions.options = populateOptions.options || {}; + populateOptions.options.lean = lean; + } + } + } + if (!utils.isObject(opts.populate)) { + opts.populate = {}; + } + const pop = opts.populate; + for (const populateOptions of res) { + const path = populateOptions.path; + if (pop[path] && pop[path].populate && populateOptions.populate) { + populateOptions.populate = pop[path].populate.concat(populateOptions.populate); + } + pop[populateOptions.path] = populateOptions; + } + return this; + }; + Query.prototype.getPopulatedPaths = function getPopulatedPaths() { + const obj = this._mongooseOptions.populate || {}; + const ret = Object.keys(obj); + for (const path of Object.keys(obj)) { + const pop = obj[path]; + if (!Array.isArray(pop.populate)) { + continue; + } + _getPopulatedPaths(ret, pop.populate, path + "."); + } + return ret; + }; + function _getPopulatedPaths(list2, arr, prefix) { + for (const pop of arr) { + list2.push(prefix + pop.path); + if (!Array.isArray(pop.populate)) { + continue; + } + _getPopulatedPaths(list2, pop.populate, prefix + pop.path + "."); + } + } + Query.prototype.cast = function(model, obj) { + obj || (obj = this._conditions); + model = model || this.model; + const discriminatorKey = model.schema.options.discriminatorKey; + if (obj != null && Object.hasOwn(obj, discriminatorKey)) { + model = getDiscriminatorByValue(model.discriminators, obj[discriminatorKey]) || model; + } + const opts = { upsert: this.options && this.options.upsert }; + if (this.options) { + if ("strict" in this.options) { + opts.strict = this.options.strict; + } + if ("strictQuery" in this.options) { + opts.strictQuery = this.options.strictQuery; + } + } + if ("sanitizeFilter" in this._mongooseOptions) { + opts.sanitizeFilter = this._mongooseOptions.sanitizeFilter; + } + try { + return cast(model.schema, obj, opts, this); + } catch (err) { + if (typeof err.setModel === "function") { + err.setModel(model); + } + throw err; + } + }; + Query.prototype._castFields = function _castFields(fields) { + let selected, elemMatchKeys, keys, key, out; + if (fields) { + keys = Object.keys(fields); + elemMatchKeys = []; + for (let i4 = 0; i4 < keys.length; ++i4) { + key = keys[i4]; + if (fields[key].$elemMatch) { + selected || (selected = {}); + selected[key] = fields[key]; + elemMatchKeys.push(key); + } + } + } + if (selected) { + try { + out = this.cast(this.model, selected); + } catch (err) { + return err; + } + for (let i4 = 0; i4 < elemMatchKeys.length; ++i4) { + key = elemMatchKeys[i4]; + fields[key] = out[key]; + } + } + return fields; + }; + Query.prototype._applyPaths = function applyPaths() { + if (!this.model) { + return; + } + this._fields = this._fields || {}; + let sanitizeProjection2 = void 0; + if (this.model != null && utils.hasUserDefinedProperty(this.model.db.options, "sanitizeProjection")) { + sanitizeProjection2 = this.model.db.options.sanitizeProjection; + } else if (this.model != null && utils.hasUserDefinedProperty(this.model.base.options, "sanitizeProjection")) { + sanitizeProjection2 = this.model.base.options.sanitizeProjection; + } else { + sanitizeProjection2 = this._mongooseOptions.sanitizeProjection; + } + const schemaLevelProjections = this._mongooseOptions.schemaLevelProjections ?? true; + if (schemaLevelProjections) { + helpers.applyPaths(this._fields, this.model.schema, sanitizeProjection2); + } + let _selectPopulatedPaths = true; + if ("selectPopulatedPaths" in this.model.base.options) { + _selectPopulatedPaths = this.model.base.options.selectPopulatedPaths; + } + if ("selectPopulatedPaths" in this.model.schema.options) { + _selectPopulatedPaths = this.model.schema.options.selectPopulatedPaths; + } + if (_selectPopulatedPaths) { + selectPopulatedFields(this._fields, this._userProvidedFields, this._mongooseOptions.populate); + } + }; + Query.prototype.cursor = function cursor2(opts) { + if (opts) { + this.setOptions(opts); + } + try { + this.cast(this.model); + } catch (err) { + return new QueryCursor(this)._markError(err); + } + return new QueryCursor(this); + }; + Query.prototype.tailable = function(val, opts) { + if (val != null && typeof val.constructor === "function" && val.constructor.name === "Object") { + opts = val; + val = true; + } + if (val === void 0) { + val = true; + } + if (opts && typeof opts === "object") { + for (const key of Object.keys(opts)) { + if (key === "awaitData" || key === "awaitdata") { + this.options["awaitData"] = !!opts[key]; + } else { + this.options[key] = opts[key]; + } + } + } + this.options.tailable = arguments.length ? !!val : true; + return this; + }; + Query.prototype.near = function() { + const params = []; + const sphere = this._mongooseOptions.nearSphere; + if (arguments.length === 1) { + if (Array.isArray(arguments[0])) { + params.push({ center: arguments[0], spherical: sphere }); + } else if (typeof arguments[0] === "string") { + params.push(arguments[0]); + } else if (utils.isObject(arguments[0])) { + if (typeof arguments[0].spherical !== "boolean") { + arguments[0].spherical = sphere; + } + params.push(arguments[0]); + } else { + throw new TypeError("invalid argument"); + } + } else if (arguments.length === 2) { + if (typeof arguments[0] === "number" && typeof arguments[1] === "number") { + params.push({ center: [arguments[0], arguments[1]], spherical: sphere }); + } else if (typeof arguments[0] === "string" && Array.isArray(arguments[1])) { + params.push(arguments[0]); + params.push({ center: arguments[1], spherical: sphere }); + } else if (typeof arguments[0] === "string" && utils.isObject(arguments[1])) { + params.push(arguments[0]); + if (typeof arguments[1].spherical !== "boolean") { + arguments[1].spherical = sphere; + } + params.push(arguments[1]); + } else { + throw new TypeError("invalid argument"); + } + } else if (arguments.length === 3) { + if (typeof arguments[0] === "string" && typeof arguments[1] === "number" && typeof arguments[2] === "number") { + params.push(arguments[0]); + params.push({ center: [arguments[1], arguments[2]], spherical: sphere }); + } else { + throw new TypeError("invalid argument"); + } + } else { + throw new TypeError("invalid argument"); + } + return Query.base.near.apply(this, params); + }; + Query.prototype.nearSphere = function() { + this._mongooseOptions.nearSphere = true; + this.near.apply(this, arguments); + return this; + }; + if (Symbol.asyncIterator != null) { + Query.prototype[Symbol.asyncIterator] = function queryAsyncIterator() { + this._mongooseOptions._asyncIterator = true; + return this.cursor(); + }; + } + Query.prototype.box = function(ll, ur) { + if (!Array.isArray(ll) && utils.isObject(ll)) { + ur = ll.ur; + ll = ll.ll; + } + return Query.base.box.call(this, ll, ur); + }; + Query.prototype.center = Query.base.circle; + Query.prototype.centerSphere = function() { + if (arguments[0] != null && typeof arguments[0].constructor === "function" && arguments[0].constructor.name === "Object") { + arguments[0].spherical = true; + } + if (arguments[1] != null && typeof arguments[1].constructor === "function" && arguments[1].constructor.name === "Object") { + arguments[1].spherical = true; + } + Query.base.circle.apply(this, arguments); + }; + Query.prototype.selectedInclusively = function selectedInclusively() { + return isInclusive(this._fields); + }; + Query.prototype.selectedExclusively = function selectedExclusively() { + return isExclusive(this._fields); + }; + Query.prototype.model; + module2.exports = Query; + } +}); + +// node_modules/mongoose/lib/cursor/aggregationCursor.js +var require_aggregationCursor = __commonJS({ + "node_modules/mongoose/lib/cursor/aggregationCursor.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var Readable = require("stream").Readable; + var eachAsync = require_eachAsync(); + var immediate = require_immediate(); + var kareem = require_kareem(); + var util = require("util"); + function AggregationCursor(agg) { + Readable.call(this, { autoDestroy: true, objectMode: true }); + this.cursor = null; + this.agg = agg; + this._transforms = []; + const connection = agg._connection; + const model = agg._model; + delete agg.options.cursor.useMongooseAggCursor; + this._mongooseOptions = {}; + if (connection) { + this.cursor = connection.db.aggregate(agg._pipeline, agg.options || {}); + setImmediate(() => this.emit("cursor", this.cursor)); + } else { + _init(model, this, agg); + } + } + util.inherits(AggregationCursor, Readable); + function _init(model, c4, agg) { + if (!model.collection.buffer) { + model.hooks.execPre("aggregate", agg, function(err) { + if (err != null) { + _handlePreHookError(c4, err); + return; + } + if (typeof agg.options?.cursor?.transform === "function") { + c4._transforms.push(agg.options.cursor.transform); + } + c4.cursor = model.collection.aggregate(agg._pipeline, agg.options || {}); + c4.emit("cursor", c4.cursor); + }); + } else { + model.collection.emitter.once("queue", function() { + model.hooks.execPre("aggregate", agg, function(err) { + if (err != null) { + _handlePreHookError(c4, err); + return; + } + if (typeof agg.options?.cursor?.transform === "function") { + c4._transforms.push(agg.options.cursor.transform); + } + c4.cursor = model.collection.aggregate(agg._pipeline, agg.options || {}); + c4.emit("cursor", c4.cursor); + }); + }); + } + } + function _handlePreHookError(queryCursor, err) { + if (err instanceof kareem.skipWrappedFunction) { + const resultValue = err.args[0]; + if (resultValue != null && (!Array.isArray(resultValue) || resultValue.length)) { + const err2 = new MongooseError( + 'Cannot `skipMiddlewareFunction()` with a value when using `.aggregate().cursor()`, value must be nullish or empty array, got "' + util.inspect(resultValue) + '".' + ); + queryCursor._markError(err2); + queryCursor.listeners("error").length > 0 && queryCursor.emit("error", err2); + return; + } + queryCursor.emit("cursor", null); + return; + } + queryCursor._markError(err); + queryCursor.listeners("error").length > 0 && queryCursor.emit("error", err); + } + AggregationCursor.prototype._read = function() { + const _this = this; + _next(this, function(error2, doc) { + if (error2) { + return _this.emit("error", error2); + } + if (!doc) { + _this.push(null); + _this.cursor.close(function(error3) { + if (error3) { + return _this.emit("error", error3); + } + }); + return; + } + _this.push(doc); + }); + }; + if (Symbol.asyncIterator != null) { + const msg = "Mongoose does not support using async iterators with an existing aggregation cursor. See https://bit.ly/mongoose-async-iterate-aggregation"; + AggregationCursor.prototype[Symbol.asyncIterator] = function() { + throw new MongooseError(msg); + }; + } + Object.defineProperty(AggregationCursor.prototype, "map", { + value: function(fn2) { + this._transforms.push(fn2); + return this; + }, + enumerable: true, + configurable: true, + writable: true + }); + AggregationCursor.prototype._markError = function(error2) { + this._error = error2; + return this; + }; + AggregationCursor.prototype.close = async function close() { + if (typeof arguments[0] === "function") { + throw new MongooseError("AggregationCursor.prototype.close() no longer accepts a callback"); + } + try { + await this.cursor.close(); + } catch (error2) { + this.listeners("error").length > 0 && this.emit("error", error2); + throw error2; + } + this.emit("close"); + }; + AggregationCursor.prototype._destroy = function _destroy(_err, callback) { + let waitForCursor = null; + if (!this.cursor) { + waitForCursor = new Promise((resolve) => { + this.once("cursor", resolve); + }); + } else { + waitForCursor = Promise.resolve(); + } + waitForCursor.then(() => this.cursor.close()).then(() => { + this._closed = true; + callback(); + }).catch((error2) => { + callback(error2); + }); + return this; + }; + AggregationCursor.prototype.next = async function next() { + if (typeof arguments[0] === "function") { + throw new MongooseError("AggregationCursor.prototype.next() no longer accepts a callback"); + } + return new Promise((resolve, reject) => { + _next(this, (err, res) => { + if (err != null) { + return reject(err); + } + resolve(res); + }); + }); + }; + AggregationCursor.prototype.eachAsync = function(fn2, opts) { + if (typeof arguments[2] === "function") { + throw new MongooseError("AggregationCursor.prototype.eachAsync() no longer accepts a callback"); + } + const _this = this; + if (typeof opts === "function") { + opts = {}; + } + opts = opts || {}; + return eachAsync(function(cb) { + return _next(_this, cb); + }, fn2, opts); + }; + if (Symbol.asyncIterator != null) { + AggregationCursor.prototype[Symbol.asyncIterator] = function() { + return this.transformNull()._transformForAsyncIterator(); + }; + } + AggregationCursor.prototype._transformForAsyncIterator = function() { + if (this._transforms.indexOf(_transformForAsyncIterator) === -1) { + this.map(_transformForAsyncIterator); + } + return this; + }; + AggregationCursor.prototype.transformNull = function(val) { + if (arguments.length === 0) { + val = true; + } + this._mongooseOptions.transformNull = val; + return this; + }; + function _transformForAsyncIterator(doc) { + return doc == null ? { done: true } : { value: doc, done: false }; + } + AggregationCursor.prototype.addCursorFlag = function(flag, value) { + const _this = this; + _waitForCursor(this, function() { + _this.cursor.addCursorFlag(flag, value); + }); + return this; + }; + function _waitForCursor(ctx, cb) { + if (ctx.cursor) { + return cb(); + } + ctx.once("cursor", function() { + cb(); + }); + } + function _next(ctx, cb) { + let callback = cb; + if (ctx._transforms.length) { + callback = function(err, doc) { + if (err || doc === null && !ctx._mongooseOptions.transformNull) { + return cb(err, doc); + } + cb(err, ctx._transforms.reduce(function(doc2, fn2) { + return fn2(doc2); + }, doc)); + }; + } + if (ctx._error) { + return immediate(function() { + callback(ctx._error); + }); + } + if (ctx.cursor) { + return ctx.cursor.next().then( + (doc) => { + if (!doc) { + return callback(null, null); + } + callback(null, doc); + }, + (err) => callback(err) + ); + } else { + ctx.once("error", cb); + ctx.once("cursor", function() { + _next(ctx, cb); + }); + } + } + module2.exports = AggregationCursor; + } +}); + +// node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js +var require_prepareDiscriminatorPipeline = __commonJS({ + "node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js"(exports2, module2) { + "use strict"; + module2.exports = function prepareDiscriminatorPipeline(pipeline, schema, prefix) { + const discriminatorMapping = schema && schema.discriminatorMapping; + prefix = prefix || ""; + if (discriminatorMapping && !discriminatorMapping.isRoot) { + const originalPipeline = pipeline; + const filterKey = (prefix.length > 0 ? prefix + "." : prefix) + discriminatorMapping.key; + const discriminatorValue = discriminatorMapping.value; + if (originalPipeline[0] != null && originalPipeline[0].$match && (originalPipeline[0].$match[filterKey] === void 0 || originalPipeline[0].$match[filterKey] === discriminatorValue)) { + originalPipeline[0].$match[filterKey] = discriminatorValue; + } else if (originalPipeline[0] != null && originalPipeline[0].$geoNear) { + originalPipeline[0].$geoNear.query = originalPipeline[0].$geoNear.query || {}; + originalPipeline[0].$geoNear.query[filterKey] = discriminatorValue; + } else if (originalPipeline[0] != null && originalPipeline[0].$search) { + if (originalPipeline[1] && originalPipeline[1].$match != null) { + originalPipeline[1].$match[filterKey] = originalPipeline[1].$match[filterKey] || discriminatorValue; + } else { + const match = {}; + match[filterKey] = discriminatorValue; + originalPipeline.splice(1, 0, { $match: match }); + } + } else { + const match = {}; + match[filterKey] = discriminatorValue; + originalPipeline.unshift({ $match: match }); + } + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js +var require_stringifyFunctionOperators = __commonJS({ + "node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js"(exports2, module2) { + "use strict"; + module2.exports = function stringifyFunctionOperators(pipeline) { + if (!Array.isArray(pipeline)) { + return; + } + for (const stage of pipeline) { + if (stage == null) { + continue; + } + const canHaveAccumulator = stage.$group || stage.$bucket || stage.$bucketAuto; + if (canHaveAccumulator != null) { + for (const key of Object.keys(canHaveAccumulator)) { + handleAccumulator(canHaveAccumulator[key]); + } + } + const stageType = Object.keys(stage)[0]; + if (stageType && typeof stage[stageType] === "object") { + const stageOptions = stage[stageType]; + for (const key of Object.keys(stageOptions)) { + if (stageOptions[key] != null && stageOptions[key].$function != null && typeof stageOptions[key].$function.body === "function") { + stageOptions[key].$function.body = stageOptions[key].$function.body.toString(); + } + } + } + if (stage.$facet != null) { + for (const key of Object.keys(stage.$facet)) { + stringifyFunctionOperators(stage.$facet[key]); + } + } + } + }; + function handleAccumulator(operator) { + if (operator == null || operator.$accumulator == null) { + return; + } + for (const key of ["init", "accumulate", "merge", "finalize"]) { + if (typeof operator.$accumulator[key] === "function") { + operator.$accumulator[key] = String(operator.$accumulator[key]); + } + } + } + } +}); + +// node_modules/mongoose/lib/aggregate.js +var require_aggregate2 = __commonJS({ + "node_modules/mongoose/lib/aggregate.js"(exports2, module2) { + "use strict"; + var AggregationCursor = require_aggregationCursor(); + var MongooseError = require_mongooseError(); + var Query = require_query2(); + var { applyGlobalMaxTimeMS, applyGlobalDiskUse } = require_applyGlobalOption(); + var clone = require_clone(); + var getConstructorName = require_getConstructorName(); + var prepareDiscriminatorPipeline = require_prepareDiscriminatorPipeline(); + var stringifyFunctionOperators = require_stringifyFunctionOperators(); + var utils = require_utils6(); + var { modelSymbol } = require_symbols(); + var read = Query.prototype.read; + var readConcern = Query.prototype.readConcern; + var validRedactStringValues = /* @__PURE__ */ new Set(["$$DESCEND", "$$PRUNE", "$$KEEP"]); + function Aggregate(pipeline, modelOrConn) { + this._pipeline = []; + if (modelOrConn == null || modelOrConn[modelSymbol]) { + this._model = modelOrConn; + } else { + this._connection = modelOrConn; + } + this.options = {}; + if (arguments.length === 1 && Array.isArray(pipeline)) { + this.append.apply(this, pipeline); + } + } + Aggregate.prototype.options; + Aggregate.prototype._optionsForExec = function() { + const options = this.options || {}; + const asyncLocalStorage = this.model()?.db?.base.transactionAsyncLocalStorage?.getStore(); + if (!Object.hasOwn(options, "session") && asyncLocalStorage?.session != null) { + options.session = asyncLocalStorage.session; + } + return options; + }; + Aggregate.prototype.model = function(model) { + if (arguments.length === 0) { + return this._model; + } + this._model = model; + if (model.schema != null) { + if (this.options.readPreference == null && model.schema.options.read != null) { + this.options.readPreference = model.schema.options.read; + } + if (this.options.collation == null && model.schema.options.collation != null) { + this.options.collation = model.schema.options.collation; + } + } + return model; + }; + Aggregate.prototype.append = function() { + const args2 = arguments.length === 1 && Array.isArray(arguments[0]) ? arguments[0] : [...arguments]; + if (!args2.every(isOperator)) { + throw new Error("Arguments must be aggregate pipeline operators"); + } + this._pipeline = this._pipeline.concat(args2); + return this; + }; + Aggregate.prototype.addFields = function(arg) { + if (typeof arg !== "object" || arg === null || Array.isArray(arg)) { + throw new Error("Invalid addFields() argument. Must be an object"); + } + return this.append({ $addFields: Object.assign({}, arg) }); + }; + Aggregate.prototype.project = function(arg) { + const fields = {}; + if (typeof arg === "object" && !Array.isArray(arg)) { + Object.keys(arg).forEach(function(field) { + fields[field] = arg[field]; + }); + } else if (arguments.length === 1 && typeof arg === "string") { + arg.split(/\s+/).forEach(function(field) { + if (!field) { + return; + } + const include = field[0] === "-" ? 0 : 1; + if (include === 0) { + field = field.substring(1); + } + fields[field] = include; + }); + } else { + throw new Error("Invalid project() argument. Must be string or object"); + } + return this.append({ $project: fields }); + }; + Aggregate.prototype.near = function(arg) { + if (arg == null) { + throw new MongooseError("Aggregate `near()` must be called with non-nullish argument"); + } + if (arg.near == null) { + throw new MongooseError("Aggregate `near()` argument must have a `near` property"); + } + const coordinates = Array.isArray(arg.near) ? arg.near : arg.near.coordinates; + if (typeof arg.near === "object" && (!Array.isArray(coordinates) || coordinates.length < 2 || coordinates.find((c4) => typeof c4 !== "number"))) { + throw new MongooseError(`Aggregate \`near()\` argument has invalid coordinates, got "${coordinates}"`); + } + const op2 = {}; + op2.$geoNear = arg; + return this.append(op2); + }; + "group match skip limit out densify fill".split(" ").forEach(function($operator) { + Aggregate.prototype[$operator] = function(arg) { + const op2 = {}; + op2["$" + $operator] = arg; + return this.append(op2); + }; + }); + Aggregate.prototype.unwind = function() { + const args2 = [...arguments]; + const res = []; + for (const arg of args2) { + if (arg && typeof arg === "object") { + res.push({ $unwind: arg }); + } else if (typeof arg === "string") { + res.push({ + $unwind: arg[0] === "$" ? arg : "$" + arg + }); + } else { + throw new Error('Invalid arg "' + arg + '" to unwind(), must be string or object'); + } + } + return this.append.apply(this, res); + }; + Aggregate.prototype.replaceRoot = function(newRoot) { + let ret; + if (typeof newRoot === "string") { + ret = newRoot.startsWith("$") ? newRoot : "$" + newRoot; + } else { + ret = newRoot; + } + return this.append({ + $replaceRoot: { + newRoot: ret + } + }); + }; + Aggregate.prototype.count = function(fieldName) { + return this.append({ $count: fieldName }); + }; + Aggregate.prototype.sortByCount = function(arg) { + if (arg && typeof arg === "object") { + return this.append({ $sortByCount: arg }); + } else if (typeof arg === "string") { + return this.append({ + $sortByCount: arg[0] === "$" ? arg : "$" + arg + }); + } else { + throw new TypeError('Invalid arg "' + arg + '" to sortByCount(), must be string or object'); + } + }; + Aggregate.prototype.lookup = function(options) { + return this.append({ $lookup: options }); + }; + Aggregate.prototype.graphLookup = function(options) { + const cloneOptions = {}; + if (options) { + if (!utils.isObject(options)) { + throw new TypeError("Invalid graphLookup() argument. Must be an object."); + } + utils.mergeClone(cloneOptions, options); + const startWith = cloneOptions.startWith; + if (startWith && typeof startWith === "string") { + cloneOptions.startWith = cloneOptions.startWith.startsWith("$") ? cloneOptions.startWith : "$" + cloneOptions.startWith; + } + } + return this.append({ $graphLookup: cloneOptions }); + }; + Aggregate.prototype.sample = function(size) { + return this.append({ $sample: { size } }); + }; + Aggregate.prototype.sort = function(arg) { + const sort = {}; + if (getConstructorName(arg) === "Object") { + const desc = ["desc", "descending", -1]; + Object.keys(arg).forEach(function(field) { + if (arg[field] instanceof Object && arg[field].$meta) { + sort[field] = arg[field]; + return; + } + sort[field] = desc.indexOf(arg[field]) === -1 ? 1 : -1; + }); + } else if (arguments.length === 1 && typeof arg === "string") { + arg.split(/\s+/).forEach(function(field) { + if (!field) { + return; + } + const ascend = field[0] === "-" ? -1 : 1; + if (ascend === -1) { + field = field.substring(1); + } + sort[field] = ascend; + }); + } else { + throw new TypeError("Invalid sort() argument. Must be a string or object."); + } + return this.append({ $sort: sort }); + }; + Aggregate.prototype.unionWith = function(options) { + return this.append({ $unionWith: options }); + }; + Aggregate.prototype.read = function(pref, tags) { + read.call(this, pref, tags); + return this; + }; + Aggregate.prototype.readConcern = function(level) { + readConcern.call(this, level); + return this; + }; + Aggregate.prototype.redact = function(expression, thenExpr, elseExpr) { + if (arguments.length === 3) { + if (typeof thenExpr === "string" && !validRedactStringValues.has(thenExpr) || typeof elseExpr === "string" && !validRedactStringValues.has(elseExpr)) { + throw new Error("If thenExpr or elseExpr is string, it must be either $$DESCEND, $$PRUNE or $$KEEP"); + } + expression = { + $cond: { + if: expression, + then: thenExpr, + else: elseExpr + } + }; + } else if (arguments.length !== 1) { + throw new TypeError("Invalid arguments"); + } + return this.append({ $redact: expression }); + }; + Aggregate.prototype.explain = async function explain(verbosity) { + if (typeof verbosity === "function" || typeof arguments[1] === "function") { + throw new MongooseError("Aggregate.prototype.explain() no longer accepts a callback"); + } + const model = this._model; + if (!this._pipeline.length) { + throw new Error("Aggregate has empty pipeline"); + } + prepareDiscriminatorPipeline(this._pipeline, this._model.schema); + await new Promise((resolve, reject) => { + model.hooks.execPre("aggregate", this, (error2) => { + if (error2) { + const _opts2 = { error: error2 }; + return model.hooks.execPost("aggregate", this, [null], _opts2, (error3) => { + reject(error3); + }); + } else { + resolve(); + } + }); + }); + const cursor2 = model.collection.aggregate(this._pipeline, this.options); + if (verbosity == null) { + verbosity = true; + } + let result = null; + try { + result = await cursor2.explain(verbosity); + } catch (error2) { + await new Promise((resolve, reject) => { + const _opts2 = { error: error2 }; + model.hooks.execPost("aggregate", this, [null], _opts2, (error3) => { + if (error3) { + return reject(error3); + } + return resolve(); + }); + }); + } + const _opts = { error: null }; + await new Promise((resolve, reject) => { + model.hooks.execPost("aggregate", this, [result], _opts, (error2) => { + if (error2) { + return reject(error2); + } + return resolve(); + }); + }); + return result; + }; + Aggregate.prototype.allowDiskUse = function(value) { + this.options.allowDiskUse = value; + return this; + }; + Aggregate.prototype.hint = function(value) { + this.options.hint = value; + return this; + }; + Aggregate.prototype.session = function(session) { + if (session == null) { + delete this.options.session; + } else { + this.options.session = session; + } + return this; + }; + Aggregate.prototype.option = function(value) { + for (const key in value) { + this.options[key] = value[key]; + } + return this; + }; + Aggregate.prototype.cursor = function(options) { + this._optionsForExec(); + this.options.cursor = options || {}; + return new AggregationCursor(this); + }; + Aggregate.prototype.collation = function(collation) { + this.options.collation = collation; + return this; + }; + Aggregate.prototype.facet = function(options) { + return this.append({ $facet: options }); + }; + Aggregate.prototype.search = function(options) { + return this.append({ $search: options }); + }; + Aggregate.prototype.pipeline = function() { + return this._pipeline; + }; + Aggregate.prototype.exec = async function exec() { + if (!this._model && !this._connection) { + throw new Error("Aggregate not bound to any Model"); + } + if (typeof arguments[0] === "function") { + throw new MongooseError("Aggregate.prototype.exec() no longer accepts a callback"); + } + if (this._connection) { + if (!this._pipeline.length) { + throw new MongooseError("Aggregate has empty pipeline"); + } + this._optionsForExec(); + const cursor2 = await this._connection.client.db().aggregate(this._pipeline, this.options); + return await cursor2.toArray(); + } + const model = this._model; + const collection = this._model.collection; + applyGlobalMaxTimeMS(this.options, model.db.options, model.base.options); + applyGlobalDiskUse(this.options, model.db.options, model.base.options); + this._optionsForExec(); + if (this.options && this.options.cursor) { + return new AggregationCursor(this); + } + prepareDiscriminatorPipeline(this._pipeline, this._model.schema); + stringifyFunctionOperators(this._pipeline); + await new Promise((resolve, reject) => { + model.hooks.execPre("aggregate", this, (error2) => { + if (error2) { + const _opts2 = { error: error2 }; + return model.hooks.execPost("aggregate", this, [null], _opts2, (error3) => { + reject(error3); + }); + } else { + resolve(); + } + }); + }); + if (!this._pipeline.length) { + throw new MongooseError("Aggregate has empty pipeline"); + } + const options = clone(this.options || {}); + let result; + try { + const cursor2 = await collection.aggregate(this._pipeline, options); + result = await cursor2.toArray(); + } catch (error2) { + await new Promise((resolve, reject) => { + const _opts2 = { error: error2 }; + model.hooks.execPost("aggregate", this, [null], _opts2, (error3) => { + if (error3) { + return reject(error3); + } + resolve(); + }); + }); + } + const _opts = { error: null }; + await new Promise((resolve, reject) => { + model.hooks.execPost("aggregate", this, [result], _opts, (error2) => { + if (error2) { + return reject(error2); + } + return resolve(); + }); + }); + return result; + }; + Aggregate.prototype.then = function(resolve, reject) { + return this.exec().then(resolve, reject); + }; + Aggregate.prototype.catch = function(reject) { + return this.exec().then(null, reject); + }; + Aggregate.prototype.finally = function(onFinally) { + return this.exec().finally(onFinally); + }; + if (Symbol.asyncIterator != null) { + Aggregate.prototype[Symbol.asyncIterator] = function() { + return this.cursor({ useMongooseAggCursor: true }).transformNull()._transformForAsyncIterator(); + }; + } + function isOperator(obj) { + if (typeof obj !== "object" || obj === null) { + return false; + } + const k4 = Object.keys(obj); + return k4.length === 1 && k4[0][0] === "$"; + } + Aggregate._prepareDiscriminatorPipeline = prepareDiscriminatorPipeline; + module2.exports = Aggregate; + } +}); + +// node_modules/mongoose/lib/options/saveOptions.js +var require_saveOptions = __commonJS({ + "node_modules/mongoose/lib/options/saveOptions.js"(exports2, module2) { + "use strict"; + var clone = require_clone(); + var SaveOptions = class { + constructor(obj) { + if (obj == null) { + return; + } + Object.assign(this, clone(obj)); + } + }; + SaveOptions.prototype.__subdocs = null; + module2.exports = SaveOptions; + } +}); + +// node_modules/mongoose/lib/helpers/model/applyDefaultsToPOJO.js +var require_applyDefaultsToPOJO = __commonJS({ + "node_modules/mongoose/lib/helpers/model/applyDefaultsToPOJO.js"(exports2, module2) { + "use strict"; + module2.exports = function applyDefaultsToPOJO(doc, schema) { + const paths = Object.keys(schema.paths); + const plen = paths.length; + for (let i4 = 0; i4 < plen; ++i4) { + let curPath = ""; + const p4 = paths[i4]; + const type = schema.paths[p4]; + const path = type.splitPath(); + const len = path.length; + let doc_ = doc; + for (let j4 = 0; j4 < len; ++j4) { + if (doc_ == null) { + break; + } + const piece = path[j4]; + curPath += (!curPath.length ? "" : ".") + piece; + if (j4 === len - 1) { + if (typeof doc_[piece] !== "undefined") { + if (type.$isSingleNested) { + applyDefaultsToPOJO(doc_[piece], type.caster.schema); + } else if (type.$isMongooseDocumentArray && Array.isArray(doc_[piece])) { + doc_[piece].forEach((el) => applyDefaultsToPOJO(el, type.schema)); + } + break; + } + const def = type.getDefault(doc, false, { skipCast: true }); + if (typeof def !== "undefined") { + doc_[piece] = def; + if (type.$isSingleNested) { + applyDefaultsToPOJO(def, type.caster.schema); + } else if (type.$isMongooseDocumentArray && Array.isArray(def)) { + def.forEach((el) => applyDefaultsToPOJO(el, type.schema)); + } + } + } else { + if (doc_[piece] == null) { + doc_[piece] = {}; + } + doc_ = doc_[piece]; + } + } + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/discriminator/applyEmbeddedDiscriminators.js +var require_applyEmbeddedDiscriminators = __commonJS({ + "node_modules/mongoose/lib/helpers/discriminator/applyEmbeddedDiscriminators.js"(exports2, module2) { + "use strict"; + module2.exports = applyEmbeddedDiscriminators; + function applyEmbeddedDiscriminators(schema, seen = /* @__PURE__ */ new WeakSet(), overwriteExisting = false) { + if (seen.has(schema)) { + return; + } + seen.add(schema); + for (const path of Object.keys(schema.paths)) { + const schemaType = schema.paths[path]; + if (!schemaType.schema) { + continue; + } + applyEmbeddedDiscriminators(schemaType.schema, seen); + if (!schemaType.schema._applyDiscriminators) { + continue; + } + if (schemaType._appliedDiscriminators && !overwriteExisting) { + continue; + } + for (const discriminatorKey of schemaType.schema._applyDiscriminators.keys()) { + const { + schema: discriminatorSchema, + options + } = schemaType.schema._applyDiscriminators.get(discriminatorKey); + applyEmbeddedDiscriminators(discriminatorSchema, seen); + schemaType.discriminator( + discriminatorKey, + discriminatorSchema, + overwriteExisting ? { ...options, overwriteExisting: true } : options + ); + } + schemaType._appliedDiscriminators = true; + } + } + } +}); + +// node_modules/mongoose/lib/helpers/model/applyMethods.js +var require_applyMethods = __commonJS({ + "node_modules/mongoose/lib/helpers/model/applyMethods.js"(exports2, module2) { + "use strict"; + var get2 = require_get(); + var utils = require_utils6(); + module2.exports = function applyMethods(model, schema) { + const Model = require_model(); + function apply(method, schema2) { + Object.defineProperty(model.prototype, method, { + get: function() { + const h4 = {}; + for (const k4 in schema2.methods[method]) { + h4[k4] = schema2.methods[method][k4].bind(this); + } + return h4; + }, + configurable: true + }); + } + for (const method of Object.keys(schema.methods)) { + const fn2 = schema.methods[method]; + if (Object.hasOwn(schema.tree, method)) { + throw new Error('You have a method and a property in your schema both named "' + method + '"'); + } + if (typeof fn2 === "function" && Model.prototype[method] === fn2) { + delete schema.methods[method]; + continue; + } + if (schema.reserved[method] && !get2(schema, `methodOptions.${method}.suppressWarning`, false)) { + utils.warn(`mongoose: the method name "${method}" is used by mongoose internally, overwriting it may cause bugs. If you're sure you know what you're doing, you can suppress this error by using \`schema.method('${method}', fn, { suppressWarning: true })\`.`); + } + if (typeof fn2 === "function") { + model.prototype[method] = fn2; + } else { + apply(method, schema); + } + } + model.$appliedMethods = true; + for (const key of Object.keys(schema.paths)) { + const type = schema.paths[key]; + if (type.$isSingleNested && !type.caster.$appliedMethods) { + applyMethods(type.caster, type.schema); + } + if (type.$isMongooseDocumentArray && !type.Constructor.$appliedMethods) { + applyMethods(type.Constructor, type.schema); + } + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/projection/applyProjection.js +var require_applyProjection = __commonJS({ + "node_modules/mongoose/lib/helpers/projection/applyProjection.js"(exports2, module2) { + "use strict"; + var hasIncludedChildren = require_hasIncludedChildren(); + var isExclusive = require_isExclusive(); + var isInclusive = require_isInclusive(); + var isPOJO = require_utils6().isPOJO; + module2.exports = function applyProjection(doc, projection, _hasIncludedChildren) { + if (projection == null) { + return doc; + } + if (doc == null) { + return doc; + } + let exclude = null; + if (isInclusive(projection)) { + exclude = false; + } else if (isExclusive(projection)) { + exclude = true; + } + if (exclude == null) { + return doc; + } else if (exclude) { + _hasIncludedChildren = _hasIncludedChildren || hasIncludedChildren(projection); + return applyExclusiveProjection(doc, projection, _hasIncludedChildren); + } else { + _hasIncludedChildren = _hasIncludedChildren || hasIncludedChildren(projection); + return applyInclusiveProjection(doc, projection, _hasIncludedChildren); + } + }; + function applyExclusiveProjection(doc, projection, hasIncludedChildren2, projectionLimb, prefix) { + if (doc == null || typeof doc !== "object") { + return doc; + } + if (Array.isArray(doc)) { + return doc.map((el) => applyExclusiveProjection(el, projection, hasIncludedChildren2, projectionLimb, prefix)); + } + const ret = { ...doc }; + projectionLimb = prefix ? projectionLimb || {} : projection; + for (const key of Object.keys(ret)) { + const fullPath = prefix ? prefix + "." + key : key; + if (Object.hasOwn(projection, fullPath) || Object.hasOwn(projectionLimb, key)) { + if (isPOJO(projection[fullPath]) || isPOJO(projectionLimb[key])) { + ret[key] = applyExclusiveProjection(ret[key], projection, hasIncludedChildren2, projectionLimb[key], fullPath); + } else { + delete ret[key]; + } + } else if (hasIncludedChildren2[fullPath]) { + ret[key] = applyExclusiveProjection(ret[key], projection, hasIncludedChildren2, projectionLimb[key], fullPath); + } + } + return ret; + } + function applyInclusiveProjection(doc, projection, hasIncludedChildren2, projectionLimb, prefix) { + if (doc == null || typeof doc !== "object") { + return doc; + } + if (Array.isArray(doc)) { + return doc.map((el) => applyInclusiveProjection(el, projection, hasIncludedChildren2, projectionLimb, prefix)); + } + const ret = { ...doc }; + projectionLimb = prefix ? projectionLimb || {} : projection; + for (const key of Object.keys(ret)) { + const fullPath = prefix ? prefix + "." + key : key; + if (Object.hasOwn(projection, fullPath) || Object.hasOwn(projectionLimb, key)) { + if (isPOJO(projection[fullPath]) || isPOJO(projectionLimb[key])) { + ret[key] = applyInclusiveProjection(ret[key], projection, hasIncludedChildren2, projectionLimb[key], fullPath); + } + continue; + } else if (hasIncludedChildren2[fullPath]) { + ret[key] = applyInclusiveProjection(ret[key], projection, hasIncludedChildren2, projectionLimb[key], fullPath); + } else { + delete ret[key]; + } + } + return ret; + } + } +}); + +// node_modules/mongoose/lib/helpers/indexes/isTextIndex.js +var require_isTextIndex = __commonJS({ + "node_modules/mongoose/lib/helpers/indexes/isTextIndex.js"(exports2, module2) { + "use strict"; + module2.exports = function isTextIndex(indexKeys) { + let isTextIndex2 = false; + for (const key of Object.keys(indexKeys)) { + if (indexKeys[key] === "text") { + isTextIndex2 = true; + } + } + return isTextIndex2; + }; + } +}); + +// node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js +var require_applySchemaCollation = __commonJS({ + "node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js"(exports2, module2) { + "use strict"; + var isTextIndex = require_isTextIndex(); + module2.exports = function applySchemaCollation(indexKeys, indexOptions, schemaOptions) { + if (isTextIndex(indexKeys)) { + return; + } + if (Object.hasOwn(schemaOptions, "collation") && !Object.hasOwn(indexOptions, "collation")) { + indexOptions.collation = schemaOptions.collation; + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/model/applyStaticHooks.js +var require_applyStaticHooks = __commonJS({ + "node_modules/mongoose/lib/helpers/model/applyStaticHooks.js"(exports2, module2) { + "use strict"; + var promiseOrCallback = require_promiseOrCallback(); + var { queryMiddlewareFunctions, aggregateMiddlewareFunctions, modelMiddlewareFunctions, documentMiddlewareFunctions } = require_constants6(); + var middlewareFunctions = Array.from( + /* @__PURE__ */ new Set([ + ...queryMiddlewareFunctions, + ...aggregateMiddlewareFunctions, + ...modelMiddlewareFunctions, + ...documentMiddlewareFunctions + ]) + ); + module2.exports = function applyStaticHooks(model, hooks, statics) { + const kareemOptions = { + useErrorHandlers: true, + numCallbackParams: 1 + }; + model.$__insertMany = hooks.createWrapper( + "insertMany", + model.$__insertMany, + model, + kareemOptions + ); + hooks = hooks.filter((hook) => { + if (middlewareFunctions.indexOf(hook.name) !== -1) { + return !!hook.model; + } + return hook.model !== false; + }); + for (const key of Object.keys(statics)) { + if (hooks.hasHooks(key)) { + const original = model[key]; + model[key] = function() { + const numArgs = arguments.length; + const lastArg = numArgs > 0 ? arguments[numArgs - 1] : null; + const cb = typeof lastArg === "function" ? lastArg : null; + const args2 = Array.prototype.slice.call(arguments, 0, cb == null ? numArgs : numArgs - 1); + return promiseOrCallback(cb, (callback) => { + hooks.execPre(key, model, args2, function(err) { + if (err != null) { + return callback(err); + } + let postCalled = 0; + const ret = original.apply(model, args2.concat(post)); + if (ret != null && typeof ret.then === "function") { + ret.then((res) => post(null, res), (err2) => post(err2)); + } + function post(error2, res) { + if (postCalled++ > 0) { + return; + } + if (error2 != null) { + return callback(error2); + } + hooks.execPost(key, model, [res], function(error3) { + if (error3 != null) { + return callback(error3); + } + callback(null, res); + }); + } + }); + }, model.events); + }; + } + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/model/applyStatics.js +var require_applyStatics = __commonJS({ + "node_modules/mongoose/lib/helpers/model/applyStatics.js"(exports2, module2) { + "use strict"; + module2.exports = function applyStatics(model, schema) { + for (const i4 in schema.statics) { + model[i4] = schema.statics[i4]; + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/document/applyTimestamps.js +var require_applyTimestamps = __commonJS({ + "node_modules/mongoose/lib/helpers/document/applyTimestamps.js"(exports2, module2) { + "use strict"; + var handleTimestampOption = require_handleTimestampOption(); + var mpath = require_mpath(); + module2.exports = applyTimestamps; + function applyTimestamps(schema, obj, options) { + if (obj == null) { + return obj; + } + applyTimestampsToChildren(schema, obj, options); + return applyTimestampsToDoc(schema, obj, options); + } + function applyTimestampsToChildren(schema, res, options) { + for (const childSchema of schema.childSchemas) { + const _path = childSchema.model.path; + const _schema = childSchema.schema; + if (!_path) { + continue; + } + const _obj = mpath.get(_path, res); + if (_obj == null || Array.isArray(_obj) && _obj.flat(Infinity).length === 0) { + continue; + } + applyTimestamps(_schema, _obj, options); + } + } + function applyTimestampsToDoc(schema, obj, options) { + if (obj == null || typeof obj !== "object") { + return; + } + if (Array.isArray(obj)) { + for (const el of obj) { + applyTimestampsToDoc(schema, el, options); + } + return; + } + if (schema.discriminators && Object.keys(schema.discriminators).length > 0) { + for (const discriminatorKey of Object.keys(schema.discriminators)) { + const discriminator = schema.discriminators[discriminatorKey]; + const key = discriminator.discriminatorMapping.key; + const value = discriminator.discriminatorMapping.value; + if (obj[key] == value) { + schema = discriminator; + break; + } + } + } + const createdAt = handleTimestampOption(schema.options.timestamps, "createdAt"); + const updatedAt = handleTimestampOption(schema.options.timestamps, "updatedAt"); + const currentTime = options?.currentTime; + let ts = null; + if (currentTime != null) { + ts = currentTime(); + } else if (schema.base?.now) { + ts = schema.base.now(); + } else { + ts = /* @__PURE__ */ new Date(); + } + if (createdAt && obj[createdAt] == null && !options?.isUpdate) { + obj[createdAt] = ts; + } + if (updatedAt) { + obj[updatedAt] = ts; + } + } + } +}); + +// node_modules/mongoose/lib/helpers/document/applyVirtuals.js +var require_applyVirtuals = __commonJS({ + "node_modules/mongoose/lib/helpers/document/applyVirtuals.js"(exports2, module2) { + "use strict"; + var mpath = require_mpath(); + module2.exports = applyVirtuals; + function applyVirtuals(schema, obj, virtuals) { + if (obj == null) { + return obj; + } + let virtualsForChildren = virtuals; + let toApply = null; + if (Array.isArray(virtuals)) { + virtualsForChildren = []; + toApply = []; + for (const virtual of virtuals) { + if (virtual.length === 1) { + toApply.push(virtual[0]); + } else { + virtualsForChildren.push(virtual); + } + } + } + applyVirtualsToChildren(schema, obj, virtualsForChildren); + return applyVirtualsToDoc(schema, obj, toApply); + } + function applyVirtualsToChildren(schema, res, virtuals) { + let attachedVirtuals = false; + for (const childSchema of schema.childSchemas) { + const _path = childSchema.model.path; + const _schema = childSchema.schema; + if (!_path) { + continue; + } + const _obj = mpath.get(_path, res); + if (_obj == null || Array.isArray(_obj) && _obj.flat(Infinity).length === 0) { + continue; + } + let virtualsForChild = null; + if (Array.isArray(virtuals)) { + virtualsForChild = []; + for (const virtual of virtuals) { + if (virtual[0] == _path) { + virtualsForChild.push(virtual.slice(1)); + } + } + if (virtualsForChild.length === 0) { + continue; + } + } + applyVirtuals(_schema, _obj, virtualsForChild); + attachedVirtuals = true; + } + if (virtuals && virtuals.length && !attachedVirtuals) { + applyVirtualsToDoc(schema, res, virtuals); + } + } + function applyVirtualsToDoc(schema, obj, virtuals) { + if (obj == null || typeof obj !== "object") { + return; + } + if (Array.isArray(obj)) { + for (const el of obj) { + applyVirtualsToDoc(schema, el, virtuals); + } + return; + } + if (schema.discriminators && Object.keys(schema.discriminators).length > 0) { + for (const discriminatorKey of Object.keys(schema.discriminators)) { + const discriminator = schema.discriminators[discriminatorKey]; + const key = discriminator.discriminatorMapping.key; + const value = discriminator.discriminatorMapping.value; + if (obj[key] == value) { + schema = discriminator; + break; + } + } + } + if (virtuals == null) { + virtuals = Object.keys(schema.virtuals); + } + for (const virtual of virtuals) { + if (schema.virtuals[virtual] == null) { + continue; + } + const virtualType = schema.virtuals[virtual]; + const sp = Array.isArray(virtual) ? virtual : virtual.indexOf(".") === -1 ? [virtual] : virtual.split("."); + let cur = obj; + for (let i4 = 0; i4 < sp.length - 1; ++i4) { + cur[sp[i4]] = sp[i4] in cur ? cur[sp[i4]] : {}; + cur = cur[sp[i4]]; + } + let val = virtualType.applyGetters(cur[sp[sp.length - 1]], obj); + const isPopulateVirtual = virtualType.options && (virtualType.options.ref || virtualType.options.refPath); + if (isPopulateVirtual && val === void 0) { + if (virtualType.options.justOne) { + val = null; + } else { + val = []; + } + } + cur[sp[sp.length - 1]] = val; + } + } + } +}); + +// node_modules/mongoose/lib/helpers/populate/skipPopulateValue.js +var require_skipPopulateValue = __commonJS({ + "node_modules/mongoose/lib/helpers/populate/skipPopulateValue.js"(exports2, module2) { + "use strict"; + module2.exports = function SkipPopulateValue(val) { + if (!(this instanceof SkipPopulateValue)) { + return new SkipPopulateValue(val); + } + this.val = val; + return this; + }; + } +}); + +// node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js +var require_leanPopulateMap = __commonJS({ + "node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js"(exports2, module2) { + "use strict"; + module2.exports = /* @__PURE__ */ new WeakMap(); + } +}); + +// node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js +var require_assignRawDocsToIdStructure = __commonJS({ + "node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js"(exports2, module2) { + "use strict"; + var clone = require_clone(); + var leanPopulateMap = require_leanPopulateMap(); + var modelSymbol = require_symbols().modelSymbol; + var utils = require_utils6(); + module2.exports = assignRawDocsToIdStructure; + var kHasArray = /* @__PURE__ */ Symbol("mongoose#assignRawDocsToIdStructure#hasArray"); + function assignRawDocsToIdStructure(rawIds, resultDocs, resultOrder, options, recursed) { + const newOrder = []; + const sorting = options.isVirtual && options.justOne && rawIds.length > 1 ? false : options.sort && rawIds.length > 1; + const nullIfNotFound = options.$nullIfNotFound; + let doc; + let sid; + let id; + if (utils.isMongooseArray(rawIds)) { + rawIds = rawIds.__array; + } + let i4 = 0; + const len = rawIds.length; + if (sorting && recursed && options[kHasArray] === void 0) { + options[kHasArray] = false; + for (const key in resultOrder) { + if (Array.isArray(resultOrder[key])) { + options[kHasArray] = true; + break; + } + } + } + for (i4 = 0; i4 < len; ++i4) { + id = rawIds[i4]; + if (Array.isArray(id)) { + assignRawDocsToIdStructure(id, resultDocs, resultOrder, options, true); + newOrder.push(id); + continue; + } + if (id === null && sorting === false) { + newOrder.push(id); + continue; + } + if (id?.constructor?.name === "Binary" && id.sub_type === 4 && typeof id.toUUID === "function") { + sid = String(id.toUUID()); + } else if (id?.constructor?.name === "Buffer" && id._subtype === 4 && typeof id.toUUID === "function") { + sid = String(id.toUUID()); + } else { + sid = String(id); + } + doc = resultDocs[sid]; + if (options.clone && doc != null) { + if (options.lean) { + const _model = leanPopulateMap.get(doc); + doc = clone(doc); + leanPopulateMap.set(doc, _model); + } else { + doc = doc.constructor.hydrate(doc._doc); + } + } + if (recursed) { + if (doc) { + if (sorting) { + const _resultOrder = resultOrder[sid]; + if (options[kHasArray]) { + newOrder.push(doc); + } else { + newOrder[_resultOrder] = doc; + } + } else { + newOrder.push(doc); + } + } else if (id != null && id[modelSymbol] != null) { + newOrder.push(id); + } else { + newOrder.push(options.retainNullValues || nullIfNotFound ? null : id); + } + } else { + newOrder[i4] = doc || null; + } + } + rawIds.length = 0; + if (newOrder.length) { + newOrder.forEach(function(doc2, i5) { + rawIds[i5] = doc2; + }); + } + } + } +}); + +// node_modules/mongoose/lib/helpers/populate/getVirtual.js +var require_getVirtual = __commonJS({ + "node_modules/mongoose/lib/helpers/populate/getVirtual.js"(exports2, module2) { + "use strict"; + module2.exports = getVirtual; + function getVirtual(schema, name) { + if (schema.virtuals[name]) { + return { virtual: schema.virtuals[name], path: void 0 }; + } + const parts = name.split("."); + let cur = ""; + let nestedSchemaPath = ""; + for (let i4 = 0; i4 < parts.length; ++i4) { + cur += (cur.length > 0 ? "." : "") + parts[i4]; + if (schema.virtuals[cur]) { + if (i4 === parts.length - 1) { + return { virtual: schema.virtuals[cur], path: nestedSchemaPath }; + } + continue; + } + if (schema.nested[cur]) { + continue; + } + if (schema.paths[cur] && schema.paths[cur].schema) { + schema = schema.paths[cur].schema; + const rest = parts.slice(i4 + 1).join("."); + if (schema.virtuals[rest]) { + if (i4 === parts.length - 2) { + return { + virtual: schema.virtuals[rest], + nestedSchemaPath: [nestedSchemaPath, cur].filter((v4) => !!v4).join(".") + }; + } + continue; + } + if (i4 + 1 < parts.length && schema.discriminators) { + for (const key of Object.keys(schema.discriminators)) { + const res = getVirtual(schema.discriminators[key], rest); + if (res != null) { + const _path = [nestedSchemaPath, cur, res.nestedSchemaPath].filter((v4) => !!v4).join("."); + return { + virtual: res.virtual, + nestedSchemaPath: _path + }; + } + } + } + nestedSchemaPath += (nestedSchemaPath.length > 0 ? "." : "") + cur; + cur = ""; + continue; + } else if (schema.paths[cur]?.$isSchemaMap && schema.paths[cur].$__schemaType?.schema) { + schema = schema.paths[cur].$__schemaType.schema; + ++i4; + const rest = parts.slice(i4 + 1).join("."); + if (schema.virtuals[rest]) { + if (i4 === parts.length - 2) { + return { + virtual: schema.virtuals[rest], + nestedSchemaPath: [nestedSchemaPath, cur, "$*"].filter((v4) => !!v4).join(".") + }; + } + continue; + } + if (i4 + 1 < parts.length && schema.discriminators) { + for (const key of Object.keys(schema.discriminators)) { + const res = getVirtual(schema.discriminators[key], rest); + if (res != null) { + const _path = [nestedSchemaPath, cur, res.nestedSchemaPath, "$*"].filter((v4) => !!v4).join("."); + return { + virtual: res.virtual, + nestedSchemaPath: _path + }; + } + } + } + nestedSchemaPath += (nestedSchemaPath.length > 0 ? "." : "") + "$*" + cur; + cur = ""; + } + if (schema.discriminators) { + for (const discriminatorKey of Object.keys(schema.discriminators)) { + const virtualFromDiscriminator = getVirtual(schema.discriminators[discriminatorKey], name); + if (virtualFromDiscriminator) return virtualFromDiscriminator; + } + } + return null; + } + } + } +}); + +// node_modules/sift/lib/index.js +var require_lib8 = __commonJS({ + "node_modules/sift/lib/index.js"(exports2, module2) { + (function(global2, factory) { + typeof exports2 === "object" && typeof module2 !== "undefined" ? factory(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.sift = {})); + })(exports2, (function(exports3) { + "use strict"; + var extendStatics2 = function(d4, b4) { + extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) { + d5.__proto__ = b5; + } || function(d5, b5) { + for (var p4 in b5) if (Object.prototype.hasOwnProperty.call(b5, p4)) d5[p4] = b5[p4]; + }; + return extendStatics2(d4, b4); + }; + function __extends2(d4, b4) { + if (typeof b4 !== "function" && b4 !== null) + throw new TypeError("Class extends value " + String(b4) + " is not a constructor or null"); + extendStatics2(d4, b4); + function __() { + this.constructor = d4; + } + d4.prototype = b4 === null ? Object.create(b4) : (__.prototype = b4.prototype, new __()); + } + typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message2) { + var e4 = new Error(message2); + return e4.name = "SuppressedError", e4.error = error2, e4.suppressed = suppressed, e4; + }; + var typeChecker = function(type) { + var typeString = "[object " + type + "]"; + return function(value) { + return getClassName(value) === typeString; + }; + }; + var getClassName = function(value) { + return Object.prototype.toString.call(value); + }; + var comparable = function(value) { + if (value instanceof Date) { + return value.getTime(); + } else if (isArray(value)) { + return value.map(comparable); + } else if (value && typeof value.toJSON === "function") { + return value.toJSON(); + } + return value; + }; + var coercePotentiallyNull = function(value) { + return value == null ? null : value; + }; + var isArray = typeChecker("Array"); + var isObject = typeChecker("Object"); + var isFunction = typeChecker("Function"); + var isProperty = function(item, key) { + return item.hasOwnProperty(key) && !isFunction(item[key]); + }; + var isVanillaObject = function(value) { + return value && (value.constructor === Object || value.constructor === Array || value.constructor.toString() === "function Object() { [native code] }" || value.constructor.toString() === "function Array() { [native code] }") && !value.toJSON; + }; + var equals = function(a4, b4) { + if (a4 == null && a4 == b4) { + return true; + } + if (a4 === b4) { + return true; + } + if (Object.prototype.toString.call(a4) !== Object.prototype.toString.call(b4)) { + return false; + } + if (isArray(a4)) { + if (a4.length !== b4.length) { + return false; + } + for (var i4 = 0, length_1 = a4.length; i4 < length_1; i4++) { + if (!equals(a4[i4], b4[i4])) + return false; + } + return true; + } else if (isObject(a4)) { + if (Object.keys(a4).length !== Object.keys(b4).length) { + return false; + } + for (var key in a4) { + if (!equals(a4[key], b4[key])) + return false; + } + return true; + } + return false; + }; + var walkKeyPathValues = function(item, keyPath, next, depth, key, owner) { + var currentKey = keyPath[depth]; + if (isArray(item) && isNaN(Number(currentKey)) && !isProperty(item, currentKey)) { + for (var i4 = 0, length_1 = item.length; i4 < length_1; i4++) { + if (!walkKeyPathValues(item[i4], keyPath, next, depth, i4, item)) { + return false; + } + } + } + if (depth === keyPath.length || item == null) { + return next(item, key, owner, depth === 0, depth === keyPath.length); + } + return walkKeyPathValues(item[currentKey], keyPath, next, depth + 1, currentKey, item); + }; + var BaseOperation = ( + /** @class */ + (function() { + function BaseOperation2(params, owneryQuery, options, name) { + this.params = params; + this.owneryQuery = owneryQuery; + this.options = options; + this.name = name; + this.init(); + } + BaseOperation2.prototype.init = function() { + }; + BaseOperation2.prototype.reset = function() { + this.done = false; + this.keep = false; + }; + return BaseOperation2; + })() + ); + var GroupOperation = ( + /** @class */ + (function(_super) { + __extends2(GroupOperation2, _super); + function GroupOperation2(params, owneryQuery, options, children) { + var _this = _super.call(this, params, owneryQuery, options) || this; + _this.children = children; + return _this; + } + GroupOperation2.prototype.reset = function() { + this.keep = false; + this.done = false; + for (var i4 = 0, length_2 = this.children.length; i4 < length_2; i4++) { + this.children[i4].reset(); + } + }; + GroupOperation2.prototype.childrenNext = function(item, key, owner, root, leaf) { + var done = true; + var keep = true; + for (var i4 = 0, length_3 = this.children.length; i4 < length_3; i4++) { + var childOperation = this.children[i4]; + if (!childOperation.done) { + childOperation.next(item, key, owner, root, leaf); + } + if (!childOperation.keep) { + keep = false; + } + if (childOperation.done) { + if (!childOperation.keep) { + break; + } + } else { + done = false; + } + } + this.done = done; + this.keep = keep; + }; + return GroupOperation2; + })(BaseOperation) + ); + var NamedGroupOperation = ( + /** @class */ + (function(_super) { + __extends2(NamedGroupOperation2, _super); + function NamedGroupOperation2(params, owneryQuery, options, children, name) { + var _this = _super.call(this, params, owneryQuery, options, children) || this; + _this.name = name; + return _this; + } + return NamedGroupOperation2; + })(GroupOperation) + ); + var QueryOperation = ( + /** @class */ + (function(_super) { + __extends2(QueryOperation2, _super); + function QueryOperation2() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + QueryOperation2.prototype.next = function(item, key, parent, root) { + this.childrenNext(item, key, parent, root); + }; + return QueryOperation2; + })(GroupOperation) + ); + var NestedOperation = ( + /** @class */ + (function(_super) { + __extends2(NestedOperation2, _super); + function NestedOperation2(keyPath, params, owneryQuery, options, children) { + var _this = _super.call(this, params, owneryQuery, options, children) || this; + _this.keyPath = keyPath; + _this.propop = true; + _this._nextNestedValue = function(value, key, owner, root, leaf) { + _this.childrenNext(value, key, owner, root, leaf); + return !_this.done; + }; + return _this; + } + NestedOperation2.prototype.next = function(item, key, parent) { + walkKeyPathValues(item, this.keyPath, this._nextNestedValue, 0, key, parent); + }; + return NestedOperation2; + })(GroupOperation) + ); + var createTester = function(a4, compare) { + if (a4 instanceof Function) { + return a4; + } + if (a4 instanceof RegExp) { + return function(b4) { + var result = typeof b4 === "string" && a4.test(b4); + a4.lastIndex = 0; + return result; + }; + } + var comparableA = comparable(a4); + return function(b4) { + return compare(comparableA, comparable(b4)); + }; + }; + var EqualsOperation = ( + /** @class */ + (function(_super) { + __extends2(EqualsOperation2, _super); + function EqualsOperation2() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + EqualsOperation2.prototype.init = function() { + this._test = createTester(this.params, this.options.compare); + }; + EqualsOperation2.prototype.next = function(item, key, parent) { + if (!Array.isArray(parent) || parent.hasOwnProperty(key)) { + if (this._test(item, key, parent)) { + this.done = true; + this.keep = true; + } + } + }; + return EqualsOperation2; + })(BaseOperation) + ); + var createEqualsOperation = function(params, owneryQuery, options) { + return new EqualsOperation(params, owneryQuery, options); + }; + var numericalOperationCreator = function(createNumericalOperation) { + return function(params, owneryQuery, options, name) { + return createNumericalOperation(params, owneryQuery, options, name); + }; + }; + var numericalOperation = function(createTester2) { + return numericalOperationCreator(function(params, owneryQuery, options, name) { + var typeofParams = typeof comparable(params); + var test = createTester2(params); + return new EqualsOperation(function(b4) { + var actualValue = coercePotentiallyNull(b4); + return typeof comparable(actualValue) === typeofParams && test(actualValue); + }, owneryQuery, options, name); + }); + }; + var createNamedOperation = function(name, params, parentQuery, options) { + var operationCreator = options.operations[name]; + if (!operationCreator) { + throwUnsupportedOperation(name); + } + return operationCreator(params, parentQuery, options, name); + }; + var throwUnsupportedOperation = function(name) { + throw new Error("Unsupported operation: ".concat(name)); + }; + var containsOperation = function(query, options) { + for (var key in query) { + if (options.operations.hasOwnProperty(key) || key.charAt(0) === "$") + return true; + } + return false; + }; + var createNestedOperation = function(keyPath, nestedQuery, parentKey, owneryQuery, options) { + if (containsOperation(nestedQuery, options)) { + var _a2 = createQueryOperations(nestedQuery, parentKey, options), selfOperations = _a2[0], nestedOperations = _a2[1]; + if (nestedOperations.length) { + throw new Error("Property queries must contain only operations, or exact objects."); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, selfOperations); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [ + new EqualsOperation(nestedQuery, owneryQuery, options) + ]); + }; + var createQueryOperation = function(query, owneryQuery, _a2) { + if (owneryQuery === void 0) { + owneryQuery = null; + } + var _b = _a2 === void 0 ? {} : _a2, compare = _b.compare, operations = _b.operations; + var options = { + compare: compare || equals, + operations: Object.assign({}, operations || {}) + }; + var _c4 = createQueryOperations(query, null, options), selfOperations = _c4[0], nestedOperations = _c4[1]; + var ops = []; + if (selfOperations.length) { + ops.push(new NestedOperation([], query, owneryQuery, options, selfOperations)); + } + ops.push.apply(ops, nestedOperations); + if (ops.length === 1) { + return ops[0]; + } + return new QueryOperation(query, owneryQuery, options, ops); + }; + var createQueryOperations = function(query, parentKey, options) { + var selfOperations = []; + var nestedOperations = []; + if (!isVanillaObject(query)) { + selfOperations.push(new EqualsOperation(query, query, options)); + return [selfOperations, nestedOperations]; + } + for (var key in query) { + if (options.operations.hasOwnProperty(key)) { + var op2 = createNamedOperation(key, query[key], query, options); + if (op2) { + if (!op2.propop && parentKey && !options.operations[parentKey]) { + throw new Error("Malformed query. ".concat(key, " cannot be matched against property.")); + } + } + if (op2 != null) { + selfOperations.push(op2); + } + } else if (key.charAt(0) === "$") { + throwUnsupportedOperation(key); + } else { + nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options)); + } + } + return [selfOperations, nestedOperations]; + }; + var createOperationTester = function(operation2) { + return function(item, key, owner) { + operation2.reset(); + operation2.next(item, key, owner); + return operation2.keep; + }; + }; + var createQueryTester = function(query, options) { + if (options === void 0) { + options = {}; + } + return createOperationTester(createQueryOperation(query, null, options)); + }; + var $Ne = ( + /** @class */ + (function(_super) { + __extends2($Ne2, _super); + function $Ne2() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Ne2.prototype.init = function() { + this._test = createTester(this.params, this.options.compare); + }; + $Ne2.prototype.reset = function() { + _super.prototype.reset.call(this); + this.keep = true; + }; + $Ne2.prototype.next = function(item) { + if (this._test(item)) { + this.done = true; + this.keep = false; + } + }; + return $Ne2; + })(BaseOperation) + ); + var $ElemMatch = ( + /** @class */ + (function(_super) { + __extends2($ElemMatch2, _super); + function $ElemMatch2() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $ElemMatch2.prototype.init = function() { + if (!this.params || typeof this.params !== "object") { + throw new Error("Malformed query. $elemMatch must by an object."); + } + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + }; + $ElemMatch2.prototype.reset = function() { + _super.prototype.reset.call(this); + this._queryOperation.reset(); + }; + $ElemMatch2.prototype.next = function(item) { + if (isArray(item)) { + for (var i4 = 0, length_1 = item.length; i4 < length_1; i4++) { + this._queryOperation.reset(); + var child = item[i4]; + this._queryOperation.next(child, i4, item, false); + this.keep = this.keep || this._queryOperation.keep; + } + this.done = true; + } else { + this.done = false; + this.keep = false; + } + }; + return $ElemMatch2; + })(BaseOperation) + ); + var $Not = ( + /** @class */ + (function(_super) { + __extends2($Not2, _super); + function $Not2() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Not2.prototype.init = function() { + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + }; + $Not2.prototype.reset = function() { + _super.prototype.reset.call(this); + this._queryOperation.reset(); + }; + $Not2.prototype.next = function(item, key, owner, root) { + this._queryOperation.next(item, key, owner, root); + this.done = this._queryOperation.done; + this.keep = !this._queryOperation.keep; + }; + return $Not2; + })(BaseOperation) + ); + var $Size = ( + /** @class */ + (function(_super) { + __extends2($Size2, _super); + function $Size2() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Size2.prototype.init = function() { + }; + $Size2.prototype.next = function(item) { + if (isArray(item) && item.length === this.params) { + this.done = true; + this.keep = true; + } + }; + return $Size2; + })(BaseOperation) + ); + var assertGroupNotEmpty = function(values) { + if (values.length === 0) { + throw new Error("$and/$or/$nor must be a nonempty array"); + } + }; + var $Or = ( + /** @class */ + (function(_super) { + __extends2($Or2, _super); + function $Or2() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = false; + return _this; + } + $Or2.prototype.init = function() { + var _this = this; + assertGroupNotEmpty(this.params); + this._ops = this.params.map(function(op2) { + return createQueryOperation(op2, null, _this.options); + }); + }; + $Or2.prototype.reset = function() { + this.done = false; + this.keep = false; + for (var i4 = 0, length_2 = this._ops.length; i4 < length_2; i4++) { + this._ops[i4].reset(); + } + }; + $Or2.prototype.next = function(item, key, owner) { + var done = false; + var success = false; + for (var i4 = 0, length_3 = this._ops.length; i4 < length_3; i4++) { + var op2 = this._ops[i4]; + op2.next(item, key, owner); + if (op2.keep) { + done = true; + success = op2.keep; + break; + } + } + this.keep = success; + this.done = done; + }; + return $Or2; + })(BaseOperation) + ); + var $Nor = ( + /** @class */ + (function(_super) { + __extends2($Nor2, _super); + function $Nor2() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = false; + return _this; + } + $Nor2.prototype.next = function(item, key, owner) { + _super.prototype.next.call(this, item, key, owner); + this.keep = !this.keep; + }; + return $Nor2; + })($Or) + ); + var $In = ( + /** @class */ + (function(_super) { + __extends2($In2, _super); + function $In2() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $In2.prototype.init = function() { + var _this = this; + var params = Array.isArray(this.params) ? this.params : [this.params]; + this._testers = params.map(function(value) { + if (containsOperation(value, _this.options)) { + throw new Error("cannot nest $ under ".concat(_this.name.toLowerCase())); + } + return createTester(value, _this.options.compare); + }); + }; + $In2.prototype.next = function(item, key, owner) { + var done = false; + var success = false; + for (var i4 = 0, length_4 = this._testers.length; i4 < length_4; i4++) { + var test = this._testers[i4]; + if (test(item)) { + done = true; + success = true; + break; + } + } + this.keep = success; + this.done = done; + }; + return $In2; + })(BaseOperation) + ); + var $Nin = ( + /** @class */ + (function(_super) { + __extends2($Nin2, _super); + function $Nin2(params, ownerQuery, options, name) { + var _this = _super.call(this, params, ownerQuery, options, name) || this; + _this.propop = true; + _this._in = new $In(params, ownerQuery, options, name); + return _this; + } + $Nin2.prototype.next = function(item, key, owner, root) { + this._in.next(item, key, owner); + if (isArray(owner) && !root) { + if (this._in.keep) { + this.keep = false; + this.done = true; + } else if (key == owner.length - 1) { + this.keep = true; + this.done = true; + } + } else { + this.keep = !this._in.keep; + this.done = true; + } + }; + $Nin2.prototype.reset = function() { + _super.prototype.reset.call(this); + this._in.reset(); + }; + return $Nin2; + })(BaseOperation) + ); + var $Exists = ( + /** @class */ + (function(_super) { + __extends2($Exists2, _super); + function $Exists2() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Exists2.prototype.next = function(item, key, owner, root, leaf) { + if (!leaf) { + this.done = true; + this.keep = !this.params; + } else if (owner.hasOwnProperty(key) === this.params) { + this.done = true; + this.keep = true; + } + }; + return $Exists2; + })(BaseOperation) + ); + var $And = ( + /** @class */ + (function(_super) { + __extends2($And2, _super); + function $And2(params, owneryQuery, options, name) { + var _this = _super.call(this, params, owneryQuery, options, params.map(function(query) { + return createQueryOperation(query, owneryQuery, options); + }), name) || this; + _this.propop = false; + assertGroupNotEmpty(params); + return _this; + } + $And2.prototype.next = function(item, key, owner, root) { + this.childrenNext(item, key, owner, root); + }; + return $And2; + })(NamedGroupOperation) + ); + var $All = ( + /** @class */ + (function(_super) { + __extends2($All2, _super); + function $All2(params, owneryQuery, options, name) { + var _this = _super.call(this, params, owneryQuery, options, params.map(function(query) { + return createQueryOperation(query, owneryQuery, options); + }), name) || this; + _this.propop = true; + return _this; + } + $All2.prototype.next = function(item, key, owner, root) { + this.childrenNext(item, key, owner, root); + }; + return $All2; + })(NamedGroupOperation) + ); + var $eq = function(params, owneryQuery, options) { + return new EqualsOperation(params, owneryQuery, options); + }; + var $ne = function(params, owneryQuery, options, name) { + return new $Ne(params, owneryQuery, options, name); + }; + var $or = function(params, owneryQuery, options, name) { + return new $Or(params, owneryQuery, options, name); + }; + var $nor = function(params, owneryQuery, options, name) { + return new $Nor(params, owneryQuery, options, name); + }; + var $elemMatch = function(params, owneryQuery, options, name) { + return new $ElemMatch(params, owneryQuery, options, name); + }; + var $nin = function(params, owneryQuery, options, name) { + return new $Nin(params, owneryQuery, options, name); + }; + var $in = function(params, owneryQuery, options, name) { + return new $In(params, owneryQuery, options, name); + }; + var $lt = numericalOperation(function(params) { + return function(b4) { + return b4 != null && b4 < params; + }; + }); + var $lte = numericalOperation(function(params) { + return function(b4) { + return b4 === params || b4 <= params; + }; + }); + var $gt = numericalOperation(function(params) { + return function(b4) { + return b4 != null && b4 > params; + }; + }); + var $gte = numericalOperation(function(params) { + return function(b4) { + return b4 === params || b4 >= params; + }; + }); + var $mod = function(_a2, owneryQuery, options) { + var mod = _a2[0], equalsValue = _a2[1]; + return new EqualsOperation(function(b4) { + return comparable(b4) % mod === equalsValue; + }, owneryQuery, options); + }; + var $exists = function(params, owneryQuery, options, name) { + return new $Exists(params, owneryQuery, options, name); + }; + var $regex = function(pattern, owneryQuery, options) { + return new EqualsOperation(new RegExp(pattern, owneryQuery.$options), owneryQuery, options); + }; + var $not = function(params, owneryQuery, options, name) { + return new $Not(params, owneryQuery, options, name); + }; + var typeAliases = { + number: function(v4) { + return typeof v4 === "number"; + }, + string: function(v4) { + return typeof v4 === "string"; + }, + bool: function(v4) { + return typeof v4 === "boolean"; + }, + array: function(v4) { + return Array.isArray(v4); + }, + null: function(v4) { + return v4 === null; + }, + timestamp: function(v4) { + return v4 instanceof Date; + } + }; + var $type = function(clazz, owneryQuery, options) { + return new EqualsOperation(function(b4) { + if (typeof clazz === "string") { + if (!typeAliases[clazz]) { + throw new Error("Type alias does not exist"); + } + return typeAliases[clazz](b4); + } + return b4 != null ? b4 instanceof clazz || b4.constructor === clazz : false; + }, owneryQuery, options); + }; + var $and = function(params, ownerQuery, options, name) { + return new $And(params, ownerQuery, options, name); + }; + var $all = function(params, ownerQuery, options, name) { + return new $All(params, ownerQuery, options, name); + }; + var $size = function(params, ownerQuery, options) { + return new $Size(params, ownerQuery, options, "$size"); + }; + var $options = function() { + return null; + }; + var $where = function(params, ownerQuery, options) { + var test; + if (isFunction(params)) { + test = params; + } else if (!process.env.CSP_ENABLED) { + test = new Function("obj", "return " + params); + } else { + throw new Error('In CSP mode, sift does not support strings in "$where" condition'); + } + return new EqualsOperation(function(b4) { + return test.bind(b4)(b4); + }, ownerQuery, options); + }; + var defaultOperations = /* @__PURE__ */ Object.freeze({ + __proto__: null, + $Size, + $all, + $and, + $elemMatch, + $eq, + $exists, + $gt, + $gte, + $in, + $lt, + $lte, + $mod, + $ne, + $nin, + $nor, + $not, + $options, + $or, + $regex, + $size, + $type, + $where + }); + var createDefaultQueryOperation = function(query, ownerQuery, _a2) { + var _b = _a2 === void 0 ? {} : _a2, compare = _b.compare, operations = _b.operations; + return createQueryOperation(query, ownerQuery, { + compare, + operations: Object.assign({}, defaultOperations, operations || {}) + }); + }; + var createDefaultQueryTester = function(query, options) { + if (options === void 0) { + options = {}; + } + var op2 = createDefaultQueryOperation(query, null, options); + return createOperationTester(op2); + }; + exports3.$Size = $Size; + exports3.$all = $all; + exports3.$and = $and; + exports3.$elemMatch = $elemMatch; + exports3.$eq = $eq; + exports3.$exists = $exists; + exports3.$gt = $gt; + exports3.$gte = $gte; + exports3.$in = $in; + exports3.$lt = $lt; + exports3.$lte = $lte; + exports3.$mod = $mod; + exports3.$ne = $ne; + exports3.$nin = $nin; + exports3.$nor = $nor; + exports3.$not = $not; + exports3.$options = $options; + exports3.$or = $or; + exports3.$regex = $regex; + exports3.$size = $size; + exports3.$type = $type; + exports3.$where = $where; + exports3.EqualsOperation = EqualsOperation; + exports3.createDefaultQueryOperation = createDefaultQueryOperation; + exports3.createEqualsOperation = createEqualsOperation; + exports3.createOperationTester = createOperationTester; + exports3.createQueryOperation = createQueryOperation; + exports3.createQueryTester = createQueryTester; + exports3.default = createDefaultQueryTester; + Object.defineProperty(exports3, "__esModule", { value: true }); + })); + } +}); + +// node_modules/sift/index.js +var require_sift = __commonJS({ + "node_modules/sift/index.js"(exports2, module2) { + var lib = require_lib8(); + module2.exports = lib.default; + Object.assign(module2.exports, lib); + } +}); + +// node_modules/mongoose/lib/helpers/populate/assignVals.js +var require_assignVals = __commonJS({ + "node_modules/mongoose/lib/helpers/populate/assignVals.js"(exports2, module2) { + "use strict"; + var MongooseMap = require_map(); + var SkipPopulateValue = require_skipPopulateValue(); + var assignRawDocsToIdStructure = require_assignRawDocsToIdStructure(); + var get2 = require_get(); + var getVirtual = require_getVirtual(); + var leanPopulateMap = require_leanPopulateMap(); + var lookupLocalFields = require_lookupLocalFields(); + var markArraySubdocsPopulated = require_markArraySubdocsPopulated(); + var mpath = require_mpath(); + var sift = require_sift().default; + var utils = require_utils6(); + var { populateModelSymbol } = require_symbols(); + module2.exports = function assignVals(o4) { + const userOptions = Object.assign({}, get2(o4, "allOptions.options.options"), get2(o4, "allOptions.options")); + const populateOptions = Object.assign({}, o4.options, userOptions, { + justOne: o4.justOne, + isVirtual: o4.isVirtual + }); + populateOptions.$nullIfNotFound = o4.isVirtual; + const populatedModel = o4.populatedModel; + const originalIds = [].concat(o4.rawIds); + o4.allIds = [].concat(o4.allIds); + assignRawDocsToIdStructure(o4.rawIds, o4.rawDocs, o4.rawOrder, populateOptions); + const docs = o4.docs; + const rawIds = o4.rawIds; + const options = o4.options; + const count = o4.count && o4.isVirtual; + let i4; + let setValueIndex = 0; + function setValue(val) { + ++setValueIndex; + if (count) { + return val; + } + if (val instanceof SkipPopulateValue) { + return val.val; + } + if (val === void 0) { + return val; + } + const _allIds = o4.allIds[i4]; + if (o4.path.endsWith(".$*")) { + return valueFilter(val, options, populateOptions, _allIds); + } + if (o4.justOne === true && Array.isArray(val)) { + const ret = []; + for (const doc of val) { + const _docPopulatedModel = leanPopulateMap.get(doc); + if (_docPopulatedModel == null || _docPopulatedModel === populatedModel) { + ret.push(doc); + } + } + while (val.length > ret.length) { + Array.prototype.pop.apply(val, []); + } + for (let i5 = 0; i5 < ret.length; ++i5) { + val[i5] = ret[i5]; + } + return valueFilter(val[0], options, populateOptions, _allIds); + } else if (o4.justOne === false && !Array.isArray(val)) { + return valueFilter([val], options, populateOptions, _allIds); + } else if (o4.justOne === true && !Array.isArray(val) && Array.isArray(_allIds)) { + return valueFilter(val, options, populateOptions, val == null ? val : _allIds[setValueIndex - 1]); + } + return valueFilter(val, options, populateOptions, _allIds); + } + for (i4 = 0; i4 < docs.length; ++i4) { + setValueIndex = 0; + const _path = o4.path.endsWith(".$*") ? o4.path.slice(0, -3) : o4.path; + const existingVal = mpath.get(_path, docs[i4], lookupLocalFields); + if (existingVal == null && !getVirtual(o4.originalModel.schema, _path)) { + continue; + } + let valueToSet; + if (count) { + valueToSet = numDocs(rawIds[i4]); + } else if (Array.isArray(o4.match)) { + valueToSet = Array.isArray(rawIds[i4]) ? rawIds[i4].filter((v4) => v4 == null || sift(o4.match[i4])(v4)) : [rawIds[i4]].filter((v4) => v4 == null || sift(o4.match[i4])(v4))[0]; + } else { + valueToSet = rawIds[i4]; + } + const originalSchema = o4.originalModel.schema; + const isDoc = get2(docs[i4], "$__", null) != null; + let isMap = isDoc ? existingVal instanceof Map : utils.isPOJO(existingVal); + isMap = isMap && get2(originalSchema._getSchema(_path), "$isSchemaMap"); + if (!o4.isVirtual && isMap) { + const _keys = existingVal instanceof Map ? Array.from(existingVal.keys()) : Object.keys(existingVal); + valueToSet = valueToSet.reduce((cur2, v4, i5) => { + cur2.set(_keys[i5], v4); + return cur2; + }, /* @__PURE__ */ new Map()); + } + if (isDoc && Array.isArray(valueToSet)) { + for (const val of valueToSet) { + if (val != null && val.$__ != null) { + val.$__.parent = docs[i4]; + } + } + } else if (isDoc && valueToSet != null && valueToSet.$__ != null) { + valueToSet.$__.parent = docs[i4]; + } + if (o4.isVirtual && isDoc) { + docs[i4].$populated(_path, o4.justOne ? originalIds[0] : originalIds, o4.allOptions); + if (Array.isArray(valueToSet)) { + valueToSet = valueToSet.map((v4) => v4 == null ? void 0 : v4); + } + mpath.set( + _path, + valueToSet, + docs[i4], + // Handle setting paths underneath maps using $* by converting arrays into maps of values + function lookup(obj, part, val) { + if (arguments.length >= 3) { + obj[part] = val; + return obj[part]; + } + if (obj instanceof Map && part === "$*") { + return [...obj.values()]; + } + return obj[part]; + }, + setValue, + false + ); + continue; + } + const parts = _path.split("."); + let cur = docs[i4]; + for (let j4 = 0; j4 < parts.length - 1; ++j4) { + if (Array.isArray(cur) && !utils.isArrayIndex(parts[j4])) { + break; + } + if (parts[j4] === "$*") { + break; + } + if (cur[parts[j4]] == null) { + const curPath = parts.slice(0, j4 + 1).join("."); + const schematype = originalSchema._getSchema(curPath); + if (valueToSet == null && schematype != null && schematype.$isMongooseArray) { + break; + } + cur[parts[j4]] = {}; + } + cur = cur[parts[j4]]; + if (typeof cur !== "object") { + break; + } + } + if (docs[i4].$__) { + o4.allOptions.options[populateModelSymbol] = o4.allOptions.model; + docs[i4].$populated(_path, o4.unpopulatedValues[i4], o4.allOptions.options); + if (valueToSet != null && valueToSet.$__ != null) { + valueToSet.$__.wasPopulated = { value: o4.unpopulatedValues[i4] }; + } + if (valueToSet instanceof Map && !valueToSet.$isMongooseMap) { + valueToSet = new MongooseMap(valueToSet, _path, docs[i4], docs[i4].schema.path(_path).$__schemaType); + } + } + mpath.set(_path, valueToSet, docs[i4], lookupLocalFields, setValue, false); + if (docs[i4].$__) { + markArraySubdocsPopulated(docs[i4], [o4.allOptions.options]); + } + } + }; + function numDocs(v4) { + if (Array.isArray(v4)) { + if (v4.some((el) => Array.isArray(el) || el === null)) { + return v4.map((el) => { + if (el == null) { + return 0; + } + if (Array.isArray(el)) { + return el.filter((el2) => el2 != null).length; + } + return 1; + }); + } + return v4.filter((el) => el != null).length; + } + return v4 == null ? 0 : 1; + } + function valueFilter(val, assignmentOpts, populateOptions, allIds) { + const userSpecifiedTransform = typeof populateOptions.transform === "function"; + const transform = userSpecifiedTransform ? populateOptions.transform : (v4) => v4; + if (Array.isArray(val)) { + const ret = []; + const numValues = val.length; + for (let i5 = 0; i5 < numValues; ++i5) { + let subdoc = val[i5]; + const _allIds = Array.isArray(allIds) ? allIds[i5] : allIds; + if (!isPopulatedObject(subdoc) && (!populateOptions.retainNullValues || subdoc != null) && !userSpecifiedTransform) { + continue; + } else if (!populateOptions.retainNullValues && subdoc == null) { + continue; + } else if (userSpecifiedTransform) { + subdoc = transform(isPopulatedObject(subdoc) ? subdoc : null, _allIds); + } + maybeRemoveId(subdoc, assignmentOpts); + ret.push(subdoc); + if (assignmentOpts.originalLimit && ret.length >= assignmentOpts.originalLimit) { + break; + } + } + const rLen = ret.length; + while (val.length > rLen) { + Array.prototype.pop.apply(val, []); + } + let i4 = 0; + if (utils.isMongooseArray(val)) { + for (i4 = 0; i4 < rLen; ++i4) { + val.set(i4, ret[i4], true); + } + } else { + for (i4 = 0; i4 < rLen; ++i4) { + val[i4] = ret[i4]; + } + } + return val; + } + if (isPopulatedObject(val) || utils.isPOJO(val)) { + maybeRemoveId(val, assignmentOpts); + return transform(val, allIds); + } + if (val instanceof Map) { + return val; + } + if (populateOptions.justOne === false) { + return []; + } + return val == null ? transform(val, allIds) : transform(null, allIds); + } + function maybeRemoveId(subdoc, assignmentOpts) { + if (subdoc != null && assignmentOpts.excludeId) { + if (typeof subdoc.$__setValue === "function") { + delete subdoc._doc._id; + } else { + delete subdoc._id; + } + } + } + function isPopulatedObject(obj) { + if (obj == null) { + return false; + } + return Array.isArray(obj) || obj.$isMongooseMap || obj.$__ != null || leanPopulateMap.has(obj); + } + } +}); + +// node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js +var require_createPopulateQueryFilter = __commonJS({ + "node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js"(exports2, module2) { + "use strict"; + var SkipPopulateValue = require_skipPopulateValue(); + var parentPaths = require_parentPaths(); + var { trusted } = require_trusted(); + var hasDollarKeys = require_hasDollarKeys(); + module2.exports = function createPopulateQueryFilter(ids, _match, _foreignField, model, skipInvalidIds) { + const match = _formatMatch(_match); + if (_foreignField.size === 1) { + const foreignField = Array.from(_foreignField)[0]; + const foreignSchemaType = model.schema.path(foreignField); + if (foreignField !== "_id" || !match["_id"]) { + ids = _filterInvalidIds(ids, foreignSchemaType, skipInvalidIds); + match[foreignField] = trusted({ $in: ids }); + } else if (foreignField === "_id" && match["_id"]) { + const userSpecifiedMatch = hasDollarKeys(match[foreignField]) ? match[foreignField] : { $eq: match[foreignField] }; + match[foreignField] = { ...trusted({ $in: ids }), ...userSpecifiedMatch }; + } + const _parentPaths = parentPaths(foreignField); + for (let i4 = 0; i4 < _parentPaths.length - 1; ++i4) { + const cur = _parentPaths[i4]; + if (match[cur] != null && match[cur].$elemMatch != null) { + match[cur].$elemMatch[foreignField.slice(cur.length + 1)] = trusted({ $in: ids }); + delete match[foreignField]; + break; + } + } + } else { + const $or = []; + if (Array.isArray(match.$or)) { + match.$and = [{ $or: match.$or }, { $or }]; + delete match.$or; + } else { + match.$or = $or; + } + for (const foreignField of _foreignField) { + if (foreignField !== "_id" || !match["_id"]) { + const foreignSchemaType = model.schema.path(foreignField); + ids = _filterInvalidIds(ids, foreignSchemaType, skipInvalidIds); + $or.push({ [foreignField]: { $in: ids } }); + } else if (foreignField === "_id" && match["_id"]) { + const userSpecifiedMatch = hasDollarKeys(match[foreignField]) ? match[foreignField] : { $eq: match[foreignField] }; + match[foreignField] = { ...trusted({ $in: ids }), ...userSpecifiedMatch }; + } + } + } + return match; + }; + function _filterInvalidIds(ids, foreignSchemaType, skipInvalidIds) { + ids = ids.filter((v4) => !(v4 instanceof SkipPopulateValue)); + if (!skipInvalidIds) { + return ids; + } + return ids.filter((id) => { + try { + foreignSchemaType.cast(id); + return true; + } catch (err) { + return false; + } + }); + } + function _formatMatch(match) { + if (Array.isArray(match)) { + if (match.length > 1) { + return { $or: [].concat(match.map((m4) => Object.assign({}, m4))) }; + } + return Object.assign({}, match[0]); + } + return Object.assign({}, match); + } + } +}); + +// node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js +var require_getSchemaTypes = __commonJS({ + "node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js"(exports2, module2) { + "use strict"; + var Mixed = require_mixed(); + var get2 = require_get(); + var getDiscriminatorByValue = require_getDiscriminatorByValue(); + var leanPopulateMap = require_leanPopulateMap(); + var mpath = require_mpath(); + var populateModelSymbol = require_symbols().populateModelSymbol; + module2.exports = function getSchemaTypes(model, schema, doc, path) { + const pathschema = schema.path(path); + const topLevelDoc = doc; + if (pathschema) { + return pathschema; + } + const discriminatorKey = schema.discriminatorMapping && schema.discriminatorMapping.key; + if (discriminatorKey && model != null) { + if (doc != null && doc[discriminatorKey] != null) { + const discriminator = getDiscriminatorByValue(model.discriminators, doc[discriminatorKey]); + schema = discriminator ? discriminator.schema : schema; + } else if (model.discriminators != null) { + return Object.keys(model.discriminators).reduce((arr, name) => { + const disc = model.discriminators[name]; + return arr.concat(getSchemaTypes(disc, disc.schema, null, path)); + }, []); + } + } + function search(parts2, schema2, subdoc, nestedPath) { + let p4 = parts2.length + 1; + let foundschema; + let trypath; + while (p4--) { + trypath = parts2.slice(0, p4).join("."); + foundschema = schema2.path(trypath); + if (foundschema == null) { + continue; + } + if (foundschema.caster) { + if (foundschema.caster instanceof Mixed) { + return foundschema.caster; + } + let schemas = null; + if (foundschema.schema != null && foundschema.schema.discriminators != null) { + const discriminators = foundschema.schema.discriminators; + const discriminatorKeyPath = trypath + "." + foundschema.schema.options.discriminatorKey; + const keys = subdoc ? mpath.get(discriminatorKeyPath, subdoc) || [] : []; + schemas = Object.keys(discriminators).reduce(function(cur, discriminator) { + const tiedValue = discriminators[discriminator].discriminatorMapping.value; + if (doc == null || keys.indexOf(discriminator) !== -1 || keys.indexOf(tiedValue) !== -1) { + cur.push(discriminators[discriminator]); + } + return cur; + }, []); + } + if (p4 !== parts2.length && foundschema.schema) { + let ret; + if (parts2[p4] === "$") { + if (p4 + 1 === parts2.length) { + return foundschema; + } + ret = search( + parts2.slice(p4 + 1), + schema2, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts2.slice(0, p4)) + ); + if (ret) { + ret.$parentSchemaDocArray = ret.$parentSchemaDocArray || (foundschema.schema.$isSingleNested ? null : foundschema); + } + return ret; + } + if (schemas != null && schemas.length > 0) { + ret = []; + for (const schema3 of schemas) { + const _ret = search( + parts2.slice(p4), + schema3, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts2.slice(0, p4)) + ); + if (_ret != null) { + _ret.$parentSchemaDocArray = _ret.$parentSchemaDocArray || (foundschema.schema.$isSingleNested ? null : foundschema); + if (_ret.$parentSchemaDocArray) { + ret.$parentSchemaDocArray = _ret.$parentSchemaDocArray; + } + ret.push(_ret); + } + } + return ret; + } else { + ret = search( + parts2.slice(p4), + foundschema.schema, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts2.slice(0, p4)) + ); + if (ret) { + ret.$parentSchemaDocArray = ret.$parentSchemaDocArray || (foundschema.schema.$isSingleNested ? null : foundschema); + } + return ret; + } + } else if (p4 !== parts2.length && foundschema.$isMongooseArray && foundschema.casterConstructor.$isMongooseArray) { + let type = foundschema; + while (type.$isMongooseArray && !type.$isMongooseDocumentArray) { + type = type.casterConstructor; + } + const ret = search( + parts2.slice(p4), + type.schema, + null, + nestedPath.concat(parts2.slice(0, p4)) + ); + if (ret != null) { + return ret; + } + if (type.schema.discriminators) { + const discriminatorPaths = []; + for (const discriminatorName of Object.keys(type.schema.discriminators)) { + const _schema = type.schema.discriminators[discriminatorName] || type.schema; + const ret2 = search(parts2.slice(p4), _schema, null, nestedPath.concat(parts2.slice(0, p4))); + if (ret2 != null) { + discriminatorPaths.push(ret2); + } + } + if (discriminatorPaths.length > 0) { + return discriminatorPaths; + } + } + } + } else if (foundschema.$isSchemaMap && foundschema.$__schemaType instanceof Mixed) { + return foundschema.$__schemaType; + } + const fullPath = nestedPath.concat([trypath]).join("."); + if (topLevelDoc != null && topLevelDoc.$__ && topLevelDoc.$populated(fullPath, true) && p4 < parts2.length) { + const model2 = topLevelDoc.$populated(fullPath, true).options[populateModelSymbol]; + if (model2 != null) { + const ret = search( + parts2.slice(p4), + model2.schema, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts2.slice(0, p4)) + ); + return ret; + } + } + const _val = get2(topLevelDoc, trypath); + if (_val != null) { + const model2 = Array.isArray(_val) && _val.length > 0 ? leanPopulateMap.get(_val[0]) : leanPopulateMap.get(_val); + const schema3 = model2 != null ? model2.schema : null; + if (schema3 != null) { + const ret = search( + parts2.slice(p4), + schema3, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts2.slice(0, p4)) + ); + if (ret != null) { + ret.$parentSchemaDocArray = ret.$parentSchemaDocArray || (schema3.$isSingleNested ? null : schema3); + return ret; + } + } + } + return foundschema; + } + } + const parts = path.split("."); + for (let i4 = 0; i4 < parts.length; ++i4) { + if (parts[i4] === "$") { + parts[i4] = "0"; + } + } + return search(parts, schema, doc, []); + }; + } +}); + +// node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js +var require_getModelsMapForPopulate = __commonJS({ + "node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js"(exports2, module2) { + "use strict"; + var MongooseError = require_error2(); + var SkipPopulateValue = require_skipPopulateValue(); + var clone = require_clone(); + var get2 = require_get(); + var getDiscriminatorByValue = require_getDiscriminatorByValue(); + var getConstructorName = require_getConstructorName(); + var getSchemaTypes = require_getSchemaTypes(); + var getVirtual = require_getVirtual(); + var lookupLocalFields = require_lookupLocalFields(); + var mpath = require_mpath(); + var modelNamesFromRefPath = require_modelNamesFromRefPath(); + var utils = require_utils6(); + var modelSymbol = require_symbols().modelSymbol; + var populateModelSymbol = require_symbols().populateModelSymbol; + var schemaMixedSymbol = require_symbols2().schemaMixedSymbol; + var StrictPopulate = require_strictPopulate(); + module2.exports = function getModelsMapForPopulate(model, docs, options) { + let doc; + const len = docs.length; + const map2 = []; + const modelNameFromQuery = options.model && options.model.modelName || options.model; + let schema; + let refPath; + let modelNames; + const available = {}; + const modelSchema = model.schema; + if (options._localModel != null && options._localModel.schema.nested[options.path]) { + return []; + } + const _virtualRes = getVirtual(model.schema, options.path); + const virtual = _virtualRes == null ? null : _virtualRes.virtual; + if (virtual != null) { + return _virtualPopulate(model, docs, options, _virtualRes); + } + let allSchemaTypes = getSchemaTypes(model, modelSchema, null, options.path); + allSchemaTypes = Array.isArray(allSchemaTypes) ? allSchemaTypes : [allSchemaTypes].filter((v4) => v4 != null); + const isStrictPopulateDisabled = options.strictPopulate === false || options.options?.strictPopulate === false; + if (!isStrictPopulateDisabled && allSchemaTypes.length === 0 && options._localModel != null) { + return new StrictPopulate(options._fullPath || options.path); + } + for (let i4 = 0; i4 < len; i4++) { + doc = docs[i4]; + let justOne = null; + if (doc.$__ != null && doc.populated(options.path)) { + const forceRepopulate = options.forceRepopulate != null ? options.forceRepopulate : doc.constructor.base.options.forceRepopulate; + if (forceRepopulate === false) { + continue; + } + } + const docSchema = doc != null && doc.$__ != null ? doc.$__schema : modelSchema; + schema = getSchemaTypes(model, docSchema, doc, options.path); + if (schema != null && schema.$isMongooseDocumentArray && schema.options.ref == null && schema.options.refPath == null) { + continue; + } + const isUnderneathDocArray = schema && schema.$parentSchemaDocArray; + if (isUnderneathDocArray && get2(options, "options.sort") != null) { + return new MongooseError("Cannot populate with `sort` on path " + options.path + " because it is a subproperty of a document array"); + } + modelNames = null; + let isRefPath = false; + let normalizedRefPath = null; + let schemaOptions = null; + let modelNamesInOrder = null; + if (schema != null && schema.instance === "Embedded") { + if (schema.options.ref) { + const data3 = { + localField: options.path + "._id", + foreignField: "_id", + justOne: true + }; + const res = _getModelNames(doc, schema, modelNameFromQuery, model); + const unpopulatedValue = mpath.get(options.path, doc); + const id2 = mpath.get("_id", unpopulatedValue); + addModelNamesToMap(model, map2, available, res.modelNames, options, data3, id2, doc, schemaOptions, unpopulatedValue); + } + continue; + } + if (Array.isArray(schema)) { + const schemasArray = schema; + for (const _schema of schemasArray) { + let _modelNames; + let res; + try { + res = _getModelNames(doc, _schema, modelNameFromQuery, model); + _modelNames = res.modelNames; + isRefPath = isRefPath || res.isRefPath; + normalizedRefPath = normalizedRefPath || res.refPath; + justOne = res.justOne; + } catch (error2) { + return error2; + } + if (isRefPath && !res.isRefPath) { + continue; + } + if (!_modelNames) { + continue; + } + modelNames = modelNames || []; + for (const modelName of _modelNames) { + if (modelNames.indexOf(modelName) === -1) { + modelNames.push(modelName); + } + } + } + } else { + try { + const res = _getModelNames(doc, schema, modelNameFromQuery, model); + modelNames = res.modelNames; + isRefPath = res.isRefPath; + normalizedRefPath = normalizedRefPath || res.refPath; + justOne = res.justOne; + schemaOptions = get2(schema, "options.populate", null); + if (isRefPath) { + modelNamesInOrder = modelNames; + modelNames = Array.from(new Set(modelNames)); + } + } catch (error2) { + return error2; + } + if (!modelNames) { + continue; + } + } + const data2 = {}; + const localField = options.path; + const foreignField = "_id"; + if ("justOne" in options && options.justOne !== void 0) { + justOne = options.justOne; + } else if (schema && !schema[schemaMixedSymbol]) { + if (options.path.endsWith("." + schema.path) || options.path === schema.path) { + justOne = Array.isArray(schema) ? schema.every((schema2) => !schema2.$isMongooseArray) : !schema.$isMongooseArray; + } + } + if (!modelNames) { + continue; + } + data2.isVirtual = false; + data2.justOne = justOne; + data2.localField = localField; + data2.foreignField = foreignField; + const ret = _getLocalFieldValues(doc, localField, model, options, null, schema); + const id = String(utils.getValue(foreignField, doc)); + options._docs[id] = Array.isArray(ret) ? ret.slice() : ret; + let match = get2(options, "match", null); + const hasMatchFunction = typeof match === "function"; + if (hasMatchFunction) { + match = match.call(doc, doc); + } + throwOn$where(match); + data2.match = match; + data2.hasMatchFunction = hasMatchFunction; + data2.isRefPath = isRefPath; + data2.modelNamesInOrder = modelNamesInOrder; + if (isRefPath) { + const embeddedDiscriminatorModelNames = _findRefPathForDiscriminators( + doc, + modelSchema, + data2, + options, + normalizedRefPath, + ret + ); + modelNames = embeddedDiscriminatorModelNames || modelNames; + } + try { + addModelNamesToMap(model, map2, available, modelNames, options, data2, ret, doc, schemaOptions); + } catch (err) { + return err; + } + } + return map2; + function _getModelNames(doc2, schema2, modelNameFromQuery2, model2) { + let modelNames2; + let isRefPath = false; + let justOne = null; + const originalSchema = schema2; + if (schema2 && schema2.instance === "Array") { + schema2 = schema2.caster; + } + if (schema2 && schema2.$isSchemaMap) { + schema2 = schema2.$__schemaType; + } + const ref = schema2 && schema2.options && schema2.options.ref; + refPath = schema2 && schema2.options && schema2.options.refPath; + if (schema2 != null && schema2[schemaMixedSymbol] && !ref && !refPath && !modelNameFromQuery2) { + return { modelNames: null }; + } + if (modelNameFromQuery2) { + modelNames2 = [modelNameFromQuery2]; + } else if (refPath != null) { + if (typeof refPath === "function") { + const subdocPath = options.path.slice(0, options.path.length - schema2.path.length - 1); + const vals = mpath.get(subdocPath, doc2, lookupLocalFields); + const subdocsBeingPopulated = Array.isArray(vals) ? utils.array.flatten(vals) : vals ? [vals] : []; + modelNames2 = /* @__PURE__ */ new Set(); + for (const subdoc of subdocsBeingPopulated) { + refPath = refPath.call(subdoc, subdoc, options.path); + modelNamesFromRefPath(refPath, doc2, options.path, modelSchema, options._queryProjection).forEach((name) => modelNames2.add(name)); + } + modelNames2 = Array.from(modelNames2); + } else { + modelNames2 = modelNamesFromRefPath(refPath, doc2, options.path, modelSchema, options._queryProjection); + } + isRefPath = true; + } else { + let ref2; + let refPath2; + let schemaForCurrentDoc; + let discriminatorValue; + let modelForCurrentDoc = model2; + const discriminatorKey = model2.schema.options.discriminatorKey; + if (!schema2 && discriminatorKey && (discriminatorValue = utils.getValue(discriminatorKey, doc2))) { + const discriminatorModel = getDiscriminatorByValue(model2.discriminators, discriminatorValue) || model2; + if (discriminatorModel != null) { + modelForCurrentDoc = discriminatorModel; + } else { + try { + modelForCurrentDoc = _getModelFromConn(model2.db, discriminatorValue); + } catch (error2) { + return error2; + } + } + schemaForCurrentDoc = modelForCurrentDoc.schema._getSchema(options.path); + if (schemaForCurrentDoc && schemaForCurrentDoc.caster) { + schemaForCurrentDoc = schemaForCurrentDoc.caster; + } + } else { + schemaForCurrentDoc = schema2; + } + if (originalSchema && originalSchema.path.endsWith(".$*")) { + justOne = !originalSchema.$isMongooseArray && !originalSchema._arrayPath; + } else if (schemaForCurrentDoc != null) { + justOne = !schemaForCurrentDoc.$isMongooseArray && !schemaForCurrentDoc._arrayPath; + } + if ((ref2 = get2(schemaForCurrentDoc, "options.ref")) != null) { + if (schemaForCurrentDoc != null && typeof ref2 === "function" && options.path.endsWith("." + schemaForCurrentDoc.path)) { + modelNames2 = /* @__PURE__ */ new Set(); + const subdocPath = options.path.slice(0, options.path.length - schemaForCurrentDoc.path.length - 1); + const vals = mpath.get(subdocPath, doc2, lookupLocalFields); + const subdocsBeingPopulated = Array.isArray(vals) ? utils.array.flatten(vals) : vals ? [vals] : []; + for (const subdoc of subdocsBeingPopulated) { + modelNames2.add(handleRefFunction(ref2, subdoc)); + } + if (subdocsBeingPopulated.length === 0) { + modelNames2 = [handleRefFunction(ref2, doc2)]; + } else { + modelNames2 = Array.from(modelNames2); + } + } else { + ref2 = handleRefFunction(ref2, doc2); + modelNames2 = [ref2]; + } + } else if ((schemaForCurrentDoc = get2(schema2, "options.refPath")) != null) { + isRefPath = true; + if (typeof refPath2 === "function") { + const subdocPath = options.path.slice(0, options.path.length - schemaForCurrentDoc.path.length - 1); + const vals = mpath.get(subdocPath, doc2, lookupLocalFields); + const subdocsBeingPopulated = Array.isArray(vals) ? utils.array.flatten(vals) : vals ? [vals] : []; + modelNames2 = /* @__PURE__ */ new Set(); + for (const subdoc of subdocsBeingPopulated) { + refPath2 = refPath2.call(subdoc, subdoc, options.path); + modelNamesFromRefPath(refPath2, doc2, options.path, modelSchema, options._queryProjection).forEach((name) => modelNames2.add(name)); + } + modelNames2 = Array.from(modelNames2); + } else { + modelNames2 = modelNamesFromRefPath(refPath2, doc2, options.path, modelSchema, options._queryProjection); + } + } + } + if (!modelNames2) { + if (options._localModel == null) { + modelNames2 = [model2.modelName]; + } else { + return { modelNames: modelNames2, justOne, isRefPath, refPath }; + } + } + if (!Array.isArray(modelNames2)) { + modelNames2 = [modelNames2]; + } + return { modelNames: modelNames2, justOne, isRefPath, refPath }; + } + }; + function _virtualPopulate(model, docs, options, _virtualRes) { + const map2 = []; + const available = {}; + const virtual = _virtualRes.virtual; + for (const doc of docs) { + let modelNames = null; + const data2 = {}; + let localField; + const virtualPrefix = _virtualRes.nestedSchemaPath ? _virtualRes.nestedSchemaPath + "." : ""; + if (typeof options.localField === "string") { + localField = options.localField; + } else if (typeof virtual.options.localField === "function") { + localField = virtualPrefix + virtual.options.localField.call(doc, doc); + } else if (Array.isArray(virtual.options.localField)) { + localField = virtual.options.localField.map((field) => virtualPrefix + field); + } else { + localField = virtualPrefix + virtual.options.localField; + } + data2.count = virtual.options.count; + if (virtual.options.skip != null && !Object.hasOwn(options, "skip")) { + options.skip = virtual.options.skip; + } + if (virtual.options.limit != null && !Object.hasOwn(options, "limit")) { + options.limit = virtual.options.limit; + } + if (virtual.options.perDocumentLimit != null && !Object.hasOwn(options, "perDocumentLimit")) { + options.perDocumentLimit = virtual.options.perDocumentLimit; + } + let foreignField = virtual.options.foreignField; + if (!localField || !foreignField) { + return new MongooseError(`Cannot populate virtual \`${options.path}\` on model \`${model.modelName}\`, because options \`localField\` and / or \`foreignField\` are missing`); + } + if (typeof localField === "function") { + localField = localField.call(doc, doc); + } + if (typeof foreignField === "function") { + foreignField = foreignField.call(doc, doc); + } + data2.isRefPath = false; + let justOne = null; + if ("justOne" in options && options.justOne !== void 0) { + justOne = options.justOne; + } + modelNames = virtual._getModelNamesForPopulate(doc); + if (virtual.options.refPath) { + justOne = !!virtual.options.justOne; + data2.isRefPath = true; + } else if (virtual.options.ref) { + justOne = !!virtual.options.justOne; + } + data2.isVirtual = true; + data2.virtual = virtual; + data2.justOne = justOne; + const baseMatch = get2(data2, "virtual.options.match", null) || get2(data2, "virtual.options.options.match", null); + let match = get2(options, "match", null) || baseMatch; + let hasMatchFunction = typeof match === "function"; + if (hasMatchFunction) { + match = match.call(doc, doc, data2.virtual); + } + if (Array.isArray(localField) && Array.isArray(foreignField) && localField.length === foreignField.length) { + match = Object.assign({}, match); + for (let i4 = 1; i4 < localField.length; ++i4) { + match[foreignField[i4]] = convertTo_id(mpath.get(localField[i4], doc, lookupLocalFields), model.schema); + hasMatchFunction = true; + } + localField = localField[0]; + foreignField = foreignField[0]; + } + data2.localField = localField; + data2.foreignField = foreignField; + data2.match = match; + data2.hasMatchFunction = hasMatchFunction; + throwOn$where(match); + const ret = _getLocalFieldValues(doc, localField, model, options, virtual); + try { + addModelNamesToMap(model, map2, available, modelNames, options, data2, ret, doc); + } catch (err) { + return err; + } + } + return map2; + } + function addModelNamesToMap(model, map2, available, modelNames, options, data2, ret, doc, schemaOptions, unpopulatedValue) { + const connection = options.connection != null ? options.connection : model.db; + unpopulatedValue = unpopulatedValue === void 0 ? ret : unpopulatedValue; + if (Array.isArray(unpopulatedValue)) { + unpopulatedValue = utils.cloneArrays(unpopulatedValue); + } + if (modelNames == null) { + return; + } + const flatModelNames = utils.array.flatten(modelNames); + let k4 = flatModelNames.length; + while (k4--) { + let modelName = flatModelNames[k4]; + if (modelName == null) { + continue; + } + let Model; + if (options.model && options.model[modelSymbol]) { + Model = options.model; + } else if (modelName[modelSymbol]) { + Model = modelName; + modelName = Model.modelName; + } else { + try { + Model = _getModelFromConn(connection, modelName); + } catch (err) { + if (ret !== void 0) { + throw err; + } + Model = null; + } + } + let ids = ret; + const modelNamesForRefPath = data2.modelNamesInOrder ? data2.modelNamesInOrder : modelNames; + if (data2.isRefPath && Array.isArray(ret) && ret.length === modelNamesForRefPath.length) { + ids = matchIdsToRefPaths(ret, modelNamesForRefPath, modelName); + } + const perDocumentLimit = options.perDocumentLimit == null ? get2(options, "options.perDocumentLimit", null) : options.perDocumentLimit; + if (!available[modelName] || perDocumentLimit != null) { + const currentOptions = { + model: Model + }; + if (data2.isVirtual && get2(data2.virtual, "options.options")) { + currentOptions.options = clone(data2.virtual.options.options); + } else if (schemaOptions != null) { + currentOptions.options = Object.assign({}, schemaOptions); + } + utils.merge(currentOptions, options); + options[populateModelSymbol] = Model; + currentOptions[populateModelSymbol] = Model; + available[modelName] = { + model: Model, + options: currentOptions, + match: data2.hasMatchFunction ? [data2.match] : data2.match, + docs: [doc], + ids: [ids], + allIds: [ret], + unpopulatedValues: [unpopulatedValue], + localField: /* @__PURE__ */ new Set([data2.localField]), + foreignField: /* @__PURE__ */ new Set([data2.foreignField]), + justOne: data2.justOne, + isVirtual: data2.isVirtual, + virtual: data2.virtual, + count: data2.count, + [populateModelSymbol]: Model + }; + map2.push(available[modelName]); + } else { + available[modelName].localField.add(data2.localField); + available[modelName].foreignField.add(data2.foreignField); + available[modelName].docs.push(doc); + available[modelName].ids.push(ids); + available[modelName].allIds.push(ret); + available[modelName].unpopulatedValues.push(unpopulatedValue); + if (data2.hasMatchFunction) { + available[modelName].match.push(data2.match); + } + } + } + } + function _getModelFromConn(conn, modelName) { + if (conn.models[modelName] == null && conn._parent != null) { + return _getModelFromConn(conn._parent, modelName); + } + return conn.model(modelName); + } + function matchIdsToRefPaths(ids, refPaths, refPathToFind) { + if (!Array.isArray(refPaths)) { + return refPaths === refPathToFind ? Array.isArray(ids) ? utils.array.flatten(ids) : [ids] : []; + } + if (Array.isArray(ids) && Array.isArray(refPaths)) { + return ids.flatMap((id, index) => matchIdsToRefPaths(id, refPaths[index], refPathToFind)); + } + return []; + } + function handleRefFunction(ref, doc) { + if (typeof ref === "function" && !ref[modelSymbol]) { + return ref.call(doc, doc); + } + return ref; + } + function _getLocalFieldValues(doc, localField, model, options, virtual, schema) { + const localFieldPathType = model.schema._getPathType(localField); + const localFieldPath = localFieldPathType === "real" ? model.schema.path(localField) : localFieldPathType.schema; + const localFieldGetters = localFieldPath && localFieldPath.getters ? localFieldPath.getters : []; + localField = localFieldPath != null && localFieldPath.instance === "Embedded" ? localField + "._id" : localField; + const _populateOptions = get2(options, "options", {}); + const getters = "getters" in _populateOptions ? _populateOptions.getters : get2(virtual, "options.getters", false); + if (localFieldGetters.length !== 0 && getters) { + const hydratedDoc = doc.$__ != null ? doc : model.hydrate(doc); + const localFieldValue = utils.getValue(localField, doc); + if (Array.isArray(localFieldValue)) { + const localFieldHydratedValue = utils.getValue(localField.split(".").slice(0, -1), hydratedDoc); + return localFieldValue.map((localFieldArrVal, localFieldArrIndex) => localFieldPath.applyGetters(localFieldArrVal, localFieldHydratedValue[localFieldArrIndex])); + } else { + return localFieldPath.applyGetters(localFieldValue, hydratedDoc); + } + } else { + return convertTo_id(mpath.get(localField, doc, lookupLocalFields), schema); + } + } + function convertTo_id(val, schema) { + if (val != null && val.$__ != null) { + return val._doc._id; + } + if (val != null && val._id != null && (schema == null || !schema.$isSchemaMap)) { + return val._id; + } + if (Array.isArray(val)) { + const rawVal = val.__array != null ? val.__array : val; + for (let i4 = 0; i4 < rawVal.length; ++i4) { + if (rawVal[i4] != null && rawVal[i4].$__ != null) { + rawVal[i4] = rawVal[i4]._doc._id; + } + } + if (utils.isMongooseArray(val) && val.$schema()) { + return val.$schema()._castForPopulate(val, val.$parent()); + } + return [].concat(val); + } + if (getConstructorName(val) === "Object" && // The intent here is we should only flatten the object if we expect + // to get a Map in the end. Avoid doing this for mixed types. + (schema == null || schema[schemaMixedSymbol] == null)) { + const ret = []; + for (const key of Object.keys(val)) { + ret.push(val[key]); + } + return ret; + } + if (val instanceof Map) { + return Array.from(val.values()); + } + return val; + } + function _findRefPathForDiscriminators(doc, modelSchema, data2, options, normalizedRefPath, ret) { + if (!data2.isRefPath || normalizedRefPath == null) { + return; + } + const pieces = normalizedRefPath.split("."); + let cur = ""; + let modelNames = void 0; + for (let i4 = 0; i4 < pieces.length; ++i4) { + const piece = pieces[i4]; + cur = cur + (cur.length === 0 ? "" : ".") + piece; + const schematype = modelSchema.path(cur); + if (schematype != null && schematype.$isMongooseArray && schematype.caster.discriminators != null && Object.keys(schematype.caster.discriminators).length !== 0) { + const subdocs = utils.getValue(cur, doc); + const remnant = options.path.substring(cur.length + 1); + const discriminatorKey = schematype.caster.schema.options.discriminatorKey; + modelNames = []; + for (const subdoc of subdocs) { + const discriminatorName = utils.getValue(discriminatorKey, subdoc); + const discriminator = schematype.caster.discriminators[discriminatorName]; + const discriminatorSchema = discriminator && discriminator.schema; + if (discriminatorSchema == null) { + continue; + } + const _path = discriminatorSchema.path(remnant); + if (_path == null || _path.options.refPath == null) { + const docValue = utils.getValue(data2.localField.substring(cur.length + 1), subdoc); + ret.forEach((v4, i5) => { + if (v4 === docValue) { + ret[i5] = SkipPopulateValue(v4); + } + }); + continue; + } + const modelName = utils.getValue(pieces.slice(i4 + 1).join("."), subdoc); + modelNames.push(modelName); + } + } + } + return modelNames; + } + function throwOn$where(match) { + if (match == null) { + return; + } + if (typeof match !== "object") { + return; + } + for (const key of Object.keys(match)) { + if (key === "$where") { + throw new MongooseError("Cannot use $where filter with populate() match"); + } + if (match[key] != null && typeof match[key] === "object") { + throwOn$where(match[key]); + } + } + } + } +}); + +// node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js +var require_isDefaultIdIndex = __commonJS({ + "node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js"(exports2, module2) { + "use strict"; + var get2 = require_get(); + module2.exports = function isDefaultIdIndex(index) { + if (Array.isArray(index)) { + const keys = Object.keys(index[0]); + return keys.length === 1 && keys[0] === "_id" && index[0]._id !== "hashed"; + } + if (typeof index !== "object") { + return false; + } + const key = get2(index, "key", {}); + return Object.keys(key).length === 1 && Object.hasOwn(key, "_id"); + }; + } +}); + +// node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js +var require_isIndexEqual = __commonJS({ + "node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js"(exports2, module2) { + "use strict"; + var get2 = require_get(); + var utils = require_utils6(); + module2.exports = function isIndexEqual(schemaIndexKeysObject, options, dbIndex) { + if (dbIndex.textIndexVersion != null) { + delete dbIndex.key._fts; + delete dbIndex.key._ftsx; + const weights = { ...dbIndex.weights, ...dbIndex.key }; + if (Object.keys(weights).length !== Object.keys(schemaIndexKeysObject).length) { + return false; + } + for (const prop of Object.keys(weights)) { + if (!(prop in schemaIndexKeysObject)) { + return false; + } + const weight = weights[prop]; + if (weight !== get2(options, "weights." + prop) && !(weight === 1 && get2(options, "weights." + prop) == null)) { + return false; + } + } + if (options["default_language"] !== dbIndex["default_language"]) { + return dbIndex["default_language"] === "english" && options["default_language"] == null; + } + return true; + } + const optionKeys = [ + "unique", + "partialFilterExpression", + "sparse", + "expireAfterSeconds", + "collation" + ]; + for (const key of optionKeys) { + if (!(key in options) && !(key in dbIndex)) { + continue; + } + if (key === "collation") { + if (options[key] == null || dbIndex[key] == null) { + return options[key] == null && dbIndex[key] == null; + } + const definedKeys = Object.keys(options.collation); + const schemaCollation = options.collation; + const dbCollation = dbIndex.collation; + for (const opt of definedKeys) { + if (get2(schemaCollation, opt) !== get2(dbCollation, opt)) { + return false; + } + } + } else if (!utils.deepEqual(options[key], dbIndex[key])) { + return false; + } + } + const schemaIndexKeys = Object.keys(schemaIndexKeysObject); + const dbIndexKeys = Object.keys(dbIndex.key); + if (schemaIndexKeys.length !== dbIndexKeys.length) { + return false; + } + for (let i4 = 0; i4 < schemaIndexKeys.length; ++i4) { + if (schemaIndexKeys[i4] !== dbIndexKeys[i4]) { + return false; + } + if (!utils.deepEqual(schemaIndexKeysObject[schemaIndexKeys[i4]], dbIndex.key[dbIndexKeys[i4]])) { + return false; + } + } + return true; + }; + } +}); + +// node_modules/mongoose/lib/helpers/indexes/isTimeseriesIndex.js +var require_isTimeseriesIndex = __commonJS({ + "node_modules/mongoose/lib/helpers/indexes/isTimeseriesIndex.js"(exports2, module2) { + "use strict"; + module2.exports = function isTimeseriesIndex(dbIndex, schemaOptions) { + if (schemaOptions.timeseries == null) { + return false; + } + const { timeField, metaField } = schemaOptions.timeseries; + if (typeof timeField !== "string" || typeof metaField !== "string") { + return false; + } + return Object.keys(dbIndex.key).length === 2 && dbIndex.key[timeField] === 1 && dbIndex.key[metaField] === 1; + }; + } +}); + +// node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js +var require_getRelatedIndexes = __commonJS({ + "node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js"(exports2, module2) { + "use strict"; + var hasDollarKeys = require_hasDollarKeys(); + function getRelatedSchemaIndexes(model, schemaIndexes) { + return getRelatedIndexes({ + baseModelName: model.baseModelName, + discriminatorMapping: model.schema.discriminatorMapping, + indexes: schemaIndexes, + indexesType: "schema" + }); + } + function getRelatedDBIndexes(model, dbIndexes) { + return getRelatedIndexes({ + baseModelName: model.baseModelName, + discriminatorMapping: model.schema.discriminatorMapping, + indexes: dbIndexes, + indexesType: "db" + }); + } + module2.exports = { + getRelatedSchemaIndexes, + getRelatedDBIndexes + }; + function getRelatedIndexes({ + baseModelName, + discriminatorMapping, + indexes, + indexesType + }) { + const discriminatorKey = discriminatorMapping && discriminatorMapping.key; + const discriminatorValue = discriminatorMapping && discriminatorMapping.value; + if (!discriminatorKey) { + return indexes; + } + const isChildDiscriminatorModel = Boolean(baseModelName); + if (isChildDiscriminatorModel) { + return indexes.filter((index) => { + const partialFilterExpression = getPartialFilterExpression(index, indexesType); + return partialFilterExpression && partialFilterExpression[discriminatorKey] === discriminatorValue; + }); + } + return indexes.filter((index) => { + const partialFilterExpression = getPartialFilterExpression(index, indexesType); + return !partialFilterExpression || !partialFilterExpression[discriminatorKey] || hasDollarKeys(partialFilterExpression[discriminatorKey]) && !("$eq" in partialFilterExpression[discriminatorKey]); + }); + } + function getPartialFilterExpression(index, indexesType) { + if (indexesType === "schema") { + const options = index[1]; + return options && options.partialFilterExpression; + } + return index.partialFilterExpression; + } + } +}); + +// node_modules/mongoose/lib/helpers/parallelLimit.js +var require_parallelLimit = __commonJS({ + "node_modules/mongoose/lib/helpers/parallelLimit.js"(exports2, module2) { + "use strict"; + module2.exports = parallelLimit; + function parallelLimit(fns, limit, callback) { + let numInProgress = 0; + let numFinished = 0; + let error2 = null; + if (limit <= 0) { + throw new Error("Limit must be positive"); + } + if (fns.length === 0) { + return callback(null, []); + } + for (let i4 = 0; i4 < fns.length && i4 < limit; ++i4) { + _start(); + } + function _start() { + fns[numFinished + numInProgress](_done(numFinished + numInProgress)); + ++numInProgress; + } + const results = []; + function _done(index) { + return (err, res) => { + --numInProgress; + ++numFinished; + if (error2 != null) { + return; + } + if (err != null) { + error2 = err; + return callback(error2); + } + results[index] = res; + if (numFinished === fns.length) { + return callback(null, results); + } else if (numFinished + numInProgress < fns.length) { + _start(); + } + }; + } + } + } +}); + +// node_modules/mongoose/lib/helpers/model/pushNestedArrayPaths.js +var require_pushNestedArrayPaths = __commonJS({ + "node_modules/mongoose/lib/helpers/model/pushNestedArrayPaths.js"(exports2, module2) { + "use strict"; + module2.exports = function pushNestedArrayPaths(paths, nestedArray, path) { + if (nestedArray == null) { + return; + } + for (let i4 = 0; i4 < nestedArray.length; ++i4) { + if (Array.isArray(nestedArray[i4])) { + pushNestedArrayPaths(paths, nestedArray[i4], path + "." + i4); + } else { + paths.push(path + "." + i4); + } + } + }; + } +}); + +// node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js +var require_removeDeselectedForeignField = __commonJS({ + "node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js"(exports2, module2) { + "use strict"; + var get2 = require_get(); + var mpath = require_mpath(); + var parseProjection = require_parseProjection(); + module2.exports = function removeDeselectedForeignField(foreignFields, options, docs) { + const projection = parseProjection(get2(options, "select", null), true) || parseProjection(get2(options, "options.select", null), true); + if (projection == null) { + return; + } + for (const foreignField of foreignFields) { + if (!Object.hasOwn(projection, "-" + foreignField)) { + continue; + } + for (const val of docs) { + if (val.$__ != null) { + mpath.unset(foreignField, val._doc); + } else { + mpath.unset(foreignField, val); + } + } + } + }; + } +}); + +// node_modules/mongoose/lib/model.js +var require_model = __commonJS({ + "node_modules/mongoose/lib/model.js"(exports2, module2) { + "use strict"; + var Aggregate = require_aggregate2(); + var ChangeStream = require_changeStream(); + var Document = require_document2(); + var DocumentNotFoundError = require_notFound(); + var EventEmitter = require("events").EventEmitter; + var Kareem = require_kareem(); + var MongooseBulkWriteError = require_bulkWriteError(); + var MongooseError = require_error2(); + var ObjectParameterError = require_objectParameter(); + var OverwriteModelError = require_overwriteModel(); + var Query = require_query2(); + var SaveOptions = require_saveOptions(); + var Schema2 = require_schema2(); + var ValidationError = require_validation(); + var VersionError = require_version(); + var ParallelSaveError = require_parallelSave(); + var applyDefaultsHelper = require_applyDefaults(); + var applyDefaultsToPOJO = require_applyDefaultsToPOJO(); + var applyEmbeddedDiscriminators = require_applyEmbeddedDiscriminators(); + var applyHooks = require_applyHooks(); + var applyMethods = require_applyMethods(); + var applyProjection = require_applyProjection(); + var applyReadConcern = require_applyReadConcern(); + var applySchemaCollation = require_applySchemaCollation(); + var applyStaticHooks = require_applyStaticHooks(); + var applyStatics = require_applyStatics(); + var applyTimestampsHelper = require_applyTimestamps(); + var applyWriteConcern = require_applyWriteConcern(); + var applyVirtualsHelper = require_applyVirtuals(); + var assignVals = require_assignVals(); + var castBulkWrite = require_castBulkWrite(); + var clone = require_clone(); + var createPopulateQueryFilter = require_createPopulateQueryFilter(); + var decorateUpdateWithVersionKey = require_decorateUpdateWithVersionKey(); + var getDefaultBulkwriteResult = require_getDefaultBulkwriteResult(); + var getSchemaDiscriminatorByValue = require_getSchemaDiscriminatorByValue(); + var discriminator = require_discriminator(); + var each = require_each(); + var get2 = require_get(); + var getConstructorName = require_getConstructorName(); + var getDiscriminatorByValue = require_getDiscriminatorByValue(); + var getModelsMapForPopulate = require_getModelsMapForPopulate(); + var immediate = require_immediate(); + var internalToObjectOptions = require_options().internalToObjectOptions; + var isDefaultIdIndex = require_isDefaultIdIndex(); + var isIndexEqual = require_isIndexEqual(); + var isTimeseriesIndex = require_isTimeseriesIndex(); + var { + getRelatedDBIndexes, + getRelatedSchemaIndexes + } = require_getRelatedIndexes(); + var decorateDiscriminatorIndexOptions = require_decorateDiscriminatorIndexOptions(); + var isPathSelectedInclusive = require_isPathSelectedInclusive(); + var leanPopulateMap = require_leanPopulateMap(); + var parallelLimit = require_parallelLimit(); + var prepareDiscriminatorPipeline = require_prepareDiscriminatorPipeline(); + var pushNestedArrayPaths = require_pushNestedArrayPaths(); + var removeDeselectedForeignField = require_removeDeselectedForeignField(); + var setDottedPath = require_setDottedPath(); + var util = require("util"); + var utils = require_utils6(); + var minimize = require_minimize(); + var MongooseBulkSaveIncompleteError = require_bulkSaveIncompleteError(); + var ObjectExpectedError = require_objectExpected(); + var decorateBulkWriteResult = require_decorateBulkWriteResult(); + var modelCollectionSymbol = /* @__PURE__ */ Symbol("mongoose#Model#collection"); + var modelDbSymbol = /* @__PURE__ */ Symbol("mongoose#Model#db"); + var modelSymbol = require_symbols().modelSymbol; + var subclassedSymbol = /* @__PURE__ */ Symbol("mongoose#Model#subclassed"); + var { VERSION_INC, VERSION_WHERE, VERSION_ALL } = Document; + var saveToObjectOptions = Object.assign({}, internalToObjectOptions, { + bson: true + }); + function Model(doc, fields, skipId) { + if (fields instanceof Schema2) { + throw new TypeError("2nd argument to `Model` constructor must be a POJO or string, **not** a schema. Make sure you're calling `mongoose.model()`, not `mongoose.Model()`."); + } + if (typeof doc === "string") { + throw new TypeError("First argument to `Model` constructor must be an object, **not** a string. Make sure you're calling `mongoose.model()`, not `mongoose.Model()`."); + } + Document.call(this, doc, fields, skipId); + } + Object.setPrototypeOf(Model.prototype, Document.prototype); + Model.prototype.$isMongooseModelPrototype = true; + Model.prototype.db; + Model.useConnection = function useConnection(connection) { + if (!connection) { + throw new Error("Please provide a connection."); + } + if (this.db) { + delete this.db.models[this.modelName]; + delete this.prototype.db; + delete this.prototype[modelDbSymbol]; + delete this.prototype.collection; + delete this.prototype.$collection; + delete this.prototype[modelCollectionSymbol]; + } + this.db = connection; + const collection = connection.collection(this.collection.collectionName, connection.options); + this.prototype.collection = collection; + this.prototype.$collection = collection; + this.prototype[modelCollectionSymbol] = collection; + this.prototype.db = connection; + this.prototype[modelDbSymbol] = connection; + this.collection = collection; + this.$__collection = collection; + connection.models[this.modelName] = this; + return this; + }; + Model.prototype.collection; + Model.prototype.$__collection; + Model.prototype.modelName; + Model.prototype.$where; + Model.prototype.baseModelName; + Model.events; + Model._middleware; + function _applyCustomWhere(doc, where) { + if (doc.$where == null) { + return; + } + for (const key of Object.keys(doc.$where)) { + where[key] = doc.$where[key]; + } + } + Model.prototype.$__handleSave = function(options, callback) { + const saveOptions = {}; + applyWriteConcern(this.$__schema, options); + if (typeof options.writeConcern !== "undefined") { + saveOptions.writeConcern = {}; + if ("w" in options.writeConcern) { + saveOptions.writeConcern.w = options.writeConcern.w; + } + if ("j" in options.writeConcern) { + saveOptions.writeConcern.j = options.writeConcern.j; + } + if ("wtimeout" in options.writeConcern) { + saveOptions.writeConcern.wtimeout = options.writeConcern.wtimeout; + } + } else { + if ("w" in options) { + saveOptions.w = options.w; + } + if ("j" in options) { + saveOptions.j = options.j; + } + if ("wtimeout" in options) { + saveOptions.wtimeout = options.wtimeout; + } + } + if ("checkKeys" in options) { + saveOptions.checkKeys = options.checkKeys; + } + const session = this.$session(); + const asyncLocalStorage = this[modelDbSymbol].base.transactionAsyncLocalStorage?.getStore(); + if (session != null) { + saveOptions.session = session; + } else if (!Object.hasOwn(options, "session") && asyncLocalStorage?.session != null) { + saveOptions.session = asyncLocalStorage.session; + } + if (this.$isNew) { + const obj = this.toObject(saveToObjectOptions); + if ((obj || {})._id === void 0) { + immediate(function() { + callback(new MongooseError("document must have an _id before saving")); + }); + return; + } + this.$__version(true, obj); + this[modelCollectionSymbol].insertOne(obj, saveOptions).then( + (ret) => callback(null, ret), + (err) => { + _setIsNew(this, true); + callback(err, null); + } + ); + this.$__reset(); + _setIsNew(this, false); + this.$__.inserting = true; + return; + } + this.$__.inserting = false; + const delta = this.$__delta(); + if (options.pathsToSave) { + for (const key in delta[1]["$set"]) { + if (options.pathsToSave.includes(key)) { + continue; + } else if (options.pathsToSave.some((pathToSave) => key.slice(0, pathToSave.length) === pathToSave && key.charAt(pathToSave.length) === ".")) { + continue; + } else { + delete delta[1]["$set"][key]; + } + } + } + if (delta) { + if (delta instanceof MongooseError) { + callback(delta); + return; + } + const where = this.$__where(delta[0]); + if (where instanceof MongooseError) { + callback(where); + return; + } + _applyCustomWhere(this, where); + const update = delta[1]; + if (this.$__schema.options.minimize) { + for (const updateOp of Object.values(update)) { + if (updateOp == null) { + continue; + } + for (const key of Object.keys(updateOp)) { + if (updateOp[key] == null || typeof updateOp[key] !== "object") { + continue; + } + if (!utils.isPOJO(updateOp[key])) { + continue; + } + minimize(updateOp[key]); + if (Object.keys(updateOp[key]).length === 0) { + delete updateOp[key]; + update.$unset = update.$unset || {}; + update.$unset[key] = 1; + } + } + } + } + this[modelCollectionSymbol].updateOne(where, update, saveOptions).then( + (ret) => { + if (ret == null) { + ret = { $where: where }; + } else { + ret.$where = where; + } + callback(null, ret); + }, + (err) => { + this.$__undoReset(); + callback(err); + } + ); + } else { + handleEmptyUpdate.call(this); + return; + } + this.$__.modifiedPaths = this.modifiedPaths().concat(Object.keys(this.$__.activePaths.getStatePaths("default"))); + this.$__reset(); + _setIsNew(this, false); + function handleEmptyUpdate() { + const optionsWithCustomValues = Object.assign({}, options, saveOptions); + const where = this.$__where(); + const optimisticConcurrency = this.$__schema.options.optimisticConcurrency; + if (optimisticConcurrency && !Array.isArray(optimisticConcurrency)) { + const key = this.$__schema.options.versionKey; + const val = this.$__getValue(key); + if (val != null) { + where[key] = val; + } + } + applyReadConcern(this.$__schema, optionsWithCustomValues); + this.constructor.collection.findOne(where, optionsWithCustomValues).then((documentExists) => { + const matchedCount = !documentExists ? 0 : 1; + callback(null, { $where: where, matchedCount }); + }).catch(callback); + } + }; + Model.prototype.$__save = function(options, callback) { + this.$__handleSave(options, (error2, result) => { + if (error2) { + error2 = this.$__schema._transformDuplicateKeyError(error2); + const hooks = this.$__schema.s.hooks; + return hooks.execPost("save:error", this, [this], { error: error2 }, (error3) => { + callback(error3, this); + }); + } + let numAffected = 0; + const writeConcern = options != null ? options.writeConcern != null ? options.writeConcern.w : options.w : 0; + if (writeConcern !== 0) { + if (result != null) { + if (Array.isArray(result)) { + numAffected = result.length; + } else if (result.matchedCount != null) { + numAffected = result.matchedCount; + } else { + numAffected = result; + } + } + const versionBump = this.$__.version; + if (versionBump && !this.$__.inserting) { + if (numAffected <= 0) { + const key = this.$__schema.options.versionKey; + const version = this.$__getValue(key) || 0; + this.$__undoReset(); + const err = this.$__.$versionError || new VersionError(this, version, this.$__.modifiedPaths); + return callback(err, this); + } + this._applyVersionIncrement(); + } + if (result != null && numAffected <= 0) { + this.$__undoReset(); + error2 = new DocumentNotFoundError( + result.$where, + this.constructor.modelName, + numAffected, + result + ); + const hooks = this.$__schema.s.hooks; + return hooks.execPost("save:error", this, [this], { error: error2 }, (error3) => { + callback(error3, this); + }); + } + } + this.$__.saving = void 0; + this.$__.savedState = {}; + this.$emit("save", this, numAffected); + this.constructor.emit("save", this, numAffected); + callback(null, this); + }); + }; + function generateVersionError(doc, modifiedPaths, defaultPaths) { + const key = doc.$__schema.options.versionKey; + if (!key) { + return null; + } + const version = doc.$__getValue(key) || 0; + return new VersionError(doc, version, modifiedPaths.concat(defaultPaths)); + } + Model.prototype.save = async function save(options) { + if (typeof options === "function" || typeof arguments[1] === "function") { + throw new MongooseError("Model.prototype.save() no longer accepts a callback"); + } + let parallelSave; + this.$op = "save"; + if (this.$__.saving) { + parallelSave = new ParallelSaveError(this); + } else { + this.$__.saving = new ParallelSaveError(this); + } + options = new SaveOptions(options); + if (Object.hasOwn(options, "session")) { + this.$session(options.session); + } + if (this.$__.timestamps != null) { + options.timestamps = this.$__.timestamps; + } + this.$__.$versionError = generateVersionError( + this, + this.modifiedPaths(), + Object.keys(this.$__.activePaths.getStatePaths("default")) + ); + if (parallelSave) { + this.$__handleReject(parallelSave); + throw parallelSave; + } + this.$__.saveOptions = options; + await new Promise((resolve, reject) => { + this.$__save(options, (error2) => { + this.$__.saving = null; + this.$__.saveOptions = null; + this.$__.$versionError = null; + this.$op = null; + if (error2 != null) { + this.$__handleReject(error2); + return reject(error2); + } + resolve(); + }); + }); + return this; + }; + Model.prototype.$save = Model.prototype.save; + Model.prototype.$__version = function(where, delta) { + const key = this.$__schema.options.versionKey; + if (where === true) { + if (key) { + setDottedPath(delta, key, 0); + this.$__setValue(key, 0); + } + return; + } + if (key === false) { + return; + } + if (!this.$__isSelected(key)) { + return; + } + if (VERSION_WHERE === (VERSION_WHERE & this.$__.version)) { + const value = this.$__getValue(key); + if (value != null) where[key] = value; + } + if (VERSION_INC === (VERSION_INC & this.$__.version)) { + if (get2(delta.$set, key, null) != null) { + ++delta.$set[key]; + } else { + delta.$inc = delta.$inc || {}; + delta.$inc[key] = 1; + } + } + }; + Model.prototype.increment = function increment() { + this.$__.version = VERSION_ALL; + return this; + }; + Model.prototype.$__where = function _where(where) { + where || (where = {}); + if (!where._id) { + where._id = this._doc._id; + } + if (this._doc._id === void 0) { + return new MongooseError("No _id found on document!"); + } + return where; + }; + Model.prototype.deleteOne = function deleteOne(options) { + if (typeof options === "function" || typeof arguments[1] === "function") { + throw new MongooseError("Model.prototype.deleteOne() no longer accepts a callback"); + } + if (!options) { + options = {}; + } + if (Object.hasOwn(options, "session")) { + this.$session(options.session); + } + const self2 = this; + const where = this.$__where(); + if (where instanceof Error) { + throw where; + } + const query = self2.constructor.deleteOne(); + if (this.$session() != null) { + if (!("session" in query.options)) { + query.options.session = this.$session(); + } + } + query.pre(async function queryPreDeleteOne() { + await new Promise((resolve, reject) => { + self2.constructor._middleware.execPre("deleteOne", self2, [self2, options], (err) => { + query.deleteOne(where, options); + if (err) reject(err); + else resolve(); + }); + }); + if (self2.$where != null) { + this.where(self2.$where); + } + }); + query.pre(function callSubdocPreHooks(cb) { + each(self2.$getAllSubdocs(), (subdoc, cb2) => { + subdoc.constructor._middleware.execPre("deleteOne", subdoc, [subdoc, options], cb2); + }, cb); + }); + query.pre(function skipIfAlreadyDeleted(cb) { + if (self2.$__.isDeleted) { + return cb(Kareem.skipWrappedFunction()); + } + return cb(); + }); + query.post(function callSubdocPostHooks(cb) { + each(self2.$getAllSubdocs(), (subdoc, cb2) => { + subdoc.constructor._middleware.execPost("deleteOne", subdoc, [subdoc], {}, cb2); + }, cb); + }); + query.post(function queryPostDeleteOne(cb) { + self2.constructor._middleware.execPost("deleteOne", self2, [self2], {}, cb); + }); + query.transform(function setIsDeleted(result) { + if (result?.deletedCount > 0) { + self2.$isDeleted(true); + } + return result; + }); + return query; + }; + Model.prototype.$model = function $model(name) { + if (arguments.length === 0) { + return this.constructor; + } + return this[modelDbSymbol].model(name); + }; + Model.prototype.model = Model.prototype.$model; + Model.exists = function exists(filter, options) { + _checkContext(this, "exists"); + if (typeof arguments[2] === "function") { + throw new MongooseError("Model.exists() no longer accepts a callback"); + } + const query = this.findOne(filter).select({ _id: 1 }).lean().setOptions(options); + return query; + }; + Model.discriminator = function(name, schema, options) { + let model; + if (typeof name === "function") { + model = name; + name = utils.getFunctionName(model); + if (!(model.prototype instanceof Model)) { + throw new MongooseError("The provided class " + name + " must extend Model"); + } + } + options = options || {}; + const value = utils.isPOJO(options) ? options.value : options; + const clone2 = typeof options.clone === "boolean" ? options.clone : true; + const mergePlugins = typeof options.mergePlugins === "boolean" ? options.mergePlugins : true; + const overwriteModels = typeof options.overwriteModels === "boolean" ? options.overwriteModels : false; + _checkContext(this, "discriminator"); + if (utils.isObject(schema) && !schema.instanceOfSchema) { + schema = new Schema2(schema); + } + if (schema instanceof Schema2 && clone2) { + schema = schema.clone(); + } + schema = discriminator(this, name, schema, value, mergePlugins, options.mergeHooks, overwriteModels); + if (this.db.models[name] && !schema.options.overwriteModels && !overwriteModels) { + throw new OverwriteModelError(name); + } + schema.$isRootDiscriminator = true; + schema.$globalPluginsApplied = true; + model = this.db.model(model || name, schema, this.$__collection.name); + this.discriminators[name] = model; + const d4 = this.discriminators[name]; + Object.setPrototypeOf(d4.prototype, this.prototype); + Object.defineProperty(d4, "baseModelName", { + value: this.modelName, + configurable: true, + writable: false + }); + applyMethods(d4, schema); + applyStatics(d4, schema); + if (this[subclassedSymbol] != null) { + for (const submodel of this[subclassedSymbol]) { + submodel.discriminators = submodel.discriminators || {}; + submodel.discriminators[name] = model.__subclass(model.db, schema, submodel.collection.name); + } + } + return d4; + }; + function _checkContext(ctx, fnName) { + if (ctx == null || ctx === global) { + throw new MongooseError("`Model." + fnName + "()` cannot run without a model as `this`. Make sure you are calling `MyModel." + fnName + "()` where `MyModel` is a Mongoose model."); + } else if (ctx[modelSymbol] == null) { + throw new MongooseError("`Model." + fnName + "()` cannot run without a model as `this`. Make sure you are not calling `new Model." + fnName + "()`"); + } + } + for (const i4 in EventEmitter.prototype) { + Model[i4] = EventEmitter.prototype[i4]; + } + Model.init = function init() { + _checkContext(this, "init"); + if (typeof arguments[0] === "function") { + throw new MongooseError("Model.init() no longer accepts a callback"); + } + this.schema.emit("init", this); + if (this.$init != null) { + return this.$init; + } + const conn = this.db; + const _ensureIndexes2 = async () => { + const autoIndex = utils.getOption( + "autoIndex", + this.schema.options, + conn.config, + conn.base.options + ); + if (!autoIndex) { + return; + } + return await this.ensureIndexes({ _automatic: true }); + }; + const _createSearchIndexes = async () => { + const autoSearchIndex = utils.getOption( + "autoSearchIndex", + this.schema.options, + conn.config, + conn.base.options + ); + if (!autoSearchIndex) { + return; + } + return await this.createSearchIndexes(); + }; + const _createCollection = async () => { + let autoCreate = utils.getOption( + "autoCreate", + this.schema.options, + conn.config + // No base.options here because we don't want to take the base value if the connection hasn't + // set it yet + ); + if (autoCreate == null) { + await conn._waitForConnect(true); + autoCreate = utils.getOption( + "autoCreate", + this.schema.options, + conn.config, + conn.base.options + ); + } + if (!autoCreate) { + return; + } + return await this.createCollection(); + }; + this.$init = _createCollection().then(() => _ensureIndexes2()).then(() => _createSearchIndexes()); + const _catch = this.$init.catch; + const _this = this; + this.$init.catch = function() { + _this.$caught = true; + return _catch.apply(_this.$init, arguments); + }; + return this.$init; + }; + Model.createCollection = async function createCollection(options) { + _checkContext(this, "createCollection"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function") { + throw new MongooseError("Model.createCollection() no longer accepts a callback"); + } + const shouldSkip = await new Promise((resolve, reject) => { + this.hooks.execPre("createCollection", this, [options], (err) => { + if (err != null) { + if (err instanceof Kareem.skipWrappedFunction) { + return resolve(true); + } + return reject(err); + } + resolve(); + }); + }); + const collectionOptions = this && this.schema && this.schema.options && this.schema.options.collectionOptions; + if (collectionOptions != null) { + options = Object.assign({}, collectionOptions, options); + } + const schemaCollation = this && this.schema && this.schema.options && this.schema.options.collation; + if (schemaCollation != null) { + options = Object.assign({ collation: schemaCollation }, options); + } + const capped = this && this.schema && this.schema.options && this.schema.options.capped; + if (capped != null) { + if (typeof capped === "number") { + options = Object.assign({ capped: true, size: capped }, options); + } else if (typeof capped === "object") { + options = Object.assign({ capped: true }, capped, options); + } + } + const timeseries = this && this.schema && this.schema.options && this.schema.options.timeseries; + if (timeseries != null) { + options = Object.assign({ timeseries }, options); + if (options.expireAfterSeconds != null) { + } else if (options.expires != null) { + utils.expires(options); + } else if (this.schema.options.expireAfterSeconds != null) { + options.expireAfterSeconds = this.schema.options.expireAfterSeconds; + } else if (this.schema.options.expires != null) { + options.expires = this.schema.options.expires; + utils.expires(options); + } + } + const clusteredIndex = this && this.schema && this.schema.options && this.schema.options.clusteredIndex; + if (clusteredIndex != null) { + options = Object.assign({ clusteredIndex: { ...clusteredIndex, unique: true } }, options); + } + try { + if (!shouldSkip) { + await this.db.createCollection(this.$__collection.collectionName, options); + } + } catch (err) { + if (err != null && (err.name !== "MongoServerError" || err.code !== 48)) { + await new Promise((resolve, reject) => { + const _opts = { error: err }; + this.hooks.execPost("createCollection", this, [null], _opts, (err2) => { + if (err2 != null) { + return reject(err2); + } + resolve(); + }); + }); + } + } + await new Promise((resolve, reject) => { + this.hooks.execPost("createCollection", this, [this.$__collection], (err) => { + if (err != null) { + return reject(err); + } + resolve(); + }); + }); + return this.$__collection; + }; + Model.syncIndexes = async function syncIndexes(options) { + _checkContext(this, "syncIndexes"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function") { + throw new MongooseError("Model.syncIndexes() no longer accepts a callback"); + } + const autoCreate = options?.autoCreate ?? this.schema.options?.autoCreate ?? this.db.config.autoCreate ?? this.db.base?.options?.autoCreate ?? true; + if (autoCreate) { + try { + await this.createCollection(); + } catch (err) { + if (err != null && (err.name !== "MongoServerError" || err.code !== 48)) { + throw err; + } + } + } + const diffIndexesResult = await this.diffIndexes({ indexOptionsToCreate: true }); + const dropped = await this.cleanIndexes({ ...options, toDrop: diffIndexesResult.toDrop }); + await this.createIndexes({ ...options, toCreate: diffIndexesResult.toCreate }); + return dropped; + }; + Model.createSearchIndex = async function createSearchIndex(description) { + _checkContext(this, "createSearchIndex"); + return await this.$__collection.createSearchIndex(description); + }; + Model.updateSearchIndex = async function updateSearchIndex(name, definition) { + _checkContext(this, "updateSearchIndex"); + return await this.$__collection.updateSearchIndex(name, definition); + }; + Model.dropSearchIndex = async function dropSearchIndex(name) { + _checkContext(this, "dropSearchIndex"); + return await this.$__collection.dropSearchIndex(name); + }; + Model.listSearchIndexes = async function listSearchIndexes(options) { + _checkContext(this, "listSearchIndexes"); + const cursor2 = await this.$__collection.listSearchIndexes(options); + return await cursor2.toArray(); + }; + Model.diffIndexes = async function diffIndexes(options) { + if (typeof arguments[0] === "function" || typeof arguments[1] === "function") { + throw new MongooseError("Model.syncIndexes() no longer accepts a callback"); + } + const model = this; + let dbIndexes = await model.listIndexes().catch((err) => { + if (err.codeName == "NamespaceNotFound") { + return void 0; + } + throw err; + }); + if (dbIndexes === void 0) { + dbIndexes = []; + } + dbIndexes = getRelatedDBIndexes(model, dbIndexes); + const schema = model.schema; + const schemaIndexes = getRelatedSchemaIndexes(model, schema.indexes()); + const toDrop = getIndexesToDrop(schema, schemaIndexes, dbIndexes); + const toCreate = getIndexesToCreate(schema, schemaIndexes, dbIndexes, toDrop, options); + return { toDrop, toCreate }; + }; + function getIndexesToCreate(schema, schemaIndexes, dbIndexes, toDrop, options) { + const toCreate = []; + const indexOptionsToCreate = options?.indexOptionsToCreate ?? false; + for (const [schemaIndexKeysObject, schemaIndexOptions] of schemaIndexes) { + let found = false; + const options2 = decorateDiscriminatorIndexOptions(schema, clone(schemaIndexOptions)); + for (const index of dbIndexes) { + if (isDefaultIdIndex(index)) { + continue; + } + if (isIndexEqual(schemaIndexKeysObject, options2, index) && !toDrop.includes(index.name)) { + found = true; + break; + } + } + if (!found) { + if (indexOptionsToCreate) { + toCreate.push([schemaIndexKeysObject, schemaIndexOptions]); + } else { + toCreate.push(schemaIndexKeysObject); + } + } + } + return toCreate; + } + function getIndexesToDrop(schema, schemaIndexes, dbIndexes) { + const toDrop = []; + for (const dbIndex of dbIndexes) { + let found = false; + if (isDefaultIdIndex(dbIndex)) { + continue; + } + if (isTimeseriesIndex(dbIndex, schema.options)) { + continue; + } + for (const [schemaIndexKeysObject, schemaIndexOptions] of schemaIndexes) { + const options = decorateDiscriminatorIndexOptions(schema, clone(schemaIndexOptions)); + applySchemaCollation(schemaIndexKeysObject, options, schema.options); + if (isIndexEqual(schemaIndexKeysObject, options, dbIndex)) { + found = true; + break; + } + } + if (found) { + continue; + } + toDrop.push(dbIndex.name); + } + return toDrop; + } + Model.cleanIndexes = async function cleanIndexes(options) { + _checkContext(this, "cleanIndexes"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function") { + throw new MongooseError("Model.cleanIndexes() no longer accepts a callback"); + } + const model = this; + if (Array.isArray(options && options.toDrop)) { + const res2 = await _dropIndexes(options.toDrop, model, options); + return res2; + } + const res = await model.diffIndexes(); + return await _dropIndexes(res.toDrop, model, options); + }; + async function _dropIndexes(toDrop, model, options) { + if (toDrop.length === 0) { + return []; + } + const collection = model.$__collection; + if (options && options.hideIndexes) { + await Promise.all(toDrop.map((indexName) => { + return model.db.db.command({ + collMod: collection.collectionName, + index: { name: indexName, hidden: true } + }); + })); + } else { + await Promise.all(toDrop.map((indexName) => collection.dropIndex(indexName))); + } + return toDrop; + } + Model.listIndexes = async function listIndexes() { + _checkContext(this, "listIndexes"); + if (typeof arguments[0] === "function") { + throw new MongooseError("Model.listIndexes() no longer accepts a callback"); + } + if (this.$__collection.buffer) { + await new Promise((resolve) => { + this.$__collection.addQueue(resolve); + }); + } + return this.$__collection.listIndexes().toArray(); + }; + Model.ensureIndexes = async function ensureIndexes(options) { + _checkContext(this, "ensureIndexes"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function") { + throw new MongooseError("Model.ensureIndexes() no longer accepts a callback"); + } + await new Promise((resolve, reject) => { + _ensureIndexes(this, options, (err) => { + if (err != null) { + return reject(err); + } + resolve(); + }); + }); + }; + Model.createIndexes = async function createIndexes(options) { + _checkContext(this, "createIndexes"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function") { + throw new MongooseError("Model.createIndexes() no longer accepts a callback"); + } + return this.ensureIndexes(options); + }; + function _ensureIndexes(model, options, callback) { + const indexes = Array.isArray(options?.toCreate) ? options.toCreate : model.schema.indexes(); + let indexError; + options = options || {}; + const done = function(err) { + if (err && !model.$caught) { + model.emit("error", err); + } + model.emit("index", err || indexError); + callback && callback(err || indexError); + }; + for (const index of indexes) { + if (isDefaultIdIndex(index)) { + utils.warn('mongoose: Cannot specify a custom index on `_id` for model name "' + model.modelName + '", MongoDB does not allow overwriting the default `_id` index. See https://bit.ly/mongodb-id-index'); + } + } + if (!indexes.length) { + immediate(function() { + done(); + }); + return; + } + const indexSingleDone = function(err, fields, options2, name) { + model.emit("index-single-done", err, fields, options2, name); + }; + const indexSingleStart = function(fields, options2) { + model.emit("index-single-start", fields, options2); + }; + const baseSchema = model.schema._baseSchema; + const baseSchemaIndexes = baseSchema ? baseSchema.indexes() : []; + immediate(function() { + if (options._automatic && !model.collection.collection) { + model.collection.addQueue(create, []); + } else { + create(); + } + }); + function create() { + if (options._automatic) { + if (model.schema.options.autoIndex === false || model.schema.options.autoIndex == null && model.db.config.autoIndex === false) { + return done(); + } + } + const index = indexes.shift(); + if (!index) { + return done(); + } + if (options._automatic && index[1]._autoIndex === false) { + return create(); + } + if (baseSchemaIndexes.find((i4) => utils.deepEqual(i4, index))) { + return create(); + } + const indexFields = clone(index[0]); + const indexOptions = clone(index[1]); + delete indexOptions._autoIndex; + decorateDiscriminatorIndexOptions(model.schema, indexOptions); + applyWriteConcern(model.schema, indexOptions); + applySchemaCollation(indexFields, indexOptions, model.schema.options); + indexSingleStart(indexFields, options); + if ("background" in options) { + indexOptions.background = options.background; + } + let promise = null; + try { + promise = model.collection.createIndex(indexFields, indexOptions); + } catch (err) { + if (!indexError) { + indexError = err; + } + if (!model.$caught) { + model.emit("error", err); + } + indexSingleDone(err, indexFields, indexOptions); + create(); + return; + } + promise.then( + (name) => { + indexSingleDone(null, indexFields, indexOptions, name); + create(); + }, + (err) => { + if (!indexError) { + indexError = err; + } + if (!model.$caught) { + model.emit("error", err); + } + indexSingleDone(err, indexFields, indexOptions); + create(); + } + ); + } + } + Model.createSearchIndexes = async function createSearchIndexes() { + _checkContext(this, "createSearchIndexes"); + const results = []; + for (const searchIndex of this.schema._searchIndexes) { + results.push(await this.createSearchIndex(searchIndex)); + } + return results; + }; + Model.schema; + Model.db; + Model.collection; + Model.$__collection; + Model.base; + Model.discriminators; + Model.translateAliases = function translateAliases(fields, errorOnDuplicates) { + _checkContext(this, "translateAliases"); + const translate = (key, value) => { + let alias; + const translated = []; + const fieldKeys = key.split("."); + let currentSchema = this.schema; + for (const i4 in fieldKeys) { + const name = fieldKeys[i4]; + if (currentSchema && currentSchema.aliases[name]) { + alias = currentSchema.aliases[name]; + if (errorOnDuplicates && alias in fields) { + throw new MongooseError(`Provided object has both field "${name}" and its alias "${alias}"`); + } + translated.push(alias); + } else { + alias = name; + translated.push(name); + } + if (currentSchema && currentSchema.paths[alias]) { + currentSchema = currentSchema.paths[alias].schema; + } else + currentSchema = null; + } + const translatedKey = translated.join("."); + if (fields instanceof Map) + fields.set(translatedKey, value); + else + fields[translatedKey] = value; + if (translatedKey !== key) { + if (fields instanceof Map) { + fields.delete(key); + } else { + delete fields[key]; + } + } + return fields; + }; + if (typeof fields === "object") { + if (fields instanceof Map) { + for (const field of new Map(fields)) { + fields = translate(field[0], field[1]); + } + } else { + for (const key of Object.keys(fields)) { + fields = translate(key, fields[key]); + if (key[0] === "$") { + if (Array.isArray(fields[key])) { + for (const i4 in fields[key]) { + fields[key][i4] = this.translateAliases(fields[key][i4]); + } + } else { + this.translateAliases(fields[key]); + } + } + } + } + return fields; + } else { + return fields; + } + }; + Model.deleteOne = function deleteOne(conditions, options) { + _checkContext(this, "deleteOne"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Model.prototype.deleteOne() no longer accepts a callback"); + } + const mq = new this.Query({}, {}, this, this.$__collection); + mq.setOptions(options); + return mq.deleteOne(conditions); + }; + Model.deleteMany = function deleteMany(conditions, options) { + _checkContext(this, "deleteMany"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Model.deleteMany() no longer accepts a callback"); + } + const mq = new this.Query({}, {}, this, this.$__collection); + mq.setOptions(options); + return mq.deleteMany(conditions); + }; + Model.find = function find(conditions, projection, options) { + _checkContext(this, "find"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function" || typeof arguments[2] === "function" || typeof arguments[3] === "function") { + throw new MongooseError("Model.find() no longer accepts a callback"); + } + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(projection); + mq.setOptions(options); + return mq.find(conditions); + }; + Model.findById = function findById(id, projection, options) { + _checkContext(this, "findById"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Model.findById() no longer accepts a callback"); + } + return this.findOne({ _id: id }, projection, options); + }; + Model.findOne = function findOne(conditions, projection, options) { + _checkContext(this, "findOne"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Model.findOne() no longer accepts a callback"); + } + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(projection); + mq.setOptions(options); + return mq.findOne(conditions); + }; + Model.estimatedDocumentCount = function estimatedDocumentCount(options) { + _checkContext(this, "estimatedDocumentCount"); + const mq = new this.Query({}, {}, this, this.$__collection); + return mq.estimatedDocumentCount(options); + }; + Model.countDocuments = function countDocuments(conditions, options) { + _checkContext(this, "countDocuments"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Model.countDocuments() no longer accepts a callback"); + } + const mq = new this.Query({}, {}, this, this.$__collection); + if (options != null) { + mq.setOptions(options); + } + return mq.countDocuments(conditions); + }; + Model.distinct = function distinct(field, conditions, options) { + _checkContext(this, "distinct"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Model.distinct() no longer accepts a callback"); + } + const mq = new this.Query({}, {}, this, this.$__collection); + if (options != null) { + mq.setOptions(options); + } + return mq.distinct(field, conditions); + }; + Model.where = function where(path, val) { + _checkContext(this, "where"); + void val; + const mq = new this.Query({}, {}, this, this.$__collection).find({}); + return mq.where.apply(mq, arguments); + }; + Model.$where = function $where() { + _checkContext(this, "$where"); + const mq = new this.Query({}, {}, this, this.$__collection).find({}); + return mq.$where.apply(mq, arguments); + }; + Model.findOneAndUpdate = function(conditions, update, options) { + _checkContext(this, "findOneAndUpdate"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function" || typeof arguments[2] === "function" || typeof arguments[3] === "function") { + throw new MongooseError("Model.findOneAndUpdate() no longer accepts a callback"); + } + let fields; + if (options) { + fields = options.fields || options.projection; + } + update = clone(update, { + depopulate: true, + _isNested: true + }); + decorateUpdateWithVersionKey(update, options, this.schema.options.versionKey); + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(fields); + return mq.findOneAndUpdate(conditions, update, options); + }; + Model.findByIdAndUpdate = function(id, update, options) { + _checkContext(this, "findByIdAndUpdate"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function" || typeof arguments[2] === "function" || typeof arguments[3] === "function") { + throw new MongooseError("Model.findByIdAndUpdate() no longer accepts a callback"); + } + if (id instanceof Document) { + id = id._doc._id; + } + return this.findOneAndUpdate.call(this, { _id: id }, update, options); + }; + Model.findOneAndDelete = function(conditions, options) { + _checkContext(this, "findOneAndDelete"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Model.findOneAndDelete() no longer accepts a callback"); + } + let fields; + if (options) { + fields = options.select; + options.select = void 0; + } + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(fields); + return mq.findOneAndDelete(conditions, options); + }; + Model.findByIdAndDelete = function(id, options) { + _checkContext(this, "findByIdAndDelete"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Model.findByIdAndDelete() no longer accepts a callback"); + } + return this.findOneAndDelete({ _id: id }, options); + }; + Model.findOneAndReplace = function(filter, replacement, options) { + _checkContext(this, "findOneAndReplace"); + if (typeof arguments[0] === "function" || typeof arguments[1] === "function" || typeof arguments[2] === "function" || typeof arguments[3] === "function") { + throw new MongooseError("Model.findOneAndReplace() no longer accepts a callback"); + } + let fields; + if (options) { + fields = options.select; + options.select = void 0; + } + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(fields); + return mq.findOneAndReplace(filter, replacement, options); + }; + Model.create = async function create(doc, options) { + if (typeof options === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Model.create() no longer accepts a callback"); + } + _checkContext(this, "create"); + let args2; + const discriminatorKey = this.schema.options.discriminatorKey; + if (Array.isArray(doc)) { + args2 = doc; + options = options != null && typeof options === "object" ? options : {}; + } else { + const last = arguments[arguments.length - 1]; + options = {}; + const hasCallback = typeof last === "function" || typeof options === "function" || typeof arguments[2] === "function"; + if (hasCallback) { + throw new MongooseError("Model.create() no longer accepts a callback"); + } else { + args2 = [...arguments]; + if (args2.length > 1 && !last) { + args2.pop(); + } + } + if (args2.length === 2 && args2[0] != null && args2[1] != null && args2[0].session == null && last && getConstructorName(last.session) === "ClientSession" && !this.schema.path("session")) { + utils.warn("WARNING: to pass a `session` to `Model.create()` in Mongoose, you **must** pass an array as the first argument. See: https://mongoosejs.com/docs/api/model.html#Model.create()"); + } + } + if (args2.length === 0) { + return Array.isArray(doc) ? [] : null; + } + let res = []; + const immediateError = typeof options.aggregateErrors === "boolean" ? !options.aggregateErrors : true; + delete options.aggregateErrors; + if (options.session && !options.ordered && args2.length > 1) { + throw new MongooseError("Cannot call `create()` with a session and multiple documents unless `ordered: true` is set"); + } + if (options.ordered) { + for (let i4 = 0; i4 < args2.length; i4++) { + try { + const doc2 = args2[i4]; + const Model2 = this.discriminators && doc2[discriminatorKey] != null ? this.discriminators[doc2[discriminatorKey]] || getDiscriminatorByValue(this.discriminators, doc2[discriminatorKey]) : this; + if (Model2 == null) { + throw new MongooseError(`Discriminator "${doc2[discriminatorKey]}" not found for model "${this.modelName}"`); + } + let toSave = doc2; + if (!(toSave instanceof Model2)) { + toSave = new Model2(toSave); + } + await toSave.$save(options); + res.push(toSave); + } catch (err) { + if (!immediateError) { + res.push(err); + } else { + throw err; + } + } + } + return res; + } else if (!immediateError) { + res = await Promise.allSettled(args2.map(async (doc2) => { + const Model2 = this.discriminators && doc2[discriminatorKey] != null ? this.discriminators[doc2[discriminatorKey]] || getDiscriminatorByValue(this.discriminators, doc2[discriminatorKey]) : this; + if (Model2 == null) { + throw new MongooseError(`Discriminator "${doc2[discriminatorKey]}" not found for model "${this.modelName}"`); + } + let toSave = doc2; + if (!(toSave instanceof Model2)) { + toSave = new Model2(toSave); + } + await toSave.$save(options); + return toSave; + })); + res = res.map((result) => result.status === "fulfilled" ? result.value : result.reason); + } else { + let firstError = null; + res = await Promise.all(args2.map(async (doc2) => { + const Model2 = this.discriminators && doc2[discriminatorKey] != null ? this.discriminators[doc2[discriminatorKey]] || getDiscriminatorByValue(this.discriminators, doc2[discriminatorKey]) : this; + if (Model2 == null) { + throw new MongooseError(`Discriminator "${doc2[discriminatorKey]}" not found for model "${this.modelName}"`); + } + try { + let toSave = doc2; + if (!(toSave instanceof Model2)) { + toSave = new Model2(toSave); + } + await toSave.$save(options); + return toSave; + } catch (err) { + if (!firstError) { + firstError = err; + } + } + })); + if (firstError) { + throw firstError; + } + } + if (!Array.isArray(doc) && args2.length === 1) { + return res[0]; + } + return res; + }; + Model.insertOne = async function insertOne(doc, options) { + _checkContext(this, "insertOne"); + const discriminatorKey = this.schema.options.discriminatorKey; + const Model2 = this.discriminators && doc[discriminatorKey] != null ? this.discriminators[doc[discriminatorKey]] || getDiscriminatorByValue(this.discriminators, doc[discriminatorKey]) : this; + if (Model2 == null) { + throw new MongooseError( + `Discriminator "${doc[discriminatorKey]}" not found for model "${this.modelName}"` + ); + } + if (!(doc instanceof Model2)) { + doc = new Model2(doc); + } + return await doc.$save(options); + }; + Model.watch = function(pipeline, options) { + _checkContext(this, "watch"); + const changeStreamThunk = (cb) => { + pipeline = pipeline || []; + prepareDiscriminatorPipeline(pipeline, this.schema, "fullDocument"); + if (this.$__collection.buffer) { + this.$__collection.addQueue(() => { + if (this.closed) { + return; + } + const driverChangeStream = this.$__collection.watch(pipeline, options); + cb(null, driverChangeStream); + }); + } else { + const driverChangeStream = this.$__collection.watch(pipeline, options); + cb(null, driverChangeStream); + } + }; + options = options || {}; + options.model = this; + return new ChangeStream(changeStreamThunk, pipeline, options); + }; + Model.startSession = function() { + _checkContext(this, "startSession"); + return this.db.startSession.apply(this.db, arguments); + }; + Model.insertMany = async function insertMany(arr, options) { + _checkContext(this, "insertMany"); + if (typeof options === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Model.insertMany() no longer accepts a callback"); + } + return new Promise((resolve, reject) => { + this.$__insertMany(arr, options, (err, res) => { + if (err != null) { + return reject(err); + } + resolve(res); + }); + }); + }; + Model.$__insertMany = function(arr, options, callback) { + const _this = this; + if (typeof options === "function") { + callback = options; + options = null; + } + callback = callback || utils.noop; + options = options || {}; + const limit = options.limit || 1e3; + const rawResult = !!options.rawResult; + const ordered = typeof options.ordered === "boolean" ? options.ordered : true; + const throwOnValidationError = typeof options.throwOnValidationError === "boolean" ? options.throwOnValidationError : false; + const lean = !!options.lean; + const asyncLocalStorage = this.db.base.transactionAsyncLocalStorage?.getStore(); + if ((!options || !Object.hasOwn(options, "session")) && asyncLocalStorage?.session != null) { + options = { ...options, session: asyncLocalStorage.session }; + } + if (!Array.isArray(arr)) { + arr = [arr]; + } + const validationErrors = []; + const validationErrorsToOriginalOrder = /* @__PURE__ */ new Map(); + const results = ordered ? null : new Array(arr.length); + const toExecute = arr.map((doc, index) => (callback2) => { + if (lean) { + return immediate(() => callback2(null, doc)); + } + let createdNewDoc = false; + if (!(doc instanceof _this)) { + if (doc != null && typeof doc !== "object") { + return callback2(new ObjectParameterError(doc, "arr." + index, "insertMany")); + } + try { + doc = new _this(doc); + createdNewDoc = true; + } catch (err) { + return callback2(err); + } + } + if (options.session != null) { + doc.$session(options.session); + } + if (lean) { + return immediate(() => callback2(null, doc)); + } + doc.$validate(createdNewDoc ? { _skipParallelValidateCheck: true } : null).then( + () => { + callback2(null, doc); + }, + (error2) => { + if (ordered === false) { + error2.index = index; + validationErrors.push(error2); + validationErrorsToOriginalOrder.set(error2, index); + results[index] = error2; + return callback2(null, null); + } + callback2(error2); + } + ); + }); + parallelLimit(toExecute, limit, function(error2, docs) { + if (error2) { + callback(error2, null); + return; + } + const originalDocIndex = /* @__PURE__ */ new Map(); + const validDocIndexToOriginalIndex = /* @__PURE__ */ new Map(); + for (let i4 = 0; i4 < docs.length; ++i4) { + originalDocIndex.set(docs[i4], i4); + } + const docAttributes = docs.filter(function(doc) { + return doc != null; + }); + for (let i4 = 0; i4 < docAttributes.length; ++i4) { + validDocIndexToOriginalIndex.set(i4, originalDocIndex.get(docAttributes[i4])); + } + if (validationErrors.length > 0) { + validationErrors.sort((err1, err2) => { + return validationErrorsToOriginalOrder.get(err1) - validationErrorsToOriginalOrder.get(err2); + }); + } + if (docAttributes.length === 0) { + if (throwOnValidationError) { + return callback(new MongooseBulkWriteError( + validationErrors, + results, + null, + "insertMany" + )); + } + if (rawResult) { + const res = { + acknowledged: true, + insertedCount: 0, + insertedIds: {} + }; + decorateBulkWriteResult(res, validationErrors, validationErrors); + return callback(null, res); + } + callback(null, []); + return; + } + const docObjects = lean ? docAttributes : docAttributes.map(function(doc) { + if (doc.$__schema.options.versionKey) { + doc[doc.$__schema.options.versionKey] = 0; + } + const shouldSetTimestamps = (!options || options.timestamps !== false) && doc.initializeTimestamps && (!doc.$__ || doc.$__.timestamps !== false); + if (shouldSetTimestamps) { + doc.initializeTimestamps(); + } + if (doc.$__hasOnlyPrimitiveValues()) { + return doc.$__toObjectShallow(); + } + return doc.toObject(internalToObjectOptions); + }); + _this.$__collection.insertMany(docObjects, options).then( + (res) => { + if (!lean) { + for (const attribute of docAttributes) { + attribute.$__reset(); + _setIsNew(attribute, false); + } + } + if (ordered === false && throwOnValidationError && validationErrors.length > 0) { + for (let i4 = 0; i4 < results.length; ++i4) { + if (results[i4] === void 0) { + results[i4] = docs[i4]; + } + } + return callback(new MongooseBulkWriteError( + validationErrors, + results, + res, + "insertMany" + )); + } + if (rawResult) { + if (ordered === false) { + for (let i4 = 0; i4 < results.length; ++i4) { + if (results[i4] === void 0) { + results[i4] = docs[i4]; + } + } + decorateBulkWriteResult(res, validationErrors, results); + } + return callback(null, res); + } + if (options.populate != null) { + return _this.populate(docAttributes, options.populate).then( + (docs2) => { + callback(null, docs2); + }, + (err) => { + if (err != null) { + err.insertedDocs = docAttributes; + } + throw err; + } + ); + } + callback(null, docAttributes); + }, + (error3) => { + if (error3.writeErrors == null && (error3.result && error3.result.result && error3.result.result.writeErrors) != null) { + error3.writeErrors = error3.result.result.writeErrors; + } + const hasWriteErrors = error3 && error3.writeErrors; + const erroredIndexes = new Set((error3 && error3.writeErrors || []).map((err) => err.index)); + if (error3.writeErrors != null) { + for (let i4 = 0; i4 < error3.writeErrors.length; ++i4) { + const originalIndex = validDocIndexToOriginalIndex.get(error3.writeErrors[i4].index); + error3.writeErrors[i4] = { ...error3.writeErrors[i4], index: originalIndex }; + if (!ordered) { + results[originalIndex] = error3.writeErrors[i4]; + } + } + } + if (!ordered) { + for (let i4 = 0; i4 < results.length; ++i4) { + if (results[i4] === void 0) { + results[i4] = docs[i4]; + } + } + error3.results = results; + } + let firstErroredIndex = -1; + error3.insertedDocs = docAttributes.filter((doc, i4) => { + const isErrored = !hasWriteErrors || erroredIndexes.has(i4); + if (ordered) { + if (firstErroredIndex > -1) { + return i4 < firstErroredIndex; + } + if (isErrored) { + firstErroredIndex = i4; + } + } + return !isErrored; + }).map(function setIsNewForInsertedDoc(doc) { + if (lean) { + return doc; + } + doc.$__reset(); + _setIsNew(doc, false); + return doc; + }); + if (rawResult && ordered === false) { + decorateBulkWriteResult(error3, validationErrors, results); + } + callback(error3, null); + } + ); + }); + }; + function _setIsNew(doc, val) { + doc.$isNew = val; + doc.$emit("isNew", val); + doc.constructor.emit("isNew", val); + const subdocs = doc.$getAllSubdocs({ useCache: true }); + for (const subdoc of subdocs) { + subdoc.$isNew = val; + subdoc.$emit("isNew", val); + } + } + Model.bulkWrite = async function bulkWrite(ops, options) { + _checkContext(this, "bulkWrite"); + if (typeof options === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Model.bulkWrite() no longer accepts a callback"); + } + options = options || {}; + const shouldSkip = await new Promise((resolve, reject) => { + this.hooks.execPre("bulkWrite", this, [ops, options], (err) => { + if (err != null) { + if (err instanceof Kareem.skipWrappedFunction) { + return resolve(err); + } + return reject(err); + } + resolve(); + }); + }); + if (shouldSkip) { + return shouldSkip.args[0]; + } + const ordered = options.ordered == null ? true : options.ordered; + if (ops.length === 0) { + const BulkWriteResult = this.base.driver.get().BulkWriteResult; + const bulkWriteResult = new BulkWriteResult(getDefaultBulkwriteResult(), false); + bulkWriteResult.n = 0; + decorateBulkWriteResult(bulkWriteResult, [], []); + return bulkWriteResult; + } + const validations = options?._skipCastBulkWrite ? [] : ops.map((op2) => castBulkWrite(this, op2, options)); + const asyncLocalStorage = this.db.base.transactionAsyncLocalStorage?.getStore(); + if ((!options || !Object.hasOwn(options, "session")) && asyncLocalStorage?.session != null) { + options = { ...options, session: asyncLocalStorage.session }; + } + let res = null; + if (ordered) { + await new Promise((resolve, reject) => { + each(validations, (fn2, cb) => fn2(cb), (error2) => { + if (error2) { + return reject(error2); + } + resolve(); + }); + }); + try { + res = await this.$__collection.bulkWrite(ops, options); + } catch (error2) { + await new Promise((resolve, reject) => { + const _opts = { error: error2 }; + this.hooks.execPost("bulkWrite", this, [null], _opts, (err) => { + if (err != null) { + return reject(err); + } + resolve(); + }); + }); + } + } else { + let validOpIndexes = []; + let validationErrors = []; + const results = []; + if (validations.length > 0) { + validOpIndexes = await Promise.all(ops.map((op2, i4) => { + if (i4 >= validations.length) { + return i4; + } + return new Promise((resolve) => { + validations[i4]((err) => { + if (err == null) { + resolve(i4); + } else { + validationErrors.push({ index: i4, error: err }); + results[i4] = err; + } + resolve(); + }); + }); + })); + validOpIndexes = validOpIndexes.filter((index) => index != null); + } else { + validOpIndexes = ops.map((op2, i4) => i4); + } + validationErrors = validationErrors.sort((v1, v22) => v1.index - v22.index).map((v4) => v4.error); + const validOps = validOpIndexes.sort().map((index) => ops[index]); + if (validOps.length === 0) { + if (options.throwOnValidationError && validationErrors.length) { + throw new MongooseBulkWriteError( + validationErrors, + results, + res, + "bulkWrite" + ); + } + const BulkWriteResult = this.base.driver.get().BulkWriteResult; + const bulkWriteResult = new BulkWriteResult(getDefaultBulkwriteResult(), false); + bulkWriteResult.result = getDefaultBulkwriteResult(); + decorateBulkWriteResult(bulkWriteResult, validationErrors, results); + return bulkWriteResult; + } + let error2; + [res, error2] = await this.$__collection.bulkWrite(validOps, options).then((res2) => [res2, null]).catch((error3) => [null, error3]); + const writeErrorsByIndex = {}; + if (error2?.writeErrors) { + for (const writeError of error2.writeErrors) { + writeErrorsByIndex[writeError.err.index] = writeError; + } + } + for (let i4 = 0; i4 < validOpIndexes.length; ++i4) { + results[validOpIndexes[i4]] = writeErrorsByIndex[i4] ?? null; + } + if (error2) { + if (validationErrors.length > 0) { + decorateBulkWriteResult(error2, validationErrors, results); + } + await new Promise((resolve, reject) => { + const _opts = { error: error2 }; + this.hooks.execPost("bulkWrite", this, [null], _opts, (err) => { + if (err != null) { + return reject(err); + } + resolve(); + }); + }); + } + if (validationErrors.length > 0) { + if (options.throwOnValidationError) { + throw new MongooseBulkWriteError( + validationErrors, + results, + res, + "bulkWrite" + ); + } else { + decorateBulkWriteResult(res, validationErrors, results); + } + } + } + await new Promise((resolve, reject) => { + this.hooks.execPost("bulkWrite", this, [res], (err) => { + if (err != null) { + return reject(err); + } + resolve(); + }); + }); + return res; + }; + Model.bulkSave = async function bulkSave(documents, options) { + options = options || {}; + if (options.timestamps != null) { + for (const document2 of documents) { + document2.$__.saveOptions = document2.$__.saveOptions || {}; + document2.$__.saveOptions.timestamps = options.timestamps; + } + } else { + for (const document2 of documents) { + if (document2.$__.timestamps != null) { + document2.$__.saveOptions = document2.$__.saveOptions || {}; + document2.$__.saveOptions.timestamps = document2.$__.timestamps; + } + } + } + await Promise.all(documents.map((doc) => buildPreSavePromise(doc, options))); + const writeOperations = this.buildBulkWriteOperations(documents, options); + const opts = { skipValidation: true, _skipCastBulkWrite: true, ...options }; + const { bulkWriteResult, bulkWriteError } = await this.bulkWrite(writeOperations, opts).then( + (res) => ({ bulkWriteResult: res, bulkWriteError: null }), + (err) => ({ bulkWriteResult: null, bulkWriteError: err }) + ); + if (bulkWriteError != null && bulkWriteError.name !== "MongoBulkWriteError") { + throw bulkWriteError; + } + const matchedCount = bulkWriteResult?.matchedCount ?? 0; + const insertedCount = bulkWriteResult?.insertedCount ?? 0; + if (writeOperations.length > 0 && matchedCount + insertedCount < writeOperations.length && !bulkWriteError) { + throw new MongooseBulkSaveIncompleteError( + this.modelName, + documents, + bulkWriteResult + ); + } + const successfulDocuments = []; + for (let i4 = 0; i4 < documents.length; i4++) { + const document2 = documents[i4]; + const documentError = bulkWriteError && bulkWriteError.writeErrors.find((writeError) => { + const writeErrorDocumentId = writeError.err.op._id || writeError.err.op.q._id; + return writeErrorDocumentId.toString() === document2._doc._id.toString(); + }); + if (documentError == null) { + successfulDocuments.push(document2); + } + } + await Promise.all(successfulDocuments.map((document2) => handleSuccessfulWrite(document2))); + if (bulkWriteError != null) { + throw bulkWriteError; + } + return bulkWriteResult; + }; + function buildPreSavePromise(document2, options) { + return new Promise((resolve, reject) => { + document2.schema.s.hooks.execPre("save", document2, [options], (err) => { + if (err) { + reject(err); + return; + } + resolve(); + }); + }); + } + function handleSuccessfulWrite(document2) { + return new Promise((resolve, reject) => { + if (document2.$isNew) { + _setIsNew(document2, false); + } + document2.$__reset(); + document2._applyVersionIncrement(); + document2.schema.s.hooks.execPost("save", document2, [document2], {}, (err) => { + if (err) { + reject(err); + return; + } + resolve(); + }); + }); + } + Model.applyDefaults = function applyDefaults(doc) { + if (doc == null) { + return doc; + } + if (doc.$__ != null) { + applyDefaultsHelper(doc, doc.$__.fields, doc.$__.exclude); + for (const subdoc of doc.$getAllSubdocs()) { + applyDefaults(subdoc, subdoc.$__.fields, subdoc.$__.exclude); + } + return doc; + } + applyDefaultsToPOJO(doc, this.schema); + return doc; + }; + Model.applyVirtuals = function applyVirtuals(obj, virtualsToApply) { + if (obj == null) { + return obj; + } + if (obj.$__ != null) { + return obj; + } + applyVirtualsHelper(this.schema, obj, virtualsToApply); + return obj; + }; + Model.applyTimestamps = function applyTimestamps(obj, options) { + if (obj == null) { + return obj; + } + if (obj.$__ != null) { + return obj; + } + applyTimestampsHelper(this.schema, obj, options); + return obj; + }; + Model.castObject = function castObject(obj, options) { + options = options || {}; + const ret = {}; + let schema = this.schema; + const discriminatorKey = schema.options.discriminatorKey; + if (schema.discriminators != null && obj != null && obj[discriminatorKey] != null) { + schema = getSchemaDiscriminatorByValue(schema, obj[discriminatorKey]) || schema; + } + const paths = Object.keys(schema.paths); + for (const path of paths) { + const schemaType = schema.path(path); + if (!schemaType || !schemaType.$isMongooseArray) { + continue; + } + const val = get2(obj, path); + pushNestedArrayPaths(paths, val, path); + } + let error2 = null; + for (const path of paths) { + const schemaType = schema.path(path); + if (schemaType == null) { + continue; + } + let val = get2(obj, path, void 0); + if (val == null) { + continue; + } + const pieces = path.indexOf(".") === -1 ? [path] : path.split("."); + let cur = ret; + for (let i4 = 0; i4 < pieces.length - 1; ++i4) { + if (cur[pieces[i4]] == null) { + cur[pieces[i4]] = isNaN(pieces[i4 + 1]) ? {} : []; + } + cur = cur[pieces[i4]]; + } + if (schemaType.$isMongooseDocumentArray) { + const castNonArraysOption = schemaType.options?.castNonArrays ?? schemaType.constructor.options.castNonArrays; + if (!Array.isArray(val)) { + if (!castNonArraysOption) { + if (!options.ignoreCastErrors) { + error2 = error2 || new ValidationError(); + error2.addError(path, new ObjectExpectedError(path, val)); + } + } else { + cur[pieces[pieces.length - 1]] = [ + Model.castObject.call(schemaType.caster, val) + ]; + } + continue; + } + } + if (schemaType.$isSingleNested || schemaType.$isMongooseDocumentArrayElement) { + try { + val = Model.castObject.call(schemaType.caster, val); + } catch (err) { + if (!options.ignoreCastErrors) { + error2 = error2 || new ValidationError(); + error2.addError(path, err); + } + continue; + } + cur[pieces[pieces.length - 1]] = val; + continue; + } + try { + val = schemaType.cast(val); + cur[pieces[pieces.length - 1]] = val; + } catch (err) { + if (!options.ignoreCastErrors) { + error2 = error2 || new ValidationError(); + error2.addError(path, err); + } + continue; + } + } + if (error2 != null) { + throw error2; + } + return ret; + }; + Model.buildBulkWriteOperations = function buildBulkWriteOperations(documents, options) { + if (!Array.isArray(documents)) { + throw new Error(`bulkSave expects an array of documents to be passed, received \`${documents}\` instead`); + } + setDefaultOptions(); + const writeOperations = documents.map((document2, i4) => { + if (!options.skipValidation) { + if (!(document2 instanceof Document)) { + throw new Error(`documents.${i4} was not a mongoose document, documents must be an array of mongoose documents (instanceof mongoose.Document).`); + } + if (options.validateBeforeSave == null || options.validateBeforeSave) { + const err = document2.validateSync(); + if (err != null) { + throw err; + } + } + } + const isANewDocument = document2.isNew; + if (isANewDocument) { + const writeOperation = { insertOne: { document: document2 } }; + utils.injectTimestampsOption(writeOperation.insertOne, options.timestamps); + return writeOperation; + } + const delta = document2.$__delta(); + const isDocumentWithChanges = delta != null && !utils.isEmptyObject(delta[0]); + if (isDocumentWithChanges) { + const where = document2.$__where(delta[0]); + const changes = delta[1]; + _applyCustomWhere(document2, where); + const shardKey = this.schema.options.shardKey; + if (shardKey) { + const paths = Object.keys(shardKey); + const len = paths.length; + for (let i5 = 0; i5 < len; ++i5) { + where[paths[i5]] = document2[paths[i5]]; + } + } + document2.$__version(where, delta); + const writeOperation = { updateOne: { filter: where, update: changes } }; + utils.injectTimestampsOption(writeOperation.updateOne, options.timestamps); + return writeOperation; + } + return null; + }).filter((op2) => op2 !== null); + return writeOperations; + function setDefaultOptions() { + options = options || {}; + if (options.skipValidation == null) { + options.skipValidation = false; + } + } + }; + Model.hydrate = function(obj, projection, options) { + _checkContext(this, "hydrate"); + if (options?.virtuals && options?.hydratedPopulatedDocs === false) { + throw new MongooseError("Cannot set `hydratedPopulatedDocs` option to false if `virtuals` option is truthy because `virtuals: true` also sets populated virtuals"); + } + if (projection != null) { + if (obj != null && obj.$__ != null) { + obj = obj.toObject(internalToObjectOptions); + } + obj = applyProjection(obj, projection); + } + const document2 = require_queryHelpers().createModel(this, obj, projection); + document2.$init(obj, options); + return document2; + }; + Model.updateMany = function updateMany(conditions, update, options) { + _checkContext(this, "updateMany"); + if (update == null) { + throw new MongooseError("updateMany `update` parameter cannot be nullish"); + } + return _update(this, "updateMany", conditions, update, options); + }; + Model.updateOne = function updateOne(conditions, doc, options) { + _checkContext(this, "updateOne"); + return _update(this, "updateOne", conditions, doc, options); + }; + Model.replaceOne = function replaceOne(conditions, doc, options) { + _checkContext(this, "replaceOne"); + const versionKey = this && this.schema && this.schema.options && this.schema.options.versionKey || null; + if (versionKey && !doc[versionKey]) { + doc[versionKey] = 0; + } + return _update(this, "replaceOne", conditions, doc, options); + }; + function _update(model, op2, conditions, doc, options) { + const mq = new model.Query({}, {}, model, model.collection); + if (conditions instanceof Document) { + conditions = conditions.toObject(); + } else { + conditions = clone(conditions); + } + options = typeof options === "function" ? options : clone(options); + const versionKey = model && model.schema && model.schema.options && model.schema.options.versionKey || null; + decorateUpdateWithVersionKey(doc, options, versionKey); + return mq[op2](conditions, doc, options); + } + Model.aggregate = function aggregate(pipeline, options) { + _checkContext(this, "aggregate"); + if (typeof options === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Model.aggregate() no longer accepts a callback"); + } + const aggregate2 = new Aggregate(pipeline || []); + aggregate2.model(this); + if (options != null) { + aggregate2.option(options); + } + return aggregate2; + }; + Model.validate = async function validate(obj, pathsOrOptions, context) { + if (arguments.length < 3 || arguments.length === 3 && typeof arguments[2] === "function") { + context = obj; + } + if (typeof context === "function" || typeof arguments[3] === "function") { + throw new MongooseError("Model.validate() no longer accepts a callback"); + } + let schema = this.schema; + const discriminatorKey = schema.options.discriminatorKey; + if (schema.discriminators != null && obj != null && obj[discriminatorKey] != null) { + schema = getSchemaDiscriminatorByValue(schema, obj[discriminatorKey]) || schema; + } + let paths = Object.keys(schema.paths); + if (pathsOrOptions != null) { + const _pathsToValidate = typeof pathsOrOptions === "string" ? new Set(pathsOrOptions.split(" ")) : Array.isArray(pathsOrOptions) ? new Set(pathsOrOptions) : new Set(paths); + paths = paths.filter((p4) => { + if (pathsOrOptions.pathsToSkip) { + if (Array.isArray(pathsOrOptions.pathsToSkip)) { + if (pathsOrOptions.pathsToSkip.find((x4) => x4 == p4)) { + return false; + } + } else if (typeof pathsOrOptions.pathsToSkip == "string") { + if (pathsOrOptions.pathsToSkip.includes(p4)) { + return false; + } + } + } + const pieces = p4.split("."); + let cur = pieces[0]; + for (const piece of pieces) { + if (_pathsToValidate.has(cur)) { + return true; + } + cur += "." + piece; + } + return _pathsToValidate.has(p4); + }); + } + for (const path of paths) { + const schemaType = schema.path(path); + if (!schemaType || !schemaType.$isMongooseArray || schemaType.$isMongooseDocumentArray) { + continue; + } + const val = get2(obj, path); + pushNestedArrayPaths(paths, val, path); + } + let error2 = null; + paths = new Set(paths); + try { + obj = this.castObject(obj); + } catch (err) { + error2 = err; + for (const key of Object.keys(error2.errors || {})) { + paths.delete(key); + } + } + let remaining = paths.size; + return new Promise((resolve, reject) => { + if (remaining === 0) { + return settle(); + } + for (const path of paths) { + const schemaType = schema.path(path); + if (schemaType == null) { + _checkDone(); + continue; + } + const pieces = path.indexOf(".") === -1 ? [path] : path.split("."); + let cur = obj; + for (let i4 = 0; i4 < pieces.length - 1; ++i4) { + cur = cur[pieces[i4]]; + } + const val = get2(obj, path, void 0); + schemaType.doValidate(val, (err) => { + if (err) { + error2 = error2 || new ValidationError(); + error2.addError(path, err); + } + _checkDone(); + }, context, { path }); + } + function settle() { + if (error2) { + reject(error2); + } else { + resolve(obj); + } + } + function _checkDone() { + if (--remaining <= 0) { + return settle(); + } + } + }); + }; + Model.populate = async function populate(docs, paths) { + _checkContext(this, "populate"); + if (typeof paths === "function" || typeof arguments[2] === "function") { + throw new MongooseError("Model.populate() no longer accepts a callback"); + } + paths = utils.populate(paths); + if (paths.length === 0) { + return docs; + } + if (paths.find((p4) => p4.ordered)) { + for (const path of paths) { + await _populatePath(this, docs, path); + } + } else { + const promises = []; + for (const path of paths) { + promises.push(_populatePath(this, docs, path)); + } + await Promise.all(promises); + } + return docs; + }; + var excludeIdReg = /\s?-_id\s?/; + var excludeIdRegGlobal = /\s?-_id\s?/g; + async function _populatePath(model, docs, populateOptions) { + if (populateOptions.strictPopulate == null) { + if (populateOptions._localModel != null && populateOptions._localModel.schema._userProvidedOptions.strictPopulate != null) { + populateOptions.strictPopulate = populateOptions._localModel.schema._userProvidedOptions.strictPopulate; + } else if (populateOptions._localModel != null && model.base.options.strictPopulate != null) { + populateOptions.strictPopulate = model.base.options.strictPopulate; + } else if (model.base.options.strictPopulate != null) { + populateOptions.strictPopulate = model.base.options.strictPopulate; + } + } + if (!Array.isArray(docs)) { + docs = [docs]; + } + if (docs.length === 0 || docs.every(utils.isNullOrUndefined)) { + return; + } + const modelsMap = getModelsMapForPopulate(model, docs, populateOptions); + if (modelsMap instanceof MongooseError) { + throw modelsMap; + } + const len = modelsMap.length; + let vals = []; + function flatten(item) { + return void 0 !== item; + } + let hasOne = false; + const params = []; + for (let i4 = 0; i4 < len; ++i4) { + const mod = modelsMap[i4]; + let select = mod.options.select; + let ids = utils.array.flatten(mod.ids, flatten); + ids = utils.array.unique(ids); + const assignmentOpts = {}; + assignmentOpts.sort = mod && mod.options && mod.options.options && mod.options.options.sort || void 0; + assignmentOpts.excludeId = excludeIdReg.test(select) || select && select._id === 0; + if (mod.options && mod.options.options && mod.options.options.lean && mod.options.options.lean.transform) { + mod.options.options._leanTransform = mod.options.options.lean.transform; + mod.options.options.lean = true; + } + if (ids.length === 0 || ids.every(utils.isNullOrUndefined)) { + _assign(model, [], mod, assignmentOpts); + continue; + } + hasOne = true; + if (typeof populateOptions.foreignField === "string") { + mod.foreignField.clear(); + mod.foreignField.add(populateOptions.foreignField); + } + const match = createPopulateQueryFilter(ids, mod.match, mod.foreignField, mod.model, mod.options.skipInvalidIds); + if (assignmentOpts.excludeId) { + if (typeof select === "string") { + select = select.replace(excludeIdRegGlobal, " "); + } else if (Array.isArray(select)) { + select = select.filter((field) => field !== "-_id"); + } else { + select = { ...select }; + delete select._id; + } + } + if (mod.options.options && mod.options.options.limit != null) { + assignmentOpts.originalLimit = mod.options.options.limit; + } else if (mod.options.limit != null) { + assignmentOpts.originalLimit = mod.options.limit; + } + params.push([mod, match, select, assignmentOpts]); + } + if (!hasOne) { + if (modelsMap.length !== 0) { + return; + } + if (populateOptions.populate != null) { + const opts = utils.populate(populateOptions.populate).map((pop) => Object.assign({}, pop, { + path: populateOptions.path + "." + pop.path + })); + return model.populate(docs, opts); + } + return; + } + if (populateOptions.ordered) { + for (const arr of params) { + await _execPopulateQuery.apply(null, arr).then((valsFromDb) => { + vals = vals.concat(valsFromDb); + }); + } + } else { + const promises = []; + for (const arr of params) { + promises.push(_execPopulateQuery.apply(null, arr).then((valsFromDb) => { + vals = vals.concat(valsFromDb); + })); + } + await Promise.all(promises); + } + for (const arr of params) { + const mod = arr[0]; + const assignmentOpts = arr[3]; + for (const val of vals) { + mod.options._childDocs.push(val); + } + _assign(model, vals, mod, assignmentOpts); + } + for (const arr of params) { + removeDeselectedForeignField(arr[0].foreignField, arr[0].options, vals); + } + for (const arr of params) { + const mod = arr[0]; + if (mod.options && mod.options.options && mod.options.options._leanTransform) { + for (const doc of vals) { + mod.options.options._leanTransform(doc); + } + } + } + } + function _execPopulateQuery(mod, match, select) { + let subPopulate = clone(mod.options.populate); + const queryOptions = {}; + if (mod.options.skip !== void 0) { + queryOptions.skip = mod.options.skip; + } + if (mod.options.limit !== void 0) { + queryOptions.limit = mod.options.limit; + } + if (mod.options.perDocumentLimit !== void 0) { + queryOptions.perDocumentLimit = mod.options.perDocumentLimit; + } + Object.assign(queryOptions, mod.options.options); + if (mod.count) { + delete queryOptions.skip; + } + if (queryOptions.perDocumentLimit != null) { + queryOptions.limit = queryOptions.perDocumentLimit; + delete queryOptions.perDocumentLimit; + } else if (queryOptions.limit != null) { + queryOptions.limit = queryOptions.limit * mod.ids.length; + } + const query = mod.model.find(match, select, queryOptions); + for (const foreignField of mod.foreignField) { + if (foreignField !== "_id" && query.selectedInclusively() && !isPathSelectedInclusive(query._fields, foreignField)) { + query.select(foreignField); + } + } + if (mod.count) { + for (const foreignField of mod.foreignField) { + query.select(foreignField); + } + } + if (subPopulate) { + if (mod.model.baseModelName != null) { + if (Array.isArray(subPopulate)) { + subPopulate.forEach((pop) => { + pop.strictPopulate = false; + }); + } else if (typeof subPopulate === "string") { + subPopulate = { path: subPopulate, strictPopulate: false }; + } else { + subPopulate.strictPopulate = false; + } + } + const basePath2 = mod.options._fullPath || mod.options.path; + if (Array.isArray(subPopulate)) { + for (const pop of subPopulate) { + pop._fullPath = basePath2 + "." + pop.path; + } + } else if (typeof subPopulate === "object") { + subPopulate._fullPath = basePath2 + "." + subPopulate.path; + } + query.populate(subPopulate); + } + return query.exec().then( + (docs) => { + for (const val of docs) { + leanPopulateMap.set(val, mod.model); + } + return docs; + } + ); + } + function _assign(model, vals, mod, assignmentOpts) { + const options = mod.options; + const isVirtual = mod.isVirtual; + const justOne = mod.justOne; + let _val; + const lean = options && options.options && options.options.lean || false; + const len = vals.length; + const rawOrder = {}; + const rawDocs = {}; + let key; + let val; + const allIds = clone(mod.allIds); + for (let i4 = 0; i4 < len; i4++) { + val = vals[i4]; + if (val == null) { + continue; + } + for (const foreignField of mod.foreignField) { + _val = utils.getValue(foreignField, val); + if (Array.isArray(_val)) { + _val = utils.array.unique(utils.array.flatten(_val)); + for (let __val of _val) { + if (__val instanceof Document) { + __val = __val._doc._id; + } + if (__val?.constructor?.name === "Binary" && __val.sub_type === 4 && typeof __val.toUUID === "function") { + key = String(__val.toUUID()); + } else if (__val?.constructor?.name === "Buffer" && __val._subtype === 4 && typeof __val.toUUID === "function") { + key = String(__val.toUUID()); + } else { + key = String(__val); + } + if (rawDocs[key]) { + if (Array.isArray(rawDocs[key])) { + rawDocs[key].push(val); + rawOrder[key].push(i4); + } else { + rawDocs[key] = [rawDocs[key], val]; + rawOrder[key] = [rawOrder[key], i4]; + } + } else { + if (isVirtual && !justOne) { + rawDocs[key] = [val]; + rawOrder[key] = [i4]; + } else { + rawDocs[key] = val; + rawOrder[key] = i4; + } + } + } + } else { + if (_val instanceof Document) { + _val = _val._doc._id; + } + if (_val?.constructor?.name === "Binary" && _val.sub_type === 4 && typeof _val.toUUID === "function") { + key = String(_val.toUUID()); + } else if (_val?.constructor?.name === "Buffer" && _val._subtype === 4 && typeof _val.toUUID === "function") { + key = String(_val.toUUID()); + } else { + key = String(_val); + } + if (rawDocs[key]) { + if (Array.isArray(rawDocs[key])) { + rawDocs[key].push(val); + rawOrder[key].push(i4); + } else if (isVirtual || rawDocs[key].constructor !== val.constructor || (rawDocs[key] instanceof Document ? String(rawDocs[key]._doc._id) : String(rawDocs[key]._id)) !== (val instanceof Document ? String(val._doc._id) : String(val._id))) { + rawDocs[key] = [rawDocs[key], val]; + rawOrder[key] = [rawOrder[key], i4]; + } + } else { + rawDocs[key] = val; + rawOrder[key] = i4; + } + } + if (!lean) { + val.$__.wasPopulated = val.$__.wasPopulated || { value: _val }; + } + } + } + assignVals({ + originalModel: model, + // If virtual, make sure to not mutate original field + rawIds: mod.isVirtual ? allIds : mod.allIds, + allIds, + unpopulatedValues: mod.unpopulatedValues, + foreignField: mod.foreignField, + rawDocs, + rawOrder, + docs: mod.docs, + path: options.path, + options: assignmentOpts, + justOne: mod.justOne, + isVirtual: mod.isVirtual, + allOptions: mod, + populatedModel: mod.model, + lean, + virtual: mod.virtual, + count: mod.count, + match: mod.match + }); + } + Model.compile = function compile(name, schema, collectionName, connection, base) { + const versioningEnabled = schema.options.versionKey !== false; + if (versioningEnabled && !schema.paths[schema.options.versionKey]) { + const o4 = {}; + o4[schema.options.versionKey] = Number; + schema.add(o4); + } + let model; + if (typeof name === "function" && name.prototype instanceof Model) { + model = name; + name = model.name; + schema.loadClass(model, false); + model.prototype.$isMongooseModelPrototype = true; + } else { + model = function model2(doc, fields, skipId) { + model2.hooks.execPreSync("createModel", doc); + if (!(this instanceof model2)) { + return new model2(doc, fields, skipId); + } + const discriminatorKey = model2.schema.options.discriminatorKey; + if (model2.discriminators == null || doc == null || doc[discriminatorKey] == null) { + Model.call(this, doc, fields, skipId); + return; + } + const Discriminator = model2.discriminators[doc[discriminatorKey]] || getDiscriminatorByValue(model2.discriminators, doc[discriminatorKey]); + if (Discriminator != null) { + return new Discriminator(doc, fields, skipId); + } + Model.call(this, doc, fields, skipId); + }; + } + model.hooks = schema.s.hooks.clone(); + model.base = base; + model.modelName = name; + if (!(model.prototype instanceof Model)) { + Object.setPrototypeOf(model, Model); + Object.setPrototypeOf(model.prototype, Model.prototype); + } + model.model = function model2(name2) { + return this.db.model(name2); + }; + model.db = connection; + model.prototype.db = connection; + model.prototype[modelDbSymbol] = connection; + model.discriminators = model.prototype.discriminators = void 0; + model[modelSymbol] = true; + model.events = new EventEmitter(); + schema._preCompile(); + const _userProvidedOptions = schema._userProvidedOptions || {}; + const collectionOptions = { + schemaUserProvidedOptions: _userProvidedOptions, + capped: schema.options.capped, + Promise: model.base.Promise, + modelName: name + }; + if (schema.options.autoCreate !== void 0) { + collectionOptions.autoCreate = schema.options.autoCreate; + } + const collection = connection.collection( + collectionName, + collectionOptions + ); + model.prototype.collection = collection; + model.prototype.$collection = collection; + model.prototype[modelCollectionSymbol] = collection; + model.prototype.$__setSchema(schema); + applyMethods(model, schema); + applyStatics(model, schema); + applyHooks(model, schema); + applyStaticHooks(model, schema.s.hooks, schema.statics); + model.schema = model.prototype.$__schema; + model.collection = collection; + model.$__collection = collection; + model.Query = function() { + Query.apply(this, arguments); + }; + Object.setPrototypeOf(model.Query.prototype, Query.prototype); + model.Query.base = Query.base; + model.Query.prototype.constructor = Query; + model._applyQueryMiddleware(); + applyQueryMethods(model, schema.query); + return model; + }; + Model.clientEncryption = function clientEncryption() { + const ClientEncryption = this.base.driver.get().ClientEncryption; + if (!ClientEncryption) { + throw new Error("The mongodb driver must be used to obtain a ClientEncryption object."); + } + const client = this.collection?.conn?.client; + if (!client) return null; + const autoEncryptionOptions = client.options.autoEncryption; + if (!autoEncryptionOptions) return null; + const { + keyVaultNamespace, + keyVaultClient, + kmsProviders, + credentialProviders, + proxyOptions, + tlsOptions + } = autoEncryptionOptions; + return new ClientEncryption( + keyVaultClient ?? client, + { keyVaultNamespace, kmsProviders, credentialProviders, proxyOptions, tlsOptions } + ); + }; + Model.$__updateConnection = function $__updateConnection(newConnection) { + this.db = newConnection; + this.prototype.db = newConnection; + this.prototype[modelDbSymbol] = newConnection; + const collection = newConnection.collection( + this.collection.collectionName, + this.collection.opts + ); + this.prototype.collection = collection; + this.prototype.$collection = collection; + this.prototype[modelCollectionSymbol] = collection; + this.collection = collection; + this.$__collection = collection; + }; + function applyQueryMethods(model, methods) { + for (const i4 in methods) { + model.Query.prototype[i4] = methods[i4]; + } + } + Model.__subclass = function subclass(conn, schema, collection) { + const _this = this; + const Model2 = function Model3(doc, fields, skipId) { + if (!(this instanceof Model3)) { + return new Model3(doc, fields, skipId); + } + _this.call(this, doc, fields, skipId); + }; + Object.setPrototypeOf(Model2, _this); + Object.setPrototypeOf(Model2.prototype, _this.prototype); + Model2.db = conn; + Model2.prototype.db = conn; + Model2.prototype[modelDbSymbol] = conn; + _this[subclassedSymbol] = _this[subclassedSymbol] || []; + _this[subclassedSymbol].push(Model2); + if (_this.discriminators != null) { + Model2.discriminators = {}; + for (const key of Object.keys(_this.discriminators)) { + Model2.discriminators[key] = _this.discriminators[key].__subclass(_this.db, _this.discriminators[key].schema, collection); + } + } + const s4 = schema && typeof schema !== "string" ? schema : _this.prototype.$__schema; + const options = s4.options || {}; + const _userProvidedOptions = s4._userProvidedOptions || {}; + if (!collection) { + collection = _this.prototype.$__schema.get("collection") || utils.toCollectionName(_this.modelName, this.base.pluralize()); + } + const collectionOptions = { + schemaUserProvidedOptions: _userProvidedOptions, + capped: s4 && options.capped + }; + Model2.prototype.collection = conn.collection(collection, collectionOptions); + Model2.prototype.$collection = Model2.prototype.collection; + Model2.prototype[modelCollectionSymbol] = Model2.prototype.collection; + Model2.collection = Model2.prototype.collection; + Model2.$__collection = Model2.collection; + Model2.init().catch(() => { + }); + return Model2; + }; + Model.recompileSchema = function recompileSchema() { + this.prototype.$__setSchema(this.schema); + if (this.schema._applyDiscriminators != null) { + for (const disc of this.schema._applyDiscriminators.keys()) { + this.discriminator(disc, this.schema._applyDiscriminators.get(disc)); + } + } + delete this.schema._defaultToObjectOptionsMap; + applyEmbeddedDiscriminators(this.schema, /* @__PURE__ */ new WeakSet(), true); + }; + Model.inspect = function() { + return `Model { ${this.modelName} }`; + }; + Model.namespace = function namespace() { + return this.db.name + "." + this.collection.collectionName; + }; + if (util.inspect.custom) { + Model[util.inspect.custom] = Model.inspect; + } + Model._applyQueryMiddleware = function _applyQueryMiddleware() { + const Query2 = this.Query; + const queryMiddleware = this.schema.s.hooks.filter((hook) => { + const contexts = _getContexts(hook); + if (hook.name === "validate") { + return !!contexts.query; + } + if (hook.name === "deleteOne" || hook.name === "updateOne") { + return !!contexts.query || Object.keys(contexts).length === 0; + } + if (hook.query != null || hook.document != null) { + return !!hook.query; + } + return true; + }); + Query2.prototype._queryMiddleware = queryMiddleware; + }; + function _getContexts(hook) { + const ret = {}; + if (Object.hasOwn(hook, "query")) { + ret.query = hook.query; + } + if (Object.hasOwn(hook, "document")) { + ret.document = hook.document; + } + return ret; + } + module2.exports = exports2 = Model; + } +}); + +// node_modules/mongoose/lib/helpers/pluralize.js +var require_pluralize = __commonJS({ + "node_modules/mongoose/lib/helpers/pluralize.js"(exports2, module2) { + "use strict"; + module2.exports = pluralize; + exports2.pluralization = [ + [/human$/gi, "humans"], + [/(m)an$/gi, "$1en"], + [/(pe)rson$/gi, "$1ople"], + [/(child)$/gi, "$1ren"], + [/^(ox)$/gi, "$1en"], + [/(ax|test)is$/gi, "$1es"], + [/(octop|vir)us$/gi, "$1i"], + [/(alias|status)$/gi, "$1es"], + [/(bu)s$/gi, "$1ses"], + [/(buffal|tomat|potat)o$/gi, "$1oes"], + [/([ti])um$/gi, "$1a"], + [/sis$/gi, "ses"], + [/(?:([^f])fe|([lr])f)$/gi, "$1$2ves"], + [/(hive)$/gi, "$1s"], + [/([^aeiouy]|qu)y$/gi, "$1ies"], + [/(x|ch|ss|sh)$/gi, "$1es"], + [/(matr|vert|ind)ix|ex$/gi, "$1ices"], + [/([m|l])ouse$/gi, "$1ice"], + [/(kn|w|l)ife$/gi, "$1ives"], + [/(quiz)$/gi, "$1zes"], + [/^goose$/i, "geese"], + [/s$/gi, "s"], + [/([^a-z])$/, "$1"], + [/$/gi, "s"] + ]; + var rules = exports2.pluralization; + exports2.uncountables = [ + "advice", + "energy", + "excretion", + "digestion", + "cooperation", + "health", + "justice", + "labour", + "machinery", + "equipment", + "information", + "pollution", + "sewage", + "paper", + "money", + "species", + "series", + "rain", + "rice", + "fish", + "sheep", + "moose", + "deer", + "news", + "expertise", + "status", + "media" + ]; + var uncountables = exports2.uncountables; + function pluralize(str) { + let found; + str = str.toLowerCase(); + if (!~uncountables.indexOf(str)) { + found = rules.filter(function(rule) { + return str.match(rule[0]); + }); + if (found[0]) { + return str.replace(found[0][0], found[0][1]); + } + } + return str; + } + } +}); + +// node_modules/mongoose/lib/error/setOptionError.js +var require_setOptionError = __commonJS({ + "node_modules/mongoose/lib/error/setOptionError.js"(exports2, module2) { + "use strict"; + var MongooseError = require_mongooseError(); + var util = require("util"); + var combinePathErrors = require_combinePathErrors(); + var SetOptionError = class _SetOptionError extends MongooseError { + constructor() { + super(""); + this.errors = {}; + } + /** + * Console.log helper + */ + toString() { + return combinePathErrors(this); + } + /** + * inspect helper + * @api private + */ + inspect() { + return Object.assign(new Error(this.message), this); + } + /** + * add message + * @param {String} key + * @param {String|Error} error + * @api private + */ + addError(key, error2) { + if (error2 instanceof _SetOptionError) { + const { errors } = error2; + for (const optionKey of Object.keys(errors)) { + this.addError(optionKey, errors[optionKey]); + } + return; + } + this.errors[key] = error2; + this.message = combinePathErrors(this); + } + }; + if (util.inspect.custom) { + SetOptionError.prototype[util.inspect.custom] = SetOptionError.prototype.inspect; + } + Object.defineProperty(SetOptionError.prototype, "toJSON", { + enumerable: false, + writable: false, + configurable: true, + value: function() { + return Object.assign({}, this, { name: this.name, message: this.message }); + } + }); + Object.defineProperty(SetOptionError.prototype, "name", { + value: "SetOptionError" + }); + var SetOptionInnerError = class extends MongooseError { + /** + * Error for the "errors" array in "SetOptionError" with consistent message + * @param {String} key + */ + constructor(key) { + super(`"${key}" is not a valid option to set`); + } + }; + SetOptionError.SetOptionInnerError = SetOptionInnerError; + module2.exports = SetOptionError; + } +}); + +// node_modules/mongoose/lib/helpers/printJestWarning.js +var require_printJestWarning = __commonJS({ + "node_modules/mongoose/lib/helpers/printJestWarning.js"() { + "use strict"; + var utils = require_utils6(); + if (typeof jest !== "undefined" && !process.env.SUPPRESS_JEST_WARNINGS) { + if (typeof window !== "undefined") { + utils.warn("Mongoose: looks like you're trying to test a Mongoose app with Jest's default jsdom test environment. Please make sure you read Mongoose's docs on configuring Jest to test Node.js apps: https://mongoosejs.com/docs/jest.html. Set the SUPPRESS_JEST_WARNINGS to true to hide this warning."); + } + if (setTimeout.clock != null && typeof setTimeout.clock.Date === "function") { + utils.warn("Mongoose: looks like you're trying to test a Mongoose app with Jest's mock timers enabled. Please make sure you read Mongoose's docs on configuring Jest to test Node.js apps: https://mongoosejs.com/docs/jest.html. Set the SUPPRESS_JEST_WARNINGS to true to hide this warning."); + } + } + } +}); + +// node_modules/mongoose/lib/browserDocument.js +var require_browserDocument = __commonJS({ + "node_modules/mongoose/lib/browserDocument.js"(exports2, module2) { + "use strict"; + var NodeJSDocument = require_document2(); + var EventEmitter = require("events").EventEmitter; + var MongooseError = require_error2(); + var Schema2 = require_schema2(); + var ObjectId2 = require_objectid(); + var ValidationError = MongooseError.ValidationError; + var applyHooks = require_applyHooks(); + var isObject = require_isObject(); + function Document(obj, schema, fields, skipId, skipInit) { + if (!(this instanceof Document)) { + return new Document(obj, schema, fields, skipId, skipInit); + } + if (isObject(schema) && !schema.instanceOfSchema) { + schema = new Schema2(schema); + } + schema = this.schema || schema; + if (!this.schema && schema.options._id) { + obj = obj || {}; + if (obj._id === void 0) { + obj._id = new ObjectId2(); + } + } + if (!schema) { + throw new MongooseError.MissingSchemaError(); + } + this.$__setSchema(schema); + NodeJSDocument.call(this, obj, fields, skipId, skipInit); + applyHooks(this, schema, { decorateDoc: true }); + for (const m4 in schema.methods) { + this[m4] = schema.methods[m4]; + } + for (const s4 in schema.statics) { + this[s4] = schema.statics[s4]; + } + } + Document.prototype = Object.create(NodeJSDocument.prototype); + Document.prototype.constructor = Document; + Document.events = new EventEmitter(); + Document.$emitter = new EventEmitter(); + [ + "on", + "once", + "emit", + "listeners", + "removeListener", + "setMaxListeners", + "removeAllListeners", + "addListener" + ].forEach(function(emitterFn) { + Document[emitterFn] = function() { + return Document.$emitter[emitterFn].apply(Document.$emitter, arguments); + }; + }); + Document.ValidationError = ValidationError; + module2.exports = exports2 = Document; + } +}); + +// node_modules/mongoose/lib/documentProvider.js +var require_documentProvider = __commonJS({ + "node_modules/mongoose/lib/documentProvider.js"(exports2, module2) { + "use strict"; + var Document = require_document2(); + var BrowserDocument = require_browserDocument(); + var isBrowser = false; + module2.exports = function documentProvider() { + if (isBrowser) { + return BrowserDocument; + } + return Document; + }; + module2.exports.setBrowser = function(flag) { + isBrowser = flag; + }; + } +}); + +// node_modules/mongoose/lib/mongoose.js +var require_mongoose = __commonJS({ + "node_modules/mongoose/lib/mongoose.js"(exports2, module2) { + "use strict"; + var Document = require_document2(); + var EventEmitter = require("events").EventEmitter; + var Kareem = require_kareem(); + var Schema2 = require_schema2(); + var SchemaType = require_schemaType(); + var SchemaTypes = require_schema(); + var VirtualType = require_virtualType(); + var STATES = require_connectionState(); + var VALID_OPTIONS = require_validOptions(); + var Types = require_types2(); + var Query = require_query2(); + var Model = require_model(); + var applyPlugins = require_applyPlugins(); + var builtinPlugins = require_plugins(); + var driver = require_driver(); + var legacyPluralize = require_pluralize(); + var utils = require_utils6(); + var pkg = require_package2(); + var cast = require_cast2(); + var Aggregate = require_aggregate2(); + var trusted = require_trusted().trusted; + var sanitizeFilter = require_sanitizeFilter(); + var isBsonType = require_isBsonType(); + var MongooseError = require_mongooseError(); + var SetOptionError = require_setOptionError(); + var applyEmbeddedDiscriminators = require_applyEmbeddedDiscriminators(); + var defaultMongooseSymbol = /* @__PURE__ */ Symbol.for("mongoose:default"); + var defaultConnectionSymbol = /* @__PURE__ */ Symbol("mongoose:defaultConnection"); + require_printJestWarning(); + var objectIdHexRegexp = /^[0-9A-Fa-f]{24}$/; + var { AsyncLocalStorage } = require("node:async_hooks"); + function Mongoose(options) { + this.connections = []; + this.nextConnectionId = 0; + this.models = {}; + this.events = new EventEmitter(); + this.__driver = driver.get(); + this.options = Object.assign({ + pluralization: true, + autoIndex: true, + autoCreate: true, + autoSearchIndex: false + }, options); + const createInitialConnection = utils.getOption("createInitialConnection", this.options) ?? true; + if (createInitialConnection && this.__driver != null) { + _createDefaultConnection(this); + } + if (this.options.pluralization) { + this._pluralize = legacyPluralize; + } + if (!options || !options[defaultMongooseSymbol]) { + const _this = this; + this.Schema = function() { + this.base = _this; + return Schema2.apply(this, arguments); + }; + this.Schema.prototype = Object.create(Schema2.prototype); + Object.assign(this.Schema, Schema2); + this.Schema.base = this; + this.Schema.Types = Object.assign({}, Schema2.Types); + } else { + for (const key of ["Schema", "model"]) { + this[key] = Mongoose.prototype[key]; + } + } + this.Schema.prototype.base = this; + if (options?.transactionAsyncLocalStorage) { + this.transactionAsyncLocalStorage = new AsyncLocalStorage(); + } + Object.defineProperty(this, "plugins", { + configurable: false, + enumerable: true, + writable: false, + value: Object.values(builtinPlugins).map((plugin) => [plugin, { deduplicate: true }]) + }); + } + Mongoose.prototype.cast = cast; + Mongoose.prototype.STATES = STATES; + Mongoose.prototype.ConnectionStates = STATES; + Mongoose.prototype.driver = driver; + Mongoose.prototype.setDriver = function setDriver(driver2) { + const _mongoose = this instanceof Mongoose ? this : mongoose2; + if (_mongoose.__driver === driver2) { + return _mongoose; + } + const openConnection = _mongoose.connections && _mongoose.connections.find((conn) => conn.readyState !== STATES.disconnected); + if (openConnection) { + const msg = "Cannot modify Mongoose driver if a connection is already open. Call `mongoose.disconnect()` before modifying the driver"; + throw new MongooseError(msg); + } + _mongoose.__driver = driver2; + if (Array.isArray(driver2.plugins)) { + for (const plugin of driver2.plugins) { + if (typeof plugin === "function") { + _mongoose.plugin(plugin); + } + } + } + if (driver2.SchemaTypes != null) { + Object.assign(mongoose2.Schema.Types, driver2.SchemaTypes); + } + const Connection = driver2.Connection; + const oldDefaultConnection = _mongoose.connections[0]; + _mongoose.connections = [new Connection(_mongoose)]; + _mongoose.connections[0].models = _mongoose.models; + if (oldDefaultConnection == null) { + return _mongoose; + } + for (const model of Object.values(_mongoose.models)) { + if (model.db !== oldDefaultConnection) { + continue; + } + model.$__updateConnection(_mongoose.connections[0]); + } + return _mongoose; + }; + Mongoose.prototype.set = function getsetOptions(key, value) { + const _mongoose = this instanceof Mongoose ? this : mongoose2; + if (arguments.length === 1 && typeof key !== "object") { + if (VALID_OPTIONS.indexOf(key) === -1) { + const error3 = new SetOptionError(); + error3.addError(key, new SetOptionError.SetOptionInnerError(key)); + throw error3; + } + return _mongoose.options[key]; + } + let options = {}; + if (arguments.length === 2) { + options = { [key]: value }; + } + if (arguments.length === 1 && typeof key === "object") { + options = key; + } + let error2 = void 0; + for (const [optionKey, optionValue] of Object.entries(options)) { + if (VALID_OPTIONS.indexOf(optionKey) === -1) { + if (!error2) { + error2 = new SetOptionError(); + } + error2.addError(optionKey, new SetOptionError.SetOptionInnerError(optionKey)); + continue; + } + _mongoose.options[optionKey] = optionValue; + if (optionKey === "objectIdGetter") { + if (optionValue) { + Object.defineProperty(_mongoose.Types.ObjectId.prototype, "_id", { + enumerable: false, + configurable: true, + get: function() { + return this; + } + }); + } else { + delete _mongoose.Types.ObjectId.prototype._id; + } + } else if (optionKey === "transactionAsyncLocalStorage") { + if (optionValue && !_mongoose.transactionAsyncLocalStorage) { + _mongoose.transactionAsyncLocalStorage = new AsyncLocalStorage(); + } else if (!optionValue && _mongoose.transactionAsyncLocalStorage) { + delete _mongoose.transactionAsyncLocalStorage; + } + } else if (optionKey === "createInitialConnection") { + if (optionValue && !_mongoose.connection) { + _createDefaultConnection(_mongoose); + } else if (optionValue === false && _mongoose.connection && _mongoose.connection[defaultConnectionSymbol]) { + if (_mongoose.connection.readyState === STATES.disconnected && Object.keys(_mongoose.connection.models).length === 0) { + _mongoose.connections.shift(); + } + } + } + } + if (error2) { + throw error2; + } + return _mongoose; + }; + Mongoose.prototype.get = Mongoose.prototype.set; + Mongoose.prototype.createConnection = function createConnection(uri, options) { + const _mongoose = this instanceof Mongoose ? this : mongoose2; + const Connection = _mongoose.__driver.Connection; + const conn = new Connection(_mongoose); + _mongoose.connections.push(conn); + _mongoose.nextConnectionId++; + _mongoose.events.emit("createConnection", conn); + if (arguments.length > 0) { + conn.openUri(uri, { ...options, _fireAndForget: true }); + } + return conn; + }; + Mongoose.prototype.connect = async function connect(uri, options) { + if (typeof options === "function" || arguments.length >= 3 && typeof arguments[2] === "function") { + throw new MongooseError("Mongoose.prototype.connect() no longer accepts a callback"); + } + const _mongoose = this instanceof Mongoose ? this : mongoose2; + if (_mongoose.connection == null) { + _createDefaultConnection(_mongoose); + } + const conn = _mongoose.connection; + return conn.openUri(uri, options).then(() => _mongoose); + }; + Mongoose.prototype.disconnect = async function disconnect() { + if (arguments.length >= 1 && typeof arguments[0] === "function") { + throw new MongooseError("Mongoose.prototype.disconnect() no longer accepts a callback"); + } + const _mongoose = this instanceof Mongoose ? this : mongoose2; + const remaining = _mongoose.connections.length; + if (remaining <= 0) { + return; + } + await Promise.all(_mongoose.connections.map((conn) => conn.close())); + }; + Mongoose.prototype.startSession = function startSession() { + const _mongoose = this instanceof Mongoose ? this : mongoose2; + return _mongoose.connection.startSession.apply(_mongoose.connection, arguments); + }; + Mongoose.prototype.pluralize = function pluralize(fn2) { + const _mongoose = this instanceof Mongoose ? this : mongoose2; + if (arguments.length > 0) { + _mongoose._pluralize = fn2; + } + return _mongoose._pluralize; + }; + Mongoose.prototype.model = function model(name, schema, collection, options) { + const _mongoose = this instanceof Mongoose ? this : mongoose2; + if (typeof schema === "string") { + collection = schema; + schema = false; + } + if (arguments.length === 1) { + const model3 = _mongoose.models[name]; + if (!model3) { + throw new _mongoose.Error.MissingSchemaError(name); + } + return model3; + } + if (utils.isObject(schema) && !(schema instanceof Schema2)) { + schema = new Schema2(schema); + } + if (schema && !(schema instanceof Schema2)) { + throw new _mongoose.Error("The 2nd parameter to `mongoose.model()` should be a schema or a POJO"); + } + options = options || {}; + const originalSchema = schema; + if (schema) { + if (_mongoose.get("cloneSchemas")) { + schema = schema.clone(); + } + _mongoose._applyPlugins(schema); + } + const overwriteModels = Object.hasOwn(_mongoose.options, "overwriteModels") ? _mongoose.options.overwriteModels : options.overwriteModels; + if (Object.hasOwn(_mongoose.models, name) && options.cache !== false && overwriteModels !== true) { + if (originalSchema?.instanceOfSchema && originalSchema !== _mongoose.models[name].schema) { + throw new _mongoose.Error.OverwriteModelError(name); + } + if (collection && collection !== _mongoose.models[name].collection.name) { + const model3 = _mongoose.models[name]; + schema = model3.prototype.schema; + const sub = model3.__subclass(_mongoose.connection, schema, collection); + return sub; + } + return _mongoose.models[name]; + } + if (schema == null) { + throw new _mongoose.Error.MissingSchemaError(name); + } + const model2 = _mongoose._model(name, schema, collection, options); + _mongoose.connection.models[name] = model2; + _mongoose.models[name] = model2; + return model2; + }; + Mongoose.prototype._model = function _model(name, schema, collection, options) { + const _mongoose = this instanceof Mongoose ? this : mongoose2; + let model; + if (typeof name === "function") { + model = name; + name = model.name; + if (!(model.prototype instanceof Model)) { + throw new _mongoose.Error("The provided class " + name + " must extend Model"); + } + } + if (schema) { + if (_mongoose.get("cloneSchemas")) { + schema = schema.clone(); + } + _mongoose._applyPlugins(schema); + } + if (schema == null || !("pluralization" in schema.options)) { + schema.options.pluralization = _mongoose.options.pluralization; + } + if (!collection) { + collection = schema.get("collection") || utils.toCollectionName(name, _mongoose.pluralize()); + } + applyEmbeddedDiscriminators(schema); + const connection = options.connection || _mongoose.connection; + model = _mongoose.Model.compile(model || name, schema, collection, connection, _mongoose); + model.init().catch(function $modelInitNoop() { + }); + connection.emit("model", model); + if (schema._applyDiscriminators != null) { + for (const disc of schema._applyDiscriminators.keys()) { + const { + schema: discriminatorSchema, + options: options2 + } = schema._applyDiscriminators.get(disc); + model.discriminator(disc, discriminatorSchema, options2); + } + } + return model; + }; + Mongoose.prototype.deleteModel = function deleteModel(name) { + const _mongoose = this instanceof Mongoose ? this : mongoose2; + _mongoose.connection.deleteModel(name); + delete _mongoose.models[name]; + return _mongoose; + }; + Mongoose.prototype.modelNames = function modelNames() { + const _mongoose = this instanceof Mongoose ? this : mongoose2; + const names = Object.keys(_mongoose.models); + return names; + }; + Mongoose.prototype._applyPlugins = function _applyPlugins(schema, options) { + const _mongoose = this instanceof Mongoose ? this : mongoose2; + options = options || {}; + options.applyPluginsToDiscriminators = _mongoose.options && _mongoose.options.applyPluginsToDiscriminators || false; + options.applyPluginsToChildSchemas = typeof (_mongoose.options && _mongoose.options.applyPluginsToChildSchemas) === "boolean" ? _mongoose.options.applyPluginsToChildSchemas : true; + applyPlugins(schema, _mongoose.plugins, options, "$globalPluginsApplied"); + }; + Mongoose.prototype.plugin = function plugin(fn2, opts) { + const _mongoose = this instanceof Mongoose ? this : mongoose2; + _mongoose.plugins.push([fn2, opts]); + return _mongoose; + }; + Mongoose.prototype.__defineGetter__("connection", function() { + return this.connections[0]; + }); + Mongoose.prototype.__defineSetter__("connection", function(v4) { + if (v4 instanceof this.__driver.Connection) { + this.connections[0] = v4; + this.models = v4.models; + } + }); + Mongoose.prototype.connections; + Mongoose.prototype.nextConnectionId; + Mongoose.prototype.Aggregate = Aggregate; + Mongoose.prototype.BaseCollection = require_collection(); + Object.defineProperty(Mongoose.prototype, "Collection", { + get: function() { + return this.__driver.Collection; + }, + set: function(Collection) { + this.__driver.Collection = Collection; + } + }); + Object.defineProperty(Mongoose.prototype, "Connection", { + get: function() { + return this.__driver.Connection; + }, + set: function(Connection) { + if (Connection === this.__driver.Connection) { + return; + } + this.__driver.Connection = Connection; + } + }); + Mongoose.prototype.BaseConnection = require_connection2(); + Mongoose.prototype.version = pkg.version; + Mongoose.prototype.Mongoose = Mongoose; + Mongoose.prototype.Schema = Schema2; + Mongoose.prototype.SchemaType = SchemaType; + Mongoose.prototype.SchemaTypes = Schema2.Types; + Mongoose.prototype.VirtualType = VirtualType; + Mongoose.prototype.Types = Types; + Mongoose.prototype.Query = Query; + Mongoose.prototype.Model = Model; + Mongoose.prototype.Document = Document; + Mongoose.prototype.DocumentProvider = require_documentProvider(); + Mongoose.prototype.ObjectId = SchemaTypes.ObjectId; + Mongoose.prototype.isValidObjectId = function isValidObjectId(v4) { + const _mongoose = this instanceof Mongoose ? this : mongoose2; + return _mongoose.Types.ObjectId.isValid(v4); + }; + Mongoose.prototype.isObjectIdOrHexString = function isObjectIdOrHexString(v4) { + return isBsonType(v4, "ObjectId") || typeof v4 === "string" && objectIdHexRegexp.test(v4); + }; + Mongoose.prototype.syncIndexes = function syncIndexes(options) { + const _mongoose = this instanceof Mongoose ? this : mongoose2; + return _mongoose.connection.syncIndexes(options); + }; + Mongoose.prototype.Decimal128 = SchemaTypes.Decimal128; + Mongoose.prototype.Mixed = SchemaTypes.Mixed; + Mongoose.prototype.Date = SchemaTypes.Date; + Mongoose.prototype.Number = SchemaTypes.Number; + Mongoose.prototype.Error = MongooseError; + Mongoose.prototype.MongooseError = MongooseError; + Mongoose.prototype.now = function now() { + return /* @__PURE__ */ new Date(); + }; + Mongoose.prototype.CastError = MongooseError.CastError; + Mongoose.prototype.SchemaTypeOptions = require_schemaTypeOptions(); + Mongoose.prototype.mquery = require_mquery(); + Mongoose.prototype.sanitizeFilter = sanitizeFilter; + Mongoose.prototype.trusted = trusted; + Mongoose.prototype.skipMiddlewareFunction = Kareem.skipWrappedFunction; + Mongoose.prototype.overwriteMiddlewareResult = Kareem.overwriteResult; + Mongoose.prototype.omitUndefined = require_omitUndefined(); + function _createDefaultConnection(mongoose3) { + if (mongoose3.connection) { + return; + } + const conn = mongoose3.createConnection(); + conn[defaultConnectionSymbol] = true; + conn.models = mongoose3.models; + } + var mongoose2 = module2.exports = exports2 = new Mongoose({ + [defaultMongooseSymbol]: true + }); + } +}); + +// node_modules/mongoose/lib/index.js +var require_lib9 = __commonJS({ + "node_modules/mongoose/lib/index.js"(exports2, module2) { + "use strict"; + var mongodbDriver = require_node_mongodb_native(); + require_driver().set(mongodbDriver); + var mongoose2 = require_mongoose(); + mongoose2.setDriver(mongodbDriver); + mongoose2.Mongoose.prototype.mongo = require_lib6(); + module2.exports = mongoose2; + } +}); + +// node_modules/mongoose/index.js +var require_mongoose2 = __commonJS({ + "node_modules/mongoose/index.js"(exports2, module2) { + "use strict"; + var mongoose2 = require_lib9(); + module2.exports = mongoose2; + module2.exports.default = mongoose2; + module2.exports.mongoose = mongoose2; + module2.exports.cast = mongoose2.cast; + module2.exports.STATES = mongoose2.STATES; + module2.exports.setDriver = mongoose2.setDriver; + module2.exports.set = mongoose2.set; + module2.exports.get = mongoose2.get; + module2.exports.createConnection = mongoose2.createConnection; + module2.exports.connect = mongoose2.connect; + module2.exports.disconnect = mongoose2.disconnect; + module2.exports.startSession = mongoose2.startSession; + module2.exports.pluralize = mongoose2.pluralize; + module2.exports.model = mongoose2.model; + module2.exports.deleteModel = mongoose2.deleteModel; + module2.exports.modelNames = mongoose2.modelNames; + module2.exports.plugin = mongoose2.plugin; + module2.exports.connections = mongoose2.connections; + module2.exports.version = mongoose2.version; + module2.exports.Aggregate = mongoose2.Aggregate; + module2.exports.Mongoose = mongoose2.Mongoose; + module2.exports.Schema = mongoose2.Schema; + module2.exports.SchemaType = mongoose2.SchemaType; + module2.exports.SchemaTypes = mongoose2.SchemaTypes; + module2.exports.VirtualType = mongoose2.VirtualType; + module2.exports.Types = mongoose2.Types; + module2.exports.Query = mongoose2.Query; + module2.exports.Model = mongoose2.Model; + module2.exports.Document = mongoose2.Document; + module2.exports.ObjectId = mongoose2.ObjectId; + module2.exports.isValidObjectId = mongoose2.isValidObjectId; + module2.exports.isObjectIdOrHexString = mongoose2.isObjectIdOrHexString; + module2.exports.syncIndexes = mongoose2.syncIndexes; + module2.exports.Decimal128 = mongoose2.Decimal128; + module2.exports.Mixed = mongoose2.Mixed; + module2.exports.Date = mongoose2.Date; + module2.exports.Number = mongoose2.Number; + module2.exports.Error = mongoose2.Error; + module2.exports.MongooseError = mongoose2.MongooseError; + module2.exports.now = mongoose2.now; + module2.exports.CastError = mongoose2.CastError; + module2.exports.SchemaTypeOptions = mongoose2.SchemaTypeOptions; + module2.exports.mongo = mongoose2.mongo; + module2.exports.mquery = mongoose2.mquery; + module2.exports.sanitizeFilter = mongoose2.sanitizeFilter; + module2.exports.trusted = mongoose2.trusted; + module2.exports.skipMiddlewareFunction = mongoose2.skipMiddlewareFunction; + module2.exports.overwriteMiddlewareResult = mongoose2.overwriteMiddlewareResult; + } +}); + +// node_modules/serverless-http/lib/finish.js +var require_finish = __commonJS({ + "node_modules/serverless-http/lib/finish.js"(exports2, module2) { + "use strict"; + module2.exports = async function finish(item, transform, ...details) { + await new Promise((resolve, reject) => { + if (item.finished || item.complete) { + resolve(); + return; + } + let finished = false; + function done(err) { + if (finished) { + return; + } + finished = true; + item.removeListener("error", done); + item.removeListener("end", done); + item.removeListener("finish", done); + if (err) { + reject(err); + } else { + resolve(); + } + } + item.once("error", done); + item.once("end", done); + item.once("finish", done); + }); + if (typeof transform === "function") { + await transform(item, ...details); + } else if (typeof transform === "object" && transform !== null) { + Object.assign(item, transform); + } + return item; + }; + } +}); + +// node_modules/serverless-http/lib/response.js +var require_response2 = __commonJS({ + "node_modules/serverless-http/lib/response.js"(exports2, module2) { + "use strict"; + var http = require("http"); + var headerEnd = "\r\n\r\n"; + var BODY = /* @__PURE__ */ Symbol(); + var HEADERS = /* @__PURE__ */ Symbol(); + function getString(data2) { + if (Buffer.isBuffer(data2)) { + return data2.toString("utf8"); + } else if (typeof data2 === "string") { + return data2; + } else { + throw new Error(`response.write() of unexpected type: ${typeof data2}`); + } + } + function addData(stream, data2) { + if (Buffer.isBuffer(data2) || typeof data2 === "string" || data2 instanceof Uint8Array) { + stream[BODY].push(Buffer.from(data2)); + } else { + throw new Error(`response.write() of unexpected type: ${typeof data2}`); + } + } + module2.exports = class ServerlessResponse extends http.ServerResponse { + static from(res) { + const response = new ServerlessResponse(res); + response.statusCode = res.statusCode; + response[HEADERS] = res.headers; + response[BODY] = [Buffer.from(res.body)]; + response.end(); + return response; + } + static body(res) { + return Buffer.concat(res[BODY]); + } + static headers(res) { + const headers = typeof res.getHeaders === "function" ? res.getHeaders() : res._headers; + return Object.assign(headers, res[HEADERS]); + } + get headers() { + return this[HEADERS]; + } + setHeader(key, value) { + if (this._wroteHeader) { + this[HEADERS][key] = value; + } else { + super.setHeader(key, value); + } + } + writeHead(statusCode, reason, obj) { + const headers = typeof reason === "string" ? obj : reason; + for (const name in headers) { + this.setHeader(name, headers[name]); + if (!this._wroteHeader) { + break; + } + } + super.writeHead(statusCode, reason, obj); + } + constructor({ method }) { + super({ method }); + this[BODY] = []; + this[HEADERS] = {}; + this.useChunkedEncodingByDefault = false; + this.chunkedEncoding = false; + this._header = ""; + this.assignSocket({ + _writableState: {}, + writable: true, + on: Function.prototype, + removeListener: Function.prototype, + destroy: Function.prototype, + cork: Function.prototype, + uncork: Function.prototype, + write: (data2, encoding, cb) => { + if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (this._header === "" || this._wroteHeader) { + addData(this, data2); + } else { + const string = getString(data2); + const index = string.indexOf(headerEnd); + if (index !== -1) { + const remainder = string.slice(index + headerEnd.length); + if (remainder) { + addData(this, remainder); + } + this._wroteHeader = true; + } + } + if (typeof cb === "function") { + cb(); + } + return true; + } + }); + } + }; + } +}); + +// node_modules/serverless-http/lib/framework/get-framework.js +var require_get_framework = __commonJS({ + "node_modules/serverless-http/lib/framework/get-framework.js"(exports2, module2) { + "use strict"; + var http = require("http"); + var Response = require_response2(); + function common(cb) { + return (request) => { + const response = new Response(request); + cb(request, response); + return response; + }; + } + module2.exports = function getFramework(app2) { + if (app2 instanceof http.Server) { + return (request) => { + const response = new Response(request); + app2.emit("request", request, response); + return response; + }; + } + if (typeof app2.callback === "function") { + return common(app2.callback()); + } + if (typeof app2.handle === "function") { + return common((request, response) => { + app2.handle(request, response); + }); + } + if (typeof app2.handler === "function") { + return common((request, response) => { + app2.handler(request, response); + }); + } + if (typeof app2._onRequest === "function") { + return common((request, response) => { + app2._onRequest(request, response); + }); + } + if (typeof app2 === "function") { + return common(app2); + } + if (app2.router && typeof app2.router.route == "function") { + return common((req, res) => { + const { url, method, headers, body } = req; + app2.router.route({ url, method, headers, body }, res); + }); + } + if (app2._core && typeof app2._core._dispatch === "function") { + return common(app2._core._dispatch({ + app: app2 + })); + } + if (typeof app2.inject === "function") { + return async (request) => { + const { method, url, headers, body } = request; + const res = await app2.inject({ method, url, headers, payload: body }); + return Response.from(res); + }; + } + if (typeof app2.main === "function") { + return common(app2.main); + } + throw new Error("Unsupported framework"); + }; + } +}); + +// node_modules/serverless-http/lib/provider/aws/clean-up-event.js +var require_clean_up_event = __commonJS({ + "node_modules/serverless-http/lib/provider/aws/clean-up-event.js"(exports2, module2) { + "use strict"; + function removeBasePath(path = "/", basePath2) { + if (basePath2) { + const basePathIndex = path.indexOf(basePath2); + if (basePathIndex > -1) { + return path.substr(basePathIndex + basePath2.length) || "/"; + } + } + return path; + } + function isString(value) { + return typeof value === "string" || value instanceof String; + } + function specialDecodeURIComponent(value) { + if (!isString(value)) { + return value; + } + let decoded; + try { + decoded = decodeURIComponent(value.replace(/[+]/g, "%20")); + } catch (err) { + decoded = value.replace(/[+]/g, "%20"); + } + return decoded; + } + function recursiveURLDecode(value) { + if (isString(value)) { + return specialDecodeURIComponent(value); + } else if (Array.isArray(value)) { + const decodedArray = []; + for (let index in value) { + decodedArray.push(recursiveURLDecode(value[index])); + } + return decodedArray; + } else if (value instanceof Object) { + const decodedObject = {}; + for (let key of Object.keys(value)) { + decodedObject[specialDecodeURIComponent(key)] = recursiveURLDecode(value[key]); + } + return decodedObject; + } + return value; + } + module2.exports = function cleanupEvent(evt, options) { + const event = evt || {}; + event.requestContext = event.requestContext || {}; + event.body = event.body || ""; + event.headers = event.headers || {}; + if ("elb" in event.requestContext) { + if (event.multiValueQueryStringParameters) { + event.multiValueQueryStringParameters = recursiveURLDecode(event.multiValueQueryStringParameters); + } + if (event.queryStringParameters) { + event.queryStringParameters = recursiveURLDecode(event.queryStringParameters); + } + } + if (event.version === "2.0") { + event.requestContext.authorizer = event.requestContext.authorizer || {}; + event.requestContext.http.method = event.requestContext.http.method || "GET"; + event.rawPath = removeBasePath(event.requestPath || event.rawPath, options.basePath); + } else { + event.requestContext.identity = event.requestContext.identity || {}; + event.httpMethod = event.httpMethod || "GET"; + event.path = removeBasePath(event.requestPath || event.path, options.basePath); + } + return event; + }; + } +}); + +// node_modules/serverless-http/lib/request.js +var require_request2 = __commonJS({ + "node_modules/serverless-http/lib/request.js"(exports2, module2) { + "use strict"; + var http = require("http"); + var { PassThrough } = require("stream"); + module2.exports = class ServerlessRequest extends http.IncomingMessage { + constructor({ method, url, headers, body, remoteAddress }) { + const socket = new PassThrough(); + socket.encrypted = true; + socket.remoteAddress = remoteAddress; + socket.address = () => ({ port: 443 }); + super(socket); + if (typeof headers["content-length"] === "undefined") { + headers["content-length"] = Buffer.byteLength(body); + } + Object.assign(this, { + ip: remoteAddress, + complete: true, + httpVersion: "1.1", + httpVersionMajor: "1", + httpVersionMinor: "1", + method, + headers, + body, + url + }); + this._read = () => { + if (typeof body !== "undefined" && body !== null) { + this.push(body); + } + this.push(null); + }; + if (!body || Buffer.byteLength(body) === 0) { + setImmediate(() => this.emit("end")); + } + } + }; + } +}); + +// node_modules/serverless-http/lib/provider/aws/create-request.js +var require_create_request = __commonJS({ + "node_modules/serverless-http/lib/provider/aws/create-request.js"(exports2, module2) { + "use strict"; + var URL2 = require("url"); + var Request2 = require_request2(); + function requestMethod(event) { + if (event.version === "2.0") { + return event.requestContext.http.method; + } + return event.httpMethod; + } + function requestRemoteAddress(event) { + if (event.version === "2.0") { + return event.requestContext.http.sourceIp; + } + return event.requestContext.identity.sourceIp; + } + function requestHeaders(event) { + const initialHeader = event.version === "2.0" && Array.isArray(event.cookies) ? { cookie: event.cookies.join("; ") } : {}; + if (event.multiValueHeaders) { + Object.keys(event.multiValueHeaders).reduce((headers, key) => { + headers[key.toLowerCase()] = event.multiValueHeaders[key].join(", "); + return headers; + }, initialHeader); + } + return Object.keys(event.headers).reduce((headers, key) => { + headers[key.toLowerCase()] = event.headers[key]; + return headers; + }, initialHeader); + } + function requestBody(event) { + const type = typeof event.body; + if (Buffer.isBuffer(event.body)) { + return event.body; + } else if (type === "string") { + return Buffer.from(event.body, event.isBase64Encoded ? "base64" : "utf8"); + } else if (type === "object") { + return Buffer.from(JSON.stringify(event.body)); + } + throw new Error(`Unexpected event.body type: ${typeof event.body}`); + } + function requestUrl(event) { + if (event.version === "2.0") { + return URL2.format({ + pathname: event.rawPath, + search: event.rawQueryString + }); + } + const query = event.multiValueQueryStringParameters || {}; + if (event.queryStringParameters) { + Object.keys(event.queryStringParameters).forEach((key) => { + if (Array.isArray(query[key])) { + if (!query[key].includes(event.queryStringParameters[key])) { + query[key].push(event.queryStringParameters[key]); + } + } else { + query[key] = [event.queryStringParameters[key]]; + } + }); + } + return URL2.format({ + pathname: event.path, + query + }); + } + module2.exports = (event, context, options) => { + const method = requestMethod(event); + const remoteAddress = requestRemoteAddress(event); + const headers = requestHeaders(event); + const body = requestBody(event); + const url = requestUrl(event); + if (typeof options.requestId === "string" && options.requestId.length > 0) { + const header = options.requestId.toLowerCase(); + const requestId = headers[header] || event.requestContext.requestId; + if (requestId) { + headers[header] = requestId; + } + } + const req = new Request2({ + method, + headers, + body, + remoteAddress, + url + }); + req.requestContext = event.requestContext; + req.apiGateway = { + event, + context + }; + return req; + }; + } +}); + +// node_modules/serverless-http/lib/provider/aws/is-binary.js +var require_is_binary = __commonJS({ + "node_modules/serverless-http/lib/provider/aws/is-binary.js"(exports2, module2) { + "use strict"; + var BINARY_ENCODINGS = ["gzip", "deflate", "br"]; + var BINARY_CONTENT_TYPES = (process.env.BINARY_CONTENT_TYPES || "").split(","); + function isBinaryEncoding(headers) { + const contentEncoding = headers["content-encoding"]; + if (typeof contentEncoding === "string") { + return contentEncoding.split(",").some( + (value) => BINARY_ENCODINGS.some((binaryEncoding) => value.indexOf(binaryEncoding) !== -1) + ); + } + } + function isBinaryContent(headers, options) { + const contentTypes = [].concat( + options.binary ? options.binary : BINARY_CONTENT_TYPES + ).map( + (candidate) => new RegExp(`^${candidate.replace(/\*/g, ".*")}$`) + ); + const contentType = (headers["content-type"] || "").split(";")[0]; + return !!contentType && contentTypes.some((candidate) => candidate.test(contentType)); + } + module2.exports = function isBinary(headers, options) { + if (options.binary === false) { + return false; + } + if (options.binary === true) { + return true; + } + if (typeof options.binary === "function") { + return options.binary(headers); + } + return isBinaryEncoding(headers) || isBinaryContent(headers, options); + }; + } +}); + +// node_modules/serverless-http/lib/provider/aws/sanitize-headers.js +var require_sanitize_headers = __commonJS({ + "node_modules/serverless-http/lib/provider/aws/sanitize-headers.js"(exports2, module2) { + "use strict"; + module2.exports = function sanitizeHeaders(headers) { + return Object.keys(headers).reduce((memo, key) => { + const value = headers[key]; + if (Array.isArray(value)) { + memo.multiValueHeaders[key] = value; + if (key.toLowerCase() !== "set-cookie") { + memo.headers[key] = value.join(", "); + } + } else { + memo.headers[key] = value == null ? "" : value.toString(); + } + return memo; + }, { + headers: {}, + multiValueHeaders: {} + }); + }; + } +}); + +// node_modules/serverless-http/lib/provider/aws/get-event-type.js +var require_get_event_type = __commonJS({ + "node_modules/serverless-http/lib/provider/aws/get-event-type.js"(exports2, module2) { + var HTTP_API_V1 = "HTTP_API_V1"; + var HTTP_API_V2 = "HTTP_API_V2"; + var ALB = "ALB"; + var LAMBDA_EVENT_TYPES = { + HTTP_API_V1, + HTTP_API_V2, + ALB + }; + var getEventType = (event) => { + if (event.requestContext && event.requestContext.elb) { + return ALB; + } else if (event.version === "2.0") { + return HTTP_API_V2; + } else { + return HTTP_API_V1; + } + }; + module2.exports = { + getEventType, + LAMBDA_EVENT_TYPES + }; + } +}); + +// node_modules/serverless-http/lib/provider/aws/format-response.js +var require_format_response = __commonJS({ + "node_modules/serverless-http/lib/provider/aws/format-response.js"(exports2, module2) { + "use strict"; + var isBinary = require_is_binary(); + var Response = require_response2(); + var sanitizeHeaders = require_sanitize_headers(); + var { getEventType, LAMBDA_EVENT_TYPES } = require_get_event_type(); + var combineHeaders = (headers, multiValueHeaders) => { + return Object.entries(headers).reduce((memo, [key, value]) => { + if (multiValueHeaders[key]) { + memo[key].push(value); + } else { + memo[key] = [value]; + } + return memo; + }, multiValueHeaders); + }; + module2.exports = (event, response, options) => { + const eventType = getEventType(event); + const { statusCode } = response; + const { headers, multiValueHeaders } = sanitizeHeaders(Response.headers(response)); + let cookies = []; + if (multiValueHeaders["set-cookie"]) { + cookies = multiValueHeaders["set-cookie"]; + } + const isBase64Encoded = isBinary(headers, options); + const encoding = isBase64Encoded ? "base64" : "utf8"; + let body = Response.body(response).toString(encoding); + if (headers["transfer-encoding"] === "chunked" || response.chunkedEncoding) { + const raw = Response.body(response).toString().split("\r\n"); + const parsed = []; + for (let i4 = 0; i4 < raw.length; i4 += 2) { + const size = parseInt(raw[i4], 16); + const value = raw[i4 + 1]; + if (value) { + parsed.push(value.substring(0, size)); + } + } + body = parsed.join(""); + } + if (eventType === LAMBDA_EVENT_TYPES.ALB) { + const albResponse = { statusCode, isBase64Encoded, body }; + if (event.multiValueHeaders) { + albResponse.multiValueHeaders = combineHeaders(headers, multiValueHeaders); + } else { + albResponse.headers = headers; + } + return albResponse; + } + if (eventType === LAMBDA_EVENT_TYPES.HTTP_API_V2) { + return { statusCode, isBase64Encoded, body, headers, cookies }; + } + return { statusCode, isBase64Encoded, body, headers, multiValueHeaders }; + }; + } +}); + +// node_modules/serverless-http/lib/provider/aws/index.js +var require_aws2 = __commonJS({ + "node_modules/serverless-http/lib/provider/aws/index.js"(exports2, module2) { + var cleanUpEvent = require_clean_up_event(); + var createRequest = require_create_request(); + var formatResponse = require_format_response(); + module2.exports = (options) => { + return (getResponse) => async (event_, context = {}) => { + const event = cleanUpEvent(event_, options); + const request = createRequest(event, context, options); + const response = await getResponse(request, event, context); + return formatResponse(event, response, options); + }; + }; + } +}); + +// node_modules/serverless-http/lib/provider/azure/clean-up-request.js +var require_clean_up_request = __commonJS({ + "node_modules/serverless-http/lib/provider/azure/clean-up-request.js"(exports2, module2) { + "use strict"; + function getUrl({ requestPath, url }) { + if (requestPath) { + return requestPath; + } + return typeof url === "string" ? url : "/"; + } + function getRequestContext(request) { + const requestContext = {}; + requestContext.identity = {}; + const forwardedIp = request.headers["x-forwarded-for"]; + const clientIp = request.headers["client-ip"]; + const ip = forwardedIp ? forwardedIp : clientIp ? clientIp : ""; + if (ip) { + requestContext.identity.sourceIp = ip.split(":")[0]; + } + return requestContext; + } + module2.exports = function cleanupRequest(req, options) { + const request = req || {}; + request.requestContext = getRequestContext(req); + request.method = request.method || "GET"; + request.url = getUrl(request); + request.body = request.body || ""; + request.headers = request.headers || {}; + if (options.basePath) { + const basePathIndex = request.url.indexOf(options.basePath); + if (basePathIndex > -1) { + request.url = request.url.substr(basePathIndex + options.basePath.length); + } + } + return request; + }; + } +}); + +// node_modules/serverless-http/lib/provider/azure/create-request.js +var require_create_request2 = __commonJS({ + "node_modules/serverless-http/lib/provider/azure/create-request.js"(exports2, module2) { + "use strict"; + var url = require("url"); + var Request2 = require_request2(); + function requestHeaders(request) { + return Object.keys(request.headers).reduce((headers, key) => { + headers[key.toLowerCase()] = request.headers[key]; + return headers; + }, {}); + } + function requestBody(request) { + const type = typeof request.rawBody; + if (Buffer.isBuffer(request.rawBody)) { + return request.rawBody; + } else if (type === "string") { + return Buffer.from(request.rawBody, "utf8"); + } else if (type === "object") { + return Buffer.from(JSON.stringify(request.rawBody)); + } + throw new Error(`Unexpected request.body type: ${typeof request.rawBody}`); + } + module2.exports = (request) => { + const method = request.method; + const query = request.query; + const headers = requestHeaders(request); + const body = requestBody(request); + const req = new Request2({ + method, + headers, + body, + url: url.format({ + pathname: request.url, + query + }) + }); + req.requestContext = request.requestContext; + return req; + }; + } +}); + +// node_modules/serverless-http/lib/provider/azure/is-binary.js +var require_is_binary2 = __commonJS({ + "node_modules/serverless-http/lib/provider/azure/is-binary.js"(exports2, module2) { + "use strict"; + var BINARY_ENCODINGS = ["gzip", "deflate", "br"]; + var BINARY_CONTENT_TYPES = (process.env.BINARY_CONTENT_TYPES || "").split(","); + function isBinaryEncoding(headers) { + const contentEncoding = headers["content-encoding"]; + if (typeof contentEncoding === "string") { + return contentEncoding.split(",").some( + (value) => BINARY_ENCODINGS.some((binaryEncoding) => value.indexOf(binaryEncoding) !== -1) + ); + } + } + function isBinaryContent(headers, options) { + const contentTypes = [].concat( + options.binary ? options.binary : BINARY_CONTENT_TYPES + ).map( + (candidate) => new RegExp(`^${candidate.replace(/\*/g, ".*")}$`) + ); + const contentType = (headers["content-type"] || "").split(";")[0]; + return !!contentType && contentTypes.some((candidate) => candidate.test(contentType)); + } + module2.exports = function isBinary(headers, options) { + if (options.binary === false) { + return false; + } + if (options.binary === true) { + return true; + } + if (typeof options.binary === "function") { + return options.binary(headers); + } + return isBinaryEncoding(headers) || isBinaryContent(headers, options); + }; + } +}); + +// node_modules/serverless-http/lib/provider/azure/set-cookie.json +var require_set_cookie = __commonJS({ + "node_modules/serverless-http/lib/provider/azure/set-cookie.json"(exports2, module2) { + module2.exports = { variations: ["set-cookie", "Set-cookie", "sEt-cookie", "SEt-cookie", "seT-cookie", "SeT-cookie", "sET-cookie", "SET-cookie", "set-Cookie", "Set-Cookie", "sEt-Cookie", "SEt-Cookie", "seT-Cookie", "SeT-Cookie", "sET-Cookie", "SET-Cookie", "set-cOokie", "Set-cOokie", "sEt-cOokie", "SEt-cOokie", "seT-cOokie", "SeT-cOokie", "sET-cOokie", "SET-cOokie", "set-COokie", "Set-COokie", "sEt-COokie", "SEt-COokie", "seT-COokie", "SeT-COokie", "sET-COokie", "SET-COokie", "set-coOkie", "Set-coOkie", "sEt-coOkie", "SEt-coOkie", "seT-coOkie", "SeT-coOkie", "sET-coOkie", "SET-coOkie", "set-CoOkie", "Set-CoOkie", "sEt-CoOkie", "SEt-CoOkie", "seT-CoOkie", "SeT-CoOkie", "sET-CoOkie", "SET-CoOkie", "set-cOOkie", "Set-cOOkie", "sEt-cOOkie", "SEt-cOOkie", "seT-cOOkie", "SeT-cOOkie", "sET-cOOkie", "SET-cOOkie", "set-COOkie", "Set-COOkie", "sEt-COOkie", "SEt-COOkie", "seT-COOkie", "SeT-COOkie", "sET-COOkie", "SET-COOkie", "set-cooKie", "Set-cooKie", "sEt-cooKie", "SEt-cooKie", "seT-cooKie", "SeT-cooKie", "sET-cooKie", "SET-cooKie", "set-CooKie", "Set-CooKie", "sEt-CooKie", "SEt-CooKie", "seT-CooKie", "SeT-CooKie", "sET-CooKie", "SET-CooKie", "set-cOoKie", "Set-cOoKie", "sEt-cOoKie", "SEt-cOoKie", "seT-cOoKie", "SeT-cOoKie", "sET-cOoKie", "SET-cOoKie", "set-COoKie", "Set-COoKie", "sEt-COoKie", "SEt-COoKie", "seT-COoKie", "SeT-COoKie", "sET-COoKie", "SET-COoKie", "set-coOKie", "Set-coOKie", "sEt-coOKie", "SEt-coOKie", "seT-coOKie", "SeT-coOKie", "sET-coOKie", "SET-coOKie", "set-CoOKie", "Set-CoOKie", "sEt-CoOKie", "SEt-CoOKie", "seT-CoOKie", "SeT-CoOKie", "sET-CoOKie", "SET-CoOKie", "set-cOOKie", "Set-cOOKie", "sEt-cOOKie", "SEt-cOOKie", "seT-cOOKie", "SeT-cOOKie", "sET-cOOKie", "SET-cOOKie", "set-COOKie", "Set-COOKie", "sEt-COOKie", "SEt-COOKie", "seT-COOKie", "SeT-COOKie", "sET-COOKie", "SET-COOKie", "set-cookIe", "Set-cookIe", "sEt-cookIe", "SEt-cookIe", "seT-cookIe", "SeT-cookIe", "sET-cookIe", "SET-cookIe", "set-CookIe", "Set-CookIe", "sEt-CookIe", "SEt-CookIe", "seT-CookIe", "SeT-CookIe", "sET-CookIe", "SET-CookIe", "set-cOokIe", "Set-cOokIe", "sEt-cOokIe", "SEt-cOokIe", "seT-cOokIe", "SeT-cOokIe", "sET-cOokIe", "SET-cOokIe", "set-COokIe", "Set-COokIe", "sEt-COokIe", "SEt-COokIe", "seT-COokIe", "SeT-COokIe", "sET-COokIe", "SET-COokIe", "set-coOkIe", "Set-coOkIe", "sEt-coOkIe", "SEt-coOkIe", "seT-coOkIe", "SeT-coOkIe", "sET-coOkIe", "SET-coOkIe", "set-CoOkIe", "Set-CoOkIe", "sEt-CoOkIe", "SEt-CoOkIe", "seT-CoOkIe", "SeT-CoOkIe", "sET-CoOkIe", "SET-CoOkIe", "set-cOOkIe", "Set-cOOkIe", "sEt-cOOkIe", "SEt-cOOkIe", "seT-cOOkIe", "SeT-cOOkIe", "sET-cOOkIe", "SET-cOOkIe", "set-COOkIe", "Set-COOkIe", "sEt-COOkIe", "SEt-COOkIe", "seT-COOkIe", "SeT-COOkIe", "sET-COOkIe", "SET-COOkIe", "set-cooKIe", "Set-cooKIe", "sEt-cooKIe", "SEt-cooKIe", "seT-cooKIe", "SeT-cooKIe", "sET-cooKIe", "SET-cooKIe", "set-CooKIe", "Set-CooKIe", "sEt-CooKIe", "SEt-CooKIe", "seT-CooKIe", "SeT-CooKIe", "sET-CooKIe", "SET-CooKIe", "set-cOoKIe", "Set-cOoKIe", "sEt-cOoKIe", "SEt-cOoKIe", "seT-cOoKIe", "SeT-cOoKIe", "sET-cOoKIe", "SET-cOoKIe", "set-COoKIe", "Set-COoKIe", "sEt-COoKIe", "SEt-COoKIe", "seT-COoKIe", "SeT-COoKIe", "sET-COoKIe", "SET-COoKIe", "set-coOKIe", "Set-coOKIe", "sEt-coOKIe", "SEt-coOKIe", "seT-coOKIe", "SeT-coOKIe", "sET-coOKIe", "SET-coOKIe", "set-CoOKIe", "Set-CoOKIe", "sEt-CoOKIe", "SEt-CoOKIe", "seT-CoOKIe", "SeT-CoOKIe", "sET-CoOKIe", "SET-CoOKIe", "set-cOOKIe", "Set-cOOKIe", "sEt-cOOKIe", "SEt-cOOKIe", "seT-cOOKIe", "SeT-cOOKIe", "sET-cOOKIe", "SET-cOOKIe", "set-COOKIe", "Set-COOKIe", "sEt-COOKIe", "SEt-COOKIe", "seT-COOKIe", "SeT-COOKIe", "sET-COOKIe", "SET-COOKIe", "set-cookiE", "Set-cookiE", "sEt-cookiE", "SEt-cookiE", "seT-cookiE", "SeT-cookiE", "sET-cookiE", "SET-cookiE", "set-CookiE", "Set-CookiE", "sEt-CookiE", "SEt-CookiE", "seT-CookiE", "SeT-CookiE", "sET-CookiE", "SET-CookiE", "set-cOokiE", "Set-cOokiE", "sEt-cOokiE", "SEt-cOokiE", "seT-cOokiE", "SeT-cOokiE", "sET-cOokiE", "SET-cOokiE", "set-COokiE", "Set-COokiE", "sEt-COokiE", "SEt-COokiE", "seT-COokiE", "SeT-COokiE", "sET-COokiE", "SET-COokiE", "set-coOkiE", "Set-coOkiE", "sEt-coOkiE", "SEt-coOkiE", "seT-coOkiE", "SeT-coOkiE", "sET-coOkiE", "SET-coOkiE", "set-CoOkiE", "Set-CoOkiE", "sEt-CoOkiE", "SEt-CoOkiE", "seT-CoOkiE", "SeT-CoOkiE", "sET-CoOkiE", "SET-CoOkiE", "set-cOOkiE", "Set-cOOkiE", "sEt-cOOkiE", "SEt-cOOkiE", "seT-cOOkiE", "SeT-cOOkiE", "sET-cOOkiE", "SET-cOOkiE", "set-COOkiE", "Set-COOkiE", "sEt-COOkiE", "SEt-COOkiE", "seT-COOkiE", "SeT-COOkiE", "sET-COOkiE", "SET-COOkiE", "set-cooKiE", "Set-cooKiE", "sEt-cooKiE", "SEt-cooKiE", "seT-cooKiE", "SeT-cooKiE", "sET-cooKiE", "SET-cooKiE", "set-CooKiE", "Set-CooKiE", "sEt-CooKiE", "SEt-CooKiE", "seT-CooKiE", "SeT-CooKiE", "sET-CooKiE", "SET-CooKiE", "set-cOoKiE", "Set-cOoKiE", "sEt-cOoKiE", "SEt-cOoKiE", "seT-cOoKiE", "SeT-cOoKiE", "sET-cOoKiE", "SET-cOoKiE", "set-COoKiE", "Set-COoKiE", "sEt-COoKiE", "SEt-COoKiE", "seT-COoKiE", "SeT-COoKiE", "sET-COoKiE", "SET-COoKiE", "set-coOKiE", "Set-coOKiE", "sEt-coOKiE", "SEt-coOKiE", "seT-coOKiE", "SeT-coOKiE", "sET-coOKiE", "SET-coOKiE", "set-CoOKiE", "Set-CoOKiE", "sEt-CoOKiE", "SEt-CoOKiE", "seT-CoOKiE", "SeT-CoOKiE", "sET-CoOKiE", "SET-CoOKiE", "set-cOOKiE", "Set-cOOKiE", "sEt-cOOKiE", "SEt-cOOKiE", "seT-cOOKiE", "SeT-cOOKiE", "sET-cOOKiE", "SET-cOOKiE", "set-COOKiE", "Set-COOKiE", "sEt-COOKiE", "SEt-COOKiE", "seT-COOKiE", "SeT-COOKiE", "sET-COOKiE", "SET-COOKiE", "set-cookIE", "Set-cookIE", "sEt-cookIE", "SEt-cookIE", "seT-cookIE", "SeT-cookIE", "sET-cookIE", "SET-cookIE", "set-CookIE", "Set-CookIE", "sEt-CookIE", "SEt-CookIE", "seT-CookIE", "SeT-CookIE", "sET-CookIE", "SET-CookIE", "set-cOokIE", "Set-cOokIE", "sEt-cOokIE", "SEt-cOokIE", "seT-cOokIE", "SeT-cOokIE", "sET-cOokIE", "SET-cOokIE", "set-COokIE", "Set-COokIE", "sEt-COokIE", "SEt-COokIE", "seT-COokIE", "SeT-COokIE", "sET-COokIE", "SET-COokIE", "set-coOkIE", "Set-coOkIE", "sEt-coOkIE", "SEt-coOkIE", "seT-coOkIE", "SeT-coOkIE", "sET-coOkIE", "SET-coOkIE", "set-CoOkIE", "Set-CoOkIE", "sEt-CoOkIE", "SEt-CoOkIE", "seT-CoOkIE", "SeT-CoOkIE", "sET-CoOkIE", "SET-CoOkIE", "set-cOOkIE", "Set-cOOkIE", "sEt-cOOkIE", "SEt-cOOkIE", "seT-cOOkIE", "SeT-cOOkIE", "sET-cOOkIE", "SET-cOOkIE", "set-COOkIE", "Set-COOkIE", "sEt-COOkIE", "SEt-COOkIE", "seT-COOkIE", "SeT-COOkIE", "sET-COOkIE", "SET-COOkIE", "set-cooKIE", "Set-cooKIE", "sEt-cooKIE", "SEt-cooKIE", "seT-cooKIE", "SeT-cooKIE", "sET-cooKIE", "SET-cooKIE", "set-CooKIE", "Set-CooKIE", "sEt-CooKIE", "SEt-CooKIE", "seT-CooKIE", "SeT-CooKIE", "sET-CooKIE", "SET-CooKIE", "set-cOoKIE", "Set-cOoKIE", "sEt-cOoKIE", "SEt-cOoKIE", "seT-cOoKIE", "SeT-cOoKIE", "sET-cOoKIE", "SET-cOoKIE", "set-COoKIE", "Set-COoKIE", "sEt-COoKIE", "SEt-COoKIE", "seT-COoKIE", "SeT-COoKIE", "sET-COoKIE", "SET-COoKIE", "set-coOKIE", "Set-coOKIE", "sEt-coOKIE", "SEt-coOKIE", "seT-coOKIE", "SeT-coOKIE", "sET-coOKIE", "SET-coOKIE", "set-CoOKIE", "Set-CoOKIE", "sEt-CoOKIE", "SEt-CoOKIE", "seT-CoOKIE", "SeT-CoOKIE", "sET-CoOKIE", "SET-CoOKIE", "set-cOOKIE", "Set-cOOKIE", "sEt-cOOKIE", "SEt-cOOKIE", "seT-cOOKIE", "SeT-cOOKIE", "sET-cOOKIE", "SET-cOOKIE", "set-COOKIE", "Set-COOKIE", "sEt-COOKIE", "SEt-COOKIE", "seT-COOKIE", "SeT-COOKIE", "sET-COOKIE", "SET-COOKIE"] }; + } +}); + +// node_modules/serverless-http/lib/provider/azure/sanitize-headers.js +var require_sanitize_headers2 = __commonJS({ + "node_modules/serverless-http/lib/provider/azure/sanitize-headers.js"(exports2, module2) { + "use strict"; + var setCookieVariations = require_set_cookie().variations; + module2.exports = function sanitizeHeaders(headers) { + return Object.keys(headers).reduce((memo, key) => { + const value = headers[key]; + if (Array.isArray(value)) { + if (key.toLowerCase() === "set-cookie") { + value.forEach((cookie, i4) => { + memo[setCookieVariations[i4]] = cookie; + }); + } else { + memo[key] = value.join(", "); + } + } else { + memo[key] = value == null ? "" : value.toString(); + } + return memo; + }, {}); + }; + } +}); + +// node_modules/serverless-http/lib/provider/azure/format-response.js +var require_format_response2 = __commonJS({ + "node_modules/serverless-http/lib/provider/azure/format-response.js"(exports2, module2) { + var isBinary = require_is_binary2(); + var Response = require_response2(); + var sanitizeHeaders = require_sanitize_headers2(); + module2.exports = (response, options) => { + const { statusCode } = response; + const headers = sanitizeHeaders(Response.headers(response)); + if (headers["transfer-encoding"] === "chunked" || response.chunkedEncoding) { + throw new Error("chunked encoding not supported"); + } + const isBase64Encoded = isBinary(headers, options); + const encoding = isBase64Encoded ? "base64" : "utf8"; + const body = Response.body(response).toString(encoding); + return { status: statusCode, headers, isBase64Encoded, body }; + }; + } +}); + +// node_modules/serverless-http/lib/provider/azure/index.js +var require_azure2 = __commonJS({ + "node_modules/serverless-http/lib/provider/azure/index.js"(exports2, module2) { + var cleanupRequest = require_clean_up_request(); + var createRequest = require_create_request2(); + var formatResponse = require_format_response2(); + module2.exports = (options) => { + return (getResponse) => async (context, req) => { + const event = cleanupRequest(req, options); + const request = createRequest(event, options); + const response = await getResponse(request, context, event); + context.log(response); + return formatResponse(response, options); + }; + }; + } +}); + +// node_modules/serverless-http/lib/provider/get-provider.js +var require_get_provider = __commonJS({ + "node_modules/serverless-http/lib/provider/get-provider.js"(exports2, module2) { + var aws = require_aws2(); + var azure = require_azure2(); + var providers = { + aws, + azure + }; + module2.exports = function getProvider(options) { + const { provider = "aws" } = options; + if (provider in providers) { + return providers[provider](options); + } + throw new Error(`Unsupported provider ${provider}`); + }; + } +}); + +// node_modules/serverless-http/serverless-http.js +var require_serverless_http = __commonJS({ + "node_modules/serverless-http/serverless-http.js"(exports2, module2) { + "use strict"; + var finish = require_finish(); + var getFramework = require_get_framework(); + var getProvider = require_get_provider(); + var defaultOptions = { + requestId: "x-request-id" + }; + module2.exports = function(app2, opts) { + const options = Object.assign({}, defaultOptions, opts); + const framework = getFramework(app2); + const provider = getProvider(options); + return provider(async (request, ...context) => { + await finish(request, options.request, ...context); + const response = await framework(request); + await finish(response, options.response, ...context); + response.emit("close"); + return response; + }); + }; + } +}); + +// config/db.connect.js +var require_db_connect = __commonJS({ + "config/db.connect.js"(exports2, module2) { + var mongoose2 = require_mongoose2(); + var isConnected = false; + var connectionPromise = null; + var connectDB2 = async () => { + if (isConnected) { + console.log("Using existing MongoDB connection"); + return; + } + if (connectionPromise) { + console.log("Waiting for existing connection attempt..."); + await connectionPromise; + return; + } + console.log("Connecting to MongoDB..."); + connectionPromise = mongoose2.connect(process.env.DATABASE_URI, { + serverSelectionTimeoutMS: 5e3, + socketTimeoutMS: 45e3 + }).then((db) => { + isConnected = db.connections[0].readyState === 1; + console.log("MongoDB connected successfully"); + return db; + }).catch((error2) => { + isConnected = false; + connectionPromise = null; + console.error("MongoDB connection error:", error2); + throw error2; + }); + await connectionPromise; + }; + module2.exports = connectDB2; + } +}); + +// node_modules/jws/lib/data-stream.js +var require_data_stream = __commonJS({ + "node_modules/jws/lib/data-stream.js"(exports2, module2) { + var Buffer2 = require_safe_buffer().Buffer; + var Stream = require("stream"); + var util = require("util"); + function DataStream(data2) { + this.buffer = null; + this.writable = true; + this.readable = true; + if (!data2) { + this.buffer = Buffer2.alloc(0); + return this; + } + if (typeof data2.pipe === "function") { + this.buffer = Buffer2.alloc(0); + data2.pipe(this); + return this; + } + if (data2.length || typeof data2 === "object") { + this.buffer = data2; + this.writable = false; + process.nextTick(function() { + this.emit("end", data2); + this.readable = false; + this.emit("close"); + }.bind(this)); + return this; + } + throw new TypeError("Unexpected data type (" + typeof data2 + ")"); + } + util.inherits(DataStream, Stream); + DataStream.prototype.write = function write(data2) { + this.buffer = Buffer2.concat([this.buffer, Buffer2.from(data2)]); + this.emit("data", data2); + }; + DataStream.prototype.end = function end(data2) { + if (data2) + this.write(data2); + this.emit("end", data2); + this.emit("close"); + this.writable = false; + this.readable = false; + }; + module2.exports = DataStream; + } +}); + +// node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js +var require_param_bytes_for_alg = __commonJS({ + "node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js"(exports2, module2) { + "use strict"; + function getParamSize(keySize) { + var result = (keySize / 8 | 0) + (keySize % 8 === 0 ? 0 : 1); + return result; + } + var paramBytesForAlg = { + ES256: getParamSize(256), + ES384: getParamSize(384), + ES512: getParamSize(521) + }; + function getParamBytesForAlg(alg) { + var paramBytes = paramBytesForAlg[alg]; + if (paramBytes) { + return paramBytes; + } + throw new Error('Unknown algorithm "' + alg + '"'); + } + module2.exports = getParamBytesForAlg; + } +}); + +// node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js +var require_ecdsa_sig_formatter = __commonJS({ + "node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js"(exports2, module2) { + "use strict"; + var Buffer2 = require_safe_buffer().Buffer; + var getParamBytesForAlg = require_param_bytes_for_alg(); + var MAX_OCTET = 128; + var CLASS_UNIVERSAL = 0; + var PRIMITIVE_BIT = 32; + var TAG_SEQ = 16; + var TAG_INT = 2; + var ENCODED_TAG_SEQ = TAG_SEQ | PRIMITIVE_BIT | CLASS_UNIVERSAL << 6; + var ENCODED_TAG_INT = TAG_INT | CLASS_UNIVERSAL << 6; + function base64Url(base64) { + return base64.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); + } + function signatureAsBuffer(signature) { + if (Buffer2.isBuffer(signature)) { + return signature; + } else if ("string" === typeof signature) { + return Buffer2.from(signature, "base64"); + } + throw new TypeError("ECDSA signature must be a Base64 string or a Buffer"); + } + function derToJose(signature, alg) { + signature = signatureAsBuffer(signature); + var paramBytes = getParamBytesForAlg(alg); + var maxEncodedParamLength = paramBytes + 1; + var inputLength = signature.length; + var offset = 0; + if (signature[offset++] !== ENCODED_TAG_SEQ) { + throw new Error('Could not find expected "seq"'); + } + var seqLength = signature[offset++]; + if (seqLength === (MAX_OCTET | 1)) { + seqLength = signature[offset++]; + } + if (inputLength - offset < seqLength) { + throw new Error('"seq" specified length of "' + seqLength + '", only "' + (inputLength - offset) + '" remaining'); + } + if (signature[offset++] !== ENCODED_TAG_INT) { + throw new Error('Could not find expected "int" for "r"'); + } + var rLength = signature[offset++]; + if (inputLength - offset - 2 < rLength) { + throw new Error('"r" specified length of "' + rLength + '", only "' + (inputLength - offset - 2) + '" available'); + } + if (maxEncodedParamLength < rLength) { + throw new Error('"r" specified length of "' + rLength + '", max of "' + maxEncodedParamLength + '" is acceptable'); + } + var rOffset = offset; + offset += rLength; + if (signature[offset++] !== ENCODED_TAG_INT) { + throw new Error('Could not find expected "int" for "s"'); + } + var sLength = signature[offset++]; + if (inputLength - offset !== sLength) { + throw new Error('"s" specified length of "' + sLength + '", expected "' + (inputLength - offset) + '"'); + } + if (maxEncodedParamLength < sLength) { + throw new Error('"s" specified length of "' + sLength + '", max of "' + maxEncodedParamLength + '" is acceptable'); + } + var sOffset = offset; + offset += sLength; + if (offset !== inputLength) { + throw new Error('Expected to consume entire buffer, but "' + (inputLength - offset) + '" bytes remain'); + } + var rPadding = paramBytes - rLength, sPadding = paramBytes - sLength; + var dst = Buffer2.allocUnsafe(rPadding + rLength + sPadding + sLength); + for (offset = 0; offset < rPadding; ++offset) { + dst[offset] = 0; + } + signature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength); + offset = paramBytes; + for (var o4 = offset; offset < o4 + sPadding; ++offset) { + dst[offset] = 0; + } + signature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength); + dst = dst.toString("base64"); + dst = base64Url(dst); + return dst; + } + function countPadding(buf, start, stop) { + var padding = 0; + while (start + padding < stop && buf[start + padding] === 0) { + ++padding; + } + var needsSign = buf[start + padding] >= MAX_OCTET; + if (needsSign) { + --padding; + } + return padding; + } + function joseToDer(signature, alg) { + signature = signatureAsBuffer(signature); + var paramBytes = getParamBytesForAlg(alg); + var signatureBytes = signature.length; + if (signatureBytes !== paramBytes * 2) { + throw new TypeError('"' + alg + '" signatures must be "' + paramBytes * 2 + '" bytes, saw "' + signatureBytes + '"'); + } + var rPadding = countPadding(signature, 0, paramBytes); + var sPadding = countPadding(signature, paramBytes, signature.length); + var rLength = paramBytes - rPadding; + var sLength = paramBytes - sPadding; + var rsBytes = 1 + 1 + rLength + 1 + 1 + sLength; + var shortLength = rsBytes < MAX_OCTET; + var dst = Buffer2.allocUnsafe((shortLength ? 2 : 3) + rsBytes); + var offset = 0; + dst[offset++] = ENCODED_TAG_SEQ; + if (shortLength) { + dst[offset++] = rsBytes; + } else { + dst[offset++] = MAX_OCTET | 1; + dst[offset++] = rsBytes & 255; + } + dst[offset++] = ENCODED_TAG_INT; + dst[offset++] = rLength; + if (rPadding < 0) { + dst[offset++] = 0; + offset += signature.copy(dst, offset, 0, paramBytes); + } else { + offset += signature.copy(dst, offset, rPadding, paramBytes); + } + dst[offset++] = ENCODED_TAG_INT; + dst[offset++] = sLength; + if (sPadding < 0) { + dst[offset++] = 0; + signature.copy(dst, offset, paramBytes); + } else { + signature.copy(dst, offset, paramBytes + sPadding); + } + return dst; + } + module2.exports = { + derToJose, + joseToDer + }; + } +}); + +// node_modules/buffer-equal-constant-time/index.js +var require_buffer_equal_constant_time = __commonJS({ + "node_modules/buffer-equal-constant-time/index.js"(exports2, module2) { + "use strict"; + var Buffer2 = require("buffer").Buffer; + var SlowBuffer = require("buffer").SlowBuffer; + module2.exports = bufferEq; + function bufferEq(a4, b4) { + if (!Buffer2.isBuffer(a4) || !Buffer2.isBuffer(b4)) { + return false; + } + if (a4.length !== b4.length) { + return false; + } + var c4 = 0; + for (var i4 = 0; i4 < a4.length; i4++) { + c4 |= a4[i4] ^ b4[i4]; + } + return c4 === 0; + } + bufferEq.install = function() { + Buffer2.prototype.equal = SlowBuffer.prototype.equal = function equal(that) { + return bufferEq(this, that); + }; + }; + var origBufEqual = Buffer2.prototype.equal; + var origSlowBufEqual = SlowBuffer.prototype.equal; + bufferEq.restore = function() { + Buffer2.prototype.equal = origBufEqual; + SlowBuffer.prototype.equal = origSlowBufEqual; + }; + } +}); + +// node_modules/jwa/index.js +var require_jwa = __commonJS({ + "node_modules/jwa/index.js"(exports2, module2) { + var Buffer2 = require_safe_buffer().Buffer; + var crypto2 = require("crypto"); + var formatEcdsa = require_ecdsa_sig_formatter(); + var util = require("util"); + var MSG_INVALID_ALGORITHM = '"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".'; + var MSG_INVALID_SECRET = "secret must be a string or buffer"; + var MSG_INVALID_VERIFIER_KEY = "key must be a string or a buffer"; + var MSG_INVALID_SIGNER_KEY = "key must be a string, a buffer or an object"; + var supportsKeyObjects = typeof crypto2.createPublicKey === "function"; + if (supportsKeyObjects) { + MSG_INVALID_VERIFIER_KEY += " or a KeyObject"; + MSG_INVALID_SECRET += "or a KeyObject"; + } + function checkIsPublicKey(key) { + if (Buffer2.isBuffer(key)) { + return; + } + if (typeof key === "string") { + return; + } + if (!supportsKeyObjects) { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } + if (typeof key !== "object") { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } + if (typeof key.type !== "string") { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } + if (typeof key.asymmetricKeyType !== "string") { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } + if (typeof key.export !== "function") { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } + } + function checkIsPrivateKey(key) { + if (Buffer2.isBuffer(key)) { + return; + } + if (typeof key === "string") { + return; + } + if (typeof key === "object") { + return; + } + throw typeError(MSG_INVALID_SIGNER_KEY); + } + function checkIsSecretKey(key) { + if (Buffer2.isBuffer(key)) { + return; + } + if (typeof key === "string") { + return key; + } + if (!supportsKeyObjects) { + throw typeError(MSG_INVALID_SECRET); + } + if (typeof key !== "object") { + throw typeError(MSG_INVALID_SECRET); + } + if (key.type !== "secret") { + throw typeError(MSG_INVALID_SECRET); + } + if (typeof key.export !== "function") { + throw typeError(MSG_INVALID_SECRET); + } + } + function fromBase648(base64) { + return base64.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); + } + function toBase648(base64url) { + base64url = base64url.toString(); + var padding = 4 - base64url.length % 4; + if (padding !== 4) { + for (var i4 = 0; i4 < padding; ++i4) { + base64url += "="; + } + } + return base64url.replace(/\-/g, "+").replace(/_/g, "/"); + } + function typeError(template) { + var args2 = [].slice.call(arguments, 1); + var errMsg = util.format.bind(util, template).apply(null, args2); + return new TypeError(errMsg); + } + function bufferOrString(obj) { + return Buffer2.isBuffer(obj) || typeof obj === "string"; + } + function normalizeInput(thing) { + if (!bufferOrString(thing)) + thing = JSON.stringify(thing); + return thing; + } + function createHmacSigner(bits) { + return function sign(thing, secret) { + checkIsSecretKey(secret); + thing = normalizeInput(thing); + var hmac = crypto2.createHmac("sha" + bits, secret); + var sig = (hmac.update(thing), hmac.digest("base64")); + return fromBase648(sig); + }; + } + var bufferEqual; + var timingSafeEqual = "timingSafeEqual" in crypto2 ? function timingSafeEqual2(a4, b4) { + if (a4.byteLength !== b4.byteLength) { + return false; + } + return crypto2.timingSafeEqual(a4, b4); + } : function timingSafeEqual2(a4, b4) { + if (!bufferEqual) { + bufferEqual = require_buffer_equal_constant_time(); + } + return bufferEqual(a4, b4); + }; + function createHmacVerifier(bits) { + return function verify(thing, signature, secret) { + var computedSig = createHmacSigner(bits)(thing, secret); + return timingSafeEqual(Buffer2.from(signature), Buffer2.from(computedSig)); + }; + } + function createKeySigner(bits) { + return function sign(thing, privateKey) { + checkIsPrivateKey(privateKey); + thing = normalizeInput(thing); + var signer = crypto2.createSign("RSA-SHA" + bits); + var sig = (signer.update(thing), signer.sign(privateKey, "base64")); + return fromBase648(sig); + }; + } + function createKeyVerifier(bits) { + return function verify(thing, signature, publicKey) { + checkIsPublicKey(publicKey); + thing = normalizeInput(thing); + signature = toBase648(signature); + var verifier = crypto2.createVerify("RSA-SHA" + bits); + verifier.update(thing); + return verifier.verify(publicKey, signature, "base64"); + }; + } + function createPSSKeySigner(bits) { + return function sign(thing, privateKey) { + checkIsPrivateKey(privateKey); + thing = normalizeInput(thing); + var signer = crypto2.createSign("RSA-SHA" + bits); + var sig = (signer.update(thing), signer.sign({ + key: privateKey, + padding: crypto2.constants.RSA_PKCS1_PSS_PADDING, + saltLength: crypto2.constants.RSA_PSS_SALTLEN_DIGEST + }, "base64")); + return fromBase648(sig); + }; + } + function createPSSKeyVerifier(bits) { + return function verify(thing, signature, publicKey) { + checkIsPublicKey(publicKey); + thing = normalizeInput(thing); + signature = toBase648(signature); + var verifier = crypto2.createVerify("RSA-SHA" + bits); + verifier.update(thing); + return verifier.verify({ + key: publicKey, + padding: crypto2.constants.RSA_PKCS1_PSS_PADDING, + saltLength: crypto2.constants.RSA_PSS_SALTLEN_DIGEST + }, signature, "base64"); + }; + } + function createECDSASigner(bits) { + var inner = createKeySigner(bits); + return function sign() { + var signature = inner.apply(null, arguments); + signature = formatEcdsa.derToJose(signature, "ES" + bits); + return signature; + }; + } + function createECDSAVerifer(bits) { + var inner = createKeyVerifier(bits); + return function verify(thing, signature, publicKey) { + signature = formatEcdsa.joseToDer(signature, "ES" + bits).toString("base64"); + var result = inner(thing, signature, publicKey); + return result; + }; + } + function createNoneSigner() { + return function sign() { + return ""; + }; + } + function createNoneVerifier() { + return function verify(thing, signature) { + return signature === ""; + }; + } + module2.exports = function jwa(algorithm) { + var signerFactories = { + hs: createHmacSigner, + rs: createKeySigner, + ps: createPSSKeySigner, + es: createECDSASigner, + none: createNoneSigner + }; + var verifierFactories = { + hs: createHmacVerifier, + rs: createKeyVerifier, + ps: createPSSKeyVerifier, + es: createECDSAVerifer, + none: createNoneVerifier + }; + var match = algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i); + if (!match) + throw typeError(MSG_INVALID_ALGORITHM, algorithm); + var algo = (match[1] || match[3]).toLowerCase(); + var bits = match[2]; + return { + sign: signerFactories[algo](bits), + verify: verifierFactories[algo](bits) + }; + }; + } +}); + +// node_modules/jws/lib/tostring.js +var require_tostring = __commonJS({ + "node_modules/jws/lib/tostring.js"(exports2, module2) { + var Buffer2 = require("buffer").Buffer; + module2.exports = function toString(obj) { + if (typeof obj === "string") + return obj; + if (typeof obj === "number" || Buffer2.isBuffer(obj)) + return obj.toString(); + return JSON.stringify(obj); + }; + } +}); + +// node_modules/jws/lib/sign-stream.js +var require_sign_stream = __commonJS({ + "node_modules/jws/lib/sign-stream.js"(exports2, module2) { + var Buffer2 = require_safe_buffer().Buffer; + var DataStream = require_data_stream(); + var jwa = require_jwa(); + var Stream = require("stream"); + var toString = require_tostring(); + var util = require("util"); + function base64url(string, encoding) { + return Buffer2.from(string, encoding).toString("base64").replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); + } + function jwsSecuredInput(header, payload2, encoding) { + encoding = encoding || "utf8"; + var encodedHeader = base64url(toString(header), "binary"); + var encodedPayload = base64url(toString(payload2), encoding); + return util.format("%s.%s", encodedHeader, encodedPayload); + } + function jwsSign(opts) { + var header = opts.header; + var payload2 = opts.payload; + var secretOrKey = opts.secret || opts.privateKey; + var encoding = opts.encoding; + var algo = jwa(header.alg); + var securedInput = jwsSecuredInput(header, payload2, encoding); + var signature = algo.sign(securedInput, secretOrKey); + return util.format("%s.%s", securedInput, signature); + } + function SignStream(opts) { + var secret = opts.secret; + secret = secret == null ? opts.privateKey : secret; + secret = secret == null ? opts.key : secret; + if (/^hs/i.test(opts.header.alg) === true && secret == null) { + throw new TypeError("secret must be a string or buffer or a KeyObject"); + } + var secretStream = new DataStream(secret); + this.readable = true; + this.header = opts.header; + this.encoding = opts.encoding; + this.secret = this.privateKey = this.key = secretStream; + this.payload = new DataStream(opts.payload); + this.secret.once("close", function() { + if (!this.payload.writable && this.readable) + this.sign(); + }.bind(this)); + this.payload.once("close", function() { + if (!this.secret.writable && this.readable) + this.sign(); + }.bind(this)); + } + util.inherits(SignStream, Stream); + SignStream.prototype.sign = function sign() { + try { + var signature = jwsSign({ + header: this.header, + payload: this.payload.buffer, + secret: this.secret.buffer, + encoding: this.encoding + }); + this.emit("done", signature); + this.emit("data", signature); + this.emit("end"); + this.readable = false; + return signature; + } catch (e4) { + this.readable = false; + this.emit("error", e4); + this.emit("close"); + } + }; + SignStream.sign = jwsSign; + module2.exports = SignStream; + } +}); + +// node_modules/jws/lib/verify-stream.js +var require_verify_stream = __commonJS({ + "node_modules/jws/lib/verify-stream.js"(exports2, module2) { + var Buffer2 = require_safe_buffer().Buffer; + var DataStream = require_data_stream(); + var jwa = require_jwa(); + var Stream = require("stream"); + var toString = require_tostring(); + var util = require("util"); + var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/; + function isObject(thing) { + return Object.prototype.toString.call(thing) === "[object Object]"; + } + function safeJsonParse(thing) { + if (isObject(thing)) + return thing; + try { + return JSON.parse(thing); + } catch (e4) { + return void 0; + } + } + function headerFromJWS(jwsSig) { + var encodedHeader = jwsSig.split(".", 1)[0]; + return safeJsonParse(Buffer2.from(encodedHeader, "base64").toString("binary")); + } + function securedInputFromJWS(jwsSig) { + return jwsSig.split(".", 2).join("."); + } + function signatureFromJWS(jwsSig) { + return jwsSig.split(".")[2]; + } + function payloadFromJWS(jwsSig, encoding) { + encoding = encoding || "utf8"; + var payload2 = jwsSig.split(".")[1]; + return Buffer2.from(payload2, "base64").toString(encoding); + } + function isValidJws(string) { + return JWS_REGEX.test(string) && !!headerFromJWS(string); + } + function jwsVerify(jwsSig, algorithm, secretOrKey) { + if (!algorithm) { + var err = new Error("Missing algorithm parameter for jws.verify"); + err.code = "MISSING_ALGORITHM"; + throw err; + } + jwsSig = toString(jwsSig); + var signature = signatureFromJWS(jwsSig); + var securedInput = securedInputFromJWS(jwsSig); + var algo = jwa(algorithm); + return algo.verify(securedInput, signature, secretOrKey); + } + function jwsDecode(jwsSig, opts) { + opts = opts || {}; + jwsSig = toString(jwsSig); + if (!isValidJws(jwsSig)) + return null; + var header = headerFromJWS(jwsSig); + if (!header) + return null; + var payload2 = payloadFromJWS(jwsSig); + if (header.typ === "JWT" || opts.json) + payload2 = JSON.parse(payload2, opts.encoding); + return { + header, + payload: payload2, + signature: signatureFromJWS(jwsSig) + }; + } + function VerifyStream(opts) { + opts = opts || {}; + var secretOrKey = opts.secret; + secretOrKey = secretOrKey == null ? opts.publicKey : secretOrKey; + secretOrKey = secretOrKey == null ? opts.key : secretOrKey; + if (/^hs/i.test(opts.algorithm) === true && secretOrKey == null) { + throw new TypeError("secret must be a string or buffer or a KeyObject"); + } + var secretStream = new DataStream(secretOrKey); + this.readable = true; + this.algorithm = opts.algorithm; + this.encoding = opts.encoding; + this.secret = this.publicKey = this.key = secretStream; + this.signature = new DataStream(opts.signature); + this.secret.once("close", function() { + if (!this.signature.writable && this.readable) + this.verify(); + }.bind(this)); + this.signature.once("close", function() { + if (!this.secret.writable && this.readable) + this.verify(); + }.bind(this)); + } + util.inherits(VerifyStream, Stream); + VerifyStream.prototype.verify = function verify() { + try { + var valid = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer); + var obj = jwsDecode(this.signature.buffer, this.encoding); + this.emit("done", valid, obj); + this.emit("data", valid); + this.emit("end"); + this.readable = false; + return valid; + } catch (e4) { + this.readable = false; + this.emit("error", e4); + this.emit("close"); + } + }; + VerifyStream.decode = jwsDecode; + VerifyStream.isValid = isValidJws; + VerifyStream.verify = jwsVerify; + module2.exports = VerifyStream; + } +}); + +// node_modules/jws/index.js +var require_jws = __commonJS({ + "node_modules/jws/index.js"(exports2) { + var SignStream = require_sign_stream(); + var VerifyStream = require_verify_stream(); + var ALGORITHMS = [ + "HS256", + "HS384", + "HS512", + "RS256", + "RS384", + "RS512", + "PS256", + "PS384", + "PS512", + "ES256", + "ES384", + "ES512" + ]; + exports2.ALGORITHMS = ALGORITHMS; + exports2.sign = SignStream.sign; + exports2.verify = VerifyStream.verify; + exports2.decode = VerifyStream.decode; + exports2.isValid = VerifyStream.isValid; + exports2.createSign = function createSign(opts) { + return new SignStream(opts); + }; + exports2.createVerify = function createVerify(opts) { + return new VerifyStream(opts); + }; + } +}); + +// node_modules/jsonwebtoken/decode.js +var require_decode = __commonJS({ + "node_modules/jsonwebtoken/decode.js"(exports2, module2) { + var jws = require_jws(); + module2.exports = function(jwt, options) { + options = options || {}; + var decoded = jws.decode(jwt, options); + if (!decoded) { + return null; + } + var payload2 = decoded.payload; + if (typeof payload2 === "string") { + try { + var obj = JSON.parse(payload2); + if (obj !== null && typeof obj === "object") { + payload2 = obj; + } + } catch (e4) { + } + } + if (options.complete === true) { + return { + header: decoded.header, + payload: payload2, + signature: decoded.signature + }; + } + return payload2; + }; + } +}); + +// node_modules/jsonwebtoken/lib/JsonWebTokenError.js +var require_JsonWebTokenError = __commonJS({ + "node_modules/jsonwebtoken/lib/JsonWebTokenError.js"(exports2, module2) { + var JsonWebTokenError = function(message2, error2) { + Error.call(this, message2); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + this.name = "JsonWebTokenError"; + this.message = message2; + if (error2) this.inner = error2; + }; + JsonWebTokenError.prototype = Object.create(Error.prototype); + JsonWebTokenError.prototype.constructor = JsonWebTokenError; + module2.exports = JsonWebTokenError; + } +}); + +// node_modules/jsonwebtoken/lib/NotBeforeError.js +var require_NotBeforeError = __commonJS({ + "node_modules/jsonwebtoken/lib/NotBeforeError.js"(exports2, module2) { + var JsonWebTokenError = require_JsonWebTokenError(); + var NotBeforeError = function(message2, date2) { + JsonWebTokenError.call(this, message2); + this.name = "NotBeforeError"; + this.date = date2; + }; + NotBeforeError.prototype = Object.create(JsonWebTokenError.prototype); + NotBeforeError.prototype.constructor = NotBeforeError; + module2.exports = NotBeforeError; + } +}); + +// node_modules/jsonwebtoken/lib/TokenExpiredError.js +var require_TokenExpiredError = __commonJS({ + "node_modules/jsonwebtoken/lib/TokenExpiredError.js"(exports2, module2) { + var JsonWebTokenError = require_JsonWebTokenError(); + var TokenExpiredError = function(message2, expiredAt) { + JsonWebTokenError.call(this, message2); + this.name = "TokenExpiredError"; + this.expiredAt = expiredAt; + }; + TokenExpiredError.prototype = Object.create(JsonWebTokenError.prototype); + TokenExpiredError.prototype.constructor = TokenExpiredError; + module2.exports = TokenExpiredError; + } +}); + +// node_modules/jsonwebtoken/node_modules/ms/index.js +var require_ms4 = __commonJS({ + "node_modules/jsonwebtoken/node_modules/ms/index.js"(exports2, module2) { + var s4 = 1e3; + var m4 = s4 * 60; + var h4 = m4 * 60; + var d4 = h4 * 24; + var w4 = d4 * 7; + var y2 = d4 * 365.25; + module2.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === "string" && val.length > 0) { + return parse(val); + } else if (type === "number" && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) + ); + }; + function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n4 = parseFloat(match[1]); + var type = (match[2] || "ms").toLowerCase(); + switch (type) { + case "years": + case "year": + case "yrs": + case "yr": + case "y": + return n4 * y2; + case "weeks": + case "week": + case "w": + return n4 * w4; + case "days": + case "day": + case "d": + return n4 * d4; + case "hours": + case "hour": + case "hrs": + case "hr": + case "h": + return n4 * h4; + case "minutes": + case "minute": + case "mins": + case "min": + case "m": + return n4 * m4; + case "seconds": + case "second": + case "secs": + case "sec": + case "s": + return n4 * s4; + case "milliseconds": + case "millisecond": + case "msecs": + case "msec": + case "ms": + return n4; + default: + return void 0; + } + } + function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d4) { + return Math.round(ms / d4) + "d"; + } + if (msAbs >= h4) { + return Math.round(ms / h4) + "h"; + } + if (msAbs >= m4) { + return Math.round(ms / m4) + "m"; + } + if (msAbs >= s4) { + return Math.round(ms / s4) + "s"; + } + return ms + "ms"; + } + function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d4) { + return plural(ms, msAbs, d4, "day"); + } + if (msAbs >= h4) { + return plural(ms, msAbs, h4, "hour"); + } + if (msAbs >= m4) { + return plural(ms, msAbs, m4, "minute"); + } + if (msAbs >= s4) { + return plural(ms, msAbs, s4, "second"); + } + return ms + " ms"; + } + function plural(ms, msAbs, n4, name) { + var isPlural = msAbs >= n4 * 1.5; + return Math.round(ms / n4) + " " + name + (isPlural ? "s" : ""); + } + } +}); + +// node_modules/jsonwebtoken/lib/timespan.js +var require_timespan = __commonJS({ + "node_modules/jsonwebtoken/lib/timespan.js"(exports2, module2) { + var ms = require_ms4(); + module2.exports = function(time2, iat) { + var timestamp = iat || Math.floor(Date.now() / 1e3); + if (typeof time2 === "string") { + var milliseconds = ms(time2); + if (typeof milliseconds === "undefined") { + return; + } + return Math.floor(timestamp + milliseconds / 1e3); + } else if (typeof time2 === "number") { + return timestamp + time2; + } else { + return; + } + }; + } +}); + +// node_modules/semver/internal/constants.js +var require_constants7 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports2, module2) { + "use strict"; + var SEMVER_SPEC_VERSION = "2.0.0"; + var MAX_LENGTH = 256; + var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ + 9007199254740991; + var MAX_SAFE_COMPONENT_LENGTH = 16; + var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; + var RELEASE_TYPES = [ + "major", + "premajor", + "minor", + "preminor", + "patch", + "prepatch", + "prerelease" + ]; + module2.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 1, + FLAG_LOOSE: 2 + }; + } +}); + +// node_modules/semver/internal/debug.js +var require_debug2 = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { + "use strict"; + var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args2) => console.error("SEMVER", ...args2) : () => { + }; + module2.exports = debug; + } +}); + +// node_modules/semver/internal/re.js +var require_re = __commonJS({ + "node_modules/semver/internal/re.js"(exports2, module2) { + "use strict"; + var { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH + } = require_constants7(); + var debug = require_debug2(); + exports2 = module2.exports = {}; + var re = exports2.re = []; + var safeRe = exports2.safeRe = []; + var src = exports2.src = []; + var safeSrc = exports2.safeSrc = []; + var t4 = exports2.t = {}; + var R = 0; + var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; + var safeRegexReplacements = [ + ["\\s", 1], + ["\\d", MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] + ]; + var makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); + } + return value; + }; + var createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value); + const index = R++; + debug(name, index, value); + t4[name] = index; + src[index] = value; + safeSrc[index] = safe; + re[index] = new RegExp(value, isGlobal ? "g" : void 0); + safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); + }; + createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); + createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); + createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); + createToken("MAINVERSION", `(${src[t4.NUMERICIDENTIFIER]})\\.(${src[t4.NUMERICIDENTIFIER]})\\.(${src[t4.NUMERICIDENTIFIER]})`); + createToken("MAINVERSIONLOOSE", `(${src[t4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t4.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASEIDENTIFIER", `(?:${src[t4.NONNUMERICIDENTIFIER]}|${src[t4.NUMERICIDENTIFIER]})`); + createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t4.NONNUMERICIDENTIFIER]}|${src[t4.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASE", `(?:-(${src[t4.PRERELEASEIDENTIFIER]}(?:\\.${src[t4.PRERELEASEIDENTIFIER]})*))`); + createToken("PRERELEASELOOSE", `(?:-?(${src[t4.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t4.PRERELEASEIDENTIFIERLOOSE]})*))`); + createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); + createToken("BUILD", `(?:\\+(${src[t4.BUILDIDENTIFIER]}(?:\\.${src[t4.BUILDIDENTIFIER]})*))`); + createToken("FULLPLAIN", `v?${src[t4.MAINVERSION]}${src[t4.PRERELEASE]}?${src[t4.BUILD]}?`); + createToken("FULL", `^${src[t4.FULLPLAIN]}$`); + createToken("LOOSEPLAIN", `[v=\\s]*${src[t4.MAINVERSIONLOOSE]}${src[t4.PRERELEASELOOSE]}?${src[t4.BUILD]}?`); + createToken("LOOSE", `^${src[t4.LOOSEPLAIN]}$`); + createToken("GTLT", "((?:<|>)?=?)"); + createToken("XRANGEIDENTIFIERLOOSE", `${src[t4.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); + createToken("XRANGEIDENTIFIER", `${src[t4.NUMERICIDENTIFIER]}|x|X|\\*`); + createToken("XRANGEPLAIN", `[v=\\s]*(${src[t4.XRANGEIDENTIFIER]})(?:\\.(${src[t4.XRANGEIDENTIFIER]})(?:\\.(${src[t4.XRANGEIDENTIFIER]})(?:${src[t4.PRERELEASE]})?${src[t4.BUILD]}?)?)?`); + createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t4.XRANGEIDENTIFIERLOOSE]})(?:${src[t4.PRERELEASELOOSE]})?${src[t4.BUILD]}?)?)?`); + createToken("XRANGE", `^${src[t4.GTLT]}\\s*${src[t4.XRANGEPLAIN]}$`); + createToken("XRANGELOOSE", `^${src[t4.GTLT]}\\s*${src[t4.XRANGEPLAINLOOSE]}$`); + createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); + createToken("COERCE", `${src[t4.COERCEPLAIN]}(?:$|[^\\d])`); + createToken("COERCEFULL", src[t4.COERCEPLAIN] + `(?:${src[t4.PRERELEASE]})?(?:${src[t4.BUILD]})?(?:$|[^\\d])`); + createToken("COERCERTL", src[t4.COERCE], true); + createToken("COERCERTLFULL", src[t4.COERCEFULL], true); + createToken("LONETILDE", "(?:~>?)"); + createToken("TILDETRIM", `(\\s*)${src[t4.LONETILDE]}\\s+`, true); + exports2.tildeTrimReplace = "$1~"; + createToken("TILDE", `^${src[t4.LONETILDE]}${src[t4.XRANGEPLAIN]}$`); + createToken("TILDELOOSE", `^${src[t4.LONETILDE]}${src[t4.XRANGEPLAINLOOSE]}$`); + createToken("LONECARET", "(?:\\^)"); + createToken("CARETTRIM", `(\\s*)${src[t4.LONECARET]}\\s+`, true); + exports2.caretTrimReplace = "$1^"; + createToken("CARET", `^${src[t4.LONECARET]}${src[t4.XRANGEPLAIN]}$`); + createToken("CARETLOOSE", `^${src[t4.LONECARET]}${src[t4.XRANGEPLAINLOOSE]}$`); + createToken("COMPARATORLOOSE", `^${src[t4.GTLT]}\\s*(${src[t4.LOOSEPLAIN]})$|^$`); + createToken("COMPARATOR", `^${src[t4.GTLT]}\\s*(${src[t4.FULLPLAIN]})$|^$`); + createToken("COMPARATORTRIM", `(\\s*)${src[t4.GTLT]}\\s*(${src[t4.LOOSEPLAIN]}|${src[t4.XRANGEPLAIN]})`, true); + exports2.comparatorTrimReplace = "$1$2$3"; + createToken("HYPHENRANGE", `^\\s*(${src[t4.XRANGEPLAIN]})\\s+-\\s+(${src[t4.XRANGEPLAIN]})\\s*$`); + createToken("HYPHENRANGELOOSE", `^\\s*(${src[t4.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t4.XRANGEPLAINLOOSE]})\\s*$`); + createToken("STAR", "(<|>)?=?\\s*\\*"); + createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); + createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); + } +}); + +// node_modules/semver/internal/parse-options.js +var require_parse_options = __commonJS({ + "node_modules/semver/internal/parse-options.js"(exports2, module2) { + "use strict"; + var looseOption = Object.freeze({ loose: true }); + var emptyOpts = Object.freeze({}); + var parseOptions = (options) => { + if (!options) { + return emptyOpts; + } + if (typeof options !== "object") { + return looseOption; + } + return options; + }; + module2.exports = parseOptions; + } +}); + +// node_modules/semver/internal/identifiers.js +var require_identifiers = __commonJS({ + "node_modules/semver/internal/identifiers.js"(exports2, module2) { + "use strict"; + var numeric = /^[0-9]+$/; + var compareIdentifiers = (a4, b4) => { + if (typeof a4 === "number" && typeof b4 === "number") { + return a4 === b4 ? 0 : a4 < b4 ? -1 : 1; + } + const anum = numeric.test(a4); + const bnum = numeric.test(b4); + if (anum && bnum) { + a4 = +a4; + b4 = +b4; + } + return a4 === b4 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a4 < b4 ? -1 : 1; + }; + var rcompareIdentifiers = (a4, b4) => compareIdentifiers(b4, a4); + module2.exports = { + compareIdentifiers, + rcompareIdentifiers + }; + } +}); + +// node_modules/semver/classes/semver.js +var require_semver = __commonJS({ + "node_modules/semver/classes/semver.js"(exports2, module2) { + "use strict"; + var debug = require_debug2(); + var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants7(); + var { safeRe: re, t: t4 } = require_re(); + var parseOptions = require_parse_options(); + var { compareIdentifiers } = require_identifiers(); + var SemVer = class _SemVer { + constructor(version, options) { + options = parseOptions(options); + if (version instanceof _SemVer) { + if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { + return version; + } else { + version = version.version; + } + } else if (typeof version !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`); + } + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ); + } + debug("SemVer", version, options); + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + const m4 = version.trim().match(options.loose ? re[t4.LOOSE] : re[t4.FULL]); + if (!m4) { + throw new TypeError(`Invalid Version: ${version}`); + } + this.raw = version; + this.major = +m4[1]; + this.minor = +m4[2]; + this.patch = +m4[3]; + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError("Invalid major version"); + } + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError("Invalid minor version"); + } + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError("Invalid patch version"); + } + if (!m4[4]) { + this.prerelease = []; + } else { + this.prerelease = m4[4].split(".").map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num; + } + } + return id; + }); + } + this.build = m4[5] ? m4[5].split(".") : []; + this.format(); + } + format() { + this.version = `${this.major}.${this.minor}.${this.patch}`; + if (this.prerelease.length) { + this.version += `-${this.prerelease.join(".")}`; + } + return this.version; + } + toString() { + return this.version; + } + compare(other) { + debug("SemVer.compare", this.version, this.options, other); + if (!(other instanceof _SemVer)) { + if (typeof other === "string" && other === this.version) { + return 0; + } + other = new _SemVer(other, this.options); + } + if (other.version === this.version) { + return 0; + } + return this.compareMain(other) || this.comparePre(other); + } + compareMain(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + if (this.major < other.major) { + return -1; + } + if (this.major > other.major) { + return 1; + } + if (this.minor < other.minor) { + return -1; + } + if (this.minor > other.minor) { + return 1; + } + if (this.patch < other.patch) { + return -1; + } + if (this.patch > other.patch) { + return 1; + } + return 0; + } + comparePre(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + if (this.prerelease.length && !other.prerelease.length) { + return -1; + } else if (!this.prerelease.length && other.prerelease.length) { + return 1; + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0; + } + let i4 = 0; + do { + const a4 = this.prerelease[i4]; + const b4 = other.prerelease[i4]; + debug("prerelease compare", i4, a4, b4); + if (a4 === void 0 && b4 === void 0) { + return 0; + } else if (b4 === void 0) { + return 1; + } else if (a4 === void 0) { + return -1; + } else if (a4 === b4) { + continue; + } else { + return compareIdentifiers(a4, b4); + } + } while (++i4); + } + compareBuild(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + let i4 = 0; + do { + const a4 = this.build[i4]; + const b4 = other.build[i4]; + debug("build compare", i4, a4, b4); + if (a4 === void 0 && b4 === void 0) { + return 0; + } else if (b4 === void 0) { + return 1; + } else if (a4 === void 0) { + return -1; + } else if (a4 === b4) { + continue; + } else { + return compareIdentifiers(a4, b4); + } + } while (++i4); + } + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc(release, identifier, identifierBase) { + if (release.startsWith("pre")) { + if (!identifier && identifierBase === false) { + throw new Error("invalid increment argument: identifier is empty"); + } + if (identifier) { + const match = `-${identifier}`.match(this.options.loose ? re[t4.PRERELEASELOOSE] : re[t4.PRERELEASE]); + if (!match || match[1] !== identifier) { + throw new Error(`invalid identifier: ${identifier}`); + } + } + } + switch (release) { + case "premajor": + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc("pre", identifier, identifierBase); + break; + case "preminor": + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc("pre", identifier, identifierBase); + break; + case "prepatch": + this.prerelease.length = 0; + this.inc("patch", identifier, identifierBase); + this.inc("pre", identifier, identifierBase); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case "prerelease": + if (this.prerelease.length === 0) { + this.inc("patch", identifier, identifierBase); + } + this.inc("pre", identifier, identifierBase); + break; + case "release": + if (this.prerelease.length === 0) { + throw new Error(`version ${this.raw} is not a prerelease`); + } + this.prerelease.length = 0; + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; + } + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case "pre": { + const base = Number(identifierBase) ? 1 : 0; + if (this.prerelease.length === 0) { + this.prerelease = [base]; + } else { + let i4 = this.prerelease.length; + while (--i4 >= 0) { + if (typeof this.prerelease[i4] === "number") { + this.prerelease[i4]++; + i4 = -2; + } + } + if (i4 === -1) { + if (identifier === this.prerelease.join(".") && identifierBase === false) { + throw new Error("invalid increment argument: identifier already exists"); + } + this.prerelease.push(base); + } + } + if (identifier) { + let prerelease = [identifier, base]; + if (identifierBase === false) { + prerelease = [identifier]; + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease; + } + } else { + this.prerelease = prerelease; + } + } + break; + } + default: + throw new Error(`invalid increment argument: ${release}`); + } + this.raw = this.format(); + if (this.build.length) { + this.raw += `+${this.build.join(".")}`; + } + return this; + } + }; + module2.exports = SemVer; + } +}); + +// node_modules/semver/functions/parse.js +var require_parse2 = __commonJS({ + "node_modules/semver/functions/parse.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var parse = (version, options, throwErrors = false) => { + if (version instanceof SemVer) { + return version; + } + try { + return new SemVer(version, options); + } catch (er) { + if (!throwErrors) { + return null; + } + throw er; + } + }; + module2.exports = parse; + } +}); + +// node_modules/semver/functions/valid.js +var require_valid = __commonJS({ + "node_modules/semver/functions/valid.js"(exports2, module2) { + "use strict"; + var parse = require_parse2(); + var valid = (version, options) => { + const v4 = parse(version, options); + return v4 ? v4.version : null; + }; + module2.exports = valid; + } +}); + +// node_modules/semver/functions/clean.js +var require_clean = __commonJS({ + "node_modules/semver/functions/clean.js"(exports2, module2) { + "use strict"; + var parse = require_parse2(); + var clean = (version, options) => { + const s4 = parse(version.trim().replace(/^[=v]+/, ""), options); + return s4 ? s4.version : null; + }; + module2.exports = clean; + } +}); + +// node_modules/semver/functions/inc.js +var require_inc = __commonJS({ + "node_modules/semver/functions/inc.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var inc = (version, release, options, identifier, identifierBase) => { + if (typeof options === "string") { + identifierBase = identifier; + identifier = options; + options = void 0; + } + try { + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release, identifier, identifierBase).version; + } catch (er) { + return null; + } + }; + module2.exports = inc; + } +}); + +// node_modules/semver/functions/diff.js +var require_diff = __commonJS({ + "node_modules/semver/functions/diff.js"(exports2, module2) { + "use strict"; + var parse = require_parse2(); + var diff = (version1, version2) => { + const v1 = parse(version1, null, true); + const v22 = parse(version2, null, true); + const comparison = v1.compare(v22); + if (comparison === 0) { + return null; + } + const v1Higher = comparison > 0; + const highVersion = v1Higher ? v1 : v22; + const lowVersion = v1Higher ? v22 : v1; + const highHasPre = !!highVersion.prerelease.length; + const lowHasPre = !!lowVersion.prerelease.length; + if (lowHasPre && !highHasPre) { + if (!lowVersion.patch && !lowVersion.minor) { + return "major"; + } + if (lowVersion.compareMain(highVersion) === 0) { + if (lowVersion.minor && !lowVersion.patch) { + return "minor"; + } + return "patch"; + } + } + const prefix = highHasPre ? "pre" : ""; + if (v1.major !== v22.major) { + return prefix + "major"; + } + if (v1.minor !== v22.minor) { + return prefix + "minor"; + } + if (v1.patch !== v22.patch) { + return prefix + "patch"; + } + return "prerelease"; + }; + module2.exports = diff; + } +}); + +// node_modules/semver/functions/major.js +var require_major = __commonJS({ + "node_modules/semver/functions/major.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var major = (a4, loose) => new SemVer(a4, loose).major; + module2.exports = major; + } +}); + +// node_modules/semver/functions/minor.js +var require_minor = __commonJS({ + "node_modules/semver/functions/minor.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var minor = (a4, loose) => new SemVer(a4, loose).minor; + module2.exports = minor; + } +}); + +// node_modules/semver/functions/patch.js +var require_patch = __commonJS({ + "node_modules/semver/functions/patch.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var patch = (a4, loose) => new SemVer(a4, loose).patch; + module2.exports = patch; + } +}); + +// node_modules/semver/functions/prerelease.js +var require_prerelease = __commonJS({ + "node_modules/semver/functions/prerelease.js"(exports2, module2) { + "use strict"; + var parse = require_parse2(); + var prerelease = (version, options) => { + const parsed = parse(version, options); + return parsed && parsed.prerelease.length ? parsed.prerelease : null; + }; + module2.exports = prerelease; + } +}); + +// node_modules/semver/functions/compare.js +var require_compare = __commonJS({ + "node_modules/semver/functions/compare.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var compare = (a4, b4, loose) => new SemVer(a4, loose).compare(new SemVer(b4, loose)); + module2.exports = compare; + } +}); + +// node_modules/semver/functions/rcompare.js +var require_rcompare = __commonJS({ + "node_modules/semver/functions/rcompare.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var rcompare = (a4, b4, loose) => compare(b4, a4, loose); + module2.exports = rcompare; + } +}); + +// node_modules/semver/functions/compare-loose.js +var require_compare_loose = __commonJS({ + "node_modules/semver/functions/compare-loose.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var compareLoose = (a4, b4) => compare(a4, b4, true); + module2.exports = compareLoose; + } +}); + +// node_modules/semver/functions/compare-build.js +var require_compare_build = __commonJS({ + "node_modules/semver/functions/compare-build.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var compareBuild = (a4, b4, loose) => { + const versionA = new SemVer(a4, loose); + const versionB = new SemVer(b4, loose); + return versionA.compare(versionB) || versionA.compareBuild(versionB); + }; + module2.exports = compareBuild; + } +}); + +// node_modules/semver/functions/sort.js +var require_sort2 = __commonJS({ + "node_modules/semver/functions/sort.js"(exports2, module2) { + "use strict"; + var compareBuild = require_compare_build(); + var sort = (list2, loose) => list2.sort((a4, b4) => compareBuild(a4, b4, loose)); + module2.exports = sort; + } +}); + +// node_modules/semver/functions/rsort.js +var require_rsort = __commonJS({ + "node_modules/semver/functions/rsort.js"(exports2, module2) { + "use strict"; + var compareBuild = require_compare_build(); + var rsort = (list2, loose) => list2.sort((a4, b4) => compareBuild(b4, a4, loose)); + module2.exports = rsort; + } +}); + +// node_modules/semver/functions/gt.js +var require_gt = __commonJS({ + "node_modules/semver/functions/gt.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var gt = (a4, b4, loose) => compare(a4, b4, loose) > 0; + module2.exports = gt; + } +}); + +// node_modules/semver/functions/lt.js +var require_lt = __commonJS({ + "node_modules/semver/functions/lt.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var lt = (a4, b4, loose) => compare(a4, b4, loose) < 0; + module2.exports = lt; + } +}); + +// node_modules/semver/functions/eq.js +var require_eq = __commonJS({ + "node_modules/semver/functions/eq.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var eq = (a4, b4, loose) => compare(a4, b4, loose) === 0; + module2.exports = eq; + } +}); + +// node_modules/semver/functions/neq.js +var require_neq = __commonJS({ + "node_modules/semver/functions/neq.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var neq = (a4, b4, loose) => compare(a4, b4, loose) !== 0; + module2.exports = neq; + } +}); + +// node_modules/semver/functions/gte.js +var require_gte = __commonJS({ + "node_modules/semver/functions/gte.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var gte = (a4, b4, loose) => compare(a4, b4, loose) >= 0; + module2.exports = gte; + } +}); + +// node_modules/semver/functions/lte.js +var require_lte = __commonJS({ + "node_modules/semver/functions/lte.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var lte = (a4, b4, loose) => compare(a4, b4, loose) <= 0; + module2.exports = lte; + } +}); + +// node_modules/semver/functions/cmp.js +var require_cmp = __commonJS({ + "node_modules/semver/functions/cmp.js"(exports2, module2) { + "use strict"; + var eq = require_eq(); + var neq = require_neq(); + var gt = require_gt(); + var gte = require_gte(); + var lt = require_lt(); + var lte = require_lte(); + var cmp = (a4, op2, b4, loose) => { + switch (op2) { + case "===": + if (typeof a4 === "object") { + a4 = a4.version; + } + if (typeof b4 === "object") { + b4 = b4.version; + } + return a4 === b4; + case "!==": + if (typeof a4 === "object") { + a4 = a4.version; + } + if (typeof b4 === "object") { + b4 = b4.version; + } + return a4 !== b4; + case "": + case "=": + case "==": + return eq(a4, b4, loose); + case "!=": + return neq(a4, b4, loose); + case ">": + return gt(a4, b4, loose); + case ">=": + return gte(a4, b4, loose); + case "<": + return lt(a4, b4, loose); + case "<=": + return lte(a4, b4, loose); + default: + throw new TypeError(`Invalid operator: ${op2}`); + } + }; + module2.exports = cmp; + } +}); + +// node_modules/semver/functions/coerce.js +var require_coerce = __commonJS({ + "node_modules/semver/functions/coerce.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var parse = require_parse2(); + var { safeRe: re, t: t4 } = require_re(); + var coerce = (version, options) => { + if (version instanceof SemVer) { + return version; + } + if (typeof version === "number") { + version = String(version); + } + if (typeof version !== "string") { + return null; + } + options = options || {}; + let match = null; + if (!options.rtl) { + match = version.match(options.includePrerelease ? re[t4.COERCEFULL] : re[t4.COERCE]); + } else { + const coerceRtlRegex = options.includePrerelease ? re[t4.COERCERTLFULL] : re[t4.COERCERTL]; + let next; + while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; + } + coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length; + } + coerceRtlRegex.lastIndex = -1; + } + if (match === null) { + return null; + } + const major = match[2]; + const minor = match[3] || "0"; + const patch = match[4] || "0"; + const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ""; + const build = options.includePrerelease && match[6] ? `+${match[6]}` : ""; + return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options); + }; + module2.exports = coerce; + } +}); + +// node_modules/semver/internal/lrucache.js +var require_lrucache = __commonJS({ + "node_modules/semver/internal/lrucache.js"(exports2, module2) { + "use strict"; + var LRUCache = class { + constructor() { + this.max = 1e3; + this.map = /* @__PURE__ */ new Map(); + } + get(key) { + const value = this.map.get(key); + if (value === void 0) { + return void 0; + } else { + this.map.delete(key); + this.map.set(key, value); + return value; + } + } + delete(key) { + return this.map.delete(key); + } + set(key, value) { + const deleted = this.delete(key); + if (!deleted && value !== void 0) { + if (this.map.size >= this.max) { + const firstKey = this.map.keys().next().value; + this.delete(firstKey); + } + this.map.set(key, value); + } + return this; + } + }; + module2.exports = LRUCache; + } +}); + +// node_modules/semver/classes/range.js +var require_range = __commonJS({ + "node_modules/semver/classes/range.js"(exports2, module2) { + "use strict"; + var SPACE_CHARACTERS = /\s+/g; + var Range = class _Range { + constructor(range2, options) { + options = parseOptions(options); + if (range2 instanceof _Range) { + if (range2.loose === !!options.loose && range2.includePrerelease === !!options.includePrerelease) { + return range2; + } else { + return new _Range(range2.raw, options); + } + } + if (range2 instanceof Comparator) { + this.raw = range2.value; + this.set = [[range2]]; + this.formatted = void 0; + return this; + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range2.trim().replace(SPACE_CHARACTERS, " "); + this.set = this.raw.split("||").map((r4) => this.parseRange(r4.trim())).filter((c4) => c4.length); + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`); + } + if (this.set.length > 1) { + const first = this.set[0]; + this.set = this.set.filter((c4) => !isNullSet(c4[0])); + if (this.set.length === 0) { + this.set = [first]; + } else if (this.set.length > 1) { + for (const c4 of this.set) { + if (c4.length === 1 && isAny(c4[0])) { + this.set = [c4]; + break; + } + } + } + } + this.formatted = void 0; + } + get range() { + if (this.formatted === void 0) { + this.formatted = ""; + for (let i4 = 0; i4 < this.set.length; i4++) { + if (i4 > 0) { + this.formatted += "||"; + } + const comps = this.set[i4]; + for (let k4 = 0; k4 < comps.length; k4++) { + if (k4 > 0) { + this.formatted += " "; + } + this.formatted += comps[k4].toString().trim(); + } + } + } + return this.formatted; + } + format() { + return this.range; + } + toString() { + return this.range; + } + parseRange(range2) { + const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); + const memoKey = memoOpts + ":" + range2; + const cached = cache4.get(memoKey); + if (cached) { + return cached; + } + const loose = this.options.loose; + const hr = loose ? re[t4.HYPHENRANGELOOSE] : re[t4.HYPHENRANGE]; + range2 = range2.replace(hr, hyphenReplace(this.options.includePrerelease)); + debug("hyphen replace", range2); + range2 = range2.replace(re[t4.COMPARATORTRIM], comparatorTrimReplace); + debug("comparator trim", range2); + range2 = range2.replace(re[t4.TILDETRIM], tildeTrimReplace); + debug("tilde trim", range2); + range2 = range2.replace(re[t4.CARETTRIM], caretTrimReplace); + debug("caret trim", range2); + let rangeList = range2.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)); + if (loose) { + rangeList = rangeList.filter((comp) => { + debug("loose invalid filter", comp, this.options); + return !!comp.match(re[t4.COMPARATORLOOSE]); + }); + } + debug("range list", rangeList); + const rangeMap = /* @__PURE__ */ new Map(); + const comparators = rangeList.map((comp) => new Comparator(comp, this.options)); + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp]; + } + rangeMap.set(comp.value, comp); + } + if (rangeMap.size > 1 && rangeMap.has("")) { + rangeMap.delete(""); + } + const result = [...rangeMap.values()]; + cache4.set(memoKey, result); + return result; + } + intersects(range2, options) { + if (!(range2 instanceof _Range)) { + throw new TypeError("a Range is required"); + } + return this.set.some((thisComparators) => { + return isSatisfiable(thisComparators, options) && range2.set.some((rangeComparators) => { + return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options); + }); + }); + }); + }); + } + // if ANY of the sets match ALL of its comparators, then pass + test(version) { + if (!version) { + return false; + } + if (typeof version === "string") { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; + } + } + for (let i4 = 0; i4 < this.set.length; i4++) { + if (testSet(this.set[i4], version, this.options)) { + return true; + } + } + return false; + } + }; + module2.exports = Range; + var LRU = require_lrucache(); + var cache4 = new LRU(); + var parseOptions = require_parse_options(); + var Comparator = require_comparator(); + var debug = require_debug2(); + var SemVer = require_semver(); + var { + safeRe: re, + t: t4, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace + } = require_re(); + var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants7(); + var isNullSet = (c4) => c4.value === "<0.0.0-0"; + var isAny = (c4) => c4.value === ""; + var isSatisfiable = (comparators, options) => { + let result = true; + const remainingComparators = comparators.slice(); + let testComparator = remainingComparators.pop(); + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options); + }); + testComparator = remainingComparators.pop(); + } + return result; + }; + var parseComparator = (comp, options) => { + comp = comp.replace(re[t4.BUILD], ""); + debug("comp", comp, options); + comp = replaceCarets(comp, options); + debug("caret", comp); + comp = replaceTildes(comp, options); + debug("tildes", comp); + comp = replaceXRanges(comp, options); + debug("xrange", comp); + comp = replaceStars(comp, options); + debug("stars", comp); + return comp; + }; + var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; + var replaceTildes = (comp, options) => { + return comp.trim().split(/\s+/).map((c4) => replaceTilde(c4, options)).join(" "); + }; + var replaceTilde = (comp, options) => { + const r4 = options.loose ? re[t4.TILDELOOSE] : re[t4.TILDE]; + return comp.replace(r4, (_, M, m4, p4, pr) => { + debug("tilde", comp, _, M, m4, p4, pr); + let ret; + if (isX(M)) { + ret = ""; + } else if (isX(m4)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; + } else if (isX(p4)) { + ret = `>=${M}.${m4}.0 <${M}.${+m4 + 1}.0-0`; + } else if (pr) { + debug("replaceTilde pr", pr); + ret = `>=${M}.${m4}.${p4}-${pr} <${M}.${+m4 + 1}.0-0`; + } else { + ret = `>=${M}.${m4}.${p4} <${M}.${+m4 + 1}.0-0`; + } + debug("tilde return", ret); + return ret; + }); + }; + var replaceCarets = (comp, options) => { + return comp.trim().split(/\s+/).map((c4) => replaceCaret(c4, options)).join(" "); + }; + var replaceCaret = (comp, options) => { + debug("caret", comp, options); + const r4 = options.loose ? re[t4.CARETLOOSE] : re[t4.CARET]; + const z2 = options.includePrerelease ? "-0" : ""; + return comp.replace(r4, (_, M, m4, p4, pr) => { + debug("caret", comp, _, M, m4, p4, pr); + let ret; + if (isX(M)) { + ret = ""; + } else if (isX(m4)) { + ret = `>=${M}.0.0${z2} <${+M + 1}.0.0-0`; + } else if (isX(p4)) { + if (M === "0") { + ret = `>=${M}.${m4}.0${z2} <${M}.${+m4 + 1}.0-0`; + } else { + ret = `>=${M}.${m4}.0${z2} <${+M + 1}.0.0-0`; + } + } else if (pr) { + debug("replaceCaret pr", pr); + if (M === "0") { + if (m4 === "0") { + ret = `>=${M}.${m4}.${p4}-${pr} <${M}.${m4}.${+p4 + 1}-0`; + } else { + ret = `>=${M}.${m4}.${p4}-${pr} <${M}.${+m4 + 1}.0-0`; + } + } else { + ret = `>=${M}.${m4}.${p4}-${pr} <${+M + 1}.0.0-0`; + } + } else { + debug("no pr"); + if (M === "0") { + if (m4 === "0") { + ret = `>=${M}.${m4}.${p4}${z2} <${M}.${m4}.${+p4 + 1}-0`; + } else { + ret = `>=${M}.${m4}.${p4}${z2} <${M}.${+m4 + 1}.0-0`; + } + } else { + ret = `>=${M}.${m4}.${p4} <${+M + 1}.0.0-0`; + } + } + debug("caret return", ret); + return ret; + }); + }; + var replaceXRanges = (comp, options) => { + debug("replaceXRanges", comp, options); + return comp.split(/\s+/).map((c4) => replaceXRange(c4, options)).join(" "); + }; + var replaceXRange = (comp, options) => { + comp = comp.trim(); + const r4 = options.loose ? re[t4.XRANGELOOSE] : re[t4.XRANGE]; + return comp.replace(r4, (ret, gtlt, M, m4, p4, pr) => { + debug("xRange", comp, ret, gtlt, M, m4, p4, pr); + const xM = isX(M); + const xm = xM || isX(m4); + const xp = xm || isX(p4); + const anyX = xp; + if (gtlt === "=" && anyX) { + gtlt = ""; + } + pr = options.includePrerelease ? "-0" : ""; + if (xM) { + if (gtlt === ">" || gtlt === "<") { + ret = "<0.0.0-0"; + } else { + ret = "*"; + } + } else if (gtlt && anyX) { + if (xm) { + m4 = 0; + } + p4 = 0; + if (gtlt === ">") { + gtlt = ">="; + if (xm) { + M = +M + 1; + m4 = 0; + p4 = 0; + } else { + m4 = +m4 + 1; + p4 = 0; + } + } else if (gtlt === "<=") { + gtlt = "<"; + if (xm) { + M = +M + 1; + } else { + m4 = +m4 + 1; + } + } + if (gtlt === "<") { + pr = "-0"; + } + ret = `${gtlt + M}.${m4}.${p4}${pr}`; + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; + } else if (xp) { + ret = `>=${M}.${m4}.0${pr} <${M}.${+m4 + 1}.0-0`; + } + debug("xRange return", ret); + return ret; + }); + }; + var replaceStars = (comp, options) => { + debug("replaceStars", comp, options); + return comp.trim().replace(re[t4.STAR], ""); + }; + var replaceGTE0 = (comp, options) => { + debug("replaceGTE0", comp, options); + return comp.trim().replace(re[options.includePrerelease ? t4.GTE0PRE : t4.GTE0], ""); + }; + var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => { + if (isX(fM)) { + from = ""; + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? "-0" : ""}`; + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; + } else if (fpr) { + from = `>=${from}`; + } else { + from = `>=${from}${incPr ? "-0" : ""}`; + } + if (isX(tM)) { + to = ""; + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0`; + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0`; + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}`; + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0`; + } else { + to = `<=${to}`; + } + return `${from} ${to}`.trim(); + }; + var testSet = (set, version, options) => { + for (let i4 = 0; i4 < set.length; i4++) { + if (!set[i4].test(version)) { + return false; + } + } + if (version.prerelease.length && !options.includePrerelease) { + for (let i4 = 0; i4 < set.length; i4++) { + debug(set[i4].semver); + if (set[i4].semver === Comparator.ANY) { + continue; + } + if (set[i4].semver.prerelease.length > 0) { + const allowed = set[i4].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; + } + } + } + return false; + } + return true; + }; + } +}); + +// node_modules/semver/classes/comparator.js +var require_comparator = __commonJS({ + "node_modules/semver/classes/comparator.js"(exports2, module2) { + "use strict"; + var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); + var Comparator = class _Comparator { + static get ANY() { + return ANY; + } + constructor(comp, options) { + options = parseOptions(options); + if (comp instanceof _Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; + } + } + comp = comp.trim().split(/\s+/).join(" "); + debug("comparator", comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + if (this.semver === ANY) { + this.value = ""; + } else { + this.value = this.operator + this.semver.version; + } + debug("comp", this); + } + parse(comp) { + const r4 = this.options.loose ? re[t4.COMPARATORLOOSE] : re[t4.COMPARATOR]; + const m4 = comp.match(r4); + if (!m4) { + throw new TypeError(`Invalid comparator: ${comp}`); + } + this.operator = m4[1] !== void 0 ? m4[1] : ""; + if (this.operator === "=") { + this.operator = ""; + } + if (!m4[2]) { + this.semver = ANY; + } else { + this.semver = new SemVer(m4[2], this.options.loose); + } + } + toString() { + return this.value; + } + test(version) { + debug("Comparator.test", version, this.options.loose); + if (this.semver === ANY || version === ANY) { + return true; + } + if (typeof version === "string") { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; + } + } + return cmp(version, this.operator, this.semver, this.options); + } + intersects(comp, options) { + if (!(comp instanceof _Comparator)) { + throw new TypeError("a Comparator is required"); + } + if (this.operator === "") { + if (this.value === "") { + return true; + } + return new Range(comp.value, options).test(this.value); + } else if (comp.operator === "") { + if (comp.value === "") { + return true; + } + return new Range(this.value, options).test(comp.semver); + } + options = parseOptions(options); + if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) { + return false; + } + if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) { + return false; + } + if (this.operator.startsWith(">") && comp.operator.startsWith(">")) { + return true; + } + if (this.operator.startsWith("<") && comp.operator.startsWith("<")) { + return true; + } + if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) { + return true; + } + if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) { + return true; + } + if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) { + return true; + } + return false; + } + }; + module2.exports = Comparator; + var parseOptions = require_parse_options(); + var { safeRe: re, t: t4 } = require_re(); + var cmp = require_cmp(); + var debug = require_debug2(); + var SemVer = require_semver(); + var Range = require_range(); + } +}); + +// node_modules/semver/functions/satisfies.js +var require_satisfies = __commonJS({ + "node_modules/semver/functions/satisfies.js"(exports2, module2) { + "use strict"; + var Range = require_range(); + var satisfies = (version, range2, options) => { + try { + range2 = new Range(range2, options); + } catch (er) { + return false; + } + return range2.test(version); + }; + module2.exports = satisfies; + } +}); + +// node_modules/semver/ranges/to-comparators.js +var require_to_comparators = __commonJS({ + "node_modules/semver/ranges/to-comparators.js"(exports2, module2) { + "use strict"; + var Range = require_range(); + var toComparators = (range2, options) => new Range(range2, options).set.map((comp) => comp.map((c4) => c4.value).join(" ").trim().split(" ")); + module2.exports = toComparators; + } +}); + +// node_modules/semver/ranges/max-satisfying.js +var require_max_satisfying = __commonJS({ + "node_modules/semver/ranges/max-satisfying.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var Range = require_range(); + var maxSatisfying = (versions, range2, options) => { + let max = null; + let maxSV = null; + let rangeObj = null; + try { + rangeObj = new Range(range2, options); + } catch (er) { + return null; + } + versions.forEach((v4) => { + if (rangeObj.test(v4)) { + if (!max || maxSV.compare(v4) === -1) { + max = v4; + maxSV = new SemVer(max, options); + } + } + }); + return max; + }; + module2.exports = maxSatisfying; + } +}); + +// node_modules/semver/ranges/min-satisfying.js +var require_min_satisfying = __commonJS({ + "node_modules/semver/ranges/min-satisfying.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var Range = require_range(); + var minSatisfying = (versions, range2, options) => { + let min = null; + let minSV = null; + let rangeObj = null; + try { + rangeObj = new Range(range2, options); + } catch (er) { + return null; + } + versions.forEach((v4) => { + if (rangeObj.test(v4)) { + if (!min || minSV.compare(v4) === 1) { + min = v4; + minSV = new SemVer(min, options); + } + } + }); + return min; + }; + module2.exports = minSatisfying; + } +}); + +// node_modules/semver/ranges/min-version.js +var require_min_version = __commonJS({ + "node_modules/semver/ranges/min-version.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var Range = require_range(); + var gt = require_gt(); + var minVersion = (range2, loose) => { + range2 = new Range(range2, loose); + let minver = new SemVer("0.0.0"); + if (range2.test(minver)) { + return minver; + } + minver = new SemVer("0.0.0-0"); + if (range2.test(minver)) { + return minver; + } + minver = null; + for (let i4 = 0; i4 < range2.set.length; ++i4) { + const comparators = range2.set[i4]; + let setMin = null; + comparators.forEach((comparator) => { + const compver = new SemVer(comparator.semver.version); + switch (comparator.operator) { + case ">": + if (compver.prerelease.length === 0) { + compver.patch++; + } else { + compver.prerelease.push(0); + } + compver.raw = compver.format(); + /* fallthrough */ + case "": + case ">=": + if (!setMin || gt(compver, setMin)) { + setMin = compver; + } + break; + case "<": + case "<=": + break; + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`); + } + }); + if (setMin && (!minver || gt(minver, setMin))) { + minver = setMin; + } + } + if (minver && range2.test(minver)) { + return minver; + } + return null; + }; + module2.exports = minVersion; + } +}); + +// node_modules/semver/ranges/valid.js +var require_valid2 = __commonJS({ + "node_modules/semver/ranges/valid.js"(exports2, module2) { + "use strict"; + var Range = require_range(); + var validRange = (range2, options) => { + try { + return new Range(range2, options).range || "*"; + } catch (er) { + return null; + } + }; + module2.exports = validRange; + } +}); + +// node_modules/semver/ranges/outside.js +var require_outside = __commonJS({ + "node_modules/semver/ranges/outside.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var Comparator = require_comparator(); + var { ANY } = Comparator; + var Range = require_range(); + var satisfies = require_satisfies(); + var gt = require_gt(); + var lt = require_lt(); + var lte = require_lte(); + var gte = require_gte(); + var outside = (version, range2, hilo, options) => { + version = new SemVer(version, options); + range2 = new Range(range2, options); + let gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + if (satisfies(version, range2, options)) { + return false; + } + for (let i4 = 0; i4 < range2.set.length; ++i4) { + const comparators = range2.set[i4]; + let high = null; + let low = null; + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator(">=0.0.0"); + } + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator; + } + }); + if (high.operator === comp || high.operator === ecomp) { + return false; + } + if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; + } + } + return true; + }; + module2.exports = outside; + } +}); + +// node_modules/semver/ranges/gtr.js +var require_gtr = __commonJS({ + "node_modules/semver/ranges/gtr.js"(exports2, module2) { + "use strict"; + var outside = require_outside(); + var gtr = (version, range2, options) => outside(version, range2, ">", options); + module2.exports = gtr; + } +}); + +// node_modules/semver/ranges/ltr.js +var require_ltr = __commonJS({ + "node_modules/semver/ranges/ltr.js"(exports2, module2) { + "use strict"; + var outside = require_outside(); + var ltr = (version, range2, options) => outside(version, range2, "<", options); + module2.exports = ltr; + } +}); + +// node_modules/semver/ranges/intersects.js +var require_intersects = __commonJS({ + "node_modules/semver/ranges/intersects.js"(exports2, module2) { + "use strict"; + var Range = require_range(); + var intersects = (r1, r22, options) => { + r1 = new Range(r1, options); + r22 = new Range(r22, options); + return r1.intersects(r22, options); + }; + module2.exports = intersects; + } +}); + +// node_modules/semver/ranges/simplify.js +var require_simplify = __commonJS({ + "node_modules/semver/ranges/simplify.js"(exports2, module2) { + "use strict"; + var satisfies = require_satisfies(); + var compare = require_compare(); + module2.exports = (versions, range2, options) => { + const set = []; + let first = null; + let prev = null; + const v4 = versions.sort((a4, b4) => compare(a4, b4, options)); + for (const version of v4) { + const included = satisfies(version, range2, options); + if (included) { + prev = version; + if (!first) { + first = version; + } + } else { + if (prev) { + set.push([first, prev]); + } + prev = null; + first = null; + } + } + if (first) { + set.push([first, null]); + } + const ranges = []; + for (const [min, max] of set) { + if (min === max) { + ranges.push(min); + } else if (!max && min === v4[0]) { + ranges.push("*"); + } else if (!max) { + ranges.push(`>=${min}`); + } else if (min === v4[0]) { + ranges.push(`<=${max}`); + } else { + ranges.push(`${min} - ${max}`); + } + } + const simplified = ranges.join(" || "); + const original = typeof range2.raw === "string" ? range2.raw : String(range2); + return simplified.length < original.length ? simplified : range2; + }; + } +}); + +// node_modules/semver/ranges/subset.js +var require_subset = __commonJS({ + "node_modules/semver/ranges/subset.js"(exports2, module2) { + "use strict"; + var Range = require_range(); + var Comparator = require_comparator(); + var { ANY } = Comparator; + var satisfies = require_satisfies(); + var compare = require_compare(); + var subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true; + } + sub = new Range(sub, options); + dom = new Range(dom, options); + let sawNonNull = false; + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options); + sawNonNull = sawNonNull || isSub !== null; + if (isSub) { + continue OUTER; + } + } + if (sawNonNull) { + return false; + } + } + return true; + }; + var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")]; + var minimumVersion = [new Comparator(">=0.0.0")]; + var simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true; + } + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true; + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease; + } else { + sub = minimumVersion; + } + } + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true; + } else { + dom = minimumVersion; + } + } + const eqSet = /* @__PURE__ */ new Set(); + let gt, lt; + for (const c4 of sub) { + if (c4.operator === ">" || c4.operator === ">=") { + gt = higherGT(gt, c4, options); + } else if (c4.operator === "<" || c4.operator === "<=") { + lt = lowerLT(lt, c4, options); + } else { + eqSet.add(c4.semver); + } + } + if (eqSet.size > 1) { + return null; + } + let gtltComp; + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options); + if (gtltComp > 0) { + return null; + } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) { + return null; + } + } + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) { + return null; + } + if (lt && !satisfies(eq, String(lt), options)) { + return null; + } + for (const c4 of dom) { + if (!satisfies(eq, String(c4), options)) { + return false; + } + } + return true; + } + let higher, lower; + let hasDomLT, hasDomGT; + let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false; + let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false; + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false; + } + for (const c4 of dom) { + hasDomGT = hasDomGT || c4.operator === ">" || c4.operator === ">="; + hasDomLT = hasDomLT || c4.operator === "<" || c4.operator === "<="; + if (gt) { + if (needDomGTPre) { + if (c4.semver.prerelease && c4.semver.prerelease.length && c4.semver.major === needDomGTPre.major && c4.semver.minor === needDomGTPre.minor && c4.semver.patch === needDomGTPre.patch) { + needDomGTPre = false; + } + } + if (c4.operator === ">" || c4.operator === ">=") { + higher = higherGT(gt, c4, options); + if (higher === c4 && higher !== gt) { + return false; + } + } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c4), options)) { + return false; + } + } + if (lt) { + if (needDomLTPre) { + if (c4.semver.prerelease && c4.semver.prerelease.length && c4.semver.major === needDomLTPre.major && c4.semver.minor === needDomLTPre.minor && c4.semver.patch === needDomLTPre.patch) { + needDomLTPre = false; + } + } + if (c4.operator === "<" || c4.operator === "<=") { + lower = lowerLT(lt, c4, options); + if (lower === c4 && lower !== lt) { + return false; + } + } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c4), options)) { + return false; + } + } + if (!c4.operator && (lt || gt) && gtltComp !== 0) { + return false; + } + } + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false; + } + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false; + } + if (needDomGTPre || needDomLTPre) { + return false; + } + return true; + }; + var higherGT = (a4, b4, options) => { + if (!a4) { + return b4; + } + const comp = compare(a4.semver, b4.semver, options); + return comp > 0 ? a4 : comp < 0 ? b4 : b4.operator === ">" && a4.operator === ">=" ? b4 : a4; + }; + var lowerLT = (a4, b4, options) => { + if (!a4) { + return b4; + } + const comp = compare(a4.semver, b4.semver, options); + return comp < 0 ? a4 : comp > 0 ? b4 : b4.operator === "<" && a4.operator === "<=" ? b4 : a4; + }; + module2.exports = subset; + } +}); + +// node_modules/semver/index.js +var require_semver2 = __commonJS({ + "node_modules/semver/index.js"(exports2, module2) { + "use strict"; + var internalRe = require_re(); + var constants = require_constants7(); + var SemVer = require_semver(); + var identifiers = require_identifiers(); + var parse = require_parse2(); + var valid = require_valid(); + var clean = require_clean(); + var inc = require_inc(); + var diff = require_diff(); + var major = require_major(); + var minor = require_minor(); + var patch = require_patch(); + var prerelease = require_prerelease(); + var compare = require_compare(); + var rcompare = require_rcompare(); + var compareLoose = require_compare_loose(); + var compareBuild = require_compare_build(); + var sort = require_sort2(); + var rsort = require_rsort(); + var gt = require_gt(); + var lt = require_lt(); + var eq = require_eq(); + var neq = require_neq(); + var gte = require_gte(); + var lte = require_lte(); + var cmp = require_cmp(); + var coerce = require_coerce(); + var Comparator = require_comparator(); + var Range = require_range(); + var satisfies = require_satisfies(); + var toComparators = require_to_comparators(); + var maxSatisfying = require_max_satisfying(); + var minSatisfying = require_min_satisfying(); + var minVersion = require_min_version(); + var validRange = require_valid2(); + var outside = require_outside(); + var gtr = require_gtr(); + var ltr = require_ltr(); + var intersects = require_intersects(); + var simplifyRange = require_simplify(); + var subset = require_subset(); + module2.exports = { + parse, + valid, + clean, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt, + lt, + eq, + neq, + gte, + lte, + cmp, + coerce, + Comparator, + Range, + satisfies, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers + }; + } +}); + +// node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js +var require_asymmetricKeyDetailsSupported = __commonJS({ + "node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js"(exports2, module2) { + var semver = require_semver2(); + module2.exports = semver.satisfies(process.version, ">=15.7.0"); + } +}); + +// node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js +var require_rsaPssKeyDetailsSupported = __commonJS({ + "node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js"(exports2, module2) { + var semver = require_semver2(); + module2.exports = semver.satisfies(process.version, ">=16.9.0"); + } +}); + +// node_modules/jsonwebtoken/lib/validateAsymmetricKey.js +var require_validateAsymmetricKey = __commonJS({ + "node_modules/jsonwebtoken/lib/validateAsymmetricKey.js"(exports2, module2) { + var ASYMMETRIC_KEY_DETAILS_SUPPORTED = require_asymmetricKeyDetailsSupported(); + var RSA_PSS_KEY_DETAILS_SUPPORTED = require_rsaPssKeyDetailsSupported(); + var allowedAlgorithmsForKeys = { + "ec": ["ES256", "ES384", "ES512"], + "rsa": ["RS256", "PS256", "RS384", "PS384", "RS512", "PS512"], + "rsa-pss": ["PS256", "PS384", "PS512"] + }; + var allowedCurves = { + ES256: "prime256v1", + ES384: "secp384r1", + ES512: "secp521r1" + }; + module2.exports = function(algorithm, key) { + if (!algorithm || !key) return; + const keyType = key.asymmetricKeyType; + if (!keyType) return; + const allowedAlgorithms = allowedAlgorithmsForKeys[keyType]; + if (!allowedAlgorithms) { + throw new Error(`Unknown key type "${keyType}".`); + } + if (!allowedAlgorithms.includes(algorithm)) { + throw new Error(`"alg" parameter for "${keyType}" key type must be one of: ${allowedAlgorithms.join(", ")}.`); + } + if (ASYMMETRIC_KEY_DETAILS_SUPPORTED) { + switch (keyType) { + case "ec": + const keyCurve = key.asymmetricKeyDetails.namedCurve; + const allowedCurve = allowedCurves[algorithm]; + if (keyCurve !== allowedCurve) { + throw new Error(`"alg" parameter "${algorithm}" requires curve "${allowedCurve}".`); + } + break; + case "rsa-pss": + if (RSA_PSS_KEY_DETAILS_SUPPORTED) { + const length = parseInt(algorithm.slice(-3), 10); + const { hashAlgorithm, mgf1HashAlgorithm, saltLength } = key.asymmetricKeyDetails; + if (hashAlgorithm !== `sha${length}` || mgf1HashAlgorithm !== hashAlgorithm) { + throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${algorithm}.`); + } + if (saltLength !== void 0 && saltLength > length >> 3) { + throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${algorithm}.`); + } + } + break; + } + } + }; + } +}); + +// node_modules/jsonwebtoken/lib/psSupported.js +var require_psSupported = __commonJS({ + "node_modules/jsonwebtoken/lib/psSupported.js"(exports2, module2) { + var semver = require_semver2(); + module2.exports = semver.satisfies(process.version, "^6.12.0 || >=8.0.0"); + } +}); + +// node_modules/jsonwebtoken/verify.js +var require_verify = __commonJS({ + "node_modules/jsonwebtoken/verify.js"(exports2, module2) { + var JsonWebTokenError = require_JsonWebTokenError(); + var NotBeforeError = require_NotBeforeError(); + var TokenExpiredError = require_TokenExpiredError(); + var decode2 = require_decode(); + var timespan = require_timespan(); + var validateAsymmetricKey = require_validateAsymmetricKey(); + var PS_SUPPORTED = require_psSupported(); + var jws = require_jws(); + var { KeyObject, createSecretKey, createPublicKey } = require("crypto"); + var PUB_KEY_ALGS = ["RS256", "RS384", "RS512"]; + var EC_KEY_ALGS = ["ES256", "ES384", "ES512"]; + var RSA_KEY_ALGS = ["RS256", "RS384", "RS512"]; + var HS_ALGS = ["HS256", "HS384", "HS512"]; + if (PS_SUPPORTED) { + PUB_KEY_ALGS.splice(PUB_KEY_ALGS.length, 0, "PS256", "PS384", "PS512"); + RSA_KEY_ALGS.splice(RSA_KEY_ALGS.length, 0, "PS256", "PS384", "PS512"); + } + module2.exports = function(jwtString, secretOrPublicKey, options, callback) { + if (typeof options === "function" && !callback) { + callback = options; + options = {}; + } + if (!options) { + options = {}; + } + options = Object.assign({}, options); + let done; + if (callback) { + done = callback; + } else { + done = function(err, data2) { + if (err) throw err; + return data2; + }; + } + if (options.clockTimestamp && typeof options.clockTimestamp !== "number") { + return done(new JsonWebTokenError("clockTimestamp must be a number")); + } + if (options.nonce !== void 0 && (typeof options.nonce !== "string" || options.nonce.trim() === "")) { + return done(new JsonWebTokenError("nonce must be a non-empty string")); + } + if (options.allowInvalidAsymmetricKeyTypes !== void 0 && typeof options.allowInvalidAsymmetricKeyTypes !== "boolean") { + return done(new JsonWebTokenError("allowInvalidAsymmetricKeyTypes must be a boolean")); + } + const clockTimestamp = options.clockTimestamp || Math.floor(Date.now() / 1e3); + if (!jwtString) { + return done(new JsonWebTokenError("jwt must be provided")); + } + if (typeof jwtString !== "string") { + return done(new JsonWebTokenError("jwt must be a string")); + } + const parts = jwtString.split("."); + if (parts.length !== 3) { + return done(new JsonWebTokenError("jwt malformed")); + } + let decodedToken; + try { + decodedToken = decode2(jwtString, { complete: true }); + } catch (err) { + return done(err); + } + if (!decodedToken) { + return done(new JsonWebTokenError("invalid token")); + } + const header = decodedToken.header; + let getSecret; + if (typeof secretOrPublicKey === "function") { + if (!callback) { + return done(new JsonWebTokenError("verify must be called asynchronous if secret or public key is provided as a callback")); + } + getSecret = secretOrPublicKey; + } else { + getSecret = function(header2, secretCallback) { + return secretCallback(null, secretOrPublicKey); + }; + } + return getSecret(header, function(err, secretOrPublicKey2) { + if (err) { + return done(new JsonWebTokenError("error in secret or public key callback: " + err.message)); + } + const hasSignature = parts[2].trim() !== ""; + if (!hasSignature && secretOrPublicKey2) { + return done(new JsonWebTokenError("jwt signature is required")); + } + if (hasSignature && !secretOrPublicKey2) { + return done(new JsonWebTokenError("secret or public key must be provided")); + } + if (!hasSignature && !options.algorithms) { + return done(new JsonWebTokenError('please specify "none" in "algorithms" to verify unsigned tokens')); + } + if (secretOrPublicKey2 != null && !(secretOrPublicKey2 instanceof KeyObject)) { + try { + secretOrPublicKey2 = createPublicKey(secretOrPublicKey2); + } catch (_) { + try { + secretOrPublicKey2 = createSecretKey(typeof secretOrPublicKey2 === "string" ? Buffer.from(secretOrPublicKey2) : secretOrPublicKey2); + } catch (_2) { + return done(new JsonWebTokenError("secretOrPublicKey is not valid key material")); + } + } + } + if (!options.algorithms) { + if (secretOrPublicKey2.type === "secret") { + options.algorithms = HS_ALGS; + } else if (["rsa", "rsa-pss"].includes(secretOrPublicKey2.asymmetricKeyType)) { + options.algorithms = RSA_KEY_ALGS; + } else if (secretOrPublicKey2.asymmetricKeyType === "ec") { + options.algorithms = EC_KEY_ALGS; + } else { + options.algorithms = PUB_KEY_ALGS; + } + } + if (options.algorithms.indexOf(decodedToken.header.alg) === -1) { + return done(new JsonWebTokenError("invalid algorithm")); + } + if (header.alg.startsWith("HS") && secretOrPublicKey2.type !== "secret") { + return done(new JsonWebTokenError(`secretOrPublicKey must be a symmetric key when using ${header.alg}`)); + } else if (/^(?:RS|PS|ES)/.test(header.alg) && secretOrPublicKey2.type !== "public") { + return done(new JsonWebTokenError(`secretOrPublicKey must be an asymmetric key when using ${header.alg}`)); + } + if (!options.allowInvalidAsymmetricKeyTypes) { + try { + validateAsymmetricKey(header.alg, secretOrPublicKey2); + } catch (e4) { + return done(e4); + } + } + let valid; + try { + valid = jws.verify(jwtString, decodedToken.header.alg, secretOrPublicKey2); + } catch (e4) { + return done(e4); + } + if (!valid) { + return done(new JsonWebTokenError("invalid signature")); + } + const payload2 = decodedToken.payload; + if (typeof payload2.nbf !== "undefined" && !options.ignoreNotBefore) { + if (typeof payload2.nbf !== "number") { + return done(new JsonWebTokenError("invalid nbf value")); + } + if (payload2.nbf > clockTimestamp + (options.clockTolerance || 0)) { + return done(new NotBeforeError("jwt not active", new Date(payload2.nbf * 1e3))); + } + } + if (typeof payload2.exp !== "undefined" && !options.ignoreExpiration) { + if (typeof payload2.exp !== "number") { + return done(new JsonWebTokenError("invalid exp value")); + } + if (clockTimestamp >= payload2.exp + (options.clockTolerance || 0)) { + return done(new TokenExpiredError("jwt expired", new Date(payload2.exp * 1e3))); + } + } + if (options.audience) { + const audiences = Array.isArray(options.audience) ? options.audience : [options.audience]; + const target = Array.isArray(payload2.aud) ? payload2.aud : [payload2.aud]; + const match = target.some(function(targetAudience) { + return audiences.some(function(audience) { + return audience instanceof RegExp ? audience.test(targetAudience) : audience === targetAudience; + }); + }); + if (!match) { + return done(new JsonWebTokenError("jwt audience invalid. expected: " + audiences.join(" or "))); + } + } + if (options.issuer) { + const invalid_issuer = typeof options.issuer === "string" && payload2.iss !== options.issuer || Array.isArray(options.issuer) && options.issuer.indexOf(payload2.iss) === -1; + if (invalid_issuer) { + return done(new JsonWebTokenError("jwt issuer invalid. expected: " + options.issuer)); + } + } + if (options.subject) { + if (payload2.sub !== options.subject) { + return done(new JsonWebTokenError("jwt subject invalid. expected: " + options.subject)); + } + } + if (options.jwtid) { + if (payload2.jti !== options.jwtid) { + return done(new JsonWebTokenError("jwt jwtid invalid. expected: " + options.jwtid)); + } + } + if (options.nonce) { + if (payload2.nonce !== options.nonce) { + return done(new JsonWebTokenError("jwt nonce invalid. expected: " + options.nonce)); + } + } + if (options.maxAge) { + if (typeof payload2.iat !== "number") { + return done(new JsonWebTokenError("iat required when maxAge is specified")); + } + const maxAgeTimestamp = timespan(options.maxAge, payload2.iat); + if (typeof maxAgeTimestamp === "undefined") { + return done(new JsonWebTokenError('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); + } + if (clockTimestamp >= maxAgeTimestamp + (options.clockTolerance || 0)) { + return done(new TokenExpiredError("maxAge exceeded", new Date(maxAgeTimestamp * 1e3))); + } + } + if (options.complete === true) { + const signature = decodedToken.signature; + return done(null, { + header, + payload: payload2, + signature + }); + } + return done(null, payload2); + }); + }; + } +}); + +// node_modules/lodash.includes/index.js +var require_lodash = __commonJS({ + "node_modules/lodash.includes/index.js"(exports2, module2) { + var INFINITY = 1 / 0; + var MAX_SAFE_INTEGER = 9007199254740991; + var MAX_INTEGER = 17976931348623157e292; + var NAN = 0 / 0; + var argsTag = "[object Arguments]"; + var funcTag = "[object Function]"; + var genTag = "[object GeneratorFunction]"; + var stringTag = "[object String]"; + var symbolTag = "[object Symbol]"; + var reTrim = /^\s+|\s+$/g; + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + var reIsBinary = /^0b[01]+$/i; + var reIsOctal = /^0o[0-7]+$/i; + var reIsUint = /^(?:0|[1-9]\d*)$/; + var freeParseInt = parseInt; + function arrayMap(array, iteratee) { + var index = -1, length = array ? array.length : 0, result = Array(length); + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, index = fromIndex + (fromRight ? 1 : -1); + while (fromRight ? index-- : ++index < length) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, length = array.length; + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + function baseIsNaN(value) { + return value !== value; + } + function baseTimes(n4, iteratee) { + var index = -1, result = Array(n4); + while (++index < n4) { + result[index] = iteratee(index); + } + return result; + } + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var objectToString = objectProto.toString; + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + var nativeKeys = overArg(Object.keys, Object); + var nativeMax = Math.max; + function arrayLikeKeys(value, inherited) { + var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : []; + var length = result.length, skipIndexes = !!length; + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) { + result.push(key); + } + } + return result; + } + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != "constructor") { + result.push(key); + } + } + return result; + } + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); + } + function isPrototype(value) { + var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; + return value === proto; + } + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0; + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1; + } + function isArguments(value) { + return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag); + } + var isArray = Array.isArray; + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + function isFunction(value) { + var tag2 = isObject(value) ? objectToString.call(value) : ""; + return tag2 == funcTag || tag2 == genTag; + } + function isLength(value) { + return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + function isObject(value) { + var type = typeof value; + return !!value && (type == "object" || type == "function"); + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isString(value) { + return typeof value == "string" || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag; + } + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; + } + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = value < 0 ? -1 : 1; + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + function toInteger(value) { + var result = toFinite(value), remainder = result % 1; + return result === result ? remainder ? result - remainder : result : 0; + } + function toNumber(value) { + if (typeof value == "number") { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == "function" ? value.valueOf() : value; + value = isObject(other) ? other + "" : other; + } + if (typeof value != "string") { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ""); + var isBinary = reIsBinary.test(value); + return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + } + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + function values(object) { + return object ? baseValues(object, keys(object)) : []; + } + module2.exports = includes; + } +}); + +// node_modules/lodash.isboolean/index.js +var require_lodash2 = __commonJS({ + "node_modules/lodash.isboolean/index.js"(exports2, module2) { + var boolTag = "[object Boolean]"; + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + function isBoolean(value) { + return value === true || value === false || isObjectLike(value) && objectToString.call(value) == boolTag; + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + module2.exports = isBoolean; + } +}); + +// node_modules/lodash.isinteger/index.js +var require_lodash3 = __commonJS({ + "node_modules/lodash.isinteger/index.js"(exports2, module2) { + var INFINITY = 1 / 0; + var MAX_INTEGER = 17976931348623157e292; + var NAN = 0 / 0; + var symbolTag = "[object Symbol]"; + var reTrim = /^\s+|\s+$/g; + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + var reIsBinary = /^0b[01]+$/i; + var reIsOctal = /^0o[0-7]+$/i; + var freeParseInt = parseInt; + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + function isInteger(value) { + return typeof value == "number" && value == toInteger(value); + } + function isObject(value) { + var type = typeof value; + return !!value && (type == "object" || type == "function"); + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; + } + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = value < 0 ? -1 : 1; + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + function toInteger(value) { + var result = toFinite(value), remainder = result % 1; + return result === result ? remainder ? result - remainder : result : 0; + } + function toNumber(value) { + if (typeof value == "number") { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == "function" ? value.valueOf() : value; + value = isObject(other) ? other + "" : other; + } + if (typeof value != "string") { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ""); + var isBinary = reIsBinary.test(value); + return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + } + module2.exports = isInteger; + } +}); + +// node_modules/lodash.isnumber/index.js +var require_lodash4 = __commonJS({ + "node_modules/lodash.isnumber/index.js"(exports2, module2) { + var numberTag = "[object Number]"; + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isNumber(value) { + return typeof value == "number" || isObjectLike(value) && objectToString.call(value) == numberTag; + } + module2.exports = isNumber; + } +}); + +// node_modules/lodash.isplainobject/index.js +var require_lodash5 = __commonJS({ + "node_modules/lodash.isplainobject/index.js"(exports2, module2) { + var objectTag = "[object Object]"; + function isHostObject(value) { + var result = false; + if (value != null && typeof value.toString != "function") { + try { + result = !!(value + ""); + } catch (e4) { + } + } + return result; + } + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + var funcProto = Function.prototype; + var objectProto = Object.prototype; + var funcToString = funcProto.toString; + var hasOwnProperty = objectProto.hasOwnProperty; + var objectCtorString = funcToString.call(Object); + var objectToString = objectProto.toString; + var getPrototype = overArg(Object.getPrototypeOf, Object); + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isPlainObject(value) { + if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; + } + module2.exports = isPlainObject; + } +}); + +// node_modules/lodash.isstring/index.js +var require_lodash6 = __commonJS({ + "node_modules/lodash.isstring/index.js"(exports2, module2) { + var stringTag = "[object String]"; + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + var isArray = Array.isArray; + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isString(value) { + return typeof value == "string" || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag; + } + module2.exports = isString; + } +}); + +// node_modules/lodash.once/index.js +var require_lodash7 = __commonJS({ + "node_modules/lodash.once/index.js"(exports2, module2) { + var FUNC_ERROR_TEXT = "Expected a function"; + var INFINITY = 1 / 0; + var MAX_INTEGER = 17976931348623157e292; + var NAN = 0 / 0; + var symbolTag = "[object Symbol]"; + var reTrim = /^\s+|\s+$/g; + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + var reIsBinary = /^0b[01]+$/i; + var reIsOctal = /^0o[0-7]+$/i; + var freeParseInt = parseInt; + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + function before(n4, func) { + var result; + if (typeof func != "function") { + throw new TypeError(FUNC_ERROR_TEXT); + } + n4 = toInteger(n4); + return function() { + if (--n4 > 0) { + result = func.apply(this, arguments); + } + if (n4 <= 1) { + func = void 0; + } + return result; + }; + } + function once(func) { + return before(2, func); + } + function isObject(value) { + var type = typeof value; + return !!value && (type == "object" || type == "function"); + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; + } + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = value < 0 ? -1 : 1; + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + function toInteger(value) { + var result = toFinite(value), remainder = result % 1; + return result === result ? remainder ? result - remainder : result : 0; + } + function toNumber(value) { + if (typeof value == "number") { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == "function" ? value.valueOf() : value; + value = isObject(other) ? other + "" : other; + } + if (typeof value != "string") { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ""); + var isBinary = reIsBinary.test(value); + return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + } + module2.exports = once; + } +}); + +// node_modules/jsonwebtoken/sign.js +var require_sign = __commonJS({ + "node_modules/jsonwebtoken/sign.js"(exports2, module2) { + var timespan = require_timespan(); + var PS_SUPPORTED = require_psSupported(); + var validateAsymmetricKey = require_validateAsymmetricKey(); + var jws = require_jws(); + var includes = require_lodash(); + var isBoolean = require_lodash2(); + var isInteger = require_lodash3(); + var isNumber = require_lodash4(); + var isPlainObject = require_lodash5(); + var isString = require_lodash6(); + var once = require_lodash7(); + var { KeyObject, createSecretKey, createPrivateKey } = require("crypto"); + var SUPPORTED_ALGS = ["RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "HS256", "HS384", "HS512", "none"]; + if (PS_SUPPORTED) { + SUPPORTED_ALGS.splice(3, 0, "PS256", "PS384", "PS512"); + } + var sign_options_schema = { + expiresIn: { isValid: function(value) { + return isInteger(value) || isString(value) && value; + }, message: '"expiresIn" should be a number of seconds or string representing a timespan' }, + notBefore: { isValid: function(value) { + return isInteger(value) || isString(value) && value; + }, message: '"notBefore" should be a number of seconds or string representing a timespan' }, + audience: { isValid: function(value) { + return isString(value) || Array.isArray(value); + }, message: '"audience" must be a string or array' }, + algorithm: { isValid: includes.bind(null, SUPPORTED_ALGS), message: '"algorithm" must be a valid string enum value' }, + header: { isValid: isPlainObject, message: '"header" must be an object' }, + encoding: { isValid: isString, message: '"encoding" must be a string' }, + issuer: { isValid: isString, message: '"issuer" must be a string' }, + subject: { isValid: isString, message: '"subject" must be a string' }, + jwtid: { isValid: isString, message: '"jwtid" must be a string' }, + noTimestamp: { isValid: isBoolean, message: '"noTimestamp" must be a boolean' }, + keyid: { isValid: isString, message: '"keyid" must be a string' }, + mutatePayload: { isValid: isBoolean, message: '"mutatePayload" must be a boolean' }, + allowInsecureKeySizes: { isValid: isBoolean, message: '"allowInsecureKeySizes" must be a boolean' }, + allowInvalidAsymmetricKeyTypes: { isValid: isBoolean, message: '"allowInvalidAsymmetricKeyTypes" must be a boolean' } + }; + var registered_claims_schema = { + iat: { isValid: isNumber, message: '"iat" should be a number of seconds' }, + exp: { isValid: isNumber, message: '"exp" should be a number of seconds' }, + nbf: { isValid: isNumber, message: '"nbf" should be a number of seconds' } + }; + function validate(schema, allowUnknown, object, parameterName) { + if (!isPlainObject(object)) { + throw new Error('Expected "' + parameterName + '" to be a plain object.'); + } + Object.keys(object).forEach(function(key) { + const validator = schema[key]; + if (!validator) { + if (!allowUnknown) { + throw new Error('"' + key + '" is not allowed in "' + parameterName + '"'); + } + return; + } + if (!validator.isValid(object[key])) { + throw new Error(validator.message); + } + }); + } + function validateOptions(options) { + return validate(sign_options_schema, false, options, "options"); + } + function validatePayload(payload2) { + return validate(registered_claims_schema, true, payload2, "payload"); + } + var options_to_payload = { + "audience": "aud", + "issuer": "iss", + "subject": "sub", + "jwtid": "jti" + }; + var options_for_objects = [ + "expiresIn", + "notBefore", + "noTimestamp", + "audience", + "issuer", + "subject", + "jwtid" + ]; + module2.exports = function(payload2, secretOrPrivateKey, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } else { + options = options || {}; + } + const isObjectPayload = typeof payload2 === "object" && !Buffer.isBuffer(payload2); + const header = Object.assign({ + alg: options.algorithm || "HS256", + typ: isObjectPayload ? "JWT" : void 0, + kid: options.keyid + }, options.header); + function failure(err) { + if (callback) { + return callback(err); + } + throw err; + } + if (!secretOrPrivateKey && options.algorithm !== "none") { + return failure(new Error("secretOrPrivateKey must have a value")); + } + if (secretOrPrivateKey != null && !(secretOrPrivateKey instanceof KeyObject)) { + try { + secretOrPrivateKey = createPrivateKey(secretOrPrivateKey); + } catch (_) { + try { + secretOrPrivateKey = createSecretKey(typeof secretOrPrivateKey === "string" ? Buffer.from(secretOrPrivateKey) : secretOrPrivateKey); + } catch (_2) { + return failure(new Error("secretOrPrivateKey is not valid key material")); + } + } + } + if (header.alg.startsWith("HS") && secretOrPrivateKey.type !== "secret") { + return failure(new Error(`secretOrPrivateKey must be a symmetric key when using ${header.alg}`)); + } else if (/^(?:RS|PS|ES)/.test(header.alg)) { + if (secretOrPrivateKey.type !== "private") { + return failure(new Error(`secretOrPrivateKey must be an asymmetric key when using ${header.alg}`)); + } + if (!options.allowInsecureKeySizes && !header.alg.startsWith("ES") && secretOrPrivateKey.asymmetricKeyDetails !== void 0 && //KeyObject.asymmetricKeyDetails is supported in Node 15+ + secretOrPrivateKey.asymmetricKeyDetails.modulusLength < 2048) { + return failure(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`)); + } + } + if (typeof payload2 === "undefined") { + return failure(new Error("payload is required")); + } else if (isObjectPayload) { + try { + validatePayload(payload2); + } catch (error2) { + return failure(error2); + } + if (!options.mutatePayload) { + payload2 = Object.assign({}, payload2); + } + } else { + const invalid_options = options_for_objects.filter(function(opt) { + return typeof options[opt] !== "undefined"; + }); + if (invalid_options.length > 0) { + return failure(new Error("invalid " + invalid_options.join(",") + " option for " + typeof payload2 + " payload")); + } + } + if (typeof payload2.exp !== "undefined" && typeof options.expiresIn !== "undefined") { + return failure(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.')); + } + if (typeof payload2.nbf !== "undefined" && typeof options.notBefore !== "undefined") { + return failure(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.')); + } + try { + validateOptions(options); + } catch (error2) { + return failure(error2); + } + if (!options.allowInvalidAsymmetricKeyTypes) { + try { + validateAsymmetricKey(header.alg, secretOrPrivateKey); + } catch (error2) { + return failure(error2); + } + } + const timestamp = payload2.iat || Math.floor(Date.now() / 1e3); + if (options.noTimestamp) { + delete payload2.iat; + } else if (isObjectPayload) { + payload2.iat = timestamp; + } + if (typeof options.notBefore !== "undefined") { + try { + payload2.nbf = timespan(options.notBefore, timestamp); + } catch (err) { + return failure(err); + } + if (typeof payload2.nbf === "undefined") { + return failure(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); + } + } + if (typeof options.expiresIn !== "undefined" && typeof payload2 === "object") { + try { + payload2.exp = timespan(options.expiresIn, timestamp); + } catch (err) { + return failure(err); + } + if (typeof payload2.exp === "undefined") { + return failure(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); + } + } + Object.keys(options_to_payload).forEach(function(key) { + const claim = options_to_payload[key]; + if (typeof options[key] !== "undefined") { + if (typeof payload2[claim] !== "undefined") { + return failure(new Error('Bad "options.' + key + '" option. The payload already has an "' + claim + '" property.')); + } + payload2[claim] = options[key]; + } + }); + const encoding = options.encoding || "utf8"; + if (typeof callback === "function") { + callback = callback && once(callback); + jws.createSign({ + header, + privateKey: secretOrPrivateKey, + payload: payload2, + encoding + }).once("error", callback).once("done", function(signature) { + if (!options.allowInsecureKeySizes && /^(?:RS|PS)/.test(header.alg) && signature.length < 256) { + return callback(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`)); + } + callback(null, signature); + }); + } else { + let signature = jws.sign({ header, payload: payload2, secret: secretOrPrivateKey, encoding }); + if (!options.allowInsecureKeySizes && /^(?:RS|PS)/.test(header.alg) && signature.length < 256) { + throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`); + } + return signature; + } + }; + } +}); + +// node_modules/jsonwebtoken/index.js +var require_jsonwebtoken = __commonJS({ + "node_modules/jsonwebtoken/index.js"(exports2, module2) { + module2.exports = { + decode: require_decode(), + verify: require_verify(), + sign: require_sign(), + JsonWebTokenError: require_JsonWebTokenError(), + NotBeforeError: require_NotBeforeError(), + TokenExpiredError: require_TokenExpiredError() + }; + } +}); + +// node_modules/dotenv/package.json +var require_package3 = __commonJS({ + "node_modules/dotenv/package.json"(exports2, module2) { + module2.exports = { + name: "dotenv", + version: "17.2.3", + description: "Loads environment variables from .env file", + main: "lib/main.js", + types: "lib/main.d.ts", + exports: { + ".": { + types: "./lib/main.d.ts", + require: "./lib/main.js", + default: "./lib/main.js" + }, + "./config": "./config.js", + "./config.js": "./config.js", + "./lib/env-options": "./lib/env-options.js", + "./lib/env-options.js": "./lib/env-options.js", + "./lib/cli-options": "./lib/cli-options.js", + "./lib/cli-options.js": "./lib/cli-options.js", + "./package.json": "./package.json" + }, + scripts: { + "dts-check": "tsc --project tests/types/tsconfig.json", + lint: "standard", + pretest: "npm run lint && npm run dts-check", + test: "tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000", + "test:coverage": "tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov", + prerelease: "npm test", + release: "standard-version" + }, + repository: { + type: "git", + url: "git://github.com/motdotla/dotenv.git" + }, + homepage: "https://github.com/motdotla/dotenv#readme", + funding: "https://dotenvx.com", + keywords: [ + "dotenv", + "env", + ".env", + "environment", + "variables", + "config", + "settings" + ], + readmeFilename: "README.md", + license: "BSD-2-Clause", + devDependencies: { + "@types/node": "^18.11.3", + decache: "^4.6.2", + sinon: "^14.0.1", + standard: "^17.0.0", + "standard-version": "^9.5.0", + tap: "^19.2.0", + typescript: "^4.8.4" + }, + engines: { + node: ">=12" + }, + browser: { + fs: false + } + }; + } +}); + +// node_modules/dotenv/lib/main.js +var require_main = __commonJS({ + "node_modules/dotenv/lib/main.js"(exports2, module2) { + var fs = require("fs"); + var path = require("path"); + var os = require("os"); + var crypto2 = require("crypto"); + var packageJson = require_package3(); + var version = packageJson.version; + var TIPS = [ + "\u{1F510} encrypt with Dotenvx: https://dotenvx.com", + "\u{1F510} prevent committing .env to code: https://dotenvx.com/precommit", + "\u{1F510} prevent building .env in docker: https://dotenvx.com/prebuild", + "\u{1F4E1} add observability to secrets: https://dotenvx.com/ops", + "\u{1F465} sync secrets across teammates & machines: https://dotenvx.com/ops", + "\u{1F5C2}\uFE0F backup and recover secrets: https://dotenvx.com/ops", + "\u2705 audit secrets and track compliance: https://dotenvx.com/ops", + "\u{1F504} add secrets lifecycle management: https://dotenvx.com/ops", + "\u{1F511} add access controls to secrets: https://dotenvx.com/ops", + "\u{1F6E0}\uFE0F run anywhere with `dotenvx run -- yourcommand`", + "\u2699\uFE0F specify custom .env file path with { path: '/custom/path/.env' }", + "\u2699\uFE0F enable debug logging with { debug: true }", + "\u2699\uFE0F override existing env vars with { override: true }", + "\u2699\uFE0F suppress all logs with { quiet: true }", + "\u2699\uFE0F write to custom object with { processEnv: myObject }", + "\u2699\uFE0F load multiple .env files with { path: ['.env.local', '.env'] }" + ]; + function _getRandomTip() { + return TIPS[Math.floor(Math.random() * TIPS.length)]; + } + function parseBoolean2(value) { + if (typeof value === "string") { + return !["false", "0", "no", "off", ""].includes(value.toLowerCase()); + } + return Boolean(value); + } + function supportsAnsi() { + return process.stdout.isTTY; + } + function dim(text) { + return supportsAnsi() ? `\x1B[2m${text}\x1B[0m` : text; + } + var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg; + function parse(src) { + const obj = {}; + let lines = src.toString(); + lines = lines.replace(/\r\n?/mg, "\n"); + let match; + while ((match = LINE.exec(lines)) != null) { + const key = match[1]; + let value = match[2] || ""; + value = value.trim(); + const maybeQuote = value[0]; + value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2"); + if (maybeQuote === '"') { + value = value.replace(/\\n/g, "\n"); + value = value.replace(/\\r/g, "\r"); + } + obj[key] = value; + } + return obj; + } + function _parseVault(options) { + options = options || {}; + const vaultPath = _vaultPath(options); + options.path = vaultPath; + const result = DotenvModule.configDotenv(options); + if (!result.parsed) { + const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`); + err.code = "MISSING_DATA"; + throw err; + } + const keys = _dotenvKey(options).split(","); + const length = keys.length; + let decrypted; + for (let i4 = 0; i4 < length; i4++) { + try { + const key = keys[i4].trim(); + const attrs = _instructions(result, key); + decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key); + break; + } catch (error2) { + if (i4 + 1 >= length) { + throw error2; + } + } + } + return DotenvModule.parse(decrypted); + } + function _warn(message2) { + console.error(`[dotenv@${version}][WARN] ${message2}`); + } + function _debug(message2) { + console.log(`[dotenv@${version}][DEBUG] ${message2}`); + } + function _log(message2) { + console.log(`[dotenv@${version}] ${message2}`); + } + function _dotenvKey(options) { + if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) { + return options.DOTENV_KEY; + } + if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) { + return process.env.DOTENV_KEY; + } + return ""; + } + function _instructions(result, dotenvKey) { + let uri; + try { + uri = new URL(dotenvKey); + } catch (error2) { + if (error2.code === "ERR_INVALID_URL") { + const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development"); + err.code = "INVALID_DOTENV_KEY"; + throw err; + } + throw error2; + } + const key = uri.password; + if (!key) { + const err = new Error("INVALID_DOTENV_KEY: Missing key part"); + err.code = "INVALID_DOTENV_KEY"; + throw err; + } + const environment = uri.searchParams.get("environment"); + if (!environment) { + const err = new Error("INVALID_DOTENV_KEY: Missing environment part"); + err.code = "INVALID_DOTENV_KEY"; + throw err; + } + const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`; + const ciphertext = result.parsed[environmentKey]; + if (!ciphertext) { + const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`); + err.code = "NOT_FOUND_DOTENV_ENVIRONMENT"; + throw err; + } + return { ciphertext, key }; + } + function _vaultPath(options) { + let possibleVaultPath = null; + if (options && options.path && options.path.length > 0) { + if (Array.isArray(options.path)) { + for (const filepath of options.path) { + if (fs.existsSync(filepath)) { + possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`; + } + } + } else { + possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`; + } + } else { + possibleVaultPath = path.resolve(process.cwd(), ".env.vault"); + } + if (fs.existsSync(possibleVaultPath)) { + return possibleVaultPath; + } + return null; + } + function _resolveHome(envPath) { + return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath; + } + function _configVault(options) { + const debug = parseBoolean2(process.env.DOTENV_CONFIG_DEBUG || options && options.debug); + const quiet = parseBoolean2(process.env.DOTENV_CONFIG_QUIET || options && options.quiet); + if (debug || !quiet) { + _log("Loading env from encrypted .env.vault"); + } + const parsed = DotenvModule._parseVault(options); + let processEnv = process.env; + if (options && options.processEnv != null) { + processEnv = options.processEnv; + } + DotenvModule.populate(processEnv, parsed, options); + return { parsed }; + } + function configDotenv(options) { + const dotenvPath = path.resolve(process.cwd(), ".env"); + let encoding = "utf8"; + let processEnv = process.env; + if (options && options.processEnv != null) { + processEnv = options.processEnv; + } + let debug = parseBoolean2(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug); + let quiet = parseBoolean2(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet); + if (options && options.encoding) { + encoding = options.encoding; + } else { + if (debug) { + _debug("No encoding is specified. UTF-8 is used by default"); + } + } + let optionPaths = [dotenvPath]; + if (options && options.path) { + if (!Array.isArray(options.path)) { + optionPaths = [_resolveHome(options.path)]; + } else { + optionPaths = []; + for (const filepath of options.path) { + optionPaths.push(_resolveHome(filepath)); + } + } + } + let lastError; + const parsedAll = {}; + for (const path2 of optionPaths) { + try { + const parsed = DotenvModule.parse(fs.readFileSync(path2, { encoding })); + DotenvModule.populate(parsedAll, parsed, options); + } catch (e4) { + if (debug) { + _debug(`Failed to load ${path2} ${e4.message}`); + } + lastError = e4; + } + } + const populated = DotenvModule.populate(processEnv, parsedAll, options); + debug = parseBoolean2(processEnv.DOTENV_CONFIG_DEBUG || debug); + quiet = parseBoolean2(processEnv.DOTENV_CONFIG_QUIET || quiet); + if (debug || !quiet) { + const keysCount = Object.keys(populated).length; + const shortPaths = []; + for (const filePath of optionPaths) { + try { + const relative2 = path.relative(process.cwd(), filePath); + shortPaths.push(relative2); + } catch (e4) { + if (debug) { + _debug(`Failed to load ${filePath} ${e4.message}`); + } + lastError = e4; + } + } + _log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim(`-- tip: ${_getRandomTip()}`)}`); + } + if (lastError) { + return { parsed: parsedAll, error: lastError }; + } else { + return { parsed: parsedAll }; + } + } + function config(options) { + if (_dotenvKey(options).length === 0) { + return DotenvModule.configDotenv(options); + } + const vaultPath = _vaultPath(options); + if (!vaultPath) { + _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`); + return DotenvModule.configDotenv(options); + } + return DotenvModule._configVault(options); + } + function decrypt(encrypted, keyStr) { + const key = Buffer.from(keyStr.slice(-64), "hex"); + let ciphertext = Buffer.from(encrypted, "base64"); + const nonce = ciphertext.subarray(0, 12); + const authTag = ciphertext.subarray(-16); + ciphertext = ciphertext.subarray(12, -16); + try { + const aesgcm = crypto2.createDecipheriv("aes-256-gcm", key, nonce); + aesgcm.setAuthTag(authTag); + return `${aesgcm.update(ciphertext)}${aesgcm.final()}`; + } catch (error2) { + const isRange = error2 instanceof RangeError; + const invalidKeyLength = error2.message === "Invalid key length"; + const decryptionFailed = error2.message === "Unsupported state or unable to authenticate data"; + if (isRange || invalidKeyLength) { + const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)"); + err.code = "INVALID_DOTENV_KEY"; + throw err; + } else if (decryptionFailed) { + const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY"); + err.code = "DECRYPTION_FAILED"; + throw err; + } else { + throw error2; + } + } + } + function populate(processEnv, parsed, options = {}) { + const debug = Boolean(options && options.debug); + const override = Boolean(options && options.override); + const populated = {}; + if (typeof parsed !== "object") { + const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate"); + err.code = "OBJECT_REQUIRED"; + throw err; + } + for (const key of Object.keys(parsed)) { + if (Object.prototype.hasOwnProperty.call(processEnv, key)) { + if (override === true) { + processEnv[key] = parsed[key]; + populated[key] = parsed[key]; + } + if (debug) { + if (override === true) { + _debug(`"${key}" is already defined and WAS overwritten`); + } else { + _debug(`"${key}" is already defined and was NOT overwritten`); + } + } + } else { + processEnv[key] = parsed[key]; + populated[key] = parsed[key]; + } + } + return populated; + } + var DotenvModule = { + configDotenv, + _configVault, + _parseVault, + config, + decrypt, + parse, + populate + }; + module2.exports.configDotenv = DotenvModule.configDotenv; + module2.exports._configVault = DotenvModule._configVault; + module2.exports._parseVault = DotenvModule._parseVault; + module2.exports.config = DotenvModule.config; + module2.exports.decrypt = DotenvModule.decrypt; + module2.exports.parse = DotenvModule.parse; + module2.exports.populate = DotenvModule.populate; + module2.exports = DotenvModule; + } +}); + +// config/envVariable.js +var require_envVariable = __commonJS({ + "config/envVariable.js"(exports2, module2) { + require_main().config(); + module2.exports = { + JWT_ACCESS_SECRET: process.env.JWT_ACCESS_SECRET, + JWT_REFRESH_SECRET: process.env.JWT_REFRESH_SECRET, + JWT_ACCESS_EXPIRATION: process.env.JWT_ACCESS_EXPIRATION, + JWT_REFRESH_EXPIRATION: process.env.JWT_REFRESH_EXPIRATION, + NODEMAILER_EMAIL: process.env.NODEMAILER_EMAIL, + NODEMAILER_PASSWORD: process.env.NODEMAILER_PASSWORD + }; + } +}); + +// utils/jwtHelper.js +var require_jwtHelper = __commonJS({ + "utils/jwtHelper.js"(exports2, module2) { + var jwt = require_jsonwebtoken(); + var { + JWT_ACCESS_SECRET, + JWT_REFRESH_SECRET, + JWT_ACCESS_EXPIRATION, + JWT_REFRESH_EXPIRATION + } = require_envVariable(); + var ACCESS_TOKEN_SECRET = JWT_ACCESS_SECRET; + var REFRESH_TOKEN_SECRET = JWT_REFRESH_SECRET; + var generateAccessToken = (user) => { + const payload2 = { + userId: user.id, + email: user.email, + branchId: user.branch_id, + newUser: user.newUser ? true : false + }; + return jwt.sign(payload2, ACCESS_TOKEN_SECRET, { expiresIn: JWT_ACCESS_EXPIRATION }); + }; + var generateRefreshToken = (user) => { + const payload2 = { + userId: user.id, + email: user.email, + branchId: user.branch_id, + newUser: user.newUser ? true : false + }; + return jwt.sign(payload2, REFRESH_TOKEN_SECRET, { expiresIn: JWT_REFRESH_EXPIRATION }); + }; + var verifyToken = (token, isRefreshToken = false) => { + try { + const secret = isRefreshToken ? REFRESH_TOKEN_SECRET : ACCESS_TOKEN_SECRET; + return jwt.verify(token, secret); + } catch (error2) { + return null; + } + }; + module2.exports = { generateAccessToken, generateRefreshToken, verifyToken }; + } +}); + +// utils/responseHelper.js +var require_responseHelper = __commonJS({ + "utils/responseHelper.js"(exports2, module2) { + var sendResponse = (res, statusCode, message2, data2 = {}, pagination = null) => { + const isSuccess = statusCode >= 200 && statusCode < 300; + const response = { + status: isSuccess ? "success" : "error", + success: isSuccess, + message: message2, + data: data2 + }; + if (pagination) { + response.pagination = pagination; + } + return res.status(statusCode).json(response); + }; + module2.exports = { sendResponse }; + } +}); + +// middleware/authMiddleware.js +var require_authMiddleware = __commonJS({ + "middleware/authMiddleware.js"(exports2, module2) { + var { verifyToken, generateAccessToken } = require_jwtHelper(); + var { sendResponse } = require_responseHelper(); + var authMiddleware2 = (req, res, next) => { + if (req.method === "OPTIONS") { + return next(); + } + const publicPaths = [ + "/api/v1/users/signin", + "/api/v1/users/check", + "/api/v1/users/verify-otp", + "/api/v1/restaurant/search", + "/api/v1/menu/", + "/api/v1/users" + ]; + const publicGetPaths = []; + if (publicPaths.some((path) => req.path.startsWith(path))) { + console.log("public path", req.path); + return next(); + } + if (req.method === "GET" && publicGetPaths.some((path) => req.path.startsWith(path))) { + return next(); + } + let accessToken = req.cookies.accessToken; + if (!accessToken && req.headers.authorization && req.headers.authorization.startsWith("Bearer ")) { + accessToken = req.headers.authorization.split(" ")[1]; + } + let decoded = verifyToken(accessToken); + if (!decoded) { + const refreshToken = req.cookies.refreshToken; + if (!refreshToken) { + return sendResponse(res, 401, "Access denied. No valid token provided."); + } + const refreshDecoded = verifyToken(refreshToken, true); + if (!refreshDecoded) { + return sendResponse( + res, + 401, + "Invalid or expired refresh token. Please login again." + ); + } + const user = { + id: refreshDecoded.userId, + email: refreshDecoded.email, + branch_id: refreshDecoded.branchId + }; + const newAccessToken = generateAccessToken(user); + res.cookie("accessToken", newAccessToken, { + httpOnly: true, + secure: process.env.NODE_ENV === "production", + sameSite: "strict" + }); + decoded = refreshDecoded; + } + console.log(decoded); + if (!decoded.branchId && !decoded.newUser) { + return sendResponse(res, 401, "Branch id missing in token."); + } + req.user = decoded; + next(); + }; + module2.exports = { authMiddleware: authMiddleware2 }; + } +}); + +// model/userModel.js +var require_userModel = __commonJS({ + "model/userModel.js"(exports2, module2) { + var mongoose2 = require_mongoose2(); + var Schema2 = mongoose2.Schema; + var userSchema = new Schema2({ + branch_id: { + type: mongoose2.Schema.Types.ObjectId, + ref: "Branch" + }, + username: { + type: String, + required: true + }, + email: { + type: String, + required: true, + unique: true + }, + Password: { + type: String, + required: true + } + }, { timestamps: true }); + var User = mongoose2.model("User", userSchema); + module2.exports = { User }; + } +}); + +// model/resturantModel.js +var require_resturantModel = __commonJS({ + "model/resturantModel.js"(exports2, module2) { + var mongoose2 = require_mongoose2(); + var Schema2 = mongoose2.Schema; + var restaurantSchema = new Schema2({ + name: String, + email: String, + phone: String, + logo: String, + type: String, + status: { + type: String, + enum: ["active", "inactive"], + default: "inactive" + } + }, { timestamps: true }); + restaurantSchema.index({ status: 1 }); + var Restaurant = mongoose2.model("Restaurant", restaurantSchema); + var settingsSchema = new Schema2({ + logo: String, + currency: String, + symbol: String, + pdf_menu_url: String, + symbol_position: { + type: String, + enum: ["left", "right"] + }, + facebook_url: String, + instagram_url: String, + google_feedback_url: String + }, { _id: false }); + var branchSchema = new Schema2({ + restaurant_id: { + type: mongoose2.Schema.Types.ObjectId, + ref: "Restaurant" + }, + name: String, + description: String, + phone: String, + email: String, + place: String, + city: String, + district: String, + state: String, + country: String, + slug: { + type: String, + unique: true + }, + status: { + type: String, + enum: ["active", "pending", "inactive", "block"], + default: "pending" + }, + is_active: { + type: Boolean, + default: true + }, + settings: settingsSchema + // Embedded settings + }, { timestamps: true }); + branchSchema.index({ restaurant_id: 1 }); + branchSchema.index({ slug: 1 }); + branchSchema.index({ status: 1 }); + branchSchema.index({ is_active: 1 }); + var Branch = mongoose2.model("Branch", branchSchema); + module2.exports = { Restaurant, Branch }; + } +}); + +// model/otpValidateModel.js +var require_otpValidateModel = __commonJS({ + "model/otpValidateModel.js"(exports2, module2) { + var mongoose2 = require_mongoose2(); + var Schema2 = mongoose2.Schema; + var otpValidateSchema = new Schema2({ + otp: Number, + email: String, + is_validate: Boolean, + expiration_time: Date + }, { timestamps: true }); + var OTPValidate = mongoose2.model("OTPValidate", otpValidateSchema); + module2.exports = { OTPValidate }; + } +}); + +// node_modules/nodemailer/lib/fetch/cookies.js +var require_cookies = __commonJS({ + "node_modules/nodemailer/lib/fetch/cookies.js"(exports2, module2) { + "use strict"; + var urllib = require("url"); + var SESSION_TIMEOUT = 1800; + var Cookies = class { + constructor(options) { + this.options = options || {}; + this.cookies = []; + } + /** + * Stores a cookie string to the cookie storage + * + * @param {String} cookieStr Value from the 'Set-Cookie:' header + * @param {String} url Current URL + */ + set(cookieStr, url) { + let urlparts = urllib.parse(url || ""); + let cookie = this.parse(cookieStr); + let domain; + if (cookie.domain) { + domain = cookie.domain.replace(/^\./, ""); + if ( + // can't be valid if the requested domain is shorter than current hostname + urlparts.hostname.length < domain.length || // prefix domains with dot to be sure that partial matches are not used + ("." + urlparts.hostname).substr(-domain.length + 1) !== "." + domain + ) { + cookie.domain = urlparts.hostname; + } + } else { + cookie.domain = urlparts.hostname; + } + if (!cookie.path) { + cookie.path = this.getPath(urlparts.pathname); + } + if (!cookie.expires) { + cookie.expires = new Date(Date.now() + (Number(this.options.sessionTimeout || SESSION_TIMEOUT) || SESSION_TIMEOUT) * 1e3); + } + return this.add(cookie); + } + /** + * Returns cookie string for the 'Cookie:' header. + * + * @param {String} url URL to check for + * @returns {String} Cookie header or empty string if no matches were found + */ + get(url) { + return this.list(url).map((cookie) => cookie.name + "=" + cookie.value).join("; "); + } + /** + * Lists all valied cookie objects for the specified URL + * + * @param {String} url URL to check for + * @returns {Array} An array of cookie objects + */ + list(url) { + let result = []; + let i4; + let cookie; + for (i4 = this.cookies.length - 1; i4 >= 0; i4--) { + cookie = this.cookies[i4]; + if (this.isExpired(cookie)) { + this.cookies.splice(i4, i4); + continue; + } + if (this.match(cookie, url)) { + result.unshift(cookie); + } + } + return result; + } + /** + * Parses cookie string from the 'Set-Cookie:' header + * + * @param {String} cookieStr String from the 'Set-Cookie:' header + * @returns {Object} Cookie object + */ + parse(cookieStr) { + let cookie = {}; + (cookieStr || "").toString().split(";").forEach((cookiePart) => { + let valueParts = cookiePart.split("="); + let key = valueParts.shift().trim().toLowerCase(); + let value = valueParts.join("=").trim(); + let domain; + if (!key) { + return; + } + switch (key) { + case "expires": + value = new Date(value); + if (value.toString() !== "Invalid Date") { + cookie.expires = value; + } + break; + case "path": + cookie.path = value; + break; + case "domain": + domain = value.toLowerCase(); + if (domain.length && domain.charAt(0) !== ".") { + domain = "." + domain; + } + cookie.domain = domain; + break; + case "max-age": + cookie.expires = new Date(Date.now() + (Number(value) || 0) * 1e3); + break; + case "secure": + cookie.secure = true; + break; + case "httponly": + cookie.httponly = true; + break; + default: + if (!cookie.name) { + cookie.name = key; + cookie.value = value; + } + } + }); + return cookie; + } + /** + * Checks if a cookie object is valid for a specified URL + * + * @param {Object} cookie Cookie object + * @param {String} url URL to check for + * @returns {Boolean} true if cookie is valid for specifiec URL + */ + match(cookie, url) { + let urlparts = urllib.parse(url || ""); + if (urlparts.hostname !== cookie.domain && (cookie.domain.charAt(0) !== "." || ("." + urlparts.hostname).substr(-cookie.domain.length) !== cookie.domain)) { + return false; + } + let path = this.getPath(urlparts.pathname); + if (path.substr(0, cookie.path.length) !== cookie.path) { + return false; + } + if (cookie.secure && urlparts.protocol !== "https:") { + return false; + } + return true; + } + /** + * Adds (or updates/removes if needed) a cookie object to the cookie storage + * + * @param {Object} cookie Cookie value to be stored + */ + add(cookie) { + let i4; + let len; + if (!cookie || !cookie.name) { + return false; + } + for (i4 = 0, len = this.cookies.length; i4 < len; i4++) { + if (this.compare(this.cookies[i4], cookie)) { + if (this.isExpired(cookie)) { + this.cookies.splice(i4, 1); + return false; + } + this.cookies[i4] = cookie; + return true; + } + } + if (!this.isExpired(cookie)) { + this.cookies.push(cookie); + } + return true; + } + /** + * Checks if two cookie objects are the same + * + * @param {Object} a Cookie to check against + * @param {Object} b Cookie to check against + * @returns {Boolean} True, if the cookies are the same + */ + compare(a4, b4) { + return a4.name === b4.name && a4.path === b4.path && a4.domain === b4.domain && a4.secure === b4.secure && a4.httponly === a4.httponly; + } + /** + * Checks if a cookie is expired + * + * @param {Object} cookie Cookie object to check against + * @returns {Boolean} True, if the cookie is expired + */ + isExpired(cookie) { + return cookie.expires && cookie.expires < /* @__PURE__ */ new Date() || !cookie.value; + } + /** + * Returns normalized cookie path for an URL path argument + * + * @param {String} pathname + * @returns {String} Normalized path + */ + getPath(pathname) { + let path = (pathname || "/").split("/"); + path.pop(); + path = path.join("/").trim(); + if (path.charAt(0) !== "/") { + path = "/" + path; + } + if (path.substr(-1) !== "/") { + path += "/"; + } + return path; + } + }; + module2.exports = Cookies; + } +}); + +// node_modules/nodemailer/package.json +var require_package4 = __commonJS({ + "node_modules/nodemailer/package.json"(exports2, module2) { + module2.exports = { + name: "nodemailer", + version: "7.0.12", + description: "Easy as cake e-mail sending from your Node.js applications", + main: "lib/nodemailer.js", + scripts: { + test: "node --test --test-concurrency=1 test/**/*.test.js test/**/*-test.js", + "test:coverage": "c8 node --test --test-concurrency=1 test/**/*.test.js test/**/*-test.js", + format: 'prettier --write "**/*.{js,json,md}"', + "format:check": 'prettier --check "**/*.{js,json,md}"', + lint: "eslint .", + "lint:fix": "eslint . --fix", + update: "rm -rf node_modules/ package-lock.json && ncu -u && npm install" + }, + repository: { + type: "git", + url: "https://github.com/nodemailer/nodemailer.git" + }, + keywords: [ + "Nodemailer" + ], + author: "Andris Reinman", + license: "MIT-0", + bugs: { + url: "https://github.com/nodemailer/nodemailer/issues" + }, + homepage: "https://nodemailer.com/", + devDependencies: { + "@aws-sdk/client-sesv2": "3.940.0", + bunyan: "1.8.15", + c8: "10.1.3", + eslint: "9.39.1", + "eslint-config-prettier": "10.1.8", + globals: "16.5.0", + libbase64: "1.3.0", + libmime: "5.3.7", + libqp: "2.1.1", + "nodemailer-ntlm-auth": "1.0.4", + prettier: "3.6.2", + proxy: "1.0.2", + "proxy-test-server": "1.0.0", + "smtp-server": "3.16.1" + }, + engines: { + node: ">=6.0.0" + } + }; + } +}); + +// node_modules/nodemailer/lib/fetch/index.js +var require_fetch = __commonJS({ + "node_modules/nodemailer/lib/fetch/index.js"(exports2, module2) { + "use strict"; + var http = require("http"); + var https = require("https"); + var urllib = require("url"); + var zlib = require("zlib"); + var PassThrough = require("stream").PassThrough; + var Cookies = require_cookies(); + var packageData = require_package4(); + var net = require("net"); + var MAX_REDIRECTS = 5; + module2.exports = function(url, options) { + return nmfetch(url, options); + }; + module2.exports.Cookies = Cookies; + function nmfetch(url, options) { + options = options || {}; + options.fetchRes = options.fetchRes || new PassThrough(); + options.cookies = options.cookies || new Cookies(); + options.redirects = options.redirects || 0; + options.maxRedirects = isNaN(options.maxRedirects) ? MAX_REDIRECTS : options.maxRedirects; + if (options.cookie) { + [].concat(options.cookie || []).forEach((cookie) => { + options.cookies.set(cookie, url); + }); + options.cookie = false; + } + let fetchRes = options.fetchRes; + let parsed = urllib.parse(url); + let method = (options.method || "").toString().trim().toUpperCase() || "GET"; + let finished = false; + let cookies; + let body; + let handler2 = parsed.protocol === "https:" ? https : http; + let headers = { + "accept-encoding": "gzip,deflate", + "user-agent": "nodemailer/" + packageData.version + }; + Object.keys(options.headers || {}).forEach((key) => { + headers[key.toLowerCase().trim()] = options.headers[key]; + }); + if (options.userAgent) { + headers["user-agent"] = options.userAgent; + } + if (parsed.auth) { + headers.Authorization = "Basic " + Buffer.from(parsed.auth).toString("base64"); + } + if (cookies = options.cookies.get(url)) { + headers.cookie = cookies; + } + if (options.body) { + if (options.contentType !== false) { + headers["Content-Type"] = options.contentType || "application/x-www-form-urlencoded"; + } + if (typeof options.body.pipe === "function") { + headers["Transfer-Encoding"] = "chunked"; + body = options.body; + body.on("error", (err) => { + if (finished) { + return; + } + finished = true; + err.type = "FETCH"; + err.sourceUrl = url; + fetchRes.emit("error", err); + }); + } else { + if (options.body instanceof Buffer) { + body = options.body; + } else if (typeof options.body === "object") { + try { + body = Buffer.from( + Object.keys(options.body).map((key) => { + let value = options.body[key].toString().trim(); + return encodeURIComponent(key) + "=" + encodeURIComponent(value); + }).join("&") + ); + } catch (E2) { + if (finished) { + return; + } + finished = true; + E2.type = "FETCH"; + E2.sourceUrl = url; + fetchRes.emit("error", E2); + return; + } + } else { + body = Buffer.from(options.body.toString().trim()); + } + headers["Content-Type"] = options.contentType || "application/x-www-form-urlencoded"; + headers["Content-Length"] = body.length; + } + method = (options.method || "").toString().trim().toUpperCase() || "POST"; + } + let req; + let reqOptions = { + method, + host: parsed.hostname, + path: parsed.path, + port: parsed.port ? parsed.port : parsed.protocol === "https:" ? 443 : 80, + headers, + rejectUnauthorized: false, + agent: false + }; + if (options.tls) { + Object.keys(options.tls).forEach((key) => { + reqOptions[key] = options.tls[key]; + }); + } + if (parsed.protocol === "https:" && parsed.hostname && parsed.hostname !== reqOptions.host && !net.isIP(parsed.hostname) && !reqOptions.servername) { + reqOptions.servername = parsed.hostname; + } + try { + req = handler2.request(reqOptions); + } catch (E2) { + finished = true; + setImmediate(() => { + E2.type = "FETCH"; + E2.sourceUrl = url; + fetchRes.emit("error", E2); + }); + return fetchRes; + } + if (options.timeout) { + req.setTimeout(options.timeout, () => { + if (finished) { + return; + } + finished = true; + req.abort(); + let err = new Error("Request Timeout"); + err.type = "FETCH"; + err.sourceUrl = url; + fetchRes.emit("error", err); + }); + } + req.on("error", (err) => { + if (finished) { + return; + } + finished = true; + err.type = "FETCH"; + err.sourceUrl = url; + fetchRes.emit("error", err); + }); + req.on("response", (res) => { + let inflate; + if (finished) { + return; + } + switch (res.headers["content-encoding"]) { + case "gzip": + case "deflate": + inflate = zlib.createUnzip(); + break; + } + if (res.headers["set-cookie"]) { + [].concat(res.headers["set-cookie"] || []).forEach((cookie) => { + options.cookies.set(cookie, url); + }); + } + if ([301, 302, 303, 307, 308].includes(res.statusCode) && res.headers.location) { + options.redirects++; + if (options.redirects > options.maxRedirects) { + finished = true; + let err = new Error("Maximum redirect count exceeded"); + err.type = "FETCH"; + err.sourceUrl = url; + fetchRes.emit("error", err); + req.abort(); + return; + } + options.method = "GET"; + options.body = false; + return nmfetch(urllib.resolve(url, res.headers.location), options); + } + fetchRes.statusCode = res.statusCode; + fetchRes.headers = res.headers; + if (res.statusCode >= 300 && !options.allowErrorResponse) { + finished = true; + let err = new Error("Invalid status code " + res.statusCode); + err.type = "FETCH"; + err.sourceUrl = url; + fetchRes.emit("error", err); + req.abort(); + return; + } + res.on("error", (err) => { + if (finished) { + return; + } + finished = true; + err.type = "FETCH"; + err.sourceUrl = url; + fetchRes.emit("error", err); + req.abort(); + }); + if (inflate) { + res.pipe(inflate).pipe(fetchRes); + inflate.on("error", (err) => { + if (finished) { + return; + } + finished = true; + err.type = "FETCH"; + err.sourceUrl = url; + fetchRes.emit("error", err); + req.abort(); + }); + } else { + res.pipe(fetchRes); + } + }); + setImmediate(() => { + if (body) { + try { + if (typeof body.pipe === "function") { + return body.pipe(req); + } else { + req.write(body); + } + } catch (err) { + finished = true; + err.type = "FETCH"; + err.sourceUrl = url; + fetchRes.emit("error", err); + return; + } + } + req.end(); + }); + return fetchRes; + } + } +}); + +// node_modules/nodemailer/lib/shared/index.js +var require_shared2 = __commonJS({ + "node_modules/nodemailer/lib/shared/index.js"(exports2, module2) { + "use strict"; + var urllib = require("url"); + var util = require("util"); + var fs = require("fs"); + var nmfetch = require_fetch(); + var dns = require("dns"); + var net = require("net"); + var os = require("os"); + var DNS_TTL = 5 * 60 * 1e3; + var CACHE_CLEANUP_INTERVAL = 30 * 1e3; + var MAX_CACHE_SIZE = 1e3; + var lastCacheCleanup = 0; + module2.exports._lastCacheCleanup = () => lastCacheCleanup; + module2.exports._resetCacheCleanup = () => { + lastCacheCleanup = 0; + }; + var networkInterfaces; + try { + networkInterfaces = os.networkInterfaces(); + } catch (_err) { + } + module2.exports.networkInterfaces = networkInterfaces; + var isFamilySupported = (family, allowInternal) => { + let networkInterfaces2 = module2.exports.networkInterfaces; + if (!networkInterfaces2) { + return true; + } + const familySupported = ( + // crux that replaces Object.values(networkInterfaces) as Object.values is not supported in nodejs v6 + Object.keys(networkInterfaces2).map((key) => networkInterfaces2[key]).reduce((acc, val) => acc.concat(val), []).filter((i4) => !i4.internal || allowInternal).filter((i4) => i4.family === "IPv" + family || i4.family === family).length > 0 + ); + return familySupported; + }; + var resolver = (family, hostname, options, callback) => { + options = options || {}; + const familySupported = isFamilySupported(family, options.allowInternalNetworkInterfaces); + if (!familySupported) { + return callback(null, []); + } + const resolver2 = dns.Resolver ? new dns.Resolver(options) : dns; + resolver2["resolve" + family](hostname, (err, addresses) => { + if (err) { + switch (err.code) { + case dns.NODATA: + case dns.NOTFOUND: + case dns.NOTIMP: + case dns.SERVFAIL: + case dns.CONNREFUSED: + case dns.REFUSED: + case "EAI_AGAIN": + return callback(null, []); + } + return callback(err); + } + return callback(null, Array.isArray(addresses) ? addresses : [].concat(addresses || [])); + }); + }; + var dnsCache = module2.exports.dnsCache = /* @__PURE__ */ new Map(); + var formatDNSValue = (value, extra) => { + if (!value) { + return Object.assign({}, extra || {}); + } + return Object.assign( + { + servername: value.servername, + host: !value.addresses || !value.addresses.length ? null : value.addresses.length === 1 ? value.addresses[0] : value.addresses[Math.floor(Math.random() * value.addresses.length)] + }, + extra || {} + ); + }; + module2.exports.resolveHostname = (options, callback) => { + options = options || {}; + if (!options.host && options.servername) { + options.host = options.servername; + } + if (!options.host || net.isIP(options.host)) { + let value = { + addresses: [options.host], + servername: options.servername || false + }; + return callback( + null, + formatDNSValue(value, { + cached: false + }) + ); + } + let cached; + if (dnsCache.has(options.host)) { + cached = dnsCache.get(options.host); + const now = Date.now(); + if (now - lastCacheCleanup > CACHE_CLEANUP_INTERVAL) { + lastCacheCleanup = now; + for (const [host, entry] of dnsCache.entries()) { + if (entry.expires && entry.expires < now) { + dnsCache.delete(host); + } + } + if (dnsCache.size > MAX_CACHE_SIZE) { + const toDelete = Math.floor(MAX_CACHE_SIZE * 0.1); + const keys = Array.from(dnsCache.keys()).slice(0, toDelete); + keys.forEach((key) => dnsCache.delete(key)); + } + } + if (!cached.expires || cached.expires >= now) { + return callback( + null, + formatDNSValue(cached.value, { + cached: true + }) + ); + } + } + resolver(4, options.host, options, (err, addresses) => { + if (err) { + if (cached) { + dnsCache.set(options.host, { + value: cached.value, + expires: Date.now() + (options.dnsTtl || DNS_TTL) + }); + return callback( + null, + formatDNSValue(cached.value, { + cached: true, + error: err + }) + ); + } + return callback(err); + } + if (addresses && addresses.length) { + let value = { + addresses, + servername: options.servername || options.host + }; + dnsCache.set(options.host, { + value, + expires: Date.now() + (options.dnsTtl || DNS_TTL) + }); + return callback( + null, + formatDNSValue(value, { + cached: false + }) + ); + } + resolver(6, options.host, options, (err2, addresses2) => { + if (err2) { + if (cached) { + dnsCache.set(options.host, { + value: cached.value, + expires: Date.now() + (options.dnsTtl || DNS_TTL) + }); + return callback( + null, + formatDNSValue(cached.value, { + cached: true, + error: err2 + }) + ); + } + return callback(err2); + } + if (addresses2 && addresses2.length) { + let value = { + addresses: addresses2, + servername: options.servername || options.host + }; + dnsCache.set(options.host, { + value, + expires: Date.now() + (options.dnsTtl || DNS_TTL) + }); + return callback( + null, + formatDNSValue(value, { + cached: false + }) + ); + } + try { + dns.lookup(options.host, { all: true }, (err3, addresses3) => { + if (err3) { + if (cached) { + dnsCache.set(options.host, { + value: cached.value, + expires: Date.now() + (options.dnsTtl || DNS_TTL) + }); + return callback( + null, + formatDNSValue(cached.value, { + cached: true, + error: err3 + }) + ); + } + return callback(err3); + } + let address = addresses3 ? addresses3.filter((addr) => isFamilySupported(addr.family)).map((addr) => addr.address).shift() : false; + if (addresses3 && addresses3.length && !address) { + console.warn(`Failed to resolve IPv${addresses3[0].family} addresses with current network`); + } + if (!address && cached) { + return callback( + null, + formatDNSValue(cached.value, { + cached: true + }) + ); + } + let value = { + addresses: address ? [address] : [options.host], + servername: options.servername || options.host + }; + dnsCache.set(options.host, { + value, + expires: Date.now() + (options.dnsTtl || DNS_TTL) + }); + return callback( + null, + formatDNSValue(value, { + cached: false + }) + ); + }); + } catch (_err) { + if (cached) { + dnsCache.set(options.host, { + value: cached.value, + expires: Date.now() + (options.dnsTtl || DNS_TTL) + }); + return callback( + null, + formatDNSValue(cached.value, { + cached: true, + error: err2 + }) + ); + } + return callback(err2); + } + }); + }); + }; + module2.exports.parseConnectionUrl = (str) => { + str = str || ""; + let options = {}; + [urllib.parse(str, true)].forEach((url) => { + let auth; + switch (url.protocol) { + case "smtp:": + options.secure = false; + break; + case "smtps:": + options.secure = true; + break; + case "direct:": + options.direct = true; + break; + } + if (!isNaN(url.port) && Number(url.port)) { + options.port = Number(url.port); + } + if (url.hostname) { + options.host = url.hostname; + } + if (url.auth) { + auth = url.auth.split(":"); + if (!options.auth) { + options.auth = {}; + } + options.auth.user = auth.shift(); + options.auth.pass = auth.join(":"); + } + Object.keys(url.query || {}).forEach((key) => { + let obj = options; + let lKey = key; + let value = url.query[key]; + if (!isNaN(value)) { + value = Number(value); + } + switch (value) { + case "true": + value = true; + break; + case "false": + value = false; + break; + } + if (key.indexOf("tls.") === 0) { + lKey = key.substr(4); + if (!options.tls) { + options.tls = {}; + } + obj = options.tls; + } else if (key.indexOf(".") >= 0) { + return; + } + if (!(lKey in obj)) { + obj[lKey] = value; + } + }); + }); + return options; + }; + module2.exports._logFunc = (logger3, level, defaults, data2, message2, ...args2) => { + let entry = {}; + Object.keys(defaults || {}).forEach((key) => { + if (key !== "level") { + entry[key] = defaults[key]; + } + }); + Object.keys(data2 || {}).forEach((key) => { + if (key !== "level") { + entry[key] = data2[key]; + } + }); + logger3[level](entry, message2, ...args2); + }; + module2.exports.getLogger = (options, defaults) => { + options = options || {}; + let response = {}; + let levels = ["trace", "debug", "info", "warn", "error", "fatal"]; + if (!options.logger) { + levels.forEach((level) => { + response[level] = () => false; + }); + return response; + } + let logger3 = options.logger; + if (options.logger === true) { + logger3 = createDefaultLogger(levels); + } + levels.forEach((level) => { + response[level] = (data2, message2, ...args2) => { + module2.exports._logFunc(logger3, level, defaults, data2, message2, ...args2); + }; + }); + return response; + }; + module2.exports.callbackPromise = (resolve, reject) => function() { + let args2 = Array.from(arguments); + let err = args2.shift(); + if (err) { + reject(err); + } else { + resolve(...args2); + } + }; + module2.exports.parseDataURI = (uri) => { + if (typeof uri !== "string") { + return null; + } + if (!uri.startsWith("data:")) { + return null; + } + const commaPos = uri.indexOf(","); + if (commaPos === -1) { + return null; + } + const data2 = uri.substring(commaPos + 1); + const metaStr = uri.substring("data:".length, commaPos); + let encoding; + const metaEntries = metaStr.split(";"); + if (metaEntries.length > 0) { + const lastEntry = metaEntries[metaEntries.length - 1].toLowerCase().trim(); + if (["base64", "utf8", "utf-8"].includes(lastEntry) && lastEntry.indexOf("=") === -1) { + encoding = lastEntry; + metaEntries.pop(); + } + } + const contentType = metaEntries.length > 0 ? metaEntries.shift() : "application/octet-stream"; + const params = {}; + for (let i4 = 0; i4 < metaEntries.length; i4++) { + const entry = metaEntries[i4]; + const sepPos = entry.indexOf("="); + if (sepPos > 0) { + const key = entry.substring(0, sepPos).trim(); + const value = entry.substring(sepPos + 1).trim(); + if (key) { + params[key] = value; + } + } + } + let bufferData; + try { + if (encoding === "base64") { + bufferData = Buffer.from(data2, "base64"); + } else { + try { + bufferData = Buffer.from(decodeURIComponent(data2)); + } catch (_decodeError) { + bufferData = Buffer.from(data2); + } + } + } catch (_bufferError) { + bufferData = Buffer.alloc(0); + } + return { + data: bufferData, + encoding: encoding || null, + contentType: contentType || "application/octet-stream", + params + }; + }; + module2.exports.resolveContent = (data2, key, callback) => { + let promise; + if (!callback) { + promise = new Promise((resolve, reject) => { + callback = module2.exports.callbackPromise(resolve, reject); + }); + } + let content = data2 && data2[key] && data2[key].content || data2[key]; + let contentStream; + let encoding = (typeof data2[key] === "object" && data2[key].encoding || "utf8").toString().toLowerCase().replace(/[-_\s]/g, ""); + if (!content) { + return callback(null, content); + } + if (typeof content === "object") { + if (typeof content.pipe === "function") { + return resolveStream(content, (err, value) => { + if (err) { + return callback(err); + } + if (data2[key].content) { + data2[key].content = value; + } else { + data2[key] = value; + } + callback(null, value); + }); + } else if (/^https?:\/\//i.test(content.path || content.href)) { + contentStream = nmfetch(content.path || content.href); + return resolveStream(contentStream, callback); + } else if (/^data:/i.test(content.path || content.href)) { + let parsedDataUri = module2.exports.parseDataURI(content.path || content.href); + if (!parsedDataUri || !parsedDataUri.data) { + return callback(null, Buffer.from(0)); + } + return callback(null, parsedDataUri.data); + } else if (content.path) { + return resolveStream(fs.createReadStream(content.path), callback); + } + } + if (typeof data2[key].content === "string" && !["utf8", "usascii", "ascii"].includes(encoding)) { + content = Buffer.from(data2[key].content, encoding); + } + setImmediate(() => callback(null, content)); + return promise; + }; + module2.exports.assign = function() { + let args2 = Array.from(arguments); + let target = args2.shift() || {}; + args2.forEach((source) => { + Object.keys(source || {}).forEach((key) => { + if (["tls", "auth"].includes(key) && source[key] && typeof source[key] === "object") { + if (!target[key]) { + target[key] = {}; + } + Object.keys(source[key]).forEach((subKey) => { + target[key][subKey] = source[key][subKey]; + }); + } else { + target[key] = source[key]; + } + }); + }); + return target; + }; + module2.exports.encodeXText = (str) => { + if (!/[^\x21-\x2A\x2C-\x3C\x3E-\x7E]/.test(str)) { + return str; + } + let buf = Buffer.from(str); + let result = ""; + for (let i4 = 0, len = buf.length; i4 < len; i4++) { + let c4 = buf[i4]; + if (c4 < 33 || c4 > 126 || c4 === 43 || c4 === 61) { + result += "+" + (c4 < 16 ? "0" : "") + c4.toString(16).toUpperCase(); + } else { + result += String.fromCharCode(c4); + } + } + return result; + }; + function resolveStream(stream, callback) { + let responded = false; + let chunks = []; + let chunklen = 0; + stream.on("error", (err) => { + if (responded) { + return; + } + responded = true; + callback(err); + }); + stream.on("readable", () => { + let chunk; + while ((chunk = stream.read()) !== null) { + chunks.push(chunk); + chunklen += chunk.length; + } + }); + stream.on("end", () => { + if (responded) { + return; + } + responded = true; + let value; + try { + value = Buffer.concat(chunks, chunklen); + } catch (E2) { + return callback(E2); + } + callback(null, value); + }); + } + function createDefaultLogger(levels) { + let levelMaxLen = 0; + let levelNames = /* @__PURE__ */ new Map(); + levels.forEach((level) => { + if (level.length > levelMaxLen) { + levelMaxLen = level.length; + } + }); + levels.forEach((level) => { + let levelName = level.toUpperCase(); + if (levelName.length < levelMaxLen) { + levelName += " ".repeat(levelMaxLen - levelName.length); + } + levelNames.set(level, levelName); + }); + let print = (level, entry, message2, ...args2) => { + let prefix = ""; + if (entry) { + if (entry.tnx === "server") { + prefix = "S: "; + } else if (entry.tnx === "client") { + prefix = "C: "; + } + if (entry.sid) { + prefix = "[" + entry.sid + "] " + prefix; + } + if (entry.cid) { + prefix = "[#" + entry.cid + "] " + prefix; + } + } + message2 = util.format(message2, ...args2); + message2.split(/\r?\n/).forEach((line) => { + console.log("[%s] %s %s", (/* @__PURE__ */ new Date()).toISOString().substr(0, 19).replace(/T/, " "), levelNames.get(level), prefix + line); + }); + }; + let logger3 = {}; + levels.forEach((level) => { + logger3[level] = print.bind(null, level); + }); + return logger3; + } + } +}); + +// node_modules/nodemailer/lib/mime-funcs/mime-types.js +var require_mime_types2 = __commonJS({ + "node_modules/nodemailer/lib/mime-funcs/mime-types.js"(exports2, module2) { + "use strict"; + var path = require("path"); + var defaultMimeType = "application/octet-stream"; + var defaultExtension = "bin"; + var mimeTypes = /* @__PURE__ */ new Map([ + ["application/acad", "dwg"], + ["application/applixware", "aw"], + ["application/arj", "arj"], + ["application/atom+xml", "xml"], + ["application/atomcat+xml", "atomcat"], + ["application/atomsvc+xml", "atomsvc"], + ["application/base64", ["mm", "mme"]], + ["application/binhex", "hqx"], + ["application/binhex4", "hqx"], + ["application/book", ["book", "boo"]], + ["application/ccxml+xml,", "ccxml"], + ["application/cdf", "cdf"], + ["application/cdmi-capability", "cdmia"], + ["application/cdmi-container", "cdmic"], + ["application/cdmi-domain", "cdmid"], + ["application/cdmi-object", "cdmio"], + ["application/cdmi-queue", "cdmiq"], + ["application/clariscad", "ccad"], + ["application/commonground", "dp"], + ["application/cu-seeme", "cu"], + ["application/davmount+xml", "davmount"], + ["application/drafting", "drw"], + ["application/dsptype", "tsp"], + ["application/dssc+der", "dssc"], + ["application/dssc+xml", "xdssc"], + ["application/dxf", "dxf"], + ["application/ecmascript", ["js", "es"]], + ["application/emma+xml", "emma"], + ["application/envoy", "evy"], + ["application/epub+zip", "epub"], + ["application/excel", ["xls", "xl", "xla", "xlb", "xlc", "xld", "xlk", "xll", "xlm", "xlt", "xlv", "xlw"]], + ["application/exi", "exi"], + ["application/font-tdpfr", "pfr"], + ["application/fractals", "fif"], + ["application/freeloader", "frl"], + ["application/futuresplash", "spl"], + ["application/geo+json", "geojson"], + ["application/gnutar", "tgz"], + ["application/groupwise", "vew"], + ["application/hlp", "hlp"], + ["application/hta", "hta"], + ["application/hyperstudio", "stk"], + ["application/i-deas", "unv"], + ["application/iges", ["iges", "igs"]], + ["application/inf", "inf"], + ["application/internet-property-stream", "acx"], + ["application/ipfix", "ipfix"], + ["application/java", "class"], + ["application/java-archive", "jar"], + ["application/java-byte-code", "class"], + ["application/java-serialized-object", "ser"], + ["application/java-vm", "class"], + ["application/javascript", "js"], + ["application/json", "json"], + ["application/lha", "lha"], + ["application/lzx", "lzx"], + ["application/mac-binary", "bin"], + ["application/mac-binhex", "hqx"], + ["application/mac-binhex40", "hqx"], + ["application/mac-compactpro", "cpt"], + ["application/macbinary", "bin"], + ["application/mads+xml", "mads"], + ["application/marc", "mrc"], + ["application/marcxml+xml", "mrcx"], + ["application/mathematica", "ma"], + ["application/mathml+xml", "mathml"], + ["application/mbedlet", "mbd"], + ["application/mbox", "mbox"], + ["application/mcad", "mcd"], + ["application/mediaservercontrol+xml", "mscml"], + ["application/metalink4+xml", "meta4"], + ["application/mets+xml", "mets"], + ["application/mime", "aps"], + ["application/mods+xml", "mods"], + ["application/mp21", "m21"], + ["application/mp4", "mp4"], + ["application/mspowerpoint", ["ppt", "pot", "pps", "ppz"]], + ["application/msword", ["doc", "dot", "w6w", "wiz", "word"]], + ["application/mswrite", "wri"], + ["application/mxf", "mxf"], + ["application/netmc", "mcp"], + ["application/octet-stream", ["*"]], + ["application/oda", "oda"], + ["application/oebps-package+xml", "opf"], + ["application/ogg", "ogx"], + ["application/olescript", "axs"], + ["application/onenote", "onetoc"], + ["application/patch-ops-error+xml", "xer"], + ["application/pdf", "pdf"], + ["application/pgp-encrypted", "asc"], + ["application/pgp-signature", "pgp"], + ["application/pics-rules", "prf"], + ["application/pkcs-12", "p12"], + ["application/pkcs-crl", "crl"], + ["application/pkcs10", "p10"], + ["application/pkcs7-mime", ["p7c", "p7m"]], + ["application/pkcs7-signature", "p7s"], + ["application/pkcs8", "p8"], + ["application/pkix-attr-cert", "ac"], + ["application/pkix-cert", ["cer", "crt"]], + ["application/pkix-crl", "crl"], + ["application/pkix-pkipath", "pkipath"], + ["application/pkixcmp", "pki"], + ["application/plain", "text"], + ["application/pls+xml", "pls"], + ["application/postscript", ["ps", "ai", "eps"]], + ["application/powerpoint", "ppt"], + ["application/pro_eng", ["part", "prt"]], + ["application/prs.cww", "cww"], + ["application/pskc+xml", "pskcxml"], + ["application/rdf+xml", "rdf"], + ["application/reginfo+xml", "rif"], + ["application/relax-ng-compact-syntax", "rnc"], + ["application/resource-lists+xml", "rl"], + ["application/resource-lists-diff+xml", "rld"], + ["application/ringing-tones", "rng"], + ["application/rls-services+xml", "rs"], + ["application/rsd+xml", "rsd"], + ["application/rss+xml", "xml"], + ["application/rtf", ["rtf", "rtx"]], + ["application/sbml+xml", "sbml"], + ["application/scvp-cv-request", "scq"], + ["application/scvp-cv-response", "scs"], + ["application/scvp-vp-request", "spq"], + ["application/scvp-vp-response", "spp"], + ["application/sdp", "sdp"], + ["application/sea", "sea"], + ["application/set", "set"], + ["application/set-payment-initiation", "setpay"], + ["application/set-registration-initiation", "setreg"], + ["application/shf+xml", "shf"], + ["application/sla", "stl"], + ["application/smil", ["smi", "smil"]], + ["application/smil+xml", "smi"], + ["application/solids", "sol"], + ["application/sounder", "sdr"], + ["application/sparql-query", "rq"], + ["application/sparql-results+xml", "srx"], + ["application/srgs", "gram"], + ["application/srgs+xml", "grxml"], + ["application/sru+xml", "sru"], + ["application/ssml+xml", "ssml"], + ["application/step", ["step", "stp"]], + ["application/streamingmedia", "ssm"], + ["application/tei+xml", "tei"], + ["application/thraud+xml", "tfi"], + ["application/timestamped-data", "tsd"], + ["application/toolbook", "tbk"], + ["application/vda", "vda"], + ["application/vnd.3gpp.pic-bw-large", "plb"], + ["application/vnd.3gpp.pic-bw-small", "psb"], + ["application/vnd.3gpp.pic-bw-var", "pvb"], + ["application/vnd.3gpp2.tcap", "tcap"], + ["application/vnd.3m.post-it-notes", "pwn"], + ["application/vnd.accpac.simply.aso", "aso"], + ["application/vnd.accpac.simply.imp", "imp"], + ["application/vnd.acucobol", "acu"], + ["application/vnd.acucorp", "atc"], + ["application/vnd.adobe.air-application-installer-package+zip", "air"], + ["application/vnd.adobe.fxp", "fxp"], + ["application/vnd.adobe.xdp+xml", "xdp"], + ["application/vnd.adobe.xfdf", "xfdf"], + ["application/vnd.ahead.space", "ahead"], + ["application/vnd.airzip.filesecure.azf", "azf"], + ["application/vnd.airzip.filesecure.azs", "azs"], + ["application/vnd.amazon.ebook", "azw"], + ["application/vnd.americandynamics.acc", "acc"], + ["application/vnd.amiga.ami", "ami"], + ["application/vnd.android.package-archive", "apk"], + ["application/vnd.anser-web-certificate-issue-initiation", "cii"], + ["application/vnd.anser-web-funds-transfer-initiation", "fti"], + ["application/vnd.antix.game-component", "atx"], + ["application/vnd.apple.installer+xml", "mpkg"], + ["application/vnd.apple.mpegurl", "m3u8"], + ["application/vnd.aristanetworks.swi", "swi"], + ["application/vnd.audiograph", "aep"], + ["application/vnd.blueice.multipass", "mpm"], + ["application/vnd.bmi", "bmi"], + ["application/vnd.businessobjects", "rep"], + ["application/vnd.chemdraw+xml", "cdxml"], + ["application/vnd.chipnuts.karaoke-mmd", "mmd"], + ["application/vnd.cinderella", "cdy"], + ["application/vnd.claymore", "cla"], + ["application/vnd.cloanto.rp9", "rp9"], + ["application/vnd.clonk.c4group", "c4g"], + ["application/vnd.cluetrust.cartomobile-config", "c11amc"], + ["application/vnd.cluetrust.cartomobile-config-pkg", "c11amz"], + ["application/vnd.commonspace", "csp"], + ["application/vnd.contact.cmsg", "cdbcmsg"], + ["application/vnd.cosmocaller", "cmc"], + ["application/vnd.crick.clicker", "clkx"], + ["application/vnd.crick.clicker.keyboard", "clkk"], + ["application/vnd.crick.clicker.palette", "clkp"], + ["application/vnd.crick.clicker.template", "clkt"], + ["application/vnd.crick.clicker.wordbank", "clkw"], + ["application/vnd.criticaltools.wbs+xml", "wbs"], + ["application/vnd.ctc-posml", "pml"], + ["application/vnd.cups-ppd", "ppd"], + ["application/vnd.curl.car", "car"], + ["application/vnd.curl.pcurl", "pcurl"], + ["application/vnd.data-vision.rdz", "rdz"], + ["application/vnd.denovo.fcselayout-link", "fe_launch"], + ["application/vnd.dna", "dna"], + ["application/vnd.dolby.mlp", "mlp"], + ["application/vnd.dpgraph", "dpg"], + ["application/vnd.dreamfactory", "dfac"], + ["application/vnd.dvb.ait", "ait"], + ["application/vnd.dvb.service", "svc"], + ["application/vnd.dynageo", "geo"], + ["application/vnd.ecowin.chart", "mag"], + ["application/vnd.enliven", "nml"], + ["application/vnd.epson.esf", "esf"], + ["application/vnd.epson.msf", "msf"], + ["application/vnd.epson.quickanime", "qam"], + ["application/vnd.epson.salt", "slt"], + ["application/vnd.epson.ssf", "ssf"], + ["application/vnd.eszigno3+xml", "es3"], + ["application/vnd.ezpix-album", "ez2"], + ["application/vnd.ezpix-package", "ez3"], + ["application/vnd.fdf", "fdf"], + ["application/vnd.fdsn.seed", "seed"], + ["application/vnd.flographit", "gph"], + ["application/vnd.fluxtime.clip", "ftc"], + ["application/vnd.framemaker", "fm"], + ["application/vnd.frogans.fnc", "fnc"], + ["application/vnd.frogans.ltf", "ltf"], + ["application/vnd.fsc.weblaunch", "fsc"], + ["application/vnd.fujitsu.oasys", "oas"], + ["application/vnd.fujitsu.oasys2", "oa2"], + ["application/vnd.fujitsu.oasys3", "oa3"], + ["application/vnd.fujitsu.oasysgp", "fg5"], + ["application/vnd.fujitsu.oasysprs", "bh2"], + ["application/vnd.fujixerox.ddd", "ddd"], + ["application/vnd.fujixerox.docuworks", "xdw"], + ["application/vnd.fujixerox.docuworks.binder", "xbd"], + ["application/vnd.fuzzysheet", "fzs"], + ["application/vnd.genomatix.tuxedo", "txd"], + ["application/vnd.geogebra.file", "ggb"], + ["application/vnd.geogebra.tool", "ggt"], + ["application/vnd.geometry-explorer", "gex"], + ["application/vnd.geonext", "gxt"], + ["application/vnd.geoplan", "g2w"], + ["application/vnd.geospace", "g3w"], + ["application/vnd.gmx", "gmx"], + ["application/vnd.google-earth.kml+xml", "kml"], + ["application/vnd.google-earth.kmz", "kmz"], + ["application/vnd.grafeq", "gqf"], + ["application/vnd.groove-account", "gac"], + ["application/vnd.groove-help", "ghf"], + ["application/vnd.groove-identity-message", "gim"], + ["application/vnd.groove-injector", "grv"], + ["application/vnd.groove-tool-message", "gtm"], + ["application/vnd.groove-tool-template", "tpl"], + ["application/vnd.groove-vcard", "vcg"], + ["application/vnd.hal+xml", "hal"], + ["application/vnd.handheld-entertainment+xml", "zmm"], + ["application/vnd.hbci", "hbci"], + ["application/vnd.hhe.lesson-player", "les"], + ["application/vnd.hp-hpgl", ["hgl", "hpg", "hpgl"]], + ["application/vnd.hp-hpid", "hpid"], + ["application/vnd.hp-hps", "hps"], + ["application/vnd.hp-jlyt", "jlt"], + ["application/vnd.hp-pcl", "pcl"], + ["application/vnd.hp-pclxl", "pclxl"], + ["application/vnd.hydrostatix.sof-data", "sfd-hdstx"], + ["application/vnd.hzn-3d-crossword", "x3d"], + ["application/vnd.ibm.minipay", "mpy"], + ["application/vnd.ibm.modcap", "afp"], + ["application/vnd.ibm.rights-management", "irm"], + ["application/vnd.ibm.secure-container", "sc"], + ["application/vnd.iccprofile", "icc"], + ["application/vnd.igloader", "igl"], + ["application/vnd.immervision-ivp", "ivp"], + ["application/vnd.immervision-ivu", "ivu"], + ["application/vnd.insors.igm", "igm"], + ["application/vnd.intercon.formnet", "xpw"], + ["application/vnd.intergeo", "i2g"], + ["application/vnd.intu.qbo", "qbo"], + ["application/vnd.intu.qfx", "qfx"], + ["application/vnd.ipunplugged.rcprofile", "rcprofile"], + ["application/vnd.irepository.package+xml", "irp"], + ["application/vnd.is-xpr", "xpr"], + ["application/vnd.isac.fcs", "fcs"], + ["application/vnd.jam", "jam"], + ["application/vnd.jcp.javame.midlet-rms", "rms"], + ["application/vnd.jisp", "jisp"], + ["application/vnd.joost.joda-archive", "joda"], + ["application/vnd.kahootz", "ktz"], + ["application/vnd.kde.karbon", "karbon"], + ["application/vnd.kde.kchart", "chrt"], + ["application/vnd.kde.kformula", "kfo"], + ["application/vnd.kde.kivio", "flw"], + ["application/vnd.kde.kontour", "kon"], + ["application/vnd.kde.kpresenter", "kpr"], + ["application/vnd.kde.kspread", "ksp"], + ["application/vnd.kde.kword", "kwd"], + ["application/vnd.kenameaapp", "htke"], + ["application/vnd.kidspiration", "kia"], + ["application/vnd.kinar", "kne"], + ["application/vnd.koan", "skp"], + ["application/vnd.kodak-descriptor", "sse"], + ["application/vnd.las.las+xml", "lasxml"], + ["application/vnd.llamagraphics.life-balance.desktop", "lbd"], + ["application/vnd.llamagraphics.life-balance.exchange+xml", "lbe"], + ["application/vnd.lotus-1-2-3", "123"], + ["application/vnd.lotus-approach", "apr"], + ["application/vnd.lotus-freelance", "pre"], + ["application/vnd.lotus-notes", "nsf"], + ["application/vnd.lotus-organizer", "org"], + ["application/vnd.lotus-screencam", "scm"], + ["application/vnd.lotus-wordpro", "lwp"], + ["application/vnd.macports.portpkg", "portpkg"], + ["application/vnd.mcd", "mcd"], + ["application/vnd.medcalcdata", "mc1"], + ["application/vnd.mediastation.cdkey", "cdkey"], + ["application/vnd.mfer", "mwf"], + ["application/vnd.mfmp", "mfm"], + ["application/vnd.micrografx.flo", "flo"], + ["application/vnd.micrografx.igx", "igx"], + ["application/vnd.mif", "mif"], + ["application/vnd.mobius.daf", "daf"], + ["application/vnd.mobius.dis", "dis"], + ["application/vnd.mobius.mbk", "mbk"], + ["application/vnd.mobius.mqy", "mqy"], + ["application/vnd.mobius.msl", "msl"], + ["application/vnd.mobius.plc", "plc"], + ["application/vnd.mobius.txf", "txf"], + ["application/vnd.mophun.application", "mpn"], + ["application/vnd.mophun.certificate", "mpc"], + ["application/vnd.mozilla.xul+xml", "xul"], + ["application/vnd.ms-artgalry", "cil"], + ["application/vnd.ms-cab-compressed", "cab"], + ["application/vnd.ms-excel", ["xls", "xla", "xlc", "xlm", "xlt", "xlw", "xlb", "xll"]], + ["application/vnd.ms-excel.addin.macroenabled.12", "xlam"], + ["application/vnd.ms-excel.sheet.binary.macroenabled.12", "xlsb"], + ["application/vnd.ms-excel.sheet.macroenabled.12", "xlsm"], + ["application/vnd.ms-excel.template.macroenabled.12", "xltm"], + ["application/vnd.ms-fontobject", "eot"], + ["application/vnd.ms-htmlhelp", "chm"], + ["application/vnd.ms-ims", "ims"], + ["application/vnd.ms-lrm", "lrm"], + ["application/vnd.ms-officetheme", "thmx"], + ["application/vnd.ms-outlook", "msg"], + ["application/vnd.ms-pki.certstore", "sst"], + ["application/vnd.ms-pki.pko", "pko"], + ["application/vnd.ms-pki.seccat", "cat"], + ["application/vnd.ms-pki.stl", "stl"], + ["application/vnd.ms-pkicertstore", "sst"], + ["application/vnd.ms-pkiseccat", "cat"], + ["application/vnd.ms-pkistl", "stl"], + ["application/vnd.ms-powerpoint", ["ppt", "pot", "pps", "ppa", "pwz"]], + ["application/vnd.ms-powerpoint.addin.macroenabled.12", "ppam"], + ["application/vnd.ms-powerpoint.presentation.macroenabled.12", "pptm"], + ["application/vnd.ms-powerpoint.slide.macroenabled.12", "sldm"], + ["application/vnd.ms-powerpoint.slideshow.macroenabled.12", "ppsm"], + ["application/vnd.ms-powerpoint.template.macroenabled.12", "potm"], + ["application/vnd.ms-project", "mpp"], + ["application/vnd.ms-word.document.macroenabled.12", "docm"], + ["application/vnd.ms-word.template.macroenabled.12", "dotm"], + ["application/vnd.ms-works", ["wks", "wcm", "wdb", "wps"]], + ["application/vnd.ms-wpl", "wpl"], + ["application/vnd.ms-xpsdocument", "xps"], + ["application/vnd.mseq", "mseq"], + ["application/vnd.musician", "mus"], + ["application/vnd.muvee.style", "msty"], + ["application/vnd.neurolanguage.nlu", "nlu"], + ["application/vnd.noblenet-directory", "nnd"], + ["application/vnd.noblenet-sealer", "nns"], + ["application/vnd.noblenet-web", "nnw"], + ["application/vnd.nokia.configuration-message", "ncm"], + ["application/vnd.nokia.n-gage.data", "ngdat"], + ["application/vnd.nokia.n-gage.symbian.install", "n-gage"], + ["application/vnd.nokia.radio-preset", "rpst"], + ["application/vnd.nokia.radio-presets", "rpss"], + ["application/vnd.nokia.ringing-tone", "rng"], + ["application/vnd.novadigm.edm", "edm"], + ["application/vnd.novadigm.edx", "edx"], + ["application/vnd.novadigm.ext", "ext"], + ["application/vnd.oasis.opendocument.chart", "odc"], + ["application/vnd.oasis.opendocument.chart-template", "otc"], + ["application/vnd.oasis.opendocument.database", "odb"], + ["application/vnd.oasis.opendocument.formula", "odf"], + ["application/vnd.oasis.opendocument.formula-template", "odft"], + ["application/vnd.oasis.opendocument.graphics", "odg"], + ["application/vnd.oasis.opendocument.graphics-template", "otg"], + ["application/vnd.oasis.opendocument.image", "odi"], + ["application/vnd.oasis.opendocument.image-template", "oti"], + ["application/vnd.oasis.opendocument.presentation", "odp"], + ["application/vnd.oasis.opendocument.presentation-template", "otp"], + ["application/vnd.oasis.opendocument.spreadsheet", "ods"], + ["application/vnd.oasis.opendocument.spreadsheet-template", "ots"], + ["application/vnd.oasis.opendocument.text", "odt"], + ["application/vnd.oasis.opendocument.text-master", "odm"], + ["application/vnd.oasis.opendocument.text-template", "ott"], + ["application/vnd.oasis.opendocument.text-web", "oth"], + ["application/vnd.olpc-sugar", "xo"], + ["application/vnd.oma.dd2+xml", "dd2"], + ["application/vnd.openofficeorg.extension", "oxt"], + ["application/vnd.openxmlformats-officedocument.presentationml.presentation", "pptx"], + ["application/vnd.openxmlformats-officedocument.presentationml.slide", "sldx"], + ["application/vnd.openxmlformats-officedocument.presentationml.slideshow", "ppsx"], + ["application/vnd.openxmlformats-officedocument.presentationml.template", "potx"], + ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "xlsx"], + ["application/vnd.openxmlformats-officedocument.spreadsheetml.template", "xltx"], + ["application/vnd.openxmlformats-officedocument.wordprocessingml.document", "docx"], + ["application/vnd.openxmlformats-officedocument.wordprocessingml.template", "dotx"], + ["application/vnd.osgeo.mapguide.package", "mgp"], + ["application/vnd.osgi.dp", "dp"], + ["application/vnd.palm", "pdb"], + ["application/vnd.pawaafile", "paw"], + ["application/vnd.pg.format", "str"], + ["application/vnd.pg.osasli", "ei6"], + ["application/vnd.picsel", "efif"], + ["application/vnd.pmi.widget", "wg"], + ["application/vnd.pocketlearn", "plf"], + ["application/vnd.powerbuilder6", "pbd"], + ["application/vnd.previewsystems.box", "box"], + ["application/vnd.proteus.magazine", "mgz"], + ["application/vnd.publishare-delta-tree", "qps"], + ["application/vnd.pvi.ptid1", "ptid"], + ["application/vnd.quark.quarkxpress", "qxd"], + ["application/vnd.realvnc.bed", "bed"], + ["application/vnd.recordare.musicxml", "mxl"], + ["application/vnd.recordare.musicxml+xml", "musicxml"], + ["application/vnd.rig.cryptonote", "cryptonote"], + ["application/vnd.rim.cod", "cod"], + ["application/vnd.rn-realmedia", "rm"], + ["application/vnd.rn-realplayer", "rnx"], + ["application/vnd.route66.link66+xml", "link66"], + ["application/vnd.sailingtracker.track", "st"], + ["application/vnd.seemail", "see"], + ["application/vnd.sema", "sema"], + ["application/vnd.semd", "semd"], + ["application/vnd.semf", "semf"], + ["application/vnd.shana.informed.formdata", "ifm"], + ["application/vnd.shana.informed.formtemplate", "itp"], + ["application/vnd.shana.informed.interchange", "iif"], + ["application/vnd.shana.informed.package", "ipk"], + ["application/vnd.simtech-mindmapper", "twd"], + ["application/vnd.smaf", "mmf"], + ["application/vnd.smart.teacher", "teacher"], + ["application/vnd.solent.sdkm+xml", "sdkm"], + ["application/vnd.spotfire.dxp", "dxp"], + ["application/vnd.spotfire.sfs", "sfs"], + ["application/vnd.stardivision.calc", "sdc"], + ["application/vnd.stardivision.draw", "sda"], + ["application/vnd.stardivision.impress", "sdd"], + ["application/vnd.stardivision.math", "smf"], + ["application/vnd.stardivision.writer", "sdw"], + ["application/vnd.stardivision.writer-global", "sgl"], + ["application/vnd.stepmania.stepchart", "sm"], + ["application/vnd.sun.xml.calc", "sxc"], + ["application/vnd.sun.xml.calc.template", "stc"], + ["application/vnd.sun.xml.draw", "sxd"], + ["application/vnd.sun.xml.draw.template", "std"], + ["application/vnd.sun.xml.impress", "sxi"], + ["application/vnd.sun.xml.impress.template", "sti"], + ["application/vnd.sun.xml.math", "sxm"], + ["application/vnd.sun.xml.writer", "sxw"], + ["application/vnd.sun.xml.writer.global", "sxg"], + ["application/vnd.sun.xml.writer.template", "stw"], + ["application/vnd.sus-calendar", "sus"], + ["application/vnd.svd", "svd"], + ["application/vnd.symbian.install", "sis"], + ["application/vnd.syncml+xml", "xsm"], + ["application/vnd.syncml.dm+wbxml", "bdm"], + ["application/vnd.syncml.dm+xml", "xdm"], + ["application/vnd.tao.intent-module-archive", "tao"], + ["application/vnd.tmobile-livetv", "tmo"], + ["application/vnd.trid.tpt", "tpt"], + ["application/vnd.triscape.mxs", "mxs"], + ["application/vnd.trueapp", "tra"], + ["application/vnd.ufdl", "ufd"], + ["application/vnd.uiq.theme", "utz"], + ["application/vnd.umajin", "umj"], + ["application/vnd.unity", "unityweb"], + ["application/vnd.uoml+xml", "uoml"], + ["application/vnd.vcx", "vcx"], + ["application/vnd.visio", "vsd"], + ["application/vnd.visionary", "vis"], + ["application/vnd.vsf", "vsf"], + ["application/vnd.wap.wbxml", "wbxml"], + ["application/vnd.wap.wmlc", "wmlc"], + ["application/vnd.wap.wmlscriptc", "wmlsc"], + ["application/vnd.webturbo", "wtb"], + ["application/vnd.wolfram.player", "nbp"], + ["application/vnd.wordperfect", "wpd"], + ["application/vnd.wqd", "wqd"], + ["application/vnd.wt.stf", "stf"], + ["application/vnd.xara", ["web", "xar"]], + ["application/vnd.xfdl", "xfdl"], + ["application/vnd.yamaha.hv-dic", "hvd"], + ["application/vnd.yamaha.hv-script", "hvs"], + ["application/vnd.yamaha.hv-voice", "hvp"], + ["application/vnd.yamaha.openscoreformat", "osf"], + ["application/vnd.yamaha.openscoreformat.osfpvg+xml", "osfpvg"], + ["application/vnd.yamaha.smaf-audio", "saf"], + ["application/vnd.yamaha.smaf-phrase", "spf"], + ["application/vnd.yellowriver-custom-menu", "cmp"], + ["application/vnd.zul", "zir"], + ["application/vnd.zzazz.deck+xml", "zaz"], + ["application/vocaltec-media-desc", "vmd"], + ["application/vocaltec-media-file", "vmf"], + ["application/voicexml+xml", "vxml"], + ["application/widget", "wgt"], + ["application/winhlp", "hlp"], + ["application/wordperfect", ["wp", "wp5", "wp6", "wpd"]], + ["application/wordperfect6.0", ["w60", "wp5"]], + ["application/wordperfect6.1", "w61"], + ["application/wsdl+xml", "wsdl"], + ["application/wspolicy+xml", "wspolicy"], + ["application/x-123", "wk1"], + ["application/x-7z-compressed", "7z"], + ["application/x-abiword", "abw"], + ["application/x-ace-compressed", "ace"], + ["application/x-aim", "aim"], + ["application/x-authorware-bin", "aab"], + ["application/x-authorware-map", "aam"], + ["application/x-authorware-seg", "aas"], + ["application/x-bcpio", "bcpio"], + ["application/x-binary", "bin"], + ["application/x-binhex40", "hqx"], + ["application/x-bittorrent", "torrent"], + ["application/x-bsh", ["bsh", "sh", "shar"]], + ["application/x-bytecode.elisp", "elc"], + ["application/x-bytecode.python", "pyc"], + ["application/x-bzip", "bz"], + ["application/x-bzip2", ["boz", "bz2"]], + ["application/x-cdf", "cdf"], + ["application/x-cdlink", "vcd"], + ["application/x-chat", ["cha", "chat"]], + ["application/x-chess-pgn", "pgn"], + ["application/x-cmu-raster", "ras"], + ["application/x-cocoa", "cco"], + ["application/x-compactpro", "cpt"], + ["application/x-compress", "z"], + ["application/x-compressed", ["tgz", "gz", "z", "zip"]], + ["application/x-conference", "nsc"], + ["application/x-cpio", "cpio"], + ["application/x-cpt", "cpt"], + ["application/x-csh", "csh"], + ["application/x-debian-package", "deb"], + ["application/x-deepv", "deepv"], + ["application/x-director", ["dir", "dcr", "dxr"]], + ["application/x-doom", "wad"], + ["application/x-dtbncx+xml", "ncx"], + ["application/x-dtbook+xml", "dtb"], + ["application/x-dtbresource+xml", "res"], + ["application/x-dvi", "dvi"], + ["application/x-elc", "elc"], + ["application/x-envoy", ["env", "evy"]], + ["application/x-esrehber", "es"], + ["application/x-excel", ["xls", "xla", "xlb", "xlc", "xld", "xlk", "xll", "xlm", "xlt", "xlv", "xlw"]], + ["application/x-font-bdf", "bdf"], + ["application/x-font-ghostscript", "gsf"], + ["application/x-font-linux-psf", "psf"], + ["application/x-font-otf", "otf"], + ["application/x-font-pcf", "pcf"], + ["application/x-font-snf", "snf"], + ["application/x-font-ttf", "ttf"], + ["application/x-font-type1", "pfa"], + ["application/x-font-woff", "woff"], + ["application/x-frame", "mif"], + ["application/x-freelance", "pre"], + ["application/x-futuresplash", "spl"], + ["application/x-gnumeric", "gnumeric"], + ["application/x-gsp", "gsp"], + ["application/x-gss", "gss"], + ["application/x-gtar", "gtar"], + ["application/x-gzip", ["gz", "gzip"]], + ["application/x-hdf", "hdf"], + ["application/x-helpfile", ["help", "hlp"]], + ["application/x-httpd-imap", "imap"], + ["application/x-ima", "ima"], + ["application/x-internet-signup", ["ins", "isp"]], + ["application/x-internett-signup", "ins"], + ["application/x-inventor", "iv"], + ["application/x-ip2", "ip"], + ["application/x-iphone", "iii"], + ["application/x-java-class", "class"], + ["application/x-java-commerce", "jcm"], + ["application/x-java-jnlp-file", "jnlp"], + ["application/x-javascript", "js"], + ["application/x-koan", ["skd", "skm", "skp", "skt"]], + ["application/x-ksh", "ksh"], + ["application/x-latex", ["latex", "ltx"]], + ["application/x-lha", "lha"], + ["application/x-lisp", "lsp"], + ["application/x-livescreen", "ivy"], + ["application/x-lotus", "wq1"], + ["application/x-lotusscreencam", "scm"], + ["application/x-lzh", "lzh"], + ["application/x-lzx", "lzx"], + ["application/x-mac-binhex40", "hqx"], + ["application/x-macbinary", "bin"], + ["application/x-magic-cap-package-1.0", "mc$"], + ["application/x-mathcad", "mcd"], + ["application/x-meme", "mm"], + ["application/x-midi", ["mid", "midi"]], + ["application/x-mif", "mif"], + ["application/x-mix-transfer", "nix"], + ["application/x-mobipocket-ebook", "prc"], + ["application/x-mplayer2", "asx"], + ["application/x-ms-application", "application"], + ["application/x-ms-wmd", "wmd"], + ["application/x-ms-wmz", "wmz"], + ["application/x-ms-xbap", "xbap"], + ["application/x-msaccess", "mdb"], + ["application/x-msbinder", "obd"], + ["application/x-mscardfile", "crd"], + ["application/x-msclip", "clp"], + ["application/x-msdownload", ["exe", "dll"]], + ["application/x-msexcel", ["xls", "xla", "xlw"]], + ["application/x-msmediaview", ["mvb", "m13", "m14"]], + ["application/x-msmetafile", "wmf"], + ["application/x-msmoney", "mny"], + ["application/x-mspowerpoint", "ppt"], + ["application/x-mspublisher", "pub"], + ["application/x-msschedule", "scd"], + ["application/x-msterminal", "trm"], + ["application/x-mswrite", "wri"], + ["application/x-navi-animation", "ani"], + ["application/x-navidoc", "nvd"], + ["application/x-navimap", "map"], + ["application/x-navistyle", "stl"], + ["application/x-netcdf", ["cdf", "nc"]], + ["application/x-newton-compatible-pkg", "pkg"], + ["application/x-nokia-9000-communicator-add-on-software", "aos"], + ["application/x-omc", "omc"], + ["application/x-omcdatamaker", "omcd"], + ["application/x-omcregerator", "omcr"], + ["application/x-pagemaker", ["pm4", "pm5"]], + ["application/x-pcl", "pcl"], + ["application/x-perfmon", ["pma", "pmc", "pml", "pmr", "pmw"]], + ["application/x-pixclscript", "plx"], + ["application/x-pkcs10", "p10"], + ["application/x-pkcs12", ["p12", "pfx"]], + ["application/x-pkcs7-certificates", ["p7b", "spc"]], + ["application/x-pkcs7-certreqresp", "p7r"], + ["application/x-pkcs7-mime", ["p7m", "p7c"]], + ["application/x-pkcs7-signature", ["p7s", "p7a"]], + ["application/x-pointplus", "css"], + ["application/x-portable-anymap", "pnm"], + ["application/x-project", ["mpc", "mpt", "mpv", "mpx"]], + ["application/x-qpro", "wb1"], + ["application/x-rar-compressed", "rar"], + ["application/x-rtf", "rtf"], + ["application/x-sdp", "sdp"], + ["application/x-sea", "sea"], + ["application/x-seelogo", "sl"], + ["application/x-sh", "sh"], + ["application/x-shar", ["shar", "sh"]], + ["application/x-shockwave-flash", "swf"], + ["application/x-silverlight-app", "xap"], + ["application/x-sit", "sit"], + ["application/x-sprite", ["spr", "sprite"]], + ["application/x-stuffit", "sit"], + ["application/x-stuffitx", "sitx"], + ["application/x-sv4cpio", "sv4cpio"], + ["application/x-sv4crc", "sv4crc"], + ["application/x-tar", "tar"], + ["application/x-tbook", ["sbk", "tbk"]], + ["application/x-tcl", "tcl"], + ["application/x-tex", "tex"], + ["application/x-tex-tfm", "tfm"], + ["application/x-texinfo", ["texi", "texinfo"]], + ["application/x-troff", ["roff", "t", "tr"]], + ["application/x-troff-man", "man"], + ["application/x-troff-me", "me"], + ["application/x-troff-ms", "ms"], + ["application/x-troff-msvideo", "avi"], + ["application/x-ustar", "ustar"], + ["application/x-visio", ["vsd", "vst", "vsw"]], + ["application/x-vnd.audioexplosion.mzz", "mzz"], + ["application/x-vnd.ls-xpix", "xpix"], + ["application/x-vrml", "vrml"], + ["application/x-wais-source", ["src", "wsrc"]], + ["application/x-winhelp", "hlp"], + ["application/x-wintalk", "wtk"], + ["application/x-world", ["wrl", "svr"]], + ["application/x-wpwin", "wpd"], + ["application/x-wri", "wri"], + ["application/x-x509-ca-cert", ["cer", "crt", "der"]], + ["application/x-x509-user-cert", "crt"], + ["application/x-xfig", "fig"], + ["application/x-xpinstall", "xpi"], + ["application/x-zip-compressed", "zip"], + ["application/xcap-diff+xml", "xdf"], + ["application/xenc+xml", "xenc"], + ["application/xhtml+xml", "xhtml"], + ["application/xml", "xml"], + ["application/xml-dtd", "dtd"], + ["application/xop+xml", "xop"], + ["application/xslt+xml", "xslt"], + ["application/xspf+xml", "xspf"], + ["application/xv+xml", "mxml"], + ["application/yang", "yang"], + ["application/yin+xml", "yin"], + ["application/ynd.ms-pkipko", "pko"], + ["application/zip", "zip"], + ["audio/adpcm", "adp"], + ["audio/aiff", ["aiff", "aif", "aifc"]], + ["audio/basic", ["snd", "au"]], + ["audio/it", "it"], + ["audio/make", ["funk", "my", "pfunk"]], + ["audio/make.my.funk", "pfunk"], + ["audio/mid", ["mid", "rmi"]], + ["audio/midi", ["midi", "kar", "mid"]], + ["audio/mod", "mod"], + ["audio/mp4", "mp4a"], + ["audio/mpeg", ["mpga", "mp3", "m2a", "mp2", "mpa", "mpg"]], + ["audio/mpeg3", "mp3"], + ["audio/nspaudio", ["la", "lma"]], + ["audio/ogg", "oga"], + ["audio/s3m", "s3m"], + ["audio/tsp-audio", "tsi"], + ["audio/tsplayer", "tsp"], + ["audio/vnd.dece.audio", "uva"], + ["audio/vnd.digital-winds", "eol"], + ["audio/vnd.dra", "dra"], + ["audio/vnd.dts", "dts"], + ["audio/vnd.dts.hd", "dtshd"], + ["audio/vnd.lucent.voice", "lvp"], + ["audio/vnd.ms-playready.media.pya", "pya"], + ["audio/vnd.nuera.ecelp4800", "ecelp4800"], + ["audio/vnd.nuera.ecelp7470", "ecelp7470"], + ["audio/vnd.nuera.ecelp9600", "ecelp9600"], + ["audio/vnd.qcelp", "qcp"], + ["audio/vnd.rip", "rip"], + ["audio/voc", "voc"], + ["audio/voxware", "vox"], + ["audio/wav", "wav"], + ["audio/webm", "weba"], + ["audio/x-aac", "aac"], + ["audio/x-adpcm", "snd"], + ["audio/x-aiff", ["aiff", "aif", "aifc"]], + ["audio/x-au", "au"], + ["audio/x-gsm", ["gsd", "gsm"]], + ["audio/x-jam", "jam"], + ["audio/x-liveaudio", "lam"], + ["audio/x-mid", ["mid", "midi"]], + ["audio/x-midi", ["midi", "mid"]], + ["audio/x-mod", "mod"], + ["audio/x-mpeg", "mp2"], + ["audio/x-mpeg-3", "mp3"], + ["audio/x-mpegurl", "m3u"], + ["audio/x-mpequrl", "m3u"], + ["audio/x-ms-wax", "wax"], + ["audio/x-ms-wma", "wma"], + ["audio/x-nspaudio", ["la", "lma"]], + ["audio/x-pn-realaudio", ["ra", "ram", "rm", "rmm", "rmp"]], + ["audio/x-pn-realaudio-plugin", ["ra", "rmp", "rpm"]], + ["audio/x-psid", "sid"], + ["audio/x-realaudio", "ra"], + ["audio/x-twinvq", "vqf"], + ["audio/x-twinvq-plugin", ["vqe", "vql"]], + ["audio/x-vnd.audioexplosion.mjuicemediafile", "mjf"], + ["audio/x-voc", "voc"], + ["audio/x-wav", "wav"], + ["audio/xm", "xm"], + ["chemical/x-cdx", "cdx"], + ["chemical/x-cif", "cif"], + ["chemical/x-cmdf", "cmdf"], + ["chemical/x-cml", "cml"], + ["chemical/x-csml", "csml"], + ["chemical/x-pdb", ["pdb", "xyz"]], + ["chemical/x-xyz", "xyz"], + ["drawing/x-dwf", "dwf"], + ["i-world/i-vrml", "ivr"], + ["image/bmp", ["bmp", "bm"]], + ["image/cgm", "cgm"], + ["image/cis-cod", "cod"], + ["image/cmu-raster", ["ras", "rast"]], + ["image/fif", "fif"], + ["image/florian", ["flo", "turbot"]], + ["image/g3fax", "g3"], + ["image/gif", "gif"], + ["image/ief", ["ief", "iefs"]], + ["image/jpeg", ["jpeg", "jpe", "jpg", "jfif", "jfif-tbnl"]], + ["image/jutvision", "jut"], + ["image/ktx", "ktx"], + ["image/naplps", ["nap", "naplps"]], + ["image/pict", ["pic", "pict"]], + ["image/pipeg", "jfif"], + ["image/pjpeg", ["jfif", "jpe", "jpeg", "jpg"]], + ["image/png", ["png", "x-png"]], + ["image/prs.btif", "btif"], + ["image/svg+xml", "svg"], + ["image/tiff", ["tif", "tiff"]], + ["image/vasa", "mcf"], + ["image/vnd.adobe.photoshop", "psd"], + ["image/vnd.dece.graphic", "uvi"], + ["image/vnd.djvu", "djvu"], + ["image/vnd.dvb.subtitle", "sub"], + ["image/vnd.dwg", ["dwg", "dxf", "svf"]], + ["image/vnd.dxf", "dxf"], + ["image/vnd.fastbidsheet", "fbs"], + ["image/vnd.fpx", "fpx"], + ["image/vnd.fst", "fst"], + ["image/vnd.fujixerox.edmics-mmr", "mmr"], + ["image/vnd.fujixerox.edmics-rlc", "rlc"], + ["image/vnd.ms-modi", "mdi"], + ["image/vnd.net-fpx", ["fpx", "npx"]], + ["image/vnd.rn-realflash", "rf"], + ["image/vnd.rn-realpix", "rp"], + ["image/vnd.wap.wbmp", "wbmp"], + ["image/vnd.xiff", "xif"], + ["image/webp", "webp"], + ["image/x-cmu-raster", "ras"], + ["image/x-cmx", "cmx"], + ["image/x-dwg", ["dwg", "dxf", "svf"]], + ["image/x-freehand", "fh"], + ["image/x-icon", "ico"], + ["image/x-jg", "art"], + ["image/x-jps", "jps"], + ["image/x-niff", ["niff", "nif"]], + ["image/x-pcx", "pcx"], + ["image/x-pict", ["pct", "pic"]], + ["image/x-portable-anymap", "pnm"], + ["image/x-portable-bitmap", "pbm"], + ["image/x-portable-graymap", "pgm"], + ["image/x-portable-greymap", "pgm"], + ["image/x-portable-pixmap", "ppm"], + ["image/x-quicktime", ["qif", "qti", "qtif"]], + ["image/x-rgb", "rgb"], + ["image/x-tiff", ["tif", "tiff"]], + ["image/x-windows-bmp", "bmp"], + ["image/x-xbitmap", "xbm"], + ["image/x-xbm", "xbm"], + ["image/x-xpixmap", ["xpm", "pm"]], + ["image/x-xwd", "xwd"], + ["image/x-xwindowdump", "xwd"], + ["image/xbm", "xbm"], + ["image/xpm", "xpm"], + ["message/rfc822", ["eml", "mht", "mhtml", "nws", "mime"]], + ["model/iges", ["iges", "igs"]], + ["model/mesh", "msh"], + ["model/vnd.collada+xml", "dae"], + ["model/vnd.dwf", "dwf"], + ["model/vnd.gdl", "gdl"], + ["model/vnd.gtw", "gtw"], + ["model/vnd.mts", "mts"], + ["model/vnd.vtu", "vtu"], + ["model/vrml", ["vrml", "wrl", "wrz"]], + ["model/x-pov", "pov"], + ["multipart/x-gzip", "gzip"], + ["multipart/x-ustar", "ustar"], + ["multipart/x-zip", "zip"], + ["music/crescendo", ["mid", "midi"]], + ["music/x-karaoke", "kar"], + ["paleovu/x-pv", "pvu"], + ["text/asp", "asp"], + ["text/calendar", "ics"], + ["text/css", "css"], + ["text/csv", "csv"], + ["text/ecmascript", "js"], + ["text/h323", "323"], + ["text/html", ["html", "htm", "stm", "acgi", "htmls", "htx", "shtml"]], + ["text/iuls", "uls"], + ["text/javascript", "js"], + ["text/mcf", "mcf"], + ["text/n3", "n3"], + ["text/pascal", "pas"], + [ + "text/plain", + [ + "txt", + "bas", + "c", + "h", + "c++", + "cc", + "com", + "conf", + "cxx", + "def", + "f", + "f90", + "for", + "g", + "hh", + "idc", + "jav", + "java", + "list", + "log", + "lst", + "m", + "mar", + "pl", + "sdml", + "text" + ] + ], + ["text/plain-bas", "par"], + ["text/prs.lines.tag", "dsc"], + ["text/richtext", ["rtx", "rt", "rtf"]], + ["text/scriplet", "wsc"], + ["text/scriptlet", "sct"], + ["text/sgml", ["sgm", "sgml"]], + ["text/tab-separated-values", "tsv"], + ["text/troff", "t"], + ["text/turtle", "ttl"], + ["text/uri-list", ["uni", "unis", "uri", "uris"]], + ["text/vnd.abc", "abc"], + ["text/vnd.curl", "curl"], + ["text/vnd.curl.dcurl", "dcurl"], + ["text/vnd.curl.mcurl", "mcurl"], + ["text/vnd.curl.scurl", "scurl"], + ["text/vnd.fly", "fly"], + ["text/vnd.fmi.flexstor", "flx"], + ["text/vnd.graphviz", "gv"], + ["text/vnd.in3d.3dml", "3dml"], + ["text/vnd.in3d.spot", "spot"], + ["text/vnd.rn-realtext", "rt"], + ["text/vnd.sun.j2me.app-descriptor", "jad"], + ["text/vnd.wap.wml", "wml"], + ["text/vnd.wap.wmlscript", "wmls"], + ["text/webviewhtml", "htt"], + ["text/x-asm", ["asm", "s"]], + ["text/x-audiosoft-intra", "aip"], + ["text/x-c", ["c", "cc", "cpp"]], + ["text/x-component", "htc"], + ["text/x-fortran", ["for", "f", "f77", "f90"]], + ["text/x-h", ["h", "hh"]], + ["text/x-java-source", ["java", "jav"]], + ["text/x-java-source,java", "java"], + ["text/x-la-asf", "lsx"], + ["text/x-m", "m"], + ["text/x-pascal", "p"], + ["text/x-script", "hlb"], + ["text/x-script.csh", "csh"], + ["text/x-script.elisp", "el"], + ["text/x-script.guile", "scm"], + ["text/x-script.ksh", "ksh"], + ["text/x-script.lisp", "lsp"], + ["text/x-script.perl", "pl"], + ["text/x-script.perl-module", "pm"], + ["text/x-script.phyton", "py"], + ["text/x-script.rexx", "rexx"], + ["text/x-script.scheme", "scm"], + ["text/x-script.sh", "sh"], + ["text/x-script.tcl", "tcl"], + ["text/x-script.tcsh", "tcsh"], + ["text/x-script.zsh", "zsh"], + ["text/x-server-parsed-html", ["shtml", "ssi"]], + ["text/x-setext", "etx"], + ["text/x-sgml", ["sgm", "sgml"]], + ["text/x-speech", ["spc", "talk"]], + ["text/x-uil", "uil"], + ["text/x-uuencode", ["uu", "uue"]], + ["text/x-vcalendar", "vcs"], + ["text/x-vcard", "vcf"], + ["text/xml", "xml"], + ["video/3gpp", "3gp"], + ["video/3gpp2", "3g2"], + ["video/animaflex", "afl"], + ["video/avi", "avi"], + ["video/avs-video", "avs"], + ["video/dl", "dl"], + ["video/fli", "fli"], + ["video/gl", "gl"], + ["video/h261", "h261"], + ["video/h263", "h263"], + ["video/h264", "h264"], + ["video/jpeg", "jpgv"], + ["video/jpm", "jpm"], + ["video/mj2", "mj2"], + ["video/mp4", "mp4"], + ["video/mpeg", ["mpeg", "mp2", "mpa", "mpe", "mpg", "mpv2", "m1v", "m2v", "mp3"]], + ["video/msvideo", "avi"], + ["video/ogg", "ogv"], + ["video/quicktime", ["mov", "qt", "moov"]], + ["video/vdo", "vdo"], + ["video/vivo", ["viv", "vivo"]], + ["video/vnd.dece.hd", "uvh"], + ["video/vnd.dece.mobile", "uvm"], + ["video/vnd.dece.pd", "uvp"], + ["video/vnd.dece.sd", "uvs"], + ["video/vnd.dece.video", "uvv"], + ["video/vnd.fvt", "fvt"], + ["video/vnd.mpegurl", "mxu"], + ["video/vnd.ms-playready.media.pyv", "pyv"], + ["video/vnd.rn-realvideo", "rv"], + ["video/vnd.uvvu.mp4", "uvu"], + ["video/vnd.vivo", ["viv", "vivo"]], + ["video/vosaic", "vos"], + ["video/webm", "webm"], + ["video/x-amt-demorun", "xdr"], + ["video/x-amt-showrun", "xsr"], + ["video/x-atomic3d-feature", "fmf"], + ["video/x-dl", "dl"], + ["video/x-dv", ["dif", "dv"]], + ["video/x-f4v", "f4v"], + ["video/x-fli", "fli"], + ["video/x-flv", "flv"], + ["video/x-gl", "gl"], + ["video/x-isvideo", "isu"], + ["video/x-la-asf", ["lsf", "lsx"]], + ["video/x-m4v", "m4v"], + ["video/x-motion-jpeg", "mjpg"], + ["video/x-mpeg", ["mp3", "mp2"]], + ["video/x-mpeq2a", "mp2"], + ["video/x-ms-asf", ["asf", "asr", "asx"]], + ["video/x-ms-asf-plugin", "asx"], + ["video/x-ms-wm", "wm"], + ["video/x-ms-wmv", "wmv"], + ["video/x-ms-wmx", "wmx"], + ["video/x-ms-wvx", "wvx"], + ["video/x-msvideo", "avi"], + ["video/x-qtc", "qtc"], + ["video/x-scm", "scm"], + ["video/x-sgi-movie", ["movie", "mv"]], + ["windows/metafile", "wmf"], + ["www/mime", "mime"], + ["x-conference/x-cooltalk", "ice"], + ["x-music/x-midi", ["mid", "midi"]], + ["x-world/x-3dmf", ["3dm", "3dmf", "qd3", "qd3d"]], + ["x-world/x-svr", "svr"], + ["x-world/x-vrml", ["flr", "vrml", "wrl", "wrz", "xaf", "xof"]], + ["x-world/x-vrt", "vrt"], + ["xgl/drawing", "xgz"], + ["xgl/movie", "xmz"] + ]); + var extensions = /* @__PURE__ */ new Map([ + ["123", "application/vnd.lotus-1-2-3"], + ["323", "text/h323"], + ["*", "application/octet-stream"], + ["3dm", "x-world/x-3dmf"], + ["3dmf", "x-world/x-3dmf"], + ["3dml", "text/vnd.in3d.3dml"], + ["3g2", "video/3gpp2"], + ["3gp", "video/3gpp"], + ["7z", "application/x-7z-compressed"], + ["a", "application/octet-stream"], + ["aab", "application/x-authorware-bin"], + ["aac", "audio/x-aac"], + ["aam", "application/x-authorware-map"], + ["aas", "application/x-authorware-seg"], + ["abc", "text/vnd.abc"], + ["abw", "application/x-abiword"], + ["ac", "application/pkix-attr-cert"], + ["acc", "application/vnd.americandynamics.acc"], + ["ace", "application/x-ace-compressed"], + ["acgi", "text/html"], + ["acu", "application/vnd.acucobol"], + ["acx", "application/internet-property-stream"], + ["adp", "audio/adpcm"], + ["aep", "application/vnd.audiograph"], + ["afl", "video/animaflex"], + ["afp", "application/vnd.ibm.modcap"], + ["ahead", "application/vnd.ahead.space"], + ["ai", "application/postscript"], + ["aif", ["audio/aiff", "audio/x-aiff"]], + ["aifc", ["audio/aiff", "audio/x-aiff"]], + ["aiff", ["audio/aiff", "audio/x-aiff"]], + ["aim", "application/x-aim"], + ["aip", "text/x-audiosoft-intra"], + ["air", "application/vnd.adobe.air-application-installer-package+zip"], + ["ait", "application/vnd.dvb.ait"], + ["ami", "application/vnd.amiga.ami"], + ["ani", "application/x-navi-animation"], + ["aos", "application/x-nokia-9000-communicator-add-on-software"], + ["apk", "application/vnd.android.package-archive"], + ["application", "application/x-ms-application"], + ["apr", "application/vnd.lotus-approach"], + ["aps", "application/mime"], + ["arc", "application/octet-stream"], + ["arj", ["application/arj", "application/octet-stream"]], + ["art", "image/x-jg"], + ["asf", "video/x-ms-asf"], + ["asm", "text/x-asm"], + ["aso", "application/vnd.accpac.simply.aso"], + ["asp", "text/asp"], + ["asr", "video/x-ms-asf"], + ["asx", ["video/x-ms-asf", "application/x-mplayer2", "video/x-ms-asf-plugin"]], + ["atc", "application/vnd.acucorp"], + ["atomcat", "application/atomcat+xml"], + ["atomsvc", "application/atomsvc+xml"], + ["atx", "application/vnd.antix.game-component"], + ["au", ["audio/basic", "audio/x-au"]], + ["avi", ["video/avi", "video/msvideo", "application/x-troff-msvideo", "video/x-msvideo"]], + ["avs", "video/avs-video"], + ["aw", "application/applixware"], + ["axs", "application/olescript"], + ["azf", "application/vnd.airzip.filesecure.azf"], + ["azs", "application/vnd.airzip.filesecure.azs"], + ["azw", "application/vnd.amazon.ebook"], + ["bas", "text/plain"], + ["bcpio", "application/x-bcpio"], + ["bdf", "application/x-font-bdf"], + ["bdm", "application/vnd.syncml.dm+wbxml"], + ["bed", "application/vnd.realvnc.bed"], + ["bh2", "application/vnd.fujitsu.oasysprs"], + [ + "bin", + ["application/octet-stream", "application/mac-binary", "application/macbinary", "application/x-macbinary", "application/x-binary"] + ], + ["bm", "image/bmp"], + ["bmi", "application/vnd.bmi"], + ["bmp", ["image/bmp", "image/x-windows-bmp"]], + ["boo", "application/book"], + ["book", "application/book"], + ["box", "application/vnd.previewsystems.box"], + ["boz", "application/x-bzip2"], + ["bsh", "application/x-bsh"], + ["btif", "image/prs.btif"], + ["bz", "application/x-bzip"], + ["bz2", "application/x-bzip2"], + ["c", ["text/plain", "text/x-c"]], + ["c++", "text/plain"], + ["c11amc", "application/vnd.cluetrust.cartomobile-config"], + ["c11amz", "application/vnd.cluetrust.cartomobile-config-pkg"], + ["c4g", "application/vnd.clonk.c4group"], + ["cab", "application/vnd.ms-cab-compressed"], + ["car", "application/vnd.curl.car"], + ["cat", ["application/vnd.ms-pkiseccat", "application/vnd.ms-pki.seccat"]], + ["cc", ["text/plain", "text/x-c"]], + ["ccad", "application/clariscad"], + ["cco", "application/x-cocoa"], + ["ccxml", "application/ccxml+xml,"], + ["cdbcmsg", "application/vnd.contact.cmsg"], + ["cdf", ["application/cdf", "application/x-cdf", "application/x-netcdf"]], + ["cdkey", "application/vnd.mediastation.cdkey"], + ["cdmia", "application/cdmi-capability"], + ["cdmic", "application/cdmi-container"], + ["cdmid", "application/cdmi-domain"], + ["cdmio", "application/cdmi-object"], + ["cdmiq", "application/cdmi-queue"], + ["cdx", "chemical/x-cdx"], + ["cdxml", "application/vnd.chemdraw+xml"], + ["cdy", "application/vnd.cinderella"], + ["cer", ["application/pkix-cert", "application/x-x509-ca-cert"]], + ["cgm", "image/cgm"], + ["cha", "application/x-chat"], + ["chat", "application/x-chat"], + ["chm", "application/vnd.ms-htmlhelp"], + ["chrt", "application/vnd.kde.kchart"], + ["cif", "chemical/x-cif"], + ["cii", "application/vnd.anser-web-certificate-issue-initiation"], + ["cil", "application/vnd.ms-artgalry"], + ["cla", "application/vnd.claymore"], + [ + "class", + ["application/octet-stream", "application/java", "application/java-byte-code", "application/java-vm", "application/x-java-class"] + ], + ["clkk", "application/vnd.crick.clicker.keyboard"], + ["clkp", "application/vnd.crick.clicker.palette"], + ["clkt", "application/vnd.crick.clicker.template"], + ["clkw", "application/vnd.crick.clicker.wordbank"], + ["clkx", "application/vnd.crick.clicker"], + ["clp", "application/x-msclip"], + ["cmc", "application/vnd.cosmocaller"], + ["cmdf", "chemical/x-cmdf"], + ["cml", "chemical/x-cml"], + ["cmp", "application/vnd.yellowriver-custom-menu"], + ["cmx", "image/x-cmx"], + ["cod", ["image/cis-cod", "application/vnd.rim.cod"]], + ["com", ["application/octet-stream", "text/plain"]], + ["conf", "text/plain"], + ["cpio", "application/x-cpio"], + ["cpp", "text/x-c"], + ["cpt", ["application/mac-compactpro", "application/x-compactpro", "application/x-cpt"]], + ["crd", "application/x-mscardfile"], + ["crl", ["application/pkix-crl", "application/pkcs-crl"]], + ["crt", ["application/pkix-cert", "application/x-x509-user-cert", "application/x-x509-ca-cert"]], + ["cryptonote", "application/vnd.rig.cryptonote"], + ["csh", ["text/x-script.csh", "application/x-csh"]], + ["csml", "chemical/x-csml"], + ["csp", "application/vnd.commonspace"], + ["css", ["text/css", "application/x-pointplus"]], + ["csv", "text/csv"], + ["cu", "application/cu-seeme"], + ["curl", "text/vnd.curl"], + ["cww", "application/prs.cww"], + ["cxx", "text/plain"], + ["dae", "model/vnd.collada+xml"], + ["daf", "application/vnd.mobius.daf"], + ["davmount", "application/davmount+xml"], + ["dcr", "application/x-director"], + ["dcurl", "text/vnd.curl.dcurl"], + ["dd2", "application/vnd.oma.dd2+xml"], + ["ddd", "application/vnd.fujixerox.ddd"], + ["deb", "application/x-debian-package"], + ["deepv", "application/x-deepv"], + ["def", "text/plain"], + ["der", "application/x-x509-ca-cert"], + ["dfac", "application/vnd.dreamfactory"], + ["dif", "video/x-dv"], + ["dir", "application/x-director"], + ["dis", "application/vnd.mobius.dis"], + ["djvu", "image/vnd.djvu"], + ["dl", ["video/dl", "video/x-dl"]], + ["dll", "application/x-msdownload"], + ["dms", "application/octet-stream"], + ["dna", "application/vnd.dna"], + ["doc", "application/msword"], + ["docm", "application/vnd.ms-word.document.macroenabled.12"], + ["docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"], + ["dot", "application/msword"], + ["dotm", "application/vnd.ms-word.template.macroenabled.12"], + ["dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template"], + ["dp", ["application/commonground", "application/vnd.osgi.dp"]], + ["dpg", "application/vnd.dpgraph"], + ["dra", "audio/vnd.dra"], + ["drw", "application/drafting"], + ["dsc", "text/prs.lines.tag"], + ["dssc", "application/dssc+der"], + ["dtb", "application/x-dtbook+xml"], + ["dtd", "application/xml-dtd"], + ["dts", "audio/vnd.dts"], + ["dtshd", "audio/vnd.dts.hd"], + ["dump", "application/octet-stream"], + ["dv", "video/x-dv"], + ["dvi", "application/x-dvi"], + ["dwf", ["model/vnd.dwf", "drawing/x-dwf"]], + ["dwg", ["application/acad", "image/vnd.dwg", "image/x-dwg"]], + ["dxf", ["application/dxf", "image/vnd.dwg", "image/vnd.dxf", "image/x-dwg"]], + ["dxp", "application/vnd.spotfire.dxp"], + ["dxr", "application/x-director"], + ["ecelp4800", "audio/vnd.nuera.ecelp4800"], + ["ecelp7470", "audio/vnd.nuera.ecelp7470"], + ["ecelp9600", "audio/vnd.nuera.ecelp9600"], + ["edm", "application/vnd.novadigm.edm"], + ["edx", "application/vnd.novadigm.edx"], + ["efif", "application/vnd.picsel"], + ["ei6", "application/vnd.pg.osasli"], + ["el", "text/x-script.elisp"], + ["elc", ["application/x-elc", "application/x-bytecode.elisp"]], + ["eml", "message/rfc822"], + ["emma", "application/emma+xml"], + ["env", "application/x-envoy"], + ["eol", "audio/vnd.digital-winds"], + ["eot", "application/vnd.ms-fontobject"], + ["eps", "application/postscript"], + ["epub", "application/epub+zip"], + ["es", ["application/ecmascript", "application/x-esrehber"]], + ["es3", "application/vnd.eszigno3+xml"], + ["esf", "application/vnd.epson.esf"], + ["etx", "text/x-setext"], + ["evy", ["application/envoy", "application/x-envoy"]], + ["exe", ["application/octet-stream", "application/x-msdownload"]], + ["exi", "application/exi"], + ["ext", "application/vnd.novadigm.ext"], + ["ez2", "application/vnd.ezpix-album"], + ["ez3", "application/vnd.ezpix-package"], + ["f", ["text/plain", "text/x-fortran"]], + ["f4v", "video/x-f4v"], + ["f77", "text/x-fortran"], + ["f90", ["text/plain", "text/x-fortran"]], + ["fbs", "image/vnd.fastbidsheet"], + ["fcs", "application/vnd.isac.fcs"], + ["fdf", "application/vnd.fdf"], + ["fe_launch", "application/vnd.denovo.fcselayout-link"], + ["fg5", "application/vnd.fujitsu.oasysgp"], + ["fh", "image/x-freehand"], + ["fif", ["application/fractals", "image/fif"]], + ["fig", "application/x-xfig"], + ["fli", ["video/fli", "video/x-fli"]], + ["flo", ["image/florian", "application/vnd.micrografx.flo"]], + ["flr", "x-world/x-vrml"], + ["flv", "video/x-flv"], + ["flw", "application/vnd.kde.kivio"], + ["flx", "text/vnd.fmi.flexstor"], + ["fly", "text/vnd.fly"], + ["fm", "application/vnd.framemaker"], + ["fmf", "video/x-atomic3d-feature"], + ["fnc", "application/vnd.frogans.fnc"], + ["for", ["text/plain", "text/x-fortran"]], + ["fpx", ["image/vnd.fpx", "image/vnd.net-fpx"]], + ["frl", "application/freeloader"], + ["fsc", "application/vnd.fsc.weblaunch"], + ["fst", "image/vnd.fst"], + ["ftc", "application/vnd.fluxtime.clip"], + ["fti", "application/vnd.anser-web-funds-transfer-initiation"], + ["funk", "audio/make"], + ["fvt", "video/vnd.fvt"], + ["fxp", "application/vnd.adobe.fxp"], + ["fzs", "application/vnd.fuzzysheet"], + ["g", "text/plain"], + ["g2w", "application/vnd.geoplan"], + ["g3", "image/g3fax"], + ["g3w", "application/vnd.geospace"], + ["gac", "application/vnd.groove-account"], + ["gdl", "model/vnd.gdl"], + ["geo", "application/vnd.dynageo"], + ["geojson", "application/geo+json"], + ["gex", "application/vnd.geometry-explorer"], + ["ggb", "application/vnd.geogebra.file"], + ["ggt", "application/vnd.geogebra.tool"], + ["ghf", "application/vnd.groove-help"], + ["gif", "image/gif"], + ["gim", "application/vnd.groove-identity-message"], + ["gl", ["video/gl", "video/x-gl"]], + ["gmx", "application/vnd.gmx"], + ["gnumeric", "application/x-gnumeric"], + ["gph", "application/vnd.flographit"], + ["gqf", "application/vnd.grafeq"], + ["gram", "application/srgs"], + ["grv", "application/vnd.groove-injector"], + ["grxml", "application/srgs+xml"], + ["gsd", "audio/x-gsm"], + ["gsf", "application/x-font-ghostscript"], + ["gsm", "audio/x-gsm"], + ["gsp", "application/x-gsp"], + ["gss", "application/x-gss"], + ["gtar", "application/x-gtar"], + ["gtm", "application/vnd.groove-tool-message"], + ["gtw", "model/vnd.gtw"], + ["gv", "text/vnd.graphviz"], + ["gxt", "application/vnd.geonext"], + ["gz", ["application/x-gzip", "application/x-compressed"]], + ["gzip", ["multipart/x-gzip", "application/x-gzip"]], + ["h", ["text/plain", "text/x-h"]], + ["h261", "video/h261"], + ["h263", "video/h263"], + ["h264", "video/h264"], + ["hal", "application/vnd.hal+xml"], + ["hbci", "application/vnd.hbci"], + ["hdf", "application/x-hdf"], + ["help", "application/x-helpfile"], + ["hgl", "application/vnd.hp-hpgl"], + ["hh", ["text/plain", "text/x-h"]], + ["hlb", "text/x-script"], + ["hlp", ["application/winhlp", "application/hlp", "application/x-helpfile", "application/x-winhelp"]], + ["hpg", "application/vnd.hp-hpgl"], + ["hpgl", "application/vnd.hp-hpgl"], + ["hpid", "application/vnd.hp-hpid"], + ["hps", "application/vnd.hp-hps"], + [ + "hqx", + [ + "application/mac-binhex40", + "application/binhex", + "application/binhex4", + "application/mac-binhex", + "application/x-binhex40", + "application/x-mac-binhex40" + ] + ], + ["hta", "application/hta"], + ["htc", "text/x-component"], + ["htke", "application/vnd.kenameaapp"], + ["htm", "text/html"], + ["html", "text/html"], + ["htmls", "text/html"], + ["htt", "text/webviewhtml"], + ["htx", "text/html"], + ["hvd", "application/vnd.yamaha.hv-dic"], + ["hvp", "application/vnd.yamaha.hv-voice"], + ["hvs", "application/vnd.yamaha.hv-script"], + ["i2g", "application/vnd.intergeo"], + ["icc", "application/vnd.iccprofile"], + ["ice", "x-conference/x-cooltalk"], + ["ico", "image/x-icon"], + ["ics", "text/calendar"], + ["idc", "text/plain"], + ["ief", "image/ief"], + ["iefs", "image/ief"], + ["ifm", "application/vnd.shana.informed.formdata"], + ["iges", ["application/iges", "model/iges"]], + ["igl", "application/vnd.igloader"], + ["igm", "application/vnd.insors.igm"], + ["igs", ["application/iges", "model/iges"]], + ["igx", "application/vnd.micrografx.igx"], + ["iif", "application/vnd.shana.informed.interchange"], + ["iii", "application/x-iphone"], + ["ima", "application/x-ima"], + ["imap", "application/x-httpd-imap"], + ["imp", "application/vnd.accpac.simply.imp"], + ["ims", "application/vnd.ms-ims"], + ["inf", "application/inf"], + ["ins", ["application/x-internet-signup", "application/x-internett-signup"]], + ["ip", "application/x-ip2"], + ["ipfix", "application/ipfix"], + ["ipk", "application/vnd.shana.informed.package"], + ["irm", "application/vnd.ibm.rights-management"], + ["irp", "application/vnd.irepository.package+xml"], + ["isp", "application/x-internet-signup"], + ["isu", "video/x-isvideo"], + ["it", "audio/it"], + ["itp", "application/vnd.shana.informed.formtemplate"], + ["iv", "application/x-inventor"], + ["ivp", "application/vnd.immervision-ivp"], + ["ivr", "i-world/i-vrml"], + ["ivu", "application/vnd.immervision-ivu"], + ["ivy", "application/x-livescreen"], + ["jad", "text/vnd.sun.j2me.app-descriptor"], + ["jam", ["application/vnd.jam", "audio/x-jam"]], + ["jar", "application/java-archive"], + ["jav", ["text/plain", "text/x-java-source"]], + ["java", ["text/plain", "text/x-java-source,java", "text/x-java-source"]], + ["jcm", "application/x-java-commerce"], + ["jfif", ["image/pipeg", "image/jpeg", "image/pjpeg"]], + ["jfif-tbnl", "image/jpeg"], + ["jisp", "application/vnd.jisp"], + ["jlt", "application/vnd.hp-jlyt"], + ["jnlp", "application/x-java-jnlp-file"], + ["joda", "application/vnd.joost.joda-archive"], + ["jpe", ["image/jpeg", "image/pjpeg"]], + ["jpeg", ["image/jpeg", "image/pjpeg"]], + ["jpg", ["image/jpeg", "image/pjpeg"]], + ["jpgv", "video/jpeg"], + ["jpm", "video/jpm"], + ["jps", "image/x-jps"], + ["js", ["application/javascript", "application/ecmascript", "text/javascript", "text/ecmascript", "application/x-javascript"]], + ["json", "application/json"], + ["jut", "image/jutvision"], + ["kar", ["audio/midi", "music/x-karaoke"]], + ["karbon", "application/vnd.kde.karbon"], + ["kfo", "application/vnd.kde.kformula"], + ["kia", "application/vnd.kidspiration"], + ["kml", "application/vnd.google-earth.kml+xml"], + ["kmz", "application/vnd.google-earth.kmz"], + ["kne", "application/vnd.kinar"], + ["kon", "application/vnd.kde.kontour"], + ["kpr", "application/vnd.kde.kpresenter"], + ["ksh", ["application/x-ksh", "text/x-script.ksh"]], + ["ksp", "application/vnd.kde.kspread"], + ["ktx", "image/ktx"], + ["ktz", "application/vnd.kahootz"], + ["kwd", "application/vnd.kde.kword"], + ["la", ["audio/nspaudio", "audio/x-nspaudio"]], + ["lam", "audio/x-liveaudio"], + ["lasxml", "application/vnd.las.las+xml"], + ["latex", "application/x-latex"], + ["lbd", "application/vnd.llamagraphics.life-balance.desktop"], + ["lbe", "application/vnd.llamagraphics.life-balance.exchange+xml"], + ["les", "application/vnd.hhe.lesson-player"], + ["lha", ["application/octet-stream", "application/lha", "application/x-lha"]], + ["lhx", "application/octet-stream"], + ["link66", "application/vnd.route66.link66+xml"], + ["list", "text/plain"], + ["lma", ["audio/nspaudio", "audio/x-nspaudio"]], + ["log", "text/plain"], + ["lrm", "application/vnd.ms-lrm"], + ["lsf", "video/x-la-asf"], + ["lsp", ["application/x-lisp", "text/x-script.lisp"]], + ["lst", "text/plain"], + ["lsx", ["video/x-la-asf", "text/x-la-asf"]], + ["ltf", "application/vnd.frogans.ltf"], + ["ltx", "application/x-latex"], + ["lvp", "audio/vnd.lucent.voice"], + ["lwp", "application/vnd.lotus-wordpro"], + ["lzh", ["application/octet-stream", "application/x-lzh"]], + ["lzx", ["application/lzx", "application/octet-stream", "application/x-lzx"]], + ["m", ["text/plain", "text/x-m"]], + ["m13", "application/x-msmediaview"], + ["m14", "application/x-msmediaview"], + ["m1v", "video/mpeg"], + ["m21", "application/mp21"], + ["m2a", "audio/mpeg"], + ["m2v", "video/mpeg"], + ["m3u", ["audio/x-mpegurl", "audio/x-mpequrl"]], + ["m3u8", "application/vnd.apple.mpegurl"], + ["m4v", "video/x-m4v"], + ["ma", "application/mathematica"], + ["mads", "application/mads+xml"], + ["mag", "application/vnd.ecowin.chart"], + ["man", "application/x-troff-man"], + ["map", "application/x-navimap"], + ["mar", "text/plain"], + ["mathml", "application/mathml+xml"], + ["mbd", "application/mbedlet"], + ["mbk", "application/vnd.mobius.mbk"], + ["mbox", "application/mbox"], + ["mc$", "application/x-magic-cap-package-1.0"], + ["mc1", "application/vnd.medcalcdata"], + ["mcd", ["application/mcad", "application/vnd.mcd", "application/x-mathcad"]], + ["mcf", ["image/vasa", "text/mcf"]], + ["mcp", "application/netmc"], + ["mcurl", "text/vnd.curl.mcurl"], + ["mdb", "application/x-msaccess"], + ["mdi", "image/vnd.ms-modi"], + ["me", "application/x-troff-me"], + ["meta4", "application/metalink4+xml"], + ["mets", "application/mets+xml"], + ["mfm", "application/vnd.mfmp"], + ["mgp", "application/vnd.osgeo.mapguide.package"], + ["mgz", "application/vnd.proteus.magazine"], + ["mht", "message/rfc822"], + ["mhtml", "message/rfc822"], + ["mid", ["audio/mid", "audio/midi", "music/crescendo", "x-music/x-midi", "audio/x-midi", "application/x-midi", "audio/x-mid"]], + ["midi", ["audio/midi", "music/crescendo", "x-music/x-midi", "audio/x-midi", "application/x-midi", "audio/x-mid"]], + ["mif", ["application/vnd.mif", "application/x-mif", "application/x-frame"]], + ["mime", ["message/rfc822", "www/mime"]], + ["mj2", "video/mj2"], + ["mjf", "audio/x-vnd.audioexplosion.mjuicemediafile"], + ["mjpg", "video/x-motion-jpeg"], + ["mlp", "application/vnd.dolby.mlp"], + ["mm", ["application/base64", "application/x-meme"]], + ["mmd", "application/vnd.chipnuts.karaoke-mmd"], + ["mme", "application/base64"], + ["mmf", "application/vnd.smaf"], + ["mmr", "image/vnd.fujixerox.edmics-mmr"], + ["mny", "application/x-msmoney"], + ["mod", ["audio/mod", "audio/x-mod"]], + ["mods", "application/mods+xml"], + ["moov", "video/quicktime"], + ["mov", "video/quicktime"], + ["movie", "video/x-sgi-movie"], + ["mp2", ["video/mpeg", "audio/mpeg", "video/x-mpeg", "audio/x-mpeg", "video/x-mpeq2a"]], + ["mp3", ["audio/mpeg", "audio/mpeg3", "video/mpeg", "audio/x-mpeg-3", "video/x-mpeg"]], + ["mp4", ["video/mp4", "application/mp4"]], + ["mp4a", "audio/mp4"], + ["mpa", ["video/mpeg", "audio/mpeg"]], + ["mpc", ["application/vnd.mophun.certificate", "application/x-project"]], + ["mpe", "video/mpeg"], + ["mpeg", "video/mpeg"], + ["mpg", ["video/mpeg", "audio/mpeg"]], + ["mpga", "audio/mpeg"], + ["mpkg", "application/vnd.apple.installer+xml"], + ["mpm", "application/vnd.blueice.multipass"], + ["mpn", "application/vnd.mophun.application"], + ["mpp", "application/vnd.ms-project"], + ["mpt", "application/x-project"], + ["mpv", "application/x-project"], + ["mpv2", "video/mpeg"], + ["mpx", "application/x-project"], + ["mpy", "application/vnd.ibm.minipay"], + ["mqy", "application/vnd.mobius.mqy"], + ["mrc", "application/marc"], + ["mrcx", "application/marcxml+xml"], + ["ms", "application/x-troff-ms"], + ["mscml", "application/mediaservercontrol+xml"], + ["mseq", "application/vnd.mseq"], + ["msf", "application/vnd.epson.msf"], + ["msg", "application/vnd.ms-outlook"], + ["msh", "model/mesh"], + ["msl", "application/vnd.mobius.msl"], + ["msty", "application/vnd.muvee.style"], + ["mts", "model/vnd.mts"], + ["mus", "application/vnd.musician"], + ["musicxml", "application/vnd.recordare.musicxml+xml"], + ["mv", "video/x-sgi-movie"], + ["mvb", "application/x-msmediaview"], + ["mwf", "application/vnd.mfer"], + ["mxf", "application/mxf"], + ["mxl", "application/vnd.recordare.musicxml"], + ["mxml", "application/xv+xml"], + ["mxs", "application/vnd.triscape.mxs"], + ["mxu", "video/vnd.mpegurl"], + ["my", "audio/make"], + ["mzz", "application/x-vnd.audioexplosion.mzz"], + ["n-gage", "application/vnd.nokia.n-gage.symbian.install"], + ["n3", "text/n3"], + ["nap", "image/naplps"], + ["naplps", "image/naplps"], + ["nbp", "application/vnd.wolfram.player"], + ["nc", "application/x-netcdf"], + ["ncm", "application/vnd.nokia.configuration-message"], + ["ncx", "application/x-dtbncx+xml"], + ["ngdat", "application/vnd.nokia.n-gage.data"], + ["nif", "image/x-niff"], + ["niff", "image/x-niff"], + ["nix", "application/x-mix-transfer"], + ["nlu", "application/vnd.neurolanguage.nlu"], + ["nml", "application/vnd.enliven"], + ["nnd", "application/vnd.noblenet-directory"], + ["nns", "application/vnd.noblenet-sealer"], + ["nnw", "application/vnd.noblenet-web"], + ["npx", "image/vnd.net-fpx"], + ["nsc", "application/x-conference"], + ["nsf", "application/vnd.lotus-notes"], + ["nvd", "application/x-navidoc"], + ["nws", "message/rfc822"], + ["o", "application/octet-stream"], + ["oa2", "application/vnd.fujitsu.oasys2"], + ["oa3", "application/vnd.fujitsu.oasys3"], + ["oas", "application/vnd.fujitsu.oasys"], + ["obd", "application/x-msbinder"], + ["oda", "application/oda"], + ["odb", "application/vnd.oasis.opendocument.database"], + ["odc", "application/vnd.oasis.opendocument.chart"], + ["odf", "application/vnd.oasis.opendocument.formula"], + ["odft", "application/vnd.oasis.opendocument.formula-template"], + ["odg", "application/vnd.oasis.opendocument.graphics"], + ["odi", "application/vnd.oasis.opendocument.image"], + ["odm", "application/vnd.oasis.opendocument.text-master"], + ["odp", "application/vnd.oasis.opendocument.presentation"], + ["ods", "application/vnd.oasis.opendocument.spreadsheet"], + ["odt", "application/vnd.oasis.opendocument.text"], + ["oga", "audio/ogg"], + ["ogv", "video/ogg"], + ["ogx", "application/ogg"], + ["omc", "application/x-omc"], + ["omcd", "application/x-omcdatamaker"], + ["omcr", "application/x-omcregerator"], + ["onetoc", "application/onenote"], + ["opf", "application/oebps-package+xml"], + ["org", "application/vnd.lotus-organizer"], + ["osf", "application/vnd.yamaha.openscoreformat"], + ["osfpvg", "application/vnd.yamaha.openscoreformat.osfpvg+xml"], + ["otc", "application/vnd.oasis.opendocument.chart-template"], + ["otf", "application/x-font-otf"], + ["otg", "application/vnd.oasis.opendocument.graphics-template"], + ["oth", "application/vnd.oasis.opendocument.text-web"], + ["oti", "application/vnd.oasis.opendocument.image-template"], + ["otp", "application/vnd.oasis.opendocument.presentation-template"], + ["ots", "application/vnd.oasis.opendocument.spreadsheet-template"], + ["ott", "application/vnd.oasis.opendocument.text-template"], + ["oxt", "application/vnd.openofficeorg.extension"], + ["p", "text/x-pascal"], + ["p10", ["application/pkcs10", "application/x-pkcs10"]], + ["p12", ["application/pkcs-12", "application/x-pkcs12"]], + ["p7a", "application/x-pkcs7-signature"], + ["p7b", "application/x-pkcs7-certificates"], + ["p7c", ["application/pkcs7-mime", "application/x-pkcs7-mime"]], + ["p7m", ["application/pkcs7-mime", "application/x-pkcs7-mime"]], + ["p7r", "application/x-pkcs7-certreqresp"], + ["p7s", ["application/pkcs7-signature", "application/x-pkcs7-signature"]], + ["p8", "application/pkcs8"], + ["par", "text/plain-bas"], + ["part", "application/pro_eng"], + ["pas", "text/pascal"], + ["paw", "application/vnd.pawaafile"], + ["pbd", "application/vnd.powerbuilder6"], + ["pbm", "image/x-portable-bitmap"], + ["pcf", "application/x-font-pcf"], + ["pcl", ["application/vnd.hp-pcl", "application/x-pcl"]], + ["pclxl", "application/vnd.hp-pclxl"], + ["pct", "image/x-pict"], + ["pcurl", "application/vnd.curl.pcurl"], + ["pcx", "image/x-pcx"], + ["pdb", ["application/vnd.palm", "chemical/x-pdb"]], + ["pdf", "application/pdf"], + ["pfa", "application/x-font-type1"], + ["pfr", "application/font-tdpfr"], + ["pfunk", ["audio/make", "audio/make.my.funk"]], + ["pfx", "application/x-pkcs12"], + ["pgm", ["image/x-portable-graymap", "image/x-portable-greymap"]], + ["pgn", "application/x-chess-pgn"], + ["pgp", "application/pgp-signature"], + ["pic", ["image/pict", "image/x-pict"]], + ["pict", "image/pict"], + ["pkg", "application/x-newton-compatible-pkg"], + ["pki", "application/pkixcmp"], + ["pkipath", "application/pkix-pkipath"], + ["pko", ["application/ynd.ms-pkipko", "application/vnd.ms-pki.pko"]], + ["pl", ["text/plain", "text/x-script.perl"]], + ["plb", "application/vnd.3gpp.pic-bw-large"], + ["plc", "application/vnd.mobius.plc"], + ["plf", "application/vnd.pocketlearn"], + ["pls", "application/pls+xml"], + ["plx", "application/x-pixclscript"], + ["pm", ["text/x-script.perl-module", "image/x-xpixmap"]], + ["pm4", "application/x-pagemaker"], + ["pm5", "application/x-pagemaker"], + ["pma", "application/x-perfmon"], + ["pmc", "application/x-perfmon"], + ["pml", ["application/vnd.ctc-posml", "application/x-perfmon"]], + ["pmr", "application/x-perfmon"], + ["pmw", "application/x-perfmon"], + ["png", "image/png"], + ["pnm", ["application/x-portable-anymap", "image/x-portable-anymap"]], + ["portpkg", "application/vnd.macports.portpkg"], + ["pot", ["application/vnd.ms-powerpoint", "application/mspowerpoint"]], + ["potm", "application/vnd.ms-powerpoint.template.macroenabled.12"], + ["potx", "application/vnd.openxmlformats-officedocument.presentationml.template"], + ["pov", "model/x-pov"], + ["ppa", "application/vnd.ms-powerpoint"], + ["ppam", "application/vnd.ms-powerpoint.addin.macroenabled.12"], + ["ppd", "application/vnd.cups-ppd"], + ["ppm", "image/x-portable-pixmap"], + ["pps", ["application/vnd.ms-powerpoint", "application/mspowerpoint"]], + ["ppsm", "application/vnd.ms-powerpoint.slideshow.macroenabled.12"], + ["ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow"], + ["ppt", ["application/vnd.ms-powerpoint", "application/mspowerpoint", "application/powerpoint", "application/x-mspowerpoint"]], + ["pptm", "application/vnd.ms-powerpoint.presentation.macroenabled.12"], + ["pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"], + ["ppz", "application/mspowerpoint"], + ["prc", "application/x-mobipocket-ebook"], + ["pre", ["application/vnd.lotus-freelance", "application/x-freelance"]], + ["prf", "application/pics-rules"], + ["prt", "application/pro_eng"], + ["ps", "application/postscript"], + ["psb", "application/vnd.3gpp.pic-bw-small"], + ["psd", ["application/octet-stream", "image/vnd.adobe.photoshop"]], + ["psf", "application/x-font-linux-psf"], + ["pskcxml", "application/pskc+xml"], + ["ptid", "application/vnd.pvi.ptid1"], + ["pub", "application/x-mspublisher"], + ["pvb", "application/vnd.3gpp.pic-bw-var"], + ["pvu", "paleovu/x-pv"], + ["pwn", "application/vnd.3m.post-it-notes"], + ["pwz", "application/vnd.ms-powerpoint"], + ["py", "text/x-script.phyton"], + ["pya", "audio/vnd.ms-playready.media.pya"], + ["pyc", "application/x-bytecode.python"], + ["pyv", "video/vnd.ms-playready.media.pyv"], + ["qam", "application/vnd.epson.quickanime"], + ["qbo", "application/vnd.intu.qbo"], + ["qcp", "audio/vnd.qcelp"], + ["qd3", "x-world/x-3dmf"], + ["qd3d", "x-world/x-3dmf"], + ["qfx", "application/vnd.intu.qfx"], + ["qif", "image/x-quicktime"], + ["qps", "application/vnd.publishare-delta-tree"], + ["qt", "video/quicktime"], + ["qtc", "video/x-qtc"], + ["qti", "image/x-quicktime"], + ["qtif", "image/x-quicktime"], + ["qxd", "application/vnd.quark.quarkxpress"], + ["ra", ["audio/x-realaudio", "audio/x-pn-realaudio", "audio/x-pn-realaudio-plugin"]], + ["ram", "audio/x-pn-realaudio"], + ["rar", "application/x-rar-compressed"], + ["ras", ["image/cmu-raster", "application/x-cmu-raster", "image/x-cmu-raster"]], + ["rast", "image/cmu-raster"], + ["rcprofile", "application/vnd.ipunplugged.rcprofile"], + ["rdf", "application/rdf+xml"], + ["rdz", "application/vnd.data-vision.rdz"], + ["rep", "application/vnd.businessobjects"], + ["res", "application/x-dtbresource+xml"], + ["rexx", "text/x-script.rexx"], + ["rf", "image/vnd.rn-realflash"], + ["rgb", "image/x-rgb"], + ["rif", "application/reginfo+xml"], + ["rip", "audio/vnd.rip"], + ["rl", "application/resource-lists+xml"], + ["rlc", "image/vnd.fujixerox.edmics-rlc"], + ["rld", "application/resource-lists-diff+xml"], + ["rm", ["application/vnd.rn-realmedia", "audio/x-pn-realaudio"]], + ["rmi", "audio/mid"], + ["rmm", "audio/x-pn-realaudio"], + ["rmp", ["audio/x-pn-realaudio-plugin", "audio/x-pn-realaudio"]], + ["rms", "application/vnd.jcp.javame.midlet-rms"], + ["rnc", "application/relax-ng-compact-syntax"], + ["rng", ["application/ringing-tones", "application/vnd.nokia.ringing-tone"]], + ["rnx", "application/vnd.rn-realplayer"], + ["roff", "application/x-troff"], + ["rp", "image/vnd.rn-realpix"], + ["rp9", "application/vnd.cloanto.rp9"], + ["rpm", "audio/x-pn-realaudio-plugin"], + ["rpss", "application/vnd.nokia.radio-presets"], + ["rpst", "application/vnd.nokia.radio-preset"], + ["rq", "application/sparql-query"], + ["rs", "application/rls-services+xml"], + ["rsd", "application/rsd+xml"], + ["rt", ["text/richtext", "text/vnd.rn-realtext"]], + ["rtf", ["application/rtf", "text/richtext", "application/x-rtf"]], + ["rtx", ["text/richtext", "application/rtf"]], + ["rv", "video/vnd.rn-realvideo"], + ["s", "text/x-asm"], + ["s3m", "audio/s3m"], + ["saf", "application/vnd.yamaha.smaf-audio"], + ["saveme", "application/octet-stream"], + ["sbk", "application/x-tbook"], + ["sbml", "application/sbml+xml"], + ["sc", "application/vnd.ibm.secure-container"], + ["scd", "application/x-msschedule"], + [ + "scm", + ["application/vnd.lotus-screencam", "video/x-scm", "text/x-script.guile", "application/x-lotusscreencam", "text/x-script.scheme"] + ], + ["scq", "application/scvp-cv-request"], + ["scs", "application/scvp-cv-response"], + ["sct", "text/scriptlet"], + ["scurl", "text/vnd.curl.scurl"], + ["sda", "application/vnd.stardivision.draw"], + ["sdc", "application/vnd.stardivision.calc"], + ["sdd", "application/vnd.stardivision.impress"], + ["sdkm", "application/vnd.solent.sdkm+xml"], + ["sdml", "text/plain"], + ["sdp", ["application/sdp", "application/x-sdp"]], + ["sdr", "application/sounder"], + ["sdw", "application/vnd.stardivision.writer"], + ["sea", ["application/sea", "application/x-sea"]], + ["see", "application/vnd.seemail"], + ["seed", "application/vnd.fdsn.seed"], + ["sema", "application/vnd.sema"], + ["semd", "application/vnd.semd"], + ["semf", "application/vnd.semf"], + ["ser", "application/java-serialized-object"], + ["set", "application/set"], + ["setpay", "application/set-payment-initiation"], + ["setreg", "application/set-registration-initiation"], + ["sfd-hdstx", "application/vnd.hydrostatix.sof-data"], + ["sfs", "application/vnd.spotfire.sfs"], + ["sgl", "application/vnd.stardivision.writer-global"], + ["sgm", ["text/sgml", "text/x-sgml"]], + ["sgml", ["text/sgml", "text/x-sgml"]], + ["sh", ["application/x-shar", "application/x-bsh", "application/x-sh", "text/x-script.sh"]], + ["shar", ["application/x-bsh", "application/x-shar"]], + ["shf", "application/shf+xml"], + ["shtml", ["text/html", "text/x-server-parsed-html"]], + ["sid", "audio/x-psid"], + ["sis", "application/vnd.symbian.install"], + ["sit", ["application/x-stuffit", "application/x-sit"]], + ["sitx", "application/x-stuffitx"], + ["skd", "application/x-koan"], + ["skm", "application/x-koan"], + ["skp", ["application/vnd.koan", "application/x-koan"]], + ["skt", "application/x-koan"], + ["sl", "application/x-seelogo"], + ["sldm", "application/vnd.ms-powerpoint.slide.macroenabled.12"], + ["sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide"], + ["slt", "application/vnd.epson.salt"], + ["sm", "application/vnd.stepmania.stepchart"], + ["smf", "application/vnd.stardivision.math"], + ["smi", ["application/smil", "application/smil+xml"]], + ["smil", "application/smil"], + ["snd", ["audio/basic", "audio/x-adpcm"]], + ["snf", "application/x-font-snf"], + ["sol", "application/solids"], + ["spc", ["text/x-speech", "application/x-pkcs7-certificates"]], + ["spf", "application/vnd.yamaha.smaf-phrase"], + ["spl", ["application/futuresplash", "application/x-futuresplash"]], + ["spot", "text/vnd.in3d.spot"], + ["spp", "application/scvp-vp-response"], + ["spq", "application/scvp-vp-request"], + ["spr", "application/x-sprite"], + ["sprite", "application/x-sprite"], + ["src", "application/x-wais-source"], + ["sru", "application/sru+xml"], + ["srx", "application/sparql-results+xml"], + ["sse", "application/vnd.kodak-descriptor"], + ["ssf", "application/vnd.epson.ssf"], + ["ssi", "text/x-server-parsed-html"], + ["ssm", "application/streamingmedia"], + ["ssml", "application/ssml+xml"], + ["sst", ["application/vnd.ms-pkicertstore", "application/vnd.ms-pki.certstore"]], + ["st", "application/vnd.sailingtracker.track"], + ["stc", "application/vnd.sun.xml.calc.template"], + ["std", "application/vnd.sun.xml.draw.template"], + ["step", "application/step"], + ["stf", "application/vnd.wt.stf"], + ["sti", "application/vnd.sun.xml.impress.template"], + ["stk", "application/hyperstudio"], + ["stl", ["application/vnd.ms-pkistl", "application/sla", "application/vnd.ms-pki.stl", "application/x-navistyle"]], + ["stm", "text/html"], + ["stp", "application/step"], + ["str", "application/vnd.pg.format"], + ["stw", "application/vnd.sun.xml.writer.template"], + ["sub", "image/vnd.dvb.subtitle"], + ["sus", "application/vnd.sus-calendar"], + ["sv4cpio", "application/x-sv4cpio"], + ["sv4crc", "application/x-sv4crc"], + ["svc", "application/vnd.dvb.service"], + ["svd", "application/vnd.svd"], + ["svf", ["image/vnd.dwg", "image/x-dwg"]], + ["svg", "image/svg+xml"], + ["svr", ["x-world/x-svr", "application/x-world"]], + ["swf", "application/x-shockwave-flash"], + ["swi", "application/vnd.aristanetworks.swi"], + ["sxc", "application/vnd.sun.xml.calc"], + ["sxd", "application/vnd.sun.xml.draw"], + ["sxg", "application/vnd.sun.xml.writer.global"], + ["sxi", "application/vnd.sun.xml.impress"], + ["sxm", "application/vnd.sun.xml.math"], + ["sxw", "application/vnd.sun.xml.writer"], + ["t", ["text/troff", "application/x-troff"]], + ["talk", "text/x-speech"], + ["tao", "application/vnd.tao.intent-module-archive"], + ["tar", "application/x-tar"], + ["tbk", ["application/toolbook", "application/x-tbook"]], + ["tcap", "application/vnd.3gpp2.tcap"], + ["tcl", ["text/x-script.tcl", "application/x-tcl"]], + ["tcsh", "text/x-script.tcsh"], + ["teacher", "application/vnd.smart.teacher"], + ["tei", "application/tei+xml"], + ["tex", "application/x-tex"], + ["texi", "application/x-texinfo"], + ["texinfo", "application/x-texinfo"], + ["text", ["application/plain", "text/plain"]], + ["tfi", "application/thraud+xml"], + ["tfm", "application/x-tex-tfm"], + ["tgz", ["application/gnutar", "application/x-compressed"]], + ["thmx", "application/vnd.ms-officetheme"], + ["tif", ["image/tiff", "image/x-tiff"]], + ["tiff", ["image/tiff", "image/x-tiff"]], + ["tmo", "application/vnd.tmobile-livetv"], + ["torrent", "application/x-bittorrent"], + ["tpl", "application/vnd.groove-tool-template"], + ["tpt", "application/vnd.trid.tpt"], + ["tr", "application/x-troff"], + ["tra", "application/vnd.trueapp"], + ["trm", "application/x-msterminal"], + ["tsd", "application/timestamped-data"], + ["tsi", "audio/tsp-audio"], + ["tsp", ["application/dsptype", "audio/tsplayer"]], + ["tsv", "text/tab-separated-values"], + ["ttf", "application/x-font-ttf"], + ["ttl", "text/turtle"], + ["turbot", "image/florian"], + ["twd", "application/vnd.simtech-mindmapper"], + ["txd", "application/vnd.genomatix.tuxedo"], + ["txf", "application/vnd.mobius.txf"], + ["txt", "text/plain"], + ["ufd", "application/vnd.ufdl"], + ["uil", "text/x-uil"], + ["uls", "text/iuls"], + ["umj", "application/vnd.umajin"], + ["uni", "text/uri-list"], + ["unis", "text/uri-list"], + ["unityweb", "application/vnd.unity"], + ["unv", "application/i-deas"], + ["uoml", "application/vnd.uoml+xml"], + ["uri", "text/uri-list"], + ["uris", "text/uri-list"], + ["ustar", ["application/x-ustar", "multipart/x-ustar"]], + ["utz", "application/vnd.uiq.theme"], + ["uu", ["application/octet-stream", "text/x-uuencode"]], + ["uue", "text/x-uuencode"], + ["uva", "audio/vnd.dece.audio"], + ["uvh", "video/vnd.dece.hd"], + ["uvi", "image/vnd.dece.graphic"], + ["uvm", "video/vnd.dece.mobile"], + ["uvp", "video/vnd.dece.pd"], + ["uvs", "video/vnd.dece.sd"], + ["uvu", "video/vnd.uvvu.mp4"], + ["uvv", "video/vnd.dece.video"], + ["vcd", "application/x-cdlink"], + ["vcf", "text/x-vcard"], + ["vcg", "application/vnd.groove-vcard"], + ["vcs", "text/x-vcalendar"], + ["vcx", "application/vnd.vcx"], + ["vda", "application/vda"], + ["vdo", "video/vdo"], + ["vew", "application/groupwise"], + ["vis", "application/vnd.visionary"], + ["viv", ["video/vivo", "video/vnd.vivo"]], + ["vivo", ["video/vivo", "video/vnd.vivo"]], + ["vmd", "application/vocaltec-media-desc"], + ["vmf", "application/vocaltec-media-file"], + ["voc", ["audio/voc", "audio/x-voc"]], + ["vos", "video/vosaic"], + ["vox", "audio/voxware"], + ["vqe", "audio/x-twinvq-plugin"], + ["vqf", "audio/x-twinvq"], + ["vql", "audio/x-twinvq-plugin"], + ["vrml", ["model/vrml", "x-world/x-vrml", "application/x-vrml"]], + ["vrt", "x-world/x-vrt"], + ["vsd", ["application/vnd.visio", "application/x-visio"]], + ["vsf", "application/vnd.vsf"], + ["vst", "application/x-visio"], + ["vsw", "application/x-visio"], + ["vtu", "model/vnd.vtu"], + ["vxml", "application/voicexml+xml"], + ["w60", "application/wordperfect6.0"], + ["w61", "application/wordperfect6.1"], + ["w6w", "application/msword"], + ["wad", "application/x-doom"], + ["wav", ["audio/wav", "audio/x-wav"]], + ["wax", "audio/x-ms-wax"], + ["wb1", "application/x-qpro"], + ["wbmp", "image/vnd.wap.wbmp"], + ["wbs", "application/vnd.criticaltools.wbs+xml"], + ["wbxml", "application/vnd.wap.wbxml"], + ["wcm", "application/vnd.ms-works"], + ["wdb", "application/vnd.ms-works"], + ["web", "application/vnd.xara"], + ["weba", "audio/webm"], + ["webm", "video/webm"], + ["webp", "image/webp"], + ["wg", "application/vnd.pmi.widget"], + ["wgt", "application/widget"], + ["wiz", "application/msword"], + ["wk1", "application/x-123"], + ["wks", "application/vnd.ms-works"], + ["wm", "video/x-ms-wm"], + ["wma", "audio/x-ms-wma"], + ["wmd", "application/x-ms-wmd"], + ["wmf", ["windows/metafile", "application/x-msmetafile"]], + ["wml", "text/vnd.wap.wml"], + ["wmlc", "application/vnd.wap.wmlc"], + ["wmls", "text/vnd.wap.wmlscript"], + ["wmlsc", "application/vnd.wap.wmlscriptc"], + ["wmv", "video/x-ms-wmv"], + ["wmx", "video/x-ms-wmx"], + ["wmz", "application/x-ms-wmz"], + ["woff", "application/x-font-woff"], + ["word", "application/msword"], + ["wp", "application/wordperfect"], + ["wp5", ["application/wordperfect", "application/wordperfect6.0"]], + ["wp6", "application/wordperfect"], + ["wpd", ["application/wordperfect", "application/vnd.wordperfect", "application/x-wpwin"]], + ["wpl", "application/vnd.ms-wpl"], + ["wps", "application/vnd.ms-works"], + ["wq1", "application/x-lotus"], + ["wqd", "application/vnd.wqd"], + ["wri", ["application/mswrite", "application/x-wri", "application/x-mswrite"]], + ["wrl", ["model/vrml", "x-world/x-vrml", "application/x-world"]], + ["wrz", ["model/vrml", "x-world/x-vrml"]], + ["wsc", "text/scriplet"], + ["wsdl", "application/wsdl+xml"], + ["wspolicy", "application/wspolicy+xml"], + ["wsrc", "application/x-wais-source"], + ["wtb", "application/vnd.webturbo"], + ["wtk", "application/x-wintalk"], + ["wvx", "video/x-ms-wvx"], + ["x-png", "image/png"], + ["x3d", "application/vnd.hzn-3d-crossword"], + ["xaf", "x-world/x-vrml"], + ["xap", "application/x-silverlight-app"], + ["xar", "application/vnd.xara"], + ["xbap", "application/x-ms-xbap"], + ["xbd", "application/vnd.fujixerox.docuworks.binder"], + ["xbm", ["image/xbm", "image/x-xbm", "image/x-xbitmap"]], + ["xdf", "application/xcap-diff+xml"], + ["xdm", "application/vnd.syncml.dm+xml"], + ["xdp", "application/vnd.adobe.xdp+xml"], + ["xdr", "video/x-amt-demorun"], + ["xdssc", "application/dssc+xml"], + ["xdw", "application/vnd.fujixerox.docuworks"], + ["xenc", "application/xenc+xml"], + ["xer", "application/patch-ops-error+xml"], + ["xfdf", "application/vnd.adobe.xfdf"], + ["xfdl", "application/vnd.xfdl"], + ["xgz", "xgl/drawing"], + ["xhtml", "application/xhtml+xml"], + ["xif", "image/vnd.xiff"], + ["xl", "application/excel"], + ["xla", ["application/vnd.ms-excel", "application/excel", "application/x-msexcel", "application/x-excel"]], + ["xlam", "application/vnd.ms-excel.addin.macroenabled.12"], + ["xlb", ["application/excel", "application/vnd.ms-excel", "application/x-excel"]], + ["xlc", ["application/vnd.ms-excel", "application/excel", "application/x-excel"]], + ["xld", ["application/excel", "application/x-excel"]], + ["xlk", ["application/excel", "application/x-excel"]], + ["xll", ["application/excel", "application/vnd.ms-excel", "application/x-excel"]], + ["xlm", ["application/vnd.ms-excel", "application/excel", "application/x-excel"]], + ["xls", ["application/vnd.ms-excel", "application/excel", "application/x-msexcel", "application/x-excel"]], + ["xlsb", "application/vnd.ms-excel.sheet.binary.macroenabled.12"], + ["xlsm", "application/vnd.ms-excel.sheet.macroenabled.12"], + ["xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"], + ["xlt", ["application/vnd.ms-excel", "application/excel", "application/x-excel"]], + ["xltm", "application/vnd.ms-excel.template.macroenabled.12"], + ["xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template"], + ["xlv", ["application/excel", "application/x-excel"]], + ["xlw", ["application/vnd.ms-excel", "application/excel", "application/x-msexcel", "application/x-excel"]], + ["xm", "audio/xm"], + ["xml", ["application/xml", "text/xml", "application/atom+xml", "application/rss+xml"]], + ["xmz", "xgl/movie"], + ["xo", "application/vnd.olpc-sugar"], + ["xof", "x-world/x-vrml"], + ["xop", "application/xop+xml"], + ["xpi", "application/x-xpinstall"], + ["xpix", "application/x-vnd.ls-xpix"], + ["xpm", ["image/xpm", "image/x-xpixmap"]], + ["xpr", "application/vnd.is-xpr"], + ["xps", "application/vnd.ms-xpsdocument"], + ["xpw", "application/vnd.intercon.formnet"], + ["xslt", "application/xslt+xml"], + ["xsm", "application/vnd.syncml+xml"], + ["xspf", "application/xspf+xml"], + ["xsr", "video/x-amt-showrun"], + ["xul", "application/vnd.mozilla.xul+xml"], + ["xwd", ["image/x-xwd", "image/x-xwindowdump"]], + ["xyz", ["chemical/x-xyz", "chemical/x-pdb"]], + ["yang", "application/yang"], + ["yin", "application/yin+xml"], + ["z", ["application/x-compressed", "application/x-compress"]], + ["zaz", "application/vnd.zzazz.deck+xml"], + ["zip", ["application/zip", "multipart/x-zip", "application/x-zip-compressed", "application/x-compressed"]], + ["zir", "application/vnd.zul"], + ["zmm", "application/vnd.handheld-entertainment+xml"], + ["zoo", "application/octet-stream"], + ["zsh", "text/x-script.zsh"] + ]); + module2.exports = { + detectMimeType(filename) { + if (!filename) { + return defaultMimeType; + } + let parsed = path.parse(filename); + let extension = (parsed.ext.substr(1) || parsed.name || "").split("?").shift().trim().toLowerCase(); + let value = defaultMimeType; + if (extensions.has(extension)) { + value = extensions.get(extension); + } + if (Array.isArray(value)) { + return value[0]; + } + return value; + }, + detectExtension(mimeType) { + if (!mimeType) { + return defaultExtension; + } + let parts = (mimeType || "").toLowerCase().trim().split("/"); + let rootType = parts.shift().trim(); + let subType = parts.join("/").trim(); + if (mimeTypes.has(rootType + "/" + subType)) { + let value = mimeTypes.get(rootType + "/" + subType); + if (Array.isArray(value)) { + return value[0]; + } + return value; + } + switch (rootType) { + case "text": + return "txt"; + default: + return "bin"; + } + } + }; + } +}); + +// node_modules/nodemailer/lib/punycode/index.js +var require_punycode2 = __commonJS({ + "node_modules/nodemailer/lib/punycode/index.js"(exports2, module2) { + "use strict"; + var maxInt = 2147483647; + var base = 36; + var tMin = 1; + var tMax = 26; + var skew = 38; + var damp = 700; + var initialBias = 72; + var initialN = 128; + var delimiter = "-"; + var regexPunycode = /^xn--/; + var regexNonASCII = /[^\0-\x7F]/; + var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; + var errors = { + overflow: "Overflow: input needs wider integers to process", + "not-basic": "Illegal input >= 0x80 (not a basic code point)", + "invalid-input": "Invalid input" + }; + var baseMinusTMin = base - tMin; + var floor = Math.floor; + var stringFromCharCode = String.fromCharCode; + function error2(type) { + throw new RangeError(errors[type]); + } + function map2(array, callback) { + const result = []; + let length = array.length; + while (length--) { + result[length] = callback(array[length]); + } + return result; + } + function mapDomain(domain, callback) { + const parts = domain.split("@"); + let result = ""; + if (parts.length > 1) { + result = parts[0] + "@"; + domain = parts[1]; + } + domain = domain.replace(regexSeparators, "."); + const labels = domain.split("."); + const encoded = map2(labels, callback).join("."); + return result + encoded; + } + function ucs2decode(string) { + const output = []; + let counter = 0; + const length = string.length; + while (counter < length) { + const value = string.charCodeAt(counter++); + if (value >= 55296 && value <= 56319 && counter < length) { + const extra = string.charCodeAt(counter++); + if ((extra & 64512) == 56320) { + output.push(((value & 1023) << 10) + (extra & 1023) + 65536); + } else { + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + var ucs2encode = (codePoints) => String.fromCodePoint(...codePoints); + var basicToDigit = function(codePoint) { + if (codePoint >= 48 && codePoint < 58) { + return 26 + (codePoint - 48); + } + if (codePoint >= 65 && codePoint < 91) { + return codePoint - 65; + } + if (codePoint >= 97 && codePoint < 123) { + return codePoint - 97; + } + return base; + }; + var digitToBasic = function(digit, flag) { + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + }; + var adapt = function(delta, numPoints, firstTime) { + let k4 = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for ( + ; + /* no initialization */ + delta > baseMinusTMin * tMax >> 1; + k4 += base + ) { + delta = floor(delta / baseMinusTMin); + } + return floor(k4 + (baseMinusTMin + 1) * delta / (delta + skew)); + }; + var decode2 = function(input) { + const output = []; + const inputLength = input.length; + let i4 = 0; + let n4 = initialN; + let bias = initialBias; + let basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + for (let j4 = 0; j4 < basic; ++j4) { + if (input.charCodeAt(j4) >= 128) { + error2("not-basic"); + } + output.push(input.charCodeAt(j4)); + } + for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; ) { + const oldi = i4; + for (let w4 = 1, k4 = base; ; k4 += base) { + if (index >= inputLength) { + error2("invalid-input"); + } + const digit = basicToDigit(input.charCodeAt(index++)); + if (digit >= base) { + error2("invalid-input"); + } + if (digit > floor((maxInt - i4) / w4)) { + error2("overflow"); + } + i4 += digit * w4; + const t4 = k4 <= bias ? tMin : k4 >= bias + tMax ? tMax : k4 - bias; + if (digit < t4) { + break; + } + const baseMinusT = base - t4; + if (w4 > floor(maxInt / baseMinusT)) { + error2("overflow"); + } + w4 *= baseMinusT; + } + const out = output.length + 1; + bias = adapt(i4 - oldi, out, oldi == 0); + if (floor(i4 / out) > maxInt - n4) { + error2("overflow"); + } + n4 += floor(i4 / out); + i4 %= out; + output.splice(i4++, 0, n4); + } + return String.fromCodePoint(...output); + }; + var encode2 = function(input) { + const output = []; + input = ucs2decode(input); + const inputLength = input.length; + let n4 = initialN; + let delta = 0; + let bias = initialBias; + for (const currentValue of input) { + if (currentValue < 128) { + output.push(stringFromCharCode(currentValue)); + } + } + const basicLength = output.length; + let handledCPCount = basicLength; + if (basicLength) { + output.push(delimiter); + } + while (handledCPCount < inputLength) { + let m4 = maxInt; + for (const currentValue of input) { + if (currentValue >= n4 && currentValue < m4) { + m4 = currentValue; + } + } + const handledCPCountPlusOne = handledCPCount + 1; + if (m4 - n4 > floor((maxInt - delta) / handledCPCountPlusOne)) { + error2("overflow"); + } + delta += (m4 - n4) * handledCPCountPlusOne; + n4 = m4; + for (const currentValue of input) { + if (currentValue < n4 && ++delta > maxInt) { + error2("overflow"); + } + if (currentValue === n4) { + let q4 = delta; + for (let k4 = base; ; k4 += base) { + const t4 = k4 <= bias ? tMin : k4 >= bias + tMax ? tMax : k4 - bias; + if (q4 < t4) { + break; + } + const qMinusT = q4 - t4; + const baseMinusT = base - t4; + output.push(stringFromCharCode(digitToBasic(t4 + qMinusT % baseMinusT, 0))); + q4 = floor(qMinusT / baseMinusT); + } + output.push(stringFromCharCode(digitToBasic(q4, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); + delta = 0; + ++handledCPCount; + } + } + ++delta; + ++n4; + } + return output.join(""); + }; + var toUnicode = function(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) ? decode2(string.slice(4).toLowerCase()) : string; + }); + }; + var toASCII = function(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) ? "xn--" + encode2(string) : string; + }); + }; + var punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + version: "2.3.1", + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + ucs2: { + decode: ucs2decode, + encode: ucs2encode + }, + decode: decode2, + encode: encode2, + toASCII, + toUnicode + }; + module2.exports = punycode; + } +}); + +// node_modules/nodemailer/lib/base64/index.js +var require_base64 = __commonJS({ + "node_modules/nodemailer/lib/base64/index.js"(exports2, module2) { + "use strict"; + var Transform = require("stream").Transform; + function encode2(buffer) { + if (typeof buffer === "string") { + buffer = Buffer.from(buffer, "utf-8"); + } + return buffer.toString("base64"); + } + function wrap(str, lineLength) { + str = (str || "").toString(); + lineLength = lineLength || 76; + if (str.length <= lineLength) { + return str; + } + let result = []; + let pos = 0; + let chunkLength = lineLength * 1024; + while (pos < str.length) { + let wrappedLines = str.substr(pos, chunkLength).replace(new RegExp(".{" + lineLength + "}", "g"), "$&\r\n"); + result.push(wrappedLines); + pos += chunkLength; + } + return result.join(""); + } + var Encoder = class extends Transform { + constructor(options) { + super(); + this.options = options || {}; + if (this.options.lineLength !== false) { + this.options.lineLength = this.options.lineLength || 76; + } + this._curLine = ""; + this._remainingBytes = false; + this.inputBytes = 0; + this.outputBytes = 0; + } + _transform(chunk, encoding, done) { + if (encoding !== "buffer") { + chunk = Buffer.from(chunk, encoding); + } + if (!chunk || !chunk.length) { + return setImmediate(done); + } + this.inputBytes += chunk.length; + if (this._remainingBytes && this._remainingBytes.length) { + chunk = Buffer.concat([this._remainingBytes, chunk], this._remainingBytes.length + chunk.length); + this._remainingBytes = false; + } + if (chunk.length % 3) { + this._remainingBytes = chunk.slice(chunk.length - chunk.length % 3); + chunk = chunk.slice(0, chunk.length - chunk.length % 3); + } else { + this._remainingBytes = false; + } + let b64 = this._curLine + encode2(chunk); + if (this.options.lineLength) { + b64 = wrap(b64, this.options.lineLength); + let lastLF = b64.lastIndexOf("\n"); + if (lastLF < 0) { + this._curLine = b64; + b64 = ""; + } else { + this._curLine = b64.substring(lastLF + 1); + b64 = b64.substring(0, lastLF + 1); + if (b64 && !b64.endsWith("\r\n")) { + b64 += "\r\n"; + } + } + } else { + this._curLine = ""; + } + if (b64) { + this.outputBytes += b64.length; + this.push(Buffer.from(b64, "ascii")); + } + setImmediate(done); + } + _flush(done) { + if (this._remainingBytes && this._remainingBytes.length) { + this._curLine += encode2(this._remainingBytes); + } + if (this._curLine) { + this.outputBytes += this._curLine.length; + this.push(Buffer.from(this._curLine, "ascii")); + this._curLine = ""; + } + done(); + } + }; + module2.exports = { + encode: encode2, + wrap, + Encoder + }; + } +}); + +// node_modules/nodemailer/lib/qp/index.js +var require_qp = __commonJS({ + "node_modules/nodemailer/lib/qp/index.js"(exports2, module2) { + "use strict"; + var Transform = require("stream").Transform; + function encode2(buffer) { + if (typeof buffer === "string") { + buffer = Buffer.from(buffer, "utf-8"); + } + let ranges = [ + // https://tools.ietf.org/html/rfc2045#section-6.7 + [9], + // + [10], + // + [13], + // + [32, 60], + // !"#$%&'()*+,-./0123456789:; + [62, 126] + // >?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|} + ]; + let result = ""; + let ord; + for (let i4 = 0, len = buffer.length; i4 < len; i4++) { + ord = buffer[i4]; + if (checkRanges(ord, ranges) && !((ord === 32 || ord === 9) && (i4 === len - 1 || buffer[i4 + 1] === 10 || buffer[i4 + 1] === 13))) { + result += String.fromCharCode(ord); + continue; + } + result += "=" + (ord < 16 ? "0" : "") + ord.toString(16).toUpperCase(); + } + return result; + } + function wrap(str, lineLength) { + str = (str || "").toString(); + lineLength = lineLength || 76; + if (str.length <= lineLength) { + return str; + } + let pos = 0; + let len = str.length; + let match, code, line; + let lineMargin = Math.floor(lineLength / 3); + let result = ""; + while (pos < len) { + line = str.substr(pos, lineLength); + if (match = line.match(/\r\n/)) { + line = line.substr(0, match.index + match[0].length); + result += line; + pos += line.length; + continue; + } + if (line.substr(-1) === "\n") { + result += line; + pos += line.length; + continue; + } else if (match = line.substr(-lineMargin).match(/\n.*?$/)) { + line = line.substr(0, line.length - (match[0].length - 1)); + result += line; + pos += line.length; + continue; + } else if (line.length > lineLength - lineMargin && (match = line.substr(-lineMargin).match(/[ \t.,!?][^ \t.,!?]*$/))) { + line = line.substr(0, line.length - (match[0].length - 1)); + } else if (line.match(/[=][\da-f]{0,2}$/i)) { + if (match = line.match(/[=][\da-f]{0,1}$/i)) { + line = line.substr(0, line.length - match[0].length); + } + while (line.length > 3 && line.length < len - pos && !line.match(/^(?:=[\da-f]{2}){1,4}$/i) && (match = line.match(/[=][\da-f]{2}$/gi))) { + code = parseInt(match[0].substr(1, 2), 16); + if (code < 128) { + break; + } + line = line.substr(0, line.length - 3); + if (code >= 192) { + break; + } + } + } + if (pos + line.length < len && line.substr(-1) !== "\n") { + if (line.length === lineLength && line.match(/[=][\da-f]{2}$/i)) { + line = line.substr(0, line.length - 3); + } else if (line.length === lineLength) { + line = line.substr(0, line.length - 1); + } + pos += line.length; + line += "=\r\n"; + } else { + pos += line.length; + } + result += line; + } + return result; + } + function checkRanges(nr, ranges) { + for (let i4 = ranges.length - 1; i4 >= 0; i4--) { + if (!ranges[i4].length) { + continue; + } + if (ranges[i4].length === 1 && nr === ranges[i4][0]) { + return true; + } + if (ranges[i4].length === 2 && nr >= ranges[i4][0] && nr <= ranges[i4][1]) { + return true; + } + } + return false; + } + var Encoder = class extends Transform { + constructor(options) { + super(); + this.options = options || {}; + if (this.options.lineLength !== false) { + this.options.lineLength = this.options.lineLength || 76; + } + this._curLine = ""; + this.inputBytes = 0; + this.outputBytes = 0; + } + _transform(chunk, encoding, done) { + let qp; + if (encoding !== "buffer") { + chunk = Buffer.from(chunk, encoding); + } + if (!chunk || !chunk.length) { + return done(); + } + this.inputBytes += chunk.length; + if (this.options.lineLength) { + qp = this._curLine + encode2(chunk); + qp = wrap(qp, this.options.lineLength); + qp = qp.replace(/(^|\n)([^\n]*)$/, (match, lineBreak, lastLine) => { + this._curLine = lastLine; + return lineBreak; + }); + if (qp) { + this.outputBytes += qp.length; + this.push(qp); + } + } else { + qp = encode2(chunk); + this.outputBytes += qp.length; + this.push(qp, "ascii"); + } + done(); + } + _flush(done) { + if (this._curLine) { + this.outputBytes += this._curLine.length; + this.push(this._curLine, "ascii"); + } + done(); + } + }; + module2.exports = { + encode: encode2, + wrap, + Encoder + }; + } +}); + +// node_modules/nodemailer/lib/mime-funcs/index.js +var require_mime_funcs = __commonJS({ + "node_modules/nodemailer/lib/mime-funcs/index.js"(exports2, module2) { + "use strict"; + var base64 = require_base64(); + var qp = require_qp(); + var mimeTypes = require_mime_types2(); + module2.exports = { + /** + * Checks if a value is plaintext string (uses only printable 7bit chars) + * + * @param {String} value String to be tested + * @returns {Boolean} true if it is a plaintext string + */ + isPlainText(value, isParam) { + const re = isParam ? /[\x00-\x08\x0b\x0c\x0e-\x1f"\u0080-\uFFFF]/ : /[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/; + if (typeof value !== "string" || re.test(value)) { + return false; + } else { + return true; + } + }, + /** + * Checks if a multi line string containes lines longer than the selected value. + * + * Useful when detecting if a mail message needs any processing at all – + * if only plaintext characters are used and lines are short, then there is + * no need to encode the values in any way. If the value is plaintext but has + * longer lines then allowed, then use format=flowed + * + * @param {Number} lineLength Max line length to check for + * @returns {Boolean} Returns true if there is at least one line longer than lineLength chars + */ + hasLongerLines(str, lineLength) { + if (str.length > 128 * 1024) { + return true; + } + return new RegExp("^.{" + (lineLength + 1) + ",}", "m").test(str); + }, + /** + * Encodes a string or an Buffer to an UTF-8 MIME Word (rfc2047) + * + * @param {String|Buffer} data String to be encoded + * @param {String} mimeWordEncoding='Q' Encoding for the mime word, either Q or B + * @param {Number} [maxLength=0] If set, split mime words into several chunks if needed + * @return {String} Single or several mime words joined together + */ + encodeWord(data2, mimeWordEncoding, maxLength) { + mimeWordEncoding = (mimeWordEncoding || "Q").toString().toUpperCase().trim().charAt(0); + maxLength = maxLength || 0; + let encodedStr; + let toCharset = "UTF-8"; + if (maxLength && maxLength > 7 + toCharset.length) { + maxLength -= 7 + toCharset.length; + } + if (mimeWordEncoding === "Q") { + encodedStr = qp.encode(data2).replace(/[^a-z0-9!*+\-/=]/gi, (chr) => { + let ord = chr.charCodeAt(0).toString(16).toUpperCase(); + if (chr === " ") { + return "_"; + } else { + return "=" + (ord.length === 1 ? "0" + ord : ord); + } + }); + } else if (mimeWordEncoding === "B") { + encodedStr = typeof data2 === "string" ? data2 : base64.encode(data2); + maxLength = maxLength ? Math.max(3, (maxLength - maxLength % 4) / 4 * 3) : 0; + } + if (maxLength && (mimeWordEncoding !== "B" ? encodedStr : base64.encode(data2)).length > maxLength) { + if (mimeWordEncoding === "Q") { + encodedStr = this.splitMimeEncodedString(encodedStr, maxLength).join("?= =?" + toCharset + "?" + mimeWordEncoding + "?"); + } else { + let parts = []; + let lpart = ""; + for (let i4 = 0, len = encodedStr.length; i4 < len; i4++) { + let chr = encodedStr.charAt(i4); + if (/[\ud83c\ud83d\ud83e]/.test(chr) && i4 < len - 1) { + chr += encodedStr.charAt(++i4); + } + if (Buffer.byteLength(lpart + chr) <= maxLength || i4 === 0) { + lpart += chr; + } else { + parts.push(base64.encode(lpart)); + lpart = chr; + } + } + if (lpart) { + parts.push(base64.encode(lpart)); + } + if (parts.length > 1) { + encodedStr = parts.join("?= =?" + toCharset + "?" + mimeWordEncoding + "?"); + } else { + encodedStr = parts.join(""); + } + } + } else if (mimeWordEncoding === "B") { + encodedStr = base64.encode(data2); + } + return "=?" + toCharset + "?" + mimeWordEncoding + "?" + encodedStr + (encodedStr.substr(-2) === "?=" ? "" : "?="); + }, + /** + * Finds word sequences with non ascii text and converts these to mime words + * + * @param {String} value String to be encoded + * @param {String} mimeWordEncoding='Q' Encoding for the mime word, either Q or B + * @param {Number} [maxLength=0] If set, split mime words into several chunks if needed + * @param {Boolean} [encodeAll=false] If true and the value needs encoding then encodes entire string, not just the smallest match + * @return {String} String with possible mime words + */ + encodeWords(value, mimeWordEncoding, maxLength, encodeAll) { + maxLength = maxLength || 0; + let encodedValue; + let firstMatch = value.match(/(?:^|\s)([^\s]*["\u0080-\uFFFF])/); + if (!firstMatch) { + return value; + } + if (encodeAll) { + return this.encodeWord(value, mimeWordEncoding, maxLength); + } + let lastMatch = value.match(/(["\u0080-\uFFFF][^\s]*)[^"\u0080-\uFFFF]*$/); + if (!lastMatch) { + return value; + } + let startIndex = firstMatch.index + (firstMatch[0].match(/[^\s]/) || { + index: 0 + }).index; + let endIndex = lastMatch.index + (lastMatch[1] || "").length; + encodedValue = (startIndex ? value.substr(0, startIndex) : "") + this.encodeWord(value.substring(startIndex, endIndex), mimeWordEncoding || "Q", maxLength) + (endIndex < value.length ? value.substr(endIndex) : ""); + return encodedValue; + }, + /** + * Joins parsed header value together as 'value; param1=value1; param2=value2' + * PS: We are following RFC 822 for the list of special characters that we need to keep in quotes. + * Refer: https://www.w3.org/Protocols/rfc1341/4_Content-Type.html + * @param {Object} structured Parsed header value + * @return {String} joined header value + */ + buildHeaderValue(structured) { + let paramsArray = []; + Object.keys(structured.params || {}).forEach((param) => { + let value = structured.params[param]; + if (!this.isPlainText(value, true) || value.length >= 75) { + this.buildHeaderParam(param, value, 50).forEach((encodedParam) => { + if (!/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(encodedParam.value) || encodedParam.key.substr(-1) === "*") { + paramsArray.push(encodedParam.key + "=" + encodedParam.value); + } else { + paramsArray.push(encodedParam.key + "=" + JSON.stringify(encodedParam.value)); + } + }); + } else if (/[\s'"\\;:/=(),<>@[\]?]|^-/.test(value)) { + paramsArray.push(param + "=" + JSON.stringify(value)); + } else { + paramsArray.push(param + "=" + value); + } + }); + return structured.value + (paramsArray.length ? "; " + paramsArray.join("; ") : ""); + }, + /** + * Encodes a string or an Buffer to an UTF-8 Parameter Value Continuation encoding (rfc2231) + * Useful for splitting long parameter values. + * + * For example + * title="unicode string" + * becomes + * title*0*=utf-8''unicode + * title*1*=%20string + * + * @param {String|Buffer} data String to be encoded + * @param {Number} [maxLength=50] Max length for generated chunks + * @param {String} [fromCharset='UTF-8'] Source sharacter set + * @return {Array} A list of encoded keys and headers + */ + buildHeaderParam(key, data2, maxLength) { + let list2 = []; + let encodedStr = typeof data2 === "string" ? data2 : (data2 || "").toString(); + let encodedStrArr; + let chr, ord; + let line; + let startPos = 0; + let i4, len; + maxLength = maxLength || 50; + if (this.isPlainText(data2, true)) { + if (encodedStr.length <= maxLength) { + return [ + { + key, + value: encodedStr + } + ]; + } + encodedStr = encodedStr.replace(new RegExp(".{" + maxLength + "}", "g"), (str) => { + list2.push({ + line: str + }); + return ""; + }); + if (encodedStr) { + list2.push({ + line: encodedStr + }); + } + } else { + if (/[\uD800-\uDBFF]/.test(encodedStr)) { + encodedStrArr = []; + for (i4 = 0, len = encodedStr.length; i4 < len; i4++) { + chr = encodedStr.charAt(i4); + ord = chr.charCodeAt(0); + if (ord >= 55296 && ord <= 56319 && i4 < len - 1) { + chr += encodedStr.charAt(i4 + 1); + encodedStrArr.push(chr); + i4++; + } else { + encodedStrArr.push(chr); + } + } + encodedStr = encodedStrArr; + } + line = "utf-8''"; + let encoded = true; + startPos = 0; + for (i4 = 0, len = encodedStr.length; i4 < len; i4++) { + chr = encodedStr[i4]; + if (encoded) { + chr = this.safeEncodeURIComponent(chr); + } else { + chr = chr === " " ? chr : this.safeEncodeURIComponent(chr); + if (chr !== encodedStr[i4]) { + if ((this.safeEncodeURIComponent(line) + chr).length >= maxLength) { + list2.push({ + line, + encoded + }); + line = ""; + startPos = i4 - 1; + } else { + encoded = true; + i4 = startPos; + line = ""; + continue; + } + } + } + if ((line + chr).length >= maxLength) { + list2.push({ + line, + encoded + }); + line = chr = encodedStr[i4] === " " ? " " : this.safeEncodeURIComponent(encodedStr[i4]); + if (chr === encodedStr[i4]) { + encoded = false; + startPos = i4 - 1; + } else { + encoded = true; + } + } else { + line += chr; + } + } + if (line) { + list2.push({ + line, + encoded + }); + } + } + return list2.map((item, i5) => ({ + // encoded lines: {name}*{part}* + // unencoded lines: {name}*{part} + // if any line needs to be encoded then the first line (part==0) is always encoded + key: key + "*" + i5 + (item.encoded ? "*" : ""), + value: item.line + })); + }, + /** + * Parses a header value with key=value arguments into a structured + * object. + * + * parseHeaderValue('content-type: text/plain; CHARSET='UTF-8'') -> + * { + * 'value': 'text/plain', + * 'params': { + * 'charset': 'UTF-8' + * } + * } + * + * @param {String} str Header value + * @return {Object} Header value as a parsed structure + */ + parseHeaderValue(str) { + let response = { + value: false, + params: {} + }; + let key = false; + let value = ""; + let type = "value"; + let quote = false; + let escaped = false; + let chr; + for (let i4 = 0, len = str.length; i4 < len; i4++) { + chr = str.charAt(i4); + if (type === "key") { + if (chr === "=") { + key = value.trim().toLowerCase(); + type = "value"; + value = ""; + continue; + } + value += chr; + } else { + if (escaped) { + value += chr; + } else if (chr === "\\") { + escaped = true; + continue; + } else if (quote && chr === quote) { + quote = false; + } else if (!quote && chr === '"') { + quote = chr; + } else if (!quote && chr === ";") { + if (key === false) { + response.value = value.trim(); + } else { + response.params[key] = value.trim(); + } + type = "key"; + value = ""; + } else { + value += chr; + } + escaped = false; + } + } + if (type === "value") { + if (key === false) { + response.value = value.trim(); + } else { + response.params[key] = value.trim(); + } + } else if (value.trim()) { + response.params[value.trim().toLowerCase()] = ""; + } + Object.keys(response.params).forEach((key2) => { + let actualKey, nr, match, value2; + if (match = key2.match(/(\*(\d+)|\*(\d+)\*|\*)$/)) { + actualKey = key2.substr(0, match.index); + nr = Number(match[2] || match[3]) || 0; + if (!response.params[actualKey] || typeof response.params[actualKey] !== "object") { + response.params[actualKey] = { + charset: false, + values: [] + }; + } + value2 = response.params[key2]; + if (nr === 0 && match[0].substr(-1) === "*" && (match = value2.match(/^([^']*)'[^']*'(.*)$/))) { + response.params[actualKey].charset = match[1] || "iso-8859-1"; + value2 = match[2]; + } + response.params[actualKey].values[nr] = value2; + delete response.params[key2]; + } + }); + Object.keys(response.params).forEach((key2) => { + let value2; + if (response.params[key2] && Array.isArray(response.params[key2].values)) { + value2 = response.params[key2].values.map((val) => val || "").join(""); + if (response.params[key2].charset) { + response.params[key2] = "=?" + response.params[key2].charset + "?Q?" + value2.replace(/[=?_\s]/g, (s4) => { + let c4 = s4.charCodeAt(0).toString(16); + if (s4 === " ") { + return "_"; + } else { + return "%" + (c4.length < 2 ? "0" : "") + c4; + } + }).replace(/%/g, "=") + "?="; + } else { + response.params[key2] = value2; + } + } + }); + return response; + }, + /** + * Returns file extension for a content type string. If no suitable extensions + * are found, 'bin' is used as the default extension + * + * @param {String} mimeType Content type to be checked for + * @return {String} File extension + */ + detectExtension: (mimeType) => mimeTypes.detectExtension(mimeType), + /** + * Returns content type for a file extension. If no suitable content types + * are found, 'application/octet-stream' is used as the default content type + * + * @param {String} extension Extension to be checked for + * @return {String} File extension + */ + detectMimeType: (extension) => mimeTypes.detectMimeType(extension), + /** + * Folds long lines, useful for folding header lines (afterSpace=false) and + * flowed text (afterSpace=true) + * + * @param {String} str String to be folded + * @param {Number} [lineLength=76] Maximum length of a line + * @param {Boolean} afterSpace If true, leave a space in th end of a line + * @return {String} String with folded lines + */ + foldLines(str, lineLength, afterSpace) { + str = (str || "").toString(); + lineLength = lineLength || 76; + let pos = 0, len = str.length, result = "", line, match; + while (pos < len) { + line = str.substr(pos, lineLength); + if (line.length < lineLength) { + result += line; + break; + } + if (match = line.match(/^[^\n\r]*(\r?\n|\r)/)) { + line = match[0]; + result += line; + pos += line.length; + continue; + } else if ((match = line.match(/(\s+)[^\s]*$/)) && match[0].length - (afterSpace ? (match[1] || "").length : 0) < line.length) { + line = line.substr(0, line.length - (match[0].length - (afterSpace ? (match[1] || "").length : 0))); + } else if (match = str.substr(pos + line.length).match(/^[^\s]+(\s*)/)) { + line = line + match[0].substr(0, match[0].length - (!afterSpace ? (match[1] || "").length : 0)); + } + result += line; + pos += line.length; + if (pos < len) { + result += "\r\n"; + } + } + return result; + }, + /** + * Splits a mime encoded string. Needed for dividing mime words into smaller chunks + * + * @param {String} str Mime encoded string to be split up + * @param {Number} maxlen Maximum length of characters for one part (minimum 12) + * @return {Array} Split string + */ + splitMimeEncodedString: (str, maxlen) => { + let curLine, match, chr, done, lines = []; + maxlen = Math.max(maxlen || 0, 12); + while (str.length) { + curLine = str.substr(0, maxlen); + if (match = curLine.match(/[=][0-9A-F]?$/i)) { + curLine = curLine.substr(0, match.index); + } + done = false; + while (!done) { + done = true; + if (match = str.substr(curLine.length).match(/^[=]([0-9A-F]{2})/i)) { + chr = parseInt(match[1], 16); + if (chr < 194 && chr > 127) { + curLine = curLine.substr(0, curLine.length - 3); + done = false; + } + } + } + if (curLine.length) { + lines.push(curLine); + } + str = str.substr(curLine.length); + } + return lines; + }, + encodeURICharComponent: (chr) => { + let res = ""; + let ord = chr.charCodeAt(0).toString(16).toUpperCase(); + if (ord.length % 2) { + ord = "0" + ord; + } + if (ord.length > 2) { + for (let i4 = 0, len = ord.length / 2; i4 < len; i4++) { + res += "%" + ord.substr(i4, 2); + } + } else { + res += "%" + ord; + } + return res; + }, + safeEncodeURIComponent(str) { + str = (str || "").toString(); + try { + str = encodeURIComponent(str); + } catch (_E2) { + return str.replace(/[^\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]+/g, ""); + } + return str.replace(/[\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]/g, (chr) => this.encodeURICharComponent(chr)); + } + }; + } +}); + +// node_modules/nodemailer/lib/addressparser/index.js +var require_addressparser = __commonJS({ + "node_modules/nodemailer/lib/addressparser/index.js"(exports2, module2) { + "use strict"; + function _handleAddress(tokens, depth) { + let isGroup = false; + let state2 = "text"; + let address; + let addresses = []; + let data2 = { + address: [], + comment: [], + group: [], + text: [], + textWasQuoted: [] + // Track which text tokens came from inside quotes + }; + let i4; + let len; + let insideQuotes = false; + for (i4 = 0, len = tokens.length; i4 < len; i4++) { + let token = tokens[i4]; + let prevToken = i4 ? tokens[i4 - 1] : null; + if (token.type === "operator") { + switch (token.value) { + case "<": + state2 = "address"; + insideQuotes = false; + break; + case "(": + state2 = "comment"; + insideQuotes = false; + break; + case ":": + state2 = "group"; + isGroup = true; + insideQuotes = false; + break; + case '"': + insideQuotes = !insideQuotes; + state2 = "text"; + break; + default: + state2 = "text"; + insideQuotes = false; + break; + } + } else if (token.value) { + if (state2 === "address") { + token.value = token.value.replace(/^[^<]*<\s*/, ""); + } + if (prevToken && prevToken.noBreak && data2[state2].length) { + data2[state2][data2[state2].length - 1] += token.value; + if (state2 === "text" && insideQuotes) { + data2.textWasQuoted[data2.textWasQuoted.length - 1] = true; + } + } else { + data2[state2].push(token.value); + if (state2 === "text") { + data2.textWasQuoted.push(insideQuotes); + } + } + } + } + if (!data2.text.length && data2.comment.length) { + data2.text = data2.comment; + data2.comment = []; + } + if (isGroup) { + data2.text = data2.text.join(" "); + let groupMembers = []; + if (data2.group.length) { + let parsedGroup = addressparser(data2.group.join(","), { _depth: depth + 1 }); + parsedGroup.forEach((member2) => { + if (member2.group) { + groupMembers = groupMembers.concat(member2.group); + } else { + groupMembers.push(member2); + } + }); + } + addresses.push({ + name: data2.text || address && address.name, + group: groupMembers + }); + } else { + if (!data2.address.length && data2.text.length) { + for (i4 = data2.text.length - 1; i4 >= 0; i4--) { + if (!data2.textWasQuoted[i4] && data2.text[i4].match(/^[^@\s]+@[^@\s]+$/)) { + data2.address = data2.text.splice(i4, 1); + data2.textWasQuoted.splice(i4, 1); + break; + } + } + let _regexHandler = function(address2) { + if (!data2.address.length) { + data2.address = [address2.trim()]; + return " "; + } else { + return address2; + } + }; + if (!data2.address.length) { + for (i4 = data2.text.length - 1; i4 >= 0; i4--) { + if (!data2.textWasQuoted[i4]) { + data2.text[i4] = data2.text[i4].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/, _regexHandler).trim(); + if (data2.address.length) { + break; + } + } + } + } + } + if (!data2.text.length && data2.comment.length) { + data2.text = data2.comment; + data2.comment = []; + } + if (data2.address.length > 1) { + data2.text = data2.text.concat(data2.address.splice(1)); + } + data2.text = data2.text.join(" "); + data2.address = data2.address.join(" "); + if (!data2.address && isGroup) { + return []; + } else { + address = { + address: data2.address || data2.text || "", + name: data2.text || data2.address || "" + }; + if (address.address === address.name) { + if ((address.address || "").match(/@/)) { + address.name = ""; + } else { + address.address = ""; + } + } + addresses.push(address); + } + } + return addresses; + } + var Tokenizer = class { + constructor(str) { + this.str = (str || "").toString(); + this.operatorCurrent = ""; + this.operatorExpecting = ""; + this.node = null; + this.escaped = false; + this.list = []; + this.operators = { + '"': '"', + "(": ")", + "<": ">", + ",": "", + ":": ";", + // Semicolons are not a legal delimiter per the RFC2822 grammar other + // than for terminating a group, but they are also not valid for any + // other use in this context. Given that some mail clients have + // historically allowed the semicolon as a delimiter equivalent to the + // comma in their UI, it makes sense to treat them the same as a comma + // when used outside of a group. + ";": "" + }; + } + /** + * Tokenizes the original input string + * + * @return {Array} An array of operator|text tokens + */ + tokenize() { + let list2 = []; + for (let i4 = 0, len = this.str.length; i4 < len; i4++) { + let chr = this.str.charAt(i4); + let nextChr = i4 < len - 1 ? this.str.charAt(i4 + 1) : null; + this.checkChar(chr, nextChr); + } + this.list.forEach((node) => { + node.value = (node.value || "").toString().trim(); + if (node.value) { + list2.push(node); + } + }); + return list2; + } + /** + * Checks if a character is an operator or text and acts accordingly + * + * @param {String} chr Character from the address field + */ + checkChar(chr, nextChr) { + if (this.escaped) { + } else if (chr === this.operatorExpecting) { + this.node = { + type: "operator", + value: chr + }; + if (nextChr && ![" ", " ", "\r", "\n", ",", ";"].includes(nextChr)) { + this.node.noBreak = true; + } + this.list.push(this.node); + this.node = null; + this.operatorExpecting = ""; + this.escaped = false; + return; + } else if (!this.operatorExpecting && chr in this.operators) { + this.node = { + type: "operator", + value: chr + }; + this.list.push(this.node); + this.node = null; + this.operatorExpecting = this.operators[chr]; + this.escaped = false; + return; + } else if (['"', "'"].includes(this.operatorExpecting) && chr === "\\") { + this.escaped = true; + return; + } + if (!this.node) { + this.node = { + type: "text", + value: "" + }; + this.list.push(this.node); + } + if (chr === "\n") { + chr = " "; + } + if (chr.charCodeAt(0) >= 33 || [" ", " "].includes(chr)) { + this.node.value += chr; + } + this.escaped = false; + } + }; + var MAX_NESTED_GROUP_DEPTH = 50; + function addressparser(str, options) { + options = options || {}; + let depth = options._depth || 0; + if (depth > MAX_NESTED_GROUP_DEPTH) { + return []; + } + let tokenizer = new Tokenizer(str); + let tokens = tokenizer.tokenize(); + let addresses = []; + let address = []; + let parsedAddresses = []; + tokens.forEach((token) => { + if (token.type === "operator" && (token.value === "," || token.value === ";")) { + if (address.length) { + addresses.push(address); + } + address = []; + } else { + address.push(token); + } + }); + if (address.length) { + addresses.push(address); + } + addresses.forEach((address2) => { + address2 = _handleAddress(address2, depth); + if (address2.length) { + parsedAddresses = parsedAddresses.concat(address2); + } + }); + if (options.flatten) { + let addresses2 = []; + let walkAddressList = (list2) => { + list2.forEach((address2) => { + if (address2.group) { + return walkAddressList(address2.group); + } else { + addresses2.push(address2); + } + }); + }; + walkAddressList(parsedAddresses); + return addresses2; + } + return parsedAddresses; + } + module2.exports = addressparser; + } +}); + +// node_modules/nodemailer/lib/mime-node/last-newline.js +var require_last_newline = __commonJS({ + "node_modules/nodemailer/lib/mime-node/last-newline.js"(exports2, module2) { + "use strict"; + var Transform = require("stream").Transform; + var LastNewline = class extends Transform { + constructor() { + super(); + this.lastByte = false; + } + _transform(chunk, encoding, done) { + if (chunk.length) { + this.lastByte = chunk[chunk.length - 1]; + } + this.push(chunk); + done(); + } + _flush(done) { + if (this.lastByte === 10) { + return done(); + } + if (this.lastByte === 13) { + this.push(Buffer.from("\n")); + return done(); + } + this.push(Buffer.from("\r\n")); + return done(); + } + }; + module2.exports = LastNewline; + } +}); + +// node_modules/nodemailer/lib/mime-node/le-windows.js +var require_le_windows = __commonJS({ + "node_modules/nodemailer/lib/mime-node/le-windows.js"(exports2, module2) { + "use strict"; + var stream = require("stream"); + var Transform = stream.Transform; + var LeWindows = class extends Transform { + constructor(options) { + super(options); + this.options = options || {}; + this.lastByte = false; + } + /** + * Escapes dots + */ + _transform(chunk, encoding, done) { + let buf; + let lastPos = 0; + for (let i4 = 0, len = chunk.length; i4 < len; i4++) { + if (chunk[i4] === 10) { + if (i4 && chunk[i4 - 1] !== 13 || !i4 && this.lastByte !== 13) { + if (i4 > lastPos) { + buf = chunk.slice(lastPos, i4); + this.push(buf); + } + this.push(Buffer.from("\r\n")); + lastPos = i4 + 1; + } + } + } + if (lastPos && lastPos < chunk.length) { + buf = chunk.slice(lastPos); + this.push(buf); + } else if (!lastPos) { + this.push(chunk); + } + this.lastByte = chunk[chunk.length - 1]; + done(); + } + }; + module2.exports = LeWindows; + } +}); + +// node_modules/nodemailer/lib/mime-node/le-unix.js +var require_le_unix = __commonJS({ + "node_modules/nodemailer/lib/mime-node/le-unix.js"(exports2, module2) { + "use strict"; + var stream = require("stream"); + var Transform = stream.Transform; + var LeWindows = class extends Transform { + constructor(options) { + super(options); + this.options = options || {}; + } + /** + * Escapes dots + */ + _transform(chunk, encoding, done) { + let buf; + let lastPos = 0; + for (let i4 = 0, len = chunk.length; i4 < len; i4++) { + if (chunk[i4] === 13) { + buf = chunk.slice(lastPos, i4); + lastPos = i4 + 1; + this.push(buf); + } + } + if (lastPos && lastPos < chunk.length) { + buf = chunk.slice(lastPos); + this.push(buf); + } else if (!lastPos) { + this.push(chunk); + } + done(); + } + }; + module2.exports = LeWindows; + } +}); + +// node_modules/nodemailer/lib/mime-node/index.js +var require_mime_node = __commonJS({ + "node_modules/nodemailer/lib/mime-node/index.js"(exports2, module2) { + "use strict"; + var crypto2 = require("crypto"); + var fs = require("fs"); + var punycode = require_punycode2(); + var PassThrough = require("stream").PassThrough; + var shared = require_shared2(); + var mimeFuncs = require_mime_funcs(); + var qp = require_qp(); + var base64 = require_base64(); + var addressparser = require_addressparser(); + var nmfetch = require_fetch(); + var LastNewline = require_last_newline(); + var LeWindows = require_le_windows(); + var LeUnix = require_le_unix(); + var MimeNode = class _MimeNode { + constructor(contentType, options) { + this.nodeCounter = 0; + options = options || {}; + this.baseBoundary = options.baseBoundary || crypto2.randomBytes(8).toString("hex"); + this.boundaryPrefix = options.boundaryPrefix || "--_NmP"; + this.disableFileAccess = !!options.disableFileAccess; + this.disableUrlAccess = !!options.disableUrlAccess; + this.normalizeHeaderKey = options.normalizeHeaderKey; + this.date = /* @__PURE__ */ new Date(); + this.rootNode = options.rootNode || this; + this.keepBcc = !!options.keepBcc; + if (options.filename) { + this.filename = options.filename; + if (!contentType) { + contentType = mimeFuncs.detectMimeType(this.filename.split(".").pop()); + } + } + this.textEncoding = (options.textEncoding || "").toString().trim().charAt(0).toUpperCase(); + this.parentNode = options.parentNode; + this.hostname = options.hostname; + this.newline = options.newline; + this.childNodes = []; + this._nodeId = ++this.rootNode.nodeCounter; + this._headers = []; + this._isPlainText = false; + this._hasLongLines = false; + this._envelope = false; + this._raw = false; + this._transforms = []; + this._processFuncs = []; + if (contentType) { + this.setHeader("Content-Type", contentType); + } + } + /////// PUBLIC METHODS + /** + * Creates and appends a child node.Arguments provided are passed to MimeNode constructor + * + * @param {String} [contentType] Optional content type + * @param {Object} [options] Optional options object + * @return {Object} Created node object + */ + createChild(contentType, options) { + if (!options && typeof contentType === "object") { + options = contentType; + contentType = void 0; + } + let node = new _MimeNode(contentType, options); + this.appendChild(node); + return node; + } + /** + * Appends an existing node to the mime tree. Removes the node from an existing + * tree if needed + * + * @param {Object} childNode node to be appended + * @return {Object} Appended node object + */ + appendChild(childNode) { + if (childNode.rootNode !== this.rootNode) { + childNode.rootNode = this.rootNode; + childNode._nodeId = ++this.rootNode.nodeCounter; + } + childNode.parentNode = this; + this.childNodes.push(childNode); + return childNode; + } + /** + * Replaces current node with another node + * + * @param {Object} node Replacement node + * @return {Object} Replacement node + */ + replace(node) { + if (node === this) { + return this; + } + this.parentNode.childNodes.forEach((childNode, i4) => { + if (childNode === this) { + node.rootNode = this.rootNode; + node.parentNode = this.parentNode; + node._nodeId = this._nodeId; + this.rootNode = this; + this.parentNode = void 0; + node.parentNode.childNodes[i4] = node; + } + }); + return node; + } + /** + * Removes current node from the mime tree + * + * @return {Object} removed node + */ + remove() { + if (!this.parentNode) { + return this; + } + for (let i4 = this.parentNode.childNodes.length - 1; i4 >= 0; i4--) { + if (this.parentNode.childNodes[i4] === this) { + this.parentNode.childNodes.splice(i4, 1); + this.parentNode = void 0; + this.rootNode = this; + return this; + } + } + } + /** + * Sets a header value. If the value for selected key exists, it is overwritten. + * You can set multiple values as well by using [{key:'', value:''}] or + * {key: 'value'} as the first argument. + * + * @param {String|Array|Object} key Header key or a list of key value pairs + * @param {String} value Header value + * @return {Object} current node + */ + setHeader(key, value) { + let added = false, headerValue; + if (!value && key && typeof key === "object") { + if (key.key && "value" in key) { + this.setHeader(key.key, key.value); + } else if (Array.isArray(key)) { + key.forEach((i4) => { + this.setHeader(i4.key, i4.value); + }); + } else { + Object.keys(key).forEach((i4) => { + this.setHeader(i4, key[i4]); + }); + } + return this; + } + key = this._normalizeHeaderKey(key); + headerValue = { + key, + value + }; + for (let i4 = 0, len = this._headers.length; i4 < len; i4++) { + if (this._headers[i4].key === key) { + if (!added) { + this._headers[i4] = headerValue; + added = true; + } else { + this._headers.splice(i4, 1); + i4--; + len--; + } + } + } + if (!added) { + this._headers.push(headerValue); + } + return this; + } + /** + * Adds a header value. If the value for selected key exists, the value is appended + * as a new field and old one is not touched. + * You can set multiple values as well by using [{key:'', value:''}] or + * {key: 'value'} as the first argument. + * + * @param {String|Array|Object} key Header key or a list of key value pairs + * @param {String} value Header value + * @return {Object} current node + */ + addHeader(key, value) { + if (!value && key && typeof key === "object") { + if (key.key && key.value) { + this.addHeader(key.key, key.value); + } else if (Array.isArray(key)) { + key.forEach((i4) => { + this.addHeader(i4.key, i4.value); + }); + } else { + Object.keys(key).forEach((i4) => { + this.addHeader(i4, key[i4]); + }); + } + return this; + } else if (Array.isArray(value)) { + value.forEach((val) => { + this.addHeader(key, val); + }); + return this; + } + this._headers.push({ + key: this._normalizeHeaderKey(key), + value + }); + return this; + } + /** + * Retrieves the first mathcing value of a selected key + * + * @param {String} key Key to search for + * @retun {String} Value for the key + */ + getHeader(key) { + key = this._normalizeHeaderKey(key); + for (let i4 = 0, len = this._headers.length; i4 < len; i4++) { + if (this._headers[i4].key === key) { + return this._headers[i4].value; + } + } + } + /** + * Sets body content for current node. If the value is a string, charset is added automatically + * to Content-Type (if it is text/*). If the value is a Buffer, you need to specify + * the charset yourself + * + * @param (String|Buffer) content Body content + * @return {Object} current node + */ + setContent(content) { + this.content = content; + if (typeof this.content.pipe === "function") { + this._contentErrorHandler = (err) => { + this.content.removeListener("error", this._contentErrorHandler); + this.content = err; + }; + this.content.once("error", this._contentErrorHandler); + } else if (typeof this.content === "string") { + this._isPlainText = mimeFuncs.isPlainText(this.content); + if (this._isPlainText && mimeFuncs.hasLongerLines(this.content, 76)) { + this._hasLongLines = true; + } + } + return this; + } + build(callback) { + let promise; + if (!callback) { + promise = new Promise((resolve, reject) => { + callback = shared.callbackPromise(resolve, reject); + }); + } + let stream = this.createReadStream(); + let buf = []; + let buflen = 0; + let returned = false; + stream.on("readable", () => { + let chunk; + while ((chunk = stream.read()) !== null) { + buf.push(chunk); + buflen += chunk.length; + } + }); + stream.once("error", (err) => { + if (returned) { + return; + } + returned = true; + return callback(err); + }); + stream.once("end", (chunk) => { + if (returned) { + return; + } + returned = true; + if (chunk && chunk.length) { + buf.push(chunk); + buflen += chunk.length; + } + return callback(null, Buffer.concat(buf, buflen)); + }); + return promise; + } + getTransferEncoding() { + let transferEncoding = false; + let contentType = (this.getHeader("Content-Type") || "").toString().toLowerCase().trim(); + if (this.content) { + transferEncoding = (this.getHeader("Content-Transfer-Encoding") || "").toString().toLowerCase().trim(); + if (!transferEncoding || !["base64", "quoted-printable"].includes(transferEncoding)) { + if (/^text\//i.test(contentType)) { + if (this._isPlainText && !this._hasLongLines) { + transferEncoding = "7bit"; + } else if (typeof this.content === "string" || this.content instanceof Buffer) { + transferEncoding = this._getTextEncoding(this.content) === "Q" ? "quoted-printable" : "base64"; + } else { + transferEncoding = this.textEncoding === "B" ? "base64" : "quoted-printable"; + } + } else if (!/^(multipart|message)\//i.test(contentType)) { + transferEncoding = transferEncoding || "base64"; + } + } + } + return transferEncoding; + } + /** + * Builds the header block for the mime node. Append \r\n\r\n before writing the content + * + * @returns {String} Headers + */ + buildHeaders() { + let transferEncoding = this.getTransferEncoding(); + let headers = []; + if (transferEncoding) { + this.setHeader("Content-Transfer-Encoding", transferEncoding); + } + if (this.filename && !this.getHeader("Content-Disposition")) { + this.setHeader("Content-Disposition", "attachment"); + } + if (this.rootNode === this) { + if (!this.getHeader("Date")) { + this.setHeader("Date", this.date.toUTCString().replace(/GMT/, "+0000")); + } + this.messageId(); + if (!this.getHeader("MIME-Version")) { + this.setHeader("MIME-Version", "1.0"); + } + for (let i4 = this._headers.length - 2; i4 >= 0; i4--) { + let header = this._headers[i4]; + if (header.key === "Content-Type") { + this._headers.splice(i4, 1); + this._headers.push(header); + } + } + } + this._headers.forEach((header) => { + let key = header.key; + let value = header.value; + let structured; + let param; + let options = {}; + let formattedHeaders = ["From", "Sender", "To", "Cc", "Bcc", "Reply-To", "Date", "References"]; + if (value && typeof value === "object" && !formattedHeaders.includes(key)) { + Object.keys(value).forEach((key2) => { + if (key2 !== "value") { + options[key2] = value[key2]; + } + }); + value = (value.value || "").toString(); + if (!value.trim()) { + return; + } + } + if (options.prepared) { + if (options.foldLines) { + headers.push(mimeFuncs.foldLines(key + ": " + value)); + } else { + headers.push(key + ": " + value); + } + return; + } + switch (header.key) { + case "Content-Disposition": + structured = mimeFuncs.parseHeaderValue(value); + if (this.filename) { + structured.params.filename = this.filename; + } + value = mimeFuncs.buildHeaderValue(structured); + break; + case "Content-Type": + structured = mimeFuncs.parseHeaderValue(value); + this._handleContentType(structured); + if (structured.value.match(/^text\/plain\b/) && typeof this.content === "string" && /[\u0080-\uFFFF]/.test(this.content)) { + structured.params.charset = "utf-8"; + } + value = mimeFuncs.buildHeaderValue(structured); + if (this.filename) { + param = this._encodeWords(this.filename); + if (param !== this.filename || /[\s'"\\;:/=(),<>@[\]?]|^-/.test(param)) { + param = '"' + param + '"'; + } + value += "; name=" + param; + } + break; + case "Bcc": + if (!this.keepBcc) { + return; + } + break; + } + value = this._encodeHeaderValue(key, value); + if (!(value || "").toString().trim()) { + return; + } + if (typeof this.normalizeHeaderKey === "function") { + let normalized = this.normalizeHeaderKey(key, value); + if (normalized && typeof normalized === "string" && normalized.length) { + key = normalized; + } + } + headers.push(mimeFuncs.foldLines(key + ": " + value, 76)); + }); + return headers.join("\r\n"); + } + /** + * Streams the rfc2822 message from the current node. If this is a root node, + * mandatory header fields are set if missing (Date, Message-Id, MIME-Version) + * + * @return {String} Compiled message + */ + createReadStream(options) { + options = options || {}; + let stream = new PassThrough(options); + let outputStream = stream; + let transform; + this.stream(stream, options, (err) => { + if (err) { + outputStream.emit("error", err); + return; + } + stream.end(); + }); + for (let i4 = 0, len = this._transforms.length; i4 < len; i4++) { + transform = typeof this._transforms[i4] === "function" ? this._transforms[i4]() : this._transforms[i4]; + outputStream.once("error", (err) => { + transform.emit("error", err); + }); + outputStream = outputStream.pipe(transform); + } + transform = new LastNewline(); + outputStream.once("error", (err) => { + transform.emit("error", err); + }); + outputStream = outputStream.pipe(transform); + for (let i4 = 0, len = this._processFuncs.length; i4 < len; i4++) { + transform = this._processFuncs[i4]; + outputStream = transform(outputStream); + } + if (this.newline) { + const winbreak = ["win", "windows", "dos", "\r\n"].includes(this.newline.toString().toLowerCase()); + const newlineTransform = winbreak ? new LeWindows() : new LeUnix(); + const stream2 = outputStream.pipe(newlineTransform); + outputStream.on("error", (err) => stream2.emit("error", err)); + return stream2; + } + return outputStream; + } + /** + * Appends a transform stream object to the transforms list. Final output + * is passed through this stream before exposing + * + * @param {Object} transform Read-Write stream + */ + transform(transform) { + this._transforms.push(transform); + } + /** + * Appends a post process function. The functon is run after transforms and + * uses the following syntax + * + * processFunc(input) -> outputStream + * + * @param {Object} processFunc Read-Write stream + */ + processFunc(processFunc) { + this._processFuncs.push(processFunc); + } + stream(outputStream, options, done) { + let transferEncoding = this.getTransferEncoding(); + let contentStream; + let localStream; + let returned = false; + let callback = (err) => { + if (returned) { + return; + } + returned = true; + done(err); + }; + let finalize = () => { + let childId = 0; + let processChildNode = () => { + if (childId >= this.childNodes.length) { + outputStream.write("\r\n--" + this.boundary + "--\r\n"); + return callback(); + } + let child = this.childNodes[childId++]; + outputStream.write((childId > 1 ? "\r\n" : "") + "--" + this.boundary + "\r\n"); + child.stream(outputStream, options, (err) => { + if (err) { + return callback(err); + } + setImmediate(processChildNode); + }); + }; + if (this.multipart) { + setImmediate(processChildNode); + } else { + return callback(); + } + }; + let sendContent = () => { + if (this.content) { + if (Object.prototype.toString.call(this.content) === "[object Error]") { + return callback(this.content); + } + if (typeof this.content.pipe === "function") { + this.content.removeListener("error", this._contentErrorHandler); + this._contentErrorHandler = (err) => callback(err); + this.content.once("error", this._contentErrorHandler); + } + let createStream = () => { + if (["quoted-printable", "base64"].includes(transferEncoding)) { + contentStream = new (transferEncoding === "base64" ? base64 : qp).Encoder(options); + contentStream.pipe(outputStream, { + end: false + }); + contentStream.once("end", finalize); + contentStream.once("error", (err) => callback(err)); + localStream = this._getStream(this.content); + localStream.pipe(contentStream); + } else { + localStream = this._getStream(this.content); + localStream.pipe(outputStream, { + end: false + }); + localStream.once("end", finalize); + } + localStream.once("error", (err) => callback(err)); + }; + if (this.content._resolve) { + let chunks = []; + let chunklen = 0; + let returned2 = false; + let sourceStream = this._getStream(this.content); + sourceStream.on("error", (err) => { + if (returned2) { + return; + } + returned2 = true; + callback(err); + }); + sourceStream.on("readable", () => { + let chunk; + while ((chunk = sourceStream.read()) !== null) { + chunks.push(chunk); + chunklen += chunk.length; + } + }); + sourceStream.on("end", () => { + if (returned2) { + return; + } + returned2 = true; + this.content._resolve = false; + this.content._resolvedValue = Buffer.concat(chunks, chunklen); + setImmediate(createStream); + }); + } else { + setImmediate(createStream); + } + return; + } else { + return setImmediate(finalize); + } + }; + if (this._raw) { + setImmediate(() => { + if (Object.prototype.toString.call(this._raw) === "[object Error]") { + return callback(this._raw); + } + if (typeof this._raw.pipe === "function") { + this._raw.removeListener("error", this._contentErrorHandler); + } + let raw = this._getStream(this._raw); + raw.pipe(outputStream, { + end: false + }); + raw.on("error", (err) => outputStream.emit("error", err)); + raw.on("end", finalize); + }); + } else { + outputStream.write(this.buildHeaders() + "\r\n\r\n"); + setImmediate(sendContent); + } + } + /** + * Sets envelope to be used instead of the generated one + * + * @return {Object} SMTP envelope in the form of {from: 'from@example.com', to: ['to@example.com']} + */ + setEnvelope(envelope) { + let list2; + this._envelope = { + from: false, + to: [] + }; + if (envelope.from) { + list2 = []; + this._convertAddresses(this._parseAddresses(envelope.from), list2); + list2 = list2.filter((address) => address && address.address); + if (list2.length && list2[0]) { + this._envelope.from = list2[0].address; + } + } + ["to", "cc", "bcc"].forEach((key) => { + if (envelope[key]) { + this._convertAddresses(this._parseAddresses(envelope[key]), this._envelope.to); + } + }); + this._envelope.to = this._envelope.to.map((to) => to.address).filter((address) => address); + let standardFields = ["to", "cc", "bcc", "from"]; + Object.keys(envelope).forEach((key) => { + if (!standardFields.includes(key)) { + this._envelope[key] = envelope[key]; + } + }); + return this; + } + /** + * Generates and returns an object with parsed address fields + * + * @return {Object} Address object + */ + getAddresses() { + let addresses = {}; + this._headers.forEach((header) => { + let key = header.key.toLowerCase(); + if (["from", "sender", "reply-to", "to", "cc", "bcc"].includes(key)) { + if (!Array.isArray(addresses[key])) { + addresses[key] = []; + } + this._convertAddresses(this._parseAddresses(header.value), addresses[key]); + } + }); + return addresses; + } + /** + * Generates and returns SMTP envelope with the sender address and a list of recipients addresses + * + * @return {Object} SMTP envelope in the form of {from: 'from@example.com', to: ['to@example.com']} + */ + getEnvelope() { + if (this._envelope) { + return this._envelope; + } + let envelope = { + from: false, + to: [] + }; + this._headers.forEach((header) => { + let list2 = []; + if (header.key === "From" || !envelope.from && ["Reply-To", "Sender"].includes(header.key)) { + this._convertAddresses(this._parseAddresses(header.value), list2); + if (list2.length && list2[0]) { + envelope.from = list2[0].address; + } + } else if (["To", "Cc", "Bcc"].includes(header.key)) { + this._convertAddresses(this._parseAddresses(header.value), envelope.to); + } + }); + envelope.to = envelope.to.map((to) => to.address); + return envelope; + } + /** + * Returns Message-Id value. If it does not exist, then creates one + * + * @return {String} Message-Id value + */ + messageId() { + let messageId = this.getHeader("Message-ID"); + if (!messageId) { + messageId = this._generateMessageId(); + this.setHeader("Message-ID", messageId); + } + return messageId; + } + /** + * Sets pregenerated content that will be used as the output of this node + * + * @param {String|Buffer|Stream} Raw MIME contents + */ + setRaw(raw) { + this._raw = raw; + if (this._raw && typeof this._raw.pipe === "function") { + this._contentErrorHandler = (err) => { + this._raw.removeListener("error", this._contentErrorHandler); + this._raw = err; + }; + this._raw.once("error", this._contentErrorHandler); + } + return this; + } + /////// PRIVATE METHODS + /** + * Detects and returns handle to a stream related with the content. + * + * @param {Mixed} content Node content + * @returns {Object} Stream object + */ + _getStream(content) { + let contentStream; + if (content._resolvedValue) { + contentStream = new PassThrough(); + setImmediate(() => { + try { + contentStream.end(content._resolvedValue); + } catch (_err) { + contentStream.emit("error", _err); + } + }); + return contentStream; + } else if (typeof content.pipe === "function") { + return content; + } else if (content && typeof content.path === "string" && !content.href) { + if (this.disableFileAccess) { + contentStream = new PassThrough(); + setImmediate(() => contentStream.emit("error", new Error("File access rejected for " + content.path))); + return contentStream; + } + return fs.createReadStream(content.path); + } else if (content && typeof content.href === "string") { + if (this.disableUrlAccess) { + contentStream = new PassThrough(); + setImmediate(() => contentStream.emit("error", new Error("Url access rejected for " + content.href))); + return contentStream; + } + return nmfetch(content.href, { headers: content.httpHeaders }); + } else { + contentStream = new PassThrough(); + setImmediate(() => { + try { + contentStream.end(content || ""); + } catch (_err) { + contentStream.emit("error", _err); + } + }); + return contentStream; + } + } + /** + * Parses addresses. Takes in a single address or an array or an + * array of address arrays (eg. To: [[first group], [second group],...]) + * + * @param {Mixed} addresses Addresses to be parsed + * @return {Array} An array of address objects + */ + _parseAddresses(addresses) { + return [].concat.apply( + [], + [].concat(addresses).map((address) => { + if (address && address.address) { + address.address = this._normalizeAddress(address.address); + address.name = address.name || ""; + return [address]; + } + return addressparser(address); + }) + ); + } + /** + * Normalizes a header key, uses Camel-Case form, except for uppercase MIME- + * + * @param {String} key Key to be normalized + * @return {String} key in Camel-Case form + */ + _normalizeHeaderKey(key) { + key = (key || "").toString().replace(/\r?\n|\r/g, " ").trim().toLowerCase().replace(/^X-SMTPAPI$|^(MIME|DKIM|ARC|BIMI)\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi, (c4) => c4.toUpperCase()).replace(/^Content-Features$/i, "Content-features"); + return key; + } + /** + * Checks if the content type is multipart and defines boundary if needed. + * Doesn't return anything, modifies object argument instead. + * + * @param {Object} structured Parsed header value for 'Content-Type' key + */ + _handleContentType(structured) { + this.contentType = structured.value.trim().toLowerCase(); + this.multipart = /^multipart\//i.test(this.contentType) ? this.contentType.substr(this.contentType.indexOf("/") + 1) : false; + if (this.multipart) { + this.boundary = structured.params.boundary = structured.params.boundary || this.boundary || this._generateBoundary(); + } else { + this.boundary = false; + } + } + /** + * Generates a multipart boundary value + * + * @return {String} boundary value + */ + _generateBoundary() { + return this.rootNode.boundaryPrefix + "-" + this.rootNode.baseBoundary + "-Part_" + this._nodeId; + } + /** + * Encodes a header value for use in the generated rfc2822 email. + * + * @param {String} key Header key + * @param {String} value Header value + */ + _encodeHeaderValue(key, value) { + key = this._normalizeHeaderKey(key); + switch (key) { + // Structured headers + case "From": + case "Sender": + case "To": + case "Cc": + case "Bcc": + case "Reply-To": + return this._convertAddresses(this._parseAddresses(value)); + // values enclosed in <> + case "Message-ID": + case "In-Reply-To": + case "Content-Id": + value = (value || "").toString().replace(/\r?\n|\r/g, " "); + if (value.charAt(0) !== "<") { + value = "<" + value; + } + if (value.charAt(value.length - 1) !== ">") { + value = value + ">"; + } + return value; + // space separated list of values enclosed in <> + case "References": + value = [].concat.apply( + [], + [].concat(value || "").map((elm) => { + elm = (elm || "").toString().replace(/\r?\n|\r/g, " ").trim(); + return elm.replace(/<[^>]*>/g, (str) => str.replace(/\s/g, "")).split(/\s+/); + }) + ).map((elm) => { + if (elm.charAt(0) !== "<") { + elm = "<" + elm; + } + if (elm.charAt(elm.length - 1) !== ">") { + elm = elm + ">"; + } + return elm; + }); + return value.join(" ").trim(); + case "Date": + if (Object.prototype.toString.call(value) === "[object Date]") { + return value.toUTCString().replace(/GMT/, "+0000"); + } + value = (value || "").toString().replace(/\r?\n|\r/g, " "); + return this._encodeWords(value); + case "Content-Type": + case "Content-Disposition": + return (value || "").toString().replace(/\r?\n|\r/g, " "); + default: + value = (value || "").toString().replace(/\r?\n|\r/g, " "); + return this._encodeWords(value); + } + } + /** + * Rebuilds address object using punycode and other adjustments + * + * @param {Array} addresses An array of address objects + * @param {Array} [uniqueList] An array to be populated with addresses + * @return {String} address string + */ + _convertAddresses(addresses, uniqueList) { + let values = []; + uniqueList = uniqueList || []; + [].concat(addresses || []).forEach((address) => { + if (address.address) { + address.address = this._normalizeAddress(address.address); + if (!address.name) { + values.push(address.address.indexOf(" ") >= 0 ? `<${address.address}>` : `${address.address}`); + } else if (address.name) { + values.push(`${this._encodeAddressName(address.name)} <${address.address}>`); + } + if (address.address) { + if (!uniqueList.filter((a4) => a4.address === address.address).length) { + uniqueList.push(address); + } + } + } else if (address.group) { + let groupListAddresses = (address.group.length ? this._convertAddresses(address.group, uniqueList) : "").trim(); + values.push(`${this._encodeAddressName(address.name)}:${groupListAddresses};`); + } + }); + return values.join(", "); + } + /** + * Normalizes an email address + * + * @param {Array} address An array of address objects + * @return {String} address string + */ + _normalizeAddress(address) { + address = (address || "").toString().replace(/[\x00-\x1F<>]+/g, " ").trim(); + let lastAt = address.lastIndexOf("@"); + if (lastAt < 0) { + return address; + } + let user = address.substr(0, lastAt); + let domain = address.substr(lastAt + 1); + let encodedDomain; + try { + encodedDomain = punycode.toASCII(domain.toLowerCase()); + } catch (_err) { + } + if (user.indexOf(" ") >= 0) { + if (user.charAt(0) !== '"') { + user = '"' + user; + } + if (user.substr(-1) !== '"') { + user = user + '"'; + } + } + return `${user}@${encodedDomain}`; + } + /** + * If needed, mime encodes the name part + * + * @param {String} name Name part of an address + * @returns {String} Mime word encoded string if needed + */ + _encodeAddressName(name) { + if (!/^[\w ]*$/.test(name)) { + if (/^[\x20-\x7e]*$/.test(name)) { + return '"' + name.replace(/([\\"])/g, "\\$1") + '"'; + } else { + return mimeFuncs.encodeWord(name, this._getTextEncoding(name), 52); + } + } + return name; + } + /** + * If needed, mime encodes the name part + * + * @param {String} name Name part of an address + * @returns {String} Mime word encoded string if needed + */ + _encodeWords(value) { + return mimeFuncs.encodeWords(value, this._getTextEncoding(value), 52, true); + } + /** + * Detects best mime encoding for a text value + * + * @param {String} value Value to check for + * @return {String} either 'Q' or 'B' + */ + _getTextEncoding(value) { + value = (value || "").toString(); + let encoding = this.textEncoding; + let latinLen; + let nonLatinLen; + if (!encoding) { + nonLatinLen = (value.match(/[\x00-\x08\x0B\x0C\x0E-\x1F\u0080-\uFFFF]/g) || []).length; + latinLen = (value.match(/[a-z]/gi) || []).length; + encoding = nonLatinLen < latinLen ? "Q" : "B"; + } + return encoding; + } + /** + * Generates a message id + * + * @return {String} Random Message-ID value + */ + _generateMessageId() { + return "<" + [2, 2, 2, 6].reduce( + // crux to generate UUID-like random strings + (prev, len) => prev + "-" + crypto2.randomBytes(len).toString("hex"), + crypto2.randomBytes(4).toString("hex") + ) + "@" + // try to use the domain of the FROM address or fallback to server hostname + (this.getEnvelope().from || this.hostname || "localhost").split("@").pop() + ">"; + } + }; + module2.exports = MimeNode; + } +}); + +// node_modules/nodemailer/lib/mail-composer/index.js +var require_mail_composer = __commonJS({ + "node_modules/nodemailer/lib/mail-composer/index.js"(exports2, module2) { + "use strict"; + var MimeNode = require_mime_node(); + var mimeFuncs = require_mime_funcs(); + var parseDataURI = require_shared2().parseDataURI; + var MailComposer = class { + constructor(mail) { + this.mail = mail || {}; + this.message = false; + } + /** + * Builds MimeNode instance + */ + compile() { + this._alternatives = this.getAlternatives(); + this._htmlNode = this._alternatives.filter((alternative) => /^text\/html\b/i.test(alternative.contentType)).pop(); + this._attachments = this.getAttachments(!!this._htmlNode); + this._useRelated = !!(this._htmlNode && this._attachments.related.length); + this._useAlternative = this._alternatives.length > 1; + this._useMixed = this._attachments.attached.length > 1 || this._alternatives.length && this._attachments.attached.length === 1; + if (this.mail.raw) { + this.message = new MimeNode("message/rfc822", { newline: this.mail.newline }).setRaw(this.mail.raw); + } else if (this._useMixed) { + this.message = this._createMixed(); + } else if (this._useAlternative) { + this.message = this._createAlternative(); + } else if (this._useRelated) { + this.message = this._createRelated(); + } else { + this.message = this._createContentNode( + false, + [].concat(this._alternatives || []).concat(this._attachments.attached || []).shift() || { + contentType: "text/plain", + content: "" + } + ); + } + if (this.mail.headers) { + this.message.addHeader(this.mail.headers); + } + ["from", "sender", "to", "cc", "bcc", "reply-to", "in-reply-to", "references", "subject", "message-id", "date"].forEach((header) => { + let key = header.replace(/-(\w)/g, (o4, c4) => c4.toUpperCase()); + if (this.mail[key]) { + this.message.setHeader(header, this.mail[key]); + } + }); + if (this.mail.envelope) { + this.message.setEnvelope(this.mail.envelope); + } + this.message.messageId(); + return this.message; + } + /** + * List all attachments. Resulting attachment objects can be used as input for MimeNode nodes + * + * @param {Boolean} findRelated If true separate related attachments from attached ones + * @returns {Object} An object of arrays (`related` and `attached`) + */ + getAttachments(findRelated) { + let icalEvent, eventObject; + let attachments = [].concat(this.mail.attachments || []).map((attachment, i4) => { + let data2; + if (/^data:/i.test(attachment.path || attachment.href)) { + attachment = this._processDataUrl(attachment); + } + let contentType = attachment.contentType || mimeFuncs.detectMimeType(attachment.filename || attachment.path || attachment.href || "bin"); + let isImage = /^image\//i.test(contentType); + let isMessageNode = /^message\//i.test(contentType); + let contentDisposition = attachment.contentDisposition || (isMessageNode || isImage && attachment.cid ? "inline" : "attachment"); + let contentTransferEncoding; + if ("contentTransferEncoding" in attachment) { + contentTransferEncoding = attachment.contentTransferEncoding; + } else if (isMessageNode) { + contentTransferEncoding = "8bit"; + } else { + contentTransferEncoding = "base64"; + } + data2 = { + contentType, + contentDisposition, + contentTransferEncoding + }; + if (attachment.filename) { + data2.filename = attachment.filename; + } else if (!isMessageNode && attachment.filename !== false) { + data2.filename = (attachment.path || attachment.href || "").split("/").pop().split("?").shift() || "attachment-" + (i4 + 1); + if (data2.filename.indexOf(".") < 0) { + data2.filename += "." + mimeFuncs.detectExtension(data2.contentType); + } + } + if (/^https?:\/\//i.test(attachment.path)) { + attachment.href = attachment.path; + attachment.path = void 0; + } + if (attachment.cid) { + data2.cid = attachment.cid; + } + if (attachment.raw) { + data2.raw = attachment.raw; + } else if (attachment.path) { + data2.content = { + path: attachment.path + }; + } else if (attachment.href) { + data2.content = { + href: attachment.href, + httpHeaders: attachment.httpHeaders + }; + } else { + data2.content = attachment.content || ""; + } + if (attachment.encoding) { + data2.encoding = attachment.encoding; + } + if (attachment.headers) { + data2.headers = attachment.headers; + } + return data2; + }); + if (this.mail.icalEvent) { + if (typeof this.mail.icalEvent === "object" && (this.mail.icalEvent.content || this.mail.icalEvent.path || this.mail.icalEvent.href || this.mail.icalEvent.raw)) { + icalEvent = this.mail.icalEvent; + } else { + icalEvent = { + content: this.mail.icalEvent + }; + } + eventObject = {}; + Object.keys(icalEvent).forEach((key) => { + eventObject[key] = icalEvent[key]; + }); + eventObject.contentType = "application/ics"; + if (!eventObject.headers) { + eventObject.headers = {}; + } + eventObject.filename = eventObject.filename || "invite.ics"; + eventObject.headers["Content-Disposition"] = "attachment"; + eventObject.headers["Content-Transfer-Encoding"] = "base64"; + } + if (!findRelated) { + return { + attached: attachments.concat(eventObject || []), + related: [] + }; + } else { + return { + attached: attachments.filter((attachment) => !attachment.cid).concat(eventObject || []), + related: attachments.filter((attachment) => !!attachment.cid) + }; + } + } + /** + * List alternatives. Resulting objects can be used as input for MimeNode nodes + * + * @returns {Array} An array of alternative elements. Includes the `text` and `html` values as well + */ + getAlternatives() { + let alternatives = [], text, html, watchHtml, amp, icalEvent, eventObject; + if (this.mail.text) { + if (typeof this.mail.text === "object" && (this.mail.text.content || this.mail.text.path || this.mail.text.href || this.mail.text.raw)) { + text = this.mail.text; + } else { + text = { + content: this.mail.text + }; + } + text.contentType = "text/plain; charset=utf-8"; + } + if (this.mail.watchHtml) { + if (typeof this.mail.watchHtml === "object" && (this.mail.watchHtml.content || this.mail.watchHtml.path || this.mail.watchHtml.href || this.mail.watchHtml.raw)) { + watchHtml = this.mail.watchHtml; + } else { + watchHtml = { + content: this.mail.watchHtml + }; + } + watchHtml.contentType = "text/watch-html; charset=utf-8"; + } + if (this.mail.amp) { + if (typeof this.mail.amp === "object" && (this.mail.amp.content || this.mail.amp.path || this.mail.amp.href || this.mail.amp.raw)) { + amp = this.mail.amp; + } else { + amp = { + content: this.mail.amp + }; + } + amp.contentType = "text/x-amp-html; charset=utf-8"; + } + if (this.mail.icalEvent) { + if (typeof this.mail.icalEvent === "object" && (this.mail.icalEvent.content || this.mail.icalEvent.path || this.mail.icalEvent.href || this.mail.icalEvent.raw)) { + icalEvent = this.mail.icalEvent; + } else { + icalEvent = { + content: this.mail.icalEvent + }; + } + eventObject = {}; + Object.keys(icalEvent).forEach((key) => { + eventObject[key] = icalEvent[key]; + }); + if (eventObject.content && typeof eventObject.content === "object") { + eventObject.content._resolve = true; + } + eventObject.filename = false; + eventObject.contentType = "text/calendar; charset=utf-8; method=" + (eventObject.method || "PUBLISH").toString().trim().toUpperCase(); + if (!eventObject.headers) { + eventObject.headers = {}; + } + } + if (this.mail.html) { + if (typeof this.mail.html === "object" && (this.mail.html.content || this.mail.html.path || this.mail.html.href || this.mail.html.raw)) { + html = this.mail.html; + } else { + html = { + content: this.mail.html + }; + } + html.contentType = "text/html; charset=utf-8"; + } + [].concat(text || []).concat(watchHtml || []).concat(amp || []).concat(html || []).concat(eventObject || []).concat(this.mail.alternatives || []).forEach((alternative) => { + let data2; + if (/^data:/i.test(alternative.path || alternative.href)) { + alternative = this._processDataUrl(alternative); + } + data2 = { + contentType: alternative.contentType || mimeFuncs.detectMimeType(alternative.filename || alternative.path || alternative.href || "txt"), + contentTransferEncoding: alternative.contentTransferEncoding + }; + if (alternative.filename) { + data2.filename = alternative.filename; + } + if (/^https?:\/\//i.test(alternative.path)) { + alternative.href = alternative.path; + alternative.path = void 0; + } + if (alternative.raw) { + data2.raw = alternative.raw; + } else if (alternative.path) { + data2.content = { + path: alternative.path + }; + } else if (alternative.href) { + data2.content = { + href: alternative.href + }; + } else { + data2.content = alternative.content || ""; + } + if (alternative.encoding) { + data2.encoding = alternative.encoding; + } + if (alternative.headers) { + data2.headers = alternative.headers; + } + alternatives.push(data2); + }); + return alternatives; + } + /** + * Builds multipart/mixed node. It should always contain different type of elements on the same level + * eg. text + attachments + * + * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created + * @returns {Object} MimeNode node element + */ + _createMixed(parentNode) { + let node; + if (!parentNode) { + node = new MimeNode("multipart/mixed", { + baseBoundary: this.mail.baseBoundary, + textEncoding: this.mail.textEncoding, + boundaryPrefix: this.mail.boundaryPrefix, + disableUrlAccess: this.mail.disableUrlAccess, + disableFileAccess: this.mail.disableFileAccess, + normalizeHeaderKey: this.mail.normalizeHeaderKey, + newline: this.mail.newline + }); + } else { + node = parentNode.createChild("multipart/mixed", { + disableUrlAccess: this.mail.disableUrlAccess, + disableFileAccess: this.mail.disableFileAccess, + normalizeHeaderKey: this.mail.normalizeHeaderKey, + newline: this.mail.newline + }); + } + if (this._useAlternative) { + this._createAlternative(node); + } else if (this._useRelated) { + this._createRelated(node); + } + [].concat(!this._useAlternative && this._alternatives || []).concat(this._attachments.attached || []).forEach((element) => { + if (!this._useRelated || element !== this._htmlNode) { + this._createContentNode(node, element); + } + }); + return node; + } + /** + * Builds multipart/alternative node. It should always contain same type of elements on the same level + * eg. text + html view of the same data + * + * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created + * @returns {Object} MimeNode node element + */ + _createAlternative(parentNode) { + let node; + if (!parentNode) { + node = new MimeNode("multipart/alternative", { + baseBoundary: this.mail.baseBoundary, + textEncoding: this.mail.textEncoding, + boundaryPrefix: this.mail.boundaryPrefix, + disableUrlAccess: this.mail.disableUrlAccess, + disableFileAccess: this.mail.disableFileAccess, + normalizeHeaderKey: this.mail.normalizeHeaderKey, + newline: this.mail.newline + }); + } else { + node = parentNode.createChild("multipart/alternative", { + disableUrlAccess: this.mail.disableUrlAccess, + disableFileAccess: this.mail.disableFileAccess, + normalizeHeaderKey: this.mail.normalizeHeaderKey, + newline: this.mail.newline + }); + } + this._alternatives.forEach((alternative) => { + if (this._useRelated && this._htmlNode === alternative) { + this._createRelated(node); + } else { + this._createContentNode(node, alternative); + } + }); + return node; + } + /** + * Builds multipart/related node. It should always contain html node with related attachments + * + * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created + * @returns {Object} MimeNode node element + */ + _createRelated(parentNode) { + let node; + if (!parentNode) { + node = new MimeNode('multipart/related; type="text/html"', { + baseBoundary: this.mail.baseBoundary, + textEncoding: this.mail.textEncoding, + boundaryPrefix: this.mail.boundaryPrefix, + disableUrlAccess: this.mail.disableUrlAccess, + disableFileAccess: this.mail.disableFileAccess, + normalizeHeaderKey: this.mail.normalizeHeaderKey, + newline: this.mail.newline + }); + } else { + node = parentNode.createChild('multipart/related; type="text/html"', { + disableUrlAccess: this.mail.disableUrlAccess, + disableFileAccess: this.mail.disableFileAccess, + normalizeHeaderKey: this.mail.normalizeHeaderKey, + newline: this.mail.newline + }); + } + this._createContentNode(node, this._htmlNode); + this._attachments.related.forEach((alternative) => this._createContentNode(node, alternative)); + return node; + } + /** + * Creates a regular node with contents + * + * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created + * @param {Object} element Node data + * @returns {Object} MimeNode node element + */ + _createContentNode(parentNode, element) { + element = element || {}; + element.content = element.content || ""; + let node; + let encoding = (element.encoding || "utf8").toString().toLowerCase().replace(/[-_\s]/g, ""); + if (!parentNode) { + node = new MimeNode(element.contentType, { + filename: element.filename, + baseBoundary: this.mail.baseBoundary, + textEncoding: this.mail.textEncoding, + boundaryPrefix: this.mail.boundaryPrefix, + disableUrlAccess: this.mail.disableUrlAccess, + disableFileAccess: this.mail.disableFileAccess, + normalizeHeaderKey: this.mail.normalizeHeaderKey, + newline: this.mail.newline + }); + } else { + node = parentNode.createChild(element.contentType, { + filename: element.filename, + textEncoding: this.mail.textEncoding, + disableUrlAccess: this.mail.disableUrlAccess, + disableFileAccess: this.mail.disableFileAccess, + normalizeHeaderKey: this.mail.normalizeHeaderKey, + newline: this.mail.newline + }); + } + if (element.headers) { + node.addHeader(element.headers); + } + if (element.cid) { + node.setHeader("Content-Id", "<" + element.cid.replace(/[<>]/g, "") + ">"); + } + if (element.contentTransferEncoding) { + node.setHeader("Content-Transfer-Encoding", element.contentTransferEncoding); + } else if (this.mail.encoding && /^text\//i.test(element.contentType)) { + node.setHeader("Content-Transfer-Encoding", this.mail.encoding); + } + if (!/^text\//i.test(element.contentType) || element.contentDisposition) { + node.setHeader( + "Content-Disposition", + element.contentDisposition || (element.cid && /^image\//i.test(element.contentType) ? "inline" : "attachment") + ); + } + if (typeof element.content === "string" && !["utf8", "usascii", "ascii"].includes(encoding)) { + element.content = Buffer.from(element.content, encoding); + } + if (element.raw) { + node.setRaw(element.raw); + } else { + node.setContent(element.content); + } + return node; + } + /** + * Parses data uri and converts it to a Buffer + * + * @param {Object} element Content element + * @return {Object} Parsed element + */ + _processDataUrl(element) { + const dataUrl = element.path || element.href; + if (!dataUrl || typeof dataUrl !== "string") { + return element; + } + if (!dataUrl.startsWith("data:")) { + return element; + } + if (dataUrl.length > 52428800) { + let detectedType = "application/octet-stream"; + const commaPos = dataUrl.indexOf(","); + if (commaPos > 0 && commaPos < 200) { + const header = dataUrl.substring(5, commaPos); + const parts = header.split(";"); + if (parts[0] && parts[0].includes("/")) { + detectedType = parts[0].trim(); + } + } + return Object.assign({}, element, { + path: false, + href: false, + content: Buffer.alloc(0), + contentType: element.contentType || detectedType + }); + } + let parsedDataUri; + try { + parsedDataUri = parseDataURI(dataUrl); + } catch (_err) { + return element; + } + if (!parsedDataUri) { + return element; + } + element.content = parsedDataUri.data; + element.contentType = element.contentType || parsedDataUri.contentType; + if ("path" in element) { + element.path = false; + } + if ("href" in element) { + element.href = false; + } + return element; + } + }; + module2.exports = MailComposer; + } +}); + +// node_modules/nodemailer/lib/dkim/message-parser.js +var require_message_parser = __commonJS({ + "node_modules/nodemailer/lib/dkim/message-parser.js"(exports2, module2) { + "use strict"; + var Transform = require("stream").Transform; + var MessageParser = class extends Transform { + constructor(options) { + super(options); + this.lastBytes = Buffer.alloc(4); + this.headersParsed = false; + this.headerBytes = 0; + this.headerChunks = []; + this.rawHeaders = false; + this.bodySize = 0; + } + /** + * Keeps count of the last 4 bytes in order to detect line breaks on chunk boundaries + * + * @param {Buffer} data Next data chunk from the stream + */ + updateLastBytes(data2) { + let lblen = this.lastBytes.length; + let nblen = Math.min(data2.length, lblen); + for (let i4 = 0, len = lblen - nblen; i4 < len; i4++) { + this.lastBytes[i4] = this.lastBytes[i4 + nblen]; + } + for (let i4 = 1; i4 <= nblen; i4++) { + this.lastBytes[lblen - i4] = data2[data2.length - i4]; + } + } + /** + * Finds and removes message headers from the remaining body. We want to keep + * headers separated until final delivery to be able to modify these + * + * @param {Buffer} data Next chunk of data + * @return {Boolean} Returns true if headers are already found or false otherwise + */ + checkHeaders(data2) { + if (this.headersParsed) { + return true; + } + let lblen = this.lastBytes.length; + let headerPos = 0; + this.curLinePos = 0; + for (let i4 = 0, len = this.lastBytes.length + data2.length; i4 < len; i4++) { + let chr; + if (i4 < lblen) { + chr = this.lastBytes[i4]; + } else { + chr = data2[i4 - lblen]; + } + if (chr === 10 && i4) { + let pr1 = i4 - 1 < lblen ? this.lastBytes[i4 - 1] : data2[i4 - 1 - lblen]; + let pr2 = i4 > 1 ? i4 - 2 < lblen ? this.lastBytes[i4 - 2] : data2[i4 - 2 - lblen] : false; + if (pr1 === 10) { + this.headersParsed = true; + headerPos = i4 - lblen + 1; + this.headerBytes += headerPos; + break; + } else if (pr1 === 13 && pr2 === 10) { + this.headersParsed = true; + headerPos = i4 - lblen + 1; + this.headerBytes += headerPos; + break; + } + } + } + if (this.headersParsed) { + this.headerChunks.push(data2.slice(0, headerPos)); + this.rawHeaders = Buffer.concat(this.headerChunks, this.headerBytes); + this.headerChunks = null; + this.emit("headers", this.parseHeaders()); + if (data2.length - 1 > headerPos) { + let chunk = data2.slice(headerPos); + this.bodySize += chunk.length; + setImmediate(() => this.push(chunk)); + } + return false; + } else { + this.headerBytes += data2.length; + this.headerChunks.push(data2); + } + this.updateLastBytes(data2); + return false; + } + _transform(chunk, encoding, callback) { + if (!chunk || !chunk.length) { + return callback(); + } + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, encoding); + } + let headersFound; + try { + headersFound = this.checkHeaders(chunk); + } catch (E2) { + return callback(E2); + } + if (headersFound) { + this.bodySize += chunk.length; + this.push(chunk); + } + setImmediate(callback); + } + _flush(callback) { + if (this.headerChunks) { + let chunk = Buffer.concat(this.headerChunks, this.headerBytes); + this.bodySize += chunk.length; + this.push(chunk); + this.headerChunks = null; + } + callback(); + } + parseHeaders() { + let lines = (this.rawHeaders || "").toString().split(/\r?\n/); + for (let i4 = lines.length - 1; i4 > 0; i4--) { + if (/^\s/.test(lines[i4])) { + lines[i4 - 1] += "\n" + lines[i4]; + lines.splice(i4, 1); + } + } + return lines.filter((line) => line.trim()).map((line) => ({ + key: line.substr(0, line.indexOf(":")).trim().toLowerCase(), + line + })); + } + }; + module2.exports = MessageParser; + } +}); + +// node_modules/nodemailer/lib/dkim/relaxed-body.js +var require_relaxed_body = __commonJS({ + "node_modules/nodemailer/lib/dkim/relaxed-body.js"(exports2, module2) { + "use strict"; + var Transform = require("stream").Transform; + var crypto2 = require("crypto"); + var RelaxedBody = class extends Transform { + constructor(options) { + super(); + options = options || {}; + this.chunkBuffer = []; + this.chunkBufferLen = 0; + this.bodyHash = crypto2.createHash(options.hashAlgo || "sha1"); + this.remainder = ""; + this.byteLength = 0; + this.debug = options.debug; + this._debugBody = options.debug ? [] : false; + } + updateHash(chunk) { + let bodyStr; + let nextRemainder = ""; + let state2 = "file"; + for (let i4 = chunk.length - 1; i4 >= 0; i4--) { + let c4 = chunk[i4]; + if (state2 === "file" && (c4 === 10 || c4 === 13)) { + } else if (state2 === "file" && (c4 === 9 || c4 === 32)) { + state2 = "line"; + } else if (state2 === "line" && (c4 === 9 || c4 === 32)) { + } else if (state2 === "file" || state2 === "line") { + state2 = "body"; + if (i4 === chunk.length - 1) { + break; + } + } + if (i4 === 0) { + if (state2 === "file" && (!this.remainder || /[\r\n]$/.test(this.remainder)) || state2 === "line" && (!this.remainder || /[ \t]$/.test(this.remainder))) { + this.remainder += chunk.toString("binary"); + return; + } else if (state2 === "line" || state2 === "file") { + nextRemainder = chunk.toString("binary"); + chunk = false; + break; + } + } + if (state2 !== "body") { + continue; + } + nextRemainder = chunk.slice(i4 + 1).toString("binary"); + chunk = chunk.slice(0, i4 + 1); + break; + } + let needsFixing = !!this.remainder; + if (chunk && !needsFixing) { + for (let i4 = 0, len = chunk.length; i4 < len; i4++) { + if (i4 && chunk[i4] === 10 && chunk[i4 - 1] !== 13) { + needsFixing = true; + break; + } else if (i4 && chunk[i4] === 13 && chunk[i4 - 1] === 32) { + needsFixing = true; + break; + } else if (i4 && chunk[i4] === 32 && chunk[i4 - 1] === 32) { + needsFixing = true; + break; + } else if (chunk[i4] === 9) { + needsFixing = true; + break; + } + } + } + if (needsFixing) { + bodyStr = this.remainder + (chunk ? chunk.toString("binary") : ""); + this.remainder = nextRemainder; + bodyStr = bodyStr.replace(/\r?\n/g, "\n").replace(/[ \t]*$/gm, "").replace(/[ \t]+/gm, " ").replace(/\n/g, "\r\n"); + chunk = Buffer.from(bodyStr, "binary"); + } else if (nextRemainder) { + this.remainder = nextRemainder; + } + if (this.debug) { + this._debugBody.push(chunk); + } + this.bodyHash.update(chunk); + } + _transform(chunk, encoding, callback) { + if (!chunk || !chunk.length) { + return callback(); + } + if (typeof chunk === "string") { + chunk = Buffer.from(chunk, encoding); + } + this.updateHash(chunk); + this.byteLength += chunk.length; + this.push(chunk); + callback(); + } + _flush(callback) { + if (/[\r\n]$/.test(this.remainder) && this.byteLength > 2) { + this.bodyHash.update(Buffer.from("\r\n")); + } + if (!this.byteLength) { + this.push(Buffer.from("\r\n")); + } + this.emit("hash", this.bodyHash.digest("base64"), this.debug ? Buffer.concat(this._debugBody) : false); + callback(); + } + }; + module2.exports = RelaxedBody; + } +}); + +// node_modules/nodemailer/lib/dkim/sign.js +var require_sign2 = __commonJS({ + "node_modules/nodemailer/lib/dkim/sign.js"(exports2, module2) { + "use strict"; + var punycode = require_punycode2(); + var mimeFuncs = require_mime_funcs(); + var crypto2 = require("crypto"); + module2.exports = (headers, hashAlgo, bodyHash, options) => { + options = options || {}; + let defaultFieldNames = "From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive"; + let fieldNames = options.headerFieldNames || defaultFieldNames; + let canonicalizedHeaderData = relaxedHeaders(headers, fieldNames, options.skipFields); + let dkimHeader = generateDKIMHeader(options.domainName, options.keySelector, canonicalizedHeaderData.fieldNames, hashAlgo, bodyHash); + let signer, signature; + canonicalizedHeaderData.headers += "dkim-signature:" + relaxedHeaderLine(dkimHeader); + signer = crypto2.createSign(("rsa-" + hashAlgo).toUpperCase()); + signer.update(canonicalizedHeaderData.headers); + try { + signature = signer.sign(options.privateKey, "base64"); + } catch (_E2) { + return false; + } + return dkimHeader + signature.replace(/(^.{73}|.{75}(?!\r?\n|\r))/g, "$&\r\n ").trim(); + }; + module2.exports.relaxedHeaders = relaxedHeaders; + function generateDKIMHeader(domainName, keySelector, fieldNames, hashAlgo, bodyHash) { + let dkim = [ + "v=1", + "a=rsa-" + hashAlgo, + "c=relaxed/relaxed", + "d=" + punycode.toASCII(domainName), + "q=dns/txt", + "s=" + keySelector, + "bh=" + bodyHash, + "h=" + fieldNames + ].join("; "); + return mimeFuncs.foldLines("DKIM-Signature: " + dkim, 76) + ";\r\n b="; + } + function relaxedHeaders(headers, fieldNames, skipFields) { + let includedFields = /* @__PURE__ */ new Set(); + let skip = /* @__PURE__ */ new Set(); + let headerFields = /* @__PURE__ */ new Map(); + (skipFields || "").toLowerCase().split(":").forEach((field) => { + skip.add(field.trim()); + }); + (fieldNames || "").toLowerCase().split(":").filter((field) => !skip.has(field.trim())).forEach((field) => { + includedFields.add(field.trim()); + }); + for (let i4 = headers.length - 1; i4 >= 0; i4--) { + let line = headers[i4]; + if (includedFields.has(line.key) && !headerFields.has(line.key)) { + headerFields.set(line.key, relaxedHeaderLine(line.line)); + } + } + let headersList = []; + let fields = []; + includedFields.forEach((field) => { + if (headerFields.has(field)) { + fields.push(field); + headersList.push(field + ":" + headerFields.get(field)); + } + }); + return { + headers: headersList.join("\r\n") + "\r\n", + fieldNames: fields.join(":") + }; + } + function relaxedHeaderLine(line) { + return line.substr(line.indexOf(":") + 1).replace(/\r?\n/g, "").replace(/\s+/g, " ").trim(); + } + } +}); + +// node_modules/nodemailer/lib/dkim/index.js +var require_dkim = __commonJS({ + "node_modules/nodemailer/lib/dkim/index.js"(exports2, module2) { + "use strict"; + var MessageParser = require_message_parser(); + var RelaxedBody = require_relaxed_body(); + var sign = require_sign2(); + var PassThrough = require("stream").PassThrough; + var fs = require("fs"); + var path = require("path"); + var crypto2 = require("crypto"); + var DKIM_ALGO = "sha256"; + var MAX_MESSAGE_SIZE = 2 * 1024 * 1024; + var DKIMSigner = class { + constructor(options, keys, input, output) { + this.options = options || {}; + this.keys = keys; + this.cacheTreshold = Number(this.options.cacheTreshold) || MAX_MESSAGE_SIZE; + this.hashAlgo = this.options.hashAlgo || DKIM_ALGO; + this.cacheDir = this.options.cacheDir || false; + this.chunks = []; + this.chunklen = 0; + this.readPos = 0; + this.cachePath = this.cacheDir ? path.join(this.cacheDir, "message." + Date.now() + "-" + crypto2.randomBytes(14).toString("hex")) : false; + this.cache = false; + this.headers = false; + this.bodyHash = false; + this.parser = false; + this.relaxedBody = false; + this.input = input; + this.output = output; + this.output.usingCache = false; + this.hasErrored = false; + this.input.on("error", (err) => { + this.hasErrored = true; + this.cleanup(); + output.emit("error", err); + }); + } + cleanup() { + if (!this.cache || !this.cachePath) { + return; + } + fs.unlink(this.cachePath, () => false); + } + createReadCache() { + this.cache = fs.createReadStream(this.cachePath); + this.cache.once("error", (err) => { + this.cleanup(); + this.output.emit("error", err); + }); + this.cache.once("close", () => { + this.cleanup(); + }); + this.cache.pipe(this.output); + } + sendNextChunk() { + if (this.hasErrored) { + return; + } + if (this.readPos >= this.chunks.length) { + if (!this.cache) { + return this.output.end(); + } + return this.createReadCache(); + } + let chunk = this.chunks[this.readPos++]; + if (this.output.write(chunk) === false) { + return this.output.once("drain", () => { + this.sendNextChunk(); + }); + } + setImmediate(() => this.sendNextChunk()); + } + sendSignedOutput() { + let keyPos = 0; + let signNextKey = () => { + if (keyPos >= this.keys.length) { + this.output.write(this.parser.rawHeaders); + return setImmediate(() => this.sendNextChunk()); + } + let key = this.keys[keyPos++]; + let dkimField = sign(this.headers, this.hashAlgo, this.bodyHash, { + domainName: key.domainName, + keySelector: key.keySelector, + privateKey: key.privateKey, + headerFieldNames: this.options.headerFieldNames, + skipFields: this.options.skipFields + }); + if (dkimField) { + this.output.write(Buffer.from(dkimField + "\r\n")); + } + return setImmediate(signNextKey); + }; + if (this.bodyHash && this.headers) { + return signNextKey(); + } + this.output.write(this.parser.rawHeaders); + this.sendNextChunk(); + } + createWriteCache() { + this.output.usingCache = true; + this.cache = fs.createWriteStream(this.cachePath); + this.cache.once("error", (err) => { + this.cleanup(); + this.relaxedBody.unpipe(this.cache); + this.relaxedBody.on("readable", () => { + while (this.relaxedBody.read() !== null) { + } + }); + this.hasErrored = true; + this.output.emit("error", err); + }); + this.cache.once("close", () => { + this.sendSignedOutput(); + }); + this.relaxedBody.removeAllListeners("readable"); + this.relaxedBody.pipe(this.cache); + } + signStream() { + this.parser = new MessageParser(); + this.relaxedBody = new RelaxedBody({ + hashAlgo: this.hashAlgo + }); + this.parser.on("headers", (value) => { + this.headers = value; + }); + this.relaxedBody.on("hash", (value) => { + this.bodyHash = value; + }); + this.relaxedBody.on("readable", () => { + let chunk; + if (this.cache) { + return; + } + while ((chunk = this.relaxedBody.read()) !== null) { + this.chunks.push(chunk); + this.chunklen += chunk.length; + if (this.chunklen >= this.cacheTreshold && this.cachePath) { + return this.createWriteCache(); + } + } + }); + this.relaxedBody.on("end", () => { + if (this.cache) { + return; + } + this.sendSignedOutput(); + }); + this.parser.pipe(this.relaxedBody); + setImmediate(() => this.input.pipe(this.parser)); + } + }; + var DKIM = class { + constructor(options) { + this.options = options || {}; + this.keys = [].concat( + this.options.keys || { + domainName: options.domainName, + keySelector: options.keySelector, + privateKey: options.privateKey + } + ); + } + sign(input, extraOptions) { + let output = new PassThrough(); + let inputStream = input; + let writeValue = false; + if (Buffer.isBuffer(input)) { + writeValue = input; + inputStream = new PassThrough(); + } else if (typeof input === "string") { + writeValue = Buffer.from(input); + inputStream = new PassThrough(); + } + let options = this.options; + if (extraOptions && Object.keys(extraOptions).length) { + options = {}; + Object.keys(this.options || {}).forEach((key) => { + options[key] = this.options[key]; + }); + Object.keys(extraOptions || {}).forEach((key) => { + if (!(key in options)) { + options[key] = extraOptions[key]; + } + }); + } + let signer = new DKIMSigner(options, this.keys, inputStream, output); + setImmediate(() => { + signer.signStream(); + if (writeValue) { + setImmediate(() => { + inputStream.end(writeValue); + }); + } + }); + return output; + } + }; + module2.exports = DKIM; + } +}); + +// node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +var require_http_proxy_client = __commonJS({ + "node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js"(exports2, module2) { + "use strict"; + var net = require("net"); + var tls = require("tls"); + var urllib = require("url"); + function httpProxyClient(proxyUrl, destinationPort, destinationHost, callback) { + let proxy = urllib.parse(proxyUrl); + let options; + let connect; + let socket; + options = { + host: proxy.hostname, + port: Number(proxy.port) ? Number(proxy.port) : proxy.protocol === "https:" ? 443 : 80 + }; + if (proxy.protocol === "https:") { + options.rejectUnauthorized = false; + connect = tls.connect.bind(tls); + } else { + connect = net.connect.bind(net); + } + let finished = false; + let tempSocketErr = (err) => { + if (finished) { + return; + } + finished = true; + try { + socket.destroy(); + } catch (_E2) { + } + callback(err); + }; + let timeoutErr = () => { + let err = new Error("Proxy socket timed out"); + err.code = "ETIMEDOUT"; + tempSocketErr(err); + }; + socket = connect(options, () => { + if (finished) { + return; + } + let reqHeaders = { + Host: destinationHost + ":" + destinationPort, + Connection: "close" + }; + if (proxy.auth) { + reqHeaders["Proxy-Authorization"] = "Basic " + Buffer.from(proxy.auth).toString("base64"); + } + socket.write( + // HTTP method + "CONNECT " + destinationHost + ":" + destinationPort + " HTTP/1.1\r\n" + // HTTP request headers + Object.keys(reqHeaders).map((key) => key + ": " + reqHeaders[key]).join("\r\n") + // End request + "\r\n\r\n" + ); + let headers = ""; + let onSocketData = (chunk) => { + let match; + let remainder; + if (finished) { + return; + } + headers += chunk.toString("binary"); + if (match = headers.match(/\r\n\r\n/)) { + socket.removeListener("data", onSocketData); + remainder = headers.substr(match.index + match[0].length); + headers = headers.substr(0, match.index); + if (remainder) { + socket.unshift(Buffer.from(remainder, "binary")); + } + finished = true; + match = headers.match(/^HTTP\/\d+\.\d+ (\d+)/i); + if (!match || (match[1] || "").charAt(0) !== "2") { + try { + socket.destroy(); + } catch (_E2) { + } + return callback(new Error("Invalid response from proxy" + (match && ": " + match[1] || ""))); + } + socket.removeListener("error", tempSocketErr); + socket.removeListener("timeout", timeoutErr); + socket.setTimeout(0); + return callback(null, socket); + } + }; + socket.on("data", onSocketData); + }); + socket.setTimeout(httpProxyClient.timeout || 30 * 1e3); + socket.on("timeout", timeoutErr); + socket.once("error", tempSocketErr); + } + module2.exports = httpProxyClient; + } +}); + +// node_modules/nodemailer/lib/mailer/mail-message.js +var require_mail_message = __commonJS({ + "node_modules/nodemailer/lib/mailer/mail-message.js"(exports2, module2) { + "use strict"; + var shared = require_shared2(); + var MimeNode = require_mime_node(); + var mimeFuncs = require_mime_funcs(); + var MailMessage = class { + constructor(mailer, data2) { + this.mailer = mailer; + this.data = {}; + this.message = null; + data2 = data2 || {}; + let options = mailer.options || {}; + let defaults = mailer._defaults || {}; + Object.keys(data2).forEach((key) => { + this.data[key] = data2[key]; + }); + this.data.headers = this.data.headers || {}; + Object.keys(defaults).forEach((key) => { + if (!(key in this.data)) { + this.data[key] = defaults[key]; + } else if (key === "headers") { + Object.keys(defaults.headers).forEach((key2) => { + if (!(key2 in this.data.headers)) { + this.data.headers[key2] = defaults.headers[key2]; + } + }); + } + }); + ["disableFileAccess", "disableUrlAccess", "normalizeHeaderKey"].forEach((key) => { + if (key in options) { + this.data[key] = options[key]; + } + }); + } + resolveContent(...args2) { + return shared.resolveContent(...args2); + } + resolveAll(callback) { + let keys = [ + [this.data, "html"], + [this.data, "text"], + [this.data, "watchHtml"], + [this.data, "amp"], + [this.data, "icalEvent"] + ]; + if (this.data.alternatives && this.data.alternatives.length) { + this.data.alternatives.forEach((alternative, i4) => { + keys.push([this.data.alternatives, i4]); + }); + } + if (this.data.attachments && this.data.attachments.length) { + this.data.attachments.forEach((attachment, i4) => { + if (!attachment.filename) { + attachment.filename = (attachment.path || attachment.href || "").split("/").pop().split("?").shift() || "attachment-" + (i4 + 1); + if (attachment.filename.indexOf(".") < 0) { + attachment.filename += "." + mimeFuncs.detectExtension(attachment.contentType); + } + } + if (!attachment.contentType) { + attachment.contentType = mimeFuncs.detectMimeType(attachment.filename || attachment.path || attachment.href || "bin"); + } + keys.push([this.data.attachments, i4]); + }); + } + let mimeNode = new MimeNode(); + let addressKeys = ["from", "to", "cc", "bcc", "sender", "replyTo"]; + addressKeys.forEach((address) => { + let value; + if (this.message) { + value = [].concat(mimeNode._parseAddresses(this.message.getHeader(address === "replyTo" ? "reply-to" : address)) || []); + } else if (this.data[address]) { + value = [].concat(mimeNode._parseAddresses(this.data[address]) || []); + } + if (value && value.length) { + this.data[address] = value; + } else if (address in this.data) { + this.data[address] = null; + } + }); + let singleKeys = ["from", "sender"]; + singleKeys.forEach((address) => { + if (this.data[address]) { + this.data[address] = this.data[address].shift(); + } + }); + let pos = 0; + let resolveNext = () => { + if (pos >= keys.length) { + return callback(null, this.data); + } + let args2 = keys[pos++]; + if (!args2[0] || !args2[0][args2[1]]) { + return resolveNext(); + } + shared.resolveContent(...args2, (err, value) => { + if (err) { + return callback(err); + } + let node = { + content: value + }; + if (args2[0][args2[1]] && typeof args2[0][args2[1]] === "object" && !Buffer.isBuffer(args2[0][args2[1]])) { + Object.keys(args2[0][args2[1]]).forEach((key) => { + if (!(key in node) && !["content", "path", "href", "raw"].includes(key)) { + node[key] = args2[0][args2[1]][key]; + } + }); + } + args2[0][args2[1]] = node; + resolveNext(); + }); + }; + setImmediate(() => resolveNext()); + } + normalize(callback) { + let envelope = this.data.envelope || this.message.getEnvelope(); + let messageId = this.message.messageId(); + this.resolveAll((err, data2) => { + if (err) { + return callback(err); + } + data2.envelope = envelope; + data2.messageId = messageId; + ["html", "text", "watchHtml", "amp"].forEach((key) => { + if (data2[key] && data2[key].content) { + if (typeof data2[key].content === "string") { + data2[key] = data2[key].content; + } else if (Buffer.isBuffer(data2[key].content)) { + data2[key] = data2[key].content.toString(); + } + } + }); + if (data2.icalEvent && Buffer.isBuffer(data2.icalEvent.content)) { + data2.icalEvent.content = data2.icalEvent.content.toString("base64"); + data2.icalEvent.encoding = "base64"; + } + if (data2.alternatives && data2.alternatives.length) { + data2.alternatives.forEach((alternative) => { + if (alternative && alternative.content && Buffer.isBuffer(alternative.content)) { + alternative.content = alternative.content.toString("base64"); + alternative.encoding = "base64"; + } + }); + } + if (data2.attachments && data2.attachments.length) { + data2.attachments.forEach((attachment) => { + if (attachment && attachment.content && Buffer.isBuffer(attachment.content)) { + attachment.content = attachment.content.toString("base64"); + attachment.encoding = "base64"; + } + }); + } + data2.normalizedHeaders = {}; + Object.keys(data2.headers || {}).forEach((key) => { + let value = [].concat(data2.headers[key] || []).shift(); + value = value && value.value || value; + if (value) { + if (["references", "in-reply-to", "message-id", "content-id"].includes(key)) { + value = this.message._encodeHeaderValue(key, value); + } + data2.normalizedHeaders[key] = value; + } + }); + if (data2.list && typeof data2.list === "object") { + let listHeaders = this._getListHeaders(data2.list); + listHeaders.forEach((entry) => { + data2.normalizedHeaders[entry.key] = entry.value.map((val) => val && val.value || val).join(", "); + }); + } + if (data2.references) { + data2.normalizedHeaders.references = this.message._encodeHeaderValue("references", data2.references); + } + if (data2.inReplyTo) { + data2.normalizedHeaders["in-reply-to"] = this.message._encodeHeaderValue("in-reply-to", data2.inReplyTo); + } + return callback(null, data2); + }); + } + setMailerHeader() { + if (!this.message || !this.data.xMailer) { + return; + } + this.message.setHeader("X-Mailer", this.data.xMailer); + } + setPriorityHeaders() { + if (!this.message || !this.data.priority) { + return; + } + switch ((this.data.priority || "").toString().toLowerCase()) { + case "high": + this.message.setHeader("X-Priority", "1 (Highest)"); + this.message.setHeader("X-MSMail-Priority", "High"); + this.message.setHeader("Importance", "High"); + break; + case "low": + this.message.setHeader("X-Priority", "5 (Lowest)"); + this.message.setHeader("X-MSMail-Priority", "Low"); + this.message.setHeader("Importance", "Low"); + break; + default: + } + } + setListHeaders() { + if (!this.message || !this.data.list || typeof this.data.list !== "object") { + return; + } + if (this.data.list && typeof this.data.list === "object") { + this._getListHeaders(this.data.list).forEach((listHeader) => { + listHeader.value.forEach((value) => { + this.message.addHeader(listHeader.key, value); + }); + }); + } + } + _getListHeaders(listData) { + return Object.keys(listData).map((key) => ({ + key: "list-" + key.toLowerCase().trim(), + value: [].concat(listData[key] || []).map((value) => ({ + prepared: true, + foldLines: true, + value: [].concat(value || []).map((value2) => { + if (typeof value2 === "string") { + value2 = { + url: value2 + }; + } + if (value2 && value2.url) { + if (key.toLowerCase().trim() === "id") { + let comment2 = value2.comment || ""; + if (mimeFuncs.isPlainText(comment2)) { + comment2 = '"' + comment2 + '"'; + } else { + comment2 = mimeFuncs.encodeWord(comment2); + } + return (value2.comment ? comment2 + " " : "") + this._formatListUrl(value2.url).replace(/^<[^:]+\/{,2}/, ""); + } + let comment = value2.comment || ""; + if (!mimeFuncs.isPlainText(comment)) { + comment = mimeFuncs.encodeWord(comment); + } + return this._formatListUrl(value2.url) + (value2.comment ? " (" + comment + ")" : ""); + } + return ""; + }).filter((value2) => value2).join(", ") + })) + })); + } + _formatListUrl(url) { + url = url.replace(/[\s<]+|[\s>]+/g, ""); + if (/^(https?|mailto|ftp):/.test(url)) { + return "<" + url + ">"; + } + if (/^[^@]+@[^@]+$/.test(url)) { + return ""; + } + return ""; + } + }; + module2.exports = MailMessage; + } +}); + +// node_modules/nodemailer/lib/mailer/index.js +var require_mailer = __commonJS({ + "node_modules/nodemailer/lib/mailer/index.js"(exports2, module2) { + "use strict"; + var EventEmitter = require("events"); + var shared = require_shared2(); + var mimeTypes = require_mime_types2(); + var MailComposer = require_mail_composer(); + var DKIM = require_dkim(); + var httpProxyClient = require_http_proxy_client(); + var util = require("util"); + var urllib = require("url"); + var packageData = require_package4(); + var MailMessage = require_mail_message(); + var net = require("net"); + var dns = require("dns"); + var crypto2 = require("crypto"); + var Mail = class extends EventEmitter { + constructor(transporter, options, defaults) { + super(); + this.options = options || {}; + this._defaults = defaults || {}; + this._defaultPlugins = { + compile: [(...args2) => this._convertDataImages(...args2)], + stream: [] + }; + this._userPlugins = { + compile: [], + stream: [] + }; + this.meta = /* @__PURE__ */ new Map(); + this.dkim = this.options.dkim ? new DKIM(this.options.dkim) : false; + this.transporter = transporter; + this.transporter.mailer = this; + this.logger = shared.getLogger(this.options, { + component: this.options.component || "mail" + }); + this.logger.debug( + { + tnx: "create" + }, + "Creating transport: %s", + this.getVersionString() + ); + if (typeof this.transporter.on === "function") { + this.transporter.on("log", (log2) => { + this.logger.debug( + { + tnx: "transport" + }, + "%s: %s", + log2.type, + log2.message + ); + }); + this.transporter.on("error", (err) => { + this.logger.error( + { + err, + tnx: "transport" + }, + "Transport Error: %s", + err.message + ); + this.emit("error", err); + }); + this.transporter.on("idle", (...args2) => { + this.emit("idle", ...args2); + }); + this.transporter.on("clear", (...args2) => { + this.emit("clear", ...args2); + }); + } + ["close", "isIdle", "verify"].forEach((method) => { + this[method] = (...args2) => { + if (typeof this.transporter[method] === "function") { + if (method === "verify" && typeof this.getSocket === "function") { + this.transporter.getSocket = this.getSocket; + this.getSocket = false; + } + return this.transporter[method](...args2); + } else { + this.logger.warn( + { + tnx: "transport", + methodName: method + }, + "Non existing method %s called for transport", + method + ); + return false; + } + }; + }); + if (this.options.proxy && typeof this.options.proxy === "string") { + this.setupProxy(this.options.proxy); + } + } + use(step, plugin) { + step = (step || "").toString(); + if (!this._userPlugins.hasOwnProperty(step)) { + this._userPlugins[step] = [plugin]; + } else { + this._userPlugins[step].push(plugin); + } + return this; + } + /** + * Sends an email using the preselected transport object + * + * @param {Object} data E-data description + * @param {Function?} callback Callback to run once the sending succeeded or failed + */ + sendMail(data2, callback = null) { + let promise; + if (!callback) { + promise = new Promise((resolve, reject) => { + callback = shared.callbackPromise(resolve, reject); + }); + } + if (typeof this.getSocket === "function") { + this.transporter.getSocket = this.getSocket; + this.getSocket = false; + } + let mail = new MailMessage(this, data2); + this.logger.debug( + { + tnx: "transport", + name: this.transporter.name, + version: this.transporter.version, + action: "send" + }, + "Sending mail using %s/%s", + this.transporter.name, + this.transporter.version + ); + this._processPlugins("compile", mail, (err) => { + if (err) { + this.logger.error( + { + err, + tnx: "plugin", + action: "compile" + }, + "PluginCompile Error: %s", + err.message + ); + return callback(err); + } + mail.message = new MailComposer(mail.data).compile(); + mail.setMailerHeader(); + mail.setPriorityHeaders(); + mail.setListHeaders(); + this._processPlugins("stream", mail, (err2) => { + if (err2) { + this.logger.error( + { + err: err2, + tnx: "plugin", + action: "stream" + }, + "PluginStream Error: %s", + err2.message + ); + return callback(err2); + } + if (mail.data.dkim || this.dkim) { + mail.message.processFunc((input) => { + let dkim = mail.data.dkim ? new DKIM(mail.data.dkim) : this.dkim; + this.logger.debug( + { + tnx: "DKIM", + messageId: mail.message.messageId(), + dkimDomains: dkim.keys.map((key) => key.keySelector + "." + key.domainName).join(", ") + }, + "Signing outgoing message with %s keys", + dkim.keys.length + ); + return dkim.sign(input, mail.data._dkim); + }); + } + this.transporter.send(mail, (...args2) => { + if (args2[0]) { + this.logger.error( + { + err: args2[0], + tnx: "transport", + action: "send" + }, + "Send Error: %s", + args2[0].message + ); + } + callback(...args2); + }); + }); + }); + return promise; + } + getVersionString() { + return util.format( + "%s (%s; +%s; %s/%s)", + packageData.name, + packageData.version, + packageData.homepage, + this.transporter.name, + this.transporter.version + ); + } + _processPlugins(step, mail, callback) { + step = (step || "").toString(); + if (!this._userPlugins.hasOwnProperty(step)) { + return callback(); + } + let userPlugins = this._userPlugins[step] || []; + let defaultPlugins = this._defaultPlugins[step] || []; + if (userPlugins.length) { + this.logger.debug( + { + tnx: "transaction", + pluginCount: userPlugins.length, + step + }, + "Using %s plugins for %s", + userPlugins.length, + step + ); + } + if (userPlugins.length + defaultPlugins.length === 0) { + return callback(); + } + let pos = 0; + let block = "default"; + let processPlugins = () => { + let curplugins = block === "default" ? defaultPlugins : userPlugins; + if (pos >= curplugins.length) { + if (block === "default" && userPlugins.length) { + block = "user"; + pos = 0; + curplugins = userPlugins; + } else { + return callback(); + } + } + let plugin = curplugins[pos++]; + plugin(mail, (err) => { + if (err) { + return callback(err); + } + processPlugins(); + }); + }; + processPlugins(); + } + /** + * Sets up proxy handler for a Nodemailer object + * + * @param {String} proxyUrl Proxy configuration url + */ + setupProxy(proxyUrl) { + let proxy = urllib.parse(proxyUrl); + this.getSocket = (options, callback) => { + let protocol = proxy.protocol.replace(/:$/, "").toLowerCase(); + if (this.meta.has("proxy_handler_" + protocol)) { + return this.meta.get("proxy_handler_" + protocol)(proxy, options, callback); + } + switch (protocol) { + // Connect using a HTTP CONNECT method + case "http": + case "https": + httpProxyClient(proxy.href, options.port, options.host, (err, socket) => { + if (err) { + return callback(err); + } + return callback(null, { + connection: socket + }); + }); + return; + case "socks": + case "socks5": + case "socks4": + case "socks4a": { + if (!this.meta.has("proxy_socks_module")) { + return callback(new Error("Socks module not loaded")); + } + let connect = (ipaddress) => { + let proxyV2 = !!this.meta.get("proxy_socks_module").SocksClient; + let socksClient = proxyV2 ? this.meta.get("proxy_socks_module").SocksClient : this.meta.get("proxy_socks_module"); + let proxyType = Number(proxy.protocol.replace(/\D/g, "")) || 5; + let connectionOpts = { + proxy: { + ipaddress, + port: Number(proxy.port), + type: proxyType + }, + [proxyV2 ? "destination" : "target"]: { + host: options.host, + port: options.port + }, + command: "connect" + }; + if (proxy.auth) { + let username = decodeURIComponent(proxy.auth.split(":").shift()); + let password = decodeURIComponent(proxy.auth.split(":").pop()); + if (proxyV2) { + connectionOpts.proxy.userId = username; + connectionOpts.proxy.password = password; + } else if (proxyType === 4) { + connectionOpts.userid = username; + } else { + connectionOpts.authentication = { + username, + password + }; + } + } + socksClient.createConnection(connectionOpts, (err, info) => { + if (err) { + return callback(err); + } + return callback(null, { + connection: info.socket || info + }); + }); + }; + if (net.isIP(proxy.hostname)) { + return connect(proxy.hostname); + } + return dns.resolve(proxy.hostname, (err, address) => { + if (err) { + return callback(err); + } + connect(Array.isArray(address) ? address[0] : address); + }); + } + } + callback(new Error("Unknown proxy configuration")); + }; + } + _convertDataImages(mail, callback) { + if (!this.options.attachDataUrls && !mail.data.attachDataUrls || !mail.data.html) { + return callback(); + } + mail.resolveContent(mail.data, "html", (err, html) => { + if (err) { + return callback(err); + } + let cidCounter = 0; + html = (html || "").toString().replace(/(]{0,1024} src\s{0,20}=[\s"']{0,20})(data:([^;]+);[^"'>\s]+)/gi, (match, prefix, dataUri, mimeType) => { + let cid = crypto2.randomBytes(10).toString("hex") + "@localhost"; + if (!mail.data.attachments) { + mail.data.attachments = []; + } + if (!Array.isArray(mail.data.attachments)) { + mail.data.attachments = [].concat(mail.data.attachments || []); + } + mail.data.attachments.push({ + path: dataUri, + cid, + filename: "image-" + ++cidCounter + "." + mimeTypes.detectExtension(mimeType) + }); + return prefix + "cid:" + cid; + }); + mail.data.html = html; + callback(); + }); + } + set(key, value) { + return this.meta.set(key, value); + } + get(key) { + return this.meta.get(key); + } + }; + module2.exports = Mail; + } +}); + +// node_modules/nodemailer/lib/smtp-connection/data-stream.js +var require_data_stream2 = __commonJS({ + "node_modules/nodemailer/lib/smtp-connection/data-stream.js"(exports2, module2) { + "use strict"; + var stream = require("stream"); + var Transform = stream.Transform; + var DataStream = class extends Transform { + constructor(options) { + super(options); + this.options = options || {}; + this._curLine = ""; + this.inByteCount = 0; + this.outByteCount = 0; + this.lastByte = false; + } + /** + * Escapes dots + */ + _transform(chunk, encoding, done) { + let chunks = []; + let chunklen = 0; + let i4, len, lastPos = 0; + let buf; + if (!chunk || !chunk.length) { + return done(); + } + if (typeof chunk === "string") { + chunk = Buffer.from(chunk); + } + this.inByteCount += chunk.length; + for (i4 = 0, len = chunk.length; i4 < len; i4++) { + if (chunk[i4] === 46) { + if (i4 && chunk[i4 - 1] === 10 || !i4 && (!this.lastByte || this.lastByte === 10)) { + buf = chunk.slice(lastPos, i4 + 1); + chunks.push(buf); + chunks.push(Buffer.from(".")); + chunklen += buf.length + 1; + lastPos = i4 + 1; + } + } else if (chunk[i4] === 10) { + if (i4 && chunk[i4 - 1] !== 13 || !i4 && this.lastByte !== 13) { + if (i4 > lastPos) { + buf = chunk.slice(lastPos, i4); + chunks.push(buf); + chunklen += buf.length + 2; + } else { + chunklen += 2; + } + chunks.push(Buffer.from("\r\n")); + lastPos = i4 + 1; + } + } + } + if (chunklen) { + if (lastPos < chunk.length) { + buf = chunk.slice(lastPos); + chunks.push(buf); + chunklen += buf.length; + } + this.outByteCount += chunklen; + this.push(Buffer.concat(chunks, chunklen)); + } else { + this.outByteCount += chunk.length; + this.push(chunk); + } + this.lastByte = chunk[chunk.length - 1]; + done(); + } + /** + * Finalizes the stream with a dot on a single line + */ + _flush(done) { + let buf; + if (this.lastByte === 10) { + buf = Buffer.from(".\r\n"); + } else if (this.lastByte === 13) { + buf = Buffer.from("\n.\r\n"); + } else { + buf = Buffer.from("\r\n.\r\n"); + } + this.outByteCount += buf.length; + this.push(buf); + done(); + } + }; + module2.exports = DataStream; + } +}); + +// node_modules/nodemailer/lib/smtp-connection/index.js +var require_smtp_connection = __commonJS({ + "node_modules/nodemailer/lib/smtp-connection/index.js"(exports2, module2) { + "use strict"; + var packageInfo = require_package4(); + var EventEmitter = require("events").EventEmitter; + var net = require("net"); + var tls = require("tls"); + var os = require("os"); + var crypto2 = require("crypto"); + var DataStream = require_data_stream2(); + var PassThrough = require("stream").PassThrough; + var shared = require_shared2(); + var CONNECTION_TIMEOUT = 2 * 60 * 1e3; + var SOCKET_TIMEOUT = 10 * 60 * 1e3; + var GREETING_TIMEOUT = 30 * 1e3; + var DNS_TIMEOUT = 30 * 1e3; + var SMTPConnection = class extends EventEmitter { + constructor(options) { + super(options); + this.id = crypto2.randomBytes(8).toString("base64").replace(/\W/g, ""); + this.stage = "init"; + this.options = options || {}; + this.secureConnection = !!this.options.secure; + this.alreadySecured = !!this.options.secured; + this.port = Number(this.options.port) || (this.secureConnection ? 465 : 587); + this.host = this.options.host || "localhost"; + this.servername = this.options.servername ? this.options.servername : !net.isIP(this.host) ? this.host : false; + this.allowInternalNetworkInterfaces = this.options.allowInternalNetworkInterfaces || false; + if (typeof this.options.secure === "undefined" && this.port === 465) { + this.secureConnection = true; + } + this.name = this.options.name || this._getHostname(); + this.logger = shared.getLogger(this.options, { + component: this.options.component || "smtp-connection", + sid: this.id + }); + this.customAuth = /* @__PURE__ */ new Map(); + Object.keys(this.options.customAuth || {}).forEach((key) => { + let mapKey = (key || "").toString().trim().toUpperCase(); + if (!mapKey) { + return; + } + this.customAuth.set(mapKey, this.options.customAuth[key]); + }); + this.version = packageInfo.version; + this.authenticated = false; + this.destroyed = false; + this.secure = !!this.secureConnection; + this._remainder = ""; + this._responseQueue = []; + this.lastServerResponse = false; + this._socket = false; + this._supportedAuth = []; + this.allowsAuth = false; + this._envelope = false; + this._supportedExtensions = []; + this._maxAllowedSize = 0; + this._responseActions = []; + this._recipientQueue = []; + this._greetingTimeout = false; + this._connectionTimeout = false; + this._destroyed = false; + this._closing = false; + this._onSocketData = (chunk) => this._onData(chunk); + this._onSocketError = (error2) => this._onError(error2, "ESOCKET", false, "CONN"); + this._onSocketClose = () => this._onClose(); + this._onSocketEnd = () => this._onEnd(); + this._onSocketTimeout = () => this._onTimeout(); + } + /** + * Creates a connection to a SMTP server and sets up connection + * listener + */ + connect(connectCallback) { + if (typeof connectCallback === "function") { + this.once("connect", () => { + this.logger.debug( + { + tnx: "smtp" + }, + "SMTP handshake finished" + ); + connectCallback(); + }); + const isDestroyedMessage = this._isDestroyedMessage("connect"); + if (isDestroyedMessage) { + return connectCallback(this._formatError(isDestroyedMessage, "ECONNECTION", false, "CONN")); + } + } + let opts = { + port: this.port, + host: this.host, + allowInternalNetworkInterfaces: this.allowInternalNetworkInterfaces, + timeout: this.options.dnsTimeout || DNS_TIMEOUT + }; + if (this.options.localAddress) { + opts.localAddress = this.options.localAddress; + } + let setupConnectionHandlers = () => { + this._connectionTimeout = setTimeout(() => { + this._onError("Connection timeout", "ETIMEDOUT", false, "CONN"); + }, this.options.connectionTimeout || CONNECTION_TIMEOUT); + this._socket.on("error", this._onSocketError); + }; + if (this.options.connection) { + this._socket = this.options.connection; + setupConnectionHandlers(); + if (this.secureConnection && !this.alreadySecured) { + setImmediate( + () => this._upgradeConnection((err) => { + if (err) { + this._onError(new Error("Error initiating TLS - " + (err.message || err)), "ETLS", false, "CONN"); + return; + } + this._onConnect(); + }) + ); + } else { + setImmediate(() => this._onConnect()); + } + return; + } else if (this.options.socket) { + this._socket = this.options.socket; + return shared.resolveHostname(opts, (err, resolved) => { + if (err) { + return setImmediate(() => this._onError(err, "EDNS", false, "CONN")); + } + this.logger.debug( + { + tnx: "dns", + source: opts.host, + resolved: resolved.host, + cached: !!resolved.cached + }, + "Resolved %s as %s [cache %s]", + opts.host, + resolved.host, + resolved.cached ? "hit" : "miss" + ); + Object.keys(resolved).forEach((key) => { + if (key.charAt(0) !== "_" && resolved[key]) { + opts[key] = resolved[key]; + } + }); + try { + this._socket.connect(this.port, this.host, () => { + this._socket.setKeepAlive(true); + this._onConnect(); + }); + setupConnectionHandlers(); + } catch (E2) { + return setImmediate(() => this._onError(E2, "ECONNECTION", false, "CONN")); + } + }); + } else if (this.secureConnection) { + if (this.options.tls) { + Object.keys(this.options.tls).forEach((key) => { + opts[key] = this.options.tls[key]; + }); + } + if (this.servername && !opts.servername) { + opts.servername = this.servername; + } + return shared.resolveHostname(opts, (err, resolved) => { + if (err) { + return setImmediate(() => this._onError(err, "EDNS", false, "CONN")); + } + this.logger.debug( + { + tnx: "dns", + source: opts.host, + resolved: resolved.host, + cached: !!resolved.cached + }, + "Resolved %s as %s [cache %s]", + opts.host, + resolved.host, + resolved.cached ? "hit" : "miss" + ); + Object.keys(resolved).forEach((key) => { + if (key.charAt(0) !== "_" && resolved[key]) { + opts[key] = resolved[key]; + } + }); + try { + this._socket = tls.connect(opts, () => { + this._socket.setKeepAlive(true); + this._onConnect(); + }); + setupConnectionHandlers(); + } catch (E2) { + return setImmediate(() => this._onError(E2, "ECONNECTION", false, "CONN")); + } + }); + } else { + return shared.resolveHostname(opts, (err, resolved) => { + if (err) { + return setImmediate(() => this._onError(err, "EDNS", false, "CONN")); + } + this.logger.debug( + { + tnx: "dns", + source: opts.host, + resolved: resolved.host, + cached: !!resolved.cached + }, + "Resolved %s as %s [cache %s]", + opts.host, + resolved.host, + resolved.cached ? "hit" : "miss" + ); + Object.keys(resolved).forEach((key) => { + if (key.charAt(0) !== "_" && resolved[key]) { + opts[key] = resolved[key]; + } + }); + try { + this._socket = net.connect(opts, () => { + this._socket.setKeepAlive(true); + this._onConnect(); + }); + setupConnectionHandlers(); + } catch (E2) { + return setImmediate(() => this._onError(E2, "ECONNECTION", false, "CONN")); + } + }); + } + } + /** + * Sends QUIT + */ + quit() { + this._sendCommand("QUIT"); + this._responseActions.push(this.close); + } + /** + * Closes the connection to the server + */ + close() { + clearTimeout(this._connectionTimeout); + clearTimeout(this._greetingTimeout); + this._responseActions = []; + if (this._closing) { + return; + } + this._closing = true; + let closeMethod = "end"; + if (this.stage === "init") { + closeMethod = "destroy"; + } + this.logger.debug( + { + tnx: "smtp" + }, + 'Closing connection to the server using "%s"', + closeMethod + ); + let socket = this._socket && this._socket.socket || this._socket; + if (socket && !socket.destroyed) { + try { + socket[closeMethod](); + } catch (_E2) { + } + } + this._destroy(); + } + /** + * Authenticate user + */ + login(authData, callback) { + const isDestroyedMessage = this._isDestroyedMessage("login"); + if (isDestroyedMessage) { + return callback(this._formatError(isDestroyedMessage, "ECONNECTION", false, "API")); + } + this._auth = authData || {}; + this._authMethod = (this._auth.method || "").toString().trim().toUpperCase() || false; + if (!this._authMethod && this._auth.oauth2 && !this._auth.credentials) { + this._authMethod = "XOAUTH2"; + } else if (!this._authMethod || this._authMethod === "XOAUTH2" && !this._auth.oauth2) { + this._authMethod = (this._supportedAuth[0] || "PLAIN").toUpperCase().trim(); + } + if (this._authMethod !== "XOAUTH2" && (!this._auth.credentials || !this._auth.credentials.user || !this._auth.credentials.pass)) { + if (this._auth.user && this._auth.pass || this.customAuth.has(this._authMethod)) { + this._auth.credentials = { + user: this._auth.user, + pass: this._auth.pass, + options: this._auth.options + }; + } else { + return callback(this._formatError('Missing credentials for "' + this._authMethod + '"', "EAUTH", false, "API")); + } + } + if (this.customAuth.has(this._authMethod)) { + let handler2 = this.customAuth.get(this._authMethod); + let lastResponse; + let returned = false; + let resolve = () => { + if (returned) { + return; + } + returned = true; + this.logger.info( + { + tnx: "smtp", + username: this._auth.user, + action: "authenticated", + method: this._authMethod + }, + "User %s authenticated", + JSON.stringify(this._auth.user) + ); + this.authenticated = true; + callback(null, true); + }; + let reject = (err) => { + if (returned) { + return; + } + returned = true; + callback(this._formatError(err, "EAUTH", lastResponse, "AUTH " + this._authMethod)); + }; + let handlerResponse = handler2({ + auth: this._auth, + method: this._authMethod, + extensions: [].concat(this._supportedExtensions), + authMethods: [].concat(this._supportedAuth), + maxAllowedSize: this._maxAllowedSize || false, + sendCommand: (cmd, done) => { + let promise; + if (!done) { + promise = new Promise((resolve2, reject2) => { + done = shared.callbackPromise(resolve2, reject2); + }); + } + this._responseActions.push((str) => { + lastResponse = str; + let codes = str.match(/^(\d+)(?:\s(\d+\.\d+\.\d+))?\s/); + let data2 = { + command: cmd, + response: str + }; + if (codes) { + data2.status = Number(codes[1]) || 0; + if (codes[2]) { + data2.code = codes[2]; + } + data2.text = str.substr(codes[0].length); + } else { + data2.text = str; + data2.status = 0; + } + done(null, data2); + }); + setImmediate(() => this._sendCommand(cmd)); + return promise; + }, + resolve, + reject + }); + if (handlerResponse && typeof handlerResponse.catch === "function") { + handlerResponse.then(resolve).catch(reject); + } + return; + } + switch (this._authMethod) { + case "XOAUTH2": + this._handleXOauth2Token(false, callback); + return; + case "LOGIN": + this._responseActions.push((str) => { + this._actionAUTH_LOGIN_USER(str, callback); + }); + this._sendCommand("AUTH LOGIN"); + return; + case "PLAIN": + this._responseActions.push((str) => { + this._actionAUTHComplete(str, callback); + }); + this._sendCommand( + "AUTH PLAIN " + Buffer.from( + //this._auth.user+'\u0000'+ + "\0" + // skip authorization identity as it causes problems with some servers + this._auth.credentials.user + "\0" + this._auth.credentials.pass, + "utf-8" + ).toString("base64"), + // log entry without passwords + "AUTH PLAIN " + Buffer.from( + //this._auth.user+'\u0000'+ + "\0" + // skip authorization identity as it causes problems with some servers + this._auth.credentials.user + "\0/* secret */", + "utf-8" + ).toString("base64") + ); + return; + case "CRAM-MD5": + this._responseActions.push((str) => { + this._actionAUTH_CRAM_MD5(str, callback); + }); + this._sendCommand("AUTH CRAM-MD5"); + return; + } + return callback(this._formatError('Unknown authentication method "' + this._authMethod + '"', "EAUTH", false, "API")); + } + /** + * Sends a message + * + * @param {Object} envelope Envelope object, {from: addr, to: [addr]} + * @param {Object} message String, Buffer or a Stream + * @param {Function} callback Callback to return once sending is completed + */ + send(envelope, message2, done) { + if (!message2) { + return done(this._formatError("Empty message", "EMESSAGE", false, "API")); + } + const isDestroyedMessage = this._isDestroyedMessage("send message"); + if (isDestroyedMessage) { + return done(this._formatError(isDestroyedMessage, "ECONNECTION", false, "API")); + } + if (this._maxAllowedSize && envelope.size > this._maxAllowedSize) { + return setImmediate(() => { + done(this._formatError("Message size larger than allowed " + this._maxAllowedSize, "EMESSAGE", false, "MAIL FROM")); + }); + } + let returned = false; + let callback = function() { + if (returned) { + return; + } + returned = true; + done(...arguments); + }; + if (typeof message2.on === "function") { + message2.on("error", (err) => callback(this._formatError(err, "ESTREAM", false, "API"))); + } + let startTime = Date.now(); + this._setEnvelope(envelope, (err, info) => { + if (err) { + let stream2 = new PassThrough(); + if (typeof message2.pipe === "function") { + message2.pipe(stream2); + } else { + stream2.write(message2); + stream2.end(); + } + return callback(err); + } + let envelopeTime = Date.now(); + let stream = this._createSendStream((err2, str) => { + if (err2) { + return callback(err2); + } + info.envelopeTime = envelopeTime - startTime; + info.messageTime = Date.now() - envelopeTime; + info.messageSize = stream.outByteCount; + info.response = str; + return callback(null, info); + }); + if (typeof message2.pipe === "function") { + message2.pipe(stream); + } else { + stream.write(message2); + stream.end(); + } + }); + } + /** + * Resets connection state + * + * @param {Function} callback Callback to return once connection is reset + */ + reset(callback) { + this._sendCommand("RSET"); + this._responseActions.push((str) => { + if (str.charAt(0) !== "2") { + return callback(this._formatError("Could not reset session state. response=" + str, "EPROTOCOL", str, "RSET")); + } + this._envelope = false; + return callback(null, true); + }); + } + /** + * Connection listener that is run when the connection to + * the server is opened + * + * @event + */ + _onConnect() { + clearTimeout(this._connectionTimeout); + this.logger.info( + { + tnx: "network", + localAddress: this._socket.localAddress, + localPort: this._socket.localPort, + remoteAddress: this._socket.remoteAddress, + remotePort: this._socket.remotePort + }, + "%s established to %s:%s", + this.secure ? "Secure connection" : "Connection", + this._socket.remoteAddress, + this._socket.remotePort + ); + if (this._destroyed) { + this.close(); + return; + } + this.stage = "connected"; + this._socket.removeListener("data", this._onSocketData); + this._socket.removeListener("timeout", this._onSocketTimeout); + this._socket.removeListener("close", this._onSocketClose); + this._socket.removeListener("end", this._onSocketEnd); + this._socket.on("data", this._onSocketData); + this._socket.once("close", this._onSocketClose); + this._socket.once("end", this._onSocketEnd); + this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT); + this._socket.on("timeout", this._onSocketTimeout); + this._greetingTimeout = setTimeout(() => { + if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) { + this._onError("Greeting never received", "ETIMEDOUT", false, "CONN"); + } + }, this.options.greetingTimeout || GREETING_TIMEOUT); + this._responseActions.push(this._actionGreeting); + this._socket.resume(); + } + /** + * 'data' listener for data coming from the server + * + * @event + * @param {Buffer} chunk Data chunk coming from the server + */ + _onData(chunk) { + if (this._destroyed || !chunk || !chunk.length) { + return; + } + let data2 = (chunk || "").toString("binary"); + let lines = (this._remainder + data2).split(/\r?\n/); + let lastline; + this._remainder = lines.pop(); + for (let i4 = 0, len = lines.length; i4 < len; i4++) { + if (this._responseQueue.length) { + lastline = this._responseQueue[this._responseQueue.length - 1]; + if (/^\d+-/.test(lastline.split("\n").pop())) { + this._responseQueue[this._responseQueue.length - 1] += "\n" + lines[i4]; + continue; + } + } + this._responseQueue.push(lines[i4]); + } + if (this._responseQueue.length) { + lastline = this._responseQueue[this._responseQueue.length - 1]; + if (/^\d+-/.test(lastline.split("\n").pop())) { + return; + } + } + this._processResponse(); + } + /** + * 'error' listener for the socket + * + * @event + * @param {Error} err Error object + * @param {String} type Error name + */ + _onError(err, type, data2, command) { + clearTimeout(this._connectionTimeout); + clearTimeout(this._greetingTimeout); + if (this._destroyed) { + return; + } + err = this._formatError(err, type, data2, command); + this.logger.error(data2, err.message); + this.emit("error", err); + this.close(); + } + _formatError(message2, type, response, command) { + let err; + if (/Error\]$/i.test(Object.prototype.toString.call(message2))) { + err = message2; + } else { + err = new Error(message2); + } + if (type && type !== "Error") { + err.code = type; + } + if (response) { + err.response = response; + err.message += ": " + response; + } + let responseCode = typeof response === "string" && Number((response.match(/^\d+/) || [])[0]) || false; + if (responseCode) { + err.responseCode = responseCode; + } + if (command) { + err.command = command; + } + return err; + } + /** + * 'close' listener for the socket + * + * @event + */ + _onClose() { + let serverResponse = false; + if (this._remainder && this._remainder.trim()) { + if (this.options.debug || this.options.transactionLog) { + this.logger.debug( + { + tnx: "server" + }, + this._remainder.replace(/\r?\n$/, "") + ); + } + this.lastServerResponse = serverResponse = this._remainder.trim(); + } + this.logger.info( + { + tnx: "network" + }, + "Connection closed" + ); + if (this.upgrading && !this._destroyed) { + return this._onError(new Error("Connection closed unexpectedly"), "ETLS", serverResponse, "CONN"); + } else if (![this._actionGreeting, this.close].includes(this._responseActions[0]) && !this._destroyed) { + return this._onError(new Error("Connection closed unexpectedly"), "ECONNECTION", serverResponse, "CONN"); + } else if (/^[45]\d{2}\b/.test(serverResponse)) { + return this._onError(new Error("Connection closed unexpectedly"), "ECONNECTION", serverResponse, "CONN"); + } + this._destroy(); + } + /** + * 'end' listener for the socket + * + * @event + */ + _onEnd() { + if (this._socket && !this._socket.destroyed) { + this._socket.destroy(); + } + } + /** + * 'timeout' listener for the socket + * + * @event + */ + _onTimeout() { + return this._onError(new Error("Timeout"), "ETIMEDOUT", false, "CONN"); + } + /** + * Destroys the client, emits 'end' + */ + _destroy() { + if (this._destroyed) { + return; + } + this._destroyed = true; + this.emit("end"); + } + /** + * Upgrades the connection to TLS + * + * @param {Function} callback Callback function to run when the connection + * has been secured + */ + _upgradeConnection(callback) { + this._socket.removeListener("data", this._onSocketData); + this._socket.removeListener("timeout", this._onSocketTimeout); + let socketPlain = this._socket; + let opts = { + socket: this._socket, + host: this.host + }; + Object.keys(this.options.tls || {}).forEach((key) => { + opts[key] = this.options.tls[key]; + }); + if (this.servername && !opts.servername) { + opts.servername = this.servername; + } + this.upgrading = true; + try { + this._socket = tls.connect(opts, () => { + this.secure = true; + this.upgrading = false; + this._socket.on("data", this._onSocketData); + socketPlain.removeListener("close", this._onSocketClose); + socketPlain.removeListener("end", this._onSocketEnd); + return callback(null, true); + }); + } catch (err) { + return callback(err); + } + this._socket.on("error", this._onSocketError); + this._socket.once("close", this._onSocketClose); + this._socket.once("end", this._onSocketEnd); + this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT); + this._socket.on("timeout", this._onSocketTimeout); + socketPlain.resume(); + } + /** + * Processes queued responses from the server + * + * @param {Boolean} force If true, ignores _processing flag + */ + _processResponse() { + if (!this._responseQueue.length) { + return false; + } + let str = this.lastServerResponse = (this._responseQueue.shift() || "").toString(); + if (/^\d+-/.test(str.split("\n").pop())) { + return; + } + if (this.options.debug || this.options.transactionLog) { + this.logger.debug( + { + tnx: "server" + }, + str.replace(/\r?\n$/, "") + ); + } + if (!str.trim()) { + setImmediate(() => this._processResponse()); + } + let action = this._responseActions.shift(); + if (typeof action === "function") { + action.call(this, str); + setImmediate(() => this._processResponse()); + } else { + return this._onError(new Error("Unexpected Response"), "EPROTOCOL", str, "CONN"); + } + } + /** + * Send a command to the server, append \r\n + * + * @param {String} str String to be sent to the server + * @param {String} logStr Optional string to be used for logging instead of the actual string + */ + _sendCommand(str, logStr) { + if (this._destroyed) { + return; + } + if (this._socket.destroyed) { + return this.close(); + } + if (this.options.debug || this.options.transactionLog) { + this.logger.debug( + { + tnx: "client" + }, + (logStr || str || "").toString().replace(/\r?\n$/, "") + ); + } + this._socket.write(Buffer.from(str + "\r\n", "utf-8")); + } + /** + * Initiates a new message by submitting envelope data, starting with + * MAIL FROM: command + * + * @param {Object} envelope Envelope object in the form of + * {from:'...', to:['...']} + * or + * {from:{address:'...',name:'...'}, to:[address:'...',name:'...']} + */ + _setEnvelope(envelope, callback) { + let args2 = []; + let useSmtpUtf8 = false; + this._envelope = envelope || {}; + this._envelope.from = (this._envelope.from && this._envelope.from.address || this._envelope.from || "").toString().trim(); + this._envelope.to = [].concat(this._envelope.to || []).map((to) => (to && to.address || to || "").toString().trim()); + if (!this._envelope.to.length) { + return callback(this._formatError("No recipients defined", "EENVELOPE", false, "API")); + } + if (this._envelope.from && /[\r\n<>]/.test(this._envelope.from)) { + return callback(this._formatError("Invalid sender " + JSON.stringify(this._envelope.from), "EENVELOPE", false, "API")); + } + if (/[\x80-\uFFFF]/.test(this._envelope.from)) { + useSmtpUtf8 = true; + } + for (let i4 = 0, len = this._envelope.to.length; i4 < len; i4++) { + if (!this._envelope.to[i4] || /[\r\n<>]/.test(this._envelope.to[i4])) { + return callback(this._formatError("Invalid recipient " + JSON.stringify(this._envelope.to[i4]), "EENVELOPE", false, "API")); + } + if (/[\x80-\uFFFF]/.test(this._envelope.to[i4])) { + useSmtpUtf8 = true; + } + } + this._envelope.rcptQueue = JSON.parse(JSON.stringify(this._envelope.to || [])); + this._envelope.rejected = []; + this._envelope.rejectedErrors = []; + this._envelope.accepted = []; + if (this._envelope.dsn) { + try { + this._envelope.dsn = this._setDsnEnvelope(this._envelope.dsn); + } catch (err) { + return callback(this._formatError("Invalid DSN " + err.message, "EENVELOPE", false, "API")); + } + } + this._responseActions.push((str) => { + this._actionMAIL(str, callback); + }); + if (useSmtpUtf8 && this._supportedExtensions.includes("SMTPUTF8")) { + args2.push("SMTPUTF8"); + this._usingSmtpUtf8 = true; + } + if (this._envelope.use8BitMime && this._supportedExtensions.includes("8BITMIME")) { + args2.push("BODY=8BITMIME"); + this._using8BitMime = true; + } + if (this._envelope.size && this._supportedExtensions.includes("SIZE")) { + args2.push("SIZE=" + this._envelope.size); + } + if (this._envelope.dsn && this._supportedExtensions.includes("DSN")) { + if (this._envelope.dsn.ret) { + args2.push("RET=" + shared.encodeXText(this._envelope.dsn.ret)); + } + if (this._envelope.dsn.envid) { + args2.push("ENVID=" + shared.encodeXText(this._envelope.dsn.envid)); + } + } + if (this._envelope.requireTLSExtensionEnabled) { + if (!this.secure) { + return callback( + this._formatError("REQUIRETLS can only be used over TLS connections (RFC 8689)", "EREQUIRETLS", false, "MAIL FROM") + ); + } + if (!this._supportedExtensions.includes("REQUIRETLS")) { + return callback( + this._formatError("Server does not support REQUIRETLS extension (RFC 8689)", "EREQUIRETLS", false, "MAIL FROM") + ); + } + args2.push("REQUIRETLS"); + } + this._sendCommand("MAIL FROM:<" + this._envelope.from + ">" + (args2.length ? " " + args2.join(" ") : "")); + } + _setDsnEnvelope(params) { + let ret = (params.ret || params.return || "").toString().toUpperCase() || null; + if (ret) { + switch (ret) { + case "HDRS": + case "HEADERS": + ret = "HDRS"; + break; + case "FULL": + case "BODY": + ret = "FULL"; + break; + } + } + if (ret && !["FULL", "HDRS"].includes(ret)) { + throw new Error("ret: " + JSON.stringify(ret)); + } + let envid = (params.envid || params.id || "").toString() || null; + let notify = params.notify || null; + if (notify) { + if (typeof notify === "string") { + notify = notify.split(","); + } + notify = notify.map((n4) => n4.trim().toUpperCase()); + let validNotify = ["NEVER", "SUCCESS", "FAILURE", "DELAY"]; + let invalidNotify = notify.filter((n4) => !validNotify.includes(n4)); + if (invalidNotify.length || notify.length > 1 && notify.includes("NEVER")) { + throw new Error("notify: " + JSON.stringify(notify.join(","))); + } + notify = notify.join(","); + } + let orcpt = (params.recipient || params.orcpt || "").toString() || null; + if (orcpt && orcpt.indexOf(";") < 0) { + orcpt = "rfc822;" + orcpt; + } + return { + ret, + envid, + notify, + orcpt + }; + } + _getDsnRcptToArgs() { + let args2 = []; + if (this._envelope.dsn && this._supportedExtensions.includes("DSN")) { + if (this._envelope.dsn.notify) { + args2.push("NOTIFY=" + shared.encodeXText(this._envelope.dsn.notify)); + } + if (this._envelope.dsn.orcpt) { + args2.push("ORCPT=" + shared.encodeXText(this._envelope.dsn.orcpt)); + } + } + return args2.length ? " " + args2.join(" ") : ""; + } + _createSendStream(callback) { + let dataStream = new DataStream(); + let logStream; + if (this.options.lmtp) { + this._envelope.accepted.forEach((recipient, i4) => { + let final = i4 === this._envelope.accepted.length - 1; + this._responseActions.push((str) => { + this._actionLMTPStream(recipient, final, str, callback); + }); + }); + } else { + this._responseActions.push((str) => { + this._actionSMTPStream(str, callback); + }); + } + dataStream.pipe(this._socket, { + end: false + }); + if (this.options.debug) { + logStream = new PassThrough(); + logStream.on("readable", () => { + let chunk; + while (chunk = logStream.read()) { + this.logger.debug( + { + tnx: "message" + }, + chunk.toString("binary").replace(/\r?\n$/, "") + ); + } + }); + dataStream.pipe(logStream); + } + dataStream.once("end", () => { + this.logger.info( + { + tnx: "message", + inByteCount: dataStream.inByteCount, + outByteCount: dataStream.outByteCount + }, + "<%s bytes encoded mime message (source size %s bytes)>", + dataStream.outByteCount, + dataStream.inByteCount + ); + }); + return dataStream; + } + /** ACTIONS **/ + /** + * Will be run after the connection is created and the server sends + * a greeting. If the incoming message starts with 220 initiate + * SMTP session by sending EHLO command + * + * @param {String} str Message from the server + */ + _actionGreeting(str) { + clearTimeout(this._greetingTimeout); + if (str.substr(0, 3) !== "220") { + this._onError(new Error("Invalid greeting. response=" + str), "EPROTOCOL", str, "CONN"); + return; + } + if (this.options.lmtp) { + this._responseActions.push(this._actionLHLO); + this._sendCommand("LHLO " + this.name); + } else { + this._responseActions.push(this._actionEHLO); + this._sendCommand("EHLO " + this.name); + } + } + /** + * Handles server response for LHLO command. If it yielded in + * error, emit 'error', otherwise treat this as an EHLO response + * + * @param {String} str Message from the server + */ + _actionLHLO(str) { + if (str.charAt(0) !== "2") { + this._onError(new Error("Invalid LHLO. response=" + str), "EPROTOCOL", str, "LHLO"); + return; + } + this._actionEHLO(str); + } + /** + * Handles server response for EHLO command. If it yielded in + * error, try HELO instead, otherwise initiate TLS negotiation + * if STARTTLS is supported by the server or move into the + * authentication phase. + * + * @param {String} str Message from the server + */ + _actionEHLO(str) { + let match; + if (str.substr(0, 3) === "421") { + this._onError(new Error("Server terminates connection. response=" + str), "ECONNECTION", str, "EHLO"); + return; + } + if (str.charAt(0) !== "2") { + if (this.options.requireTLS) { + this._onError( + new Error("EHLO failed but HELO does not support required STARTTLS. response=" + str), + "ECONNECTION", + str, + "EHLO" + ); + return; + } + this._responseActions.push(this._actionHELO); + this._sendCommand("HELO " + this.name); + return; + } + this._ehloLines = str.split(/\r?\n/).map((line) => line.replace(/^\d+[ -]/, "").trim()).filter((line) => line).slice(1); + if (!this.secure && !this.options.ignoreTLS && (/[ -]STARTTLS\b/im.test(str) || this.options.requireTLS)) { + this._sendCommand("STARTTLS"); + this._responseActions.push(this._actionSTARTTLS); + return; + } + if (/[ -]SMTPUTF8\b/im.test(str)) { + this._supportedExtensions.push("SMTPUTF8"); + } + if (/[ -]DSN\b/im.test(str)) { + this._supportedExtensions.push("DSN"); + } + if (/[ -]8BITMIME\b/im.test(str)) { + this._supportedExtensions.push("8BITMIME"); + } + if (/[ -]REQUIRETLS\b/im.test(str)) { + this._supportedExtensions.push("REQUIRETLS"); + } + if (/[ -]PIPELINING\b/im.test(str)) { + this._supportedExtensions.push("PIPELINING"); + } + if (/[ -]AUTH\b/i.test(str)) { + this.allowsAuth = true; + } + if (/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)PLAIN/i.test(str)) { + this._supportedAuth.push("PLAIN"); + } + if (/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)LOGIN/i.test(str)) { + this._supportedAuth.push("LOGIN"); + } + if (/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)CRAM-MD5/i.test(str)) { + this._supportedAuth.push("CRAM-MD5"); + } + if (/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)XOAUTH2/i.test(str)) { + this._supportedAuth.push("XOAUTH2"); + } + if (match = str.match(/[ -]SIZE(?:[ \t]+(\d+))?/im)) { + this._supportedExtensions.push("SIZE"); + this._maxAllowedSize = Number(match[1]) || 0; + } + this.emit("connect"); + } + /** + * Handles server response for HELO command. If it yielded in + * error, emit 'error', otherwise move into the authentication phase. + * + * @param {String} str Message from the server + */ + _actionHELO(str) { + if (str.charAt(0) !== "2") { + this._onError(new Error("Invalid HELO. response=" + str), "EPROTOCOL", str, "HELO"); + return; + } + this.allowsAuth = true; + this.emit("connect"); + } + /** + * Handles server response for STARTTLS command. If there's an error + * try HELO instead, otherwise initiate TLS upgrade. If the upgrade + * succeedes restart the EHLO + * + * @param {String} str Message from the server + */ + _actionSTARTTLS(str) { + if (str.charAt(0) !== "2") { + if (this.options.opportunisticTLS) { + this.logger.info( + { + tnx: "smtp" + }, + "Failed STARTTLS upgrade, continuing unencrypted" + ); + return this.emit("connect"); + } + this._onError(new Error("Error upgrading connection with STARTTLS"), "ETLS", str, "STARTTLS"); + return; + } + this._upgradeConnection((err, secured) => { + if (err) { + this._onError(new Error("Error initiating TLS - " + (err.message || err)), "ETLS", false, "STARTTLS"); + return; + } + this.logger.info( + { + tnx: "smtp" + }, + "Connection upgraded with STARTTLS" + ); + if (secured) { + if (this.options.lmtp) { + this._responseActions.push(this._actionLHLO); + this._sendCommand("LHLO " + this.name); + } else { + this._responseActions.push(this._actionEHLO); + this._sendCommand("EHLO " + this.name); + } + } else { + this.emit("connect"); + } + }); + } + /** + * Handle the response for AUTH LOGIN command. We are expecting + * '334 VXNlcm5hbWU6' (base64 for 'Username:'). Data to be sent as + * response needs to be base64 encoded username. We do not need + * exact match but settle with 334 response in general as some + * hosts invalidly use a longer message than VXNlcm5hbWU6 + * + * @param {String} str Message from the server + */ + _actionAUTH_LOGIN_USER(str, callback) { + if (!/^334[ -]/.test(str)) { + callback(this._formatError('Invalid login sequence while waiting for "334 VXNlcm5hbWU6"', "EAUTH", str, "AUTH LOGIN")); + return; + } + this._responseActions.push((str2) => { + this._actionAUTH_LOGIN_PASS(str2, callback); + }); + this._sendCommand(Buffer.from(this._auth.credentials.user + "", "utf-8").toString("base64")); + } + /** + * Handle the response for AUTH CRAM-MD5 command. We are expecting + * '334 '. Data to be sent as response needs to be + * base64 decoded challenge string, MD5 hashed using the password as + * a HMAC key, prefixed by the username and a space, and finally all + * base64 encoded again. + * + * @param {String} str Message from the server + */ + _actionAUTH_CRAM_MD5(str, callback) { + let challengeMatch = str.match(/^334\s+(.+)$/); + let challengeString = ""; + if (!challengeMatch) { + return callback( + this._formatError("Invalid login sequence while waiting for server challenge string", "EAUTH", str, "AUTH CRAM-MD5") + ); + } else { + challengeString = challengeMatch[1]; + } + let base64decoded = Buffer.from(challengeString, "base64").toString("ascii"), hmacMD5 = crypto2.createHmac("md5", this._auth.credentials.pass); + hmacMD5.update(base64decoded); + let prepended = this._auth.credentials.user + " " + hmacMD5.digest("hex"); + this._responseActions.push((str2) => { + this._actionAUTH_CRAM_MD5_PASS(str2, callback); + }); + this._sendCommand( + Buffer.from(prepended).toString("base64"), + // hidden hash for logs + Buffer.from(this._auth.credentials.user + " /* secret */").toString("base64") + ); + } + /** + * Handles the response to CRAM-MD5 authentication, if there's no error, + * the user can be considered logged in. Start waiting for a message to send + * + * @param {String} str Message from the server + */ + _actionAUTH_CRAM_MD5_PASS(str, callback) { + if (!str.match(/^235\s+/)) { + return callback(this._formatError('Invalid login sequence while waiting for "235"', "EAUTH", str, "AUTH CRAM-MD5")); + } + this.logger.info( + { + tnx: "smtp", + username: this._auth.user, + action: "authenticated", + method: this._authMethod + }, + "User %s authenticated", + JSON.stringify(this._auth.user) + ); + this.authenticated = true; + callback(null, true); + } + /** + * Handle the response for AUTH LOGIN command. We are expecting + * '334 UGFzc3dvcmQ6' (base64 for 'Password:'). Data to be sent as + * response needs to be base64 encoded password. + * + * @param {String} str Message from the server + */ + _actionAUTH_LOGIN_PASS(str, callback) { + if (!/^334[ -]/.test(str)) { + return callback(this._formatError('Invalid login sequence while waiting for "334 UGFzc3dvcmQ6"', "EAUTH", str, "AUTH LOGIN")); + } + this._responseActions.push((str2) => { + this._actionAUTHComplete(str2, callback); + }); + this._sendCommand( + Buffer.from((this._auth.credentials.pass || "").toString(), "utf-8").toString("base64"), + // Hidden pass for logs + Buffer.from("/* secret */", "utf-8").toString("base64") + ); + } + /** + * Handles the response for authentication, if there's no error, + * the user can be considered logged in. Start waiting for a message to send + * + * @param {String} str Message from the server + */ + _actionAUTHComplete(str, isRetry, callback) { + if (!callback && typeof isRetry === "function") { + callback = isRetry; + isRetry = false; + } + if (str.substr(0, 3) === "334") { + this._responseActions.push((str2) => { + if (isRetry || this._authMethod !== "XOAUTH2") { + this._actionAUTHComplete(str2, true, callback); + } else { + setImmediate(() => this._handleXOauth2Token(true, callback)); + } + }); + this._sendCommand(""); + return; + } + if (str.charAt(0) !== "2") { + this.logger.info( + { + tnx: "smtp", + username: this._auth.user, + action: "authfail", + method: this._authMethod + }, + "User %s failed to authenticate", + JSON.stringify(this._auth.user) + ); + return callback(this._formatError("Invalid login", "EAUTH", str, "AUTH " + this._authMethod)); + } + this.logger.info( + { + tnx: "smtp", + username: this._auth.user, + action: "authenticated", + method: this._authMethod + }, + "User %s authenticated", + JSON.stringify(this._auth.user) + ); + this.authenticated = true; + callback(null, true); + } + /** + * Handle response for a MAIL FROM: command + * + * @param {String} str Message from the server + */ + _actionMAIL(str, callback) { + let message2, curRecipient; + if (Number(str.charAt(0)) !== 2) { + if (this._usingSmtpUtf8 && /^550 /.test(str) && /[\x80-\uFFFF]/.test(this._envelope.from)) { + message2 = "Internationalized mailbox name not allowed"; + } else { + message2 = "Mail command failed"; + } + return callback(this._formatError(message2, "EENVELOPE", str, "MAIL FROM")); + } + if (!this._envelope.rcptQueue.length) { + return callback(this._formatError("Can't send mail - no recipients defined", "EENVELOPE", false, "API")); + } else { + this._recipientQueue = []; + if (this._supportedExtensions.includes("PIPELINING")) { + while (this._envelope.rcptQueue.length) { + curRecipient = this._envelope.rcptQueue.shift(); + this._recipientQueue.push(curRecipient); + this._responseActions.push((str2) => { + this._actionRCPT(str2, callback); + }); + this._sendCommand("RCPT TO:<" + curRecipient + ">" + this._getDsnRcptToArgs()); + } + } else { + curRecipient = this._envelope.rcptQueue.shift(); + this._recipientQueue.push(curRecipient); + this._responseActions.push((str2) => { + this._actionRCPT(str2, callback); + }); + this._sendCommand("RCPT TO:<" + curRecipient + ">" + this._getDsnRcptToArgs()); + } + } + } + /** + * Handle response for a RCPT TO: command + * + * @param {String} str Message from the server + */ + _actionRCPT(str, callback) { + let message2, err, curRecipient = this._recipientQueue.shift(); + if (Number(str.charAt(0)) !== 2) { + if (this._usingSmtpUtf8 && /^553 /.test(str) && /[\x80-\uFFFF]/.test(curRecipient)) { + message2 = "Internationalized mailbox name not allowed"; + } else { + message2 = "Recipient command failed"; + } + this._envelope.rejected.push(curRecipient); + err = this._formatError(message2, "EENVELOPE", str, "RCPT TO"); + err.recipient = curRecipient; + this._envelope.rejectedErrors.push(err); + } else { + this._envelope.accepted.push(curRecipient); + } + if (!this._envelope.rcptQueue.length && !this._recipientQueue.length) { + if (this._envelope.rejected.length < this._envelope.to.length) { + this._responseActions.push((str2) => { + this._actionDATA(str2, callback); + }); + this._sendCommand("DATA"); + } else { + err = this._formatError("Can't send mail - all recipients were rejected", "EENVELOPE", str, "RCPT TO"); + err.rejected = this._envelope.rejected; + err.rejectedErrors = this._envelope.rejectedErrors; + return callback(err); + } + } else if (this._envelope.rcptQueue.length) { + curRecipient = this._envelope.rcptQueue.shift(); + this._recipientQueue.push(curRecipient); + this._responseActions.push((str2) => { + this._actionRCPT(str2, callback); + }); + this._sendCommand("RCPT TO:<" + curRecipient + ">" + this._getDsnRcptToArgs()); + } + } + /** + * Handle response for a DATA command + * + * @param {String} str Message from the server + */ + _actionDATA(str, callback) { + if (!/^[23]/.test(str)) { + return callback(this._formatError("Data command failed", "EENVELOPE", str, "DATA")); + } + let response = { + accepted: this._envelope.accepted, + rejected: this._envelope.rejected + }; + if (this._ehloLines && this._ehloLines.length) { + response.ehlo = this._ehloLines; + } + if (this._envelope.rejectedErrors.length) { + response.rejectedErrors = this._envelope.rejectedErrors; + } + callback(null, response); + } + /** + * Handle response for a DATA stream when using SMTP + * We expect a single response that defines if the sending succeeded or failed + * + * @param {String} str Message from the server + */ + _actionSMTPStream(str, callback) { + if (Number(str.charAt(0)) !== 2) { + return callback(this._formatError("Message failed", "EMESSAGE", str, "DATA")); + } else { + return callback(null, str); + } + } + /** + * Handle response for a DATA stream + * We expect a separate response for every recipient. All recipients can either + * succeed or fail separately + * + * @param {String} recipient The recipient this response applies to + * @param {Boolean} final Is this the final recipient? + * @param {String} str Message from the server + */ + _actionLMTPStream(recipient, final, str, callback) { + let err; + if (Number(str.charAt(0)) !== 2) { + err = this._formatError("Message failed for recipient " + recipient, "EMESSAGE", str, "DATA"); + err.recipient = recipient; + this._envelope.rejected.push(recipient); + this._envelope.rejectedErrors.push(err); + for (let i4 = 0, len = this._envelope.accepted.length; i4 < len; i4++) { + if (this._envelope.accepted[i4] === recipient) { + this._envelope.accepted.splice(i4, 1); + } + } + } + if (final) { + return callback(null, str); + } + } + _handleXOauth2Token(isRetry, callback) { + this._auth.oauth2.getToken(isRetry, (err, accessToken) => { + if (err) { + this.logger.info( + { + tnx: "smtp", + username: this._auth.user, + action: "authfail", + method: this._authMethod + }, + "User %s failed to authenticate", + JSON.stringify(this._auth.user) + ); + return callback(this._formatError(err, "EAUTH", false, "AUTH XOAUTH2")); + } + this._responseActions.push((str) => { + this._actionAUTHComplete(str, isRetry, callback); + }); + this._sendCommand( + "AUTH XOAUTH2 " + this._auth.oauth2.buildXOAuth2Token(accessToken), + // Hidden for logs + "AUTH XOAUTH2 " + this._auth.oauth2.buildXOAuth2Token("/* secret */") + ); + }); + } + /** + * + * @param {string} command + * @private + */ + _isDestroyedMessage(command) { + if (this._destroyed) { + return "Cannot " + command + " - smtp connection is already destroyed."; + } + if (this._socket) { + if (this._socket.destroyed) { + return "Cannot " + command + " - smtp connection socket is already destroyed."; + } + if (!this._socket.writable) { + return "Cannot " + command + " - smtp connection socket is already half-closed."; + } + } + } + _getHostname() { + let defaultHostname; + try { + defaultHostname = os.hostname() || ""; + } catch (_err) { + defaultHostname = "localhost"; + } + if (!defaultHostname || defaultHostname.indexOf(".") < 0) { + defaultHostname = "[127.0.0.1]"; + } + if (defaultHostname.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)) { + defaultHostname = "[" + defaultHostname + "]"; + } + return defaultHostname; + } + }; + module2.exports = SMTPConnection; + } +}); + +// node_modules/nodemailer/lib/xoauth2/index.js +var require_xoauth2 = __commonJS({ + "node_modules/nodemailer/lib/xoauth2/index.js"(exports2, module2) { + "use strict"; + var Stream = require("stream").Stream; + var nmfetch = require_fetch(); + var crypto2 = require("crypto"); + var shared = require_shared2(); + var XOAuth2 = class extends Stream { + constructor(options, logger3) { + super(); + this.options = options || {}; + if (options && options.serviceClient) { + if (!options.privateKey || !options.user) { + setImmediate(() => this.emit("error", new Error('Options "privateKey" and "user" are required for service account!'))); + return; + } + let serviceRequestTimeout = Math.min(Math.max(Number(this.options.serviceRequestTimeout) || 0, 0), 3600); + this.options.serviceRequestTimeout = serviceRequestTimeout || 5 * 60; + } + this.logger = shared.getLogger( + { + logger: logger3 + }, + { + component: this.options.component || "OAuth2" + } + ); + this.provisionCallback = typeof this.options.provisionCallback === "function" ? this.options.provisionCallback : false; + this.options.accessUrl = this.options.accessUrl || "https://accounts.google.com/o/oauth2/token"; + this.options.customHeaders = this.options.customHeaders || {}; + this.options.customParams = this.options.customParams || {}; + this.accessToken = this.options.accessToken || false; + if (this.options.expires && Number(this.options.expires)) { + this.expires = this.options.expires; + } else { + let timeout = Math.max(Number(this.options.timeout) || 0, 0); + this.expires = timeout && Date.now() + timeout * 1e3 || 0; + } + this.renewing = false; + this.renewalQueue = []; + } + /** + * Returns or generates (if previous has expired) a XOAuth2 token + * + * @param {Boolean} renew If false then use cached access token (if available) + * @param {Function} callback Callback function with error object and token string + */ + getToken(renew, callback) { + if (!renew && this.accessToken && (!this.expires || this.expires > Date.now())) { + this.logger.debug( + { + tnx: "OAUTH2", + user: this.options.user, + action: "reuse" + }, + "Reusing existing access token for %s", + this.options.user + ); + return callback(null, this.accessToken); + } + if (!this.provisionCallback && !this.options.refreshToken && !this.options.serviceClient) { + if (this.accessToken) { + this.logger.debug( + { + tnx: "OAUTH2", + user: this.options.user, + action: "reuse" + }, + "Reusing existing access token (no refresh capability) for %s", + this.options.user + ); + return callback(null, this.accessToken); + } + this.logger.error( + { + tnx: "OAUTH2", + user: this.options.user, + action: "renew" + }, + "Cannot renew access token for %s: No refresh mechanism available", + this.options.user + ); + return callback(new Error("Can't create new access token for user")); + } + if (this.renewing) { + return this.renewalQueue.push({ renew, callback }); + } + this.renewing = true; + const generateCallback = (err, accessToken) => { + this.renewalQueue.forEach((item) => item.callback(err, accessToken)); + this.renewalQueue = []; + this.renewing = false; + if (err) { + this.logger.error( + { + err, + tnx: "OAUTH2", + user: this.options.user, + action: "renew" + }, + "Failed generating new Access Token for %s", + this.options.user + ); + } else { + this.logger.info( + { + tnx: "OAUTH2", + user: this.options.user, + action: "renew" + }, + "Generated new Access Token for %s", + this.options.user + ); + } + callback(err, accessToken); + }; + if (this.provisionCallback) { + this.provisionCallback(this.options.user, !!renew, (err, accessToken, expires) => { + if (!err && accessToken) { + this.accessToken = accessToken; + this.expires = expires || 0; + } + generateCallback(err, accessToken); + }); + } else { + this.generateToken(generateCallback); + } + } + /** + * Updates token values + * + * @param {String} accessToken New access token + * @param {Number} timeout Access token lifetime in seconds + * + * Emits 'token': { user: User email-address, accessToken: the new accessToken, timeout: TTL in seconds} + */ + updateToken(accessToken, timeout) { + this.accessToken = accessToken; + timeout = Math.max(Number(timeout) || 0, 0); + this.expires = timeout && Date.now() + timeout * 1e3 || 0; + this.emit("token", { + user: this.options.user, + accessToken: accessToken || "", + expires: this.expires + }); + } + /** + * Generates a new XOAuth2 token with the credentials provided at initialization + * + * @param {Function} callback Callback function with error object and token string + */ + generateToken(callback) { + let urlOptions; + let loggedUrlOptions; + if (this.options.serviceClient) { + let iat = Math.floor(Date.now() / 1e3); + let tokenData = { + iss: this.options.serviceClient, + scope: this.options.scope || "https://mail.google.com/", + sub: this.options.user, + aud: this.options.accessUrl, + iat, + exp: iat + this.options.serviceRequestTimeout + }; + let token; + try { + token = this.jwtSignRS256(tokenData); + } catch (_err) { + return callback(new Error("Can't generate token. Check your auth options")); + } + urlOptions = { + grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer", + assertion: token + }; + loggedUrlOptions = { + grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer", + assertion: tokenData + }; + } else { + if (!this.options.refreshToken) { + return callback(new Error("Can't create new access token for user")); + } + urlOptions = { + client_id: this.options.clientId || "", + client_secret: this.options.clientSecret || "", + refresh_token: this.options.refreshToken, + grant_type: "refresh_token" + }; + loggedUrlOptions = { + client_id: this.options.clientId || "", + client_secret: (this.options.clientSecret || "").substr(0, 6) + "...", + refresh_token: (this.options.refreshToken || "").substr(0, 6) + "...", + grant_type: "refresh_token" + }; + } + Object.keys(this.options.customParams).forEach((key) => { + urlOptions[key] = this.options.customParams[key]; + loggedUrlOptions[key] = this.options.customParams[key]; + }); + this.logger.debug( + { + tnx: "OAUTH2", + user: this.options.user, + action: "generate" + }, + "Requesting token using: %s", + JSON.stringify(loggedUrlOptions) + ); + this.postRequest(this.options.accessUrl, urlOptions, this.options, (error2, body) => { + let data2; + if (error2) { + return callback(error2); + } + try { + data2 = JSON.parse(body.toString()); + } catch (E2) { + return callback(E2); + } + if (!data2 || typeof data2 !== "object") { + this.logger.debug( + { + tnx: "OAUTH2", + user: this.options.user, + action: "post" + }, + "Response: %s", + (body || "").toString() + ); + return callback(new Error("Invalid authentication response")); + } + let logData = {}; + Object.keys(data2).forEach((key) => { + if (key !== "access_token") { + logData[key] = data2[key]; + } else { + logData[key] = (data2[key] || "").toString().substr(0, 6) + "..."; + } + }); + this.logger.debug( + { + tnx: "OAUTH2", + user: this.options.user, + action: "post" + }, + "Response: %s", + JSON.stringify(logData) + ); + if (data2.error) { + let errorMessage = data2.error; + if (data2.error_description) { + errorMessage += ": " + data2.error_description; + } + if (data2.error_uri) { + errorMessage += " (" + data2.error_uri + ")"; + } + return callback(new Error(errorMessage)); + } + if (data2.access_token) { + this.updateToken(data2.access_token, data2.expires_in); + return callback(null, this.accessToken); + } + return callback(new Error("No access token")); + }); + } + /** + * Converts an access_token and user id into a base64 encoded XOAuth2 token + * + * @param {String} [accessToken] Access token string + * @return {String} Base64 encoded token for IMAP or SMTP login + */ + buildXOAuth2Token(accessToken) { + let authData = ["user=" + (this.options.user || ""), "auth=Bearer " + (accessToken || this.accessToken), "", ""]; + return Buffer.from(authData.join(""), "utf-8").toString("base64"); + } + /** + * Custom POST request handler. + * This is only needed to keep paths short in Windows – usually this module + * is a dependency of a dependency and if it tries to require something + * like the request module the paths get way too long to handle for Windows. + * As we do only a simple POST request we do not actually require complicated + * logic support (no redirects, no nothing) anyway. + * + * @param {String} url Url to POST to + * @param {String|Buffer} payload Payload to POST + * @param {Function} callback Callback function with (err, buff) + */ + postRequest(url, payload2, params, callback) { + let returned = false; + let chunks = []; + let chunklen = 0; + let req = nmfetch(url, { + method: "post", + headers: params.customHeaders, + body: payload2, + allowErrorResponse: true + }); + req.on("readable", () => { + let chunk; + while ((chunk = req.read()) !== null) { + chunks.push(chunk); + chunklen += chunk.length; + } + }); + req.once("error", (err) => { + if (returned) { + return; + } + returned = true; + return callback(err); + }); + req.once("end", () => { + if (returned) { + return; + } + returned = true; + return callback(null, Buffer.concat(chunks, chunklen)); + }); + } + /** + * Encodes a buffer or a string into Base64url format + * + * @param {Buffer|String} data The data to convert + * @return {String} The encoded string + */ + toBase64URL(data2) { + if (typeof data2 === "string") { + data2 = Buffer.from(data2); + } + return data2.toString("base64").replace(/[=]+/g, "").replace(/\+/g, "-").replace(/\//g, "_"); + } + /** + * Creates a JSON Web Token signed with RS256 (SHA256 + RSA) + * + * @param {Object} payload The payload to include in the generated token + * @return {String} The generated and signed token + */ + jwtSignRS256(payload2) { + payload2 = ['{"alg":"RS256","typ":"JWT"}', JSON.stringify(payload2)].map((val) => this.toBase64URL(val)).join("."); + let signature = crypto2.createSign("RSA-SHA256").update(payload2).sign(this.options.privateKey); + return payload2 + "." + this.toBase64URL(signature); + } + }; + module2.exports = XOAuth2; + } +}); + +// node_modules/nodemailer/lib/smtp-pool/pool-resource.js +var require_pool_resource = __commonJS({ + "node_modules/nodemailer/lib/smtp-pool/pool-resource.js"(exports2, module2) { + "use strict"; + var SMTPConnection = require_smtp_connection(); + var assign = require_shared2().assign; + var XOAuth2 = require_xoauth2(); + var EventEmitter = require("events"); + var PoolResource = class extends EventEmitter { + constructor(pool) { + super(); + this.pool = pool; + this.options = pool.options; + this.logger = this.pool.logger; + if (this.options.auth) { + switch ((this.options.auth.type || "").toString().toUpperCase()) { + case "OAUTH2": { + let oauth2 = new XOAuth2(this.options.auth, this.logger); + oauth2.provisionCallback = this.pool.mailer && this.pool.mailer.get("oauth2_provision_cb") || oauth2.provisionCallback; + this.auth = { + type: "OAUTH2", + user: this.options.auth.user, + oauth2, + method: "XOAUTH2" + }; + oauth2.on("token", (token) => this.pool.mailer.emit("token", token)); + oauth2.on("error", (err) => this.emit("error", err)); + break; + } + default: + if (!this.options.auth.user && !this.options.auth.pass) { + break; + } + this.auth = { + type: (this.options.auth.type || "").toString().toUpperCase() || "LOGIN", + user: this.options.auth.user, + credentials: { + user: this.options.auth.user || "", + pass: this.options.auth.pass, + options: this.options.auth.options + }, + method: (this.options.auth.method || "").trim().toUpperCase() || this.options.authMethod || false + }; + } + } + this._connection = false; + this._connected = false; + this.messages = 0; + this.available = true; + } + /** + * Initiates a connection to the SMTP server + * + * @param {Function} callback Callback function to run once the connection is established or failed + */ + connect(callback) { + this.pool.getSocket(this.options, (err, socketOptions) => { + if (err) { + return callback(err); + } + let returned = false; + let options = this.options; + if (socketOptions && socketOptions.connection) { + this.logger.info( + { + tnx: "proxy", + remoteAddress: socketOptions.connection.remoteAddress, + remotePort: socketOptions.connection.remotePort, + destHost: options.host || "", + destPort: options.port || "", + action: "connected" + }, + "Using proxied socket from %s:%s to %s:%s", + socketOptions.connection.remoteAddress, + socketOptions.connection.remotePort, + options.host || "", + options.port || "" + ); + options = assign(false, options); + Object.keys(socketOptions).forEach((key) => { + options[key] = socketOptions[key]; + }); + } + this.connection = new SMTPConnection(options); + this.connection.once("error", (err2) => { + this.emit("error", err2); + if (returned) { + return; + } + returned = true; + return callback(err2); + }); + this.connection.once("end", () => { + this.close(); + if (returned) { + return; + } + returned = true; + let timer = setTimeout(() => { + if (returned) { + return; + } + let err2 = new Error("Unexpected socket close"); + if (this.connection && this.connection._socket && this.connection._socket.upgrading) { + err2.code = "ETLS"; + } + callback(err2); + }, 1e3); + try { + timer.unref(); + } catch (_E2) { + } + }); + this.connection.connect(() => { + if (returned) { + return; + } + if (this.auth && (this.connection.allowsAuth || options.forceAuth)) { + this.connection.login(this.auth, (err2) => { + if (returned) { + return; + } + returned = true; + if (err2) { + this.connection.close(); + this.emit("error", err2); + return callback(err2); + } + this._connected = true; + callback(null, true); + }); + } else { + returned = true; + this._connected = true; + return callback(null, true); + } + }); + }); + } + /** + * Sends an e-mail to be sent using the selected settings + * + * @param {Object} mail Mail object + * @param {Function} callback Callback function + */ + send(mail, callback) { + if (!this._connected) { + return this.connect((err) => { + if (err) { + return callback(err); + } + return this.send(mail, callback); + }); + } + let envelope = mail.message.getEnvelope(); + let messageId = mail.message.messageId(); + let recipients = [].concat(envelope.to || []); + if (recipients.length > 3) { + recipients.push("...and " + recipients.splice(2).length + " more"); + } + this.logger.info( + { + tnx: "send", + messageId, + cid: this.id + }, + "Sending message %s using #%s to <%s>", + messageId, + this.id, + recipients.join(", ") + ); + if (mail.data.dsn) { + envelope.dsn = mail.data.dsn; + } + if (mail.data.requireTLSExtensionEnabled) { + envelope.requireTLSExtensionEnabled = mail.data.requireTLSExtensionEnabled; + } + this.connection.send(envelope, mail.message.createReadStream(), (err, info) => { + this.messages++; + if (err) { + this.connection.close(); + this.emit("error", err); + return callback(err); + } + info.envelope = { + from: envelope.from, + to: envelope.to + }; + info.messageId = messageId; + setImmediate(() => { + let err2; + if (this.messages >= this.options.maxMessages) { + err2 = new Error("Resource exhausted"); + err2.code = "EMAXLIMIT"; + this.connection.close(); + this.emit("error", err2); + } else { + this.pool._checkRateLimit(() => { + this.available = true; + this.emit("available"); + }); + } + }); + callback(null, info); + }); + } + /** + * Closes the connection + */ + close() { + this._connected = false; + if (this.auth && this.auth.oauth2) { + this.auth.oauth2.removeAllListeners(); + } + if (this.connection) { + this.connection.close(); + } + this.emit("close"); + } + }; + module2.exports = PoolResource; + } +}); + +// node_modules/nodemailer/lib/well-known/services.json +var require_services = __commonJS({ + "node_modules/nodemailer/lib/well-known/services.json"(exports2, module2) { + module2.exports = { + "1und1": { + description: "1&1 Mail (German hosting provider)", + host: "smtp.1und1.de", + port: 465, + secure: true, + authMethod: "LOGIN" + }, + "126": { + description: "126 Mail (NetEase)", + host: "smtp.126.com", + port: 465, + secure: true + }, + "163": { + description: "163 Mail (NetEase)", + host: "smtp.163.com", + port: 465, + secure: true + }, + Aliyun: { + description: "Alibaba Cloud Mail", + domains: ["aliyun.com"], + host: "smtp.aliyun.com", + port: 465, + secure: true + }, + AliyunQiye: { + description: "Alibaba Cloud Enterprise Mail", + host: "smtp.qiye.aliyun.com", + port: 465, + secure: true + }, + AOL: { + description: "AOL Mail", + domains: ["aol.com"], + host: "smtp.aol.com", + port: 587 + }, + Aruba: { + description: "Aruba PEC (Italian email provider)", + domains: ["aruba.it", "pec.aruba.it"], + aliases: ["Aruba PEC"], + host: "smtps.aruba.it", + port: 465, + secure: true, + authMethod: "LOGIN" + }, + Bluewin: { + description: "Bluewin (Swiss email provider)", + host: "smtpauths.bluewin.ch", + domains: ["bluewin.ch"], + port: 465 + }, + BOL: { + description: "BOL Mail (Brazilian provider)", + domains: ["bol.com.br"], + host: "smtp.bol.com.br", + port: 587, + requireTLS: true + }, + DebugMail: { + description: "DebugMail (email testing service)", + host: "debugmail.io", + port: 25 + }, + Disroot: { + description: "Disroot (privacy-focused provider)", + domains: ["disroot.org"], + host: "disroot.org", + port: 587, + secure: false, + authMethod: "LOGIN" + }, + DynectEmail: { + description: "Dyn Email Delivery", + aliases: ["Dynect"], + host: "smtp.dynect.net", + port: 25 + }, + ElasticEmail: { + description: "Elastic Email", + aliases: ["Elastic Email"], + host: "smtp.elasticemail.com", + port: 465, + secure: true + }, + Ethereal: { + description: "Ethereal Email (email testing service)", + aliases: ["ethereal.email"], + host: "smtp.ethereal.email", + port: 587 + }, + FastMail: { + description: "FastMail", + domains: ["fastmail.fm"], + host: "smtp.fastmail.com", + port: 465, + secure: true + }, + "Feishu Mail": { + description: "Feishu Mail (Lark)", + aliases: ["Feishu", "FeishuMail"], + domains: ["www.feishu.cn"], + host: "smtp.feishu.cn", + port: 465, + secure: true + }, + "Forward Email": { + description: "Forward Email (email forwarding service)", + aliases: ["FE", "ForwardEmail"], + domains: ["forwardemail.net"], + host: "smtp.forwardemail.net", + port: 465, + secure: true + }, + GandiMail: { + description: "Gandi Mail", + aliases: ["Gandi", "Gandi Mail"], + host: "mail.gandi.net", + port: 587 + }, + Gmail: { + description: "Gmail", + aliases: ["Google Mail"], + domains: ["gmail.com", "googlemail.com"], + host: "smtp.gmail.com", + port: 465, + secure: true + }, + GMX: { + description: "GMX Mail", + domains: ["gmx.com", "gmx.net", "gmx.de"], + host: "mail.gmx.com", + port: 587 + }, + Godaddy: { + description: "GoDaddy Email (US)", + host: "smtpout.secureserver.net", + port: 25 + }, + GodaddyAsia: { + description: "GoDaddy Email (Asia)", + host: "smtp.asia.secureserver.net", + port: 25 + }, + GodaddyEurope: { + description: "GoDaddy Email (Europe)", + host: "smtp.europe.secureserver.net", + port: 25 + }, + "hot.ee": { + description: "Hot.ee (Estonian email provider)", + host: "mail.hot.ee" + }, + Hotmail: { + description: "Outlook.com / Hotmail", + aliases: ["Outlook", "Outlook.com", "Hotmail.com"], + domains: ["hotmail.com", "outlook.com"], + host: "smtp-mail.outlook.com", + port: 587 + }, + iCloud: { + description: "iCloud Mail", + aliases: ["Me", "Mac"], + domains: ["me.com", "mac.com"], + host: "smtp.mail.me.com", + port: 587 + }, + Infomaniak: { + description: "Infomaniak Mail (Swiss hosting provider)", + host: "mail.infomaniak.com", + domains: ["ik.me", "ikmail.com", "etik.com"], + port: 587 + }, + KolabNow: { + description: "KolabNow (secure email service)", + domains: ["kolabnow.com"], + aliases: ["Kolab"], + host: "smtp.kolabnow.com", + port: 465, + secure: true, + authMethod: "LOGIN" + }, + Loopia: { + description: "Loopia (Swedish hosting provider)", + host: "mailcluster.loopia.se", + port: 465 + }, + Loops: { + description: "Loops", + host: "smtp.loops.so", + port: 587 + }, + "mail.ee": { + description: "Mail.ee (Estonian email provider)", + host: "smtp.mail.ee" + }, + "Mail.ru": { + description: "Mail.ru", + host: "smtp.mail.ru", + port: 465, + secure: true + }, + "Mailcatch.app": { + description: "Mailcatch (email testing service)", + host: "sandbox-smtp.mailcatch.app", + port: 2525 + }, + Maildev: { + description: "MailDev (local email testing)", + port: 1025, + ignoreTLS: true + }, + MailerSend: { + description: "MailerSend", + host: "smtp.mailersend.net", + port: 587 + }, + Mailgun: { + description: "Mailgun", + host: "smtp.mailgun.org", + port: 465, + secure: true + }, + Mailjet: { + description: "Mailjet", + host: "in.mailjet.com", + port: 587 + }, + Mailosaur: { + description: "Mailosaur (email testing service)", + host: "mailosaur.io", + port: 25 + }, + Mailtrap: { + description: "Mailtrap", + host: "live.smtp.mailtrap.io", + port: 587 + }, + Mandrill: { + description: "Mandrill (by Mailchimp)", + host: "smtp.mandrillapp.com", + port: 587 + }, + Naver: { + description: "Naver Mail (Korean email provider)", + host: "smtp.naver.com", + port: 587 + }, + OhMySMTP: { + description: "OhMySMTP (email delivery service)", + host: "smtp.ohmysmtp.com", + port: 587, + secure: false + }, + One: { + description: "One.com Email", + host: "send.one.com", + port: 465, + secure: true + }, + OpenMailBox: { + description: "OpenMailBox", + aliases: ["OMB", "openmailbox.org"], + host: "smtp.openmailbox.org", + port: 465, + secure: true + }, + Outlook365: { + description: "Microsoft 365 / Office 365", + host: "smtp.office365.com", + port: 587, + secure: false + }, + Postmark: { + description: "Postmark", + aliases: ["PostmarkApp"], + host: "smtp.postmarkapp.com", + port: 2525 + }, + Proton: { + description: "Proton Mail", + aliases: ["ProtonMail", "Proton.me", "Protonmail.com", "Protonmail.ch"], + domains: ["proton.me", "protonmail.com", "pm.me", "protonmail.ch"], + host: "smtp.protonmail.ch", + port: 587, + requireTLS: true + }, + "qiye.aliyun": { + description: "Alibaba Mail Enterprise Edition", + host: "smtp.mxhichina.com", + port: "465", + secure: true + }, + QQ: { + description: "QQ Mail", + domains: ["qq.com"], + host: "smtp.qq.com", + port: 465, + secure: true + }, + QQex: { + description: "QQ Enterprise Mail", + aliases: ["QQ Enterprise"], + domains: ["exmail.qq.com"], + host: "smtp.exmail.qq.com", + port: 465, + secure: true + }, + Resend: { + description: "Resend", + host: "smtp.resend.com", + port: 465, + secure: true + }, + Runbox: { + description: "Runbox (Norwegian email provider)", + domains: ["runbox.com"], + host: "smtp.runbox.com", + port: 465, + secure: true + }, + SendCloud: { + description: "SendCloud (Chinese email delivery)", + host: "smtp.sendcloud.net", + port: 2525 + }, + SendGrid: { + description: "SendGrid", + host: "smtp.sendgrid.net", + port: 587 + }, + SendinBlue: { + description: "Brevo (formerly Sendinblue)", + aliases: ["Brevo"], + host: "smtp-relay.brevo.com", + port: 587 + }, + SendPulse: { + description: "SendPulse", + host: "smtp-pulse.com", + port: 465, + secure: true + }, + SES: { + description: "AWS SES US East (N. Virginia)", + host: "email-smtp.us-east-1.amazonaws.com", + port: 465, + secure: true + }, + "SES-AP-NORTHEAST-1": { + description: "AWS SES Asia Pacific (Tokyo)", + host: "email-smtp.ap-northeast-1.amazonaws.com", + port: 465, + secure: true + }, + "SES-AP-NORTHEAST-2": { + description: "AWS SES Asia Pacific (Seoul)", + host: "email-smtp.ap-northeast-2.amazonaws.com", + port: 465, + secure: true + }, + "SES-AP-NORTHEAST-3": { + description: "AWS SES Asia Pacific (Osaka)", + host: "email-smtp.ap-northeast-3.amazonaws.com", + port: 465, + secure: true + }, + "SES-AP-SOUTH-1": { + description: "AWS SES Asia Pacific (Mumbai)", + host: "email-smtp.ap-south-1.amazonaws.com", + port: 465, + secure: true + }, + "SES-AP-SOUTHEAST-1": { + description: "AWS SES Asia Pacific (Singapore)", + host: "email-smtp.ap-southeast-1.amazonaws.com", + port: 465, + secure: true + }, + "SES-AP-SOUTHEAST-2": { + description: "AWS SES Asia Pacific (Sydney)", + host: "email-smtp.ap-southeast-2.amazonaws.com", + port: 465, + secure: true + }, + "SES-CA-CENTRAL-1": { + description: "AWS SES Canada (Central)", + host: "email-smtp.ca-central-1.amazonaws.com", + port: 465, + secure: true + }, + "SES-EU-CENTRAL-1": { + description: "AWS SES Europe (Frankfurt)", + host: "email-smtp.eu-central-1.amazonaws.com", + port: 465, + secure: true + }, + "SES-EU-NORTH-1": { + description: "AWS SES Europe (Stockholm)", + host: "email-smtp.eu-north-1.amazonaws.com", + port: 465, + secure: true + }, + "SES-EU-WEST-1": { + description: "AWS SES Europe (Ireland)", + host: "email-smtp.eu-west-1.amazonaws.com", + port: 465, + secure: true + }, + "SES-EU-WEST-2": { + description: "AWS SES Europe (London)", + host: "email-smtp.eu-west-2.amazonaws.com", + port: 465, + secure: true + }, + "SES-EU-WEST-3": { + description: "AWS SES Europe (Paris)", + host: "email-smtp.eu-west-3.amazonaws.com", + port: 465, + secure: true + }, + "SES-SA-EAST-1": { + description: "AWS SES South America (S\xE3o Paulo)", + host: "email-smtp.sa-east-1.amazonaws.com", + port: 465, + secure: true + }, + "SES-US-EAST-1": { + description: "AWS SES US East (N. Virginia)", + host: "email-smtp.us-east-1.amazonaws.com", + port: 465, + secure: true + }, + "SES-US-EAST-2": { + description: "AWS SES US East (Ohio)", + host: "email-smtp.us-east-2.amazonaws.com", + port: 465, + secure: true + }, + "SES-US-GOV-EAST-1": { + description: "AWS SES GovCloud (US-East)", + host: "email-smtp.us-gov-east-1.amazonaws.com", + port: 465, + secure: true + }, + "SES-US-GOV-WEST-1": { + description: "AWS SES GovCloud (US-West)", + host: "email-smtp.us-gov-west-1.amazonaws.com", + port: 465, + secure: true + }, + "SES-US-WEST-1": { + description: "AWS SES US West (N. California)", + host: "email-smtp.us-west-1.amazonaws.com", + port: 465, + secure: true + }, + "SES-US-WEST-2": { + description: "AWS SES US West (Oregon)", + host: "email-smtp.us-west-2.amazonaws.com", + port: 465, + secure: true + }, + Seznam: { + description: "Seznam Email (Czech email provider)", + aliases: ["Seznam Email"], + domains: ["seznam.cz", "email.cz", "post.cz", "spoluzaci.cz"], + host: "smtp.seznam.cz", + port: 465, + secure: true + }, + SMTP2GO: { + description: "SMTP2GO", + host: "mail.smtp2go.com", + port: 2525 + }, + Sparkpost: { + description: "SparkPost", + aliases: ["SparkPost", "SparkPost Mail"], + domains: ["sparkpost.com"], + host: "smtp.sparkpostmail.com", + port: 587, + secure: false + }, + Tipimail: { + description: "Tipimail (email delivery service)", + host: "smtp.tipimail.com", + port: 587 + }, + Tutanota: { + description: "Tutanota (Tuta Mail)", + domains: ["tutanota.com", "tuta.com", "tutanota.de", "tuta.io"], + host: "smtp.tutanota.com", + port: 465, + secure: true + }, + Yahoo: { + description: "Yahoo Mail", + domains: ["yahoo.com"], + host: "smtp.mail.yahoo.com", + port: 465, + secure: true + }, + Yandex: { + description: "Yandex Mail", + domains: ["yandex.ru"], + host: "smtp.yandex.ru", + port: 465, + secure: true + }, + Zimbra: { + description: "Zimbra Mail Server", + aliases: ["Zimbra Collaboration"], + host: "smtp.zimbra.com", + port: 587, + requireTLS: true + }, + Zoho: { + description: "Zoho Mail", + host: "smtp.zoho.com", + port: 465, + secure: true, + authMethod: "LOGIN" + } + }; + } +}); + +// node_modules/nodemailer/lib/well-known/index.js +var require_well_known = __commonJS({ + "node_modules/nodemailer/lib/well-known/index.js"(exports2, module2) { + "use strict"; + var services = require_services(); + var normalized = {}; + Object.keys(services).forEach((key) => { + let service = services[key]; + normalized[normalizeKey(key)] = normalizeService(service); + [].concat(service.aliases || []).forEach((alias) => { + normalized[normalizeKey(alias)] = normalizeService(service); + }); + [].concat(service.domains || []).forEach((domain) => { + normalized[normalizeKey(domain)] = normalizeService(service); + }); + }); + function normalizeKey(key) { + return key.replace(/[^a-zA-Z0-9.-]/g, "").toLowerCase(); + } + function normalizeService(service) { + let filter = ["domains", "aliases"]; + let response = {}; + Object.keys(service).forEach((key) => { + if (filter.indexOf(key) < 0) { + response[key] = service[key]; + } + }); + return response; + } + module2.exports = function(key) { + key = normalizeKey(key.split("@").pop()); + return normalized[key] || false; + }; + } +}); + +// node_modules/nodemailer/lib/smtp-pool/index.js +var require_smtp_pool = __commonJS({ + "node_modules/nodemailer/lib/smtp-pool/index.js"(exports2, module2) { + "use strict"; + var EventEmitter = require("events"); + var PoolResource = require_pool_resource(); + var SMTPConnection = require_smtp_connection(); + var wellKnown = require_well_known(); + var shared = require_shared2(); + var packageData = require_package4(); + var SMTPPool = class extends EventEmitter { + constructor(options) { + super(); + options = options || {}; + if (typeof options === "string") { + options = { + url: options + }; + } + let urlData; + let service = options.service; + if (typeof options.getSocket === "function") { + this.getSocket = options.getSocket; + } + if (options.url) { + urlData = shared.parseConnectionUrl(options.url); + service = service || urlData.service; + } + this.options = shared.assign( + false, + // create new object + options, + // regular options + urlData, + // url options + service && wellKnown(service) + // wellknown options + ); + this.options.maxConnections = this.options.maxConnections || 5; + this.options.maxMessages = this.options.maxMessages || 100; + this.logger = shared.getLogger(this.options, { + component: this.options.component || "smtp-pool" + }); + let connection = new SMTPConnection(this.options); + this.name = "SMTP (pool)"; + this.version = packageData.version + "[client:" + connection.version + "]"; + this._rateLimit = { + counter: 0, + timeout: null, + waiting: [], + checkpoint: false, + delta: Number(this.options.rateDelta) || 1e3, + limit: Number(this.options.rateLimit) || 0 + }; + this._closed = false; + this._queue = []; + this._connections = []; + this._connectionCounter = 0; + this.idling = true; + setImmediate(() => { + if (this.idling) { + this.emit("idle"); + } + }); + } + /** + * Placeholder function for creating proxy sockets. This method immediatelly returns + * without a socket + * + * @param {Object} options Connection options + * @param {Function} callback Callback function to run with the socket keys + */ + getSocket(options, callback) { + return setImmediate(() => callback(null, false)); + } + /** + * Queues an e-mail to be sent using the selected settings + * + * @param {Object} mail Mail object + * @param {Function} callback Callback function + */ + send(mail, callback) { + if (this._closed) { + return false; + } + this._queue.push({ + mail, + requeueAttempts: 0, + callback + }); + if (this.idling && this._queue.length >= this.options.maxConnections) { + this.idling = false; + } + setImmediate(() => this._processMessages()); + return true; + } + /** + * Closes all connections in the pool. If there is a message being sent, the connection + * is closed later + */ + close() { + let connection; + let len = this._connections.length; + this._closed = true; + clearTimeout(this._rateLimit.timeout); + if (!len && !this._queue.length) { + return; + } + for (let i4 = len - 1; i4 >= 0; i4--) { + if (this._connections[i4] && this._connections[i4].available) { + connection = this._connections[i4]; + connection.close(); + this.logger.info( + { + tnx: "connection", + cid: connection.id, + action: "removed" + }, + "Connection #%s removed", + connection.id + ); + } + } + if (len && !this._connections.length) { + this.logger.debug( + { + tnx: "connection" + }, + "All connections removed" + ); + } + if (!this._queue.length) { + return; + } + let invokeCallbacks = () => { + if (!this._queue.length) { + this.logger.debug( + { + tnx: "connection" + }, + "Pending queue entries cleared" + ); + return; + } + let entry = this._queue.shift(); + if (entry && typeof entry.callback === "function") { + try { + entry.callback(new Error("Connection pool was closed")); + } catch (E2) { + this.logger.error( + { + err: E2, + tnx: "callback", + cid: connection.id + }, + "Callback error for #%s: %s", + connection.id, + E2.message + ); + } + } + setImmediate(invokeCallbacks); + }; + setImmediate(invokeCallbacks); + } + /** + * Check the queue and available connections. If there is a message to be sent and there is + * an available connection, then use this connection to send the mail + */ + _processMessages() { + let connection; + let i4, len; + if (this._closed) { + return; + } + if (!this._queue.length) { + if (!this.idling) { + this.idling = true; + this.emit("idle"); + } + return; + } + for (i4 = 0, len = this._connections.length; i4 < len; i4++) { + if (this._connections[i4].available) { + connection = this._connections[i4]; + break; + } + } + if (!connection && this._connections.length < this.options.maxConnections) { + connection = this._createConnection(); + } + if (!connection) { + this.idling = false; + return; + } + if (!this.idling && this._queue.length < this.options.maxConnections) { + this.idling = true; + this.emit("idle"); + } + let entry = connection.queueEntry = this._queue.shift(); + entry.messageId = (connection.queueEntry.mail.message.getHeader("message-id") || "").replace(/[<>\s]/g, ""); + connection.available = false; + this.logger.debug( + { + tnx: "pool", + cid: connection.id, + messageId: entry.messageId, + action: "assign" + }, + "Assigned message <%s> to #%s (%s)", + entry.messageId, + connection.id, + connection.messages + 1 + ); + if (this._rateLimit.limit) { + this._rateLimit.counter++; + if (!this._rateLimit.checkpoint) { + this._rateLimit.checkpoint = Date.now(); + } + } + connection.send(entry.mail, (err, info) => { + if (entry === connection.queueEntry) { + try { + entry.callback(err, info); + } catch (E2) { + this.logger.error( + { + err: E2, + tnx: "callback", + cid: connection.id + }, + "Callback error for #%s: %s", + connection.id, + E2.message + ); + } + connection.queueEntry = false; + } + }); + } + /** + * Creates a new pool resource + */ + _createConnection() { + let connection = new PoolResource(this); + connection.id = ++this._connectionCounter; + this.logger.info( + { + tnx: "pool", + cid: connection.id, + action: "conection" + }, + "Created new pool resource #%s", + connection.id + ); + connection.on("available", () => { + this.logger.debug( + { + tnx: "connection", + cid: connection.id, + action: "available" + }, + "Connection #%s became available", + connection.id + ); + if (this._closed) { + this.close(); + } else { + this._processMessages(); + } + }); + connection.once("error", (err) => { + if (err.code !== "EMAXLIMIT") { + this.logger.error( + { + err, + tnx: "pool", + cid: connection.id + }, + "Pool Error for #%s: %s", + connection.id, + err.message + ); + } else { + this.logger.debug( + { + tnx: "pool", + cid: connection.id, + action: "maxlimit" + }, + "Max messages limit exchausted for #%s", + connection.id + ); + } + if (connection.queueEntry) { + try { + connection.queueEntry.callback(err); + } catch (E2) { + this.logger.error( + { + err: E2, + tnx: "callback", + cid: connection.id + }, + "Callback error for #%s: %s", + connection.id, + E2.message + ); + } + connection.queueEntry = false; + } + this._removeConnection(connection); + this._continueProcessing(); + }); + connection.once("close", () => { + this.logger.info( + { + tnx: "connection", + cid: connection.id, + action: "closed" + }, + "Connection #%s was closed", + connection.id + ); + this._removeConnection(connection); + if (connection.queueEntry) { + setTimeout(() => { + if (connection.queueEntry) { + if (this._shouldRequeuOnConnectionClose(connection.queueEntry)) { + this._requeueEntryOnConnectionClose(connection); + } else { + this._failDeliveryOnConnectionClose(connection); + } + } + this._continueProcessing(); + }, 50); + } else { + if (!this._closed && this.idling && !this._connections.length) { + this.emit("clear"); + } + this._continueProcessing(); + } + }); + this._connections.push(connection); + return connection; + } + _shouldRequeuOnConnectionClose(queueEntry) { + if (this.options.maxRequeues === void 0 || this.options.maxRequeues < 0) { + return true; + } + return queueEntry.requeueAttempts < this.options.maxRequeues; + } + _failDeliveryOnConnectionClose(connection) { + if (connection.queueEntry && connection.queueEntry.callback) { + try { + connection.queueEntry.callback(new Error("Reached maximum number of retries after connection was closed")); + } catch (E2) { + this.logger.error( + { + err: E2, + tnx: "callback", + messageId: connection.queueEntry.messageId, + cid: connection.id + }, + "Callback error for #%s: %s", + connection.id, + E2.message + ); + } + connection.queueEntry = false; + } + } + _requeueEntryOnConnectionClose(connection) { + connection.queueEntry.requeueAttempts = connection.queueEntry.requeueAttempts + 1; + this.logger.debug( + { + tnx: "pool", + cid: connection.id, + messageId: connection.queueEntry.messageId, + action: "requeue" + }, + "Re-queued message <%s> for #%s. Attempt: #%s", + connection.queueEntry.messageId, + connection.id, + connection.queueEntry.requeueAttempts + ); + this._queue.unshift(connection.queueEntry); + connection.queueEntry = false; + } + /** + * Continue to process message if the pool hasn't closed + */ + _continueProcessing() { + if (this._closed) { + this.close(); + } else { + setTimeout(() => this._processMessages(), 100); + } + } + /** + * Remove resource from pool + * + * @param {Object} connection The PoolResource to remove + */ + _removeConnection(connection) { + let index = this._connections.indexOf(connection); + if (index !== -1) { + this._connections.splice(index, 1); + } + } + /** + * Checks if connections have hit current rate limit and if so, queues the availability callback + * + * @param {Function} callback Callback function to run once rate limiter has been cleared + */ + _checkRateLimit(callback) { + if (!this._rateLimit.limit) { + return callback(); + } + let now = Date.now(); + if (this._rateLimit.counter < this._rateLimit.limit) { + return callback(); + } + this._rateLimit.waiting.push(callback); + if (this._rateLimit.checkpoint <= now - this._rateLimit.delta) { + return this._clearRateLimit(); + } else if (!this._rateLimit.timeout) { + this._rateLimit.timeout = setTimeout(() => this._clearRateLimit(), this._rateLimit.delta - (now - this._rateLimit.checkpoint)); + this._rateLimit.checkpoint = now; + } + } + /** + * Clears current rate limit limitation and runs paused callback + */ + _clearRateLimit() { + clearTimeout(this._rateLimit.timeout); + this._rateLimit.timeout = null; + this._rateLimit.counter = 0; + this._rateLimit.checkpoint = false; + while (this._rateLimit.waiting.length) { + let cb = this._rateLimit.waiting.shift(); + setImmediate(cb); + } + } + /** + * Returns true if there are free slots in the queue + */ + isIdle() { + return this.idling; + } + /** + * Verifies SMTP configuration + * + * @param {Function} callback Callback function + */ + verify(callback) { + let promise; + if (!callback) { + promise = new Promise((resolve, reject) => { + callback = shared.callbackPromise(resolve, reject); + }); + } + let auth = new PoolResource(this).auth; + this.getSocket(this.options, (err, socketOptions) => { + if (err) { + return callback(err); + } + let options = this.options; + if (socketOptions && socketOptions.connection) { + this.logger.info( + { + tnx: "proxy", + remoteAddress: socketOptions.connection.remoteAddress, + remotePort: socketOptions.connection.remotePort, + destHost: options.host || "", + destPort: options.port || "", + action: "connected" + }, + "Using proxied socket from %s:%s to %s:%s", + socketOptions.connection.remoteAddress, + socketOptions.connection.remotePort, + options.host || "", + options.port || "" + ); + options = shared.assign(false, options); + Object.keys(socketOptions).forEach((key) => { + options[key] = socketOptions[key]; + }); + } + let connection = new SMTPConnection(options); + let returned = false; + connection.once("error", (err2) => { + if (returned) { + return; + } + returned = true; + connection.close(); + return callback(err2); + }); + connection.once("end", () => { + if (returned) { + return; + } + returned = true; + return callback(new Error("Connection closed")); + }); + let finalize = () => { + if (returned) { + return; + } + returned = true; + connection.quit(); + return callback(null, true); + }; + connection.connect(() => { + if (returned) { + return; + } + if (auth && (connection.allowsAuth || options.forceAuth)) { + connection.login(auth, (err2) => { + if (returned) { + return; + } + if (err2) { + returned = true; + connection.close(); + return callback(err2); + } + finalize(); + }); + } else if (!auth && connection.allowsAuth && options.forceAuth) { + let err2 = new Error("Authentication info was not provided"); + err2.code = "NoAuth"; + returned = true; + connection.close(); + return callback(err2); + } else { + finalize(); + } + }); + }); + return promise; + } + }; + module2.exports = SMTPPool; + } +}); + +// node_modules/nodemailer/lib/smtp-transport/index.js +var require_smtp_transport = __commonJS({ + "node_modules/nodemailer/lib/smtp-transport/index.js"(exports2, module2) { + "use strict"; + var EventEmitter = require("events"); + var SMTPConnection = require_smtp_connection(); + var wellKnown = require_well_known(); + var shared = require_shared2(); + var XOAuth2 = require_xoauth2(); + var packageData = require_package4(); + var SMTPTransport = class extends EventEmitter { + constructor(options) { + super(); + options = options || {}; + if (typeof options === "string") { + options = { + url: options + }; + } + let urlData; + let service = options.service; + if (typeof options.getSocket === "function") { + this.getSocket = options.getSocket; + } + if (options.url) { + urlData = shared.parseConnectionUrl(options.url); + service = service || urlData.service; + } + this.options = shared.assign( + false, + // create new object + options, + // regular options + urlData, + // url options + service && wellKnown(service) + // wellknown options + ); + this.logger = shared.getLogger(this.options, { + component: this.options.component || "smtp-transport" + }); + let connection = new SMTPConnection(this.options); + this.name = "SMTP"; + this.version = packageData.version + "[client:" + connection.version + "]"; + if (this.options.auth) { + this.auth = this.getAuth({}); + } + } + /** + * Placeholder function for creating proxy sockets. This method immediatelly returns + * without a socket + * + * @param {Object} options Connection options + * @param {Function} callback Callback function to run with the socket keys + */ + getSocket(options, callback) { + return setImmediate(() => callback(null, false)); + } + getAuth(authOpts) { + if (!authOpts) { + return this.auth; + } + let hasAuth = false; + let authData = {}; + if (this.options.auth && typeof this.options.auth === "object") { + Object.keys(this.options.auth).forEach((key) => { + hasAuth = true; + authData[key] = this.options.auth[key]; + }); + } + if (authOpts && typeof authOpts === "object") { + Object.keys(authOpts).forEach((key) => { + hasAuth = true; + authData[key] = authOpts[key]; + }); + } + if (!hasAuth) { + return false; + } + switch ((authData.type || "").toString().toUpperCase()) { + case "OAUTH2": { + if (!authData.service && !authData.user) { + return false; + } + let oauth2 = new XOAuth2(authData, this.logger); + oauth2.provisionCallback = this.mailer && this.mailer.get("oauth2_provision_cb") || oauth2.provisionCallback; + oauth2.on("token", (token) => this.mailer.emit("token", token)); + oauth2.on("error", (err) => this.emit("error", err)); + return { + type: "OAUTH2", + user: authData.user, + oauth2, + method: "XOAUTH2" + }; + } + default: + return { + type: (authData.type || "").toString().toUpperCase() || "LOGIN", + user: authData.user, + credentials: { + user: authData.user || "", + pass: authData.pass, + options: authData.options + }, + method: (authData.method || "").trim().toUpperCase() || this.options.authMethod || false + }; + } + } + /** + * Sends an e-mail using the selected settings + * + * @param {Object} mail Mail object + * @param {Function} callback Callback function + */ + send(mail, callback) { + this.getSocket(this.options, (err, socketOptions) => { + if (err) { + return callback(err); + } + let returned = false; + let options = this.options; + if (socketOptions && socketOptions.connection) { + this.logger.info( + { + tnx: "proxy", + remoteAddress: socketOptions.connection.remoteAddress, + remotePort: socketOptions.connection.remotePort, + destHost: options.host || "", + destPort: options.port || "", + action: "connected" + }, + "Using proxied socket from %s:%s to %s:%s", + socketOptions.connection.remoteAddress, + socketOptions.connection.remotePort, + options.host || "", + options.port || "" + ); + options = shared.assign(false, options); + Object.keys(socketOptions).forEach((key) => { + options[key] = socketOptions[key]; + }); + } + let connection = new SMTPConnection(options); + connection.once("error", (err2) => { + if (returned) { + return; + } + returned = true; + connection.close(); + return callback(err2); + }); + connection.once("end", () => { + if (returned) { + return; + } + let timer = setTimeout(() => { + if (returned) { + return; + } + returned = true; + let err2 = new Error("Unexpected socket close"); + if (connection && connection._socket && connection._socket.upgrading) { + err2.code = "ETLS"; + } + callback(err2); + }, 1e3); + try { + timer.unref(); + } catch (_E2) { + } + }); + let sendMessage = () => { + let envelope = mail.message.getEnvelope(); + let messageId = mail.message.messageId(); + let recipients = [].concat(envelope.to || []); + if (recipients.length > 3) { + recipients.push("...and " + recipients.splice(2).length + " more"); + } + if (mail.data.dsn) { + envelope.dsn = mail.data.dsn; + } + if (mail.data.requireTLSExtensionEnabled) { + envelope.requireTLSExtensionEnabled = mail.data.requireTLSExtensionEnabled; + } + this.logger.info( + { + tnx: "send", + messageId + }, + "Sending message %s to <%s>", + messageId, + recipients.join(", ") + ); + connection.send(envelope, mail.message.createReadStream(), (err2, info) => { + returned = true; + connection.close(); + if (err2) { + this.logger.error( + { + err: err2, + tnx: "send" + }, + "Send error for %s: %s", + messageId, + err2.message + ); + return callback(err2); + } + info.envelope = { + from: envelope.from, + to: envelope.to + }; + info.messageId = messageId; + try { + return callback(null, info); + } catch (E2) { + this.logger.error( + { + err: E2, + tnx: "callback" + }, + "Callback error for %s: %s", + messageId, + E2.message + ); + } + }); + }; + connection.connect(() => { + if (returned) { + return; + } + let auth = this.getAuth(mail.data.auth); + if (auth && (connection.allowsAuth || options.forceAuth)) { + connection.login(auth, (err2) => { + if (auth && auth !== this.auth && auth.oauth2) { + auth.oauth2.removeAllListeners(); + } + if (returned) { + return; + } + if (err2) { + returned = true; + connection.close(); + return callback(err2); + } + sendMessage(); + }); + } else { + sendMessage(); + } + }); + }); + } + /** + * Verifies SMTP configuration + * + * @param {Function} callback Callback function + */ + verify(callback) { + let promise; + if (!callback) { + promise = new Promise((resolve, reject) => { + callback = shared.callbackPromise(resolve, reject); + }); + } + this.getSocket(this.options, (err, socketOptions) => { + if (err) { + return callback(err); + } + let options = this.options; + if (socketOptions && socketOptions.connection) { + this.logger.info( + { + tnx: "proxy", + remoteAddress: socketOptions.connection.remoteAddress, + remotePort: socketOptions.connection.remotePort, + destHost: options.host || "", + destPort: options.port || "", + action: "connected" + }, + "Using proxied socket from %s:%s to %s:%s", + socketOptions.connection.remoteAddress, + socketOptions.connection.remotePort, + options.host || "", + options.port || "" + ); + options = shared.assign(false, options); + Object.keys(socketOptions).forEach((key) => { + options[key] = socketOptions[key]; + }); + } + let connection = new SMTPConnection(options); + let returned = false; + connection.once("error", (err2) => { + if (returned) { + return; + } + returned = true; + connection.close(); + return callback(err2); + }); + connection.once("end", () => { + if (returned) { + return; + } + returned = true; + return callback(new Error("Connection closed")); + }); + let finalize = () => { + if (returned) { + return; + } + returned = true; + connection.quit(); + return callback(null, true); + }; + connection.connect(() => { + if (returned) { + return; + } + let authData = this.getAuth({}); + if (authData && (connection.allowsAuth || options.forceAuth)) { + connection.login(authData, (err2) => { + if (returned) { + return; + } + if (err2) { + returned = true; + connection.close(); + return callback(err2); + } + finalize(); + }); + } else if (!authData && connection.allowsAuth && options.forceAuth) { + let err2 = new Error("Authentication info was not provided"); + err2.code = "NoAuth"; + returned = true; + connection.close(); + return callback(err2); + } else { + finalize(); + } + }); + }); + return promise; + } + /** + * Releases resources + */ + close() { + if (this.auth && this.auth.oauth2) { + this.auth.oauth2.removeAllListeners(); + } + this.emit("close"); + } + }; + module2.exports = SMTPTransport; + } +}); + +// node_modules/nodemailer/lib/sendmail-transport/index.js +var require_sendmail_transport = __commonJS({ + "node_modules/nodemailer/lib/sendmail-transport/index.js"(exports2, module2) { + "use strict"; + var spawn = require("child_process").spawn; + var packageData = require_package4(); + var shared = require_shared2(); + var SendmailTransport = class { + constructor(options) { + options = options || {}; + this._spawn = spawn; + this.options = options || {}; + this.name = "Sendmail"; + this.version = packageData.version; + this.path = "sendmail"; + this.args = false; + this.winbreak = false; + this.logger = shared.getLogger(this.options, { + component: this.options.component || "sendmail" + }); + if (options) { + if (typeof options === "string") { + this.path = options; + } else if (typeof options === "object") { + if (options.path) { + this.path = options.path; + } + if (Array.isArray(options.args)) { + this.args = options.args; + } + this.winbreak = ["win", "windows", "dos", "\r\n"].includes((options.newline || "").toString().toLowerCase()); + } + } + } + /** + *

Compiles a mailcomposer message and forwards it to handler that sends it.

+ * + * @param {Object} emailMessage MailComposer object + * @param {Function} callback Callback function to run when the sending is completed + */ + send(mail, done) { + mail.message.keepBcc = true; + let envelope = mail.data.envelope || mail.message.getEnvelope(); + let messageId = mail.message.messageId(); + let args2; + let sendmail; + let returned; + const hasInvalidAddresses = [].concat(envelope.from || []).concat(envelope.to || []).some((addr) => /^-/.test(addr)); + if (hasInvalidAddresses) { + return done(new Error("Can not send mail. Invalid envelope addresses.")); + } + if (this.args) { + args2 = ["-i"].concat(this.args).concat(envelope.to); + } else { + args2 = ["-i"].concat(envelope.from ? ["-f", envelope.from] : []).concat(envelope.to); + } + let callback = (err) => { + if (returned) { + return; + } + returned = true; + if (typeof done === "function") { + if (err) { + return done(err); + } else { + return done(null, { + envelope: mail.data.envelope || mail.message.getEnvelope(), + messageId, + response: "Messages queued for delivery" + }); + } + } + }; + try { + sendmail = this._spawn(this.path, args2); + } catch (E2) { + this.logger.error( + { + err: E2, + tnx: "spawn", + messageId + }, + "Error occurred while spawning sendmail. %s", + E2.message + ); + return callback(E2); + } + if (sendmail) { + sendmail.on("error", (err) => { + this.logger.error( + { + err, + tnx: "spawn", + messageId + }, + "Error occurred when sending message %s. %s", + messageId, + err.message + ); + callback(err); + }); + sendmail.once("exit", (code) => { + if (!code) { + return callback(); + } + let err; + if (code === 127) { + err = new Error("Sendmail command not found, process exited with code " + code); + } else { + err = new Error("Sendmail exited with code " + code); + } + this.logger.error( + { + err, + tnx: "stdin", + messageId + }, + "Error sending message %s to sendmail. %s", + messageId, + err.message + ); + callback(err); + }); + sendmail.once("close", callback); + sendmail.stdin.on("error", (err) => { + this.logger.error( + { + err, + tnx: "stdin", + messageId + }, + "Error occurred when piping message %s to sendmail. %s", + messageId, + err.message + ); + callback(err); + }); + let recipients = [].concat(envelope.to || []); + if (recipients.length > 3) { + recipients.push("...and " + recipients.splice(2).length + " more"); + } + this.logger.info( + { + tnx: "send", + messageId + }, + "Sending message %s to <%s>", + messageId, + recipients.join(", ") + ); + let sourceStream = mail.message.createReadStream(); + sourceStream.once("error", (err) => { + this.logger.error( + { + err, + tnx: "stdin", + messageId + }, + "Error occurred when generating message %s. %s", + messageId, + err.message + ); + sendmail.kill("SIGINT"); + callback(err); + }); + sourceStream.pipe(sendmail.stdin); + } else { + return callback(new Error("sendmail was not found")); + } + } + }; + module2.exports = SendmailTransport; + } +}); + +// node_modules/nodemailer/lib/stream-transport/index.js +var require_stream_transport = __commonJS({ + "node_modules/nodemailer/lib/stream-transport/index.js"(exports2, module2) { + "use strict"; + var packageData = require_package4(); + var shared = require_shared2(); + var StreamTransport = class { + constructor(options) { + options = options || {}; + this.options = options || {}; + this.name = "StreamTransport"; + this.version = packageData.version; + this.logger = shared.getLogger(this.options, { + component: this.options.component || "stream-transport" + }); + this.winbreak = ["win", "windows", "dos", "\r\n"].includes((options.newline || "").toString().toLowerCase()); + } + /** + * Compiles a mailcomposer message and forwards it to handler that sends it + * + * @param {Object} emailMessage MailComposer object + * @param {Function} callback Callback function to run when the sending is completed + */ + send(mail, done) { + mail.message.keepBcc = true; + let envelope = mail.data.envelope || mail.message.getEnvelope(); + let messageId = mail.message.messageId(); + let recipients = [].concat(envelope.to || []); + if (recipients.length > 3) { + recipients.push("...and " + recipients.splice(2).length + " more"); + } + this.logger.info( + { + tnx: "send", + messageId + }, + "Sending message %s to <%s> using %s line breaks", + messageId, + recipients.join(", "), + this.winbreak ? "" : "" + ); + setImmediate(() => { + let stream; + try { + stream = mail.message.createReadStream(); + } catch (E2) { + this.logger.error( + { + err: E2, + tnx: "send", + messageId + }, + "Creating send stream failed for %s. %s", + messageId, + E2.message + ); + return done(E2); + } + if (!this.options.buffer) { + stream.once("error", (err) => { + this.logger.error( + { + err, + tnx: "send", + messageId + }, + "Failed creating message for %s. %s", + messageId, + err.message + ); + }); + return done(null, { + envelope: mail.data.envelope || mail.message.getEnvelope(), + messageId, + message: stream + }); + } + let chunks = []; + let chunklen = 0; + stream.on("readable", () => { + let chunk; + while ((chunk = stream.read()) !== null) { + chunks.push(chunk); + chunklen += chunk.length; + } + }); + stream.once("error", (err) => { + this.logger.error( + { + err, + tnx: "send", + messageId + }, + "Failed creating message for %s. %s", + messageId, + err.message + ); + return done(err); + }); + stream.on( + "end", + () => done(null, { + envelope: mail.data.envelope || mail.message.getEnvelope(), + messageId, + message: Buffer.concat(chunks, chunklen) + }) + ); + }); + } + }; + module2.exports = StreamTransport; + } +}); + +// node_modules/nodemailer/lib/json-transport/index.js +var require_json_transport = __commonJS({ + "node_modules/nodemailer/lib/json-transport/index.js"(exports2, module2) { + "use strict"; + var packageData = require_package4(); + var shared = require_shared2(); + var JSONTransport = class { + constructor(options) { + options = options || {}; + this.options = options || {}; + this.name = "JSONTransport"; + this.version = packageData.version; + this.logger = shared.getLogger(this.options, { + component: this.options.component || "json-transport" + }); + } + /** + *

Compiles a mailcomposer message and forwards it to handler that sends it.

+ * + * @param {Object} emailMessage MailComposer object + * @param {Function} callback Callback function to run when the sending is completed + */ + send(mail, done) { + mail.message.keepBcc = true; + let envelope = mail.data.envelope || mail.message.getEnvelope(); + let messageId = mail.message.messageId(); + let recipients = [].concat(envelope.to || []); + if (recipients.length > 3) { + recipients.push("...and " + recipients.splice(2).length + " more"); + } + this.logger.info( + { + tnx: "send", + messageId + }, + "Composing JSON structure of %s to <%s>", + messageId, + recipients.join(", ") + ); + setImmediate(() => { + mail.normalize((err, data2) => { + if (err) { + this.logger.error( + { + err, + tnx: "send", + messageId + }, + "Failed building JSON structure for %s. %s", + messageId, + err.message + ); + return done(err); + } + delete data2.envelope; + delete data2.normalizedHeaders; + return done(null, { + envelope, + messageId, + message: this.options.skipEncoding ? data2 : JSON.stringify(data2) + }); + }); + }); + } + }; + module2.exports = JSONTransport; + } +}); + +// node_modules/nodemailer/lib/ses-transport/index.js +var require_ses_transport = __commonJS({ + "node_modules/nodemailer/lib/ses-transport/index.js"(exports2, module2) { + "use strict"; + var EventEmitter = require("events"); + var packageData = require_package4(); + var shared = require_shared2(); + var LeWindows = require_le_windows(); + var MimeNode = require_mime_node(); + var SESTransport = class extends EventEmitter { + constructor(options) { + super(); + options = options || {}; + this.options = options || {}; + this.ses = this.options.SES; + this.name = "SESTransport"; + this.version = packageData.version; + this.logger = shared.getLogger(this.options, { + component: this.options.component || "ses-transport" + }); + } + getRegion(cb) { + if (this.ses.sesClient.config && typeof this.ses.sesClient.config.region === "function") { + return this.ses.sesClient.config.region().then((region) => cb(null, region)).catch((err) => cb(err)); + } + return cb(null, false); + } + /** + * Compiles a mailcomposer message and forwards it to SES + * + * @param {Object} emailMessage MailComposer object + * @param {Function} callback Callback function to run when the sending is completed + */ + send(mail, callback) { + let statObject = { + ts: Date.now(), + pending: true + }; + let fromHeader = mail.message._headers.find((header) => /^from$/i.test(header.key)); + if (fromHeader) { + let mimeNode = new MimeNode("text/plain"); + fromHeader = mimeNode._convertAddresses(mimeNode._parseAddresses(fromHeader.value)); + } + let envelope = mail.data.envelope || mail.message.getEnvelope(); + let messageId = mail.message.messageId(); + let recipients = [].concat(envelope.to || []); + if (recipients.length > 3) { + recipients.push("...and " + recipients.splice(2).length + " more"); + } + this.logger.info( + { + tnx: "send", + messageId + }, + "Sending message %s to <%s>", + messageId, + recipients.join(", ") + ); + let getRawMessage = (next) => { + if (!mail.data._dkim) { + mail.data._dkim = {}; + } + if (mail.data._dkim.skipFields && typeof mail.data._dkim.skipFields === "string") { + mail.data._dkim.skipFields += ":date:message-id"; + } else { + mail.data._dkim.skipFields = "date:message-id"; + } + let sourceStream = mail.message.createReadStream(); + let stream = sourceStream.pipe(new LeWindows()); + let chunks = []; + let chunklen = 0; + stream.on("readable", () => { + let chunk; + while ((chunk = stream.read()) !== null) { + chunks.push(chunk); + chunklen += chunk.length; + } + }); + sourceStream.once("error", (err) => stream.emit("error", err)); + stream.once("error", (err) => { + next(err); + }); + stream.once("end", () => next(null, Buffer.concat(chunks, chunklen))); + }; + setImmediate( + () => getRawMessage((err, raw) => { + if (err) { + this.logger.error( + { + err, + tnx: "send", + messageId + }, + "Failed creating message for %s. %s", + messageId, + err.message + ); + statObject.pending = false; + return callback(err); + } + let sesMessage = { + Content: { + Raw: { + // required + Data: raw + // required + } + }, + FromEmailAddress: fromHeader ? fromHeader : envelope.from, + Destination: { + ToAddresses: envelope.to + } + }; + Object.keys(mail.data.ses || {}).forEach((key) => { + sesMessage[key] = mail.data.ses[key]; + }); + this.getRegion((err2, region) => { + if (err2 || !region) { + region = "us-east-1"; + } + const command = new this.ses.SendEmailCommand(sesMessage); + const sendPromise = this.ses.sesClient.send(command); + sendPromise.then((data2) => { + if (region === "us-east-1") { + region = "email"; + } + statObject.pending = true; + callback(null, { + envelope: { + from: envelope.from, + to: envelope.to + }, + messageId: "<" + data2.MessageId + (!/@/.test(data2.MessageId) ? "@" + region + ".amazonses.com" : "") + ">", + response: data2.MessageId, + raw + }); + }).catch((err3) => { + this.logger.error( + { + err: err3, + tnx: "send" + }, + "Send error for %s: %s", + messageId, + err3.message + ); + statObject.pending = false; + callback(err3); + }); + }); + }) + ); + } + /** + * Verifies SES configuration + * + * @param {Function} callback Callback function + */ + verify(callback) { + let promise; + if (!callback) { + promise = new Promise((resolve, reject) => { + callback = shared.callbackPromise(resolve, reject); + }); + } + const cb = (err) => { + if (err && !["InvalidParameterValue", "MessageRejected"].includes(err.code || err.Code || err.name)) { + return callback(err); + } + return callback(null, true); + }; + const sesMessage = { + Content: { + Raw: { + Data: Buffer.from("From: \r\nTo: \r\n Subject: Invalid\r\n\r\nInvalid") + } + }, + FromEmailAddress: "invalid@invalid", + Destination: { + ToAddresses: ["invalid@invalid"] + } + }; + this.getRegion((err, region) => { + if (err || !region) { + region = "us-east-1"; + } + const command = new this.ses.SendEmailCommand(sesMessage); + const sendPromise = this.ses.sesClient.send(command); + sendPromise.then((data2) => cb(null, data2)).catch((err2) => cb(err2)); + }); + return promise; + } + }; + module2.exports = SESTransport; + } +}); + +// node_modules/nodemailer/lib/nodemailer.js +var require_nodemailer = __commonJS({ + "node_modules/nodemailer/lib/nodemailer.js"(exports2, module2) { + "use strict"; + var Mailer = require_mailer(); + var shared = require_shared2(); + var SMTPPool = require_smtp_pool(); + var SMTPTransport = require_smtp_transport(); + var SendmailTransport = require_sendmail_transport(); + var StreamTransport = require_stream_transport(); + var JSONTransport = require_json_transport(); + var SESTransport = require_ses_transport(); + var nmfetch = require_fetch(); + var packageData = require_package4(); + var ETHEREAL_API = (process.env.ETHEREAL_API || "https://api.nodemailer.com").replace(/\/+$/, ""); + var ETHEREAL_WEB = (process.env.ETHEREAL_WEB || "https://ethereal.email").replace(/\/+$/, ""); + var ETHEREAL_API_KEY = (process.env.ETHEREAL_API_KEY || "").replace(/\s*/g, "") || null; + var ETHEREAL_CACHE = ["true", "yes", "y", "1"].includes((process.env.ETHEREAL_CACHE || "yes").toString().trim().toLowerCase()); + var testAccount = false; + module2.exports.createTransport = function(transporter, defaults) { + let urlConfig; + let options; + let mailer; + if ( + // provided transporter is a configuration object, not transporter plugin + typeof transporter === "object" && typeof transporter.send !== "function" || // provided transporter looks like a connection url + typeof transporter === "string" && /^(smtps?|direct):/i.test(transporter) + ) { + if (urlConfig = typeof transporter === "string" ? transporter : transporter.url) { + options = shared.parseConnectionUrl(urlConfig); + } else { + options = transporter; + } + if (options.pool) { + transporter = new SMTPPool(options); + } else if (options.sendmail) { + transporter = new SendmailTransport(options); + } else if (options.streamTransport) { + transporter = new StreamTransport(options); + } else if (options.jsonTransport) { + transporter = new JSONTransport(options); + } else if (options.SES) { + if (options.SES.ses && options.SES.aws) { + let error2 = new Error( + "Using legacy SES configuration, expecting @aws-sdk/client-sesv2, see https://nodemailer.com/transports/ses/" + ); + error2.code = "LegacyConfig"; + throw error2; + } + transporter = new SESTransport(options); + } else { + transporter = new SMTPTransport(options); + } + } + mailer = new Mailer(transporter, options, defaults); + return mailer; + }; + module2.exports.createTestAccount = function(apiUrl, callback) { + let promise; + if (!callback && typeof apiUrl === "function") { + callback = apiUrl; + apiUrl = false; + } + if (!callback) { + promise = new Promise((resolve, reject) => { + callback = shared.callbackPromise(resolve, reject); + }); + } + if (ETHEREAL_CACHE && testAccount) { + setImmediate(() => callback(null, testAccount)); + return promise; + } + apiUrl = apiUrl || ETHEREAL_API; + let chunks = []; + let chunklen = 0; + let requestHeaders = {}; + let requestBody = { + requestor: packageData.name, + version: packageData.version + }; + if (ETHEREAL_API_KEY) { + requestHeaders.Authorization = "Bearer " + ETHEREAL_API_KEY; + } + let req = nmfetch(apiUrl + "/user", { + contentType: "application/json", + method: "POST", + headers: requestHeaders, + body: Buffer.from(JSON.stringify(requestBody)) + }); + req.on("readable", () => { + let chunk; + while ((chunk = req.read()) !== null) { + chunks.push(chunk); + chunklen += chunk.length; + } + }); + req.once("error", (err) => callback(err)); + req.once("end", () => { + let res = Buffer.concat(chunks, chunklen); + let data2; + let err; + try { + data2 = JSON.parse(res.toString()); + } catch (E2) { + err = E2; + } + if (err) { + return callback(err); + } + if (data2.status !== "success" || data2.error) { + return callback(new Error(data2.error || "Request failed")); + } + delete data2.status; + testAccount = data2; + callback(null, testAccount); + }); + return promise; + }; + module2.exports.getTestMessageUrl = function(info) { + if (!info || !info.response) { + return false; + } + let infoProps = /* @__PURE__ */ new Map(); + info.response.replace(/\[([^\]]+)\]$/, (m4, props) => { + props.replace(/\b([A-Z0-9]+)=([^\s]+)/g, (m5, key, value) => { + infoProps.set(key, value); + }); + }); + if (infoProps.has("STATUS") && infoProps.has("MSGID")) { + return (testAccount.web || ETHEREAL_WEB) + "/message/" + infoProps.get("MSGID"); + } + return false; + }; + } +}); + +// node_modules/ejs/lib/utils.js +var require_utils8 = __commonJS({ + "node_modules/ejs/lib/utils.js"(exports2) { + "use strict"; + var regExpChars = /[|\\{}()[\]^$+*?.]/g; + exports2.escapeRegExpChars = function(string) { + if (!string) { + return ""; + } + return String(string).replace(regExpChars, "\\$&"); + }; + var _ENCODE_HTML_RULES = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'" + }; + var _MATCH_HTML = /[&<>'"]/g; + function encode_char(c4) { + return _ENCODE_HTML_RULES[c4] || c4; + } + var escapeFuncStr = `var _ENCODE_HTML_RULES = { + "&": "&" + , "<": "<" + , ">": ">" + , '"': """ + , "'": "'" + } + , _MATCH_HTML = /[&<>'"]/g; +function encode_char(c) { + return _ENCODE_HTML_RULES[c] || c; +}; +`; + exports2.escapeXML = function(markup) { + return markup == void 0 ? "" : String(markup).replace(_MATCH_HTML, encode_char); + }; + exports2.escapeXML.toString = function() { + return Function.prototype.toString.call(this) + ";\n" + escapeFuncStr; + }; + exports2.shallowCopy = function(to, from) { + from = from || {}; + for (var p4 in from) { + to[p4] = from[p4]; + } + return to; + }; + exports2.shallowCopyFromList = function(to, from, list2) { + for (var i4 = 0; i4 < list2.length; i4++) { + var p4 = list2[i4]; + if (typeof from[p4] != "undefined") { + to[p4] = from[p4]; + } + } + return to; + }; + exports2.cache = { + _data: {}, + set: function(key, val) { + this._data[key] = val; + }, + get: function(key) { + return this._data[key]; + }, + remove: function(key) { + delete this._data[key]; + }, + reset: function() { + this._data = {}; + } + }; + } +}); + +// node_modules/ejs/package.json +var require_package5 = __commonJS({ + "node_modules/ejs/package.json"(exports2, module2) { + module2.exports = { + name: "ejs", + description: "Embedded JavaScript templates", + keywords: [ + "template", + "engine", + "ejs" + ], + version: "2.6.2", + author: "Matthew Eernisse (http://fleegix.org)", + contributors: [ + "Timothy Gu (https://timothygu.github.io)" + ], + license: "Apache-2.0", + main: "./lib/ejs.js", + repository: { + type: "git", + url: "git://github.com/mde/ejs.git" + }, + bugs: "https://github.com/mde/ejs/issues", + homepage: "https://github.com/mde/ejs", + dependencies: {}, + devDependencies: { + browserify: "^13.1.1", + eslint: "^4.14.0", + "git-directory-deploy": "^1.5.1", + istanbul: "~0.4.3", + jake: "^8.0.16", + jsdoc: "^3.4.0", + "lru-cache": "^4.0.1", + mocha: "^5.0.5", + "uglify-js": "^3.3.16" + }, + engines: { + node: ">=0.10.0" + }, + scripts: { + test: "jake test", + lint: 'eslint "**/*.js" Jakefile', + coverage: "istanbul cover node_modules/mocha/bin/_mocha", + doc: "jake doc", + devdoc: "jake doc[dev]" + } + }; + } +}); + +// node_modules/ejs/lib/ejs.js +var require_ejs = __commonJS({ + "node_modules/ejs/lib/ejs.js"(exports2) { + "use strict"; + var fs = require("fs"); + var path = require("path"); + var utils = require_utils8(); + var scopeOptionWarned = false; + var _VERSION_STRING = require_package5().version; + var _DEFAULT_OPEN_DELIMITER = "<"; + var _DEFAULT_CLOSE_DELIMITER = ">"; + var _DEFAULT_DELIMITER = "%"; + var _DEFAULT_LOCALS_NAME = "locals"; + var _NAME = "ejs"; + var _REGEX_STRING = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)"; + var _OPTS_PASSABLE_WITH_DATA = [ + "delimiter", + "scope", + "context", + "debug", + "compileDebug", + "client", + "_with", + "rmWhitespace", + "strict", + "filename", + "async" + ]; + var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat("cache"); + var _BOM = /^\uFEFF/; + exports2.cache = utils.cache; + exports2.fileLoader = fs.readFileSync; + exports2.localsName = _DEFAULT_LOCALS_NAME; + exports2.promiseImpl = new Function("return this;")().Promise; + exports2.resolveInclude = function(name, filename, isDir) { + var dirname = path.dirname; + var extname = path.extname; + var resolve = path.resolve; + var includePath = resolve(isDir ? filename : dirname(filename), name); + var ext = extname(name); + if (!ext) { + includePath += ".ejs"; + } + return includePath; + }; + function getIncludePath(path2, options) { + var includePath; + var filePath; + var views = options.views; + var match = /^[A-Za-z]+:\\|^\//.exec(path2); + if (match && match.length) { + includePath = exports2.resolveInclude(path2.replace(/^\/*/, ""), options.root || "/", true); + } else { + if (options.filename) { + filePath = exports2.resolveInclude(path2, options.filename); + if (fs.existsSync(filePath)) { + includePath = filePath; + } + } + if (!includePath) { + if (Array.isArray(views) && views.some(function(v4) { + filePath = exports2.resolveInclude(path2, v4, true); + return fs.existsSync(filePath); + })) { + includePath = filePath; + } + } + if (!includePath) { + throw new Error('Could not find the include file "' + options.escapeFunction(path2) + '"'); + } + } + return includePath; + } + function handleCache(options, template) { + var func; + var filename = options.filename; + var hasTemplate = arguments.length > 1; + if (options.cache) { + if (!filename) { + throw new Error("cache option requires a filename"); + } + func = exports2.cache.get(filename); + if (func) { + return func; + } + if (!hasTemplate) { + template = fileLoader(filename).toString().replace(_BOM, ""); + } + } else if (!hasTemplate) { + if (!filename) { + throw new Error("Internal EJS error: no file name or template provided"); + } + template = fileLoader(filename).toString().replace(_BOM, ""); + } + func = exports2.compile(template, options); + if (options.cache) { + exports2.cache.set(filename, func); + } + return func; + } + function tryHandleCache(options, data2, cb) { + var result; + if (!cb) { + if (typeof exports2.promiseImpl == "function") { + return new exports2.promiseImpl(function(resolve, reject) { + try { + result = handleCache(options)(data2); + resolve(result); + } catch (err) { + reject(err); + } + }); + } else { + throw new Error("Please provide a callback function"); + } + } else { + try { + result = handleCache(options)(data2); + } catch (err) { + return cb(err); + } + cb(null, result); + } + } + function fileLoader(filePath) { + return exports2.fileLoader(filePath); + } + function includeFile(path2, options) { + var opts = utils.shallowCopy({}, options); + opts.filename = getIncludePath(path2, opts); + return handleCache(opts); + } + function includeSource(path2, options) { + var opts = utils.shallowCopy({}, options); + var includePath; + var template; + includePath = getIncludePath(path2, opts); + template = fileLoader(includePath).toString().replace(_BOM, ""); + opts.filename = includePath; + var templ = new Template(template, opts); + templ.generateSource(); + return { + source: templ.source, + filename: includePath, + template + }; + } + function rethrow(err, str, flnm, lineno, esc) { + var lines = str.split("\n"); + var start = Math.max(lineno - 3, 0); + var end = Math.min(lines.length, lineno + 3); + var filename = esc(flnm); + var context = lines.slice(start, end).map(function(line, i4) { + var curr = i4 + start + 1; + return (curr == lineno ? " >> " : " ") + curr + "| " + line; + }).join("\n"); + err.path = filename; + err.message = (filename || "ejs") + ":" + lineno + "\n" + context + "\n\n" + err.message; + throw err; + } + function stripSemi(str) { + return str.replace(/;(\s*$)/, "$1"); + } + exports2.compile = function compile(template, opts) { + var templ; + if (opts && opts.scope) { + if (!scopeOptionWarned) { + console.warn("`scope` option is deprecated and will be removed in EJS 3"); + scopeOptionWarned = true; + } + if (!opts.context) { + opts.context = opts.scope; + } + delete opts.scope; + } + templ = new Template(template, opts); + return templ.compile(); + }; + exports2.render = function(template, d4, o4) { + var data2 = d4 || {}; + var opts = o4 || {}; + if (arguments.length == 2) { + utils.shallowCopyFromList(opts, data2, _OPTS_PASSABLE_WITH_DATA); + } + return handleCache(opts, template)(data2); + }; + exports2.renderFile = function() { + var args2 = Array.prototype.slice.call(arguments); + var filename = args2.shift(); + var cb; + var opts = { filename }; + var data2; + var viewOpts; + if (typeof arguments[arguments.length - 1] == "function") { + cb = args2.pop(); + } + if (args2.length) { + data2 = args2.shift(); + if (args2.length) { + utils.shallowCopy(opts, args2.pop()); + } else { + if (data2.settings) { + if (data2.settings.views) { + opts.views = data2.settings.views; + } + if (data2.settings["view cache"]) { + opts.cache = true; + } + viewOpts = data2.settings["view options"]; + if (viewOpts) { + utils.shallowCopy(opts, viewOpts); + } + } + utils.shallowCopyFromList(opts, data2, _OPTS_PASSABLE_WITH_DATA_EXPRESS); + } + opts.filename = filename; + } else { + data2 = {}; + } + return tryHandleCache(opts, data2, cb); + }; + exports2.Template = Template; + exports2.clearCache = function() { + exports2.cache.reset(); + }; + function Template(text, opts) { + opts = opts || {}; + var options = {}; + this.templateText = text; + this.mode = null; + this.truncate = false; + this.currentLine = 1; + this.source = ""; + this.dependencies = []; + options.client = opts.client || false; + options.escapeFunction = opts.escape || opts.escapeFunction || utils.escapeXML; + options.compileDebug = opts.compileDebug !== false; + options.debug = !!opts.debug; + options.filename = opts.filename; + options.openDelimiter = opts.openDelimiter || exports2.openDelimiter || _DEFAULT_OPEN_DELIMITER; + options.closeDelimiter = opts.closeDelimiter || exports2.closeDelimiter || _DEFAULT_CLOSE_DELIMITER; + options.delimiter = opts.delimiter || exports2.delimiter || _DEFAULT_DELIMITER; + options.strict = opts.strict || false; + options.context = opts.context; + options.cache = opts.cache || false; + options.rmWhitespace = opts.rmWhitespace; + options.root = opts.root; + options.outputFunctionName = opts.outputFunctionName; + options.localsName = opts.localsName || exports2.localsName || _DEFAULT_LOCALS_NAME; + options.views = opts.views; + options.async = opts.async; + if (options.strict) { + options._with = false; + } else { + options._with = typeof opts._with != "undefined" ? opts._with : true; + } + this.opts = options; + this.regex = this.createRegex(); + } + Template.modes = { + EVAL: "eval", + ESCAPED: "escaped", + RAW: "raw", + COMMENT: "comment", + LITERAL: "literal" + }; + Template.prototype = { + createRegex: function() { + var str = _REGEX_STRING; + var delim = utils.escapeRegExpChars(this.opts.delimiter); + var open = utils.escapeRegExpChars(this.opts.openDelimiter); + var close = utils.escapeRegExpChars(this.opts.closeDelimiter); + str = str.replace(/%/g, delim).replace(//g, close); + return new RegExp(str); + }, + compile: function() { + var src; + var fn2; + var opts = this.opts; + var prepended = ""; + var appended = ""; + var escapeFn = opts.escapeFunction; + var ctor; + if (!this.source) { + this.generateSource(); + prepended += " var __output = [], __append = __output.push.bind(__output);\n"; + if (opts.outputFunctionName) { + prepended += " var " + opts.outputFunctionName + " = __append;\n"; + } + if (opts._with !== false) { + prepended += " with (" + opts.localsName + " || {}) {\n"; + appended += " }\n"; + } + appended += ' return __output.join("");\n'; + this.source = prepended + this.source + appended; + } + if (opts.compileDebug) { + src = "var __line = 1\n , __lines = " + JSON.stringify(this.templateText) + "\n , __filename = " + (opts.filename ? JSON.stringify(opts.filename) : "undefined") + ";\ntry {\n" + this.source + "} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n"; + } else { + src = this.source; + } + if (opts.client) { + src = "escapeFn = escapeFn || " + escapeFn.toString() + ";\n" + src; + if (opts.compileDebug) { + src = "rethrow = rethrow || " + rethrow.toString() + ";\n" + src; + } + } + if (opts.strict) { + src = '"use strict";\n' + src; + } + if (opts.debug) { + console.log(src); + } + try { + if (opts.async) { + try { + ctor = new Function("return (async function(){}).constructor;")(); + } catch (e4) { + if (e4 instanceof SyntaxError) { + throw new Error("This environment does not support async/await"); + } else { + throw e4; + } + } + } else { + ctor = Function; + } + fn2 = new ctor(opts.localsName + ", escapeFn, include, rethrow", src); + } catch (e4) { + if (e4 instanceof SyntaxError) { + if (opts.filename) { + e4.message += " in " + opts.filename; + } + e4.message += " while compiling ejs\n\n"; + e4.message += "If the above error is not helpful, you may want to try EJS-Lint:\n"; + e4.message += "https://github.com/RyanZim/EJS-Lint"; + if (!e4.async) { + e4.message += "\n"; + e4.message += "Or, if you meant to create an async function, pass async: true as an option."; + } + } + throw e4; + } + if (opts.client) { + fn2.dependencies = this.dependencies; + return fn2; + } + var returnedFn = function(data2) { + var include = function(path2, includeData) { + var d4 = utils.shallowCopy({}, data2); + if (includeData) { + d4 = utils.shallowCopy(d4, includeData); + } + return includeFile(path2, opts)(d4); + }; + return fn2.apply(opts.context, [data2 || {}, escapeFn, include, rethrow]); + }; + returnedFn.dependencies = this.dependencies; + return returnedFn; + }, + generateSource: function() { + var opts = this.opts; + if (opts.rmWhitespace) { + this.templateText = this.templateText.replace(/[\r\n]+/g, "\n").replace(/^\s+|\s+$/gm, ""); + } + this.templateText = this.templateText.replace(/[ \t]*<%_/gm, "<%_").replace(/_%>[ \t]*/gm, "_%>"); + var self2 = this; + var matches = this.parseTemplateText(); + var d4 = this.opts.delimiter; + var o4 = this.opts.openDelimiter; + var c4 = this.opts.closeDelimiter; + if (matches && matches.length) { + matches.forEach(function(line, index) { + var opening; + var closing; + var include; + var includeOpts; + var includeObj; + var includeSrc; + if (line.indexOf(o4 + d4) === 0 && line.indexOf(o4 + d4 + d4) !== 0) { + closing = matches[index + 2]; + if (!(closing == d4 + c4 || closing == "-" + d4 + c4 || closing == "_" + d4 + c4)) { + throw new Error('Could not find matching close tag for "' + line + '".'); + } + } + if (include = line.match(/^\s*include\s+(\S+)/)) { + opening = matches[index - 1]; + if (opening && (opening == o4 + d4 || opening == o4 + d4 + "-" || opening == o4 + d4 + "_")) { + includeOpts = utils.shallowCopy({}, self2.opts); + includeObj = includeSource(include[1], includeOpts); + if (self2.opts.compileDebug) { + includeSrc = " ; (function(){\n var __line = 1\n , __lines = " + JSON.stringify(includeObj.template) + "\n , __filename = " + JSON.stringify(includeObj.filename) + ";\n try {\n" + includeObj.source + " } catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n }\n ; }).call(this)\n"; + } else { + includeSrc = " ; (function(){\n" + includeObj.source + " ; }).call(this)\n"; + } + self2.source += includeSrc; + self2.dependencies.push(exports2.resolveInclude( + include[1], + includeOpts.filename + )); + return; + } + } + self2.scanLine(line); + }); + } + }, + parseTemplateText: function() { + var str = this.templateText; + var pat = this.regex; + var result = pat.exec(str); + var arr = []; + var firstPos; + while (result) { + firstPos = result.index; + if (firstPos !== 0) { + arr.push(str.substring(0, firstPos)); + str = str.slice(firstPos); + } + arr.push(result[0]); + str = str.slice(result[0].length); + result = pat.exec(str); + } + if (str) { + arr.push(str); + } + return arr; + }, + _addOutput: function(line) { + if (this.truncate) { + line = line.replace(/^(?:\r\n|\r|\n)/, ""); + this.truncate = false; + } + if (!line) { + return line; + } + line = line.replace(/\\/g, "\\\\"); + line = line.replace(/\n/g, "\\n"); + line = line.replace(/\r/g, "\\r"); + line = line.replace(/"/g, '\\"'); + this.source += ' ; __append("' + line + '")\n'; + }, + scanLine: function(line) { + var self2 = this; + var d4 = this.opts.delimiter; + var o4 = this.opts.openDelimiter; + var c4 = this.opts.closeDelimiter; + var newLineCount = 0; + newLineCount = line.split("\n").length - 1; + switch (line) { + case o4 + d4: + case o4 + d4 + "_": + this.mode = Template.modes.EVAL; + break; + case o4 + d4 + "=": + this.mode = Template.modes.ESCAPED; + break; + case o4 + d4 + "-": + this.mode = Template.modes.RAW; + break; + case o4 + d4 + "#": + this.mode = Template.modes.COMMENT; + break; + case o4 + d4 + d4: + this.mode = Template.modes.LITERAL; + this.source += ' ; __append("' + line.replace(o4 + d4 + d4, o4 + d4) + '")\n'; + break; + case d4 + d4 + c4: + this.mode = Template.modes.LITERAL; + this.source += ' ; __append("' + line.replace(d4 + d4 + c4, d4 + c4) + '")\n'; + break; + case d4 + c4: + case "-" + d4 + c4: + case "_" + d4 + c4: + if (this.mode == Template.modes.LITERAL) { + this._addOutput(line); + } + this.mode = null; + this.truncate = line.indexOf("-") === 0 || line.indexOf("_") === 0; + break; + default: + if (this.mode) { + switch (this.mode) { + case Template.modes.EVAL: + case Template.modes.ESCAPED: + case Template.modes.RAW: + if (line.lastIndexOf("//") > line.lastIndexOf("\n")) { + line += "\n"; + } + } + switch (this.mode) { + // Just executing code + case Template.modes.EVAL: + this.source += " ; " + line + "\n"; + break; + // Exec, esc, and output + case Template.modes.ESCAPED: + this.source += " ; __append(escapeFn(" + stripSemi(line) + "))\n"; + break; + // Exec and output + case Template.modes.RAW: + this.source += " ; __append(" + stripSemi(line) + ")\n"; + break; + case Template.modes.COMMENT: + break; + // Literal <%% mode, append as raw output + case Template.modes.LITERAL: + this._addOutput(line); + break; + } + } else { + this._addOutput(line); + } + } + if (self2.opts.compileDebug && newLineCount) { + this.currentLine += newLineCount; + this.source += " ; __line = " + this.currentLine + "\n"; + } + } + }; + exports2.escapeXML = utils.escapeXML; + exports2.__express = exports2.renderFile; + if (require.extensions) { + require.extensions[".ejs"] = function(module3, flnm) { + var filename = flnm || /* istanbul ignore next */ + module3.filename; + var options = { + filename, + client: true + }; + var template = fileLoader(filename).toString(); + var fn2 = exports2.compile(template, options); + module3._compile("module.exports = " + fn2.toString() + ";", filename); + }; + } + exports2.VERSION = _VERSION_STRING; + exports2.name = _NAME; + if (typeof window != "undefined") { + window.ejs = exports2; + } + } +}); + +// utils/otpHandler.js +var require_otpHandler = __commonJS({ + "utils/otpHandler.js"(exports2, module2) { + var nodemailer = require_nodemailer(); + var ejs = require_ejs(); + var path = require("path"); + var { + NODEMAILER_EMAIL, + NODEMAILER_PASSWORD + } = require_envVariable(); + var generateOTP = () => Math.floor(1e5 + Math.random() * 9e5); + var getOTPExpiration = () => { + const expiresAt = /* @__PURE__ */ new Date(); + expiresAt.setMinutes(expiresAt.getMinutes() + 10); + return expiresAt; + }; + var transporter = nodemailer.createTransport({ + service: "gmail", + auth: { + user: NODEMAILER_EMAIL, + pass: NODEMAILER_PASSWORD + } + }); + var sendOTPEmail = async (email, otp, userName) => { + try { + const templatePath = path.join( + process.cwd(), + "templates", + "signupOtpEmail.ejs" + ); + const html = await ejs.renderFile(templatePath, { + otp, + userName + }); + await transporter.sendMail({ + from: `"Digify Menu" <${NODEMAILER_EMAIL}>`, + to: email, + subject: "Your Digify Menu OTP", + html + }); + return true; + } catch (error2) { + console.error("Error sending OTP email:", error2); + return false; + } + }; + module2.exports = { + generateOTP, + getOTPExpiration, + sendOTPEmail + }; + } +}); + +// controller/userController.js +var require_userController = __commonJS({ + "controller/userController.js"(exports2, module2) { + var { User } = require_userModel(); + var { Branch } = require_resturantModel(); + var { OTPValidate } = require_otpValidateModel(); + var { + generateOTP, + getOTPExpiration, + sendOTPEmail + } = require_otpHandler(); + var { sendResponse } = require_responseHelper(); + var bcrypt = require("bcrypt"); + var { + generateAccessToken, + generateRefreshToken + } = require_jwtHelper(); + var checkUser = async (req, res) => { + try { + const { email, password } = req.body; + if (!email) { + return sendResponse(res, 400, "Email is required"); + } + const user = await User.findOne({ email }); + if (user) { + return sendResponse(res, 400, "Mail id already exist! Try to Sign in"); + } + const otp = generateOTP(); + const expiration = getOTPExpiration(); + const otpRecord = await OTPValidate.create({ + otp, + email, + is_validate: false, + expiration_time: expiration + }); + const emailSent = await sendOTPEmail(email, otp); + if (emailSent) { + return sendResponse(res, 200, "OTP sent to email", { + otpId: otpRecord._id, + email + }); + } else { + return sendResponse(res, 500, "Failed to send OTP email"); + } + } catch (error2) { + console.error("Error in checkUser:", error2); + return sendResponse(res, 500, "Internal Server Error", { + error: error2.message + }); + } + }; + var signin = async (req, res) => { + try { + const { email, password } = req.body; + if (!email || !password) { + return sendResponse(res, 400, "Email and password are required"); + } + const user = await User.findOne({ email }); + if (!user) { + return sendResponse(res, 404, "User not found"); + } + const isMatch = await bcrypt.compare(password, user.Password); + if (!isMatch) { + return sendResponse(res, 400, "Invalid password"); + } + let tokenPayload = {}; + console.log(user.branch_id); + if (user.branch_id !== null) { + tokenPayload = { + id: user._id, + // Use _id + email: user.email, + branch_id: user.branch_id + }; + } else { + tokenPayload = { + id: user._id, + // Use _id + email: user.email, + branch_id: user.branch_id, + newUser: true + }; + } + console.log(tokenPayload); + const accessToken = generateAccessToken(tokenPayload); + const refreshToken = generateRefreshToken(tokenPayload); + console.log(accessToken); + console.log(refreshToken); + res.cookie("accessToken", accessToken, { + httpOnly: true, + secure: process.env.NODE_ENV === "production", + sameSite: "strict" + }); + res.cookie("refreshToken", refreshToken, { + httpOnly: true, + secure: process.env.NODE_ENV === "production", + sameSite: "strict" + }); + return sendResponse(res, 200, "User signed in successfully", { + user: { + branch_id: user.branch_id, + email: user.email, + username: user.username, + id: user._id + // Use _id + }, + redirect: user.branch_id ? "/dashboard" : "/registration", + success: true, + token: accessToken + }); + } catch (error2) { + console.error("Error in signin:", error2); + return sendResponse(res, 500, "Internal Server Error", { + error: error2.message + }); + } + }; + var verifyOTPAndRegister = async (req, res) => { + try { + const { otpId, otp, email, password } = req.body; + if (!otpId || !otp || !email || !password) { + return sendResponse( + res, + 400, + "All fields are required: otpId, otp, email, password" + ); + } + const otpRecord = await OTPValidate.findById(otpId); + if (!otpRecord) { + return sendResponse(res, 404, "OTP record not found"); + } + if (otpRecord.email !== email) { + return sendResponse(res, 400, "Email does not match OTP record"); + } + if (otpRecord.otp !== parseInt(otp)) { + return sendResponse(res, 400, "Invalid OTP"); + } + if (otpRecord.is_validate) { + return sendResponse(res, 400, "OTP already used"); + } + if (/* @__PURE__ */ new Date() > new Date(otpRecord.expiration_time)) { + return sendResponse(res, 400, "OTP expired"); + } + const hashedPassword = await bcrypt.hash(password, 10); + const user = await User.create({ + email, + Password: hashedPassword, + username: email.split("@")[0], + branch_id: null + }); + otpRecord.is_validate = true; + await otpRecord.save(); + let tokenPayload = {}; + console.log(user.branch_id); + if (user.branch_id !== null) { + tokenPayload = { + id: user.id, + email: user.email, + branch_id: user.branch_id + }; + } else { + tokenPayload = { + id: user.id, + email: user.email, + branch_id: user.branch_id, + newUser: true + }; + } + console.log(tokenPayload); + const accessToken = generateAccessToken(tokenPayload); + const refreshToken = generateRefreshToken(tokenPayload); + res.cookie("accessToken", accessToken, { + httpOnly: true, + secure: process.env.NODE_ENV === "production", + sameSite: "strict" + }); + res.cookie("refreshToken", refreshToken, { + httpOnly: true, + secure: process.env.NODE_ENV === "production", + sameSite: "strict" + }); + return sendResponse(res, 201, "User registered successfully", { + user, + status: null + }); + } catch (error2) { + console.error("Error in verifyOTPAndRegister:", error2); + return sendResponse(res, 500, "Internal Server Error", { + error: error2.message + }); + } + }; + module2.exports = { + checkUser, + verifyOTPAndRegister, + signin + }; + } +}); + +// controller/refreshTokenController.js +var require_refreshTokenController = __commonJS({ + "controller/refreshTokenController.js"(exports2, module2) { + var { verifyToken, generateAccessToken } = require_jwtHelper(); + var { sendResponse } = require_responseHelper(); + var refreshToken = (req, res) => { + try { + const refreshToken2 = req.cookies.refreshToken; + if (!refreshToken2) { + return sendResponse(res, 401, "Refresh token not found"); + } + const decoded = verifyToken(refreshToken2, true); + if (!decoded) { + return sendResponse(res, 403, "Invalid or expired refresh token"); + } + const user = { + id: decoded.userId, + email: decoded.email, + branch_id: decoded.branchId + }; + const newAccessToken = generateAccessToken(user); + res.cookie("accessToken", newAccessToken, { + httpOnly: true, + secure: process.env.NODE_ENV === "production", + sameSite: "strict" + }); + return sendResponse(res, 200, "Token refreshed successfully", { + token: newAccessToken + }); + } catch (error2) { + console.error("Error in refreshToken:", error2); + return sendResponse(res, 500, "Internal Server Error", { + error: error2.message + }); + } + }; + module2.exports = { refreshToken }; + } +}); + +// routes/users.js +var require_users = __commonJS({ + "routes/users.js"(exports2, module2) { + var express2 = require_express2(); + var router = express2.Router(); + var { checkUser, verifyOTPAndRegister, signin } = require_userController(); + var { refreshToken } = require_refreshTokenController(); + router.get("/", function(req, res, next) { + res.send("respond with a resource"); + }); + router.post("/check", checkUser); + router.post("/verify-otp", verifyOTPAndRegister); + router.post("/signin", signin); + router.post("/refresh-token", refreshToken); + module2.exports = router; + } +}); + +// model/categoryModel.js +var require_categoryModel = __commonJS({ + "model/categoryModel.js"(exports2, module2) { + var mongoose2 = require_mongoose2(); + var Schema2 = mongoose2.Schema; + var categorySchema = new Schema2({ + branch_id: { + type: mongoose2.Schema.Types.ObjectId, + ref: "Branch" + }, + name: String, + image_url: String, + is_active: Boolean, + display_order: Number, + is_deleted: { + type: Boolean, + default: false + } + }, { timestamps: true }); + categorySchema.index({ branch_id: 1, is_active: 1, display_order: 1 }); + var Category = mongoose2.model("Category", categorySchema); + module2.exports = { Category }; + } +}); + +// model/menuAccessLogModel.js +var require_menuAccessLogModel = __commonJS({ + "model/menuAccessLogModel.js"(exports2, module2) { + var mongoose2 = require_mongoose2(); + var Schema2 = mongoose2.Schema; + var menuAccessLogSchema = new Schema2({ + branch_id: { + type: mongoose2.Schema.Types.ObjectId, + ref: "Branch", + required: true + }, + accessed_at: { + type: Date, + default: Date.now, + required: true + } + }, { timestamps: true }); + var MenuAccessLog = mongoose2.model("MenuAccessLog", menuAccessLogSchema); + module2.exports = { MenuAccessLog }; + } +}); + +// model/menuItemModel.js +var require_menuItemModel = __commonJS({ + "model/menuItemModel.js"(exports2, module2) { + var mongoose2 = require_mongoose2(); + var Schema2 = mongoose2.Schema; + var optionsSchema = new Schema2({ + option_name: String, + option_price: Number, + option_offer_price: Number + }, { _id: true }); + var menuItemSchema = new Schema2({ + category_id: { + type: mongoose2.Schema.Types.ObjectId, + ref: "Category" + }, + name: String, + description: String, + image_url: String, + is_available: Boolean, + special_note: String, + tag: { + type: String, + enum: ["veg", "non-veg", "cool", "hot"] + }, + no_price: String, + options: [optionsSchema] + // Embedded Options + }, { timestamps: true }); + menuItemSchema.index({ category_id: 1, is_available: 1 }); + menuItemSchema.index({ name: 1 }); + var MenuItem2 = mongoose2.model("MenuItem", menuItemSchema); + module2.exports = { MenuItem: MenuItem2 }; + } +}); + +// controller/restaurantController.js +var require_restaurantController = __commonJS({ + "controller/restaurantController.js"(exports2, module2) { + var { Category } = require_categoryModel(); + var { MenuAccessLog } = require_menuAccessLogModel(); + var { MenuItem: MenuItem2 } = require_menuItemModel(); + var { Restaurant, Branch } = require_resturantModel(); + var { User } = require_userModel(); + var { + generateAccessToken, + generateRefreshToken + } = require_jwtHelper(); + var { sendResponse } = require_responseHelper(); + var mongoose2 = require_mongoose2(); + var searchRestaurants = async (req, res) => { + try { + const { search } = req.query; + if (search === "") { + return sendResponse(res, 200, "Restaurants fetched successfully", []); + } + let filter = {}; + if (search) { + filter.name = { $regex: search, $options: "i" }; + } + const restaurants = await Restaurant.find(filter).select("name logo").lean(); + return sendResponse( + res, + 200, + "Restaurants fetched successfully", + restaurants + ); + } catch (error2) { + console.error("Search restaurants error:", error2); + return sendResponse(res, 500, "Internal Server Error", { + error: error2.message + }); + } + }; + var createBranch = async (req, res) => { + let { userId } = req.params; + if (!userId || userId === "undefined" || userId === "null") { + userId = req.user.id; + } + if (!mongoose2.Types.ObjectId.isValid(userId)) { + return sendResponse(res, 400, "Invalid User ID"); + } + const session = await mongoose2.startSession(); + session.startTransaction(); + try { + const { + restaurant_id, + // Restaurant details (if creating new) + restaurant_name, + restaurant_email, + restaurant_type, + restaurant_logo, + // Branch details + branch_name, + phone, + country, + state: state2, + district, + city, + place, + // Settings details + currency, + symbol, + symbol_position, + facebook_url, + instagram_url, + google_feedback_url, + pdf_menu_url + } = req.body; + let finalRestaurantId = restaurant_id; + let currentRestaurantName = restaurant_name; + if (restaurant_id) { + const restaurant = await Restaurant.findById(restaurant_id).session( + session + ); + if (!restaurant) { + await session.abortTransaction(); + session.endSession(); + return sendResponse(res, 404, "Restaurant not found"); + } + currentRestaurantName = restaurant.name; + } else { + if (!restaurant_name) { + await session.abortTransaction(); + session.endSession(); + return sendResponse( + res, + 400, + "Restaurant name is required when creating a new restaurant" + ); + } + const newRestaurant = new Restaurant({ + name: restaurant_name, + email: restaurant_email, + phone, + type: restaurant_type, + logo: restaurant_logo, + status: "inactive" + }); + await newRestaurant.save({ session }); + finalRestaurantId = newRestaurant._id; + } + const countryCode = country ? country.substring(0, 2).toUpperCase() : "XX"; + const randomDigits = Math.floor(100 + Math.random() * 900); + const slug = `${currentRestaurantName.replace(/\s+/g, "-").toLowerCase()}-${countryCode}-${randomDigits}`; + const newBranch = new Branch({ + restaurant_id: finalRestaurantId, + name: branch_name, + phone, + email: restaurant_email, + country, + state: state2, + district, + city, + place, + slug, + status: "pending", + isActive: true, + // Note: Schema uses 'is_active', check consistency. Model defined 'is_active', ensure frontend sends right key or map it. + // Mapping 'isActive' input to 'is_active' in schema if needed, but schema has 'is_active'. + // If code used isActive, let's stick to is_active in Mongoose schema for consistency with SQL column request? + // Checking resturantModel.js: branchSchema has `is_active`. + is_active: true, + // Embedded Settings + settings: { + logo: restaurant_logo, + currency, + symbol, + symbol_position, + facebook_url, + instagram_url, + google_feedback_url, + pdf_menu_url + } + }); + await newBranch.save({ session }); + await User.findByIdAndUpdate( + userId, + { branch_id: newBranch._id }, + { session } + ); + const user = await User.findById(userId).session(session); + console.log(user); + const userPayload = { + id: user._id, + email: user.email, + branch_id: user.branch_id + }; + const accessToken = generateAccessToken(userPayload); + const refreshToken = generateRefreshToken(userPayload); + res.cookie("accessToken", accessToken, { + httpOnly: true, + secure: process.env.NODE_ENV === "production", + sameSite: "strict" + }); + res.cookie("refreshToken", refreshToken, { + httpOnly: true, + secure: process.env.NODE_ENV === "production", + sameSite: "strict" + }); + await session.commitTransaction(); + session.endSession(); + return sendResponse(res, 201, "Branch created successfully", { + branch: newBranch, + restaurant_id: finalRestaurantId + }); + } catch (error2) { + if (session.inTransaction()) { + await session.abortTransaction(); + } + session.endSession(); + console.error("Create branch error:", error2); + return sendResponse(res, 500, "Internal Server Error", { + error: error2.message + }); + } + }; + var getResturantById = async (req, res) => { + try { + const { branchId } = req.user; + const restaurant = await Branch.findById(branchId).lean(); + if (!restaurant) { + return sendResponse(res, 404, "Restaurant not found"); + } + return sendResponse(res, 200, "Restaurant fetched successfully", { + restaurant, + settings: restaurant.settings + }); + } catch (error2) { + console.error("Get restaurant error:", error2); + return sendResponse(res, 500, "Internal Server Error", { + error: error2.message + }); + } + }; + var checkRestaurantsImageExistDB = async (fileName, id = null) => { + try { + if (!fileName) { + return { success: false, exists: false }; + } + const filter = { + "settings.logo": fileName + }; + if (id) { + filter._id = { $ne: id }; + } + const exists = await Branch.findOne(filter); + return { + success: true, + exists: !!exists + }; + } catch (error2) { + console.log("Check Image in DB Error:", error2); + return { + success: false, + exists: false, + error: error2 + }; + } + }; + var updateBranchAndSettings = async (req, res) => { + const { branchId } = req.user; + const session = await mongoose2.startSession(); + session.startTransaction(); + try { + const { + // BRANCH editable fields + branch_name, + branch_phone, + branch_email, + country, + state: state2, + district, + city, + place, + description, + // SETTINGS editable fields (including LOGO) + settings_logo, + currency, + symbol, + symbol_position, + facebook_url, + instagram_url, + google_feedback_url, + pdf_menu_url + } = req.body; + const branch = await Branch.findById(branchId).session(session); + if (!branch) { + await session.abortTransaction(); + session.endSession(); + return sendResponse(res, 404, "Branch not found"); + } + if (branch_name) branch.name = branch_name; + if (branch_phone) branch.phone = branch_phone; + if (branch_email) branch.email = branch_email; + if (country) branch.country = country; + if (state2) branch.state = state2; + if (district) branch.district = district; + if (city) branch.city = city; + if (place) branch.place = place; + if (description) branch.description = description; + if (!branch.settings) branch.settings = {}; + if (settings_logo) branch.settings.logo = settings_logo; + if (currency) branch.settings.currency = currency; + if (symbol) branch.settings.symbol = symbol; + if (symbol_position) branch.settings.symbol_position = symbol_position; + if (facebook_url) branch.settings.facebook_url = facebook_url; + if (instagram_url) branch.settings.instagram_url = instagram_url; + if (google_feedback_url) + branch.settings.google_feedback_url = google_feedback_url; + if (pdf_menu_url) branch.settings.pdf_menu_url = pdf_menu_url; + await branch.save({ session }); + await session.commitTransaction(); + session.endSession(); + return sendResponse(res, 200, "Updated successfully", { + branch, + settings: branch.settings + }); + } catch (error2) { + if (session.inTransaction()) { + await session.abortTransaction(); + } + session.endSession(); + console.error("Update error:", error2); + return sendResponse(res, 500, "Internal Server Error", { + error: error2.message + }); + } + }; + var getAnalytics = async (req, res) => { + try { + const { slug } = req.params; + const branch = await Branch.findOne({ slug, is_active: true }); + if (!branch) { + return res.status(404).json({ + success: false, + message: "Branch not found" + }); + } + const branchId = branch._id; + const totalCategories = await Category.countDocuments({ + branch_id: branchId, + is_active: true + }); + const branchCategories = await Category.find({ + branch_id: branchId + }).select("_id").lean(); + const categoryIds = branchCategories.map((c4) => c4._id); + const totalItems = await MenuItem2.countDocuments({ + category_id: { $in: categoryIds } + }); + const visitors = await MenuAccessLog.aggregate([ + { $match: { branch_id: branchId } }, + { + $group: { + _id: { + month: { $month: "$accessed_at" }, + year: { $year: "$accessed_at" } + }, + count: { $sum: 1 } + } + } + ]); + let monthlyVisitors = Array(12).fill(0); + const currentYear = (/* @__PURE__ */ new Date()).getFullYear(); + visitors.forEach((row) => { + if (row._id.year === currentYear) { + monthlyVisitors[row._id.month - 1] = row.count; + } + }); + return res.status(200).json({ + success: true, + data: { + totalCategories, + totalItems, + monthlyVisitors + } + }); + } catch (e4) { + console.log(e4); + res.status(500).json({ success: false, message: "Server error" }); + } + }; + module2.exports = { + searchRestaurants, + createBranch, + getResturantById, + updateBranchAndSettings, + checkRestaurantsImageExistDB, + getAnalytics + }; + } +}); + +// routes/restaurantRoute.js +var require_restaurantRoute = __commonJS({ + "routes/restaurantRoute.js"(exports2, module2) { + var express2 = require_express2(); + var router = express2.Router(); + var { + searchRestaurants, + createBranch, + getResturantById, + updateBranchAndSettings, + getAnalytics + } = require_restaurantController(); + router.get("/", getResturantById); + router.get("/search", searchRestaurants); + router.post("/create/:userId", createBranch); + router.patch("/update-settings", updateBranchAndSettings); + router.get("/analytics/:slug", getAnalytics); + module2.exports = router; + } +}); + +// error/joiErrorHandler/joiErrorHandler.js +var require_joiErrorHandler = __commonJS({ + "error/joiErrorHandler/joiErrorHandler.js"(exports2, module2) { + var errorHandler = (error2) => { + if (error2.isJoi) { + return { + status: "error", + success: false, + message: "Validation error", + errors: error2.details.map((detail) => ({ + field: detail.path.join("."), + message: detail.message + })) + }; + } + if (error2.name === "SequelizeValidationError") { + return { + status: "error", + success: false, + message: "Database validation error", + errors: error2.errors.map((err) => ({ + field: err.path, + message: err.message + })) + }; + } + if (error2.name === "SequelizeUniqueConstraintError") { + return { + status: "error", + success: false, + message: "Duplicate entry found", + errors: error2.errors.map((err) => ({ + field: err.path, + message: `${err.path} already exists` + })) + }; + } + return { + status: "error", + success: false, + message: error2.message || "An unexpected error occurred" + }; + }; + module2.exports = errorHandler; + } +}); + +// controller/categoryController.js +var require_categoryController = __commonJS({ + "controller/categoryController.js"(exports2, module2) { + var { Category } = require_categoryModel(); + var { Branch } = require_resturantModel(); + var errorHandler = require_joiErrorHandler(); + var { sendResponse } = require_responseHelper(); + var mongoose2 = require_mongoose2(); + var createCategory = async (req, res) => { + try { + const branch_id = req.user.branchId; + const { name, image_url, display_order } = req.body; + if (!branch_id || !name) { + return sendResponse(res, 400, "branch_id and name are required"); + } + const branch = await Branch.findById(branch_id); + if (!branch) { + return sendResponse(res, 404, "Branch not found"); + } + const exists = await Category.findOne({ + branch_id, + is_active: true, + name: { $regex: new RegExp(`^${name.trim()}$`, "i") } + // Exact match, case insensitive + }); + if (exists) { + return sendResponse(res, 400, `Category "${name}" already exists in this branch`); + } + const category = new Category({ + branch_id, + name, + image_url: image_url || null, + is_active: true, + display_order: display_order || 0 + }); + await category.save(); + return sendResponse(res, 201, "Category created successfully", category); + } catch (error2) { + console.log("Create Category Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var getCategories = async (req, res) => { + try { + const branch_id = req.user.branchId; + const page = parseInt(req.query.page) || 1; + const limit = parseInt(req.query.limit) || 50; + const skip = (page - 1) * limit; + const filter = { branch_id, is_deleted: false }; + const totalCount = await Category.countDocuments(filter); + const rows = await Category.find(filter).sort({ display_order: 1 }).skip(skip).limit(limit).lean(); + return sendResponse(res, 200, "Categories fetched successfully", rows, { + totalCount, + currentPage: page, + pageSize: limit, + totalPages: Math.ceil(totalCount / limit) + }); + } catch (error2) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var getCategoryById = async (req, res) => { + try { + const { id } = req.params; + const category = await Category.findById(id).lean(); + if (!category) { + return res.status(404).json({ + success: false, + message: "Category not found" + }); + } + return sendResponse(res, 200, "Category fetched successfully", category); + } catch (error2) { + console.log("Get Category Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var updateCategory = async (req, res) => { + try { + const { id } = req.params; + const { name, image_url, is_active, display_order } = req.body; + const category = await Category.findById(id); + if (!category) { + return sendResponse(res, 404, "Category not found"); + } + if (name && name.trim().toLowerCase() !== category.name.toLowerCase()) { + const existing = await Category.findOne({ + branch_id: category.branch_id, + is_active: true, + name: { $regex: new RegExp(`^${name.trim()}$`, "i") }, + _id: { $ne: id } + // exclude current id + }); + if (existing) { + return sendResponse(res, 400, `Another category with name "${name}" already exists`); + } + } + if (name) category.name = name.trim().replace(/\s+/g, " "); + if (image_url !== void 0) category.image_url = image_url; + if (is_active !== void 0) category.is_active = is_active; + if (display_order !== void 0) category.display_order = display_order; + await category.save(); + return sendResponse(res, 200, "Category updated successfully", category); + } catch (error2) { + console.log("Update Category Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var deleteCategory = async (req, res) => { + try { + const { id } = req.params; + const category = await Category.findById(id); + if (!category) { + return sendResponse(res, 404, "Category not found"); + } + let nameMatch = false; + nameMatch = await Category.exists({ + name: category.name, + _id: { $ne: id }, + is_deleted: false + }); + if (!nameMatch) { + category.is_deleted = true; + await category.save(); + } else { + await MenuItem.deleteMany({ category_id: id }); + await Category.findByIdAndDelete(id); + } + return sendResponse(res, 200, "Category deleted successfully"); + } catch (error2) { + console.log("Delete Category Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var searchCategory = async (req, res) => { + try { + const searchId = req.params.id || null; + let branch_id = null; + if (searchId) { + branch_id = req.user.branchId; + } + const q4 = req.query.q || ""; + if (!q4 || q4.trim() === "") { + return sendResponse(res, 200, "No query provided", []); + } + const filter = { + name: { $regex: q4, $options: "i" }, + is_active: true + }; + if (branch_id) { + filter.branch_id = branch_id; + } + const categories = await Category.find(filter).sort({ name: 1 }).limit(10).lean(); + return sendResponse(res, 200, "Categories fetched successfully", categories); + } catch (error2) { + console.error("Search Category Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var checkCategoryImageExistsDB = async (fileName, id = null) => { + try { + if (!fileName) { + return { success: false, exists: false }; + } + const filter = { + image_url: fileName + }; + if (id) { + filter._id = { $ne: id }; + } + const exists = await Category.findOne(filter); + return { + success: true, + exists: !!exists + }; + } catch (error2) { + console.log("Check Image in DB Error:", error2); + return { + success: false, + exists: false, + error: error2 + }; + } + }; + var reOrderCategory = async (req, res) => { + try { + const { orderedIds } = req.body; + if (!Array.isArray(orderedIds)) { + return sendResponse(res, 400, "orderedIds must be array"); + } + const bulkOps = orderedIds.map((id, index) => ({ + updateOne: { + filter: { _id: id }, + update: { display_order: index } + } + })); + await Category.bulkWrite(bulkOps); + return sendResponse(res, 200, "Category priority updated"); + } catch (err) { + console.error(err); + return sendResponse(res, 500, "Server error", { error: err.message }); + } + }; + var updateStatus = async (req, res) => { + try { + const { id } = req.params; + const { is_active } = req.body; + const category = await Category.findById(id); + if (!category) { + return sendResponse(res, 404, "Category not found"); + } + category.is_active = is_active; + await category.save(); + return sendResponse(res, 200, "Category status updated successfully"); + } catch (error2) { + console.log("Update Status Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + module2.exports = { + createCategory, + getCategories, + getCategoryById, + updateCategory, + deleteCategory, + searchCategory, + checkCategoryImageExistsDB, + reOrderCategory, + updateStatus + }; + } +}); + +// routes/category.js +var require_category = __commonJS({ + "routes/category.js"(exports2, module2) { + var express2 = require_express2(); + var router = express2.Router(); + var { + createCategory, + getCategories, + getCategoryById, + updateCategory, + deleteCategory, + searchCategory, + reOrderCategory, + updateStatus + } = require_categoryController(); + router.post("/", createCategory); + router.get("/search/:id?", searchCategory); + router.get("/", getCategories); + router.get("/single/:id", getCategoryById); + router.put("/:id", updateCategory); + router.delete("/:id", deleteCategory); + router.put("/status/:id", updateStatus); + router.post("/reorder", reOrderCategory); + module2.exports = router; + } +}); + +// node_modules/busboy/lib/utils.js +var require_utils9 = __commonJS({ + "node_modules/busboy/lib/utils.js"(exports2, module2) { + "use strict"; + function parseContentType(str) { + if (str.length === 0) + return; + const params = /* @__PURE__ */ Object.create(null); + let i4 = 0; + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (TOKEN[code] !== 1) { + if (code !== 47 || i4 === 0) + return; + break; + } + } + if (i4 === str.length) + return; + const type = str.slice(0, i4).toLowerCase(); + const subtypeStart = ++i4; + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (TOKEN[code] !== 1) { + if (i4 === subtypeStart) + return; + if (parseContentTypeParams(str, i4, params) === void 0) + return; + break; + } + } + if (i4 === subtypeStart) + return; + const subtype = str.slice(subtypeStart, i4).toLowerCase(); + return { type, subtype, params }; + } + function parseContentTypeParams(str, i4, params) { + while (i4 < str.length) { + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (code !== 32 && code !== 9) + break; + } + if (i4 === str.length) + break; + if (str.charCodeAt(i4++) !== 59) + return; + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (code !== 32 && code !== 9) + break; + } + if (i4 === str.length) + return; + let name; + const nameStart = i4; + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (TOKEN[code] !== 1) { + if (code !== 61) + return; + break; + } + } + if (i4 === str.length) + return; + name = str.slice(nameStart, i4); + ++i4; + if (i4 === str.length) + return; + let value = ""; + let valueStart; + if (str.charCodeAt(i4) === 34) { + valueStart = ++i4; + let escaping = false; + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (code === 92) { + if (escaping) { + valueStart = i4; + escaping = false; + } else { + value += str.slice(valueStart, i4); + escaping = true; + } + continue; + } + if (code === 34) { + if (escaping) { + valueStart = i4; + escaping = false; + continue; + } + value += str.slice(valueStart, i4); + break; + } + if (escaping) { + valueStart = i4 - 1; + escaping = false; + } + if (QDTEXT[code] !== 1) + return; + } + if (i4 === str.length) + return; + ++i4; + } else { + valueStart = i4; + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (TOKEN[code] !== 1) { + if (i4 === valueStart) + return; + break; + } + } + value = str.slice(valueStart, i4); + } + name = name.toLowerCase(); + if (params[name] === void 0) + params[name] = value; + } + return params; + } + function parseDisposition(str, defDecoder) { + if (str.length === 0) + return; + const params = /* @__PURE__ */ Object.create(null); + let i4 = 0; + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (TOKEN[code] !== 1) { + if (parseDispositionParams(str, i4, params, defDecoder) === void 0) + return; + break; + } + } + const type = str.slice(0, i4).toLowerCase(); + return { type, params }; + } + function parseDispositionParams(str, i4, params, defDecoder) { + while (i4 < str.length) { + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (code !== 32 && code !== 9) + break; + } + if (i4 === str.length) + break; + if (str.charCodeAt(i4++) !== 59) + return; + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (code !== 32 && code !== 9) + break; + } + if (i4 === str.length) + return; + let name; + const nameStart = i4; + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (TOKEN[code] !== 1) { + if (code === 61) + break; + return; + } + } + if (i4 === str.length) + return; + let value = ""; + let valueStart; + let charset; + name = str.slice(nameStart, i4); + if (name.charCodeAt(name.length - 1) === 42) { + const charsetStart = ++i4; + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (CHARSET[code] !== 1) { + if (code !== 39) + return; + break; + } + } + if (i4 === str.length) + return; + charset = str.slice(charsetStart, i4); + ++i4; + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (code === 39) + break; + } + if (i4 === str.length) + return; + ++i4; + if (i4 === str.length) + return; + valueStart = i4; + let encode2 = 0; + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (EXTENDED_VALUE[code] !== 1) { + if (code === 37) { + let hexUpper; + let hexLower; + if (i4 + 2 < str.length && (hexUpper = HEX_VALUES[str.charCodeAt(i4 + 1)]) !== -1 && (hexLower = HEX_VALUES[str.charCodeAt(i4 + 2)]) !== -1) { + const byteVal = (hexUpper << 4) + hexLower; + value += str.slice(valueStart, i4); + value += String.fromCharCode(byteVal); + i4 += 2; + valueStart = i4 + 1; + if (byteVal >= 128) + encode2 = 2; + else if (encode2 === 0) + encode2 = 1; + continue; + } + return; + } + break; + } + } + value += str.slice(valueStart, i4); + value = convertToUTF8(value, charset, encode2); + if (value === void 0) + return; + } else { + ++i4; + if (i4 === str.length) + return; + if (str.charCodeAt(i4) === 34) { + valueStart = ++i4; + let escaping = false; + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (code === 92) { + if (escaping) { + valueStart = i4; + escaping = false; + } else { + value += str.slice(valueStart, i4); + escaping = true; + } + continue; + } + if (code === 34) { + if (escaping) { + valueStart = i4; + escaping = false; + continue; + } + value += str.slice(valueStart, i4); + break; + } + if (escaping) { + valueStart = i4 - 1; + escaping = false; + } + if (QDTEXT[code] !== 1) + return; + } + if (i4 === str.length) + return; + ++i4; + } else { + valueStart = i4; + for (; i4 < str.length; ++i4) { + const code = str.charCodeAt(i4); + if (TOKEN[code] !== 1) { + if (i4 === valueStart) + return; + break; + } + } + value = str.slice(valueStart, i4); + } + value = defDecoder(value, 2); + if (value === void 0) + return; + } + name = name.toLowerCase(); + if (params[name] === void 0) + params[name] = value; + } + return params; + } + function getDecoder(charset) { + let lc; + while (true) { + switch (charset) { + case "utf-8": + case "utf8": + return decoders.utf8; + case "latin1": + case "ascii": + // TODO: Make these a separate, strict decoder? + case "us-ascii": + case "iso-8859-1": + case "iso8859-1": + case "iso88591": + case "iso_8859-1": + case "windows-1252": + case "iso_8859-1:1987": + case "cp1252": + case "x-cp1252": + return decoders.latin1; + case "utf16le": + case "utf-16le": + case "ucs2": + case "ucs-2": + return decoders.utf16le; + case "base64": + return decoders.base64; + default: + if (lc === void 0) { + lc = true; + charset = charset.toLowerCase(); + continue; + } + return decoders.other.bind(charset); + } + } + } + var decoders = { + utf8: (data2, hint) => { + if (data2.length === 0) + return ""; + if (typeof data2 === "string") { + if (hint < 2) + return data2; + data2 = Buffer.from(data2, "latin1"); + } + return data2.utf8Slice(0, data2.length); + }, + latin1: (data2, hint) => { + if (data2.length === 0) + return ""; + if (typeof data2 === "string") + return data2; + return data2.latin1Slice(0, data2.length); + }, + utf16le: (data2, hint) => { + if (data2.length === 0) + return ""; + if (typeof data2 === "string") + data2 = Buffer.from(data2, "latin1"); + return data2.ucs2Slice(0, data2.length); + }, + base64: (data2, hint) => { + if (data2.length === 0) + return ""; + if (typeof data2 === "string") + data2 = Buffer.from(data2, "latin1"); + return data2.base64Slice(0, data2.length); + }, + other: (data2, hint) => { + if (data2.length === 0) + return ""; + if (typeof data2 === "string") + data2 = Buffer.from(data2, "latin1"); + try { + const decoder = new TextDecoder(exports2); + return decoder.decode(data2); + } catch { + } + } + }; + function convertToUTF8(data2, charset, hint) { + const decode2 = getDecoder(charset); + if (decode2) + return decode2(data2, hint); + } + function basename(path) { + if (typeof path !== "string") + return ""; + for (let i4 = path.length - 1; i4 >= 0; --i4) { + switch (path.charCodeAt(i4)) { + case 47: + // '/' + case 92: + path = path.slice(i4 + 1); + return path === ".." || path === "." ? "" : path; + } + } + return path === ".." || path === "." ? "" : path; + } + var TOKEN = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]; + var QDTEXT = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ]; + var CHARSET = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]; + var EXTENDED_VALUE = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]; + var HEX_VALUES = [ + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 10, + 11, + 12, + 13, + 14, + 15, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 10, + 11, + 12, + 13, + 14, + 15, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1 + ]; + module2.exports = { + basename, + convertToUTF8, + getDecoder, + parseContentType, + parseDisposition + }; + } +}); + +// node_modules/streamsearch/lib/sbmh.js +var require_sbmh = __commonJS({ + "node_modules/streamsearch/lib/sbmh.js"(exports2, module2) { + "use strict"; + function memcmp(buf1, pos1, buf2, pos2, num) { + for (let i4 = 0; i4 < num; ++i4) { + if (buf1[pos1 + i4] !== buf2[pos2 + i4]) + return false; + } + return true; + } + var SBMH = class { + constructor(needle, cb) { + if (typeof cb !== "function") + throw new Error("Missing match callback"); + if (typeof needle === "string") + needle = Buffer.from(needle); + else if (!Buffer.isBuffer(needle)) + throw new Error(`Expected Buffer for needle, got ${typeof needle}`); + const needleLen = needle.length; + this.maxMatches = Infinity; + this.matches = 0; + this._cb = cb; + this._lookbehindSize = 0; + this._needle = needle; + this._bufPos = 0; + this._lookbehind = Buffer.allocUnsafe(needleLen); + this._occ = [ + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen, + needleLen + ]; + if (needleLen > 1) { + for (let i4 = 0; i4 < needleLen - 1; ++i4) + this._occ[needle[i4]] = needleLen - 1 - i4; + } + } + reset() { + this.matches = 0; + this._lookbehindSize = 0; + this._bufPos = 0; + } + push(chunk, pos) { + let result; + if (!Buffer.isBuffer(chunk)) + chunk = Buffer.from(chunk, "latin1"); + const chunkLen = chunk.length; + this._bufPos = pos || 0; + while (result !== chunkLen && this.matches < this.maxMatches) + result = feed(this, chunk); + return result; + } + destroy() { + const lbSize = this._lookbehindSize; + if (lbSize) + this._cb(false, this._lookbehind, 0, lbSize, false); + this.reset(); + } + }; + function feed(self2, data2) { + const len = data2.length; + const needle = self2._needle; + const needleLen = needle.length; + let pos = -self2._lookbehindSize; + const lastNeedleCharPos = needleLen - 1; + const lastNeedleChar = needle[lastNeedleCharPos]; + const end = len - needleLen; + const occ = self2._occ; + const lookbehind = self2._lookbehind; + if (pos < 0) { + while (pos < 0 && pos <= end) { + const nextPos = pos + lastNeedleCharPos; + const ch = nextPos < 0 ? lookbehind[self2._lookbehindSize + nextPos] : data2[nextPos]; + if (ch === lastNeedleChar && matchNeedle(self2, data2, pos, lastNeedleCharPos)) { + self2._lookbehindSize = 0; + ++self2.matches; + if (pos > -self2._lookbehindSize) + self2._cb(true, lookbehind, 0, self2._lookbehindSize + pos, false); + else + self2._cb(true, void 0, 0, 0, true); + return self2._bufPos = pos + needleLen; + } + pos += occ[ch]; + } + while (pos < 0 && !matchNeedle(self2, data2, pos, len - pos)) + ++pos; + if (pos < 0) { + const bytesToCutOff = self2._lookbehindSize + pos; + if (bytesToCutOff > 0) { + self2._cb(false, lookbehind, 0, bytesToCutOff, false); + } + self2._lookbehindSize -= bytesToCutOff; + lookbehind.copy(lookbehind, 0, bytesToCutOff, self2._lookbehindSize); + lookbehind.set(data2, self2._lookbehindSize); + self2._lookbehindSize += len; + self2._bufPos = len; + return len; + } + self2._cb(false, lookbehind, 0, self2._lookbehindSize, false); + self2._lookbehindSize = 0; + } + pos += self2._bufPos; + const firstNeedleChar = needle[0]; + while (pos <= end) { + const ch = data2[pos + lastNeedleCharPos]; + if (ch === lastNeedleChar && data2[pos] === firstNeedleChar && memcmp(needle, 0, data2, pos, lastNeedleCharPos)) { + ++self2.matches; + if (pos > 0) + self2._cb(true, data2, self2._bufPos, pos, true); + else + self2._cb(true, void 0, 0, 0, true); + return self2._bufPos = pos + needleLen; + } + pos += occ[ch]; + } + while (pos < len) { + if (data2[pos] !== firstNeedleChar || !memcmp(data2, pos, needle, 0, len - pos)) { + ++pos; + continue; + } + data2.copy(lookbehind, 0, pos, len); + self2._lookbehindSize = len - pos; + break; + } + if (pos > 0) + self2._cb(false, data2, self2._bufPos, pos < len ? pos : len, true); + self2._bufPos = len; + return len; + } + function matchNeedle(self2, data2, pos, len) { + const lb = self2._lookbehind; + const lbSize = self2._lookbehindSize; + const needle = self2._needle; + for (let i4 = 0; i4 < len; ++i4, ++pos) { + const ch = pos < 0 ? lb[lbSize + pos] : data2[pos]; + if (ch !== needle[i4]) + return false; + } + return true; + } + module2.exports = SBMH; + } +}); + +// node_modules/busboy/lib/types/multipart.js +var require_multipart = __commonJS({ + "node_modules/busboy/lib/types/multipart.js"(exports2, module2) { + "use strict"; + var { Readable, Writable } = require("stream"); + var StreamSearch = require_sbmh(); + var { + basename, + convertToUTF8, + getDecoder, + parseContentType, + parseDisposition + } = require_utils9(); + var BUF_CRLF = Buffer.from("\r\n"); + var BUF_CR = Buffer.from("\r"); + var BUF_DASH = Buffer.from("-"); + function noop() { + } + var MAX_HEADER_PAIRS = 2e3; + var MAX_HEADER_SIZE = 16 * 1024; + var HPARSER_NAME = 0; + var HPARSER_PRE_OWS = 1; + var HPARSER_VALUE = 2; + var HeaderParser = class { + constructor(cb) { + this.header = /* @__PURE__ */ Object.create(null); + this.pairCount = 0; + this.byteCount = 0; + this.state = HPARSER_NAME; + this.name = ""; + this.value = ""; + this.crlf = 0; + this.cb = cb; + } + reset() { + this.header = /* @__PURE__ */ Object.create(null); + this.pairCount = 0; + this.byteCount = 0; + this.state = HPARSER_NAME; + this.name = ""; + this.value = ""; + this.crlf = 0; + } + push(chunk, pos, end) { + let start = pos; + while (pos < end) { + switch (this.state) { + case HPARSER_NAME: { + let done = false; + for (; pos < end; ++pos) { + if (this.byteCount === MAX_HEADER_SIZE) + return -1; + ++this.byteCount; + const code = chunk[pos]; + if (TOKEN[code] !== 1) { + if (code !== 58) + return -1; + this.name += chunk.latin1Slice(start, pos); + if (this.name.length === 0) + return -1; + ++pos; + done = true; + this.state = HPARSER_PRE_OWS; + break; + } + } + if (!done) { + this.name += chunk.latin1Slice(start, pos); + break; + } + } + case HPARSER_PRE_OWS: { + let done = false; + for (; pos < end; ++pos) { + if (this.byteCount === MAX_HEADER_SIZE) + return -1; + ++this.byteCount; + const code = chunk[pos]; + if (code !== 32 && code !== 9) { + start = pos; + done = true; + this.state = HPARSER_VALUE; + break; + } + } + if (!done) + break; + } + case HPARSER_VALUE: + switch (this.crlf) { + case 0: + for (; pos < end; ++pos) { + if (this.byteCount === MAX_HEADER_SIZE) + return -1; + ++this.byteCount; + const code = chunk[pos]; + if (FIELD_VCHAR[code] !== 1) { + if (code !== 13) + return -1; + ++this.crlf; + break; + } + } + this.value += chunk.latin1Slice(start, pos++); + break; + case 1: + if (this.byteCount === MAX_HEADER_SIZE) + return -1; + ++this.byteCount; + if (chunk[pos++] !== 10) + return -1; + ++this.crlf; + break; + case 2: { + if (this.byteCount === MAX_HEADER_SIZE) + return -1; + ++this.byteCount; + const code = chunk[pos]; + if (code === 32 || code === 9) { + start = pos; + this.crlf = 0; + } else { + if (++this.pairCount < MAX_HEADER_PAIRS) { + this.name = this.name.toLowerCase(); + if (this.header[this.name] === void 0) + this.header[this.name] = [this.value]; + else + this.header[this.name].push(this.value); + } + if (code === 13) { + ++this.crlf; + ++pos; + } else { + start = pos; + this.crlf = 0; + this.state = HPARSER_NAME; + this.name = ""; + this.value = ""; + } + } + break; + } + case 3: { + if (this.byteCount === MAX_HEADER_SIZE) + return -1; + ++this.byteCount; + if (chunk[pos++] !== 10) + return -1; + const header = this.header; + this.reset(); + this.cb(header); + return pos; + } + } + break; + } + } + return pos; + } + }; + var FileStream = class extends Readable { + constructor(opts, owner) { + super(opts); + this.truncated = false; + this._readcb = null; + this.once("end", () => { + this._read(); + if (--owner._fileEndsLeft === 0 && owner._finalcb) { + const cb = owner._finalcb; + owner._finalcb = null; + process.nextTick(cb); + } + }); + } + _read(n4) { + const cb = this._readcb; + if (cb) { + this._readcb = null; + cb(); + } + } + }; + var ignoreData = { + push: (chunk, pos) => { + }, + destroy: () => { + } + }; + function callAndUnsetCb(self2, err) { + const cb = self2._writecb; + self2._writecb = null; + if (err) + self2.destroy(err); + else if (cb) + cb(); + } + function nullDecoder(val, hint) { + return val; + } + var Multipart = class extends Writable { + constructor(cfg) { + const streamOpts = { + autoDestroy: true, + emitClose: true, + highWaterMark: typeof cfg.highWaterMark === "number" ? cfg.highWaterMark : void 0 + }; + super(streamOpts); + if (!cfg.conType.params || typeof cfg.conType.params.boundary !== "string") + throw new Error("Multipart: Boundary not found"); + const boundary = cfg.conType.params.boundary; + const paramDecoder = typeof cfg.defParamCharset === "string" && cfg.defParamCharset ? getDecoder(cfg.defParamCharset) : nullDecoder; + const defCharset = cfg.defCharset || "utf8"; + const preservePath = cfg.preservePath; + const fileOpts = { + autoDestroy: true, + emitClose: true, + highWaterMark: typeof cfg.fileHwm === "number" ? cfg.fileHwm : void 0 + }; + const limits = cfg.limits; + const fieldSizeLimit = limits && typeof limits.fieldSize === "number" ? limits.fieldSize : 1 * 1024 * 1024; + const fileSizeLimit = limits && typeof limits.fileSize === "number" ? limits.fileSize : Infinity; + const filesLimit = limits && typeof limits.files === "number" ? limits.files : Infinity; + const fieldsLimit = limits && typeof limits.fields === "number" ? limits.fields : Infinity; + const partsLimit = limits && typeof limits.parts === "number" ? limits.parts : Infinity; + let parts = -1; + let fields = 0; + let files = 0; + let skipPart = false; + this._fileEndsLeft = 0; + this._fileStream = void 0; + this._complete = false; + let fileSize = 0; + let field; + let fieldSize = 0; + let partCharset; + let partEncoding; + let partType; + let partName; + let partTruncated = false; + let hitFilesLimit = false; + let hitFieldsLimit = false; + this._hparser = null; + const hparser = new HeaderParser((header) => { + this._hparser = null; + skipPart = false; + partType = "text/plain"; + partCharset = defCharset; + partEncoding = "7bit"; + partName = void 0; + partTruncated = false; + let filename; + if (!header["content-disposition"]) { + skipPart = true; + return; + } + const disp = parseDisposition( + header["content-disposition"][0], + paramDecoder + ); + if (!disp || disp.type !== "form-data") { + skipPart = true; + return; + } + if (disp.params) { + if (disp.params.name) + partName = disp.params.name; + if (disp.params["filename*"]) + filename = disp.params["filename*"]; + else if (disp.params.filename) + filename = disp.params.filename; + if (filename !== void 0 && !preservePath) + filename = basename(filename); + } + if (header["content-type"]) { + const conType = parseContentType(header["content-type"][0]); + if (conType) { + partType = `${conType.type}/${conType.subtype}`; + if (conType.params && typeof conType.params.charset === "string") + partCharset = conType.params.charset.toLowerCase(); + } + } + if (header["content-transfer-encoding"]) + partEncoding = header["content-transfer-encoding"][0].toLowerCase(); + if (partType === "application/octet-stream" || filename !== void 0) { + if (files === filesLimit) { + if (!hitFilesLimit) { + hitFilesLimit = true; + this.emit("filesLimit"); + } + skipPart = true; + return; + } + ++files; + if (this.listenerCount("file") === 0) { + skipPart = true; + return; + } + fileSize = 0; + this._fileStream = new FileStream(fileOpts, this); + ++this._fileEndsLeft; + this.emit( + "file", + partName, + this._fileStream, + { + filename, + encoding: partEncoding, + mimeType: partType + } + ); + } else { + if (fields === fieldsLimit) { + if (!hitFieldsLimit) { + hitFieldsLimit = true; + this.emit("fieldsLimit"); + } + skipPart = true; + return; + } + ++fields; + if (this.listenerCount("field") === 0) { + skipPart = true; + return; + } + field = []; + fieldSize = 0; + } + }); + let matchPostBoundary = 0; + const ssCb = (isMatch, data2, start, end, isDataSafe) => { + retrydata: + while (data2) { + if (this._hparser !== null) { + const ret = this._hparser.push(data2, start, end); + if (ret === -1) { + this._hparser = null; + hparser.reset(); + this.emit("error", new Error("Malformed part header")); + break; + } + start = ret; + } + if (start === end) + break; + if (matchPostBoundary !== 0) { + if (matchPostBoundary === 1) { + switch (data2[start]) { + case 45: + matchPostBoundary = 2; + ++start; + break; + case 13: + matchPostBoundary = 3; + ++start; + break; + default: + matchPostBoundary = 0; + } + if (start === end) + return; + } + if (matchPostBoundary === 2) { + matchPostBoundary = 0; + if (data2[start] === 45) { + this._complete = true; + this._bparser = ignoreData; + return; + } + const writecb = this._writecb; + this._writecb = noop; + ssCb(false, BUF_DASH, 0, 1, false); + this._writecb = writecb; + } else if (matchPostBoundary === 3) { + matchPostBoundary = 0; + if (data2[start] === 10) { + ++start; + if (parts >= partsLimit) + break; + this._hparser = hparser; + if (start === end) + break; + continue retrydata; + } else { + const writecb = this._writecb; + this._writecb = noop; + ssCb(false, BUF_CR, 0, 1, false); + this._writecb = writecb; + } + } + } + if (!skipPart) { + if (this._fileStream) { + let chunk; + const actualLen = Math.min(end - start, fileSizeLimit - fileSize); + if (!isDataSafe) { + chunk = Buffer.allocUnsafe(actualLen); + data2.copy(chunk, 0, start, start + actualLen); + } else { + chunk = data2.slice(start, start + actualLen); + } + fileSize += chunk.length; + if (fileSize === fileSizeLimit) { + if (chunk.length > 0) + this._fileStream.push(chunk); + this._fileStream.emit("limit"); + this._fileStream.truncated = true; + skipPart = true; + } else if (!this._fileStream.push(chunk)) { + if (this._writecb) + this._fileStream._readcb = this._writecb; + this._writecb = null; + } + } else if (field !== void 0) { + let chunk; + const actualLen = Math.min( + end - start, + fieldSizeLimit - fieldSize + ); + if (!isDataSafe) { + chunk = Buffer.allocUnsafe(actualLen); + data2.copy(chunk, 0, start, start + actualLen); + } else { + chunk = data2.slice(start, start + actualLen); + } + fieldSize += actualLen; + field.push(chunk); + if (fieldSize === fieldSizeLimit) { + skipPart = true; + partTruncated = true; + } + } + } + break; + } + if (isMatch) { + matchPostBoundary = 1; + if (this._fileStream) { + this._fileStream.push(null); + this._fileStream = null; + } else if (field !== void 0) { + let data3; + switch (field.length) { + case 0: + data3 = ""; + break; + case 1: + data3 = convertToUTF8(field[0], partCharset, 0); + break; + default: + data3 = convertToUTF8( + Buffer.concat(field, fieldSize), + partCharset, + 0 + ); + } + field = void 0; + fieldSize = 0; + this.emit( + "field", + partName, + data3, + { + nameTruncated: false, + valueTruncated: partTruncated, + encoding: partEncoding, + mimeType: partType + } + ); + } + if (++parts === partsLimit) + this.emit("partsLimit"); + } + }; + this._bparser = new StreamSearch(`\r +--${boundary}`, ssCb); + this._writecb = null; + this._finalcb = null; + this.write(BUF_CRLF); + } + static detect(conType) { + return conType.type === "multipart" && conType.subtype === "form-data"; + } + _write(chunk, enc, cb) { + this._writecb = cb; + this._bparser.push(chunk, 0); + if (this._writecb) + callAndUnsetCb(this); + } + _destroy(err, cb) { + this._hparser = null; + this._bparser = ignoreData; + if (!err) + err = checkEndState(this); + const fileStream = this._fileStream; + if (fileStream) { + this._fileStream = null; + fileStream.destroy(err); + } + cb(err); + } + _final(cb) { + this._bparser.destroy(); + if (!this._complete) + return cb(new Error("Unexpected end of form")); + if (this._fileEndsLeft) + this._finalcb = finalcb.bind(null, this, cb); + else + finalcb(this, cb); + } + }; + function finalcb(self2, cb, err) { + if (err) + return cb(err); + err = checkEndState(self2); + cb(err); + } + function checkEndState(self2) { + if (self2._hparser) + return new Error("Malformed part header"); + const fileStream = self2._fileStream; + if (fileStream) { + self2._fileStream = null; + fileStream.destroy(new Error("Unexpected end of file")); + } + if (!self2._complete) + return new Error("Unexpected end of form"); + } + var TOKEN = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 1, + 1, + 0, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]; + var FIELD_VCHAR = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ]; + module2.exports = Multipart; + } +}); + +// node_modules/busboy/lib/types/urlencoded.js +var require_urlencoded3 = __commonJS({ + "node_modules/busboy/lib/types/urlencoded.js"(exports2, module2) { + "use strict"; + var { Writable } = require("stream"); + var { getDecoder } = require_utils9(); + var URLEncoded = class extends Writable { + constructor(cfg) { + const streamOpts = { + autoDestroy: true, + emitClose: true, + highWaterMark: typeof cfg.highWaterMark === "number" ? cfg.highWaterMark : void 0 + }; + super(streamOpts); + let charset = cfg.defCharset || "utf8"; + if (cfg.conType.params && typeof cfg.conType.params.charset === "string") + charset = cfg.conType.params.charset; + this.charset = charset; + const limits = cfg.limits; + this.fieldSizeLimit = limits && typeof limits.fieldSize === "number" ? limits.fieldSize : 1 * 1024 * 1024; + this.fieldsLimit = limits && typeof limits.fields === "number" ? limits.fields : Infinity; + this.fieldNameSizeLimit = limits && typeof limits.fieldNameSize === "number" ? limits.fieldNameSize : 100; + this._inKey = true; + this._keyTrunc = false; + this._valTrunc = false; + this._bytesKey = 0; + this._bytesVal = 0; + this._fields = 0; + this._key = ""; + this._val = ""; + this._byte = -2; + this._lastPos = 0; + this._encode = 0; + this._decoder = getDecoder(charset); + } + static detect(conType) { + return conType.type === "application" && conType.subtype === "x-www-form-urlencoded"; + } + _write(chunk, enc, cb) { + if (this._fields >= this.fieldsLimit) + return cb(); + let i4 = 0; + const len = chunk.length; + this._lastPos = 0; + if (this._byte !== -2) { + i4 = readPctEnc(this, chunk, i4, len); + if (i4 === -1) + return cb(new Error("Malformed urlencoded form")); + if (i4 >= len) + return cb(); + if (this._inKey) + ++this._bytesKey; + else + ++this._bytesVal; + } + main: + while (i4 < len) { + if (this._inKey) { + i4 = skipKeyBytes(this, chunk, i4, len); + while (i4 < len) { + switch (chunk[i4]) { + case 61: + if (this._lastPos < i4) + this._key += chunk.latin1Slice(this._lastPos, i4); + this._lastPos = ++i4; + this._key = this._decoder(this._key, this._encode); + this._encode = 0; + this._inKey = false; + continue main; + case 38: + if (this._lastPos < i4) + this._key += chunk.latin1Slice(this._lastPos, i4); + this._lastPos = ++i4; + this._key = this._decoder(this._key, this._encode); + this._encode = 0; + if (this._bytesKey > 0) { + this.emit( + "field", + this._key, + "", + { + nameTruncated: this._keyTrunc, + valueTruncated: false, + encoding: this.charset, + mimeType: "text/plain" + } + ); + } + this._key = ""; + this._val = ""; + this._keyTrunc = false; + this._valTrunc = false; + this._bytesKey = 0; + this._bytesVal = 0; + if (++this._fields >= this.fieldsLimit) { + this.emit("fieldsLimit"); + return cb(); + } + continue; + case 43: + if (this._lastPos < i4) + this._key += chunk.latin1Slice(this._lastPos, i4); + this._key += " "; + this._lastPos = i4 + 1; + break; + case 37: + if (this._encode === 0) + this._encode = 1; + if (this._lastPos < i4) + this._key += chunk.latin1Slice(this._lastPos, i4); + this._lastPos = i4 + 1; + this._byte = -1; + i4 = readPctEnc(this, chunk, i4 + 1, len); + if (i4 === -1) + return cb(new Error("Malformed urlencoded form")); + if (i4 >= len) + return cb(); + ++this._bytesKey; + i4 = skipKeyBytes(this, chunk, i4, len); + continue; + } + ++i4; + ++this._bytesKey; + i4 = skipKeyBytes(this, chunk, i4, len); + } + if (this._lastPos < i4) + this._key += chunk.latin1Slice(this._lastPos, i4); + } else { + i4 = skipValBytes(this, chunk, i4, len); + while (i4 < len) { + switch (chunk[i4]) { + case 38: + if (this._lastPos < i4) + this._val += chunk.latin1Slice(this._lastPos, i4); + this._lastPos = ++i4; + this._inKey = true; + this._val = this._decoder(this._val, this._encode); + this._encode = 0; + if (this._bytesKey > 0 || this._bytesVal > 0) { + this.emit( + "field", + this._key, + this._val, + { + nameTruncated: this._keyTrunc, + valueTruncated: this._valTrunc, + encoding: this.charset, + mimeType: "text/plain" + } + ); + } + this._key = ""; + this._val = ""; + this._keyTrunc = false; + this._valTrunc = false; + this._bytesKey = 0; + this._bytesVal = 0; + if (++this._fields >= this.fieldsLimit) { + this.emit("fieldsLimit"); + return cb(); + } + continue main; + case 43: + if (this._lastPos < i4) + this._val += chunk.latin1Slice(this._lastPos, i4); + this._val += " "; + this._lastPos = i4 + 1; + break; + case 37: + if (this._encode === 0) + this._encode = 1; + if (this._lastPos < i4) + this._val += chunk.latin1Slice(this._lastPos, i4); + this._lastPos = i4 + 1; + this._byte = -1; + i4 = readPctEnc(this, chunk, i4 + 1, len); + if (i4 === -1) + return cb(new Error("Malformed urlencoded form")); + if (i4 >= len) + return cb(); + ++this._bytesVal; + i4 = skipValBytes(this, chunk, i4, len); + continue; + } + ++i4; + ++this._bytesVal; + i4 = skipValBytes(this, chunk, i4, len); + } + if (this._lastPos < i4) + this._val += chunk.latin1Slice(this._lastPos, i4); + } + } + cb(); + } + _final(cb) { + if (this._byte !== -2) + return cb(new Error("Malformed urlencoded form")); + if (!this._inKey || this._bytesKey > 0 || this._bytesVal > 0) { + if (this._inKey) + this._key = this._decoder(this._key, this._encode); + else + this._val = this._decoder(this._val, this._encode); + this.emit( + "field", + this._key, + this._val, + { + nameTruncated: this._keyTrunc, + valueTruncated: this._valTrunc, + encoding: this.charset, + mimeType: "text/plain" + } + ); + } + cb(); + } + }; + function readPctEnc(self2, chunk, pos, len) { + if (pos >= len) + return len; + if (self2._byte === -1) { + const hexUpper = HEX_VALUES[chunk[pos++]]; + if (hexUpper === -1) + return -1; + if (hexUpper >= 8) + self2._encode = 2; + if (pos < len) { + const hexLower = HEX_VALUES[chunk[pos++]]; + if (hexLower === -1) + return -1; + if (self2._inKey) + self2._key += String.fromCharCode((hexUpper << 4) + hexLower); + else + self2._val += String.fromCharCode((hexUpper << 4) + hexLower); + self2._byte = -2; + self2._lastPos = pos; + } else { + self2._byte = hexUpper; + } + } else { + const hexLower = HEX_VALUES[chunk[pos++]]; + if (hexLower === -1) + return -1; + if (self2._inKey) + self2._key += String.fromCharCode((self2._byte << 4) + hexLower); + else + self2._val += String.fromCharCode((self2._byte << 4) + hexLower); + self2._byte = -2; + self2._lastPos = pos; + } + return pos; + } + function skipKeyBytes(self2, chunk, pos, len) { + if (self2._bytesKey > self2.fieldNameSizeLimit) { + if (!self2._keyTrunc) { + if (self2._lastPos < pos) + self2._key += chunk.latin1Slice(self2._lastPos, pos - 1); + } + self2._keyTrunc = true; + for (; pos < len; ++pos) { + const code = chunk[pos]; + if (code === 61 || code === 38) + break; + ++self2._bytesKey; + } + self2._lastPos = pos; + } + return pos; + } + function skipValBytes(self2, chunk, pos, len) { + if (self2._bytesVal > self2.fieldSizeLimit) { + if (!self2._valTrunc) { + if (self2._lastPos < pos) + self2._val += chunk.latin1Slice(self2._lastPos, pos - 1); + } + self2._valTrunc = true; + for (; pos < len; ++pos) { + if (chunk[pos] === 38) + break; + ++self2._bytesVal; + } + self2._lastPos = pos; + } + return pos; + } + var HEX_VALUES = [ + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 10, + 11, + 12, + 13, + 14, + 15, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 10, + 11, + 12, + 13, + 14, + 15, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1 + ]; + module2.exports = URLEncoded; + } +}); + +// node_modules/busboy/lib/index.js +var require_lib10 = __commonJS({ + "node_modules/busboy/lib/index.js"(exports2, module2) { + "use strict"; + var { parseContentType } = require_utils9(); + function getInstance(cfg) { + const headers = cfg.headers; + const conType = parseContentType(headers["content-type"]); + if (!conType) + throw new Error("Malformed content type"); + for (const type of TYPES) { + const matched = type.detect(conType); + if (!matched) + continue; + const instanceCfg = { + limits: cfg.limits, + headers, + conType, + highWaterMark: void 0, + fileHwm: void 0, + defCharset: void 0, + defParamCharset: void 0, + preservePath: false + }; + if (cfg.highWaterMark) + instanceCfg.highWaterMark = cfg.highWaterMark; + if (cfg.fileHwm) + instanceCfg.fileHwm = cfg.fileHwm; + instanceCfg.defCharset = cfg.defCharset; + instanceCfg.defParamCharset = cfg.defParamCharset; + instanceCfg.preservePath = cfg.preservePath; + return new type(instanceCfg); + } + throw new Error(`Unsupported content type: ${headers["content-type"]}`); + } + var TYPES = [ + require_multipart(), + require_urlencoded3() + ].filter(function(typemod) { + return typeof typemod.detect === "function"; + }); + module2.exports = (cfg) => { + if (typeof cfg !== "object" || cfg === null) + cfg = {}; + if (typeof cfg.headers !== "object" || cfg.headers === null || typeof cfg.headers["content-type"] !== "string") { + throw new Error("Missing Content-Type"); + } + return getInstance(cfg); + }; + } +}); + +// node_modules/xtend/immutable.js +var require_immutable = __commonJS({ + "node_modules/xtend/immutable.js"(exports2, module2) { + module2.exports = extend; + var hasOwnProperty = Object.prototype.hasOwnProperty; + function extend() { + var target = {}; + for (var i4 = 0; i4 < arguments.length; i4++) { + var source = arguments[i4]; + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + } + } +}); + +// node_modules/append-field/lib/parse-path.js +var require_parse_path = __commonJS({ + "node_modules/append-field/lib/parse-path.js"(exports2, module2) { + var reFirstKey = /^[^\[]*/; + var reDigitPath = /^\[(\d+)\]/; + var reNormalPath = /^\[([^\]]+)\]/; + function parsePath(key) { + function failure() { + return [{ type: "object", key, last: true }]; + } + var firstKey = reFirstKey.exec(key)[0]; + if (!firstKey) return failure(); + var len = key.length; + var pos = firstKey.length; + var tail = { type: "object", key: firstKey }; + var steps = [tail]; + while (pos < len) { + var m4; + if (key[pos] === "[" && key[pos + 1] === "]") { + pos += 2; + tail.append = true; + if (pos !== len) return failure(); + continue; + } + m4 = reDigitPath.exec(key.substring(pos)); + if (m4 !== null) { + pos += m4[0].length; + tail.nextType = "array"; + tail = { type: "array", key: parseInt(m4[1], 10) }; + steps.push(tail); + continue; + } + m4 = reNormalPath.exec(key.substring(pos)); + if (m4 !== null) { + pos += m4[0].length; + tail.nextType = "object"; + tail = { type: "object", key: m4[1] }; + steps.push(tail); + continue; + } + return failure(); + } + tail.last = true; + return steps; + } + module2.exports = parsePath; + } +}); + +// node_modules/append-field/lib/set-value.js +var require_set_value = __commonJS({ + "node_modules/append-field/lib/set-value.js"(exports2, module2) { + function valueType(value) { + if (value === void 0) return "undefined"; + if (Array.isArray(value)) return "array"; + if (typeof value === "object") return "object"; + return "scalar"; + } + function setLastValue(context, step, currentValue, entryValue) { + switch (valueType(currentValue)) { + case "undefined": + if (step.append) { + context[step.key] = [entryValue]; + } else { + context[step.key] = entryValue; + } + break; + case "array": + context[step.key].push(entryValue); + break; + case "object": + return setLastValue(currentValue, { type: "object", key: "", last: true }, currentValue[""], entryValue); + case "scalar": + context[step.key] = [context[step.key], entryValue]; + break; + } + return context; + } + function setValue(context, step, currentValue, entryValue) { + if (step.last) return setLastValue(context, step, currentValue, entryValue); + var obj; + switch (valueType(currentValue)) { + case "undefined": + if (step.nextType === "array") { + context[step.key] = []; + } else { + context[step.key] = /* @__PURE__ */ Object.create(null); + } + return context[step.key]; + case "object": + return context[step.key]; + case "array": + if (step.nextType === "array") { + return currentValue; + } + obj = /* @__PURE__ */ Object.create(null); + context[step.key] = obj; + currentValue.forEach(function(item, i4) { + if (item !== void 0) obj["" + i4] = item; + }); + return obj; + case "scalar": + obj = /* @__PURE__ */ Object.create(null); + obj[""] = currentValue; + context[step.key] = obj; + return obj; + } + } + module2.exports = setValue; + } +}); + +// node_modules/append-field/index.js +var require_append_field = __commonJS({ + "node_modules/append-field/index.js"(exports2, module2) { + var parsePath = require_parse_path(); + var setValue = require_set_value(); + function appendField(store, key, value) { + var steps = parsePath(key); + steps.reduce(function(context, step) { + return setValue(context, step, context[step.key], value); + }, store); + } + module2.exports = appendField; + } +}); + +// node_modules/multer/lib/counter.js +var require_counter = __commonJS({ + "node_modules/multer/lib/counter.js"(exports2, module2) { + var EventEmitter = require("events").EventEmitter; + function Counter() { + EventEmitter.call(this); + this.value = 0; + } + Counter.prototype = Object.create(EventEmitter.prototype); + Counter.prototype.increment = function increment() { + this.value++; + }; + Counter.prototype.decrement = function decrement() { + if (--this.value === 0) this.emit("zero"); + }; + Counter.prototype.isZero = function isZero() { + return this.value === 0; + }; + Counter.prototype.onceZero = function onceZero(fn2) { + if (this.isZero()) return fn2(); + this.once("zero", fn2); + }; + module2.exports = Counter; + } +}); + +// node_modules/multer/lib/multer-error.js +var require_multer_error = __commonJS({ + "node_modules/multer/lib/multer-error.js"(exports2, module2) { + var util = require("util"); + var errorMessages = { + LIMIT_PART_COUNT: "Too many parts", + LIMIT_FILE_SIZE: "File too large", + LIMIT_FILE_COUNT: "Too many files", + LIMIT_FIELD_KEY: "Field name too long", + LIMIT_FIELD_VALUE: "Field value too long", + LIMIT_FIELD_COUNT: "Too many fields", + LIMIT_UNEXPECTED_FILE: "Unexpected field", + MISSING_FIELD_NAME: "Field name missing" + }; + function MulterError(code, field) { + Error.captureStackTrace(this, this.constructor); + this.name = this.constructor.name; + this.message = errorMessages[code]; + this.code = code; + if (field) this.field = field; + } + util.inherits(MulterError, Error); + module2.exports = MulterError; + } +}); + +// node_modules/multer/lib/file-appender.js +var require_file_appender = __commonJS({ + "node_modules/multer/lib/file-appender.js"(exports2, module2) { + var objectAssign = require_object_assign(); + function arrayRemove(arr, item) { + var idx = arr.indexOf(item); + if (~idx) arr.splice(idx, 1); + } + function FileAppender(strategy, req) { + this.strategy = strategy; + this.req = req; + switch (strategy) { + case "NONE": + break; + case "VALUE": + break; + case "ARRAY": + req.files = []; + break; + case "OBJECT": + req.files = /* @__PURE__ */ Object.create(null); + break; + default: + throw new Error("Unknown file strategy: " + strategy); + } + } + FileAppender.prototype.insertPlaceholder = function(file) { + var placeholder = { + fieldname: file.fieldname + }; + switch (this.strategy) { + case "NONE": + break; + case "VALUE": + break; + case "ARRAY": + this.req.files.push(placeholder); + break; + case "OBJECT": + if (this.req.files[file.fieldname]) { + this.req.files[file.fieldname].push(placeholder); + } else { + this.req.files[file.fieldname] = [placeholder]; + } + break; + } + return placeholder; + }; + FileAppender.prototype.removePlaceholder = function(placeholder) { + switch (this.strategy) { + case "NONE": + break; + case "VALUE": + break; + case "ARRAY": + arrayRemove(this.req.files, placeholder); + break; + case "OBJECT": + if (this.req.files[placeholder.fieldname].length === 1) { + delete this.req.files[placeholder.fieldname]; + } else { + arrayRemove(this.req.files[placeholder.fieldname], placeholder); + } + break; + } + }; + FileAppender.prototype.replacePlaceholder = function(placeholder, file) { + if (this.strategy === "VALUE") { + this.req.file = file; + return; + } + delete placeholder.fieldname; + objectAssign(placeholder, file); + }; + module2.exports = FileAppender; + } +}); + +// node_modules/multer/lib/remove-uploaded-files.js +var require_remove_uploaded_files = __commonJS({ + "node_modules/multer/lib/remove-uploaded-files.js"(exports2, module2) { + function removeUploadedFiles(uploadedFiles, remove, cb) { + var length = uploadedFiles.length; + var errors = []; + if (length === 0) return cb(null, errors); + function handleFile(idx) { + var file = uploadedFiles[idx]; + remove(file, function(err) { + if (err) { + err.file = file; + err.field = file.fieldname; + errors.push(err); + } + if (idx < length - 1) { + handleFile(idx + 1); + } else { + cb(null, errors); + } + }); + } + handleFile(0); + } + module2.exports = removeUploadedFiles; + } +}); + +// node_modules/multer/lib/make-middleware.js +var require_make_middleware = __commonJS({ + "node_modules/multer/lib/make-middleware.js"(exports2, module2) { + var is = require_type_is(); + var Busboy = require_lib10(); + var extend = require_immutable(); + var appendField = require_append_field(); + var Counter = require_counter(); + var MulterError = require_multer_error(); + var FileAppender = require_file_appender(); + var removeUploadedFiles = require_remove_uploaded_files(); + function drainStream(stream) { + stream.on("readable", () => { + while (stream.read() !== null) { + } + }); + } + function makeMiddleware(setup) { + return function multerMiddleware(req, res, next) { + if (!is(req, ["multipart"])) return next(); + var options = setup(); + var limits = options.limits; + var storage = options.storage; + var fileFilter = options.fileFilter; + var fileStrategy = options.fileStrategy; + var preservePath = options.preservePath; + req.body = /* @__PURE__ */ Object.create(null); + req.on("error", function(err) { + abortWithError(err); + }); + var busboy; + try { + busboy = Busboy({ headers: req.headers, limits, preservePath }); + } catch (err) { + return next(err); + } + var appender = new FileAppender(fileStrategy, req); + var isDone = false; + var readFinished = false; + var errorOccured = false; + var pendingWrites = new Counter(); + var uploadedFiles = []; + function done(err) { + if (isDone) return; + isDone = true; + req.unpipe(busboy); + drainStream(req); + req.resume(); + setImmediate(() => { + busboy.removeAllListeners(); + }); + next(err); + } + function indicateDone() { + if (readFinished && pendingWrites.isZero() && !errorOccured) done(); + } + function abortWithError(uploadError) { + if (errorOccured) return; + errorOccured = true; + pendingWrites.onceZero(function() { + function remove(file, cb) { + storage._removeFile(req, file, cb); + } + removeUploadedFiles(uploadedFiles, remove, function(err, storageErrors) { + if (err) return done(err); + uploadError.storageErrors = storageErrors; + done(uploadError); + }); + }); + } + function abortWithCode(code, optionalField) { + abortWithError(new MulterError(code, optionalField)); + } + busboy.on("field", function(fieldname, value, { nameTruncated, valueTruncated }) { + if (fieldname == null) return abortWithCode("MISSING_FIELD_NAME"); + if (nameTruncated) return abortWithCode("LIMIT_FIELD_KEY"); + if (valueTruncated) return abortWithCode("LIMIT_FIELD_VALUE", fieldname); + if (limits && Object.prototype.hasOwnProperty.call(limits, "fieldNameSize")) { + if (fieldname.length > limits.fieldNameSize) return abortWithCode("LIMIT_FIELD_KEY"); + } + appendField(req.body, fieldname, value); + }); + busboy.on("file", function(fieldname, fileStream, { filename, encoding, mimeType }) { + var pendingWritesIncremented = false; + fileStream.on("error", function(err) { + if (pendingWritesIncremented) { + pendingWrites.decrement(); + } + abortWithError(err); + }); + if (fieldname == null) return abortWithCode("MISSING_FIELD_NAME"); + if (!filename) return fileStream.resume(); + if (limits && Object.prototype.hasOwnProperty.call(limits, "fieldNameSize")) { + if (fieldname.length > limits.fieldNameSize) return abortWithCode("LIMIT_FIELD_KEY"); + } + var file = { + fieldname, + originalname: filename, + encoding, + mimetype: mimeType + }; + var placeholder = appender.insertPlaceholder(file); + fileFilter(req, file, function(err, includeFile) { + if (err) { + appender.removePlaceholder(placeholder); + return abortWithError(err); + } + if (!includeFile) { + appender.removePlaceholder(placeholder); + return fileStream.resume(); + } + var aborting = false; + pendingWritesIncremented = true; + pendingWrites.increment(); + Object.defineProperty(file, "stream", { + configurable: true, + enumerable: false, + value: fileStream + }); + fileStream.on("limit", function() { + aborting = true; + abortWithCode("LIMIT_FILE_SIZE", fieldname); + }); + storage._handleFile(req, file, function(err2, info) { + if (aborting) { + appender.removePlaceholder(placeholder); + uploadedFiles.push(extend(file, info)); + return pendingWrites.decrement(); + } + if (err2) { + appender.removePlaceholder(placeholder); + pendingWrites.decrement(); + return abortWithError(err2); + } + var fileInfo = extend(file, info); + appender.replacePlaceholder(placeholder, fileInfo); + uploadedFiles.push(fileInfo); + pendingWrites.decrement(); + indicateDone(); + }); + }); + }); + busboy.on("error", function(err) { + abortWithError(err); + }); + busboy.on("partsLimit", function() { + abortWithCode("LIMIT_PART_COUNT"); + }); + busboy.on("filesLimit", function() { + abortWithCode("LIMIT_FILE_COUNT"); + }); + busboy.on("fieldsLimit", function() { + abortWithCode("LIMIT_FIELD_COUNT"); + }); + busboy.on("close", function() { + readFinished = true; + indicateDone(); + }); + req.pipe(busboy); + }; + } + module2.exports = makeMiddleware; + } +}); + +// node_modules/multer/node_modules/mkdirp/index.js +var require_mkdirp = __commonJS({ + "node_modules/multer/node_modules/mkdirp/index.js"(exports2, module2) { + var path = require("path"); + var fs = require("fs"); + var _0777 = parseInt("0777", 8); + module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; + function mkdirP(p4, opts, f4, made) { + if (typeof opts === "function") { + f4 = opts; + opts = {}; + } else if (!opts || typeof opts !== "object") { + opts = { mode: opts }; + } + var mode = opts.mode; + var xfs = opts.fs || fs; + if (mode === void 0) { + mode = _0777; + } + if (!made) made = null; + var cb = f4 || /* istanbul ignore next */ + function() { + }; + p4 = path.resolve(p4); + xfs.mkdir(p4, mode, function(er) { + if (!er) { + made = made || p4; + return cb(null, made); + } + switch (er.code) { + case "ENOENT": + if (path.dirname(p4) === p4) return cb(er); + mkdirP(path.dirname(p4), opts, function(er2, made2) { + if (er2) cb(er2, made2); + else mkdirP(p4, opts, cb, made2); + }); + break; + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p4, function(er2, stat) { + if (er2 || !stat.isDirectory()) cb(er, made); + else cb(null, made); + }); + break; + } + }); + } + mkdirP.sync = function sync(p4, opts, made) { + if (!opts || typeof opts !== "object") { + opts = { mode: opts }; + } + var mode = opts.mode; + var xfs = opts.fs || fs; + if (mode === void 0) { + mode = _0777; + } + if (!made) made = null; + p4 = path.resolve(p4); + try { + xfs.mkdirSync(p4, mode); + made = made || p4; + } catch (err0) { + switch (err0.code) { + case "ENOENT": + made = sync(path.dirname(p4), opts, made); + sync(p4, opts, made); + break; + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + var stat; + try { + stat = xfs.statSync(p4); + } catch (err1) { + throw err0; + } + if (!stat.isDirectory()) throw err0; + break; + } + } + return made; + }; + } +}); + +// node_modules/multer/storage/disk.js +var require_disk = __commonJS({ + "node_modules/multer/storage/disk.js"(exports2, module2) { + var fs = require("fs"); + var os = require("os"); + var path = require("path"); + var crypto2 = require("crypto"); + var mkdirp = require_mkdirp(); + function getFilename(req, file, cb) { + crypto2.randomBytes(16, function(err, raw) { + cb(err, err ? void 0 : raw.toString("hex")); + }); + } + function getDestination(req, file, cb) { + cb(null, os.tmpdir()); + } + function DiskStorage(opts) { + this.getFilename = opts.filename || getFilename; + if (typeof opts.destination === "string") { + mkdirp.sync(opts.destination); + this.getDestination = function($0, $1, cb) { + cb(null, opts.destination); + }; + } else { + this.getDestination = opts.destination || getDestination; + } + } + DiskStorage.prototype._handleFile = function _handleFile(req, file, cb) { + var that = this; + that.getDestination(req, file, function(err, destination) { + if (err) return cb(err); + that.getFilename(req, file, function(err2, filename) { + if (err2) return cb(err2); + var finalPath = path.join(destination, filename); + var outStream = fs.createWriteStream(finalPath); + file.stream.pipe(outStream); + outStream.on("error", cb); + outStream.on("finish", function() { + cb(null, { + destination, + filename, + path: finalPath, + size: outStream.bytesWritten + }); + }); + }); + }); + }; + DiskStorage.prototype._removeFile = function _removeFile(req, file, cb) { + var path2 = file.path; + delete file.destination; + delete file.filename; + delete file.path; + fs.unlink(path2, cb); + }; + module2.exports = function(opts) { + return new DiskStorage(opts); + }; + } +}); + +// node_modules/readable-stream/lib/internal/streams/stream.js +var require_stream = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/stream.js"(exports2, module2) { + module2.exports = require("stream"); + } +}); + +// node_modules/readable-stream/lib/internal/streams/buffer_list.js +var require_buffer_list = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports2, module2) { + "use strict"; + function ownKeys2(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread(target) { + for (var i4 = 1; i4 < arguments.length; i4++) { + var source = null != arguments[i4] ? arguments[i4] : {}; + i4 % 2 ? ownKeys2(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; + } + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i4 = 0; i4 < props.length; i4++) { + var descriptor = props[i4]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + var _require = require("buffer"); + var Buffer2 = _require.Buffer; + var _require2 = require("util"); + var inspect = _require2.inspect; + var custom = inspect && inspect.custom || "inspect"; + function copyBuffer(src, target, offset) { + Buffer2.prototype.copy.call(src, target, offset); + } + module2.exports = /* @__PURE__ */ (function() { + function BufferList() { + _classCallCheck(this, BufferList); + this.head = null; + this.tail = null; + this.length = 0; + } + _createClass(BufferList, [{ + key: "push", + value: function push(v4) { + var entry = { + data: v4, + next: null + }; + if (this.length > 0) this.tail.next = entry; + else this.head = entry; + this.tail = entry; + ++this.length; + } + }, { + key: "unshift", + value: function unshift(v4) { + var entry = { + data: v4, + next: this.head + }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + } + }, { + key: "shift", + value: function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null; + else this.head = this.head.next; + --this.length; + return ret; + } + }, { + key: "clear", + value: function clear() { + this.head = this.tail = null; + this.length = 0; + } + }, { + key: "join", + value: function join(s4) { + if (this.length === 0) return ""; + var p4 = this.head; + var ret = "" + p4.data; + while (p4 = p4.next) ret += s4 + p4.data; + return ret; + } + }, { + key: "concat", + value: function concat(n4) { + if (this.length === 0) return Buffer2.alloc(0); + var ret = Buffer2.allocUnsafe(n4 >>> 0); + var p4 = this.head; + var i4 = 0; + while (p4) { + copyBuffer(p4.data, ret, i4); + i4 += p4.data.length; + p4 = p4.next; + } + return ret; + } + // Consumes a specified amount of bytes or characters from the buffered data. + }, { + key: "consume", + value: function consume(n4, hasStrings) { + var ret; + if (n4 < this.head.data.length) { + ret = this.head.data.slice(0, n4); + this.head.data = this.head.data.slice(n4); + } else if (n4 === this.head.data.length) { + ret = this.shift(); + } else { + ret = hasStrings ? this._getString(n4) : this._getBuffer(n4); + } + return ret; + } + }, { + key: "first", + value: function first() { + return this.head.data; + } + // Consumes a specified amount of characters from the buffered data. + }, { + key: "_getString", + value: function _getString(n4) { + var p4 = this.head; + var c4 = 1; + var ret = p4.data; + n4 -= ret.length; + while (p4 = p4.next) { + var str = p4.data; + var nb = n4 > str.length ? str.length : n4; + if (nb === str.length) ret += str; + else ret += str.slice(0, n4); + n4 -= nb; + if (n4 === 0) { + if (nb === str.length) { + ++c4; + if (p4.next) this.head = p4.next; + else this.head = this.tail = null; + } else { + this.head = p4; + p4.data = str.slice(nb); + } + break; + } + ++c4; + } + this.length -= c4; + return ret; + } + // Consumes a specified amount of bytes from the buffered data. + }, { + key: "_getBuffer", + value: function _getBuffer(n4) { + var ret = Buffer2.allocUnsafe(n4); + var p4 = this.head; + var c4 = 1; + p4.data.copy(ret); + n4 -= p4.data.length; + while (p4 = p4.next) { + var buf = p4.data; + var nb = n4 > buf.length ? buf.length : n4; + buf.copy(ret, ret.length - n4, 0, nb); + n4 -= nb; + if (n4 === 0) { + if (nb === buf.length) { + ++c4; + if (p4.next) this.head = p4.next; + else this.head = this.tail = null; + } else { + this.head = p4; + p4.data = buf.slice(nb); + } + break; + } + ++c4; + } + this.length -= c4; + return ret; + } + // Make sure the linked list only shows the minimal necessary information. + }, { + key: custom, + value: function value(_, options) { + return inspect(this, _objectSpread(_objectSpread({}, options), {}, { + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false + })); + } + }]); + return BufferList; + })(); + } +}); + +// node_modules/readable-stream/lib/internal/streams/destroy.js +var require_destroy2 = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/destroy.js"(exports2, module2) { + "use strict"; + function destroy(err, cb) { + var _this = this; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + process.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + process.nextTick(emitErrorNT, this, err); + } + } + return this; + } + if (this._readableState) { + this._readableState.destroyed = true; + } + if (this._writableState) { + this._writableState.destroyed = true; + } + this._destroy(err || null, function(err2) { + if (!cb && err2) { + if (!_this._writableState) { + process.nextTick(emitErrorAndCloseNT, _this, err2); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + process.nextTick(emitErrorAndCloseNT, _this, err2); + } else { + process.nextTick(emitCloseNT, _this); + } + } else if (cb) { + process.nextTick(emitCloseNT, _this); + cb(err2); + } else { + process.nextTick(emitCloseNT, _this); + } + }); + return this; + } + function emitErrorAndCloseNT(self2, err) { + emitErrorNT(self2, err); + emitCloseNT(self2); + } + function emitCloseNT(self2) { + if (self2._writableState && !self2._writableState.emitClose) return; + if (self2._readableState && !self2._readableState.emitClose) return; + self2.emit("close"); + } + function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } + } + function emitErrorNT(self2, err) { + self2.emit("error", err); + } + function errorOrDestroy(stream, err) { + var rState = stream._readableState; + var wState = stream._writableState; + if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err); + else stream.emit("error", err); + } + module2.exports = { + destroy, + undestroy, + errorOrDestroy + }; + } +}); + +// node_modules/readable-stream/errors.js +var require_errors3 = __commonJS({ + "node_modules/readable-stream/errors.js"(exports2, module2) { + "use strict"; + var codes = {}; + function createErrorType(code, message2, Base) { + if (!Base) { + Base = Error; + } + function getMessage(arg1, arg2, arg3) { + if (typeof message2 === "string") { + return message2; + } else { + return message2(arg1, arg2, arg3); + } + } + class NodeError extends Base { + constructor(arg1, arg2, arg3) { + super(getMessage(arg1, arg2, arg3)); + } + } + NodeError.prototype.name = Base.name; + NodeError.prototype.code = code; + codes[code] = NodeError; + } + function oneOf(expected, thing) { + if (Array.isArray(expected)) { + const len = expected.length; + expected = expected.map((i4) => String(i4)); + if (len > 2) { + return `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + expected[len - 1]; + } else if (len === 2) { + return `one of ${thing} ${expected[0]} or ${expected[1]}`; + } else { + return `of ${thing} ${expected[0]}`; + } + } else { + return `of ${thing} ${String(expected)}`; + } + } + function startsWith(str, search, pos) { + return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; + } + function endsWith(str, search, this_len) { + if (this_len === void 0 || this_len > str.length) { + this_len = str.length; + } + return str.substring(this_len - search.length, this_len) === search; + } + function includes(str, search, start) { + if (typeof start !== "number") { + start = 0; + } + if (start + search.length > str.length) { + return false; + } else { + return str.indexOf(search, start) !== -1; + } + } + createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) { + return 'The value "' + value + '" is invalid for option "' + name + '"'; + }, TypeError); + createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) { + let determiner; + if (typeof expected === "string" && startsWith(expected, "not ")) { + determiner = "must not be"; + expected = expected.replace(/^not /, ""); + } else { + determiner = "must be"; + } + let msg; + if (endsWith(name, " argument")) { + msg = `The ${name} ${determiner} ${oneOf(expected, "type")}`; + } else { + const type = includes(name, ".") ? "property" : "argument"; + msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, "type")}`; + } + msg += `. Received type ${typeof actual}`; + return msg; + }, TypeError); + createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); + createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) { + return "The " + name + " method is not implemented"; + }); + createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); + createErrorType("ERR_STREAM_DESTROYED", function(name) { + return "Cannot call " + name + " after a stream was destroyed"; + }); + createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); + createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); + createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); + createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); + createErrorType("ERR_UNKNOWN_ENCODING", function(arg) { + return "Unknown encoding: " + arg; + }, TypeError); + createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"); + module2.exports.codes = codes; + } +}); + +// node_modules/readable-stream/lib/internal/streams/state.js +var require_state = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/state.js"(exports2, module2) { + "use strict"; + var ERR_INVALID_OPT_VALUE = require_errors3().codes.ERR_INVALID_OPT_VALUE; + function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; + } + function getHighWaterMark(state2, options, duplexKey, isDuplex) { + var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); + if (hwm != null) { + if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { + var name = isDuplex ? duplexKey : "highWaterMark"; + throw new ERR_INVALID_OPT_VALUE(name, hwm); + } + return Math.floor(hwm); + } + return state2.objectMode ? 16 : 16 * 1024; + } + module2.exports = { + getHighWaterMark + }; + } +}); + +// node_modules/util-deprecate/node.js +var require_node5 = __commonJS({ + "node_modules/util-deprecate/node.js"(exports2, module2) { + module2.exports = require("util").deprecate; + } +}); + +// node_modules/readable-stream/lib/_stream_writable.js +var require_stream_writable = __commonJS({ + "node_modules/readable-stream/lib/_stream_writable.js"(exports2, module2) { + "use strict"; + module2.exports = Writable; + function CorkedRequest(state2) { + var _this = this; + this.next = null; + this.entry = null; + this.finish = function() { + onCorkedFinish(_this, state2); + }; + } + var Duplex; + Writable.WritableState = WritableState; + var internalUtil = { + deprecate: require_node5() + }; + var Stream = require_stream(); + var Buffer2 = require("buffer").Buffer; + var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk) { + return Buffer2.from(chunk); + } + function _isUint8Array(obj) { + return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; + } + var destroyImpl = require_destroy2(); + var _require = require_state(); + var getHighWaterMark = _require.getHighWaterMark; + var _require$codes = require_errors3().codes; + var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; + var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; + var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; + var ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE; + var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; + var ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES; + var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END; + var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; + var errorOrDestroy = destroyImpl.errorOrDestroy; + require_inherits()(Writable, Stream); + function nop() { + } + function WritableState(options, stream, isDuplex) { + Duplex = Duplex || require_stream_duplex(); + options = options || {}; + if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex; + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex); + this.finalCalled = false; + this.needDrain = false; + this.ending = false; + this.ended = false; + this.finished = false; + this.destroyed = false; + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.length = 0; + this.writing = false; + this.corked = 0; + this.sync = true; + this.bufferProcessing = false; + this.onwrite = function(er) { + onwrite(stream, er); + }; + this.writecb = null; + this.writelen = 0; + this.bufferedRequest = null; + this.lastBufferedRequest = null; + this.pendingcb = 0; + this.prefinished = false; + this.errorEmitted = false; + this.emitClose = options.emitClose !== false; + this.autoDestroy = !!options.autoDestroy; + this.bufferedRequestCount = 0; + this.corkedRequestsFree = new CorkedRequest(this); + } + WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; + }; + (function() { + try { + Object.defineProperty(WritableState.prototype, "buffer", { + get: internalUtil.deprecate(function writableStateBufferGetter() { + return this.getBuffer(); + }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") + }); + } catch (_) { + } + })(); + var realHasInstance; + if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function value(object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + return object && object._writableState instanceof WritableState; + } + }); + } else { + realHasInstance = function realHasInstance2(object) { + return object instanceof this; + }; + } + function Writable(options) { + Duplex = Duplex || require_stream_duplex(); + var isDuplex = this instanceof Duplex; + if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); + this._writableState = new WritableState(options, this, isDuplex); + this.writable = true; + if (options) { + if (typeof options.write === "function") this._write = options.write; + if (typeof options.writev === "function") this._writev = options.writev; + if (typeof options.destroy === "function") this._destroy = options.destroy; + if (typeof options.final === "function") this._final = options.final; + } + Stream.call(this); + } + Writable.prototype.pipe = function() { + errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); + }; + function writeAfterEnd(stream, cb) { + var er = new ERR_STREAM_WRITE_AFTER_END(); + errorOrDestroy(stream, er); + process.nextTick(cb, er); + } + function validChunk(stream, state2, chunk, cb) { + var er; + if (chunk === null) { + er = new ERR_STREAM_NULL_VALUES(); + } else if (typeof chunk !== "string" && !state2.objectMode) { + er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk); + } + if (er) { + errorOrDestroy(stream, er); + process.nextTick(cb, er); + return false; + } + return true; + } + Writable.prototype.write = function(chunk, encoding, cb) { + var state2 = this._writableState; + var ret = false; + var isBuf = !state2.objectMode && _isUint8Array(chunk); + if (isBuf && !Buffer2.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (isBuf) encoding = "buffer"; + else if (!encoding) encoding = state2.defaultEncoding; + if (typeof cb !== "function") cb = nop; + if (state2.ending) writeAfterEnd(this, cb); + else if (isBuf || validChunk(this, state2, chunk, cb)) { + state2.pendingcb++; + ret = writeOrBuffer(this, state2, isBuf, chunk, encoding, cb); + } + return ret; + }; + Writable.prototype.cork = function() { + this._writableState.corked++; + }; + Writable.prototype.uncork = function() { + var state2 = this._writableState; + if (state2.corked) { + state2.corked--; + if (!state2.writing && !state2.corked && !state2.bufferProcessing && state2.bufferedRequest) clearBuffer(this, state2); + } + }; + Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + if (typeof encoding === "string") encoding = encoding.toLowerCase(); + if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); + this._writableState.defaultEncoding = encoding; + return this; + }; + Object.defineProperty(Writable.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._writableState && this._writableState.getBuffer(); + } + }); + function decodeChunk(state2, chunk, encoding) { + if (!state2.objectMode && state2.decodeStrings !== false && typeof chunk === "string") { + chunk = Buffer2.from(chunk, encoding); + } + return chunk; + } + Object.defineProperty(Writable.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._writableState.highWaterMark; + } + }); + function writeOrBuffer(stream, state2, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state2, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = "buffer"; + chunk = newChunk; + } + } + var len = state2.objectMode ? 1 : chunk.length; + state2.length += len; + var ret = state2.length < state2.highWaterMark; + if (!ret) state2.needDrain = true; + if (state2.writing || state2.corked) { + var last = state2.lastBufferedRequest; + state2.lastBufferedRequest = { + chunk, + encoding, + isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state2.lastBufferedRequest; + } else { + state2.bufferedRequest = state2.lastBufferedRequest; + } + state2.bufferedRequestCount += 1; + } else { + doWrite(stream, state2, false, len, chunk, encoding, cb); + } + return ret; + } + function doWrite(stream, state2, writev, len, chunk, encoding, cb) { + state2.writelen = len; + state2.writecb = cb; + state2.writing = true; + state2.sync = true; + if (state2.destroyed) state2.onwrite(new ERR_STREAM_DESTROYED("write")); + else if (writev) stream._writev(chunk, state2.onwrite); + else stream._write(chunk, encoding, state2.onwrite); + state2.sync = false; + } + function onwriteError(stream, state2, sync, er, cb) { + --state2.pendingcb; + if (sync) { + process.nextTick(cb, er); + process.nextTick(finishMaybe, stream, state2); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); + } else { + cb(er); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); + finishMaybe(stream, state2); + } + } + function onwriteStateUpdate(state2) { + state2.writing = false; + state2.writecb = null; + state2.length -= state2.writelen; + state2.writelen = 0; + } + function onwrite(stream, er) { + var state2 = stream._writableState; + var sync = state2.sync; + var cb = state2.writecb; + if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state2); + if (er) onwriteError(stream, state2, sync, er, cb); + else { + var finished = needFinish(state2) || stream.destroyed; + if (!finished && !state2.corked && !state2.bufferProcessing && state2.bufferedRequest) { + clearBuffer(stream, state2); + } + if (sync) { + process.nextTick(afterWrite, stream, state2, finished, cb); + } else { + afterWrite(stream, state2, finished, cb); + } + } + } + function afterWrite(stream, state2, finished, cb) { + if (!finished) onwriteDrain(stream, state2); + state2.pendingcb--; + cb(); + finishMaybe(stream, state2); + } + function onwriteDrain(stream, state2) { + if (state2.length === 0 && state2.needDrain) { + state2.needDrain = false; + stream.emit("drain"); + } + } + function clearBuffer(stream, state2) { + state2.bufferProcessing = true; + var entry = state2.bufferedRequest; + if (stream._writev && entry && entry.next) { + var l4 = state2.bufferedRequestCount; + var buffer = new Array(l4); + var holder = state2.corkedRequestsFree; + holder.entry = entry; + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + doWrite(stream, state2, true, state2.length, buffer, "", holder.finish); + state2.pendingcb++; + state2.lastBufferedRequest = null; + if (holder.next) { + state2.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state2.corkedRequestsFree = new CorkedRequest(state2); + } + state2.bufferedRequestCount = 0; + } else { + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state2.objectMode ? 1 : chunk.length; + doWrite(stream, state2, false, len, chunk, encoding, cb); + entry = entry.next; + state2.bufferedRequestCount--; + if (state2.writing) { + break; + } + } + if (entry === null) state2.lastBufferedRequest = null; + } + state2.bufferedRequest = entry; + state2.bufferProcessing = false; + } + Writable.prototype._write = function(chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()")); + }; + Writable.prototype._writev = null; + Writable.prototype.end = function(chunk, encoding, cb) { + var state2 = this._writableState; + if (typeof chunk === "function") { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (chunk !== null && chunk !== void 0) this.write(chunk, encoding); + if (state2.corked) { + state2.corked = 1; + this.uncork(); + } + if (!state2.ending) endWritable(this, state2, cb); + return this; + }; + Object.defineProperty(Writable.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._writableState.length; + } + }); + function needFinish(state2) { + return state2.ending && state2.length === 0 && state2.bufferedRequest === null && !state2.finished && !state2.writing; + } + function callFinal(stream, state2) { + stream._final(function(err) { + state2.pendingcb--; + if (err) { + errorOrDestroy(stream, err); + } + state2.prefinished = true; + stream.emit("prefinish"); + finishMaybe(stream, state2); + }); + } + function prefinish(stream, state2) { + if (!state2.prefinished && !state2.finalCalled) { + if (typeof stream._final === "function" && !state2.destroyed) { + state2.pendingcb++; + state2.finalCalled = true; + process.nextTick(callFinal, stream, state2); + } else { + state2.prefinished = true; + stream.emit("prefinish"); + } + } + } + function finishMaybe(stream, state2) { + var need = needFinish(state2); + if (need) { + prefinish(stream, state2); + if (state2.pendingcb === 0) { + state2.finished = true; + stream.emit("finish"); + if (state2.autoDestroy) { + var rState = stream._readableState; + if (!rState || rState.autoDestroy && rState.endEmitted) { + stream.destroy(); + } + } + } + } + return need; + } + function endWritable(stream, state2, cb) { + state2.ending = true; + finishMaybe(stream, state2); + if (cb) { + if (state2.finished) process.nextTick(cb); + else stream.once("finish", cb); + } + state2.ended = true; + stream.writable = false; + } + function onCorkedFinish(corkReq, state2, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state2.pendingcb--; + cb(err); + entry = entry.next; + } + state2.corkedRequestsFree.next = corkReq; + } + Object.defineProperty(Writable.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + if (this._writableState === void 0) { + return false; + } + return this._writableState.destroyed; + }, + set: function set(value) { + if (!this._writableState) { + return; + } + this._writableState.destroyed = value; + } + }); + Writable.prototype.destroy = destroyImpl.destroy; + Writable.prototype._undestroy = destroyImpl.undestroy; + Writable.prototype._destroy = function(err, cb) { + cb(err); + }; + } +}); + +// node_modules/readable-stream/lib/_stream_duplex.js +var require_stream_duplex = __commonJS({ + "node_modules/readable-stream/lib/_stream_duplex.js"(exports2, module2) { + "use strict"; + var objectKeys = Object.keys || function(obj) { + var keys2 = []; + for (var key in obj) keys2.push(key); + return keys2; + }; + module2.exports = Duplex; + var Readable = require_stream_readable(); + var Writable = require_stream_writable(); + require_inherits()(Duplex, Readable); + { + keys = objectKeys(Writable.prototype); + for (v4 = 0; v4 < keys.length; v4++) { + method = keys[v4]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } + } + var keys; + var method; + var v4; + function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + Readable.call(this, options); + Writable.call(this, options); + this.allowHalfOpen = true; + if (options) { + if (options.readable === false) this.readable = false; + if (options.writable === false) this.writable = false; + if (options.allowHalfOpen === false) { + this.allowHalfOpen = false; + this.once("end", onend); + } + } + } + Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._writableState.highWaterMark; + } + }); + Object.defineProperty(Duplex.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._writableState && this._writableState.getBuffer(); + } + }); + Object.defineProperty(Duplex.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._writableState.length; + } + }); + function onend() { + if (this._writableState.ended) return; + process.nextTick(onEndNT, this); + } + function onEndNT(self2) { + self2.end(); + } + Object.defineProperty(Duplex.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + if (this._readableState === void 0 || this._writableState === void 0) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function set(value) { + if (this._readableState === void 0 || this._writableState === void 0) { + return; + } + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } + }); + } +}); + +// node_modules/string_decoder/node_modules/safe-buffer/index.js +var require_safe_buffer2 = __commonJS({ + "node_modules/string_decoder/node_modules/safe-buffer/index.js"(exports2, module2) { + var buffer = require("buffer"); + var Buffer2 = buffer.Buffer; + function copyProps(src, dst) { + for (var key in src) { + dst[key] = src[key]; + } + } + if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) { + module2.exports = buffer; + } else { + copyProps(buffer, exports2); + exports2.Buffer = SafeBuffer; + } + function SafeBuffer(arg, encodingOrOffset, length) { + return Buffer2(arg, encodingOrOffset, length); + } + SafeBuffer.prototype = Object.create(Buffer2.prototype); + copyProps(Buffer2, SafeBuffer); + SafeBuffer.from = function(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + throw new TypeError("Argument must not be a number"); + } + return Buffer2(arg, encodingOrOffset, length); + }; + SafeBuffer.alloc = function(size, fill, encoding) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + var buf = Buffer2(size); + if (fill !== void 0) { + if (typeof encoding === "string") { + buf.fill(fill, encoding); + } else { + buf.fill(fill); + } + } else { + buf.fill(0); + } + return buf; + }; + SafeBuffer.allocUnsafe = function(size) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + return Buffer2(size); + }; + SafeBuffer.allocUnsafeSlow = function(size) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + return buffer.SlowBuffer(size); + }; + } +}); + +// node_modules/string_decoder/lib/string_decoder.js +var require_string_decoder = __commonJS({ + "node_modules/string_decoder/lib/string_decoder.js"(exports2) { + "use strict"; + var Buffer2 = require_safe_buffer2().Buffer; + var isEncoding = Buffer2.isEncoding || function(encoding) { + encoding = "" + encoding; + switch (encoding && encoding.toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + case "raw": + return true; + default: + return false; + } + }; + function _normalizeEncoding(enc) { + if (!enc) return "utf8"; + var retried; + while (true) { + switch (enc) { + case "utf8": + case "utf-8": + return "utf8"; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return "utf16le"; + case "latin1": + case "binary": + return "latin1"; + case "base64": + case "ascii": + case "hex": + return enc; + default: + if (retried) return; + enc = ("" + enc).toLowerCase(); + retried = true; + } + } + } + function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); + return nenc || enc; + } + exports2.StringDecoder = StringDecoder; + function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case "utf16le": + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case "utf8": + this.fillLast = utf8FillLast; + nb = 4; + break; + case "base64": + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer2.allocUnsafe(nb); + } + StringDecoder.prototype.write = function(buf) { + if (buf.length === 0) return ""; + var r4; + var i4; + if (this.lastNeed) { + r4 = this.fillLast(buf); + if (r4 === void 0) return ""; + i4 = this.lastNeed; + this.lastNeed = 0; + } else { + i4 = 0; + } + if (i4 < buf.length) return r4 ? r4 + this.text(buf, i4) : this.text(buf, i4); + return r4 || ""; + }; + StringDecoder.prototype.end = utf8End; + StringDecoder.prototype.text = utf8Text; + StringDecoder.prototype.fillLast = function(buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; + }; + function utf8CheckByte(byte) { + if (byte <= 127) return 0; + else if (byte >> 5 === 6) return 2; + else if (byte >> 4 === 14) return 3; + else if (byte >> 3 === 30) return 4; + return byte >> 6 === 2 ? -1 : -2; + } + function utf8CheckIncomplete(self2, buf, i4) { + var j4 = buf.length - 1; + if (j4 < i4) return 0; + var nb = utf8CheckByte(buf[j4]); + if (nb >= 0) { + if (nb > 0) self2.lastNeed = nb - 1; + return nb; + } + if (--j4 < i4 || nb === -2) return 0; + nb = utf8CheckByte(buf[j4]); + if (nb >= 0) { + if (nb > 0) self2.lastNeed = nb - 2; + return nb; + } + if (--j4 < i4 || nb === -2) return 0; + nb = utf8CheckByte(buf[j4]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0; + else self2.lastNeed = nb - 3; + } + return nb; + } + return 0; + } + function utf8CheckExtraBytes(self2, buf, p4) { + if ((buf[0] & 192) !== 128) { + self2.lastNeed = 0; + return "\uFFFD"; + } + if (self2.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 192) !== 128) { + self2.lastNeed = 1; + return "\uFFFD"; + } + if (self2.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 192) !== 128) { + self2.lastNeed = 2; + return "\uFFFD"; + } + } + } + } + function utf8FillLast(buf) { + var p4 = this.lastTotal - this.lastNeed; + var r4 = utf8CheckExtraBytes(this, buf, p4); + if (r4 !== void 0) return r4; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p4, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p4, 0, buf.length); + this.lastNeed -= buf.length; + } + function utf8Text(buf, i4) { + var total = utf8CheckIncomplete(this, buf, i4); + if (!this.lastNeed) return buf.toString("utf8", i4); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString("utf8", i4, end); + } + function utf8End(buf) { + var r4 = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) return r4 + "\uFFFD"; + return r4; + } + function utf16Text(buf, i4) { + if ((buf.length - i4) % 2 === 0) { + var r4 = buf.toString("utf16le", i4); + if (r4) { + var c4 = r4.charCodeAt(r4.length - 1); + if (c4 >= 55296 && c4 <= 56319) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r4.slice(0, -1); + } + } + return r4; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString("utf16le", i4, buf.length - 1); + } + function utf16End(buf) { + var r4 = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r4 + this.lastChar.toString("utf16le", 0, end); + } + return r4; + } + function base64Text(buf, i4) { + var n4 = (buf.length - i4) % 3; + if (n4 === 0) return buf.toString("base64", i4); + this.lastNeed = 3 - n4; + this.lastTotal = 3; + if (n4 === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString("base64", i4, buf.length - n4); + } + function base64End(buf) { + var r4 = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) return r4 + this.lastChar.toString("base64", 0, 3 - this.lastNeed); + return r4; + } + function simpleWrite(buf) { + return buf.toString(this.encoding); + } + function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ""; + } + } +}); + +// node_modules/readable-stream/lib/internal/streams/end-of-stream.js +var require_end_of_stream = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports2, module2) { + "use strict"; + var ERR_STREAM_PREMATURE_CLOSE = require_errors3().codes.ERR_STREAM_PREMATURE_CLOSE; + function once(callback) { + var called = false; + return function() { + if (called) return; + called = true; + for (var _len = arguments.length, args2 = new Array(_len), _key = 0; _key < _len; _key++) { + args2[_key] = arguments[_key]; + } + callback.apply(this, args2); + }; + } + function noop() { + } + function isRequest(stream) { + return stream.setHeader && typeof stream.abort === "function"; + } + function eos(stream, opts, callback) { + if (typeof opts === "function") return eos(stream, null, opts); + if (!opts) opts = {}; + callback = once(callback || noop); + var readable = opts.readable || opts.readable !== false && stream.readable; + var writable = opts.writable || opts.writable !== false && stream.writable; + var onlegacyfinish = function onlegacyfinish2() { + if (!stream.writable) onfinish(); + }; + var writableEnded = stream._writableState && stream._writableState.finished; + var onfinish = function onfinish2() { + writable = false; + writableEnded = true; + if (!readable) callback.call(stream); + }; + var readableEnded = stream._readableState && stream._readableState.endEmitted; + var onend = function onend2() { + readable = false; + readableEnded = true; + if (!writable) callback.call(stream); + }; + var onerror = function onerror2(err) { + callback.call(stream, err); + }; + var onclose = function onclose2() { + var err; + if (readable && !readableEnded) { + if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + if (writable && !writableEnded) { + if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + }; + var onrequest = function onrequest2() { + stream.req.on("finish", onfinish); + }; + if (isRequest(stream)) { + stream.on("complete", onfinish); + stream.on("abort", onclose); + if (stream.req) onrequest(); + else stream.on("request", onrequest); + } else if (writable && !stream._writableState) { + stream.on("end", onlegacyfinish); + stream.on("close", onlegacyfinish); + } + stream.on("end", onend); + stream.on("finish", onfinish); + if (opts.error !== false) stream.on("error", onerror); + stream.on("close", onclose); + return function() { + stream.removeListener("complete", onfinish); + stream.removeListener("abort", onclose); + stream.removeListener("request", onrequest); + if (stream.req) stream.req.removeListener("finish", onfinish); + stream.removeListener("end", onlegacyfinish); + stream.removeListener("close", onlegacyfinish); + stream.removeListener("finish", onfinish); + stream.removeListener("end", onend); + stream.removeListener("error", onerror); + stream.removeListener("close", onclose); + }; + } + module2.exports = eos; + } +}); + +// node_modules/readable-stream/lib/internal/streams/async_iterator.js +var require_async_iterator = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports2, module2) { + "use strict"; + var _Object$setPrototypeO; + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + var finished = require_end_of_stream(); + var kLastResolve = /* @__PURE__ */ Symbol("lastResolve"); + var kLastReject = /* @__PURE__ */ Symbol("lastReject"); + var kError = /* @__PURE__ */ Symbol("error"); + var kEnded = /* @__PURE__ */ Symbol("ended"); + var kLastPromise = /* @__PURE__ */ Symbol("lastPromise"); + var kHandlePromise = /* @__PURE__ */ Symbol("handlePromise"); + var kStream = /* @__PURE__ */ Symbol("stream"); + function createIterResult(value, done) { + return { + value, + done + }; + } + function readAndResolve(iter) { + var resolve = iter[kLastResolve]; + if (resolve !== null) { + var data2 = iter[kStream].read(); + if (data2 !== null) { + iter[kLastPromise] = null; + iter[kLastResolve] = null; + iter[kLastReject] = null; + resolve(createIterResult(data2, false)); + } + } + } + function onReadable(iter) { + process.nextTick(readAndResolve, iter); + } + function wrapForNext(lastPromise, iter) { + return function(resolve, reject) { + lastPromise.then(function() { + if (iter[kEnded]) { + resolve(createIterResult(void 0, true)); + return; + } + iter[kHandlePromise](resolve, reject); + }, reject); + }; + } + var AsyncIteratorPrototype = Object.getPrototypeOf(function() { + }); + var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { + get stream() { + return this[kStream]; + }, + next: function next() { + var _this = this; + var error2 = this[kError]; + if (error2 !== null) { + return Promise.reject(error2); + } + if (this[kEnded]) { + return Promise.resolve(createIterResult(void 0, true)); + } + if (this[kStream].destroyed) { + return new Promise(function(resolve, reject) { + process.nextTick(function() { + if (_this[kError]) { + reject(_this[kError]); + } else { + resolve(createIterResult(void 0, true)); + } + }); + }); + } + var lastPromise = this[kLastPromise]; + var promise; + if (lastPromise) { + promise = new Promise(wrapForNext(lastPromise, this)); + } else { + var data2 = this[kStream].read(); + if (data2 !== null) { + return Promise.resolve(createIterResult(data2, false)); + } + promise = new Promise(this[kHandlePromise]); + } + this[kLastPromise] = promise; + return promise; + } + }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() { + return this; + }), _defineProperty(_Object$setPrototypeO, "return", function _return() { + var _this2 = this; + return new Promise(function(resolve, reject) { + _this2[kStream].destroy(null, function(err) { + if (err) { + reject(err); + return; + } + resolve(createIterResult(void 0, true)); + }); + }); + }), _Object$setPrototypeO), AsyncIteratorPrototype); + var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream) { + var _Object$create; + var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { + value: stream, + writable: true + }), _defineProperty(_Object$create, kLastResolve, { + value: null, + writable: true + }), _defineProperty(_Object$create, kLastReject, { + value: null, + writable: true + }), _defineProperty(_Object$create, kError, { + value: null, + writable: true + }), _defineProperty(_Object$create, kEnded, { + value: stream._readableState.endEmitted, + writable: true + }), _defineProperty(_Object$create, kHandlePromise, { + value: function value(resolve, reject) { + var data2 = iterator[kStream].read(); + if (data2) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(data2, false)); + } else { + iterator[kLastResolve] = resolve; + iterator[kLastReject] = reject; + } + }, + writable: true + }), _Object$create)); + iterator[kLastPromise] = null; + finished(stream, function(err) { + if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { + var reject = iterator[kLastReject]; + if (reject !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + reject(err); + } + iterator[kError] = err; + return; + } + var resolve = iterator[kLastResolve]; + if (resolve !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(void 0, true)); + } + iterator[kEnded] = true; + }); + stream.on("readable", onReadable.bind(null, iterator)); + return iterator; + }; + module2.exports = createReadableStreamAsyncIterator; + } +}); + +// node_modules/readable-stream/lib/internal/streams/from.js +var require_from = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/from.js"(exports2, module2) { + "use strict"; + function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error2) { + reject(error2); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } + } + function _asyncToGenerator(fn2) { + return function() { + var self2 = this, args2 = arguments; + return new Promise(function(resolve, reject) { + var gen = fn2.apply(self2, args2); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(void 0); + }); + }; + } + function ownKeys2(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread(target) { + for (var i4 = 1; i4 < arguments.length; i4++) { + var source = null != arguments[i4] ? arguments[i4] : {}; + i4 % 2 ? ownKeys2(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; + } + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + var ERR_INVALID_ARG_TYPE = require_errors3().codes.ERR_INVALID_ARG_TYPE; + function from(Readable, iterable, opts) { + var iterator; + if (iterable && typeof iterable.next === "function") { + iterator = iterable; + } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator](); + else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator](); + else throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable); + var readable = new Readable(_objectSpread({ + objectMode: true + }, opts)); + var reading = false; + readable._read = function() { + if (!reading) { + reading = true; + next(); + } + }; + function next() { + return _next2.apply(this, arguments); + } + function _next2() { + _next2 = _asyncToGenerator(function* () { + try { + var _yield$iterator$next = yield iterator.next(), value = _yield$iterator$next.value, done = _yield$iterator$next.done; + if (done) { + readable.push(null); + } else if (readable.push(yield value)) { + next(); + } else { + reading = false; + } + } catch (err) { + readable.destroy(err); + } + }); + return _next2.apply(this, arguments); + } + return readable; + } + module2.exports = from; + } +}); + +// node_modules/readable-stream/lib/_stream_readable.js +var require_stream_readable = __commonJS({ + "node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) { + "use strict"; + module2.exports = Readable; + var Duplex; + Readable.ReadableState = ReadableState; + var EE = require("events").EventEmitter; + var EElistenerCount = function EElistenerCount2(emitter, type) { + return emitter.listeners(type).length; + }; + var Stream = require_stream(); + var Buffer2 = require("buffer").Buffer; + var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk) { + return Buffer2.from(chunk); + } + function _isUint8Array(obj) { + return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; + } + var debugUtil = require("util"); + var debug; + if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog("stream"); + } else { + debug = function debug2() { + }; + } + var BufferList = require_buffer_list(); + var destroyImpl = require_destroy2(); + var _require = require_state(); + var getHighWaterMark = _require.getHighWaterMark; + var _require$codes = require_errors3().codes; + var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; + var ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF; + var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; + var ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; + var StringDecoder; + var createReadableStreamAsyncIterator; + var from; + require_inherits()(Readable, Stream); + var errorOrDestroy = destroyImpl.errorOrDestroy; + var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; + function prependListener(emitter, event, fn2) { + if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn2); + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn2); + else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn2); + else emitter._events[event] = [fn2, emitter._events[event]]; + } + function ReadableState(options, stream, isDuplex) { + Duplex = Duplex || require_stream_duplex(); + options = options || {}; + if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex; + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex); + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + this.sync = true; + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + this.paused = true; + this.emitClose = options.emitClose !== false; + this.autoDestroy = !!options.autoDestroy; + this.destroyed = false; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.awaitDrain = 0; + this.readingMore = false; + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } + } + function Readable(options) { + Duplex = Duplex || require_stream_duplex(); + if (!(this instanceof Readable)) return new Readable(options); + var isDuplex = this instanceof Duplex; + this._readableState = new ReadableState(options, this, isDuplex); + this.readable = true; + if (options) { + if (typeof options.read === "function") this._read = options.read; + if (typeof options.destroy === "function") this._destroy = options.destroy; + } + Stream.call(this); + } + Object.defineProperty(Readable.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + if (this._readableState === void 0) { + return false; + } + return this._readableState.destroyed; + }, + set: function set(value) { + if (!this._readableState) { + return; + } + this._readableState.destroyed = value; + } + }); + Readable.prototype.destroy = destroyImpl.destroy; + Readable.prototype._undestroy = destroyImpl.undestroy; + Readable.prototype._destroy = function(err, cb) { + cb(err); + }; + Readable.prototype.push = function(chunk, encoding) { + var state2 = this._readableState; + var skipChunkCheck; + if (!state2.objectMode) { + if (typeof chunk === "string") { + encoding = encoding || state2.defaultEncoding; + if (encoding !== state2.encoding) { + chunk = Buffer2.from(chunk, encoding); + encoding = ""; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); + }; + Readable.prototype.unshift = function(chunk) { + return readableAddChunk(this, chunk, null, true, false); + }; + function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + debug("readableAddChunk", chunk); + var state2 = stream._readableState; + if (chunk === null) { + state2.reading = false; + onEofChunk(stream, state2); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state2, chunk); + if (er) { + errorOrDestroy(stream, er); + } else if (state2.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== "string" && !state2.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + if (addToFront) { + if (state2.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); + else addChunk(stream, state2, chunk, true); + } else if (state2.ended) { + errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); + } else if (state2.destroyed) { + return false; + } else { + state2.reading = false; + if (state2.decoder && !encoding) { + chunk = state2.decoder.write(chunk); + if (state2.objectMode || chunk.length !== 0) addChunk(stream, state2, chunk, false); + else maybeReadMore(stream, state2); + } else { + addChunk(stream, state2, chunk, false); + } + } + } else if (!addToFront) { + state2.reading = false; + maybeReadMore(stream, state2); + } + } + return !state2.ended && (state2.length < state2.highWaterMark || state2.length === 0); + } + function addChunk(stream, state2, chunk, addToFront) { + if (state2.flowing && state2.length === 0 && !state2.sync) { + state2.awaitDrain = 0; + stream.emit("data", chunk); + } else { + state2.length += state2.objectMode ? 1 : chunk.length; + if (addToFront) state2.buffer.unshift(chunk); + else state2.buffer.push(chunk); + if (state2.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state2); + } + function chunkInvalid(state2, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state2.objectMode) { + er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk); + } + return er; + } + Readable.prototype.isPaused = function() { + return this._readableState.flowing === false; + }; + Readable.prototype.setEncoding = function(enc) { + if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder; + var decoder = new StringDecoder(enc); + this._readableState.decoder = decoder; + this._readableState.encoding = this._readableState.decoder.encoding; + var p4 = this._readableState.buffer.head; + var content = ""; + while (p4 !== null) { + content += decoder.write(p4.data); + p4 = p4.next; + } + this._readableState.buffer.clear(); + if (content !== "") this._readableState.buffer.push(content); + this._readableState.length = content.length; + return this; + }; + var MAX_HWM = 1073741824; + function computeNewHighWaterMark(n4) { + if (n4 >= MAX_HWM) { + n4 = MAX_HWM; + } else { + n4--; + n4 |= n4 >>> 1; + n4 |= n4 >>> 2; + n4 |= n4 >>> 4; + n4 |= n4 >>> 8; + n4 |= n4 >>> 16; + n4++; + } + return n4; + } + function howMuchToRead(n4, state2) { + if (n4 <= 0 || state2.length === 0 && state2.ended) return 0; + if (state2.objectMode) return 1; + if (n4 !== n4) { + if (state2.flowing && state2.length) return state2.buffer.head.data.length; + else return state2.length; + } + if (n4 > state2.highWaterMark) state2.highWaterMark = computeNewHighWaterMark(n4); + if (n4 <= state2.length) return n4; + if (!state2.ended) { + state2.needReadable = true; + return 0; + } + return state2.length; + } + Readable.prototype.read = function(n4) { + debug("read", n4); + n4 = parseInt(n4, 10); + var state2 = this._readableState; + var nOrig = n4; + if (n4 !== 0) state2.emittedReadable = false; + if (n4 === 0 && state2.needReadable && ((state2.highWaterMark !== 0 ? state2.length >= state2.highWaterMark : state2.length > 0) || state2.ended)) { + debug("read: emitReadable", state2.length, state2.ended); + if (state2.length === 0 && state2.ended) endReadable(this); + else emitReadable(this); + return null; + } + n4 = howMuchToRead(n4, state2); + if (n4 === 0 && state2.ended) { + if (state2.length === 0) endReadable(this); + return null; + } + var doRead = state2.needReadable; + debug("need readable", doRead); + if (state2.length === 0 || state2.length - n4 < state2.highWaterMark) { + doRead = true; + debug("length less than watermark", doRead); + } + if (state2.ended || state2.reading) { + doRead = false; + debug("reading or ended", doRead); + } else if (doRead) { + debug("do read"); + state2.reading = true; + state2.sync = true; + if (state2.length === 0) state2.needReadable = true; + this._read(state2.highWaterMark); + state2.sync = false; + if (!state2.reading) n4 = howMuchToRead(nOrig, state2); + } + var ret; + if (n4 > 0) ret = fromList(n4, state2); + else ret = null; + if (ret === null) { + state2.needReadable = state2.length <= state2.highWaterMark; + n4 = 0; + } else { + state2.length -= n4; + state2.awaitDrain = 0; + } + if (state2.length === 0) { + if (!state2.ended) state2.needReadable = true; + if (nOrig !== n4 && state2.ended) endReadable(this); + } + if (ret !== null) this.emit("data", ret); + return ret; + }; + function onEofChunk(stream, state2) { + debug("onEofChunk"); + if (state2.ended) return; + if (state2.decoder) { + var chunk = state2.decoder.end(); + if (chunk && chunk.length) { + state2.buffer.push(chunk); + state2.length += state2.objectMode ? 1 : chunk.length; + } + } + state2.ended = true; + if (state2.sync) { + emitReadable(stream); + } else { + state2.needReadable = false; + if (!state2.emittedReadable) { + state2.emittedReadable = true; + emitReadable_(stream); + } + } + } + function emitReadable(stream) { + var state2 = stream._readableState; + debug("emitReadable", state2.needReadable, state2.emittedReadable); + state2.needReadable = false; + if (!state2.emittedReadable) { + debug("emitReadable", state2.flowing); + state2.emittedReadable = true; + process.nextTick(emitReadable_, stream); + } + } + function emitReadable_(stream) { + var state2 = stream._readableState; + debug("emitReadable_", state2.destroyed, state2.length, state2.ended); + if (!state2.destroyed && (state2.length || state2.ended)) { + stream.emit("readable"); + state2.emittedReadable = false; + } + state2.needReadable = !state2.flowing && !state2.ended && state2.length <= state2.highWaterMark; + flow(stream); + } + function maybeReadMore(stream, state2) { + if (!state2.readingMore) { + state2.readingMore = true; + process.nextTick(maybeReadMore_, stream, state2); + } + } + function maybeReadMore_(stream, state2) { + while (!state2.reading && !state2.ended && (state2.length < state2.highWaterMark || state2.flowing && state2.length === 0)) { + var len = state2.length; + debug("maybeReadMore read 0"); + stream.read(0); + if (len === state2.length) + break; + } + state2.readingMore = false; + } + Readable.prototype._read = function(n4) { + errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()")); + }; + Readable.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state2 = this._readableState; + switch (state2.pipesCount) { + case 0: + state2.pipes = dest; + break; + case 1: + state2.pipes = [state2.pipes, dest]; + break; + default: + state2.pipes.push(dest); + break; + } + state2.pipesCount += 1; + debug("pipe count=%d opts=%j", state2.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + var endFn = doEnd ? onend : unpipe; + if (state2.endEmitted) process.nextTick(endFn); + else src.once("end", endFn); + dest.on("unpipe", onunpipe); + function onunpipe(readable, unpipeInfo) { + debug("onunpipe"); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + function onend() { + debug("onend"); + dest.end(); + } + var ondrain = pipeOnDrain(src); + dest.on("drain", ondrain); + var cleanedUp = false; + function cleanup() { + debug("cleanup"); + dest.removeListener("close", onclose); + dest.removeListener("finish", onfinish); + dest.removeListener("drain", ondrain); + dest.removeListener("error", onerror); + dest.removeListener("unpipe", onunpipe); + src.removeListener("end", onend); + src.removeListener("end", unpipe); + src.removeListener("data", ondata); + cleanedUp = true; + if (state2.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + src.on("data", ondata); + function ondata(chunk) { + debug("ondata"); + var ret = dest.write(chunk); + debug("dest.write", ret); + if (ret === false) { + if ((state2.pipesCount === 1 && state2.pipes === dest || state2.pipesCount > 1 && indexOf(state2.pipes, dest) !== -1) && !cleanedUp) { + debug("false write response, pause", state2.awaitDrain); + state2.awaitDrain++; + } + src.pause(); + } + } + function onerror(er) { + debug("onerror", er); + unpipe(); + dest.removeListener("error", onerror); + if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er); + } + prependListener(dest, "error", onerror); + function onclose() { + dest.removeListener("finish", onfinish); + unpipe(); + } + dest.once("close", onclose); + function onfinish() { + debug("onfinish"); + dest.removeListener("close", onclose); + unpipe(); + } + dest.once("finish", onfinish); + function unpipe() { + debug("unpipe"); + src.unpipe(dest); + } + dest.emit("pipe", src); + if (!state2.flowing) { + debug("pipe resume"); + src.resume(); + } + return dest; + }; + function pipeOnDrain(src) { + return function pipeOnDrainFunctionResult() { + var state2 = src._readableState; + debug("pipeOnDrain", state2.awaitDrain); + if (state2.awaitDrain) state2.awaitDrain--; + if (state2.awaitDrain === 0 && EElistenerCount(src, "data")) { + state2.flowing = true; + flow(src); + } + }; + } + Readable.prototype.unpipe = function(dest) { + var state2 = this._readableState; + var unpipeInfo = { + hasUnpiped: false + }; + if (state2.pipesCount === 0) return this; + if (state2.pipesCount === 1) { + if (dest && dest !== state2.pipes) return this; + if (!dest) dest = state2.pipes; + state2.pipes = null; + state2.pipesCount = 0; + state2.flowing = false; + if (dest) dest.emit("unpipe", this, unpipeInfo); + return this; + } + if (!dest) { + var dests = state2.pipes; + var len = state2.pipesCount; + state2.pipes = null; + state2.pipesCount = 0; + state2.flowing = false; + for (var i4 = 0; i4 < len; i4++) dests[i4].emit("unpipe", this, { + hasUnpiped: false + }); + return this; + } + var index = indexOf(state2.pipes, dest); + if (index === -1) return this; + state2.pipes.splice(index, 1); + state2.pipesCount -= 1; + if (state2.pipesCount === 1) state2.pipes = state2.pipes[0]; + dest.emit("unpipe", this, unpipeInfo); + return this; + }; + Readable.prototype.on = function(ev, fn2) { + var res = Stream.prototype.on.call(this, ev, fn2); + var state2 = this._readableState; + if (ev === "data") { + state2.readableListening = this.listenerCount("readable") > 0; + if (state2.flowing !== false) this.resume(); + } else if (ev === "readable") { + if (!state2.endEmitted && !state2.readableListening) { + state2.readableListening = state2.needReadable = true; + state2.flowing = false; + state2.emittedReadable = false; + debug("on readable", state2.length, state2.reading); + if (state2.length) { + emitReadable(this); + } else if (!state2.reading) { + process.nextTick(nReadingNextTick, this); + } + } + } + return res; + }; + Readable.prototype.addListener = Readable.prototype.on; + Readable.prototype.removeListener = function(ev, fn2) { + var res = Stream.prototype.removeListener.call(this, ev, fn2); + if (ev === "readable") { + process.nextTick(updateReadableListening, this); + } + return res; + }; + Readable.prototype.removeAllListeners = function(ev) { + var res = Stream.prototype.removeAllListeners.apply(this, arguments); + if (ev === "readable" || ev === void 0) { + process.nextTick(updateReadableListening, this); + } + return res; + }; + function updateReadableListening(self2) { + var state2 = self2._readableState; + state2.readableListening = self2.listenerCount("readable") > 0; + if (state2.resumeScheduled && !state2.paused) { + state2.flowing = true; + } else if (self2.listenerCount("data") > 0) { + self2.resume(); + } + } + function nReadingNextTick(self2) { + debug("readable nexttick read 0"); + self2.read(0); + } + Readable.prototype.resume = function() { + var state2 = this._readableState; + if (!state2.flowing) { + debug("resume"); + state2.flowing = !state2.readableListening; + resume(this, state2); + } + state2.paused = false; + return this; + }; + function resume(stream, state2) { + if (!state2.resumeScheduled) { + state2.resumeScheduled = true; + process.nextTick(resume_, stream, state2); + } + } + function resume_(stream, state2) { + debug("resume", state2.reading); + if (!state2.reading) { + stream.read(0); + } + state2.resumeScheduled = false; + stream.emit("resume"); + flow(stream); + if (state2.flowing && !state2.reading) stream.read(0); + } + Readable.prototype.pause = function() { + debug("call pause flowing=%j", this._readableState.flowing); + if (this._readableState.flowing !== false) { + debug("pause"); + this._readableState.flowing = false; + this.emit("pause"); + } + this._readableState.paused = true; + return this; + }; + function flow(stream) { + var state2 = stream._readableState; + debug("flow", state2.flowing); + while (state2.flowing && stream.read() !== null) ; + } + Readable.prototype.wrap = function(stream) { + var _this = this; + var state2 = this._readableState; + var paused = false; + stream.on("end", function() { + debug("wrapped end"); + if (state2.decoder && !state2.ended) { + var chunk = state2.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + _this.push(null); + }); + stream.on("data", function(chunk) { + debug("wrapped data"); + if (state2.decoder) chunk = state2.decoder.write(chunk); + if (state2.objectMode && (chunk === null || chunk === void 0)) return; + else if (!state2.objectMode && (!chunk || !chunk.length)) return; + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + for (var i4 in stream) { + if (this[i4] === void 0 && typeof stream[i4] === "function") { + this[i4] = /* @__PURE__ */ (function methodWrap(method) { + return function methodWrapReturnFunction() { + return stream[method].apply(stream, arguments); + }; + })(i4); + } + } + for (var n4 = 0; n4 < kProxyEvents.length; n4++) { + stream.on(kProxyEvents[n4], this.emit.bind(this, kProxyEvents[n4])); + } + this._read = function(n5) { + debug("wrapped _read", n5); + if (paused) { + paused = false; + stream.resume(); + } + }; + return this; + }; + if (typeof Symbol === "function") { + Readable.prototype[Symbol.asyncIterator] = function() { + if (createReadableStreamAsyncIterator === void 0) { + createReadableStreamAsyncIterator = require_async_iterator(); + } + return createReadableStreamAsyncIterator(this); + }; + } + Object.defineProperty(Readable.prototype, "readableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._readableState.highWaterMark; + } + }); + Object.defineProperty(Readable.prototype, "readableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._readableState && this._readableState.buffer; + } + }); + Object.defineProperty(Readable.prototype, "readableFlowing", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._readableState.flowing; + }, + set: function set(state2) { + if (this._readableState) { + this._readableState.flowing = state2; + } + } + }); + Readable._fromList = fromList; + Object.defineProperty(Readable.prototype, "readableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._readableState.length; + } + }); + function fromList(n4, state2) { + if (state2.length === 0) return null; + var ret; + if (state2.objectMode) ret = state2.buffer.shift(); + else if (!n4 || n4 >= state2.length) { + if (state2.decoder) ret = state2.buffer.join(""); + else if (state2.buffer.length === 1) ret = state2.buffer.first(); + else ret = state2.buffer.concat(state2.length); + state2.buffer.clear(); + } else { + ret = state2.buffer.consume(n4, state2.decoder); + } + return ret; + } + function endReadable(stream) { + var state2 = stream._readableState; + debug("endReadable", state2.endEmitted); + if (!state2.endEmitted) { + state2.ended = true; + process.nextTick(endReadableNT, state2, stream); + } + } + function endReadableNT(state2, stream) { + debug("endReadableNT", state2.endEmitted, state2.length); + if (!state2.endEmitted && state2.length === 0) { + state2.endEmitted = true; + stream.readable = false; + stream.emit("end"); + if (state2.autoDestroy) { + var wState = stream._writableState; + if (!wState || wState.autoDestroy && wState.finished) { + stream.destroy(); + } + } + } + } + if (typeof Symbol === "function") { + Readable.from = function(iterable, opts) { + if (from === void 0) { + from = require_from(); + } + return from(Readable, iterable, opts); + }; + } + function indexOf(xs, x4) { + for (var i4 = 0, l4 = xs.length; i4 < l4; i4++) { + if (xs[i4] === x4) return i4; + } + return -1; + } + } +}); + +// node_modules/readable-stream/lib/_stream_transform.js +var require_stream_transform = __commonJS({ + "node_modules/readable-stream/lib/_stream_transform.js"(exports2, module2) { + "use strict"; + module2.exports = Transform; + var _require$codes = require_errors3().codes; + var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; + var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; + var ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING; + var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; + var Duplex = require_stream_duplex(); + require_inherits()(Transform, Duplex); + function afterTransform(er, data2) { + var ts = this._transformState; + ts.transforming = false; + var cb = ts.writecb; + if (cb === null) { + return this.emit("error", new ERR_MULTIPLE_CALLBACK()); + } + ts.writechunk = null; + ts.writecb = null; + if (data2 != null) + this.push(data2); + cb(er); + var rs2 = this._readableState; + rs2.reading = false; + if (rs2.needReadable || rs2.length < rs2.highWaterMark) { + this._read(rs2.highWaterMark); + } + } + function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + Duplex.call(this, options); + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + this._readableState.needReadable = true; + this._readableState.sync = false; + if (options) { + if (typeof options.transform === "function") this._transform = options.transform; + if (typeof options.flush === "function") this._flush = options.flush; + } + this.on("prefinish", prefinish); + } + function prefinish() { + var _this = this; + if (typeof this._flush === "function" && !this._readableState.destroyed) { + this._flush(function(er, data2) { + done(_this, er, data2); + }); + } else { + done(this, null, null); + } + } + Transform.prototype.push = function(chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); + }; + Transform.prototype._transform = function(chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); + }; + Transform.prototype._write = function(chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs2 = this._readableState; + if (ts.needTransform || rs2.needReadable || rs2.length < rs2.highWaterMark) this._read(rs2.highWaterMark); + } + }; + Transform.prototype._read = function(n4) { + var ts = this._transformState; + if (ts.writechunk !== null && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + ts.needTransform = true; + } + }; + Transform.prototype._destroy = function(err, cb) { + Duplex.prototype._destroy.call(this, err, function(err2) { + cb(err2); + }); + }; + function done(stream, er, data2) { + if (er) return stream.emit("error", er); + if (data2 != null) + stream.push(data2); + if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); + if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); + return stream.push(null); + } + } +}); + +// node_modules/readable-stream/lib/_stream_passthrough.js +var require_stream_passthrough = __commonJS({ + "node_modules/readable-stream/lib/_stream_passthrough.js"(exports2, module2) { + "use strict"; + module2.exports = PassThrough; + var Transform = require_stream_transform(); + require_inherits()(PassThrough, Transform); + function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + Transform.call(this, options); + } + PassThrough.prototype._transform = function(chunk, encoding, cb) { + cb(null, chunk); + }; + } +}); + +// node_modules/readable-stream/lib/internal/streams/pipeline.js +var require_pipeline = __commonJS({ + "node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports2, module2) { + "use strict"; + var eos; + function once(callback) { + var called = false; + return function() { + if (called) return; + called = true; + callback.apply(void 0, arguments); + }; + } + var _require$codes = require_errors3().codes; + var ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS; + var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; + function noop(err) { + if (err) throw err; + } + function isRequest(stream) { + return stream.setHeader && typeof stream.abort === "function"; + } + function destroyer(stream, reading, writing, callback) { + callback = once(callback); + var closed = false; + stream.on("close", function() { + closed = true; + }); + if (eos === void 0) eos = require_end_of_stream(); + eos(stream, { + readable: reading, + writable: writing + }, function(err) { + if (err) return callback(err); + closed = true; + callback(); + }); + var destroyed = false; + return function(err) { + if (closed) return; + if (destroyed) return; + destroyed = true; + if (isRequest(stream)) return stream.abort(); + if (typeof stream.destroy === "function") return stream.destroy(); + callback(err || new ERR_STREAM_DESTROYED("pipe")); + }; + } + function call(fn2) { + fn2(); + } + function pipe(from, to) { + return from.pipe(to); + } + function popCallback(streams) { + if (!streams.length) return noop; + if (typeof streams[streams.length - 1] !== "function") return noop; + return streams.pop(); + } + function pipeline() { + for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { + streams[_key] = arguments[_key]; + } + var callback = popCallback(streams); + if (Array.isArray(streams[0])) streams = streams[0]; + if (streams.length < 2) { + throw new ERR_MISSING_ARGS("streams"); + } + var error2; + var destroys = streams.map(function(stream, i4) { + var reading = i4 < streams.length - 1; + var writing = i4 > 0; + return destroyer(stream, reading, writing, function(err) { + if (!error2) error2 = err; + if (err) destroys.forEach(call); + if (reading) return; + destroys.forEach(call); + callback(error2); + }); + }); + return streams.reduce(pipe); + } + module2.exports = pipeline; + } +}); + +// node_modules/readable-stream/readable.js +var require_readable = __commonJS({ + "node_modules/readable-stream/readable.js"(exports2, module2) { + var Stream = require("stream"); + if (process.env.READABLE_STREAM === "disable" && Stream) { + module2.exports = Stream.Readable; + Object.assign(module2.exports, Stream); + module2.exports.Stream = Stream; + } else { + exports2 = module2.exports = require_stream_readable(); + exports2.Stream = Stream || exports2; + exports2.Readable = exports2; + exports2.Writable = require_stream_writable(); + exports2.Duplex = require_stream_duplex(); + exports2.Transform = require_stream_transform(); + exports2.PassThrough = require_stream_passthrough(); + exports2.finished = require_end_of_stream(); + exports2.pipeline = require_pipeline(); + } + } +}); + +// node_modules/buffer-from/index.js +var require_buffer_from = __commonJS({ + "node_modules/buffer-from/index.js"(exports2, module2) { + var toString = Object.prototype.toString; + var isModern = typeof Buffer !== "undefined" && typeof Buffer.alloc === "function" && typeof Buffer.allocUnsafe === "function" && typeof Buffer.from === "function"; + function isArrayBuffer(input) { + return toString.call(input).slice(8, -1) === "ArrayBuffer"; + } + function fromArrayBuffer(obj, byteOffset, length) { + byteOffset >>>= 0; + var maxLength = obj.byteLength - byteOffset; + if (maxLength < 0) { + throw new RangeError("'offset' is out of bounds"); + } + if (length === void 0) { + length = maxLength; + } else { + length >>>= 0; + if (length > maxLength) { + throw new RangeError("'length' is out of bounds"); + } + } + return isModern ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length))); + } + function fromString(string, encoding) { + if (typeof encoding !== "string" || encoding === "") { + encoding = "utf8"; + } + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding'); + } + return isModern ? Buffer.from(string, encoding) : new Buffer(string, encoding); + } + function bufferFrom(value, encodingOrOffset, length) { + if (typeof value === "number") { + throw new TypeError('"value" argument must not be a number'); + } + if (isArrayBuffer(value)) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + if (typeof value === "string") { + return fromString(value, encodingOrOffset); + } + return isModern ? Buffer.from(value) : new Buffer(value); + } + module2.exports = bufferFrom; + } +}); + +// node_modules/typedarray/index.js +var require_typedarray = __commonJS({ + "node_modules/typedarray/index.js"(exports2) { + var undefined2 = void 0; + var MAX_ARRAY_LENGTH = 1e5; + var ECMAScript = /* @__PURE__ */ (function() { + var opts = Object.prototype.toString, ophop = Object.prototype.hasOwnProperty; + return { + // Class returns internal [[Class]] property, used to avoid cross-frame instanceof issues: + Class: function(v4) { + return opts.call(v4).replace(/^\[object *|\]$/g, ""); + }, + HasProperty: function(o4, p4) { + return p4 in o4; + }, + HasOwnProperty: function(o4, p4) { + return ophop.call(o4, p4); + }, + IsCallable: function(o4) { + return typeof o4 === "function"; + }, + ToInt32: function(v4) { + return v4 >> 0; + }, + ToUint32: function(v4) { + return v4 >>> 0; + } + }; + })(); + var LN2 = Math.LN2; + var abs = Math.abs; + var floor = Math.floor; + var log2 = Math.log; + var min = Math.min; + var pow = Math.pow; + var round = Math.round; + function configureProperties(obj) { + if (getOwnPropNames && defineProp) { + var props = getOwnPropNames(obj), i4; + for (i4 = 0; i4 < props.length; i4 += 1) { + defineProp(obj, props[i4], { + value: obj[props[i4]], + writable: false, + enumerable: false, + configurable: false + }); + } + } + } + var defineProp; + if (Object.defineProperty && (function() { + try { + Object.defineProperty({}, "x", {}); + return true; + } catch (e4) { + return false; + } + })()) { + defineProp = Object.defineProperty; + } else { + defineProp = function(o4, p4, desc) { + if (!o4 === Object(o4)) throw new TypeError("Object.defineProperty called on non-object"); + if (ECMAScript.HasProperty(desc, "get") && Object.prototype.__defineGetter__) { + Object.prototype.__defineGetter__.call(o4, p4, desc.get); + } + if (ECMAScript.HasProperty(desc, "set") && Object.prototype.__defineSetter__) { + Object.prototype.__defineSetter__.call(o4, p4, desc.set); + } + if (ECMAScript.HasProperty(desc, "value")) { + o4[p4] = desc.value; + } + return o4; + }; + } + var getOwnPropNames = Object.getOwnPropertyNames || function(o4) { + if (o4 !== Object(o4)) throw new TypeError("Object.getOwnPropertyNames called on non-object"); + var props = [], p4; + for (p4 in o4) { + if (ECMAScript.HasOwnProperty(o4, p4)) { + props.push(p4); + } + } + return props; + }; + function makeArrayAccessors(obj) { + if (!defineProp) { + return; + } + if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError("Array too large for polyfill"); + function makeArrayAccessor(index) { + defineProp(obj, index, { + "get": function() { + return obj._getter(index); + }, + "set": function(v4) { + obj._setter(index, v4); + }, + enumerable: true, + configurable: false + }); + } + var i4; + for (i4 = 0; i4 < obj.length; i4 += 1) { + makeArrayAccessor(i4); + } + } + function as_signed(value, bits) { + var s4 = 32 - bits; + return value << s4 >> s4; + } + function as_unsigned(value, bits) { + var s4 = 32 - bits; + return value << s4 >>> s4; + } + function packI8(n4) { + return [n4 & 255]; + } + function unpackI8(bytes) { + return as_signed(bytes[0], 8); + } + function packU8(n4) { + return [n4 & 255]; + } + function unpackU8(bytes) { + return as_unsigned(bytes[0], 8); + } + function packU8Clamped(n4) { + n4 = round(Number(n4)); + return [n4 < 0 ? 0 : n4 > 255 ? 255 : n4 & 255]; + } + function packI16(n4) { + return [n4 >> 8 & 255, n4 & 255]; + } + function unpackI16(bytes) { + return as_signed(bytes[0] << 8 | bytes[1], 16); + } + function packU16(n4) { + return [n4 >> 8 & 255, n4 & 255]; + } + function unpackU16(bytes) { + return as_unsigned(bytes[0] << 8 | bytes[1], 16); + } + function packI32(n4) { + return [n4 >> 24 & 255, n4 >> 16 & 255, n4 >> 8 & 255, n4 & 255]; + } + function unpackI32(bytes) { + return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); + } + function packU32(n4) { + return [n4 >> 24 & 255, n4 >> 16 & 255, n4 >> 8 & 255, n4 & 255]; + } + function unpackU32(bytes) { + return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); + } + function packIEEE754(v4, ebits, fbits) { + var bias = (1 << ebits - 1) - 1, s4, e4, f4, ln, i4, bits, str, bytes; + function roundToEven(n4) { + var w4 = floor(n4), f5 = n4 - w4; + if (f5 < 0.5) + return w4; + if (f5 > 0.5) + return w4 + 1; + return w4 % 2 ? w4 + 1 : w4; + } + if (v4 !== v4) { + e4 = (1 << ebits) - 1; + f4 = pow(2, fbits - 1); + s4 = 0; + } else if (v4 === Infinity || v4 === -Infinity) { + e4 = (1 << ebits) - 1; + f4 = 0; + s4 = v4 < 0 ? 1 : 0; + } else if (v4 === 0) { + e4 = 0; + f4 = 0; + s4 = 1 / v4 === -Infinity ? 1 : 0; + } else { + s4 = v4 < 0; + v4 = abs(v4); + if (v4 >= pow(2, 1 - bias)) { + e4 = min(floor(log2(v4) / LN2), 1023); + f4 = roundToEven(v4 / pow(2, e4) * pow(2, fbits)); + if (f4 / pow(2, fbits) >= 2) { + e4 = e4 + 1; + f4 = 1; + } + if (e4 > bias) { + e4 = (1 << ebits) - 1; + f4 = 0; + } else { + e4 = e4 + bias; + f4 = f4 - pow(2, fbits); + } + } else { + e4 = 0; + f4 = roundToEven(v4 / pow(2, 1 - bias - fbits)); + } + } + bits = []; + for (i4 = fbits; i4; i4 -= 1) { + bits.push(f4 % 2 ? 1 : 0); + f4 = floor(f4 / 2); + } + for (i4 = ebits; i4; i4 -= 1) { + bits.push(e4 % 2 ? 1 : 0); + e4 = floor(e4 / 2); + } + bits.push(s4 ? 1 : 0); + bits.reverse(); + str = bits.join(""); + bytes = []; + while (str.length) { + bytes.push(parseInt(str.substring(0, 8), 2)); + str = str.substring(8); + } + return bytes; + } + function unpackIEEE754(bytes, ebits, fbits) { + var bits = [], i4, j4, b4, str, bias, s4, e4, f4; + for (i4 = bytes.length; i4; i4 -= 1) { + b4 = bytes[i4 - 1]; + for (j4 = 8; j4; j4 -= 1) { + bits.push(b4 % 2 ? 1 : 0); + b4 = b4 >> 1; + } + } + bits.reverse(); + str = bits.join(""); + bias = (1 << ebits - 1) - 1; + s4 = parseInt(str.substring(0, 1), 2) ? -1 : 1; + e4 = parseInt(str.substring(1, 1 + ebits), 2); + f4 = parseInt(str.substring(1 + ebits), 2); + if (e4 === (1 << ebits) - 1) { + return f4 !== 0 ? NaN : s4 * Infinity; + } else if (e4 > 0) { + return s4 * pow(2, e4 - bias) * (1 + f4 / pow(2, fbits)); + } else if (f4 !== 0) { + return s4 * pow(2, -(bias - 1)) * (f4 / pow(2, fbits)); + } else { + return s4 < 0 ? -0 : 0; + } + } + function unpackF64(b4) { + return unpackIEEE754(b4, 11, 52); + } + function packF64(v4) { + return packIEEE754(v4, 11, 52); + } + function unpackF32(b4) { + return unpackIEEE754(b4, 8, 23); + } + function packF32(v4) { + return packIEEE754(v4, 8, 23); + } + (function() { + var ArrayBuffer2 = function ArrayBuffer3(length) { + length = ECMAScript.ToInt32(length); + if (length < 0) throw new RangeError("ArrayBuffer size is not a small enough positive integer"); + this.byteLength = length; + this._bytes = []; + this._bytes.length = length; + var i4; + for (i4 = 0; i4 < this.byteLength; i4 += 1) { + this._bytes[i4] = 0; + } + configureProperties(this); + }; + exports2.ArrayBuffer = exports2.ArrayBuffer || ArrayBuffer2; + var ArrayBufferView = function ArrayBufferView2() { + }; + function makeConstructor(bytesPerElement, pack, unpack) { + var ctor; + ctor = function(buffer, byteOffset, length) { + var array, sequence, i4, s4; + if (!arguments.length || typeof arguments[0] === "number") { + this.length = ECMAScript.ToInt32(arguments[0]); + if (length < 0) throw new RangeError("ArrayBufferView size is not a small enough positive integer"); + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + this.buffer = new ArrayBuffer2(this.byteLength); + this.byteOffset = 0; + } else if (typeof arguments[0] === "object" && arguments[0].constructor === ctor) { + array = arguments[0]; + this.length = array.length; + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + this.buffer = new ArrayBuffer2(this.byteLength); + this.byteOffset = 0; + for (i4 = 0; i4 < this.length; i4 += 1) { + this._setter(i4, array._getter(i4)); + } + } else if (typeof arguments[0] === "object" && !(arguments[0] instanceof ArrayBuffer2 || ECMAScript.Class(arguments[0]) === "ArrayBuffer")) { + sequence = arguments[0]; + this.length = ECMAScript.ToUint32(sequence.length); + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + this.buffer = new ArrayBuffer2(this.byteLength); + this.byteOffset = 0; + for (i4 = 0; i4 < this.length; i4 += 1) { + s4 = sequence[i4]; + this._setter(i4, Number(s4)); + } + } else if (typeof arguments[0] === "object" && (arguments[0] instanceof ArrayBuffer2 || ECMAScript.Class(arguments[0]) === "ArrayBuffer")) { + this.buffer = buffer; + this.byteOffset = ECMAScript.ToUint32(byteOffset); + if (this.byteOffset > this.buffer.byteLength) { + throw new RangeError("byteOffset out of range"); + } + if (this.byteOffset % this.BYTES_PER_ELEMENT) { + throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size."); + } + if (arguments.length < 3) { + this.byteLength = this.buffer.byteLength - this.byteOffset; + if (this.byteLength % this.BYTES_PER_ELEMENT) { + throw new RangeError("length of buffer minus byteOffset not a multiple of the element size"); + } + this.length = this.byteLength / this.BYTES_PER_ELEMENT; + } else { + this.length = ECMAScript.ToUint32(length); + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + } + if (this.byteOffset + this.byteLength > this.buffer.byteLength) { + throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); + } + } else { + throw new TypeError("Unexpected argument type(s)"); + } + this.constructor = ctor; + configureProperties(this); + makeArrayAccessors(this); + }; + ctor.prototype = new ArrayBufferView(); + ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement; + ctor.prototype._pack = pack; + ctor.prototype._unpack = unpack; + ctor.BYTES_PER_ELEMENT = bytesPerElement; + ctor.prototype._getter = function(index) { + if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); + index = ECMAScript.ToUint32(index); + if (index >= this.length) { + return undefined2; + } + var bytes = [], i4, o4; + for (i4 = 0, o4 = this.byteOffset + index * this.BYTES_PER_ELEMENT; i4 < this.BYTES_PER_ELEMENT; i4 += 1, o4 += 1) { + bytes.push(this.buffer._bytes[o4]); + } + return this._unpack(bytes); + }; + ctor.prototype.get = ctor.prototype._getter; + ctor.prototype._setter = function(index, value) { + if (arguments.length < 2) throw new SyntaxError("Not enough arguments"); + index = ECMAScript.ToUint32(index); + if (index >= this.length) { + return undefined2; + } + var bytes = this._pack(value), i4, o4; + for (i4 = 0, o4 = this.byteOffset + index * this.BYTES_PER_ELEMENT; i4 < this.BYTES_PER_ELEMENT; i4 += 1, o4 += 1) { + this.buffer._bytes[o4] = bytes[i4]; + } + }; + ctor.prototype.set = function(index, value) { + if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); + var array, sequence, offset, len, i4, s4, d4, byteOffset, byteLength, tmp; + if (typeof arguments[0] === "object" && arguments[0].constructor === this.constructor) { + array = arguments[0]; + offset = ECMAScript.ToUint32(arguments[1]); + if (offset + array.length > this.length) { + throw new RangeError("Offset plus length of array is out of range"); + } + byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT; + byteLength = array.length * this.BYTES_PER_ELEMENT; + if (array.buffer === this.buffer) { + tmp = []; + for (i4 = 0, s4 = array.byteOffset; i4 < byteLength; i4 += 1, s4 += 1) { + tmp[i4] = array.buffer._bytes[s4]; + } + for (i4 = 0, d4 = byteOffset; i4 < byteLength; i4 += 1, d4 += 1) { + this.buffer._bytes[d4] = tmp[i4]; + } + } else { + for (i4 = 0, s4 = array.byteOffset, d4 = byteOffset; i4 < byteLength; i4 += 1, s4 += 1, d4 += 1) { + this.buffer._bytes[d4] = array.buffer._bytes[s4]; + } + } + } else if (typeof arguments[0] === "object" && typeof arguments[0].length !== "undefined") { + sequence = arguments[0]; + len = ECMAScript.ToUint32(sequence.length); + offset = ECMAScript.ToUint32(arguments[1]); + if (offset + len > this.length) { + throw new RangeError("Offset plus length of array is out of range"); + } + for (i4 = 0; i4 < len; i4 += 1) { + s4 = sequence[i4]; + this._setter(offset + i4, Number(s4)); + } + } else { + throw new TypeError("Unexpected argument type(s)"); + } + }; + ctor.prototype.subarray = function(start, end) { + function clamp(v4, min2, max) { + return v4 < min2 ? min2 : v4 > max ? max : v4; + } + start = ECMAScript.ToInt32(start); + end = ECMAScript.ToInt32(end); + if (arguments.length < 1) { + start = 0; + } + if (arguments.length < 2) { + end = this.length; + } + if (start < 0) { + start = this.length + start; + } + if (end < 0) { + end = this.length + end; + } + start = clamp(start, 0, this.length); + end = clamp(end, 0, this.length); + var len = end - start; + if (len < 0) { + len = 0; + } + return new this.constructor( + this.buffer, + this.byteOffset + start * this.BYTES_PER_ELEMENT, + len + ); + }; + return ctor; + } + var Int8Array2 = makeConstructor(1, packI8, unpackI8); + var Uint8Array2 = makeConstructor(1, packU8, unpackU8); + var Uint8ClampedArray2 = makeConstructor(1, packU8Clamped, unpackU8); + var Int16Array2 = makeConstructor(2, packI16, unpackI16); + var Uint16Array2 = makeConstructor(2, packU16, unpackU16); + var Int32Array2 = makeConstructor(4, packI32, unpackI32); + var Uint32Array2 = makeConstructor(4, packU32, unpackU32); + var Float32Array2 = makeConstructor(4, packF32, unpackF32); + var Float64Array2 = makeConstructor(8, packF64, unpackF64); + exports2.Int8Array = exports2.Int8Array || Int8Array2; + exports2.Uint8Array = exports2.Uint8Array || Uint8Array2; + exports2.Uint8ClampedArray = exports2.Uint8ClampedArray || Uint8ClampedArray2; + exports2.Int16Array = exports2.Int16Array || Int16Array2; + exports2.Uint16Array = exports2.Uint16Array || Uint16Array2; + exports2.Int32Array = exports2.Int32Array || Int32Array2; + exports2.Uint32Array = exports2.Uint32Array || Uint32Array2; + exports2.Float32Array = exports2.Float32Array || Float32Array2; + exports2.Float64Array = exports2.Float64Array || Float64Array2; + })(); + (function() { + function r4(array, index) { + return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index]; + } + var IS_BIG_ENDIAN = (function() { + var u16array = new exports2.Uint16Array([4660]), u8array = new exports2.Uint8Array(u16array.buffer); + return r4(u8array, 0) === 18; + })(); + var DataView2 = function DataView3(buffer, byteOffset, byteLength) { + if (arguments.length === 0) { + buffer = new exports2.ArrayBuffer(0); + } else if (!(buffer instanceof exports2.ArrayBuffer || ECMAScript.Class(buffer) === "ArrayBuffer")) { + throw new TypeError("TypeError"); + } + this.buffer = buffer || new exports2.ArrayBuffer(0); + this.byteOffset = ECMAScript.ToUint32(byteOffset); + if (this.byteOffset > this.buffer.byteLength) { + throw new RangeError("byteOffset out of range"); + } + if (arguments.length < 3) { + this.byteLength = this.buffer.byteLength - this.byteOffset; + } else { + this.byteLength = ECMAScript.ToUint32(byteLength); + } + if (this.byteOffset + this.byteLength > this.buffer.byteLength) { + throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); + } + configureProperties(this); + }; + function makeGetter(arrayType) { + return function(byteOffset, littleEndian) { + byteOffset = ECMAScript.ToUint32(byteOffset); + if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { + throw new RangeError("Array index out of range"); + } + byteOffset += this.byteOffset; + var uint8Array = new exports2.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT), bytes = [], i4; + for (i4 = 0; i4 < arrayType.BYTES_PER_ELEMENT; i4 += 1) { + bytes.push(r4(uint8Array, i4)); + } + if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { + bytes.reverse(); + } + return r4(new arrayType(new exports2.Uint8Array(bytes).buffer), 0); + }; + } + DataView2.prototype.getUint8 = makeGetter(exports2.Uint8Array); + DataView2.prototype.getInt8 = makeGetter(exports2.Int8Array); + DataView2.prototype.getUint16 = makeGetter(exports2.Uint16Array); + DataView2.prototype.getInt16 = makeGetter(exports2.Int16Array); + DataView2.prototype.getUint32 = makeGetter(exports2.Uint32Array); + DataView2.prototype.getInt32 = makeGetter(exports2.Int32Array); + DataView2.prototype.getFloat32 = makeGetter(exports2.Float32Array); + DataView2.prototype.getFloat64 = makeGetter(exports2.Float64Array); + function makeSetter(arrayType) { + return function(byteOffset, value, littleEndian) { + byteOffset = ECMAScript.ToUint32(byteOffset); + if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { + throw new RangeError("Array index out of range"); + } + var typeArray = new arrayType([value]), byteArray = new exports2.Uint8Array(typeArray.buffer), bytes = [], i4, byteView; + for (i4 = 0; i4 < arrayType.BYTES_PER_ELEMENT; i4 += 1) { + bytes.push(r4(byteArray, i4)); + } + if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { + bytes.reverse(); + } + byteView = new exports2.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT); + byteView.set(bytes); + }; + } + DataView2.prototype.setUint8 = makeSetter(exports2.Uint8Array); + DataView2.prototype.setInt8 = makeSetter(exports2.Int8Array); + DataView2.prototype.setUint16 = makeSetter(exports2.Uint16Array); + DataView2.prototype.setInt16 = makeSetter(exports2.Int16Array); + DataView2.prototype.setUint32 = makeSetter(exports2.Uint32Array); + DataView2.prototype.setInt32 = makeSetter(exports2.Int32Array); + DataView2.prototype.setFloat32 = makeSetter(exports2.Float32Array); + DataView2.prototype.setFloat64 = makeSetter(exports2.Float64Array); + exports2.DataView = exports2.DataView || DataView2; + })(); + } +}); + +// node_modules/concat-stream/index.js +var require_concat_stream = __commonJS({ + "node_modules/concat-stream/index.js"(exports2, module2) { + var Writable = require_readable().Writable; + var inherits = require_inherits(); + var bufferFrom = require_buffer_from(); + if (typeof Uint8Array === "undefined") { + U8 = require_typedarray().Uint8Array; + } else { + U8 = Uint8Array; + } + var U8; + function ConcatStream(opts, cb) { + if (!(this instanceof ConcatStream)) return new ConcatStream(opts, cb); + if (typeof opts === "function") { + cb = opts; + opts = {}; + } + if (!opts) opts = {}; + var encoding = opts.encoding; + var shouldInferEncoding = false; + if (!encoding) { + shouldInferEncoding = true; + } else { + encoding = String(encoding).toLowerCase(); + if (encoding === "u8" || encoding === "uint8") { + encoding = "uint8array"; + } + } + Writable.call(this, { objectMode: true }); + this.encoding = encoding; + this.shouldInferEncoding = shouldInferEncoding; + if (cb) this.on("finish", function() { + cb(this.getBody()); + }); + this.body = []; + } + module2.exports = ConcatStream; + inherits(ConcatStream, Writable); + ConcatStream.prototype._write = function(chunk, enc, next) { + this.body.push(chunk); + next(); + }; + ConcatStream.prototype.inferEncoding = function(buff) { + var firstBuffer = buff === void 0 ? this.body[0] : buff; + if (Buffer.isBuffer(firstBuffer)) return "buffer"; + if (typeof Uint8Array !== "undefined" && firstBuffer instanceof Uint8Array) return "uint8array"; + if (Array.isArray(firstBuffer)) return "array"; + if (typeof firstBuffer === "string") return "string"; + if (Object.prototype.toString.call(firstBuffer) === "[object Object]") return "object"; + return "buffer"; + }; + ConcatStream.prototype.getBody = function() { + if (!this.encoding && this.body.length === 0) return []; + if (this.shouldInferEncoding) this.encoding = this.inferEncoding(); + if (this.encoding === "array") return arrayConcat(this.body); + if (this.encoding === "string") return stringConcat(this.body); + if (this.encoding === "buffer") return bufferConcat(this.body); + if (this.encoding === "uint8array") return u8Concat(this.body); + return this.body; + }; + function isArrayish(arr) { + return /Array\]$/.test(Object.prototype.toString.call(arr)); + } + function isBufferish(p4) { + return typeof p4 === "string" || isArrayish(p4) || p4 && typeof p4.subarray === "function"; + } + function stringConcat(parts) { + var strings = []; + var needsToString = false; + for (var i4 = 0; i4 < parts.length; i4++) { + var p4 = parts[i4]; + if (typeof p4 === "string") { + strings.push(p4); + } else if (Buffer.isBuffer(p4)) { + strings.push(p4); + } else if (isBufferish(p4)) { + strings.push(bufferFrom(p4)); + } else { + strings.push(bufferFrom(String(p4))); + } + } + if (Buffer.isBuffer(parts[0])) { + strings = Buffer.concat(strings); + strings = strings.toString("utf8"); + } else { + strings = strings.join(""); + } + return strings; + } + function bufferConcat(parts) { + var bufs = []; + for (var i4 = 0; i4 < parts.length; i4++) { + var p4 = parts[i4]; + if (Buffer.isBuffer(p4)) { + bufs.push(p4); + } else if (isBufferish(p4)) { + bufs.push(bufferFrom(p4)); + } else { + bufs.push(bufferFrom(String(p4))); + } + } + return Buffer.concat(bufs); + } + function arrayConcat(parts) { + var res = []; + for (var i4 = 0; i4 < parts.length; i4++) { + res.push.apply(res, parts[i4]); + } + return res; + } + function u8Concat(parts) { + var len = 0; + for (var i4 = 0; i4 < parts.length; i4++) { + if (typeof parts[i4] === "string") { + parts[i4] = bufferFrom(parts[i4]); + } + len += parts[i4].length; + } + var u8 = new U8(len); + for (var i4 = 0, offset = 0; i4 < parts.length; i4++) { + var part = parts[i4]; + for (var j4 = 0; j4 < part.length; j4++) { + u8[offset++] = part[j4]; + } + } + return u8; + } + } +}); + +// node_modules/multer/storage/memory.js +var require_memory = __commonJS({ + "node_modules/multer/storage/memory.js"(exports2, module2) { + var concat = require_concat_stream(); + function MemoryStorage(opts) { + } + MemoryStorage.prototype._handleFile = function _handleFile(req, file, cb) { + file.stream.pipe(concat({ encoding: "buffer" }, function(data2) { + cb(null, { + buffer: data2, + size: data2.length + }); + })); + }; + MemoryStorage.prototype._removeFile = function _removeFile(req, file, cb) { + delete file.buffer; + cb(null); + }; + module2.exports = function(opts) { + return new MemoryStorage(opts); + }; + } +}); + +// node_modules/multer/index.js +var require_multer = __commonJS({ + "node_modules/multer/index.js"(exports2, module2) { + var makeMiddleware = require_make_middleware(); + var diskStorage = require_disk(); + var memoryStorage = require_memory(); + var MulterError = require_multer_error(); + function allowAll(req, file, cb) { + cb(null, true); + } + function Multer(options) { + if (options.storage) { + this.storage = options.storage; + } else if (options.dest) { + this.storage = diskStorage({ destination: options.dest }); + } else { + this.storage = memoryStorage(); + } + this.limits = options.limits; + this.preservePath = options.preservePath; + this.fileFilter = options.fileFilter || allowAll; + } + Multer.prototype._makeMiddleware = function(fields, fileStrategy) { + function setup() { + var fileFilter = this.fileFilter; + var filesLeft = /* @__PURE__ */ Object.create(null); + fields.forEach(function(field) { + if (typeof field.maxCount === "number") { + filesLeft[field.name] = field.maxCount; + } else { + filesLeft[field.name] = Infinity; + } + }); + function wrappedFileFilter(req, file, cb) { + if ((filesLeft[file.fieldname] || 0) <= 0) { + return cb(new MulterError("LIMIT_UNEXPECTED_FILE", file.fieldname)); + } + filesLeft[file.fieldname] -= 1; + fileFilter(req, file, cb); + } + return { + limits: this.limits, + preservePath: this.preservePath, + storage: this.storage, + fileFilter: wrappedFileFilter, + fileStrategy + }; + } + return makeMiddleware(setup.bind(this)); + }; + Multer.prototype.single = function(name) { + return this._makeMiddleware([{ name, maxCount: 1 }], "VALUE"); + }; + Multer.prototype.array = function(name, maxCount) { + return this._makeMiddleware([{ name, maxCount }], "ARRAY"); + }; + Multer.prototype.fields = function(fields) { + return this._makeMiddleware(fields, "OBJECT"); + }; + Multer.prototype.none = function() { + return this._makeMiddleware([], "NONE"); + }; + Multer.prototype.any = function() { + function setup() { + return { + limits: this.limits, + preservePath: this.preservePath, + storage: this.storage, + fileFilter: this.fileFilter, + fileStrategy: "ARRAY" + }; + } + return makeMiddleware(setup.bind(this)); + }; + function multer(options) { + if (options === void 0) { + return new Multer({}); + } + if (typeof options === "object" && options !== null) { + return new Multer(options); + } + throw new TypeError("Expected object for argument options"); + } + module2.exports = multer; + module2.exports.diskStorage = diskStorage; + module2.exports.memoryStorage = memoryStorage; + module2.exports.MulterError = MulterError; + } +}); + +// controller/menuItemController.js +var require_menuItemController = __commonJS({ + "controller/menuItemController.js"(exports2, module2) { + var { MenuItem: MenuItem2 } = require_menuItemModel(); + var { Category } = require_categoryModel(); + var errorHandler = require_joiErrorHandler(); + var { sendResponse } = require_responseHelper(); + var mongoose2 = require_mongoose2(); + var createMenuItem = async (req, res) => { + try { + const { + category_id, + name, + description, + image_url, + options, + // price, + // offer_price, + no_price, + is_available, + special_note, + tag: tag2 + } = req.body; + if (!category_id || !name) { + return sendResponse(res, 400, "category_id and name are required"); + } + const category = await Category.findById(category_id); + if (!category) { + return sendResponse(res, 404, "Category not found"); + } + const exists = await MenuItem2.findOne({ + category_id, + name: { $regex: new RegExp(`^${name.trim()}$`, "i") } + }); + if (exists) { + return sendResponse(res, 409, "A menu item with this name already exists in this category"); + } + const item = new MenuItem2({ + category_id, + name, + description: description || null, + image_url: image_url || null, + // price: price || null, + // offer_price: offer_price || null, + no_price, + is_available: is_available ?? true, + special_note: special_note || null, + tag: tag2 || null, + options: options || [] + // Embedded options + }); + await item.save(); + return sendResponse(res, 201, "Menu item created successfully", item); + } catch (error2) { + console.log("Create Menu Item Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var getMenuItems = async (req, res) => { + try { + const page = parseInt(req.query.page) || 1; + const limit = parseInt(req.query.limit) || 20; + const skip = (page - 1) * limit; + const branch_id = req.user.branchId; + const { category_id } = req.query; + const filter = {}; + if (category_id) { + filter.category_id = category_id; + } + if (branch_id) { + const branchCategories = await Category.find({ branch_id }).select("_id").lean(); + const categoryIds = branchCategories.map((c4) => c4._id); + if (category_id) { + const isCategoryInBranch = categoryIds.some((id) => id.toString() === category_id); + if (!isCategoryInBranch) { + return sendResponse(res, 200, "Menu items fetched successfully", [], { + totalCount: 0, + currentPage: page, + pageSize: limit, + totalPages: 0 + }); + } + } else { + filter.category_id = { $in: categoryIds }; + } + } + const totalCount = await MenuItem2.countDocuments(filter); + const rows = await MenuItem2.find(filter).populate("category_id").sort({ _id: -1 }).skip(skip).limit(limit).lean(); + return sendResponse(res, 200, "Menu items fetched successfully", rows, { + totalCount, + currentPage: page, + pageSize: limit, + totalPages: Math.ceil(totalCount / limit) + }); + } catch (error2) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var getItemsByCategory = async (req, res) => { + try { + const { category_id } = req.params; + const items = await MenuItem2.find({ category_id }).sort({ _id: -1 }).lean(); + return sendResponse(res, 200, "Menu items fetched successfully", items); + } catch (error2) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var getMenuItemById = async (req, res) => { + try { + const { id } = req.params; + const item = await MenuItem2.findById(id).lean(); + if (!item) { + return sendResponse(res, 404, "Menu item not found"); + } + return sendResponse(res, 200, "Menu item fetched successfully", item); + } catch (error2) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var updateMenuItem = async (req, res) => { + try { + const { id } = req.params; + const item = await MenuItem2.findById(id); + if (!item) { + return sendResponse(res, 404, "Menu item not found"); + } + const { category_id, name } = req.body; + if (name && name.trim()) { + const exists = await MenuItem2.findOne({ + name: { $regex: new RegExp(`^${name.trim()}$`, "i") }, + category_id: category_id ?? item.category_id, + _id: { $ne: id } + // exclude itself + }); + if (exists) { + return sendResponse(res, 409, "Another item with this name already exists in this category"); + } + } + const { options, ...rest } = req.body; + Object.assign(item, rest); + if (options && Array.isArray(options)) { + item.options = options; + } + await item.save(); + return sendResponse(res, 200, "Menu item updated successfully", item); + } catch (error2) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var deleteMenuItem = async (req, res) => { + try { + const { id } = req.params; + const item = await MenuItem2.findById(id); + if (!item) { + return res.status(404).json({ + success: false, + message: "Menu item not found" + }); + } + const fileName = item.image_url; + await MenuItem2.findByIdAndDelete(id); + sendResponse(res, 200, "Menu item deleted successfully"); + if (fileName) { + checkMenuItemImageExistsDB(fileName).then((exists) => { + if (!exists?.exists) { + const { deleteImageDirectly } = require_ImageController(); + deleteImageDirectly(fileName).catch( + (err) => console.error("Failed to delete image in background:", err) + ); + } + }); + } + } catch (error2) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var searchMenuItem = async (req, res) => { + try { + const { category_id } = req.params; + const { q: q4 } = req.query; + if (!q4 || q4.trim() === "") { + return sendResponse(res, 200, "No query provided", []); + } + const filter = { + name: { $regex: q4, $options: "i" } + }; + if (category_id) { + filter.category_id = category_id; + } + const items = await MenuItem2.find(filter).sort({ name: 1 }).limit(10).lean(); + return sendResponse(res, 200, "Menu items fetched successfully", items); + } catch (error2) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var checkMenuItemImageExistsDB = async (fileName, id = null) => { + try { + if (!fileName) { + return { success: false, exists: false }; + } + const filter = { + image_url: fileName + }; + if (id) { + filter._id = { $ne: id }; + } + const exists = await MenuItem2.findOne(filter); + return { + success: true, + exists: !!exists + }; + } catch (error2) { + console.log("Check Image in DB Error:", error2); + return { + success: false, + exists: false, + error: error2 + }; + } + }; + var updateMenuItemStatus = async (req, res) => { + try { + const { id } = req.params; + const { is_available } = req.body; + const item = await MenuItem2.findByIdAndUpdate(id, { is_available }, { new: true }); + if (!item) { + return sendResponse(res, 404, "Menu item not found"); + } + return sendResponse(res, 200, "Menu item status updated successfully", item); + } catch (error2) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var getInactiveMenuItems = async (req, res) => { + try { + const page = parseInt(req.query.page) || 1; + const limit = parseInt(req.query.limit) || 50; + const skip = (page - 1) * limit; + const branch_id = req.user.branchId; + const { category_id } = req.query; + const filter = { is_available: false }; + if (category_id) { + filter.category_id = category_id; + } + if (branch_id) { + const branchCategories = await Category.find({ branch_id }).select("_id").lean(); + const categoryIds = branchCategories.map((c4) => c4._id); + if (category_id) { + const isCategoryInBranch = categoryIds.some((id) => id.toString() === category_id); + if (!isCategoryInBranch) { + return sendResponse(res, 200, "Inactive menu items fetched successfully", [], { + totalCount: 0, + currentPage: page, + pageSize: limit, + totalPages: 0 + }); + } + } else { + filter.category_id = { $in: categoryIds }; + } + } + const totalCount = await MenuItem2.countDocuments(filter); + const rows = await MenuItem2.find(filter).populate("category_id").sort({ _id: -1 }).skip(skip).limit(limit).lean(); + return sendResponse(res, 200, "Inactive menu items fetched successfully", rows, { + totalCount, + currentPage: page, + pageSize: limit, + totalPages: Math.ceil(totalCount / limit) + }); + } catch (error2) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + module2.exports = { + createMenuItem, + getMenuItems, + getItemsByCategory, + getMenuItemById, + updateMenuItem, + deleteMenuItem, + searchMenuItem, + checkMenuItemImageExistsDB, + updateMenuItemStatus, + getInactiveMenuItems + }; + } +}); + +// model/adsModal.js +var require_adsModal = __commonJS({ + "model/adsModal.js"(exports2, module2) { + var mongoose2 = require_mongoose2(); + var Schema2 = mongoose2.Schema; + var adsSchema = new Schema2({ + branch_id: { + type: mongoose2.Schema.Types.ObjectId, + ref: "Branch" + }, + title: String, + ad_type: { + type: String, + enum: ["carousel", "banner"] + }, + is_expired: { + type: Boolean, + default: false + }, + valid_from: Date, + valid_to: Date, + image_url: String, + is_admin: { + type: Boolean, + default: false + } + }, { timestamps: true }); + var Ads = mongoose2.model("Ads", adsSchema); + module2.exports = { Ads }; + } +}); + +// controller/adsController.js +var require_adsController = __commonJS({ + "controller/adsController.js"(exports2, module2) { + var { Ads } = require_adsModal(); + var errorHandler = require_joiErrorHandler(); + var { sendResponse } = require_responseHelper(); + var createAd = async (req, res) => { + try { + const { + title, + ad_type, + valid_from, + valid_to, + image_url, + is_admin + } = req.body; + const branch_id = req.user.branchId; + if (!branch_id || !image_url || !ad_type) { + return res.status(400).json({ + success: false, + message: "branch_id, imageUrl, ad_type are required" + }); + } + const ad = new Ads({ + branch_id, + title, + ad_type, + valid_from, + valid_to, + image_url, + is_admin: is_admin || false + }); + await ad.save(); + return res.status(201).json({ + success: true, + message: "Ad created successfully", + data: ad + }); + } catch (error2) { + console.log("Create Ad Error:", error2); + return res.status(500).json(errorHandler(error2)); + } + }; + var getAds = async (req, res) => { + try { + const branch_id = req.user.branchId; + const page = parseInt(req.query.page) || 1; + const limit = parseInt(req.query.limit) || 20; + const skip = (page - 1) * limit; + const filter = { branch_id, is_admin: false, is_expired: false }; + const count = await Ads.countDocuments(filter); + const rows = await Ads.find(filter).sort({ _id: -1 }).skip(skip).limit(limit).lean(); + return res.status(200).json({ + success: true, + data: rows, + pagination: { + total: count, + page, + totalPages: Math.ceil(count / limit) + } + }); + } catch (error2) { + return res.status(500).json(errorHandler(error2)); + } + }; + var getActiveAds = async (req, res) => { + try { + const branch_id = req.user.branchId; + const now = /* @__PURE__ */ new Date(); + const ads = await Ads.find({ + branch_id, + valid_from: { $lte: now }, + valid_to: { $gte: now } + }).sort({ _id: -1 }).lean(); + return res.status(200).json({ success: true, data: ads }); + } catch (error2) { + return res.status(500).json(errorHandler(error2)); + } + }; + var updateAd = async (req, res) => { + try { + const { branchId } = req.user; + const { id } = req.params; + const ad = await Ads.findById(id); + if (!ad) { + return res.status(404).json({ + success: false, + message: "Ad not found" + }); + } + req.body.branch_id = branchId; + Object.assign(ad, req.body); + await ad.save(); + return res.status(200).json({ + success: true, + message: "Ad updated successfully", + data: ad + }); + } catch (error2) { + return res.status(500).json(errorHandler(error2)); + } + }; + var deleteAd = async (req, res) => { + try { + const { id } = req.params; + const ad = await Ads.findByIdAndDelete(id); + if (!ad) { + return res.status(404).json({ + success: false, + message: "Ad not found" + }); + } + return res.status(200).json({ + success: true, + message: "Ad deleted successfully" + }); + } catch (error2) { + return res.status(500).json(errorHandler(error2)); + } + }; + var checkAdsImageExistsDB = async (fileName, id = null) => { + try { + if (!fileName) { + return { success: false, exists: false }; + } + const filter = { + image_url: fileName + }; + if (id) { + filter._id = { $ne: id }; + } + const exists = await Ads.findOne(filter); + return { + success: true, + exists: !!exists + }; + } catch (error2) { + console.log("Check Image in DB Error:", error2); + return { + success: false, + exists: false, + error: error2 + }; + } + }; + module2.exports = { + createAd, + getAds, + updateAd, + deleteAd, + getActiveAds, + checkAdsImageExistsDB + }; + } +}); + +// node_modules/@smithy/types/dist-cjs/index.js +var require_dist_cjs = __commonJS({ + "node_modules/@smithy/types/dist-cjs/index.js"(exports2) { + "use strict"; + exports2.HttpAuthLocation = void 0; + (function(HttpAuthLocation) { + HttpAuthLocation["HEADER"] = "header"; + HttpAuthLocation["QUERY"] = "query"; + })(exports2.HttpAuthLocation || (exports2.HttpAuthLocation = {})); + exports2.HttpApiKeyAuthLocation = void 0; + (function(HttpApiKeyAuthLocation2) { + HttpApiKeyAuthLocation2["HEADER"] = "header"; + HttpApiKeyAuthLocation2["QUERY"] = "query"; + })(exports2.HttpApiKeyAuthLocation || (exports2.HttpApiKeyAuthLocation = {})); + exports2.EndpointURLScheme = void 0; + (function(EndpointURLScheme) { + EndpointURLScheme["HTTP"] = "http"; + EndpointURLScheme["HTTPS"] = "https"; + })(exports2.EndpointURLScheme || (exports2.EndpointURLScheme = {})); + exports2.AlgorithmId = void 0; + (function(AlgorithmId) { + AlgorithmId["MD5"] = "md5"; + AlgorithmId["CRC32"] = "crc32"; + AlgorithmId["CRC32C"] = "crc32c"; + AlgorithmId["SHA1"] = "sha1"; + AlgorithmId["SHA256"] = "sha256"; + })(exports2.AlgorithmId || (exports2.AlgorithmId = {})); + var getChecksumConfiguration = (runtimeConfig) => { + const checksumAlgorithms = []; + if (runtimeConfig.sha256 !== void 0) { + checksumAlgorithms.push({ + algorithmId: () => exports2.AlgorithmId.SHA256, + checksumConstructor: () => runtimeConfig.sha256 + }); + } + if (runtimeConfig.md5 != void 0) { + checksumAlgorithms.push({ + algorithmId: () => exports2.AlgorithmId.MD5, + checksumConstructor: () => runtimeConfig.md5 + }); + } + return { + addChecksumAlgorithm(algo) { + checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return checksumAlgorithms; + } + }; + }; + var resolveChecksumRuntimeConfig = (clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; + }; + var getDefaultClientConfiguration = (runtimeConfig) => { + return getChecksumConfiguration(runtimeConfig); + }; + var resolveDefaultRuntimeConfig4 = (config) => { + return resolveChecksumRuntimeConfig(config); + }; + exports2.FieldPosition = void 0; + (function(FieldPosition) { + FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; + FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; + })(exports2.FieldPosition || (exports2.FieldPosition = {})); + var SMITHY_CONTEXT_KEY2 = "__smithy_context"; + exports2.IniSectionType = void 0; + (function(IniSectionType) { + IniSectionType["PROFILE"] = "profile"; + IniSectionType["SSO_SESSION"] = "sso-session"; + IniSectionType["SERVICES"] = "services"; + })(exports2.IniSectionType || (exports2.IniSectionType = {})); + exports2.RequestHandlerProtocol = void 0; + (function(RequestHandlerProtocol) { + RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; + RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; + RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; + })(exports2.RequestHandlerProtocol || (exports2.RequestHandlerProtocol = {})); + exports2.SMITHY_CONTEXT_KEY = SMITHY_CONTEXT_KEY2; + exports2.getDefaultClientConfiguration = getDefaultClientConfiguration; + exports2.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig4; + } +}); + +// node_modules/@smithy/protocol-http/dist-cjs/index.js +var require_dist_cjs2 = __commonJS({ + "node_modules/@smithy/protocol-http/dist-cjs/index.js"(exports2) { + "use strict"; + var types = require_dist_cjs(); + var getHttpHandlerExtensionConfiguration4 = (runtimeConfig) => { + return { + setHttpHandler(handler2) { + runtimeConfig.httpHandler = handler2; + }, + httpHandler() { + return runtimeConfig.httpHandler; + }, + updateHttpClientConfig(key, value) { + runtimeConfig.httpHandler?.updateHttpClientConfig(key, value); + }, + httpHandlerConfigs() { + return runtimeConfig.httpHandler.httpHandlerConfigs(); + } + }; + }; + var resolveHttpHandlerRuntimeConfig4 = (httpHandlerExtensionConfiguration) => { + return { + httpHandler: httpHandlerExtensionConfiguration.httpHandler() + }; + }; + var Field = class { + name; + kind; + values; + constructor({ name, kind = types.FieldPosition.HEADER, values = [] }) { + this.name = name; + this.kind = kind; + this.values = values; + } + add(value) { + this.values.push(value); + } + set(values) { + this.values = values; + } + remove(value) { + this.values = this.values.filter((v4) => v4 !== value); + } + toString() { + return this.values.map((v4) => v4.includes(",") || v4.includes(" ") ? `"${v4}"` : v4).join(", "); + } + get() { + return this.values; + } + }; + var Fields = class { + entries = {}; + encoding; + constructor({ fields = [], encoding = "utf-8" }) { + fields.forEach(this.setField.bind(this)); + this.encoding = encoding; + } + setField(field) { + this.entries[field.name.toLowerCase()] = field; + } + getField(name) { + return this.entries[name.toLowerCase()]; + } + removeField(name) { + delete this.entries[name.toLowerCase()]; + } + getByType(kind) { + return Object.values(this.entries).filter((field) => field.kind === kind); + } + }; + var HttpRequest10 = class _HttpRequest { + method; + protocol; + hostname; + port; + path; + query; + headers; + username; + password; + fragment; + body; + constructor(options) { + this.method = options.method || "GET"; + this.hostname = options.hostname || "localhost"; + this.port = options.port; + this.query = options.query || {}; + this.headers = options.headers || {}; + this.body = options.body; + this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:"; + this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/"; + this.username = options.username; + this.password = options.password; + this.fragment = options.fragment; + } + static clone(request) { + const cloned = new _HttpRequest({ + ...request, + headers: { ...request.headers } + }); + if (cloned.query) { + cloned.query = cloneQuery(cloned.query); + } + return cloned; + } + static isInstance(request) { + if (!request) { + return false; + } + const req = request; + return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object"; + } + clone() { + return _HttpRequest.clone(this); + } + }; + function cloneQuery(query) { + return Object.keys(query).reduce((carry, paramName) => { + const param = query[paramName]; + return { + ...carry, + [paramName]: Array.isArray(param) ? [...param] : param + }; + }, {}); + } + var HttpResponse4 = class { + statusCode; + reason; + headers; + body; + constructor(options) { + this.statusCode = options.statusCode; + this.reason = options.reason; + this.headers = options.headers || {}; + this.body = options.body; + } + static isInstance(response) { + if (!response) + return false; + const resp = response; + return typeof resp.statusCode === "number" && typeof resp.headers === "object"; + } + }; + function isValidHostname(hostname) { + const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; + return hostPattern.test(hostname); + } + exports2.Field = Field; + exports2.Fields = Fields; + exports2.HttpRequest = HttpRequest10; + exports2.HttpResponse = HttpResponse4; + exports2.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration4; + exports2.isValidHostname = isValidHostname; + exports2.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig4; + } +}); + +// node_modules/@aws-sdk/middleware-expect-continue/dist-cjs/index.js +var require_dist_cjs3 = __commonJS({ + "node_modules/@aws-sdk/middleware-expect-continue/dist-cjs/index.js"(exports2) { + "use strict"; + var protocolHttp = require_dist_cjs2(); + function addExpectContinueMiddleware(options) { + return (next) => async (args2) => { + const { request } = args2; + if (options.expectContinueHeader !== false && protocolHttp.HttpRequest.isInstance(request) && request.body && options.runtime === "node" && options.requestHandler?.constructor?.name !== "FetchHttpHandler") { + let sendHeader = true; + if (typeof options.expectContinueHeader === "number") { + try { + const bodyLength = Number(request.headers?.["content-length"]) ?? options.bodyLengthChecker?.(request.body) ?? Infinity; + sendHeader = bodyLength >= options.expectContinueHeader; + } catch (e4) { + } + } else { + sendHeader = !!options.expectContinueHeader; + } + if (sendHeader) { + request.headers.Expect = "100-continue"; + } + } + return next({ + ...args2, + request + }); + }; + } + var addExpectContinueMiddlewareOptions = { + step: "build", + tags: ["SET_EXPECT_HEADER", "EXPECT_HEADER"], + name: "addExpectContinueMiddleware", + override: true + }; + var getAddExpectContinuePlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(addExpectContinueMiddleware(options), addExpectContinueMiddlewareOptions); + } + }); + exports2.addExpectContinueMiddleware = addExpectContinueMiddleware; + exports2.addExpectContinueMiddlewareOptions = addExpectContinueMiddlewareOptions; + exports2.getAddExpectContinuePlugin = getAddExpectContinuePlugin; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js +var state, emitWarningIfUnsupportedVersion; +var init_emitWarningIfUnsupportedVersion = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js"() { + state = { + warningEmitted: false + }; + emitWarningIfUnsupportedVersion = (version) => { + if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 20) { + state.warningEmitted = true; + process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will +no longer support Node.js ${version} in January 2026. + +To continue receiving updates to AWS services, bug fixes, and security +updates please upgrade to a supported Node.js LTS version. + +More information can be found at: https://a.co/c895JFp`); + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js +function setCredentialFeature(credentials, feature, value) { + if (!credentials.$source) { + credentials.$source = {}; + } + credentials.$source[feature] = value; + return credentials; +} +var init_setCredentialFeature = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js"() { + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js +function setFeature(context, feature, value) { + if (!context.__aws_sdk_context) { + context.__aws_sdk_context = { + features: {} + }; + } else if (!context.__aws_sdk_context.features) { + context.__aws_sdk_context.features = {}; + } + context.__aws_sdk_context.features[feature] = value; +} +var init_setFeature = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js"() { + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/client/setTokenFeature.js +function setTokenFeature(token, feature, value) { + if (!token.$source) { + token.$source = {}; + } + token.$source[feature] = value; + return token; +} +var init_setTokenFeature = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/setTokenFeature.js"() { + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/client/index.js +var client_exports = {}; +__export(client_exports, { + emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion, + setCredentialFeature: () => setCredentialFeature, + setFeature: () => setFeature, + setTokenFeature: () => setTokenFeature, + state: () => state +}); +var init_client = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/client/index.js"() { + init_emitWarningIfUnsupportedVersion(); + init_setCredentialFeature(); + init_setFeature(); + init_setTokenFeature(); + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js +var import_protocol_http, getDateHeader; +var init_getDateHeader = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js"() { + import_protocol_http = __toESM(require_dist_cjs2()); + getDateHeader = (response) => import_protocol_http.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js +var getSkewCorrectedDate; +var init_getSkewCorrectedDate = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js"() { + getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js +var isClockSkewed; +var init_isClockSkewed = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js"() { + init_getSkewCorrectedDate(); + isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +var getUpdatedSystemClockOffset; +var init_getUpdatedSystemClockOffset = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js"() { + init_isClockSkewed(); + getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { + const clockTimeInMs = Date.parse(clockTime); + if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { + return clockTimeInMs - Date.now(); + } + return currentSystemClockOffset; + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js +var init_utils = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js"() { + init_getDateHeader(); + init_getSkewCorrectedDate(); + init_getUpdatedSystemClockOffset(); + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +var import_protocol_http2, throwSigningPropertyError, validateSigningProperties, AwsSdkSigV4Signer, AWSSDKSigV4Signer; +var init_AwsSdkSigV4Signer = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js"() { + import_protocol_http2 = __toESM(require_dist_cjs2()); + init_utils(); + throwSigningPropertyError = (name, property) => { + if (!property) { + throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`); + } + return property; + }; + validateSigningProperties = async (signingProperties) => { + const context = throwSigningPropertyError("context", signingProperties.context); + const config = throwSigningPropertyError("config", signingProperties.config); + const authScheme = context.endpointV2?.properties?.authSchemes?.[0]; + const signerFunction = throwSigningPropertyError("signer", config.signer); + const signer = await signerFunction(authScheme); + const signingRegion = signingProperties?.signingRegion; + const signingRegionSet = signingProperties?.signingRegionSet; + const signingName = signingProperties?.signingName; + return { + config, + signer, + signingRegion, + signingRegionSet, + signingName + }; + }; + AwsSdkSigV4Signer = class { + async sign(httpRequest, identity, signingProperties) { + if (!import_protocol_http2.HttpRequest.isInstance(httpRequest)) { + throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); + } + const validatedProps = await validateSigningProperties(signingProperties); + const { config, signer } = validatedProps; + let { signingRegion, signingName } = validatedProps; + const handlerExecutionContext = signingProperties.context; + if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) { + const [first, second] = handlerExecutionContext.authSchemes; + if (first?.name === "sigv4a" && second?.name === "sigv4") { + signingRegion = second?.signingRegion ?? signingRegion; + signingName = second?.signingName ?? signingName; + } + } + const signedRequest = await signer.sign(httpRequest, { + signingDate: getSkewCorrectedDate(config.systemClockOffset), + signingRegion, + signingService: signingName + }); + return signedRequest; + } + errorHandler(signingProperties) { + return (error2) => { + const serverTime = error2.ServerTime ?? getDateHeader(error2.$response); + if (serverTime) { + const config = throwSigningPropertyError("config", signingProperties.config); + const initialSystemClockOffset = config.systemClockOffset; + config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset); + const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset; + if (clockSkewCorrected && error2.$metadata) { + error2.$metadata.clockSkewCorrected = true; + } + } + throw error2; + }; + } + successHandler(httpResponse, signingProperties) { + const dateHeader = getDateHeader(httpResponse); + if (dateHeader) { + const config = throwSigningPropertyError("config", signingProperties.config); + config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset); + } + } + }; + AWSSDKSigV4Signer = AwsSdkSigV4Signer; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js +var import_protocol_http3, AwsSdkSigV4ASigner; +var init_AwsSdkSigV4ASigner = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js"() { + import_protocol_http3 = __toESM(require_dist_cjs2()); + init_utils(); + init_AwsSdkSigV4Signer(); + AwsSdkSigV4ASigner = class extends AwsSdkSigV4Signer { + async sign(httpRequest, identity, signingProperties) { + if (!import_protocol_http3.HttpRequest.isInstance(httpRequest)) { + throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); + } + const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties); + const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.(); + const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(","); + const signedRequest = await signer.sign(httpRequest, { + signingDate: getSkewCorrectedDate(config.systemClockOffset), + signingRegion: multiRegionOverride, + signingService: signingName + }); + return signedRequest; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.js +var getArrayForCommaSeparatedString; +var init_getArrayForCommaSeparatedString = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.js"() { + getArrayForCommaSeparatedString = (str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : []; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.js +var getBearerTokenEnvKey; +var init_getBearerTokenEnvKey = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.js"() { + getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\s-]/g, "_").toUpperCase()}`; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js +var NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY, NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS; +var init_NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js"() { + init_getArrayForCommaSeparatedString(); + init_getBearerTokenEnvKey(); + NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = "AWS_AUTH_SCHEME_PREFERENCE"; + NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = "auth_scheme_preference"; + NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = { + environmentVariableSelector: (env, options) => { + if (options?.signingName) { + const bearerTokenKey = getBearerTokenEnvKey(options.signingName); + if (bearerTokenKey in env) + return ["httpBearerAuth"]; + } + if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env)) + return void 0; + return getArrayForCommaSeparatedString(env[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]); + }, + configFileSelector: (profile) => { + if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile)) + return void 0; + return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]); + }, + default: [] + }; + } +}); + +// node_modules/@smithy/core/dist-es/getSmithyContext.js +var import_types, getSmithyContext; +var init_getSmithyContext = __esm({ + "node_modules/@smithy/core/dist-es/getSmithyContext.js"() { + import_types = __toESM(require_dist_cjs()); + getSmithyContext = (context) => context[import_types.SMITHY_CONTEXT_KEY] || (context[import_types.SMITHY_CONTEXT_KEY] = {}); + } +}); + +// node_modules/@smithy/util-middleware/dist-cjs/index.js +var require_dist_cjs4 = __commonJS({ + "node_modules/@smithy/util-middleware/dist-cjs/index.js"(exports2) { + "use strict"; + var types = require_dist_cjs(); + var getSmithyContext10 = (context) => context[types.SMITHY_CONTEXT_KEY] || (context[types.SMITHY_CONTEXT_KEY] = {}); + var normalizeProvider5 = (input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; + }; + exports2.getSmithyContext = getSmithyContext10; + exports2.normalizeProvider = normalizeProvider5; + } +}); + +// node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/resolveAuthOptions.js +var resolveAuthOptions; +var init_resolveAuthOptions = __esm({ + "node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/resolveAuthOptions.js"() { + resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => { + if (!authSchemePreference || authSchemePreference.length === 0) { + return candidateAuthOptions; + } + const preferredAuthOptions = []; + for (const preferredSchemeName of authSchemePreference) { + for (const candidateAuthOption of candidateAuthOptions) { + const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1]; + if (candidateAuthSchemeName === preferredSchemeName) { + preferredAuthOptions.push(candidateAuthOption); + } + } + } + for (const candidateAuthOption of candidateAuthOptions) { + if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) { + preferredAuthOptions.push(candidateAuthOption); + } + } + return preferredAuthOptions; + }; + } +}); + +// node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +function convertHttpAuthSchemesToMap(httpAuthSchemes) { + const map2 = /* @__PURE__ */ new Map(); + for (const scheme of httpAuthSchemes) { + map2.set(scheme.schemeId, scheme); + } + return map2; +} +var import_util_middleware, httpAuthSchemeMiddleware; +var init_httpAuthSchemeMiddleware = __esm({ + "node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js"() { + import_util_middleware = __toESM(require_dist_cjs4()); + init_resolveAuthOptions(); + httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args2) => { + const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args2.input)); + const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : []; + const resolvedOptions = resolveAuthOptions(options, authSchemePreference); + const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes); + const smithyContext = (0, import_util_middleware.getSmithyContext)(context); + const failureReasons = []; + for (const option of resolvedOptions) { + const scheme = authSchemes.get(option.schemeId); + if (!scheme) { + failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`); + continue; + } + const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config)); + if (!identityProvider) { + failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`); + continue; + } + const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {}; + option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties); + option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties); + smithyContext.selectedHttpAuthScheme = { + httpAuthOption: option, + identity: await identityProvider(option.identityProperties), + signer: scheme.signer + }; + break; + } + if (!smithyContext.selectedHttpAuthScheme) { + throw new Error(failureReasons.join("\n")); + } + return next(args2); + }; + } +}); + +// node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js +var httpAuthSchemeEndpointRuleSetMiddlewareOptions, getHttpAuthSchemeEndpointRuleSetPlugin; +var init_getHttpAuthSchemeEndpointRuleSetPlugin = __esm({ + "node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js"() { + init_httpAuthSchemeMiddleware(); + httpAuthSchemeEndpointRuleSetMiddlewareOptions = { + step: "serialize", + tags: ["HTTP_AUTH_SCHEME"], + name: "httpAuthSchemeMiddleware", + override: true, + relation: "before", + toMiddleware: "endpointV2Middleware" + }; + getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, { + httpAuthSchemeParametersProvider, + identityProviderConfigProvider + }), httpAuthSchemeEndpointRuleSetMiddlewareOptions); + } + }); + } +}); + +// node_modules/@smithy/middleware-serde/dist-cjs/index.js +var require_dist_cjs5 = __commonJS({ + "node_modules/@smithy/middleware-serde/dist-cjs/index.js"(exports2) { + "use strict"; + var protocolHttp = require_dist_cjs2(); + var deserializerMiddleware = (options, deserializer) => (next, context) => async (args2) => { + const { response } = await next(args2); + try { + const parsed = await deserializer(response, options); + return { + response, + output: parsed + }; + } catch (error2) { + Object.defineProperty(error2, "$response", { + value: response, + enumerable: false, + writable: false, + configurable: false + }); + if (!("$metadata" in error2)) { + const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; + try { + error2.message += "\n " + hint; + } catch (e4) { + if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") { + console.warn(hint); + } else { + context.logger?.warn?.(hint); + } + } + if (typeof error2.$responseBodyText !== "undefined") { + if (error2.$response) { + error2.$response.body = error2.$responseBodyText; + } + } + try { + if (protocolHttp.HttpResponse.isInstance(response)) { + const { headers = {} } = response; + const headerEntries = Object.entries(headers); + error2.$metadata = { + httpStatusCode: response.statusCode, + requestId: findHeader2(/^x-[\w-]+-request-?id$/, headerEntries), + extendedRequestId: findHeader2(/^x-[\w-]+-id-2$/, headerEntries), + cfId: findHeader2(/^x-[\w-]+-cf-id$/, headerEntries) + }; + } + } catch (e4) { + } + } + throw error2; + } + }; + var findHeader2 = (pattern, headers) => { + return (headers.find(([k4]) => { + return k4.match(pattern); + }) || [void 0, void 0])[1]; + }; + var serializerMiddleware = (options, serializer) => (next, context) => async (args2) => { + const endpointConfig = options; + const endpoint = context.endpointV2?.url && endpointConfig.urlParser ? async () => endpointConfig.urlParser(context.endpointV2.url) : endpointConfig.endpoint; + if (!endpoint) { + throw new Error("No valid endpoint provider available."); + } + const request = await serializer(args2.input, { ...options, endpoint }); + return next({ + ...args2, + request + }); + }; + var deserializerMiddlewareOption2 = { + name: "deserializerMiddleware", + step: "deserialize", + tags: ["DESERIALIZER"], + override: true + }; + var serializerMiddlewareOption3 = { + name: "serializerMiddleware", + step: "serialize", + tags: ["SERIALIZER"], + override: true + }; + function getSerdePlugin(config, serializer, deserializer) { + return { + applyToStack: (commandStack) => { + commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption2); + commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption3); + } + }; + } + exports2.deserializerMiddleware = deserializerMiddleware; + exports2.deserializerMiddlewareOption = deserializerMiddlewareOption2; + exports2.getSerdePlugin = getSerdePlugin; + exports2.serializerMiddleware = serializerMiddleware; + exports2.serializerMiddlewareOption = serializerMiddlewareOption3; + } +}); + +// node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js +var import_middleware_serde, httpAuthSchemeMiddlewareOptions, getHttpAuthSchemePlugin; +var init_getHttpAuthSchemePlugin = __esm({ + "node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js"() { + import_middleware_serde = __toESM(require_dist_cjs5()); + init_httpAuthSchemeMiddleware(); + httpAuthSchemeMiddlewareOptions = { + step: "serialize", + tags: ["HTTP_AUTH_SCHEME"], + name: "httpAuthSchemeMiddleware", + override: true, + relation: "before", + toMiddleware: import_middleware_serde.serializerMiddlewareOption.name + }; + getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, { + httpAuthSchemeParametersProvider, + identityProviderConfigProvider + }), httpAuthSchemeMiddlewareOptions); + } + }); + } +}); + +// node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js +var init_middleware_http_auth_scheme = __esm({ + "node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js"() { + init_httpAuthSchemeMiddleware(); + init_getHttpAuthSchemeEndpointRuleSetPlugin(); + init_getHttpAuthSchemePlugin(); + } +}); + +// node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js +var import_protocol_http4, import_util_middleware2, defaultErrorHandler, defaultSuccessHandler, httpSigningMiddleware; +var init_httpSigningMiddleware = __esm({ + "node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js"() { + import_protocol_http4 = __toESM(require_dist_cjs2()); + import_util_middleware2 = __toESM(require_dist_cjs4()); + defaultErrorHandler = (signingProperties) => (error2) => { + throw error2; + }; + defaultSuccessHandler = (httpResponse, signingProperties) => { + }; + httpSigningMiddleware = (config) => (next, context) => async (args2) => { + if (!import_protocol_http4.HttpRequest.isInstance(args2.request)) { + return next(args2); + } + const smithyContext = (0, import_util_middleware2.getSmithyContext)(context); + const scheme = smithyContext.selectedHttpAuthScheme; + if (!scheme) { + throw new Error(`No HttpAuthScheme was selected: unable to sign request`); + } + const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme; + const output = await next({ + ...args2, + request: await signer.sign(args2.request, identity, signingProperties) + }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties)); + (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties); + return output; + }; + } +}); + +// node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js +var httpSigningMiddlewareOptions, getHttpSigningPlugin; +var init_getHttpSigningMiddleware = __esm({ + "node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js"() { + init_httpSigningMiddleware(); + httpSigningMiddlewareOptions = { + step: "finalizeRequest", + tags: ["HTTP_SIGNING"], + name: "httpSigningMiddleware", + aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"], + override: true, + relation: "after", + toMiddleware: "retryMiddleware" + }; + getHttpSigningPlugin = (config) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions); + } + }); + } +}); + +// node_modules/@smithy/core/dist-es/middleware-http-signing/index.js +var init_middleware_http_signing = __esm({ + "node_modules/@smithy/core/dist-es/middleware-http-signing/index.js"() { + init_httpSigningMiddleware(); + init_getHttpSigningMiddleware(); + } +}); + +// node_modules/@smithy/core/dist-es/normalizeProvider.js +var normalizeProvider; +var init_normalizeProvider = __esm({ + "node_modules/@smithy/core/dist-es/normalizeProvider.js"() { + normalizeProvider = (input) => { + if (typeof input === "function") + return input; + const promisified = Promise.resolve(input); + return () => promisified; + }; + } +}); + +// node_modules/@smithy/core/dist-es/pagination/createPaginator.js +function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) { + return async function* paginateOperation(config, input, ...additionalArguments) { + const _input = input; + let token = config.startingToken ?? _input[inputTokenName]; + let hasNext = true; + let page; + while (hasNext) { + _input[inputTokenName] = token; + if (pageSizeTokenName) { + _input[pageSizeTokenName] = _input[pageSizeTokenName] ?? config.pageSize; + } + if (config.client instanceof ClientCtor) { + page = await makePagedClientRequest(CommandCtor, config.client, input, config.withCommand, ...additionalArguments); + } else { + throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`); + } + yield page; + const prevToken = token; + token = get(page, outputTokenName); + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + return void 0; + }; +} +var makePagedClientRequest, get; +var init_createPaginator = __esm({ + "node_modules/@smithy/core/dist-es/pagination/createPaginator.js"() { + makePagedClientRequest = async (CommandCtor, client, input, withCommand = (_) => _, ...args2) => { + let command = new CommandCtor(input); + command = withCommand(command) ?? command; + return await client.send(command, ...args2); + }; + get = (fromObject, path) => { + let cursor2 = fromObject; + const pathComponents = path.split("."); + for (const step of pathComponents) { + if (!cursor2 || typeof cursor2 !== "object") { + return void 0; + } + cursor2 = cursor2[step]; + } + return cursor2; + }; + } +}); + +// node_modules/@smithy/is-array-buffer/dist-cjs/index.js +var require_dist_cjs6 = __commonJS({ + "node_modules/@smithy/is-array-buffer/dist-cjs/index.js"(exports2) { + "use strict"; + var isArrayBuffer = (arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]"; + exports2.isArrayBuffer = isArrayBuffer; + } +}); + +// node_modules/@smithy/util-buffer-from/dist-cjs/index.js +var require_dist_cjs7 = __commonJS({ + "node_modules/@smithy/util-buffer-from/dist-cjs/index.js"(exports2) { + "use strict"; + var isArrayBuffer = require_dist_cjs6(); + var buffer = require("buffer"); + var fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => { + if (!isArrayBuffer.isArrayBuffer(input)) { + throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); + } + return buffer.Buffer.from(input, offset, length); + }; + var fromString = (input, encoding) => { + if (typeof input !== "string") { + throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); + } + return encoding ? buffer.Buffer.from(input, encoding) : buffer.Buffer.from(input); + }; + exports2.fromArrayBuffer = fromArrayBuffer; + exports2.fromString = fromString; + } +}); + +// node_modules/@smithy/util-base64/dist-cjs/fromBase64.js +var require_fromBase64 = __commonJS({ + "node_modules/@smithy/util-base64/dist-cjs/fromBase64.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.fromBase64 = void 0; + var util_buffer_from_1 = require_dist_cjs7(); + var BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; + var fromBase648 = (input) => { + if (input.length * 3 % 4 !== 0) { + throw new TypeError(`Incorrect padding on base64 string.`); + } + if (!BASE64_REGEX.exec(input)) { + throw new TypeError(`Invalid base64 string.`); + } + const buffer = (0, util_buffer_from_1.fromString)(input, "base64"); + return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); + }; + exports2.fromBase64 = fromBase648; + } +}); + +// node_modules/@smithy/util-utf8/dist-cjs/index.js +var require_dist_cjs8 = __commonJS({ + "node_modules/@smithy/util-utf8/dist-cjs/index.js"(exports2) { + "use strict"; + var utilBufferFrom = require_dist_cjs7(); + var fromUtf87 = (input) => { + const buf = utilBufferFrom.fromString(input, "utf8"); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); + }; + var toUint8Array2 = (data2) => { + if (typeof data2 === "string") { + return fromUtf87(data2); + } + if (ArrayBuffer.isView(data2)) { + return new Uint8Array(data2.buffer, data2.byteOffset, data2.byteLength / Uint8Array.BYTES_PER_ELEMENT); + } + return new Uint8Array(data2); + }; + var toUtf810 = (input) => { + if (typeof input === "string") { + return input; + } + if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { + throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array."); + } + return utilBufferFrom.fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); + }; + exports2.fromUtf8 = fromUtf87; + exports2.toUint8Array = toUint8Array2; + exports2.toUtf8 = toUtf810; + } +}); + +// node_modules/@smithy/util-base64/dist-cjs/toBase64.js +var require_toBase64 = __commonJS({ + "node_modules/@smithy/util-base64/dist-cjs/toBase64.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.toBase64 = void 0; + var util_buffer_from_1 = require_dist_cjs7(); + var util_utf8_1 = require_dist_cjs8(); + var toBase648 = (_input) => { + let input; + if (typeof _input === "string") { + input = (0, util_utf8_1.fromUtf8)(_input); + } else { + input = _input; + } + if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { + throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array."); + } + return (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64"); + }; + exports2.toBase64 = toBase648; + } +}); + +// node_modules/@smithy/util-base64/dist-cjs/index.js +var require_dist_cjs9 = __commonJS({ + "node_modules/@smithy/util-base64/dist-cjs/index.js"(exports2) { + "use strict"; + var fromBase648 = require_fromBase64(); + var toBase648 = require_toBase64(); + Object.keys(fromBase648).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return fromBase648[k4]; + } + }); + }); + Object.keys(toBase648).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return toBase648[k4]; + } + }); + }); + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js +var require_ChecksumStream = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ChecksumStream = void 0; + var util_base64_1 = require_dist_cjs9(); + var stream_1 = require("stream"); + var ChecksumStream = class extends stream_1.Duplex { + expectedChecksum; + checksumSourceLocation; + checksum; + source; + base64Encoder; + constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) { + super(); + if (typeof source.pipe === "function") { + this.source = source; + } else { + throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`); + } + this.base64Encoder = base64Encoder ?? util_base64_1.toBase64; + this.expectedChecksum = expectedChecksum; + this.checksum = checksum; + this.checksumSourceLocation = checksumSourceLocation; + this.source.pipe(this); + } + _read(size) { + } + _write(chunk, encoding, callback) { + try { + this.checksum.update(chunk); + this.push(chunk); + } catch (e4) { + return callback(e4); + } + return callback(); + } + async _final(callback) { + try { + const digest = await this.checksum.digest(); + const received = this.base64Encoder(digest); + if (this.expectedChecksum !== received) { + return callback(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${received}" in response header "${this.checksumSourceLocation}".`)); + } + } catch (e4) { + return callback(e4); + } + this.push(null); + return callback(); + } + }; + exports2.ChecksumStream = ChecksumStream; + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js +var require_stream_type_check = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isBlob = exports2.isReadableStream = void 0; + var isReadableStream = (stream) => typeof ReadableStream === "function" && (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream); + exports2.isReadableStream = isReadableStream; + var isBlob = (blob) => { + return typeof Blob === "function" && (blob?.constructor?.name === Blob.name || blob instanceof Blob); + }; + exports2.isBlob = isBlob; + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.browser.js +var require_ChecksumStream_browser = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.browser.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ChecksumStream = void 0; + var ReadableStreamRef = typeof ReadableStream === "function" ? ReadableStream : function() { + }; + var ChecksumStream = class extends ReadableStreamRef { + }; + exports2.ChecksumStream = ChecksumStream; + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js +var require_createChecksumStream_browser = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createChecksumStream = void 0; + var util_base64_1 = require_dist_cjs9(); + var stream_type_check_1 = require_stream_type_check(); + var ChecksumStream_browser_1 = require_ChecksumStream_browser(); + var createChecksumStream = ({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) => { + if (!(0, stream_type_check_1.isReadableStream)(source)) { + throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`); + } + const encoder = base64Encoder ?? util_base64_1.toBase64; + if (typeof TransformStream !== "function") { + throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream."); + } + const transform = new TransformStream({ + start() { + }, + async transform(chunk, controller) { + checksum.update(chunk); + controller.enqueue(chunk); + }, + async flush(controller) { + const digest = await checksum.digest(); + const received = encoder(digest); + if (expectedChecksum !== received) { + const error2 = new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}" in response header "${checksumSourceLocation}".`); + controller.error(error2); + } else { + controller.terminate(); + } + } + }); + source.pipeThrough(transform); + const readable = transform.readable; + Object.setPrototypeOf(readable, ChecksumStream_browser_1.ChecksumStream.prototype); + return readable; + }; + exports2.createChecksumStream = createChecksumStream; + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.js +var require_createChecksumStream = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createChecksumStream = createChecksumStream; + var stream_type_check_1 = require_stream_type_check(); + var ChecksumStream_1 = require_ChecksumStream(); + var createChecksumStream_browser_1 = require_createChecksumStream_browser(); + function createChecksumStream(init) { + if (typeof ReadableStream === "function" && (0, stream_type_check_1.isReadableStream)(init.source)) { + return (0, createChecksumStream_browser_1.createChecksumStream)(init); + } + return new ChecksumStream_1.ChecksumStream(init); + } + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js +var require_ByteArrayCollector = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ByteArrayCollector = void 0; + var ByteArrayCollector = class { + allocByteArray; + byteLength = 0; + byteArrays = []; + constructor(allocByteArray) { + this.allocByteArray = allocByteArray; + } + push(byteArray) { + this.byteArrays.push(byteArray); + this.byteLength += byteArray.byteLength; + } + flush() { + if (this.byteArrays.length === 1) { + const bytes = this.byteArrays[0]; + this.reset(); + return bytes; + } + const aggregation = this.allocByteArray(this.byteLength); + let cursor2 = 0; + for (let i4 = 0; i4 < this.byteArrays.length; ++i4) { + const bytes = this.byteArrays[i4]; + aggregation.set(bytes, cursor2); + cursor2 += bytes.byteLength; + } + this.reset(); + return aggregation; + } + reset() { + this.byteArrays = []; + this.byteLength = 0; + } + }; + exports2.ByteArrayCollector = ByteArrayCollector; + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js +var require_createBufferedReadableStream = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createBufferedReadable = void 0; + exports2.createBufferedReadableStream = createBufferedReadableStream; + exports2.merge = merge; + exports2.flush = flush; + exports2.sizeOf = sizeOf; + exports2.modeOf = modeOf; + var ByteArrayCollector_1 = require_ByteArrayCollector(); + function createBufferedReadableStream(upstream, size, logger3) { + const reader = upstream.getReader(); + let streamBufferingLoggedWarning = false; + let bytesSeen = 0; + const buffers = ["", new ByteArrayCollector_1.ByteArrayCollector((size2) => new Uint8Array(size2))]; + let mode = -1; + const pull = async (controller) => { + const { value, done } = await reader.read(); + const chunk = value; + if (done) { + if (mode !== -1) { + const remainder = flush(buffers, mode); + if (sizeOf(remainder) > 0) { + controller.enqueue(remainder); + } + } + controller.close(); + } else { + const chunkMode = modeOf(chunk, false); + if (mode !== chunkMode) { + if (mode >= 0) { + controller.enqueue(flush(buffers, mode)); + } + mode = chunkMode; + } + if (mode === -1) { + controller.enqueue(chunk); + return; + } + const chunkSize = sizeOf(chunk); + bytesSeen += chunkSize; + const bufferSize = sizeOf(buffers[mode]); + if (chunkSize >= size && bufferSize === 0) { + controller.enqueue(chunk); + } else { + const newSize = merge(buffers, mode, chunk); + if (!streamBufferingLoggedWarning && bytesSeen > size * 2) { + streamBufferingLoggedWarning = true; + logger3?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`); + } + if (newSize >= size) { + controller.enqueue(flush(buffers, mode)); + } else { + await pull(controller); + } + } + } + }; + return new ReadableStream({ + pull + }); + } + exports2.createBufferedReadable = createBufferedReadableStream; + function merge(buffers, mode, chunk) { + switch (mode) { + case 0: + buffers[0] += chunk; + return sizeOf(buffers[0]); + case 1: + case 2: + buffers[mode].push(chunk); + return sizeOf(buffers[mode]); + } + } + function flush(buffers, mode) { + switch (mode) { + case 0: + const s4 = buffers[0]; + buffers[0] = ""; + return s4; + case 1: + case 2: + return buffers[mode].flush(); + } + throw new Error(`@smithy/util-stream - invalid index ${mode} given to flush()`); + } + function sizeOf(chunk) { + return chunk?.byteLength ?? chunk?.length ?? 0; + } + function modeOf(chunk, allowBuffer = true) { + if (allowBuffer && typeof Buffer !== "undefined" && chunk instanceof Buffer) { + return 2; + } + if (chunk instanceof Uint8Array) { + return 1; + } + if (typeof chunk === "string") { + return 0; + } + return -1; + } + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js +var require_createBufferedReadable = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createBufferedReadable = createBufferedReadable; + var node_stream_1 = require("node:stream"); + var ByteArrayCollector_1 = require_ByteArrayCollector(); + var createBufferedReadableStream_1 = require_createBufferedReadableStream(); + var stream_type_check_1 = require_stream_type_check(); + function createBufferedReadable(upstream, size, logger3) { + if ((0, stream_type_check_1.isReadableStream)(upstream)) { + return (0, createBufferedReadableStream_1.createBufferedReadableStream)(upstream, size, logger3); + } + const downstream = new node_stream_1.Readable({ read() { + } }); + let streamBufferingLoggedWarning = false; + let bytesSeen = 0; + const buffers = [ + "", + new ByteArrayCollector_1.ByteArrayCollector((size2) => new Uint8Array(size2)), + new ByteArrayCollector_1.ByteArrayCollector((size2) => Buffer.from(new Uint8Array(size2))) + ]; + let mode = -1; + upstream.on("data", (chunk) => { + const chunkMode = (0, createBufferedReadableStream_1.modeOf)(chunk, true); + if (mode !== chunkMode) { + if (mode >= 0) { + downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode)); + } + mode = chunkMode; + } + if (mode === -1) { + downstream.push(chunk); + return; + } + const chunkSize = (0, createBufferedReadableStream_1.sizeOf)(chunk); + bytesSeen += chunkSize; + const bufferSize = (0, createBufferedReadableStream_1.sizeOf)(buffers[mode]); + if (chunkSize >= size && bufferSize === 0) { + downstream.push(chunk); + } else { + const newSize = (0, createBufferedReadableStream_1.merge)(buffers, mode, chunk); + if (!streamBufferingLoggedWarning && bytesSeen > size * 2) { + streamBufferingLoggedWarning = true; + logger3?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`); + } + if (newSize >= size) { + downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode)); + } + } + }); + upstream.on("end", () => { + if (mode !== -1) { + const remainder = (0, createBufferedReadableStream_1.flush)(buffers, mode); + if ((0, createBufferedReadableStream_1.sizeOf)(remainder) > 0) { + downstream.push(remainder); + } + } + downstream.push(null); + }); + return downstream; + } + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.browser.js +var require_getAwsChunkedEncodingStream_browser = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.browser.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getAwsChunkedEncodingStream = void 0; + var getAwsChunkedEncodingStream = (readableStream, options) => { + const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; + const checksumRequired = base64Encoder !== void 0 && bodyLengthChecker !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0; + const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : void 0; + const reader = readableStream.getReader(); + return new ReadableStream({ + async pull(controller) { + const { value, done } = await reader.read(); + if (done) { + controller.enqueue(`0\r +`); + if (checksumRequired) { + const checksum = base64Encoder(await digest); + controller.enqueue(`${checksumLocationName}:${checksum}\r +`); + controller.enqueue(`\r +`); + } + controller.close(); + } else { + controller.enqueue(`${(bodyLengthChecker(value) || 0).toString(16)}\r +${value}\r +`); + } + } + }); + }; + exports2.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream; + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js +var require_getAwsChunkedEncodingStream = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream; + var node_stream_1 = require("node:stream"); + var getAwsChunkedEncodingStream_browser_1 = require_getAwsChunkedEncodingStream_browser(); + var stream_type_check_1 = require_stream_type_check(); + function getAwsChunkedEncodingStream(stream, options) { + const readable = stream; + const readableStream = stream; + if ((0, stream_type_check_1.isReadableStream)(readableStream)) { + return (0, getAwsChunkedEncodingStream_browser_1.getAwsChunkedEncodingStream)(readableStream, options); + } + const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; + const checksumRequired = base64Encoder !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0; + const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readable) : void 0; + const awsChunkedEncodingStream = new node_stream_1.Readable({ + read: () => { + } + }); + readable.on("data", (data2) => { + const length = bodyLengthChecker(data2) || 0; + if (length === 0) { + return; + } + awsChunkedEncodingStream.push(`${length.toString(16)}\r +`); + awsChunkedEncodingStream.push(data2); + awsChunkedEncodingStream.push("\r\n"); + }); + readable.on("end", async () => { + awsChunkedEncodingStream.push(`0\r +`); + if (checksumRequired) { + const checksum = base64Encoder(await digest); + awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r +`); + awsChunkedEncodingStream.push(`\r +`); + } + awsChunkedEncodingStream.push(null); + }); + return awsChunkedEncodingStream; + } + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js +var require_headStream_browser = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.headStream = headStream; + async function headStream(stream, bytes) { + let byteLengthCounter = 0; + const chunks = []; + const reader = stream.getReader(); + let isDone = false; + while (!isDone) { + const { done, value } = await reader.read(); + if (value) { + chunks.push(value); + byteLengthCounter += value?.byteLength ?? 0; + } + if (byteLengthCounter >= bytes) { + break; + } + isDone = done; + } + reader.releaseLock(); + const collected = new Uint8Array(Math.min(bytes, byteLengthCounter)); + let offset = 0; + for (const chunk of chunks) { + if (chunk.byteLength > collected.byteLength - offset) { + collected.set(chunk.subarray(0, collected.byteLength - offset), offset); + break; + } else { + collected.set(chunk, offset); + } + offset += chunk.length; + } + return collected; + } + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/headStream.js +var require_headStream = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/headStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.headStream = void 0; + var stream_1 = require("stream"); + var headStream_browser_1 = require_headStream_browser(); + var stream_type_check_1 = require_stream_type_check(); + var headStream = (stream, bytes) => { + if ((0, stream_type_check_1.isReadableStream)(stream)) { + return (0, headStream_browser_1.headStream)(stream, bytes); + } + return new Promise((resolve, reject) => { + const collector = new Collector(); + collector.limit = bytes; + stream.pipe(collector); + stream.on("error", (err) => { + collector.end(); + reject(err); + }); + collector.on("error", reject); + collector.on("finish", function() { + const bytes2 = new Uint8Array(Buffer.concat(this.buffers)); + resolve(bytes2); + }); + }); + }; + exports2.headStream = headStream; + var Collector = class extends stream_1.Writable { + buffers = []; + limit = Infinity; + bytesBuffered = 0; + _write(chunk, encoding, callback) { + this.buffers.push(chunk); + this.bytesBuffered += chunk.byteLength ?? 0; + if (this.bytesBuffered >= this.limit) { + const excess = this.bytesBuffered - this.limit; + const tailBuffer = this.buffers[this.buffers.length - 1]; + this.buffers[this.buffers.length - 1] = tailBuffer.subarray(0, tailBuffer.byteLength - excess); + this.emit("finish"); + } + callback(); + } + }; + } +}); + +// node_modules/@smithy/util-uri-escape/dist-cjs/index.js +var require_dist_cjs10 = __commonJS({ + "node_modules/@smithy/util-uri-escape/dist-cjs/index.js"(exports2) { + "use strict"; + var escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); + var hexEncode = (c4) => `%${c4.charCodeAt(0).toString(16).toUpperCase()}`; + var escapeUriPath = (uri) => uri.split("/").map(escapeUri).join("/"); + exports2.escapeUri = escapeUri; + exports2.escapeUriPath = escapeUriPath; + } +}); + +// node_modules/@smithy/querystring-builder/dist-cjs/index.js +var require_dist_cjs11 = __commonJS({ + "node_modules/@smithy/querystring-builder/dist-cjs/index.js"(exports2) { + "use strict"; + var utilUriEscape = require_dist_cjs10(); + function buildQueryString(query) { + const parts = []; + for (let key of Object.keys(query).sort()) { + const value = query[key]; + key = utilUriEscape.escapeUri(key); + if (Array.isArray(value)) { + for (let i4 = 0, iLen = value.length; i4 < iLen; i4++) { + parts.push(`${key}=${utilUriEscape.escapeUri(value[i4])}`); + } + } else { + let qsEntry = key; + if (value || typeof value === "string") { + qsEntry += `=${utilUriEscape.escapeUri(value)}`; + } + parts.push(qsEntry); + } + } + return parts.join("&"); + } + exports2.buildQueryString = buildQueryString; + } +}); + +// node_modules/@smithy/node-http-handler/dist-cjs/index.js +var require_dist_cjs12 = __commonJS({ + "node_modules/@smithy/node-http-handler/dist-cjs/index.js"(exports2) { + "use strict"; + var protocolHttp = require_dist_cjs2(); + var querystringBuilder = require_dist_cjs11(); + var http = require("http"); + var https = require("https"); + var stream = require("stream"); + var http2 = require("http2"); + var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; + var getTransformedHeaders = (headers) => { + const transformedHeaders = {}; + for (const name of Object.keys(headers)) { + const headerValues = headers[name]; + transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; + } + return transformedHeaders; + }; + var timing = { + setTimeout: (cb, ms) => setTimeout(cb, ms), + clearTimeout: (timeoutId) => clearTimeout(timeoutId) + }; + var DEFER_EVENT_LISTENER_TIME$2 = 1e3; + var setConnectionTimeout = (request, reject, timeoutInMs = 0) => { + if (!timeoutInMs) { + return -1; + } + const registerTimeout = (offset) => { + const timeoutId = timing.setTimeout(() => { + request.destroy(); + reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${timeoutInMs} ms.`), { + name: "TimeoutError" + })); + }, timeoutInMs - offset); + const doWithSocket = (socket) => { + if (socket?.connecting) { + socket.on("connect", () => { + timing.clearTimeout(timeoutId); + }); + } else { + timing.clearTimeout(timeoutId); + } + }; + if (request.socket) { + doWithSocket(request.socket); + } else { + request.on("socket", doWithSocket); + } + }; + if (timeoutInMs < 2e3) { + registerTimeout(0); + return 0; + } + return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME$2), DEFER_EVENT_LISTENER_TIME$2); + }; + var setRequestTimeout = (req, reject, timeoutInMs = 0, throwOnRequestTimeout, logger3) => { + if (timeoutInMs) { + return timing.setTimeout(() => { + let msg = `@smithy/node-http-handler - [${throwOnRequestTimeout ? "ERROR" : "WARN"}] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`; + if (throwOnRequestTimeout) { + const error2 = Object.assign(new Error(msg), { + name: "TimeoutError", + code: "ETIMEDOUT" + }); + req.destroy(error2); + reject(error2); + } else { + msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`; + logger3?.warn?.(msg); + } + }, timeoutInMs); + } + return -1; + }; + var DEFER_EVENT_LISTENER_TIME$1 = 3e3; + var setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME$1) => { + if (keepAlive !== true) { + return -1; + } + const registerListener = () => { + if (request.socket) { + request.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + } else { + request.on("socket", (socket) => { + socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); + }); + } + }; + if (deferTimeMs === 0) { + registerListener(); + return 0; + } + return timing.setTimeout(registerListener, deferTimeMs); + }; + var DEFER_EVENT_LISTENER_TIME = 3e3; + var setSocketTimeout = (request, reject, timeoutInMs = 0) => { + const registerTimeout = (offset) => { + const timeout = timeoutInMs - offset; + const onTimeout = () => { + request.destroy(); + reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" })); + }; + if (request.socket) { + request.socket.setTimeout(timeout, onTimeout); + request.on("close", () => request.socket?.removeListener("timeout", onTimeout)); + } else { + request.setTimeout(timeout, onTimeout); + } + }; + if (0 < timeoutInMs && timeoutInMs < 6e3) { + registerTimeout(0); + return 0; + } + return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); + }; + var MIN_WAIT_TIME = 6e3; + async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) { + const headers = request.headers ?? {}; + const expect = headers.Expect || headers.expect; + let timeoutId = -1; + let sendBody = true; + if (!externalAgent && expect === "100-continue") { + sendBody = await Promise.race([ + new Promise((resolve) => { + timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); + }), + new Promise((resolve) => { + httpRequest.on("continue", () => { + timing.clearTimeout(timeoutId); + resolve(true); + }); + httpRequest.on("response", () => { + timing.clearTimeout(timeoutId); + resolve(false); + }); + httpRequest.on("error", () => { + timing.clearTimeout(timeoutId); + resolve(false); + }); + }) + ]); + } + if (sendBody) { + writeBody(httpRequest, request.body); + } + } + function writeBody(httpRequest, body) { + if (body instanceof stream.Readable) { + body.pipe(httpRequest); + return; + } + if (body) { + const isBuffer = Buffer.isBuffer(body); + const isString = typeof body === "string"; + if (isBuffer || isString) { + if (isBuffer && body.byteLength === 0) { + httpRequest.end(); + } else { + httpRequest.end(body); + } + return; + } + const uint8 = body; + if (typeof uint8 === "object" && uint8.buffer && typeof uint8.byteOffset === "number" && typeof uint8.byteLength === "number") { + httpRequest.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength)); + return; + } + httpRequest.end(Buffer.from(body)); + return; + } + httpRequest.end(); + } + var DEFAULT_REQUEST_TIMEOUT = 0; + var NodeHttpHandler = class _NodeHttpHandler { + config; + configProvider; + socketWarningTimestamp = 0; + externalAgent = false; + metadata = { handlerProtocol: "http/1.1" }; + static create(instanceOrOptions) { + if (typeof instanceOrOptions?.handle === "function") { + return instanceOrOptions; + } + return new _NodeHttpHandler(instanceOrOptions); + } + static checkSocketUsage(agent, socketWarningTimestamp, logger3 = console) { + const { sockets, requests, maxSockets } = agent; + if (typeof maxSockets !== "number" || maxSockets === Infinity) { + return socketWarningTimestamp; + } + const interval = 15e3; + if (Date.now() - interval < socketWarningTimestamp) { + return socketWarningTimestamp; + } + if (sockets && requests) { + for (const origin in sockets) { + const socketsInUse = sockets[origin]?.length ?? 0; + const requestsEnqueued = requests[origin]?.length ?? 0; + if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { + logger3?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued. +See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html +or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`); + return Date.now(); + } + } + } + return socketWarningTimestamp; + } + constructor(options) { + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((_options) => { + resolve(this.resolveDefaultConfig(_options)); + }).catch(reject); + } else { + resolve(this.resolveDefaultConfig(options)); + } + }); + } + resolveDefaultConfig(options) { + const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger: logger3 } = options || {}; + const keepAlive = true; + const maxSockets = 50; + return { + connectionTimeout, + requestTimeout, + socketTimeout, + socketAcquisitionWarningTimeout, + throwOnRequestTimeout, + httpAgent: (() => { + if (httpAgent instanceof http.Agent || typeof httpAgent?.destroy === "function") { + this.externalAgent = true; + return httpAgent; + } + return new http.Agent({ keepAlive, maxSockets, ...httpAgent }); + })(), + httpsAgent: (() => { + if (httpsAgent instanceof https.Agent || typeof httpsAgent?.destroy === "function") { + this.externalAgent = true; + return httpsAgent; + } + return new https.Agent({ keepAlive, maxSockets, ...httpsAgent }); + })(), + logger: logger3 + }; + } + destroy() { + this.config?.httpAgent?.destroy(); + this.config?.httpsAgent?.destroy(); + } + async handle(request, { abortSignal, requestTimeout } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + return new Promise((_resolve, _reject) => { + const config = this.config; + let writeRequestBodyPromise = void 0; + const timeouts = []; + const resolve = async (arg) => { + await writeRequestBodyPromise; + timeouts.forEach(timing.clearTimeout); + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + timeouts.forEach(timing.clearTimeout); + _reject(arg); + }; + if (abortSignal?.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const isSSL = request.protocol === "https:"; + const headers = request.headers ?? {}; + const expectContinue = (headers.Expect ?? headers.expect) === "100-continue"; + let agent = isSSL ? config.httpsAgent : config.httpAgent; + if (expectContinue && !this.externalAgent) { + agent = new (isSSL ? https.Agent : http.Agent)({ + keepAlive: false, + maxSockets: Infinity + }); + } + timeouts.push(timing.setTimeout(() => { + this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, config.logger); + }, config.socketAcquisitionWarningTimeout ?? (config.requestTimeout ?? 2e3) + (config.connectionTimeout ?? 1e3))); + const queryString = querystringBuilder.buildQueryString(request.query || {}); + let auth = void 0; + if (request.username != null || request.password != null) { + const username = request.username ?? ""; + const password = request.password ?? ""; + auth = `${username}:${password}`; + } + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + let hostname = request.hostname ?? ""; + if (hostname[0] === "[" && hostname.endsWith("]")) { + hostname = request.hostname.slice(1, -1); + } else { + hostname = request.hostname; + } + const nodeHttpsOptions = { + headers: request.headers, + host: hostname, + method: request.method, + path, + port: request.port, + agent, + auth + }; + const requestFunc = isSSL ? https.request : http.request; + const req = requestFunc(nodeHttpsOptions, (res) => { + const httpResponse = new protocolHttp.HttpResponse({ + statusCode: res.statusCode || -1, + reason: res.statusMessage, + headers: getTransformedHeaders(res.headers), + body: res + }); + resolve({ response: httpResponse }); + }); + req.on("error", (err) => { + if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { + reject(Object.assign(err, { name: "TimeoutError" })); + } else { + reject(err); + } + }); + if (abortSignal) { + const onAbort = () => { + req.destroy(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + if (typeof abortSignal.addEventListener === "function") { + const signal = abortSignal; + signal.addEventListener("abort", onAbort, { once: true }); + req.once("close", () => signal.removeEventListener("abort", onAbort)); + } else { + abortSignal.onabort = onAbort; + } + } + const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout; + timeouts.push(setConnectionTimeout(req, reject, config.connectionTimeout)); + timeouts.push(setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, config.logger ?? console)); + timeouts.push(setSocketTimeout(req, reject, config.socketTimeout)); + const httpAgent = nodeHttpsOptions.agent; + if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { + timeouts.push(setSocketKeepAlive(req, { + keepAlive: httpAgent.keepAlive, + keepAliveMsecs: httpAgent.keepAliveMsecs + })); + } + writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout, this.externalAgent).catch((e4) => { + timeouts.forEach(timing.clearTimeout); + return _reject(e4); + }); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } + }; + var NodeHttp2ConnectionPool = class { + sessions = []; + constructor(sessions) { + this.sessions = sessions ?? []; + } + poll() { + if (this.sessions.length > 0) { + return this.sessions.shift(); + } + } + offerLast(session) { + this.sessions.push(session); + } + contains(session) { + return this.sessions.includes(session); + } + remove(session) { + this.sessions = this.sessions.filter((s4) => s4 !== session); + } + [Symbol.iterator]() { + return this.sessions[Symbol.iterator](); + } + destroy(connection) { + for (const session of this.sessions) { + if (session === connection) { + if (!session.destroyed) { + session.destroy(); + } + } + } + } + }; + var NodeHttp2ConnectionManager = class { + constructor(config) { + this.config = config; + if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { + throw new RangeError("maxConcurrency must be greater than zero."); + } + } + config; + sessionCache = /* @__PURE__ */ new Map(); + lease(requestContext, connectionConfiguration) { + const url = this.getUrlString(requestContext); + const existingPool = this.sessionCache.get(url); + if (existingPool) { + const existingSession = existingPool.poll(); + if (existingSession && !this.config.disableConcurrency) { + return existingSession; + } + } + const session = http2.connect(url); + if (this.config.maxConcurrency) { + session.settings({ maxConcurrentStreams: this.config.maxConcurrency }, (err) => { + if (err) { + throw new Error("Fail to set maxConcurrentStreams to " + this.config.maxConcurrency + "when creating new session for " + requestContext.destination.toString()); + } + }); + } + session.unref(); + const destroySessionCb = () => { + session.destroy(); + this.deleteSession(url, session); + }; + session.on("goaway", destroySessionCb); + session.on("error", destroySessionCb); + session.on("frameError", destroySessionCb); + session.on("close", () => this.deleteSession(url, session)); + if (connectionConfiguration.requestTimeout) { + session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb); + } + const connectionPool = this.sessionCache.get(url) || new NodeHttp2ConnectionPool(); + connectionPool.offerLast(session); + this.sessionCache.set(url, connectionPool); + return session; + } + deleteSession(authority, session) { + const existingConnectionPool = this.sessionCache.get(authority); + if (!existingConnectionPool) { + return; + } + if (!existingConnectionPool.contains(session)) { + return; + } + existingConnectionPool.remove(session); + this.sessionCache.set(authority, existingConnectionPool); + } + release(requestContext, session) { + const cacheKey = this.getUrlString(requestContext); + this.sessionCache.get(cacheKey)?.offerLast(session); + } + destroy() { + for (const [key, connectionPool] of this.sessionCache) { + for (const session of connectionPool) { + if (!session.destroyed) { + session.destroy(); + } + connectionPool.remove(session); + } + this.sessionCache.delete(key); + } + } + setMaxConcurrentStreams(maxConcurrentStreams) { + if (maxConcurrentStreams && maxConcurrentStreams <= 0) { + throw new RangeError("maxConcurrentStreams must be greater than zero."); + } + this.config.maxConcurrency = maxConcurrentStreams; + } + setDisableConcurrentStreams(disableConcurrentStreams) { + this.config.disableConcurrency = disableConcurrentStreams; + } + getUrlString(request) { + return request.destination.toString(); + } + }; + var NodeHttp2Handler = class _NodeHttp2Handler { + config; + configProvider; + metadata = { handlerProtocol: "h2" }; + connectionManager = new NodeHttp2ConnectionManager({}); + static create(instanceOrOptions) { + if (typeof instanceOrOptions?.handle === "function") { + return instanceOrOptions; + } + return new _NodeHttp2Handler(instanceOrOptions); + } + constructor(options) { + this.configProvider = new Promise((resolve, reject) => { + if (typeof options === "function") { + options().then((opts) => { + resolve(opts || {}); + }).catch(reject); + } else { + resolve(options || {}); + } + }); + } + destroy() { + this.connectionManager.destroy(); + } + async handle(request, { abortSignal, requestTimeout } = {}) { + if (!this.config) { + this.config = await this.configProvider; + this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); + if (this.config.maxConcurrentStreams) { + this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); + } + } + const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config; + const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout; + return new Promise((_resolve, _reject) => { + let fulfilled = false; + let writeRequestBodyPromise = void 0; + const resolve = async (arg) => { + await writeRequestBodyPromise; + _resolve(arg); + }; + const reject = async (arg) => { + await writeRequestBodyPromise; + _reject(arg); + }; + if (abortSignal?.aborted) { + fulfilled = true; + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + return; + } + const { hostname, method, port, protocol, query } = request; + let auth = ""; + if (request.username != null || request.password != null) { + const username = request.username ?? ""; + const password = request.password ?? ""; + auth = `${username}:${password}@`; + } + const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; + const requestContext = { destination: new URL(authority) }; + const session = this.connectionManager.lease(requestContext, { + requestTimeout: this.config?.sessionTimeout, + disableConcurrentStreams: disableConcurrentStreams || false + }); + const rejectWithDestroy = (err) => { + if (disableConcurrentStreams) { + this.destroySession(session); + } + fulfilled = true; + reject(err); + }; + const queryString = querystringBuilder.buildQueryString(query || {}); + let path = request.path; + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + const req = session.request({ + ...request.headers, + [http2.constants.HTTP2_HEADER_PATH]: path, + [http2.constants.HTTP2_HEADER_METHOD]: method + }); + session.ref(); + req.on("response", (headers) => { + const httpResponse = new protocolHttp.HttpResponse({ + statusCode: headers[":status"] || -1, + headers: getTransformedHeaders(headers), + body: req + }); + fulfilled = true; + resolve({ response: httpResponse }); + if (disableConcurrentStreams) { + session.close(); + this.connectionManager.deleteSession(authority, session); + } + }); + if (effectiveRequestTimeout) { + req.setTimeout(effectiveRequestTimeout, () => { + req.close(); + const timeoutError = new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`); + timeoutError.name = "TimeoutError"; + rejectWithDestroy(timeoutError); + }); + } + if (abortSignal) { + const onAbort = () => { + req.close(); + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + rejectWithDestroy(abortError); + }; + if (typeof abortSignal.addEventListener === "function") { + const signal = abortSignal; + signal.addEventListener("abort", onAbort, { once: true }); + req.once("close", () => signal.removeEventListener("abort", onAbort)); + } else { + abortSignal.onabort = onAbort; + } + } + req.on("frameError", (type, code, id) => { + rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`)); + }); + req.on("error", rejectWithDestroy); + req.on("aborted", () => { + rejectWithDestroy(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`)); + }); + req.on("close", () => { + session.unref(); + if (disableConcurrentStreams) { + session.destroy(); + } + if (!fulfilled) { + rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response")); + } + }); + writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout); + }); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + return { + ...config, + [key]: value + }; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } + destroySession(session) { + if (!session.destroyed) { + session.destroy(); + } + } + }; + var Collector = class extends stream.Writable { + bufferedBytes = []; + _write(chunk, encoding, callback) { + this.bufferedBytes.push(chunk); + callback(); + } + }; + var streamCollector4 = (stream2) => { + if (isReadableStreamInstance(stream2)) { + return collectReadableStream(stream2); + } + return new Promise((resolve, reject) => { + const collector = new Collector(); + stream2.pipe(collector); + stream2.on("error", (err) => { + collector.end(); + reject(err); + }); + collector.on("error", reject); + collector.on("finish", function() { + const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); + resolve(bytes); + }); + }); + }; + var isReadableStreamInstance = (stream2) => typeof ReadableStream === "function" && stream2 instanceof ReadableStream; + async function collectReadableStream(stream2) { + const chunks = []; + const reader = stream2.getReader(); + let isDone = false; + let length = 0; + while (!isDone) { + const { done, value } = await reader.read(); + if (value) { + chunks.push(value); + length += value.length; + } + isDone = done; + } + const collected = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + collected.set(chunk, offset); + offset += chunk.length; + } + return collected; + } + exports2.DEFAULT_REQUEST_TIMEOUT = DEFAULT_REQUEST_TIMEOUT; + exports2.NodeHttp2Handler = NodeHttp2Handler; + exports2.NodeHttpHandler = NodeHttpHandler; + exports2.streamCollector = streamCollector4; + } +}); + +// node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +var require_dist_cjs13 = __commonJS({ + "node_modules/@smithy/fetch-http-handler/dist-cjs/index.js"(exports2) { + "use strict"; + var protocolHttp = require_dist_cjs2(); + var querystringBuilder = require_dist_cjs11(); + var utilBase64 = require_dist_cjs9(); + function createRequest(url, requestOptions) { + return new Request(url, requestOptions); + } + function requestTimeout(timeoutInMs = 0) { + return new Promise((resolve, reject) => { + if (timeoutInMs) { + setTimeout(() => { + const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`); + timeoutError.name = "TimeoutError"; + reject(timeoutError); + }, timeoutInMs); + } + }); + } + var keepAliveSupport = { + supported: void 0 + }; + var FetchHttpHandler = class _FetchHttpHandler { + config; + configProvider; + static create(instanceOrOptions) { + if (typeof instanceOrOptions?.handle === "function") { + return instanceOrOptions; + } + return new _FetchHttpHandler(instanceOrOptions); + } + constructor(options) { + if (typeof options === "function") { + this.configProvider = options().then((opts) => opts || {}); + } else { + this.config = options ?? {}; + this.configProvider = Promise.resolve(this.config); + } + if (keepAliveSupport.supported === void 0) { + keepAliveSupport.supported = Boolean(typeof Request !== "undefined" && "keepalive" in createRequest("https://[::1]")); + } + } + destroy() { + } + async handle(request, { abortSignal, requestTimeout: requestTimeout$1 } = {}) { + if (!this.config) { + this.config = await this.configProvider; + } + const requestTimeoutInMs = requestTimeout$1 ?? this.config.requestTimeout; + const keepAlive = this.config.keepAlive === true; + const credentials = this.config.credentials; + if (abortSignal?.aborted) { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + return Promise.reject(abortError); + } + let path = request.path; + const queryString = querystringBuilder.buildQueryString(request.query || {}); + if (queryString) { + path += `?${queryString}`; + } + if (request.fragment) { + path += `#${request.fragment}`; + } + let auth = ""; + if (request.username != null || request.password != null) { + const username = request.username ?? ""; + const password = request.password ?? ""; + auth = `${username}:${password}@`; + } + const { port, method } = request; + const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path}`; + const body = method === "GET" || method === "HEAD" ? void 0 : request.body; + const requestOptions = { + body, + headers: new Headers(request.headers), + method, + credentials + }; + if (this.config?.cache) { + requestOptions.cache = this.config.cache; + } + if (body) { + requestOptions.duplex = "half"; + } + if (typeof AbortController !== "undefined") { + requestOptions.signal = abortSignal; + } + if (keepAliveSupport.supported) { + requestOptions.keepalive = keepAlive; + } + if (typeof this.config.requestInit === "function") { + Object.assign(requestOptions, this.config.requestInit(request)); + } + let removeSignalEventListener = () => { + }; + const fetchRequest = createRequest(url, requestOptions); + const raceOfPromises = [ + fetch(fetchRequest).then((response) => { + const fetchHeaders = response.headers; + const transformedHeaders = {}; + for (const pair of fetchHeaders.entries()) { + transformedHeaders[pair[0]] = pair[1]; + } + const hasReadableStream = response.body != void 0; + if (!hasReadableStream) { + return response.blob().then((body2) => ({ + response: new protocolHttp.HttpResponse({ + headers: transformedHeaders, + reason: response.statusText, + statusCode: response.status, + body: body2 + }) + })); + } + return { + response: new protocolHttp.HttpResponse({ + headers: transformedHeaders, + reason: response.statusText, + statusCode: response.status, + body: response.body + }) + }; + }), + requestTimeout(requestTimeoutInMs) + ]; + if (abortSignal) { + raceOfPromises.push(new Promise((resolve, reject) => { + const onAbort = () => { + const abortError = new Error("Request aborted"); + abortError.name = "AbortError"; + reject(abortError); + }; + if (typeof abortSignal.addEventListener === "function") { + const signal = abortSignal; + signal.addEventListener("abort", onAbort, { once: true }); + removeSignalEventListener = () => signal.removeEventListener("abort", onAbort); + } else { + abortSignal.onabort = onAbort; + } + })); + } + return Promise.race(raceOfPromises).finally(removeSignalEventListener); + } + updateHttpClientConfig(key, value) { + this.config = void 0; + this.configProvider = this.configProvider.then((config) => { + config[key] = value; + return config; + }); + } + httpHandlerConfigs() { + return this.config ?? {}; + } + }; + var streamCollector4 = async (stream) => { + if (typeof Blob === "function" && stream instanceof Blob || stream.constructor?.name === "Blob") { + if (Blob.prototype.arrayBuffer !== void 0) { + return new Uint8Array(await stream.arrayBuffer()); + } + return collectBlob(stream); + } + return collectStream(stream); + }; + async function collectBlob(blob) { + const base64 = await readToBase64(blob); + const arrayBuffer = utilBase64.fromBase64(base64); + return new Uint8Array(arrayBuffer); + } + async function collectStream(stream) { + const chunks = []; + const reader = stream.getReader(); + let isDone = false; + let length = 0; + while (!isDone) { + const { done, value } = await reader.read(); + if (value) { + chunks.push(value); + length += value.length; + } + isDone = done; + } + const collected = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + collected.set(chunk, offset); + offset += chunk.length; + } + return collected; + } + function readToBase64(blob) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onloadend = () => { + if (reader.readyState !== 2) { + return reject(new Error("Reader aborted too early")); + } + const result = reader.result ?? ""; + const commaIndex = result.indexOf(","); + const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length; + resolve(result.substring(dataOffset)); + }; + reader.onabort = () => reject(new Error("Read aborted")); + reader.onerror = () => reject(reader.error); + reader.readAsDataURL(blob); + }); + } + exports2.FetchHttpHandler = FetchHttpHandler; + exports2.keepAliveSupport = keepAliveSupport; + exports2.streamCollector = streamCollector4; + } +}); + +// node_modules/@smithy/util-hex-encoding/dist-cjs/index.js +var require_dist_cjs14 = __commonJS({ + "node_modules/@smithy/util-hex-encoding/dist-cjs/index.js"(exports2) { + "use strict"; + var SHORT_TO_HEX = {}; + var HEX_TO_SHORT = {}; + for (let i4 = 0; i4 < 256; i4++) { + let encodedByte = i4.toString(16).toLowerCase(); + if (encodedByte.length === 1) { + encodedByte = `0${encodedByte}`; + } + SHORT_TO_HEX[i4] = encodedByte; + HEX_TO_SHORT[encodedByte] = i4; + } + function fromHex(encoded) { + if (encoded.length % 2 !== 0) { + throw new Error("Hex encoded strings must have an even number length"); + } + const out = new Uint8Array(encoded.length / 2); + for (let i4 = 0; i4 < encoded.length; i4 += 2) { + const encodedByte = encoded.slice(i4, i4 + 2).toLowerCase(); + if (encodedByte in HEX_TO_SHORT) { + out[i4 / 2] = HEX_TO_SHORT[encodedByte]; + } else { + throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`); + } + } + return out; + } + function toHex(bytes) { + let out = ""; + for (let i4 = 0; i4 < bytes.byteLength; i4++) { + out += SHORT_TO_HEX[bytes[i4]]; + } + return out; + } + exports2.fromHex = fromHex; + exports2.toHex = toHex; + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js +var require_sdk_stream_mixin_browser = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.sdkStreamMixin = void 0; + var fetch_http_handler_1 = require_dist_cjs13(); + var util_base64_1 = require_dist_cjs9(); + var util_hex_encoding_1 = require_dist_cjs14(); + var util_utf8_1 = require_dist_cjs8(); + var stream_type_check_1 = require_stream_type_check(); + var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; + var sdkStreamMixin2 = (stream) => { + if (!isBlobInstance(stream) && !(0, stream_type_check_1.isReadableStream)(stream)) { + const name = stream?.__proto__?.constructor?.name || stream; + throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`); + } + let transformed = false; + const transformToByteArray = async () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); + } + transformed = true; + return await (0, fetch_http_handler_1.streamCollector)(stream); + }; + const blobToWebStream = (blob) => { + if (typeof blob.stream !== "function") { + throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body"); + } + return blob.stream(); + }; + return Object.assign(stream, { + transformToByteArray, + transformToString: async (encoding) => { + const buf = await transformToByteArray(); + if (encoding === "base64") { + return (0, util_base64_1.toBase64)(buf); + } else if (encoding === "hex") { + return (0, util_hex_encoding_1.toHex)(buf); + } else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") { + return (0, util_utf8_1.toUtf8)(buf); + } else if (typeof TextDecoder === "function") { + return new TextDecoder(encoding).decode(buf); + } else { + throw new Error("TextDecoder is not available, please make sure polyfill is provided."); + } + }, + transformToWebStream: () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); + } + transformed = true; + if (isBlobInstance(stream)) { + return blobToWebStream(stream); + } else if ((0, stream_type_check_1.isReadableStream)(stream)) { + return stream; + } else { + throw new Error(`Cannot transform payload to web stream, got ${stream}`); + } + } + }); + }; + exports2.sdkStreamMixin = sdkStreamMixin2; + var isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob; + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js +var require_sdk_stream_mixin = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.sdkStreamMixin = void 0; + var node_http_handler_1 = require_dist_cjs12(); + var util_buffer_from_1 = require_dist_cjs7(); + var stream_1 = require("stream"); + var sdk_stream_mixin_browser_1 = require_sdk_stream_mixin_browser(); + var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; + var sdkStreamMixin2 = (stream) => { + if (!(stream instanceof stream_1.Readable)) { + try { + return (0, sdk_stream_mixin_browser_1.sdkStreamMixin)(stream); + } catch (e4) { + const name = stream?.__proto__?.constructor?.name || stream; + throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`); + } + } + let transformed = false; + const transformToByteArray = async () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); + } + transformed = true; + return await (0, node_http_handler_1.streamCollector)(stream); + }; + return Object.assign(stream, { + transformToByteArray, + transformToString: async (encoding) => { + const buf = await transformToByteArray(); + if (encoding === void 0 || Buffer.isEncoding(encoding)) { + return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); + } else { + const decoder = new TextDecoder(encoding); + return decoder.decode(buf); + } + }, + transformToWebStream: () => { + if (transformed) { + throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); + } + if (stream.readableFlowing !== null) { + throw new Error("The stream has been consumed by other callbacks."); + } + if (typeof stream_1.Readable.toWeb !== "function") { + throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available."); + } + transformed = true; + return stream_1.Readable.toWeb(stream); + } + }); + }; + exports2.sdkStreamMixin = sdkStreamMixin2; + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js +var require_splitStream_browser = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.splitStream = splitStream; + async function splitStream(stream) { + if (typeof stream.stream === "function") { + stream = stream.stream(); + } + const readableStream = stream; + return readableStream.tee(); + } + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/splitStream.js +var require_splitStream = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/splitStream.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.splitStream = splitStream; + var stream_1 = require("stream"); + var splitStream_browser_1 = require_splitStream_browser(); + var stream_type_check_1 = require_stream_type_check(); + async function splitStream(stream) { + if ((0, stream_type_check_1.isReadableStream)(stream) || (0, stream_type_check_1.isBlob)(stream)) { + return (0, splitStream_browser_1.splitStream)(stream); + } + const stream1 = new stream_1.PassThrough(); + const stream2 = new stream_1.PassThrough(); + stream.pipe(stream1); + stream.pipe(stream2); + return [stream1, stream2]; + } + } +}); + +// node_modules/@smithy/util-stream/dist-cjs/index.js +var require_dist_cjs15 = __commonJS({ + "node_modules/@smithy/util-stream/dist-cjs/index.js"(exports2) { + "use strict"; + var utilBase64 = require_dist_cjs9(); + var utilUtf8 = require_dist_cjs8(); + var ChecksumStream = require_ChecksumStream(); + var createChecksumStream = require_createChecksumStream(); + var createBufferedReadable = require_createBufferedReadable(); + var getAwsChunkedEncodingStream = require_getAwsChunkedEncodingStream(); + var headStream = require_headStream(); + var sdkStreamMixin2 = require_sdk_stream_mixin(); + var splitStream = require_splitStream(); + var streamTypeCheck = require_stream_type_check(); + var Uint8ArrayBlobAdapter2 = class _Uint8ArrayBlobAdapter extends Uint8Array { + static fromString(source, encoding = "utf-8") { + if (typeof source === "string") { + if (encoding === "base64") { + return _Uint8ArrayBlobAdapter.mutate(utilBase64.fromBase64(source)); + } + return _Uint8ArrayBlobAdapter.mutate(utilUtf8.fromUtf8(source)); + } + throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); + } + static mutate(source) { + Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter.prototype); + return source; + } + transformToString(encoding = "utf-8") { + if (encoding === "base64") { + return utilBase64.toBase64(this); + } + return utilUtf8.toUtf8(this); + } + }; + Object.defineProperty(exports2, "isBlob", { + enumerable: true, + get: function() { + return streamTypeCheck.isBlob; + } + }); + Object.defineProperty(exports2, "isReadableStream", { + enumerable: true, + get: function() { + return streamTypeCheck.isReadableStream; + } + }); + exports2.Uint8ArrayBlobAdapter = Uint8ArrayBlobAdapter2; + Object.keys(ChecksumStream).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return ChecksumStream[k4]; + } + }); + }); + Object.keys(createChecksumStream).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return createChecksumStream[k4]; + } + }); + }); + Object.keys(createBufferedReadable).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return createBufferedReadable[k4]; + } + }); + }); + Object.keys(getAwsChunkedEncodingStream).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return getAwsChunkedEncodingStream[k4]; + } + }); + }); + Object.keys(headStream).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return headStream[k4]; + } + }); + }); + Object.keys(sdkStreamMixin2).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return sdkStreamMixin2[k4]; + } + }); + }); + Object.keys(splitStream).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return splitStream[k4]; + } + }); + }); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js +var import_util_stream, collectBody; +var init_collect_stream_body = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js"() { + import_util_stream = __toESM(require_dist_cjs15()); + collectBody = async (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return import_util_stream.Uint8ArrayBlobAdapter.mutate(streamBody); + } + if (!streamBody) { + return import_util_stream.Uint8ArrayBlobAdapter.mutate(new Uint8Array()); + } + const fromContext = context.streamCollector(streamBody); + return import_util_stream.Uint8ArrayBlobAdapter.mutate(await fromContext); + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js +function extendedEncodeURIComponent(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function(c4) { + return "%" + c4.charCodeAt(0).toString(16).toUpperCase(); + }); +} +var init_extended_encode_uri_component = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js"() { + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/deref.js +var deref; +var init_deref = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/deref.js"() { + deref = (schemaRef) => { + if (typeof schemaRef === "function") { + return schemaRef(); + } + return schemaRef; + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/operation.js +var operation; +var init_operation = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/operation.js"() { + operation = (namespace, name, traits, input, output) => ({ + name, + namespace, + traits, + input, + output + }); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js +var import_protocol_http5, import_util_middleware3, schemaDeserializationMiddleware, findHeader; +var init_schemaDeserializationMiddleware = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js"() { + import_protocol_http5 = __toESM(require_dist_cjs2()); + import_util_middleware3 = __toESM(require_dist_cjs4()); + init_operation(); + schemaDeserializationMiddleware = (config) => (next, context) => async (args2) => { + const { response } = await next(args2); + const { operationSchema } = (0, import_util_middleware3.getSmithyContext)(context); + const [, ns, n4, t4, i4, o4] = operationSchema ?? []; + try { + const parsed = await config.protocol.deserializeResponse(operation(ns, n4, t4, i4, o4), { + ...config, + ...context + }, response); + return { + response, + output: parsed + }; + } catch (error2) { + Object.defineProperty(error2, "$response", { + value: response, + enumerable: false, + writable: false, + configurable: false + }); + if (!("$metadata" in error2)) { + const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; + try { + error2.message += "\n " + hint; + } catch (e4) { + if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") { + console.warn(hint); + } else { + context.logger?.warn?.(hint); + } + } + if (typeof error2.$responseBodyText !== "undefined") { + if (error2.$response) { + error2.$response.body = error2.$responseBodyText; + } + } + try { + if (import_protocol_http5.HttpResponse.isInstance(response)) { + const { headers = {} } = response; + const headerEntries = Object.entries(headers); + error2.$metadata = { + httpStatusCode: response.statusCode, + requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries), + extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries), + cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries) + }; + } + } catch (e4) { + } + } + throw error2; + } + }; + findHeader = (pattern, headers) => { + return (headers.find(([k4]) => { + return k4.match(pattern); + }) || [void 0, void 0])[1]; + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js +var import_util_middleware4, schemaSerializationMiddleware; +var init_schemaSerializationMiddleware = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js"() { + import_util_middleware4 = __toESM(require_dist_cjs4()); + init_operation(); + schemaSerializationMiddleware = (config) => (next, context) => async (args2) => { + const { operationSchema } = (0, import_util_middleware4.getSmithyContext)(context); + const [, ns, n4, t4, i4, o4] = operationSchema ?? []; + const endpoint = context.endpointV2?.url && config.urlParser ? async () => config.urlParser(context.endpointV2.url) : config.endpoint; + const request = await config.protocol.serializeRequest(operation(ns, n4, t4, i4, o4), args2.input, { + ...config, + ...context, + endpoint + }); + return next({ + ...args2, + request + }); + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/middleware/getSchemaSerdePlugin.js +function getSchemaSerdePlugin(config) { + return { + applyToStack: (commandStack) => { + commandStack.add(schemaSerializationMiddleware(config), serializerMiddlewareOption2); + commandStack.add(schemaDeserializationMiddleware(config), deserializerMiddlewareOption); + config.protocol.setSerdeContext(config); + } + }; +} +var deserializerMiddlewareOption, serializerMiddlewareOption2; +var init_getSchemaSerdePlugin = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/middleware/getSchemaSerdePlugin.js"() { + init_schemaDeserializationMiddleware(); + init_schemaSerializationMiddleware(); + deserializerMiddlewareOption = { + name: "deserializerMiddleware", + step: "deserialize", + tags: ["DESERIALIZER"], + override: true + }; + serializerMiddlewareOption2 = { + name: "serializerMiddleware", + step: "serialize", + tags: ["SERIALIZER"], + override: true + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js +var Schema; +var init_Schema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js"() { + Schema = class { + name; + namespace; + traits; + static assign(instance, values) { + const schema = Object.assign(instance, values); + return schema; + } + static [Symbol.hasInstance](lhs) { + const isPrototype = this.prototype.isPrototypeOf(lhs); + if (!isPrototype && typeof lhs === "object" && lhs !== null) { + const list2 = lhs; + return list2.symbol === this.symbol; + } + return isPrototype; + } + getName() { + return this.namespace + "#" + this.name; + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js +var ListSchema, list; +var init_ListSchema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js"() { + init_Schema(); + ListSchema = class _ListSchema extends Schema { + static symbol = /* @__PURE__ */ Symbol.for("@smithy/lis"); + name; + traits; + valueSchema; + symbol = _ListSchema.symbol; + }; + list = (namespace, name, traits, valueSchema) => Schema.assign(new ListSchema(), { + name, + namespace, + traits, + valueSchema + }); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js +var MapSchema, map; +var init_MapSchema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js"() { + init_Schema(); + MapSchema = class _MapSchema extends Schema { + static symbol = /* @__PURE__ */ Symbol.for("@smithy/map"); + name; + traits; + keySchema; + valueSchema; + symbol = _MapSchema.symbol; + }; + map = (namespace, name, traits, keySchema, valueSchema) => Schema.assign(new MapSchema(), { + name, + namespace, + traits, + keySchema, + valueSchema + }); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js +var OperationSchema, op; +var init_OperationSchema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js"() { + init_Schema(); + OperationSchema = class _OperationSchema extends Schema { + static symbol = /* @__PURE__ */ Symbol.for("@smithy/ope"); + name; + traits; + input; + output; + symbol = _OperationSchema.symbol; + }; + op = (namespace, name, traits, input, output) => Schema.assign(new OperationSchema(), { + name, + namespace, + traits, + input, + output + }); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js +var StructureSchema, struct; +var init_StructureSchema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js"() { + init_Schema(); + StructureSchema = class _StructureSchema extends Schema { + static symbol = /* @__PURE__ */ Symbol.for("@smithy/str"); + name; + traits; + memberNames; + memberList; + symbol = _StructureSchema.symbol; + }; + struct = (namespace, name, traits, memberNames, memberList) => Schema.assign(new StructureSchema(), { + name, + namespace, + traits, + memberNames, + memberList + }); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js +var ErrorSchema, error; +var init_ErrorSchema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js"() { + init_Schema(); + init_StructureSchema(); + ErrorSchema = class _ErrorSchema extends StructureSchema { + static symbol = /* @__PURE__ */ Symbol.for("@smithy/err"); + ctor; + symbol = _ErrorSchema.symbol; + }; + error = (namespace, name, traits, memberNames, memberList, ctor) => Schema.assign(new ErrorSchema(), { + name, + namespace, + traits, + memberNames, + memberList, + ctor: null + }); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js +function translateTraits(indicator) { + if (typeof indicator === "object") { + return indicator; + } + indicator = indicator | 0; + const traits = {}; + let i4 = 0; + for (const trait of [ + "httpLabel", + "idempotent", + "idempotencyToken", + "sensitive", + "httpPayload", + "httpResponseCode", + "httpQueryParams" + ]) { + if ((indicator >> i4++ & 1) === 1) { + traits[trait] = 1; + } + } + return traits; +} +var init_translateTraits = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js"() { + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +function member(memberSchema, memberName) { + if (memberSchema instanceof NormalizedSchema) { + return Object.assign(memberSchema, { + memberName, + _isMemberSchema: true + }); + } + const internalCtorAccess = NormalizedSchema; + return new internalCtorAccess(memberSchema, memberName); +} +var anno, NormalizedSchema, isMemberSchema, isStaticSchema; +var init_NormalizedSchema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js"() { + init_deref(); + init_translateTraits(); + anno = { + it: /* @__PURE__ */ Symbol.for("@smithy/nor-struct-it") + }; + NormalizedSchema = class _NormalizedSchema { + ref; + memberName; + static symbol = /* @__PURE__ */ Symbol.for("@smithy/nor"); + symbol = _NormalizedSchema.symbol; + name; + schema; + _isMemberSchema; + traits; + memberTraits; + normalizedTraits; + constructor(ref, memberName) { + this.ref = ref; + this.memberName = memberName; + const traitStack = []; + let _ref = ref; + let schema = ref; + this._isMemberSchema = false; + while (isMemberSchema(_ref)) { + traitStack.push(_ref[1]); + _ref = _ref[0]; + schema = deref(_ref); + this._isMemberSchema = true; + } + if (traitStack.length > 0) { + this.memberTraits = {}; + for (let i4 = traitStack.length - 1; i4 >= 0; --i4) { + const traitSet = traitStack[i4]; + Object.assign(this.memberTraits, translateTraits(traitSet)); + } + } else { + this.memberTraits = 0; + } + if (schema instanceof _NormalizedSchema) { + const computedMemberTraits = this.memberTraits; + Object.assign(this, schema); + this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits()); + this.normalizedTraits = void 0; + this.memberName = memberName ?? schema.memberName; + return; + } + this.schema = deref(schema); + if (isStaticSchema(this.schema)) { + this.name = `${this.schema[1]}#${this.schema[2]}`; + this.traits = this.schema[3]; + } else { + this.name = this.memberName ?? String(schema); + this.traits = 0; + } + if (this._isMemberSchema && !memberName) { + throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`); + } + } + static [Symbol.hasInstance](lhs) { + const isPrototype = this.prototype.isPrototypeOf(lhs); + if (!isPrototype && typeof lhs === "object" && lhs !== null) { + const ns = lhs; + return ns.symbol === this.symbol; + } + return isPrototype; + } + static of(ref) { + const sc = deref(ref); + if (sc instanceof _NormalizedSchema) { + return sc; + } + if (isMemberSchema(sc)) { + const [ns, traits] = sc; + if (ns instanceof _NormalizedSchema) { + Object.assign(ns.getMergedTraits(), translateTraits(traits)); + return ns; + } + throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`); + } + return new _NormalizedSchema(sc); + } + getSchema() { + const sc = this.schema; + if (Array.isArray(sc) && sc[0] === 0) { + return sc[4]; + } + return sc; + } + getName(withNamespace = false) { + const { name } = this; + const short = !withNamespace && name && name.includes("#"); + return short ? name.split("#")[1] : name || void 0; + } + getMemberName() { + return this.memberName; + } + isMemberSchema() { + return this._isMemberSchema; + } + isListSchema() { + const sc = this.getSchema(); + return typeof sc === "number" ? sc >= 64 && sc < 128 : sc[0] === 1; + } + isMapSchema() { + const sc = this.getSchema(); + return typeof sc === "number" ? sc >= 128 && sc <= 255 : sc[0] === 2; + } + isStructSchema() { + const sc = this.getSchema(); + if (typeof sc !== "object") { + return false; + } + const id = sc[0]; + return id === 3 || id === -3 || id === 4; + } + isUnionSchema() { + const sc = this.getSchema(); + if (typeof sc !== "object") { + return false; + } + return sc[0] === 4; + } + isBlobSchema() { + const sc = this.getSchema(); + return sc === 21 || sc === 42; + } + isTimestampSchema() { + const sc = this.getSchema(); + return typeof sc === "number" && sc >= 4 && sc <= 7; + } + isUnitSchema() { + return this.getSchema() === "unit"; + } + isDocumentSchema() { + return this.getSchema() === 15; + } + isStringSchema() { + return this.getSchema() === 0; + } + isBooleanSchema() { + return this.getSchema() === 2; + } + isNumericSchema() { + return this.getSchema() === 1; + } + isBigIntegerSchema() { + return this.getSchema() === 17; + } + isBigDecimalSchema() { + return this.getSchema() === 19; + } + isStreaming() { + const { streaming } = this.getMergedTraits(); + return !!streaming || this.getSchema() === 42; + } + isIdempotencyToken() { + return !!this.getMergedTraits().idempotencyToken; + } + getMergedTraits() { + return this.normalizedTraits ?? (this.normalizedTraits = { + ...this.getOwnTraits(), + ...this.getMemberTraits() + }); + } + getMemberTraits() { + return translateTraits(this.memberTraits); + } + getOwnTraits() { + return translateTraits(this.traits); + } + getKeySchema() { + const [isDoc, isMap] = [this.isDocumentSchema(), this.isMapSchema()]; + if (!isDoc && !isMap) { + throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`); + } + const schema = this.getSchema(); + const memberSchema = isDoc ? 15 : schema[4] ?? 0; + return member([memberSchema, 0], "key"); + } + getValueSchema() { + const sc = this.getSchema(); + const [isDoc, isMap, isList] = [this.isDocumentSchema(), this.isMapSchema(), this.isListSchema()]; + const memberSchema = typeof sc === "number" ? 63 & sc : sc && typeof sc === "object" && (isMap || isList) ? sc[3 + sc[0]] : isDoc ? 15 : void 0; + if (memberSchema != null) { + return member([memberSchema, 0], isMap ? "value" : "member"); + } + throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`); + } + getMemberSchema(memberName) { + const struct2 = this.getSchema(); + if (this.isStructSchema() && struct2[4].includes(memberName)) { + const i4 = struct2[4].indexOf(memberName); + const memberSchema = struct2[5][i4]; + return member(isMemberSchema(memberSchema) ? memberSchema : [memberSchema, 0], memberName); + } + if (this.isDocumentSchema()) { + return member([15, 0], memberName); + } + throw new Error(`@smithy/core/schema - ${this.getName(true)} has no no member=${memberName}.`); + } + getMemberSchemas() { + const buffer = {}; + try { + for (const [k4, v4] of this.structIterator()) { + buffer[k4] = v4; + } + } catch (ignored) { + } + return buffer; + } + getEventStreamMember() { + if (this.isStructSchema()) { + for (const [memberName, memberSchema] of this.structIterator()) { + if (memberSchema.isStreaming() && memberSchema.isStructSchema()) { + return memberName; + } + } + } + return ""; + } + *structIterator() { + if (this.isUnitSchema()) { + return; + } + if (!this.isStructSchema()) { + throw new Error("@smithy/core/schema - cannot iterate non-struct schema."); + } + const struct2 = this.getSchema(); + const z2 = struct2[4].length; + let it = struct2[anno.it]; + if (it && z2 === it.length) { + yield* it; + return; + } + it = Array(z2); + for (let i4 = 0; i4 < z2; ++i4) { + const k4 = struct2[4][i4]; + const v4 = member([struct2[5][i4], 0], k4); + yield it[i4] = [k4, v4]; + } + struct2[anno.it] = it; + } + }; + isMemberSchema = (sc) => Array.isArray(sc) && sc.length === 2; + isStaticSchema = (sc) => Array.isArray(sc) && sc.length >= 5; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js +var SimpleSchema, sim, simAdapter; +var init_SimpleSchema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js"() { + init_Schema(); + SimpleSchema = class _SimpleSchema extends Schema { + static symbol = /* @__PURE__ */ Symbol.for("@smithy/sim"); + name; + schemaRef; + traits; + symbol = _SimpleSchema.symbol; + }; + sim = (namespace, name, schemaRef, traits) => Schema.assign(new SimpleSchema(), { + name, + namespace, + traits, + schemaRef + }); + simAdapter = (namespace, name, traits, schemaRef) => Schema.assign(new SimpleSchema(), { + name, + namespace, + traits, + schemaRef + }); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js +var SCHEMA; +var init_sentinels = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js"() { + SCHEMA = { + BLOB: 21, + STREAMING_BLOB: 42, + BOOLEAN: 2, + STRING: 0, + NUMERIC: 1, + BIG_INTEGER: 17, + BIG_DECIMAL: 19, + DOCUMENT: 15, + TIMESTAMP_DEFAULT: 4, + TIMESTAMP_DATE_TIME: 5, + TIMESTAMP_HTTP_DATE: 6, + TIMESTAMP_EPOCH_SECONDS: 7, + LIST_MODIFIER: 64, + MAP_MODIFIER: 128 + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +var TypeRegistry; +var init_TypeRegistry = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js"() { + TypeRegistry = class _TypeRegistry { + namespace; + schemas; + exceptions; + static registries = /* @__PURE__ */ new Map(); + constructor(namespace, schemas = /* @__PURE__ */ new Map(), exceptions = /* @__PURE__ */ new Map()) { + this.namespace = namespace; + this.schemas = schemas; + this.exceptions = exceptions; + } + static for(namespace) { + if (!_TypeRegistry.registries.has(namespace)) { + _TypeRegistry.registries.set(namespace, new _TypeRegistry(namespace)); + } + return _TypeRegistry.registries.get(namespace); + } + copyFrom(other) { + const { schemas, exceptions } = this; + for (const [k4, v4] of other.schemas) { + if (!schemas.has(k4)) { + schemas.set(k4, v4); + } + } + for (const [k4, v4] of other.exceptions) { + if (!exceptions.has(k4)) { + exceptions.set(k4, v4); + } + } + } + register(shapeId, schema) { + const qualifiedName = this.normalizeShapeId(shapeId); + for (const r4 of [this, _TypeRegistry.for(qualifiedName.split("#")[0])]) { + r4.schemas.set(qualifiedName, schema); + } + } + getSchema(shapeId) { + const id = this.normalizeShapeId(shapeId); + if (!this.schemas.has(id)) { + throw new Error(`@smithy/core/schema - schema not found for ${id}`); + } + return this.schemas.get(id); + } + registerError(es, ctor) { + const $error = es; + const ns = $error[1]; + for (const r4 of [this, _TypeRegistry.for(ns)]) { + r4.schemas.set(ns + "#" + $error[2], $error); + r4.exceptions.set($error, ctor); + } + } + getErrorCtor(es) { + const $error = es; + if (this.exceptions.has($error)) { + return this.exceptions.get($error); + } + const registry = _TypeRegistry.for($error[1]); + return registry.exceptions.get($error); + } + getBaseException() { + for (const exceptionKey of this.exceptions.keys()) { + if (Array.isArray(exceptionKey)) { + const [, ns, name] = exceptionKey; + const id = ns + "#" + name; + if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) { + return exceptionKey; + } + } + } + return void 0; + } + find(predicate) { + return [...this.schemas.values()].find(predicate); + } + clear() { + this.schemas.clear(); + this.exceptions.clear(); + } + normalizeShapeId(shapeId) { + if (shapeId.includes("#")) { + return shapeId; + } + return this.namespace + "#" + shapeId; + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/schema/index.js +var schema_exports = {}; +__export(schema_exports, { + ErrorSchema: () => ErrorSchema, + ListSchema: () => ListSchema, + MapSchema: () => MapSchema, + NormalizedSchema: () => NormalizedSchema, + OperationSchema: () => OperationSchema, + SCHEMA: () => SCHEMA, + Schema: () => Schema, + SimpleSchema: () => SimpleSchema, + StructureSchema: () => StructureSchema, + TypeRegistry: () => TypeRegistry, + deref: () => deref, + deserializerMiddlewareOption: () => deserializerMiddlewareOption, + error: () => error, + getSchemaSerdePlugin: () => getSchemaSerdePlugin, + isStaticSchema: () => isStaticSchema, + list: () => list, + map: () => map, + op: () => op, + operation: () => operation, + serializerMiddlewareOption: () => serializerMiddlewareOption2, + sim: () => sim, + simAdapter: () => simAdapter, + struct: () => struct, + translateTraits: () => translateTraits +}); +var init_schema = __esm({ + "node_modules/@smithy/core/dist-es/submodules/schema/index.js"() { + init_deref(); + init_getSchemaSerdePlugin(); + init_ListSchema(); + init_MapSchema(); + init_OperationSchema(); + init_operation(); + init_ErrorSchema(); + init_NormalizedSchema(); + init_Schema(); + init_SimpleSchema(); + init_StructureSchema(); + init_sentinels(); + init_translateTraits(); + init_TypeRegistry(); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js +var copyDocumentWithTransform; +var init_copyDocumentWithTransform = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js"() { + copyDocumentWithTransform = (source, schemaRef, transform = (_) => _) => source; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +var parseBoolean, expectBoolean, expectNumber, MAX_FLOAT, expectFloat32, expectLong, expectInt, expectInt32, expectShort, expectByte, expectSizedInt, castInt, expectNonNull, expectObject, expectString, expectUnion, strictParseDouble, strictParseFloat, strictParseFloat32, NUMBER_REGEX, parseNumber, limitedParseDouble, handleFloat, limitedParseFloat, limitedParseFloat32, parseFloatString, strictParseLong, strictParseInt, strictParseInt32, strictParseShort, strictParseByte, stackTraceWarning, logger; +var init_parse_utils = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js"() { + parseBoolean = (value) => { + switch (value) { + case "true": + return true; + case "false": + return false; + default: + throw new Error(`Unable to parse boolean value "${value}"`); + } + }; + expectBoolean = (value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value === "number") { + if (value === 0 || value === 1) { + logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); + } + if (value === 0) { + return false; + } + if (value === 1) { + return true; + } + } + if (typeof value === "string") { + const lower = value.toLowerCase(); + if (lower === "false" || lower === "true") { + logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); + } + if (lower === "false") { + return false; + } + if (lower === "true") { + return true; + } + } + if (typeof value === "boolean") { + return value; + } + throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`); + }; + expectNumber = (value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value === "string") { + const parsed = parseFloat(value); + if (!Number.isNaN(parsed)) { + if (String(parsed) !== String(value)) { + logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`)); + } + return parsed; + } + } + if (typeof value === "number") { + return value; + } + throw new TypeError(`Expected number, got ${typeof value}: ${value}`); + }; + MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); + expectFloat32 = (value) => { + const expected = expectNumber(value); + if (expected !== void 0 && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { + if (Math.abs(expected) > MAX_FLOAT) { + throw new TypeError(`Expected 32-bit float, got ${value}`); + } + } + return expected; + }; + expectLong = (value) => { + if (value === null || value === void 0) { + return void 0; + } + if (Number.isInteger(value) && !Number.isNaN(value)) { + return value; + } + throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); + }; + expectInt = expectLong; + expectInt32 = (value) => expectSizedInt(value, 32); + expectShort = (value) => expectSizedInt(value, 16); + expectByte = (value) => expectSizedInt(value, 8); + expectSizedInt = (value, size) => { + const expected = expectLong(value); + if (expected !== void 0 && castInt(expected, size) !== expected) { + throw new TypeError(`Expected ${size}-bit integer, got ${value}`); + } + return expected; + }; + castInt = (value, size) => { + switch (size) { + case 32: + return Int32Array.of(value)[0]; + case 16: + return Int16Array.of(value)[0]; + case 8: + return Int8Array.of(value)[0]; + } + }; + expectNonNull = (value, location) => { + if (value === null || value === void 0) { + if (location) { + throw new TypeError(`Expected a non-null value for ${location}`); + } + throw new TypeError("Expected a non-null value"); + } + return value; + }; + expectObject = (value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value === "object" && !Array.isArray(value)) { + return value; + } + const receivedType = Array.isArray(value) ? "array" : typeof value; + throw new TypeError(`Expected object, got ${receivedType}: ${value}`); + }; + expectString = (value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value === "string") { + return value; + } + if (["boolean", "number", "bigint"].includes(typeof value)) { + logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`)); + return String(value); + } + throw new TypeError(`Expected string, got ${typeof value}: ${value}`); + }; + expectUnion = (value) => { + if (value === null || value === void 0) { + return void 0; + } + const asObject = expectObject(value); + const setKeys = Object.entries(asObject).filter(([, v4]) => v4 != null).map(([k4]) => k4); + if (setKeys.length === 0) { + throw new TypeError(`Unions must have exactly one non-null member. None were found.`); + } + if (setKeys.length > 1) { + throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`); + } + return asObject; + }; + strictParseDouble = (value) => { + if (typeof value == "string") { + return expectNumber(parseNumber(value)); + } + return expectNumber(value); + }; + strictParseFloat = strictParseDouble; + strictParseFloat32 = (value) => { + if (typeof value == "string") { + return expectFloat32(parseNumber(value)); + } + return expectFloat32(value); + }; + NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; + parseNumber = (value) => { + const matches = value.match(NUMBER_REGEX); + if (matches === null || matches[0].length !== value.length) { + throw new TypeError(`Expected real number, got implicit NaN`); + } + return parseFloat(value); + }; + limitedParseDouble = (value) => { + if (typeof value == "string") { + return parseFloatString(value); + } + return expectNumber(value); + }; + handleFloat = limitedParseDouble; + limitedParseFloat = limitedParseDouble; + limitedParseFloat32 = (value) => { + if (typeof value == "string") { + return parseFloatString(value); + } + return expectFloat32(value); + }; + parseFloatString = (value) => { + switch (value) { + case "NaN": + return NaN; + case "Infinity": + return Infinity; + case "-Infinity": + return -Infinity; + default: + throw new Error(`Unable to parse float value: ${value}`); + } + }; + strictParseLong = (value) => { + if (typeof value === "string") { + return expectLong(parseNumber(value)); + } + return expectLong(value); + }; + strictParseInt = strictParseLong; + strictParseInt32 = (value) => { + if (typeof value === "string") { + return expectInt32(parseNumber(value)); + } + return expectInt32(value); + }; + strictParseShort = (value) => { + if (typeof value === "string") { + return expectShort(parseNumber(value)); + } + return expectShort(value); + }; + strictParseByte = (value) => { + if (typeof value === "string") { + return expectByte(parseNumber(value)); + } + return expectByte(value); + }; + stackTraceWarning = (message2) => { + return String(new TypeError(message2).stack || message2).split("\n").slice(0, 5).filter((s4) => !s4.includes("stackTraceWarning")).join("\n"); + }; + logger = { + warn: console.warn + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/serde/date-utils.js +function dateToUtcString(date2) { + const year2 = date2.getUTCFullYear(); + const month = date2.getUTCMonth(); + const dayOfWeek = date2.getUTCDay(); + const dayOfMonthInt = date2.getUTCDate(); + const hoursInt = date2.getUTCHours(); + const minutesInt = date2.getUTCMinutes(); + const secondsInt = date2.getUTCSeconds(); + const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`; + const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`; + const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`; + const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`; + return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year2} ${hoursString}:${minutesString}:${secondsString} GMT`; +} +var DAYS, MONTHS, RFC3339, parseRfc3339DateTime, RFC3339_WITH_OFFSET, parseRfc3339DateTimeWithOffset, IMF_FIXDATE, RFC_850_DATE, ASC_TIME, parseRfc7231DateTime, parseEpochTimestamp, buildDate, parseTwoDigitYear, FIFTY_YEARS_IN_MILLIS, adjustRfc850Year, parseMonthByShortName, DAYS_IN_MONTH, validateDayOfMonth, isLeapYear, parseDateValue, parseMilliseconds, parseOffsetToMilliseconds, stripLeadingZeroes; +var init_date_utils = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/date-utils.js"() { + init_parse_utils(); + DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; + MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); + parseRfc3339DateTime = (value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value !== "string") { + throw new TypeError("RFC-3339 date-times must be expressed as strings"); + } + const match = RFC3339.exec(value); + if (!match) { + throw new TypeError("Invalid RFC-3339 date-time value"); + } + const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match; + const year2 = strictParseShort(stripLeadingZeroes(yearStr)); + const month = parseDateValue(monthStr, "month", 1, 12); + const day = parseDateValue(dayStr, "day", 1, 31); + return buildDate(year2, month, day, { hours, minutes, seconds, fractionalMilliseconds }); + }; + RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/); + parseRfc3339DateTimeWithOffset = (value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value !== "string") { + throw new TypeError("RFC-3339 date-times must be expressed as strings"); + } + const match = RFC3339_WITH_OFFSET.exec(value); + if (!match) { + throw new TypeError("Invalid RFC-3339 date-time value"); + } + const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match; + const year2 = strictParseShort(stripLeadingZeroes(yearStr)); + const month = parseDateValue(monthStr, "month", 1, 12); + const day = parseDateValue(dayStr, "day", 1, 31); + const date2 = buildDate(year2, month, day, { hours, minutes, seconds, fractionalMilliseconds }); + if (offsetStr.toUpperCase() != "Z") { + date2.setTime(date2.getTime() - parseOffsetToMilliseconds(offsetStr)); + } + return date2; + }; + IMF_FIXDATE = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); + RFC_850_DATE = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); + ASC_TIME = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/); + parseRfc7231DateTime = (value) => { + if (value === null || value === void 0) { + return void 0; + } + if (typeof value !== "string") { + throw new TypeError("RFC-7231 date-times must be expressed as strings"); + } + let match = IMF_FIXDATE.exec(value); + if (match) { + const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; + return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); + } + match = RFC_850_DATE.exec(value); + if (match) { + const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; + return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { + hours, + minutes, + seconds, + fractionalMilliseconds + })); + } + match = ASC_TIME.exec(value); + if (match) { + const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match; + return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); + } + throw new TypeError("Invalid RFC-7231 date-time value"); + }; + parseEpochTimestamp = (value) => { + if (value === null || value === void 0) { + return void 0; + } + let valueAsDouble; + if (typeof value === "number") { + valueAsDouble = value; + } else if (typeof value === "string") { + valueAsDouble = strictParseDouble(value); + } else if (typeof value === "object" && value.tag === 1) { + valueAsDouble = value.value; + } else { + throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation"); + } + if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) { + throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics"); + } + return new Date(Math.round(valueAsDouble * 1e3)); + }; + buildDate = (year2, month, day, time2) => { + const adjustedMonth = month - 1; + validateDayOfMonth(year2, adjustedMonth, day); + return new Date(Date.UTC(year2, adjustedMonth, day, parseDateValue(time2.hours, "hour", 0, 23), parseDateValue(time2.minutes, "minute", 0, 59), parseDateValue(time2.seconds, "seconds", 0, 60), parseMilliseconds(time2.fractionalMilliseconds))); + }; + parseTwoDigitYear = (value) => { + const thisYear = (/* @__PURE__ */ new Date()).getUTCFullYear(); + const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value)); + if (valueInThisCentury < thisYear) { + return valueInThisCentury + 100; + } + return valueInThisCentury; + }; + FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1e3; + adjustRfc850Year = (input) => { + if (input.getTime() - (/* @__PURE__ */ new Date()).getTime() > FIFTY_YEARS_IN_MILLIS) { + return new Date(Date.UTC(input.getUTCFullYear() - 100, input.getUTCMonth(), input.getUTCDate(), input.getUTCHours(), input.getUTCMinutes(), input.getUTCSeconds(), input.getUTCMilliseconds())); + } + return input; + }; + parseMonthByShortName = (value) => { + const monthIdx = MONTHS.indexOf(value); + if (monthIdx < 0) { + throw new TypeError(`Invalid month: ${value}`); + } + return monthIdx + 1; + }; + DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + validateDayOfMonth = (year2, month, day) => { + let maxDays = DAYS_IN_MONTH[month]; + if (month === 1 && isLeapYear(year2)) { + maxDays = 29; + } + if (day > maxDays) { + throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year2}: ${day}`); + } + }; + isLeapYear = (year2) => { + return year2 % 4 === 0 && (year2 % 100 !== 0 || year2 % 400 === 0); + }; + parseDateValue = (value, type, lower, upper) => { + const dateVal = strictParseByte(stripLeadingZeroes(value)); + if (dateVal < lower || dateVal > upper) { + throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`); + } + return dateVal; + }; + parseMilliseconds = (value) => { + if (value === null || value === void 0) { + return 0; + } + return strictParseFloat32("0." + value) * 1e3; + }; + parseOffsetToMilliseconds = (value) => { + const directionStr = value[0]; + let direction = 1; + if (directionStr == "+") { + direction = 1; + } else if (directionStr == "-") { + direction = -1; + } else { + throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`); + } + const hour = Number(value.substring(1, 3)); + const minute = Number(value.substring(4, 6)); + return direction * (hour * 60 + minute) * 60 * 1e3; + }; + stripLeadingZeroes = (value) => { + let idx = 0; + while (idx < value.length - 1 && value.charAt(idx) === "0") { + idx++; + } + if (idx === 0) { + return value; + } + return value.slice(idx); + }; + } +}); + +// node_modules/tslib/tslib.es6.mjs +var tslib_es6_exports = {}; +__export(tslib_es6_exports, { + __addDisposableResource: () => __addDisposableResource, + __assign: () => __assign, + __asyncDelegator: () => __asyncDelegator, + __asyncGenerator: () => __asyncGenerator, + __asyncValues: () => __asyncValues, + __await: () => __await, + __awaiter: () => __awaiter, + __classPrivateFieldGet: () => __classPrivateFieldGet, + __classPrivateFieldIn: () => __classPrivateFieldIn, + __classPrivateFieldSet: () => __classPrivateFieldSet, + __createBinding: () => __createBinding, + __decorate: () => __decorate, + __disposeResources: () => __disposeResources, + __esDecorate: () => __esDecorate, + __exportStar: () => __exportStar, + __extends: () => __extends, + __generator: () => __generator, + __importDefault: () => __importDefault, + __importStar: () => __importStar, + __makeTemplateObject: () => __makeTemplateObject, + __metadata: () => __metadata, + __param: () => __param, + __propKey: () => __propKey, + __read: () => __read, + __rest: () => __rest, + __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension, + __runInitializers: () => __runInitializers, + __setFunctionName: () => __setFunctionName, + __spread: () => __spread, + __spreadArray: () => __spreadArray, + __spreadArrays: () => __spreadArrays, + __values: () => __values, + default: () => tslib_es6_default +}); +function __extends(d4, b4) { + if (typeof b4 !== "function" && b4 !== null) + throw new TypeError("Class extends value " + String(b4) + " is not a constructor or null"); + extendStatics(d4, b4); + function __() { + this.constructor = d4; + } + d4.prototype = b4 === null ? Object.create(b4) : (__.prototype = b4.prototype, new __()); +} +function __rest(s4, e4) { + var t4 = {}; + for (var p4 in s4) if (Object.prototype.hasOwnProperty.call(s4, p4) && e4.indexOf(p4) < 0) + t4[p4] = s4[p4]; + if (s4 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i4 = 0, p4 = Object.getOwnPropertySymbols(s4); i4 < p4.length; i4++) { + if (e4.indexOf(p4[i4]) < 0 && Object.prototype.propertyIsEnumerable.call(s4, p4[i4])) + t4[p4[i4]] = s4[p4[i4]]; + } + return t4; +} +function __decorate(decorators, target, key, desc) { + var c4 = arguments.length, r4 = c4 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d4; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r4 = Reflect.decorate(decorators, target, key, desc); + else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d4 = decorators[i4]) r4 = (c4 < 3 ? d4(r4) : c4 > 3 ? d4(target, key, r4) : d4(target, key)) || r4; + return c4 > 3 && r4 && Object.defineProperty(target, key, r4), r4; +} +function __param(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +} +function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f4) { + if (f4 !== void 0 && typeof f4 !== "function") throw new TypeError("Function expected"); + return f4; + } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i4 = decorators.length - 1; i4 >= 0; i4--) { + var context = {}; + for (var p4 in contextIn) context[p4] = p4 === "access" ? {} : contextIn[p4]; + for (var p4 in contextIn.access) context.access[p4] = contextIn.access[p4]; + context.addInitializer = function(f4) { + if (done) throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f4 || null)); + }; + var result = (0, decorators[i4])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +} +function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i4 = 0; i4 < initializers.length; i4++) { + value = useValue ? initializers[i4].call(thisArg, value) : initializers[i4].call(thisArg); + } + return useValue ? value : void 0; +} +function __propKey(x4) { + return typeof x4 === "symbol" ? x4 : "".concat(x4); +} +function __setFunctionName(f4, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f4, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +} +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e4) { + reject(e4); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e4) { + reject(e4); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { + if (t4[0] & 1) throw t4[1]; + return t4[1]; + }, trys: [], ops: [] }, f4, y2, t4, g4 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g4.next = verb(0), g4["throw"] = verb(1), g4["return"] = verb(2), typeof Symbol === "function" && (g4[Symbol.iterator] = function() { + return this; + }), g4; + function verb(n4) { + return function(v4) { + return step([n4, v4]); + }; + } + function step(op2) { + if (f4) throw new TypeError("Generator is already executing."); + while (g4 && (g4 = 0, op2[0] && (_ = 0)), _) try { + if (f4 = 1, y2 && (t4 = op2[0] & 2 ? y2["return"] : op2[0] ? y2["throw"] || ((t4 = y2["return"]) && t4.call(y2), 0) : y2.next) && !(t4 = t4.call(y2, op2[1])).done) return t4; + if (y2 = 0, t4) op2 = [op2[0] & 2, t4.value]; + switch (op2[0]) { + case 0: + case 1: + t4 = op2; + break; + case 4: + _.label++; + return { value: op2[1], done: false }; + case 5: + _.label++; + y2 = op2[1]; + op2 = [0]; + continue; + case 7: + op2 = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t4 = _.trys, t4 = t4.length > 0 && t4[t4.length - 1]) && (op2[0] === 6 || op2[0] === 2)) { + _ = 0; + continue; + } + if (op2[0] === 3 && (!t4 || op2[1] > t4[0] && op2[1] < t4[3])) { + _.label = op2[1]; + break; + } + if (op2[0] === 6 && _.label < t4[1]) { + _.label = t4[1]; + t4 = op2; + break; + } + if (t4 && _.label < t4[2]) { + _.label = t4[2]; + _.ops.push(op2); + break; + } + if (t4[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op2 = body.call(thisArg, _); + } catch (e4) { + op2 = [6, e4]; + y2 = 0; + } finally { + f4 = t4 = 0; + } + if (op2[0] & 5) throw op2[1]; + return { value: op2[0] ? op2[1] : void 0, done: true }; + } +} +function __exportStar(m4, o4) { + for (var p4 in m4) if (p4 !== "default" && !Object.prototype.hasOwnProperty.call(o4, p4)) __createBinding(o4, m4, p4); +} +function __values(o4) { + var s4 = typeof Symbol === "function" && Symbol.iterator, m4 = s4 && o4[s4], i4 = 0; + if (m4) return m4.call(o4); + if (o4 && typeof o4.length === "number") return { + next: function() { + if (o4 && i4 >= o4.length) o4 = void 0; + return { value: o4 && o4[i4++], done: !o4 }; + } + }; + throw new TypeError(s4 ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read(o4, n4) { + var m4 = typeof Symbol === "function" && o4[Symbol.iterator]; + if (!m4) return o4; + var i4 = m4.call(o4), r4, ar = [], e4; + try { + while ((n4 === void 0 || n4-- > 0) && !(r4 = i4.next()).done) ar.push(r4.value); + } catch (error2) { + e4 = { error: error2 }; + } finally { + try { + if (r4 && !r4.done && (m4 = i4["return"])) m4.call(i4); + } finally { + if (e4) throw e4.error; + } + } + return ar; +} +function __spread() { + for (var ar = [], i4 = 0; i4 < arguments.length; i4++) + ar = ar.concat(__read(arguments[i4])); + return ar; +} +function __spreadArrays() { + for (var s4 = 0, i4 = 0, il = arguments.length; i4 < il; i4++) s4 += arguments[i4].length; + for (var r4 = Array(s4), k4 = 0, i4 = 0; i4 < il; i4++) + for (var a4 = arguments[i4], j4 = 0, jl = a4.length; j4 < jl; j4++, k4++) + r4[k4] = a4[j4]; + return r4; +} +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i4 = 0, l4 = from.length, ar; i4 < l4; i4++) { + if (ar || !(i4 in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i4); + ar[i4] = from[i4]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function __await(v4) { + return this instanceof __await ? (this.v = v4, this) : new __await(v4); +} +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g4 = generator.apply(thisArg, _arguments || []), i4, q4 = []; + return i4 = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i4[Symbol.asyncIterator] = function() { + return this; + }, i4; + function awaitReturn(f4) { + return function(v4) { + return Promise.resolve(v4).then(f4, reject); + }; + } + function verb(n4, f4) { + if (g4[n4]) { + i4[n4] = function(v4) { + return new Promise(function(a4, b4) { + q4.push([n4, v4, a4, b4]) > 1 || resume(n4, v4); + }); + }; + if (f4) i4[n4] = f4(i4[n4]); + } + } + function resume(n4, v4) { + try { + step(g4[n4](v4)); + } catch (e4) { + settle(q4[0][3], e4); + } + } + function step(r4) { + r4.value instanceof __await ? Promise.resolve(r4.value.v).then(fulfill, reject) : settle(q4[0][2], r4); + } + function fulfill(value) { + resume("next", value); + } + function reject(value) { + resume("throw", value); + } + function settle(f4, v4) { + if (f4(v4), q4.shift(), q4.length) resume(q4[0][0], q4[0][1]); + } +} +function __asyncDelegator(o4) { + var i4, p4; + return i4 = {}, verb("next"), verb("throw", function(e4) { + throw e4; + }), verb("return"), i4[Symbol.iterator] = function() { + return this; + }, i4; + function verb(n4, f4) { + i4[n4] = o4[n4] ? function(v4) { + return (p4 = !p4) ? { value: __await(o4[n4](v4)), done: false } : f4 ? f4(v4) : v4; + } : f4; + } +} +function __asyncValues(o4) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m4 = o4[Symbol.asyncIterator], i4; + return m4 ? m4.call(o4) : (o4 = typeof __values === "function" ? __values(o4) : o4[Symbol.iterator](), i4 = {}, verb("next"), verb("throw"), verb("return"), i4[Symbol.asyncIterator] = function() { + return this; + }, i4); + function verb(n4) { + i4[n4] = o4[n4] && function(v4) { + return new Promise(function(resolve, reject) { + v4 = o4[n4](v4), settle(resolve, reject, v4.done, v4.value); + }); + }; + } + function settle(resolve, reject, d4, v4) { + Promise.resolve(v4).then(function(v5) { + resolve({ value: v5, done: d4 }); + }, reject); + } +} +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; + } + return cooked; +} +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k4 = ownKeys(mod), i4 = 0; i4 < k4.length; i4++) if (k4[i4] !== "default") __createBinding(result, mod, k4[i4]); + } + __setModuleDefault(result, mod); + return result; +} +function __importDefault(mod) { + return mod && mod.__esModule ? mod : { default: mod }; +} +function __classPrivateFieldGet(receiver, state2, kind, f4) { + if (kind === "a" && !f4) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state2 === "function" ? receiver !== state2 || !f4 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f4 : kind === "a" ? f4.call(receiver) : f4 ? f4.value : state2.get(receiver); +} +function __classPrivateFieldSet(receiver, state2, value, kind, f4) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f4) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state2 === "function" ? receiver !== state2 || !f4 : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f4.call(receiver, value) : f4 ? f4.value = value : state2.set(receiver, value), value; +} +function __classPrivateFieldIn(state2, receiver) { + if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state2 === "function" ? receiver === state2 : state2.has(receiver); +} +function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { + try { + inner.call(this); + } catch (e4) { + return Promise.reject(e4); + } + }; + env.stack.push({ value, dispose, async }); + } else if (async) { + env.stack.push({ async: true }); + } + return value; +} +function __disposeResources(env) { + function fail(e4) { + env.error = env.hasError ? new _SuppressedError(e4, env.error, "An error was suppressed during disposal.") : e4; + env.hasError = true; + } + var r4, s4 = 0; + function next() { + while (r4 = env.stack.pop()) { + try { + if (!r4.async && s4 === 1) return s4 = 0, env.stack.push(r4), Promise.resolve().then(next); + if (r4.dispose) { + var result = r4.dispose.call(r4.value); + if (r4.async) return s4 |= 2, Promise.resolve(result).then(next, function(e4) { + fail(e4); + return next(); + }); + } else s4 |= 1; + } catch (e4) { + fail(e4); + } + } + if (s4 === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} +function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m4, tsx, d4, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d4 && (!ext || !cm) ? m4 : d4 + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path; +} +var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; +var init_tslib_es6 = __esm({ + "node_modules/tslib/tslib.es6.mjs"() { + extendStatics = function(d4, b4) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b5) { + d5.__proto__ = b5; + } || function(d5, b5) { + for (var p4 in b5) if (Object.prototype.hasOwnProperty.call(b5, p4)) d5[p4] = b5[p4]; + }; + return extendStatics(d4, b4); + }; + __assign = function() { + __assign = Object.assign || function __assign2(t4) { + for (var s4, i4 = 1, n4 = arguments.length; i4 < n4; i4++) { + s4 = arguments[i4]; + for (var p4 in s4) if (Object.prototype.hasOwnProperty.call(s4, p4)) t4[p4] = s4[p4]; + } + return t4; + }; + return __assign.apply(this, arguments); + }; + __createBinding = Object.create ? (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + var desc = Object.getOwnPropertyDescriptor(m4, k4); + if (!desc || ("get" in desc ? !m4.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m4[k4]; + } }; + } + Object.defineProperty(o4, k22, desc); + }) : (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + o4[k22] = m4[k4]; + }); + __setModuleDefault = Object.create ? (function(o4, v4) { + Object.defineProperty(o4, "default", { enumerable: true, value: v4 }); + }) : function(o4, v4) { + o4["default"] = v4; + }; + ownKeys = function(o4) { + ownKeys = Object.getOwnPropertyNames || function(o5) { + var ar = []; + for (var k4 in o5) if (Object.prototype.hasOwnProperty.call(o5, k4)) ar[ar.length] = k4; + return ar; + }; + return ownKeys(o4); + }; + _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message2) { + var e4 = new Error(message2); + return e4.name = "SuppressedError", e4.error = error2, e4.suppressed = suppressed, e4; + }; + tslib_es6_default = { + __extends, + __assign, + __rest, + __decorate, + __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, + __metadata, + __awaiter, + __generator, + __createBinding, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, + __rewriteRelativeImportExtension + }; + } +}); + +// node_modules/@smithy/uuid/dist-cjs/randomUUID.js +var require_randomUUID = __commonJS({ + "node_modules/@smithy/uuid/dist-cjs/randomUUID.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.randomUUID = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var crypto_1 = tslib_1.__importDefault(require("crypto")); + exports2.randomUUID = crypto_1.default.randomUUID.bind(crypto_1.default); + } +}); + +// node_modules/@smithy/uuid/dist-cjs/index.js +var require_dist_cjs16 = __commonJS({ + "node_modules/@smithy/uuid/dist-cjs/index.js"(exports2) { + "use strict"; + var randomUUID = require_randomUUID(); + var decimalToHex = Array.from({ length: 256 }, (_, i4) => i4.toString(16).padStart(2, "0")); + var v4 = () => { + if (randomUUID.randomUUID) { + return randomUUID.randomUUID(); + } + const rnds = new Uint8Array(16); + crypto.getRandomValues(rnds); + rnds[6] = rnds[6] & 15 | 64; + rnds[8] = rnds[8] & 63 | 128; + return decimalToHex[rnds[0]] + decimalToHex[rnds[1]] + decimalToHex[rnds[2]] + decimalToHex[rnds[3]] + "-" + decimalToHex[rnds[4]] + decimalToHex[rnds[5]] + "-" + decimalToHex[rnds[6]] + decimalToHex[rnds[7]] + "-" + decimalToHex[rnds[8]] + decimalToHex[rnds[9]] + "-" + decimalToHex[rnds[10]] + decimalToHex[rnds[11]] + decimalToHex[rnds[12]] + decimalToHex[rnds[13]] + decimalToHex[rnds[14]] + decimalToHex[rnds[15]]; + }; + exports2.v4 = v4; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/serde/generateIdempotencyToken.js +var import_uuid; +var init_generateIdempotencyToken = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/generateIdempotencyToken.js"() { + import_uuid = __toESM(require_dist_cjs16()); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/serde/lazy-json.js +var LazyJsonString; +var init_lazy_json = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/lazy-json.js"() { + LazyJsonString = function LazyJsonString2(val) { + const str = Object.assign(new String(val), { + deserializeJSON() { + return JSON.parse(String(val)); + }, + toString() { + return String(val); + }, + toJSON() { + return String(val); + } + }); + return str; + }; + LazyJsonString.from = (object) => { + if (object && typeof object === "object" && (object instanceof LazyJsonString || "deserializeJSON" in object)) { + return object; + } else if (typeof object === "string" || Object.getPrototypeOf(object) === String.prototype) { + return LazyJsonString(String(object)); + } + return LazyJsonString(JSON.stringify(object)); + }; + LazyJsonString.fromObject = LazyJsonString.from; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/serde/quote-header.js +function quoteHeader(part) { + if (part.includes(",") || part.includes('"')) { + part = `"${part.replace(/"/g, '\\"')}"`; + } + return part; +} +var init_quote_header = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/quote-header.js"() { + } +}); + +// node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js +function range(v4, min, max) { + const _v = Number(v4); + if (_v < min || _v > max) { + throw new Error(`Value ${_v} out of range [${min}, ${max}]`); + } +} +var ddd, mmm, time, date, year, RFC3339_WITH_OFFSET2, IMF_FIXDATE2, RFC_850_DATE2, ASC_TIME2, months, _parseEpochTimestamp, _parseRfc3339DateTimeWithOffset, _parseRfc7231DateTime; +var init_schema_date_utils = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js"() { + ddd = `(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`; + mmm = `(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`; + time = `(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`; + date = `(\\d?\\d)`; + year = `(\\d{4})`; + RFC3339_WITH_OFFSET2 = new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/); + IMF_FIXDATE2 = new RegExp(`^${ddd}, ${date} ${mmm} ${year} ${time} GMT$`); + RFC_850_DATE2 = new RegExp(`^${ddd}, ${date}-${mmm}-(\\d\\d) ${time} GMT$`); + ASC_TIME2 = new RegExp(`^${ddd} ${mmm} ( [1-9]|\\d\\d) ${time} ${year}$`); + months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + _parseEpochTimestamp = (value) => { + if (value == null) { + return void 0; + } + let num = NaN; + if (typeof value === "number") { + num = value; + } else if (typeof value === "string") { + if (!/^-?\d*\.?\d+$/.test(value)) { + throw new TypeError(`parseEpochTimestamp - numeric string invalid.`); + } + num = Number.parseFloat(value); + } else if (typeof value === "object" && value.tag === 1) { + num = value.value; + } + if (isNaN(num) || Math.abs(num) === Infinity) { + throw new TypeError("Epoch timestamps must be valid finite numbers."); + } + return new Date(Math.round(num * 1e3)); + }; + _parseRfc3339DateTimeWithOffset = (value) => { + if (value == null) { + return void 0; + } + if (typeof value !== "string") { + throw new TypeError("RFC3339 timestamps must be strings"); + } + const matches = RFC3339_WITH_OFFSET2.exec(value); + if (!matches) { + throw new TypeError(`Invalid RFC3339 timestamp format ${value}`); + } + const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches; + range(monthStr, 1, 12); + range(dayStr, 1, 31); + range(hours, 0, 23); + range(minutes, 0, 59); + range(seconds, 0, 60); + const date2 = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms) ? Math.round(parseFloat(`0.${ms}`) * 1e3) : 0)); + date2.setUTCFullYear(Number(yearStr)); + if (offsetStr.toUpperCase() != "Z") { + const [, sign, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [void 0, "+", 0, 0]; + const scalar = sign === "-" ? 1 : -1; + date2.setTime(date2.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1e3 + Number(offsetM) * 60 * 1e3)); + } + return date2; + }; + _parseRfc7231DateTime = (value) => { + if (value == null) { + return void 0; + } + if (typeof value !== "string") { + throw new TypeError("RFC7231 timestamps must be strings."); + } + let day; + let month; + let year2; + let hour; + let minute; + let second; + let fraction; + let matches; + if (matches = IMF_FIXDATE2.exec(value)) { + [, day, month, year2, hour, minute, second, fraction] = matches; + } else if (matches = RFC_850_DATE2.exec(value)) { + [, day, month, year2, hour, minute, second, fraction] = matches; + year2 = (Number(year2) + 1900).toString(); + } else if (matches = ASC_TIME2.exec(value)) { + [, month, day, hour, minute, second, fraction, year2] = matches; + } + if (year2 && second) { + const timestamp = Date.UTC(Number(year2), months.indexOf(month), Number(day), Number(hour), Number(minute), Number(second), fraction ? Math.round(parseFloat(`0.${fraction}`) * 1e3) : 0); + range(day, 1, 31); + range(hour, 0, 23); + range(minute, 0, 59); + range(second, 0, 60); + const date2 = new Date(timestamp); + date2.setUTCFullYear(Number(year2)); + return date2; + } + throw new TypeError(`Invalid RFC7231 date-time value ${value}.`); + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/serde/split-every.js +function splitEvery(value, delimiter, numDelimiters) { + if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { + throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); + } + const segments = value.split(delimiter); + if (numDelimiters === 1) { + return segments; + } + const compoundSegments = []; + let currentSegment = ""; + for (let i4 = 0; i4 < segments.length; i4++) { + if (currentSegment === "") { + currentSegment = segments[i4]; + } else { + currentSegment += delimiter + segments[i4]; + } + if ((i4 + 1) % numDelimiters === 0) { + compoundSegments.push(currentSegment); + currentSegment = ""; + } + } + if (currentSegment !== "") { + compoundSegments.push(currentSegment); + } + return compoundSegments; +} +var init_split_every = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/split-every.js"() { + } +}); + +// node_modules/@smithy/core/dist-es/submodules/serde/split-header.js +var splitHeader; +var init_split_header = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/split-header.js"() { + splitHeader = (value) => { + const z2 = value.length; + const values = []; + let withinQuotes = false; + let prevChar = void 0; + let anchor = 0; + for (let i4 = 0; i4 < z2; ++i4) { + const char = value[i4]; + switch (char) { + case `"`: + if (prevChar !== "\\") { + withinQuotes = !withinQuotes; + } + break; + case ",": + if (!withinQuotes) { + values.push(value.slice(anchor, i4)); + anchor = i4 + 1; + } + break; + default: + } + prevChar = char; + } + values.push(value.slice(anchor)); + return values.map((v4) => { + v4 = v4.trim(); + const z3 = v4.length; + if (z3 < 2) { + return v4; + } + if (v4[0] === `"` && v4[z3 - 1] === `"`) { + v4 = v4.slice(1, z3 - 1); + } + return v4.replace(/\\"/g, '"'); + }); + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +function nv(input) { + return new NumericValue(String(input), "bigDecimal"); +} +var format, NumericValue; +var init_NumericValue = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js"() { + format = /^-?\d*(\.\d+)?$/; + NumericValue = class _NumericValue { + string; + type; + constructor(string, type) { + this.string = string; + this.type = type; + if (!format.test(string)) { + throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`); + } + } + toString() { + return this.string; + } + static [Symbol.hasInstance](object) { + if (!object || typeof object !== "object") { + return false; + } + const _nv = object; + return _NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" && format.test(_nv.string); + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/serde/index.js +var serde_exports = {}; +__export(serde_exports, { + LazyJsonString: () => LazyJsonString, + NumericValue: () => NumericValue, + _parseEpochTimestamp: () => _parseEpochTimestamp, + _parseRfc3339DateTimeWithOffset: () => _parseRfc3339DateTimeWithOffset, + _parseRfc7231DateTime: () => _parseRfc7231DateTime, + copyDocumentWithTransform: () => copyDocumentWithTransform, + dateToUtcString: () => dateToUtcString, + expectBoolean: () => expectBoolean, + expectByte: () => expectByte, + expectFloat32: () => expectFloat32, + expectInt: () => expectInt, + expectInt32: () => expectInt32, + expectLong: () => expectLong, + expectNonNull: () => expectNonNull, + expectNumber: () => expectNumber, + expectObject: () => expectObject, + expectShort: () => expectShort, + expectString: () => expectString, + expectUnion: () => expectUnion, + generateIdempotencyToken: () => import_uuid.v4, + handleFloat: () => handleFloat, + limitedParseDouble: () => limitedParseDouble, + limitedParseFloat: () => limitedParseFloat, + limitedParseFloat32: () => limitedParseFloat32, + logger: () => logger, + nv: () => nv, + parseBoolean: () => parseBoolean, + parseEpochTimestamp: () => parseEpochTimestamp, + parseRfc3339DateTime: () => parseRfc3339DateTime, + parseRfc3339DateTimeWithOffset: () => parseRfc3339DateTimeWithOffset, + parseRfc7231DateTime: () => parseRfc7231DateTime, + quoteHeader: () => quoteHeader, + splitEvery: () => splitEvery, + splitHeader: () => splitHeader, + strictParseByte: () => strictParseByte, + strictParseDouble: () => strictParseDouble, + strictParseFloat: () => strictParseFloat, + strictParseFloat32: () => strictParseFloat32, + strictParseInt: () => strictParseInt, + strictParseInt32: () => strictParseInt32, + strictParseLong: () => strictParseLong, + strictParseShort: () => strictParseShort +}); +var init_serde = __esm({ + "node_modules/@smithy/core/dist-es/submodules/serde/index.js"() { + init_copyDocumentWithTransform(); + init_date_utils(); + init_generateIdempotencyToken(); + init_lazy_json(); + init_parse_utils(); + init_quote_header(); + init_schema_date_utils(); + init_split_every(); + init_split_header(); + init_NumericValue(); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/SerdeContext.js +var SerdeContext; +var init_SerdeContext = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/SerdeContext.js"() { + SerdeContext = class { + serdeContext; + setSerdeContext(serdeContext) { + this.serdeContext = serdeContext; + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +var import_util_utf8, EventStreamSerde; +var init_EventStreamSerde = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js"() { + import_util_utf8 = __toESM(require_dist_cjs8()); + EventStreamSerde = class { + marshaller; + serializer; + deserializer; + serdeContext; + defaultContentType; + constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType }) { + this.marshaller = marshaller; + this.serializer = serializer; + this.deserializer = deserializer; + this.serdeContext = serdeContext; + this.defaultContentType = defaultContentType; + } + async serializeEventStream({ eventStream, requestSchema, initialRequest }) { + const marshaller = this.marshaller; + const eventStreamMember = requestSchema.getEventStreamMember(); + const unionSchema = requestSchema.getMemberSchema(eventStreamMember); + const serializer = this.serializer; + const defaultContentType = this.defaultContentType; + const initialRequestMarker = /* @__PURE__ */ Symbol("initialRequestMarker"); + const eventStreamIterable = { + async *[Symbol.asyncIterator]() { + if (initialRequest) { + const headers = { + ":event-type": { type: "string", value: "initial-request" }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: defaultContentType } + }; + serializer.write(requestSchema, initialRequest); + const body = serializer.flush(); + yield { + [initialRequestMarker]: true, + headers, + body + }; + } + for await (const page of eventStream) { + yield page; + } + } + }; + return marshaller.serialize(eventStreamIterable, (event) => { + if (event[initialRequestMarker]) { + return { + headers: event.headers, + body: event.body + }; + } + const unionMember = Object.keys(event).find((key) => { + return key !== "__type"; + }) ?? ""; + const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(unionMember, unionSchema, event); + const headers = { + ":event-type": { type: "string", value: eventType }, + ":message-type": { type: "string", value: "event" }, + ":content-type": { type: "string", value: explicitPayloadContentType ?? defaultContentType }, + ...additionalHeaders + }; + return { + headers, + body + }; + }); + } + async deserializeEventStream({ response, responseSchema, initialResponseContainer }) { + const marshaller = this.marshaller; + const eventStreamMember = responseSchema.getEventStreamMember(); + const unionSchema = responseSchema.getMemberSchema(eventStreamMember); + const memberSchemas = unionSchema.getMemberSchemas(); + const initialResponseMarker = /* @__PURE__ */ Symbol("initialResponseMarker"); + const asyncIterable = marshaller.deserialize(response.body, async (event) => { + const unionMember = Object.keys(event).find((key) => { + return key !== "__type"; + }) ?? ""; + const body = event[unionMember].body; + if (unionMember === "initial-response") { + const dataObject = await this.deserializer.read(responseSchema, body); + delete dataObject[eventStreamMember]; + return { + [initialResponseMarker]: true, + ...dataObject + }; + } else if (unionMember in memberSchemas) { + const eventStreamSchema = memberSchemas[unionMember]; + if (eventStreamSchema.isStructSchema()) { + const out = {}; + let hasBindings = false; + for (const [name, member2] of eventStreamSchema.structIterator()) { + const { eventHeader, eventPayload } = member2.getMergedTraits(); + hasBindings = hasBindings || Boolean(eventHeader || eventPayload); + if (eventPayload) { + if (member2.isBlobSchema()) { + out[name] = body; + } else if (member2.isStringSchema()) { + out[name] = (this.serdeContext?.utf8Encoder ?? import_util_utf8.toUtf8)(body); + } else if (member2.isStructSchema()) { + out[name] = await this.deserializer.read(member2, body); + } + } else if (eventHeader) { + const value = event[unionMember].headers[name]?.value; + if (value != null) { + if (member2.isNumericSchema()) { + if (value && typeof value === "object" && "bytes" in value) { + out[name] = BigInt(value.toString()); + } else { + out[name] = Number(value); + } + } else { + out[name] = value; + } + } + } + } + if (hasBindings) { + return { + [unionMember]: out + }; + } + if (body.byteLength === 0) { + return { + [unionMember]: {} + }; + } + } + return { + [unionMember]: await this.deserializer.read(eventStreamSchema, body) + }; + } else { + return { + $unknown: event + }; + } + }); + const asyncIterator = asyncIterable[Symbol.asyncIterator](); + const firstEvent = await asyncIterator.next(); + if (firstEvent.done) { + return asyncIterable; + } + if (firstEvent.value?.[initialResponseMarker]) { + if (!responseSchema) { + throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given."); + } + for (const [key, value] of Object.entries(firstEvent.value)) { + initialResponseContainer[key] = value; + } + } + return { + async *[Symbol.asyncIterator]() { + if (!firstEvent?.value?.[initialResponseMarker]) { + yield firstEvent.value; + } + while (true) { + const { done, value } = await asyncIterator.next(); + if (done) { + break; + } + yield value; + } + } + }; + } + writeEventBody(unionMember, unionSchema, event) { + const serializer = this.serializer; + let eventType = unionMember; + let explicitPayloadMember = null; + let explicitPayloadContentType; + const isKnownSchema = (() => { + const struct2 = unionSchema.getSchema(); + return struct2[4].includes(unionMember); + })(); + const additionalHeaders = {}; + if (!isKnownSchema) { + const [type, value] = event[unionMember]; + eventType = type; + serializer.write(15, value); + } else { + const eventSchema = unionSchema.getMemberSchema(unionMember); + if (eventSchema.isStructSchema()) { + for (const [memberName, memberSchema] of eventSchema.structIterator()) { + const { eventHeader, eventPayload } = memberSchema.getMergedTraits(); + if (eventPayload) { + explicitPayloadMember = memberName; + } else if (eventHeader) { + const value = event[unionMember][memberName]; + let type = "binary"; + if (memberSchema.isNumericSchema()) { + if ((-2) ** 31 <= value && value <= 2 ** 31 - 1) { + type = "integer"; + } else { + type = "long"; + } + } else if (memberSchema.isTimestampSchema()) { + type = "timestamp"; + } else if (memberSchema.isStringSchema()) { + type = "string"; + } else if (memberSchema.isBooleanSchema()) { + type = "boolean"; + } + if (value != null) { + additionalHeaders[memberName] = { + type, + value + }; + delete event[unionMember][memberName]; + } + } + } + if (explicitPayloadMember !== null) { + const payloadSchema = eventSchema.getMemberSchema(explicitPayloadMember); + if (payloadSchema.isBlobSchema()) { + explicitPayloadContentType = "application/octet-stream"; + } else if (payloadSchema.isStringSchema()) { + explicitPayloadContentType = "text/plain"; + } + serializer.write(payloadSchema, event[unionMember][explicitPayloadMember]); + } else { + serializer.write(eventSchema, event[unionMember]); + } + } else if (eventSchema.isUnitSchema()) { + serializer.write(eventSchema, {}); + } else { + throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union."); + } + } + const messageSerialization = serializer.flush(); + const body = typeof messageSerialization === "string" ? (this.serdeContext?.utf8Decoder ?? import_util_utf8.fromUtf8)(messageSerialization) : messageSerialization; + return { + body, + eventType, + explicitPayloadContentType, + additionalHeaders + }; + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/event-streams/index.js +var event_streams_exports = {}; +__export(event_streams_exports, { + EventStreamSerde: () => EventStreamSerde +}); +var init_event_streams = __esm({ + "node_modules/@smithy/core/dist-es/submodules/event-streams/index.js"() { + init_EventStreamSerde(); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +var import_protocol_http6, HttpProtocol; +var init_HttpProtocol = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js"() { + init_schema(); + import_protocol_http6 = __toESM(require_dist_cjs2()); + init_SerdeContext(); + HttpProtocol = class extends SerdeContext { + options; + compositeErrorRegistry; + constructor(options) { + super(); + this.options = options; + this.compositeErrorRegistry = TypeRegistry.for(options.defaultNamespace); + for (const etr of options.errorTypeRegistries ?? []) { + this.compositeErrorRegistry.copyFrom(etr); + } + } + getRequestType() { + return import_protocol_http6.HttpRequest; + } + getResponseType() { + return import_protocol_http6.HttpResponse; + } + setSerdeContext(serdeContext) { + this.serdeContext = serdeContext; + this.serializer.setSerdeContext(serdeContext); + this.deserializer.setSerdeContext(serdeContext); + if (this.getPayloadCodec()) { + this.getPayloadCodec().setSerdeContext(serdeContext); + } + } + updateServiceEndpoint(request, endpoint) { + if ("url" in endpoint) { + request.protocol = endpoint.url.protocol; + request.hostname = endpoint.url.hostname; + request.port = endpoint.url.port ? Number(endpoint.url.port) : void 0; + request.path = endpoint.url.pathname; + request.fragment = endpoint.url.hash || void 0; + request.username = endpoint.url.username || void 0; + request.password = endpoint.url.password || void 0; + if (!request.query) { + request.query = {}; + } + for (const [k4, v4] of endpoint.url.searchParams.entries()) { + request.query[k4] = v4; + } + return request; + } else { + request.protocol = endpoint.protocol; + request.hostname = endpoint.hostname; + request.port = endpoint.port ? Number(endpoint.port) : void 0; + request.path = endpoint.path; + request.query = { + ...endpoint.query + }; + return request; + } + } + setHostPrefix(request, operationSchema, input) { + if (this.serdeContext?.disableHostPrefix) { + return; + } + const inputNs = NormalizedSchema.of(operationSchema.input); + const opTraits = translateTraits(operationSchema.traits ?? {}); + if (opTraits.endpoint) { + let hostPrefix = opTraits.endpoint?.[0]; + if (typeof hostPrefix === "string") { + const hostLabelInputs = [...inputNs.structIterator()].filter(([, member2]) => member2.getMergedTraits().hostLabel); + for (const [name] of hostLabelInputs) { + const replacement = input[name]; + if (typeof replacement !== "string") { + throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`); + } + hostPrefix = hostPrefix.replace(`{${name}}`, replacement); + } + request.hostname = hostPrefix + request.hostname; + } + } + } + deserializeMetadata(output) { + return { + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"] + }; + } + async serializeEventStream({ eventStream, requestSchema, initialRequest }) { + const eventStreamSerde = await this.loadEventStreamCapability(); + return eventStreamSerde.serializeEventStream({ + eventStream, + requestSchema, + initialRequest + }); + } + async deserializeEventStream({ response, responseSchema, initialResponseContainer }) { + const eventStreamSerde = await this.loadEventStreamCapability(); + return eventStreamSerde.deserializeEventStream({ + response, + responseSchema, + initialResponseContainer + }); + } + async loadEventStreamCapability() { + const { EventStreamSerde: EventStreamSerde2 } = await Promise.resolve().then(() => (init_event_streams(), event_streams_exports)); + return new EventStreamSerde2({ + marshaller: this.getEventStreamMarshaller(), + serializer: this.serializer, + deserializer: this.deserializer, + serdeContext: this.serdeContext, + defaultContentType: this.getDefaultContentType() + }); + } + getDefaultContentType() { + throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`); + } + async deserializeHttpMessage(schema, context, response, arg4, arg5) { + void schema; + void context; + void response; + void arg4; + void arg5; + return []; + } + getEventStreamMarshaller() { + const context = this.serdeContext; + if (!context.eventStreamMarshaller) { + throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext."); + } + return context.eventStreamMarshaller; + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +var import_protocol_http7, import_util_stream2, HttpBindingProtocol; +var init_HttpBindingProtocol = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js"() { + init_schema(); + init_serde(); + import_protocol_http7 = __toESM(require_dist_cjs2()); + import_util_stream2 = __toESM(require_dist_cjs15()); + init_collect_stream_body(); + init_extended_encode_uri_component(); + init_HttpProtocol(); + HttpBindingProtocol = class extends HttpProtocol { + async serializeRequest(operationSchema, _input, context) { + const input = { + ..._input ?? {} + }; + const serializer = this.serializer; + const query = {}; + const headers = {}; + const endpoint = await context.endpoint(); + const ns = NormalizedSchema.of(operationSchema?.input); + const schema = ns.getSchema(); + let hasNonHttpBindingMember = false; + let payload2; + const request = new import_protocol_http7.HttpRequest({ + protocol: "", + hostname: "", + port: void 0, + path: "", + fragment: void 0, + query, + headers, + body: void 0 + }); + if (endpoint) { + this.updateServiceEndpoint(request, endpoint); + this.setHostPrefix(request, operationSchema, input); + const opTraits = translateTraits(operationSchema.traits); + if (opTraits.http) { + request.method = opTraits.http[0]; + const [path, search] = opTraits.http[1].split("?"); + if (request.path == "/") { + request.path = path; + } else { + request.path += path; + } + const traitSearchParams = new URLSearchParams(search ?? ""); + Object.assign(query, Object.fromEntries(traitSearchParams)); + } + } + for (const [memberName, memberNs] of ns.structIterator()) { + const memberTraits = memberNs.getMergedTraits() ?? {}; + const inputMemberValue = input[memberName]; + if (inputMemberValue == null && !memberNs.isIdempotencyToken()) { + if (memberTraits.httpLabel) { + if (request.path.includes(`{${memberName}+}`) || request.path.includes(`{${memberName}}`)) { + throw new Error(`No value provided for input HTTP label: ${memberName}.`); + } + } + continue; + } + if (memberTraits.httpPayload) { + const isStreaming = memberNs.isStreaming(); + if (isStreaming) { + const isEventStream = memberNs.isStructSchema(); + if (isEventStream) { + if (input[memberName]) { + payload2 = await this.serializeEventStream({ + eventStream: input[memberName], + requestSchema: ns + }); + } + } else { + payload2 = inputMemberValue; + } + } else { + serializer.write(memberNs, inputMemberValue); + payload2 = serializer.flush(); + } + delete input[memberName]; + } else if (memberTraits.httpLabel) { + serializer.write(memberNs, inputMemberValue); + const replacement = serializer.flush(); + if (request.path.includes(`{${memberName}+}`)) { + request.path = request.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/")); + } else if (request.path.includes(`{${memberName}}`)) { + request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement)); + } + delete input[memberName]; + } else if (memberTraits.httpHeader) { + serializer.write(memberNs, inputMemberValue); + headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush()); + delete input[memberName]; + } else if (typeof memberTraits.httpPrefixHeaders === "string") { + for (const [key, val] of Object.entries(inputMemberValue)) { + const amalgam = memberTraits.httpPrefixHeaders + key; + serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val); + headers[amalgam.toLowerCase()] = serializer.flush(); + } + delete input[memberName]; + } else if (memberTraits.httpQuery || memberTraits.httpQueryParams) { + this.serializeQuery(memberNs, inputMemberValue, query); + delete input[memberName]; + } else { + hasNonHttpBindingMember = true; + } + } + if (hasNonHttpBindingMember && input) { + serializer.write(schema, input); + payload2 = serializer.flush(); + } + request.headers = headers; + request.query = query; + request.body = payload2; + return request; + } + serializeQuery(ns, data2, query) { + const serializer = this.serializer; + const traits = ns.getMergedTraits(); + if (traits.httpQueryParams) { + for (const [key, val] of Object.entries(data2)) { + if (!(key in query)) { + const valueSchema = ns.getValueSchema(); + Object.assign(valueSchema.getMergedTraits(), { + ...traits, + httpQuery: key, + httpQueryParams: void 0 + }); + this.serializeQuery(valueSchema, val, query); + } + } + return; + } + if (ns.isListSchema()) { + const sparse = !!ns.getMergedTraits().sparse; + const buffer = []; + for (const item of data2) { + serializer.write([ns.getValueSchema(), traits], item); + const serializable = serializer.flush(); + if (sparse || serializable !== void 0) { + buffer.push(serializable); + } + } + query[traits.httpQuery] = buffer; + } else { + serializer.write([ns, traits], data2); + query[traits.httpQuery] = serializer.flush(); + } + } + async deserializeResponse(operationSchema, context, response) { + const deserializer = this.deserializer; + const ns = NormalizedSchema.of(operationSchema.output); + const dataObject = {}; + if (response.statusCode >= 300) { + const bytes = await collectBody(response.body, context); + if (bytes.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(15, bytes)); + } + await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); + throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw."); + } + for (const header in response.headers) { + const value = response.headers[header]; + delete response.headers[header]; + response.headers[header.toLowerCase()] = value; + } + const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context, response, dataObject); + if (nonHttpBindingMembers.length) { + const bytes = await collectBody(response.body, context); + if (bytes.byteLength > 0) { + const dataFromBody = await deserializer.read(ns, bytes); + for (const member2 of nonHttpBindingMembers) { + if (dataFromBody[member2] != null) { + dataObject[member2] = dataFromBody[member2]; + } + } + } + } else if (nonHttpBindingMembers.discardResponseBody) { + await collectBody(response.body, context); + } + dataObject.$metadata = this.deserializeMetadata(response); + return dataObject; + } + async deserializeHttpMessage(schema, context, response, arg4, arg5) { + let dataObject; + if (arg4 instanceof Set) { + dataObject = arg5; + } else { + dataObject = arg4; + } + let discardResponseBody = true; + const deserializer = this.deserializer; + const ns = NormalizedSchema.of(schema); + const nonHttpBindingMembers = []; + for (const [memberName, memberSchema] of ns.structIterator()) { + const memberTraits = memberSchema.getMemberTraits(); + if (memberTraits.httpPayload) { + discardResponseBody = false; + const isStreaming = memberSchema.isStreaming(); + if (isStreaming) { + const isEventStream = memberSchema.isStructSchema(); + if (isEventStream) { + dataObject[memberName] = await this.deserializeEventStream({ + response, + responseSchema: ns + }); + } else { + dataObject[memberName] = (0, import_util_stream2.sdkStreamMixin)(response.body); + } + } else if (response.body) { + const bytes = await collectBody(response.body, context); + if (bytes.byteLength > 0) { + dataObject[memberName] = await deserializer.read(memberSchema, bytes); + } + } + } else if (memberTraits.httpHeader) { + const key = String(memberTraits.httpHeader).toLowerCase(); + const value = response.headers[key]; + if (null != value) { + if (memberSchema.isListSchema()) { + const headerListValueSchema = memberSchema.getValueSchema(); + headerListValueSchema.getMergedTraits().httpHeader = key; + let sections; + if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === 4) { + sections = splitEvery(value, ",", 2); + } else { + sections = splitHeader(value); + } + const list2 = []; + for (const section of sections) { + list2.push(await deserializer.read(headerListValueSchema, section.trim())); + } + dataObject[memberName] = list2; + } else { + dataObject[memberName] = await deserializer.read(memberSchema, value); + } + } + } else if (memberTraits.httpPrefixHeaders !== void 0) { + dataObject[memberName] = {}; + for (const [header, value] of Object.entries(response.headers)) { + if (header.startsWith(memberTraits.httpPrefixHeaders)) { + const valueSchema = memberSchema.getValueSchema(); + valueSchema.getMergedTraits().httpHeader = header; + dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(valueSchema, value); + } + } + } else if (memberTraits.httpResponseCode) { + dataObject[memberName] = response.statusCode; + } else { + nonHttpBindingMembers.push(memberName); + } + } + nonHttpBindingMembers.discardResponseBody = discardResponseBody; + return nonHttpBindingMembers; + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +var import_protocol_http8, RpcProtocol; +var init_RpcProtocol = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js"() { + init_schema(); + import_protocol_http8 = __toESM(require_dist_cjs2()); + init_collect_stream_body(); + init_HttpProtocol(); + RpcProtocol = class extends HttpProtocol { + async serializeRequest(operationSchema, input, context) { + const serializer = this.serializer; + const query = {}; + const headers = {}; + const endpoint = await context.endpoint(); + const ns = NormalizedSchema.of(operationSchema?.input); + const schema = ns.getSchema(); + let payload2; + const request = new import_protocol_http8.HttpRequest({ + protocol: "", + hostname: "", + port: void 0, + path: "/", + fragment: void 0, + query, + headers, + body: void 0 + }); + if (endpoint) { + this.updateServiceEndpoint(request, endpoint); + this.setHostPrefix(request, operationSchema, input); + } + const _input = { + ...input + }; + if (input) { + const eventStreamMember = ns.getEventStreamMember(); + if (eventStreamMember) { + if (_input[eventStreamMember]) { + const initialRequest = {}; + for (const [memberName, memberSchema] of ns.structIterator()) { + if (memberName !== eventStreamMember && _input[memberName]) { + serializer.write(memberSchema, _input[memberName]); + initialRequest[memberName] = serializer.flush(); + } + } + payload2 = await this.serializeEventStream({ + eventStream: _input[eventStreamMember], + requestSchema: ns, + initialRequest + }); + } + } else { + serializer.write(schema, _input); + payload2 = serializer.flush(); + } + } + request.headers = headers; + request.query = query; + request.body = payload2; + request.method = "POST"; + return request; + } + async deserializeResponse(operationSchema, context, response) { + const deserializer = this.deserializer; + const ns = NormalizedSchema.of(operationSchema.output); + const dataObject = {}; + if (response.statusCode >= 300) { + const bytes = await collectBody(response.body, context); + if (bytes.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(15, bytes)); + } + await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); + throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw."); + } + for (const header in response.headers) { + const value = response.headers[header]; + delete response.headers[header]; + response.headers[header.toLowerCase()] = value; + } + const eventStreamMember = ns.getEventStreamMember(); + if (eventStreamMember) { + dataObject[eventStreamMember] = await this.deserializeEventStream({ + response, + responseSchema: ns, + initialResponseContainer: dataObject + }); + } else { + const bytes = await collectBody(response.body, context); + if (bytes.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(ns, bytes)); + } + } + dataObject.$metadata = this.deserializeMetadata(response); + return dataObject; + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js +var resolvedPath; +var init_resolve_path = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js"() { + init_extended_encode_uri_component(); + resolvedPath = (resolvedPath2, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { + if (input != null && input[memberName] !== void 0) { + const labelValue = labelValueProvider(); + if (labelValue.length <= 0) { + throw new Error("Empty value provided for input HTTP label: " + memberName + "."); + } + resolvedPath2 = resolvedPath2.replace(uriLabel, isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue)); + } else { + throw new Error("No value provided for input HTTP label: " + memberName + "."); + } + return resolvedPath2; + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js +function requestBuilder(input, context) { + return new RequestBuilder(input, context); +} +var import_protocol_http9, RequestBuilder; +var init_requestBuilder = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js"() { + import_protocol_http9 = __toESM(require_dist_cjs2()); + init_resolve_path(); + RequestBuilder = class { + input; + context; + query = {}; + method = ""; + headers = {}; + path = ""; + body = null; + hostname = ""; + resolvePathStack = []; + constructor(input, context) { + this.input = input; + this.context = context; + } + async build() { + const { hostname, protocol = "https", port, path: basePath2 } = await this.context.endpoint(); + this.path = basePath2; + for (const resolvePath of this.resolvePathStack) { + resolvePath(this.path); + } + return new import_protocol_http9.HttpRequest({ + protocol, + hostname: this.hostname || hostname, + port, + method: this.method, + path: this.path, + query: this.query, + body: this.body, + headers: this.headers + }); + } + hn(hostname) { + this.hostname = hostname; + return this; + } + bp(uriLabel) { + this.resolvePathStack.push((basePath2) => { + this.path = `${basePath2?.endsWith("/") ? basePath2.slice(0, -1) : basePath2 || ""}` + uriLabel; + }); + return this; + } + p(memberName, labelValueProvider, uriLabel, isGreedyLabel) { + this.resolvePathStack.push((path) => { + this.path = resolvedPath(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel); + }); + return this; + } + h(headers) { + this.headers = headers; + return this; + } + q(query) { + this.query = query; + return this; + } + b(body) { + this.body = body; + return this; + } + m(method) { + this.method = method; + return this; + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js +function determineTimestampFormat(ns, settings) { + if (settings.timestampFormat.useTrait) { + if (ns.isTimestampSchema() && (ns.getSchema() === 5 || ns.getSchema() === 6 || ns.getSchema() === 7)) { + return ns.getSchema(); + } + } + const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits(); + const bindingFormat = settings.httpBindings ? typeof httpPrefixHeaders === "string" || Boolean(httpHeader) ? 6 : Boolean(httpQuery) || Boolean(httpLabel) ? 5 : void 0 : void 0; + return bindingFormat ?? settings.timestampFormat.default; +} +var init_determineTimestampFormat = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js"() { + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js +var import_util_base64, import_util_utf82, FromStringShapeDeserializer; +var init_FromStringShapeDeserializer = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js"() { + init_schema(); + init_serde(); + import_util_base64 = __toESM(require_dist_cjs9()); + import_util_utf82 = __toESM(require_dist_cjs8()); + init_SerdeContext(); + init_determineTimestampFormat(); + FromStringShapeDeserializer = class extends SerdeContext { + settings; + constructor(settings) { + super(); + this.settings = settings; + } + read(_schema, data2) { + const ns = NormalizedSchema.of(_schema); + if (ns.isListSchema()) { + return splitHeader(data2).map((item) => this.read(ns.getValueSchema(), item)); + } + if (ns.isBlobSchema()) { + return (this.serdeContext?.base64Decoder ?? import_util_base64.fromBase64)(data2); + } + if (ns.isTimestampSchema()) { + const format2 = determineTimestampFormat(ns, this.settings); + switch (format2) { + case 5: + return _parseRfc3339DateTimeWithOffset(data2); + case 6: + return _parseRfc7231DateTime(data2); + case 7: + return _parseEpochTimestamp(data2); + default: + console.warn("Missing timestamp format, parsing value with Date constructor:", data2); + return new Date(data2); + } + } + if (ns.isStringSchema()) { + const mediaType = ns.getMergedTraits().mediaType; + let intermediateValue = data2; + if (mediaType) { + if (ns.getMergedTraits().httpHeader) { + intermediateValue = this.base64ToUtf8(intermediateValue); + } + const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); + if (isJson) { + intermediateValue = LazyJsonString.from(intermediateValue); + } + return intermediateValue; + } + } + if (ns.isNumericSchema()) { + return Number(data2); + } + if (ns.isBigIntegerSchema()) { + return BigInt(data2); + } + if (ns.isBigDecimalSchema()) { + return new NumericValue(data2, "bigDecimal"); + } + if (ns.isBooleanSchema()) { + return String(data2).toLowerCase() === "true"; + } + return data2; + } + base64ToUtf8(base64String) { + return (this.serdeContext?.utf8Encoder ?? import_util_utf82.toUtf8)((this.serdeContext?.base64Decoder ?? import_util_base64.fromBase64)(base64String)); + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js +var import_util_utf83, HttpInterceptingShapeDeserializer; +var init_HttpInterceptingShapeDeserializer = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js"() { + init_schema(); + import_util_utf83 = __toESM(require_dist_cjs8()); + init_SerdeContext(); + init_FromStringShapeDeserializer(); + HttpInterceptingShapeDeserializer = class extends SerdeContext { + codecDeserializer; + stringDeserializer; + constructor(codecDeserializer, codecSettings) { + super(); + this.codecDeserializer = codecDeserializer; + this.stringDeserializer = new FromStringShapeDeserializer(codecSettings); + } + setSerdeContext(serdeContext) { + this.stringDeserializer.setSerdeContext(serdeContext); + this.codecDeserializer.setSerdeContext(serdeContext); + this.serdeContext = serdeContext; + } + read(schema, data2) { + const ns = NormalizedSchema.of(schema); + const traits = ns.getMergedTraits(); + const toString = this.serdeContext?.utf8Encoder ?? import_util_utf83.toUtf8; + if (traits.httpHeader || traits.httpResponseCode) { + return this.stringDeserializer.read(ns, toString(data2)); + } + if (traits.httpPayload) { + if (ns.isBlobSchema()) { + const toBytes = this.serdeContext?.utf8Decoder ?? import_util_utf83.fromUtf8; + if (typeof data2 === "string") { + return toBytes(data2); + } + return data2; + } else if (ns.isStringSchema()) { + if ("byteLength" in data2) { + return toString(data2); + } + return data2; + } + } + return this.codecDeserializer.read(ns, data2); + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js +var import_util_base642, ToStringShapeSerializer; +var init_ToStringShapeSerializer = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js"() { + init_schema(); + init_serde(); + import_util_base642 = __toESM(require_dist_cjs9()); + init_SerdeContext(); + init_determineTimestampFormat(); + ToStringShapeSerializer = class extends SerdeContext { + settings; + stringBuffer = ""; + constructor(settings) { + super(); + this.settings = settings; + } + write(schema, value) { + const ns = NormalizedSchema.of(schema); + switch (typeof value) { + case "object": + if (value === null) { + this.stringBuffer = "null"; + return; + } + if (ns.isTimestampSchema()) { + if (!(value instanceof Date)) { + throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`); + } + const format2 = determineTimestampFormat(ns, this.settings); + switch (format2) { + case 5: + this.stringBuffer = value.toISOString().replace(".000Z", "Z"); + break; + case 6: + this.stringBuffer = dateToUtcString(value); + break; + case 7: + this.stringBuffer = String(value.getTime() / 1e3); + break; + default: + console.warn("Missing timestamp format, using epoch seconds", value); + this.stringBuffer = String(value.getTime() / 1e3); + } + return; + } + if (ns.isBlobSchema() && "byteLength" in value) { + this.stringBuffer = (this.serdeContext?.base64Encoder ?? import_util_base642.toBase64)(value); + return; + } + if (ns.isListSchema() && Array.isArray(value)) { + let buffer = ""; + for (const item of value) { + this.write([ns.getValueSchema(), ns.getMergedTraits()], item); + const headerItem = this.flush(); + const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : quoteHeader(headerItem); + if (buffer !== "") { + buffer += ", "; + } + buffer += serialized; + } + this.stringBuffer = buffer; + return; + } + this.stringBuffer = JSON.stringify(value, null, 2); + break; + case "string": + const mediaType = ns.getMergedTraits().mediaType; + let intermediateValue = value; + if (mediaType) { + const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); + if (isJson) { + intermediateValue = LazyJsonString.from(intermediateValue); + } + if (ns.getMergedTraits().httpHeader) { + this.stringBuffer = (this.serdeContext?.base64Encoder ?? import_util_base642.toBase64)(intermediateValue.toString()); + return; + } + } + this.stringBuffer = value; + break; + default: + if (ns.isIdempotencyToken()) { + this.stringBuffer = (0, import_uuid.v4)(); + } else { + this.stringBuffer = String(value); + } + } + } + flush() { + const buffer = this.stringBuffer; + this.stringBuffer = ""; + return buffer; + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js +var HttpInterceptingShapeSerializer; +var init_HttpInterceptingShapeSerializer = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js"() { + init_schema(); + init_ToStringShapeSerializer(); + HttpInterceptingShapeSerializer = class { + codecSerializer; + stringSerializer; + buffer; + constructor(codecSerializer, codecSettings, stringSerializer = new ToStringShapeSerializer(codecSettings)) { + this.codecSerializer = codecSerializer; + this.stringSerializer = stringSerializer; + } + setSerdeContext(serdeContext) { + this.codecSerializer.setSerdeContext(serdeContext); + this.stringSerializer.setSerdeContext(serdeContext); + } + write(schema, value) { + const ns = NormalizedSchema.of(schema); + const traits = ns.getMergedTraits(); + if (traits.httpHeader || traits.httpLabel || traits.httpQuery) { + this.stringSerializer.write(ns, value); + this.buffer = this.stringSerializer.flush(); + return; + } + return this.codecSerializer.write(ns, value); + } + flush() { + if (this.buffer !== void 0) { + const buffer = this.buffer; + this.buffer = void 0; + return buffer; + } + return this.codecSerializer.flush(); + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/protocols/index.js +var protocols_exports = {}; +__export(protocols_exports, { + FromStringShapeDeserializer: () => FromStringShapeDeserializer, + HttpBindingProtocol: () => HttpBindingProtocol, + HttpInterceptingShapeDeserializer: () => HttpInterceptingShapeDeserializer, + HttpInterceptingShapeSerializer: () => HttpInterceptingShapeSerializer, + HttpProtocol: () => HttpProtocol, + RequestBuilder: () => RequestBuilder, + RpcProtocol: () => RpcProtocol, + SerdeContext: () => SerdeContext, + ToStringShapeSerializer: () => ToStringShapeSerializer, + collectBody: () => collectBody, + determineTimestampFormat: () => determineTimestampFormat, + extendedEncodeURIComponent: () => extendedEncodeURIComponent, + requestBuilder: () => requestBuilder, + resolvedPath: () => resolvedPath +}); +var init_protocols = __esm({ + "node_modules/@smithy/core/dist-es/submodules/protocols/index.js"() { + init_collect_stream_body(); + init_extended_encode_uri_component(); + init_HttpBindingProtocol(); + init_HttpProtocol(); + init_RpcProtocol(); + init_requestBuilder(); + init_resolve_path(); + init_FromStringShapeDeserializer(); + init_HttpInterceptingShapeDeserializer(); + init_HttpInterceptingShapeSerializer(); + init_ToStringShapeSerializer(); + init_determineTimestampFormat(); + init_SerdeContext(); + } +}); + +// node_modules/@smithy/core/dist-es/request-builder/requestBuilder.js +var init_requestBuilder2 = __esm({ + "node_modules/@smithy/core/dist-es/request-builder/requestBuilder.js"() { + init_protocols(); + } +}); + +// node_modules/@smithy/core/dist-es/setFeature.js +function setFeature2(context, feature, value) { + if (!context.__smithy_context) { + context.__smithy_context = { + features: {} + }; + } else if (!context.__smithy_context.features) { + context.__smithy_context.features = {}; + } + context.__smithy_context.features[feature] = value; +} +var init_setFeature2 = __esm({ + "node_modules/@smithy/core/dist-es/setFeature.js"() { + } +}); + +// node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js +var DefaultIdentityProviderConfig; +var init_DefaultIdentityProviderConfig = __esm({ + "node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js"() { + DefaultIdentityProviderConfig = class { + authSchemes = /* @__PURE__ */ new Map(); + constructor(config) { + for (const [key, value] of Object.entries(config)) { + if (value !== void 0) { + this.authSchemes.set(key, value); + } + } + } + getIdentityProvider(schemeId) { + return this.authSchemes.get(schemeId); + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js +var import_protocol_http10, import_types2, HttpApiKeyAuthSigner; +var init_httpApiKeyAuth = __esm({ + "node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js"() { + import_protocol_http10 = __toESM(require_dist_cjs2()); + import_types2 = __toESM(require_dist_cjs()); + HttpApiKeyAuthSigner = class { + async sign(httpRequest, identity, signingProperties) { + if (!signingProperties) { + throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing"); + } + if (!signingProperties.name) { + throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing"); + } + if (!signingProperties.in) { + throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing"); + } + if (!identity.apiKey) { + throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined"); + } + const clonedRequest = import_protocol_http10.HttpRequest.clone(httpRequest); + if (signingProperties.in === import_types2.HttpApiKeyAuthLocation.QUERY) { + clonedRequest.query[signingProperties.name] = identity.apiKey; + } else if (signingProperties.in === import_types2.HttpApiKeyAuthLocation.HEADER) { + clonedRequest.headers[signingProperties.name] = signingProperties.scheme ? `${signingProperties.scheme} ${identity.apiKey}` : identity.apiKey; + } else { + throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `" + signingProperties.in + "`"); + } + return clonedRequest; + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js +var import_protocol_http11, HttpBearerAuthSigner; +var init_httpBearerAuth = __esm({ + "node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js"() { + import_protocol_http11 = __toESM(require_dist_cjs2()); + HttpBearerAuthSigner = class { + async sign(httpRequest, identity, signingProperties) { + const clonedRequest = import_protocol_http11.HttpRequest.clone(httpRequest); + if (!identity.token) { + throw new Error("request could not be signed with `token` since the `token` is not defined"); + } + clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`; + return clonedRequest; + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js +var NoAuthSigner; +var init_noAuth = __esm({ + "node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js"() { + NoAuthSigner = class { + async sign(httpRequest, identity, signingProperties) { + return httpRequest; + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js +var init_httpAuthSchemes = __esm({ + "node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js"() { + init_httpApiKeyAuth(); + init_httpBearerAuth(); + init_noAuth(); + } +}); + +// node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js +var createIsIdentityExpiredFunction, EXPIRATION_MS, isIdentityExpired, doesIdentityRequireRefresh, memoizeIdentityProvider; +var init_memoizeIdentityProvider = __esm({ + "node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js"() { + createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired2(identity) { + return doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs; + }; + EXPIRATION_MS = 3e5; + isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS); + doesIdentityRequireRefresh = (identity) => identity.expiration !== void 0; + memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => { + if (provider === void 0) { + return void 0; + } + const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider; + let resolved; + let pending; + let hasResult; + let isConstant = false; + const coalesceProvider = async (options) => { + if (!pending) { + pending = normalizedProvider(options); + } + try { + resolved = await pending; + hasResult = true; + isConstant = false; + } finally { + pending = void 0; + } + return resolved; + }; + if (isExpired === void 0) { + return async (options) => { + if (!hasResult || options?.forceRefresh) { + resolved = await coalesceProvider(options); + } + return resolved; + }; + } + return async (options) => { + if (!hasResult || options?.forceRefresh) { + resolved = await coalesceProvider(options); + } + if (isConstant) { + return resolved; + } + if (!requiresRefresh(resolved)) { + isConstant = true; + return resolved; + } + if (isExpired(resolved)) { + await coalesceProvider(options); + return resolved; + } + return resolved; + }; + }; + } +}); + +// node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js +var init_util_identity_and_auth = __esm({ + "node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js"() { + init_DefaultIdentityProviderConfig(); + init_httpAuthSchemes(); + init_memoizeIdentityProvider(); + } +}); + +// node_modules/@smithy/core/dist-es/index.js +var dist_es_exports = {}; +__export(dist_es_exports, { + DefaultIdentityProviderConfig: () => DefaultIdentityProviderConfig, + EXPIRATION_MS: () => EXPIRATION_MS, + HttpApiKeyAuthSigner: () => HttpApiKeyAuthSigner, + HttpBearerAuthSigner: () => HttpBearerAuthSigner, + NoAuthSigner: () => NoAuthSigner, + createIsIdentityExpiredFunction: () => createIsIdentityExpiredFunction, + createPaginator: () => createPaginator, + doesIdentityRequireRefresh: () => doesIdentityRequireRefresh, + getHttpAuthSchemeEndpointRuleSetPlugin: () => getHttpAuthSchemeEndpointRuleSetPlugin, + getHttpAuthSchemePlugin: () => getHttpAuthSchemePlugin, + getHttpSigningPlugin: () => getHttpSigningPlugin, + getSmithyContext: () => getSmithyContext, + httpAuthSchemeEndpointRuleSetMiddlewareOptions: () => httpAuthSchemeEndpointRuleSetMiddlewareOptions, + httpAuthSchemeMiddleware: () => httpAuthSchemeMiddleware, + httpAuthSchemeMiddlewareOptions: () => httpAuthSchemeMiddlewareOptions, + httpSigningMiddleware: () => httpSigningMiddleware, + httpSigningMiddlewareOptions: () => httpSigningMiddlewareOptions, + isIdentityExpired: () => isIdentityExpired, + memoizeIdentityProvider: () => memoizeIdentityProvider, + normalizeProvider: () => normalizeProvider, + requestBuilder: () => requestBuilder, + setFeature: () => setFeature2 +}); +var init_dist_es = __esm({ + "node_modules/@smithy/core/dist-es/index.js"() { + init_getSmithyContext(); + init_middleware_http_auth_scheme(); + init_middleware_http_signing(); + init_normalizeProvider(); + init_createPaginator(); + init_requestBuilder2(); + init_setFeature2(); + init_util_identity_and_auth(); + } +}); + +// node_modules/@smithy/property-provider/dist-cjs/index.js +var require_dist_cjs17 = __commonJS({ + "node_modules/@smithy/property-provider/dist-cjs/index.js"(exports2) { + "use strict"; + var ProviderError2 = class _ProviderError extends Error { + name = "ProviderError"; + tryNextLink; + constructor(message2, options = true) { + let logger3; + let tryNextLink = true; + if (typeof options === "boolean") { + logger3 = void 0; + tryNextLink = options; + } else if (options != null && typeof options === "object") { + logger3 = options.logger; + tryNextLink = options.tryNextLink ?? true; + } + super(message2); + this.tryNextLink = tryNextLink; + Object.setPrototypeOf(this, _ProviderError.prototype); + logger3?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message2}`); + } + static from(error2, options = true) { + return Object.assign(new this(error2.message, options), error2); + } + }; + var CredentialsProviderError = class _CredentialsProviderError extends ProviderError2 { + name = "CredentialsProviderError"; + constructor(message2, options = true) { + super(message2, options); + Object.setPrototypeOf(this, _CredentialsProviderError.prototype); + } + }; + var TokenProviderError = class _TokenProviderError extends ProviderError2 { + name = "TokenProviderError"; + constructor(message2, options = true) { + super(message2, options); + Object.setPrototypeOf(this, _TokenProviderError.prototype); + } + }; + var chain = (...providers) => async () => { + if (providers.length === 0) { + throw new ProviderError2("No providers in chain"); + } + let lastProviderError; + for (const provider of providers) { + try { + const credentials = await provider(); + return credentials; + } catch (err) { + lastProviderError = err; + if (err?.tryNextLink) { + continue; + } + throw err; + } + } + throw lastProviderError; + }; + var fromStatic = (staticValue) => () => Promise.resolve(staticValue); + var memoize = (provider, isExpired, requiresRefresh) => { + let resolved; + let pending; + let hasResult; + let isConstant = false; + const coalesceProvider = async () => { + if (!pending) { + pending = provider(); + } + try { + resolved = await pending; + hasResult = true; + isConstant = false; + } finally { + pending = void 0; + } + return resolved; + }; + if (isExpired === void 0) { + return async (options) => { + if (!hasResult || options?.forceRefresh) { + resolved = await coalesceProvider(); + } + return resolved; + }; + } + return async (options) => { + if (!hasResult || options?.forceRefresh) { + resolved = await coalesceProvider(); + } + if (isConstant) { + return resolved; + } + if (requiresRefresh && !requiresRefresh(resolved)) { + isConstant = true; + return resolved; + } + if (isExpired(resolved)) { + await coalesceProvider(); + return resolved; + } + return resolved; + }; + }; + exports2.CredentialsProviderError = CredentialsProviderError; + exports2.ProviderError = ProviderError2; + exports2.TokenProviderError = TokenProviderError; + exports2.chain = chain; + exports2.fromStatic = fromStatic; + exports2.memoize = memoize; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js +var import_property_provider, resolveAwsSdkSigV4AConfig, NODE_SIGV4A_CONFIG_OPTIONS; +var init_resolveAwsSdkSigV4AConfig = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js"() { + init_dist_es(); + import_property_provider = __toESM(require_dist_cjs17()); + resolveAwsSdkSigV4AConfig = (config) => { + config.sigv4aSigningRegionSet = normalizeProvider(config.sigv4aSigningRegionSet); + return config; + }; + NODE_SIGV4A_CONFIG_OPTIONS = { + environmentVariableSelector(env) { + if (env.AWS_SIGV4A_SIGNING_REGION_SET) { + return env.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim()); + } + throw new import_property_provider.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", { + tryNextLink: true + }); + }, + configFileSelector(profile) { + if (profile.sigv4a_signing_region_set) { + return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim()); + } + throw new import_property_provider.ProviderError("sigv4a_signing_region_set not set in profile.", { + tryNextLink: true + }); + }, + default: void 0 + }; + } +}); + +// node_modules/@smithy/signature-v4/dist-cjs/index.js +var require_dist_cjs18 = __commonJS({ + "node_modules/@smithy/signature-v4/dist-cjs/index.js"(exports2) { + "use strict"; + var utilHexEncoding = require_dist_cjs14(); + var utilUtf8 = require_dist_cjs8(); + var isArrayBuffer = require_dist_cjs6(); + var protocolHttp = require_dist_cjs2(); + var utilMiddleware = require_dist_cjs4(); + var utilUriEscape = require_dist_cjs10(); + var ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; + var CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; + var AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; + var SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; + var EXPIRES_QUERY_PARAM = "X-Amz-Expires"; + var SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; + var TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; + var REGION_SET_PARAM = "X-Amz-Region-Set"; + var AUTH_HEADER = "authorization"; + var AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase(); + var DATE_HEADER = "date"; + var GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER]; + var SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase(); + var SHA256_HEADER = "x-amz-content-sha256"; + var TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase(); + var HOST_HEADER = "host"; + var ALWAYS_UNSIGNABLE_HEADERS = { + authorization: true, + "cache-control": true, + connection: true, + expect: true, + from: true, + "keep-alive": true, + "max-forwards": true, + pragma: true, + referer: true, + te: true, + trailer: true, + "transfer-encoding": true, + upgrade: true, + "user-agent": true, + "x-amzn-trace-id": true + }; + var PROXY_HEADER_PATTERN = /^proxy-/; + var SEC_HEADER_PATTERN = /^sec-/; + var UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i]; + var ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; + var ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256"; + var EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; + var UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; + var MAX_CACHE_SIZE = 50; + var KEY_TYPE_IDENTIFIER = "aws4_request"; + var MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; + var signingKeyCache = {}; + var cacheQueue = []; + var createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`; + var getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => { + const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); + const cacheKey = `${shortDate}:${region}:${service}:${utilHexEncoding.toHex(credsHash)}:${credentials.sessionToken}`; + if (cacheKey in signingKeyCache) { + return signingKeyCache[cacheKey]; + } + cacheQueue.push(cacheKey); + while (cacheQueue.length > MAX_CACHE_SIZE) { + delete signingKeyCache[cacheQueue.shift()]; + } + let key = `AWS4${credentials.secretAccessKey}`; + for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) { + key = await hmac(sha256Constructor, key, signable); + } + return signingKeyCache[cacheKey] = key; + }; + var clearCredentialCache = () => { + cacheQueue.length = 0; + Object.keys(signingKeyCache).forEach((cacheKey) => { + delete signingKeyCache[cacheKey]; + }); + }; + var hmac = (ctor, secret, data2) => { + const hash = new ctor(secret); + hash.update(utilUtf8.toUint8Array(data2)); + return hash.digest(); + }; + var getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) => { + const canonical = {}; + for (const headerName of Object.keys(headers).sort()) { + if (headers[headerName] == void 0) { + continue; + } + const canonicalHeaderName = headerName.toLowerCase(); + if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || unsignableHeaders?.has(canonicalHeaderName) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) { + if (!signableHeaders || signableHeaders && !signableHeaders.has(canonicalHeaderName)) { + continue; + } + } + canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " "); + } + return canonical; + }; + var getPayloadHash = async ({ headers, body }, hashConstructor) => { + for (const headerName of Object.keys(headers)) { + if (headerName.toLowerCase() === SHA256_HEADER) { + return headers[headerName]; + } + } + if (body == void 0) { + return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + } else if (typeof body === "string" || ArrayBuffer.isView(body) || isArrayBuffer.isArrayBuffer(body)) { + const hashCtor = new hashConstructor(); + hashCtor.update(utilUtf8.toUint8Array(body)); + return utilHexEncoding.toHex(await hashCtor.digest()); + } + return UNSIGNED_PAYLOAD; + }; + var HeaderFormatter = class { + format(headers) { + const chunks = []; + for (const headerName of Object.keys(headers)) { + const bytes = utilUtf8.fromUtf8(headerName); + chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName])); + } + const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0)); + let position = 0; + for (const chunk of chunks) { + out.set(chunk, position); + position += chunk.byteLength; + } + return out; + } + formatHeaderValue(header) { + switch (header.type) { + case "boolean": + return Uint8Array.from([header.value ? 0 : 1]); + case "byte": + return Uint8Array.from([2, header.value]); + case "short": + const shortView = new DataView(new ArrayBuffer(3)); + shortView.setUint8(0, 3); + shortView.setInt16(1, header.value, false); + return new Uint8Array(shortView.buffer); + case "integer": + const intView = new DataView(new ArrayBuffer(5)); + intView.setUint8(0, 4); + intView.setInt32(1, header.value, false); + return new Uint8Array(intView.buffer); + case "long": + const longBytes = new Uint8Array(9); + longBytes[0] = 5; + longBytes.set(header.value.bytes, 1); + return longBytes; + case "binary": + const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength)); + binView.setUint8(0, 6); + binView.setUint16(1, header.value.byteLength, false); + const binBytes = new Uint8Array(binView.buffer); + binBytes.set(header.value, 3); + return binBytes; + case "string": + const utf8Bytes = utilUtf8.fromUtf8(header.value); + const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); + strView.setUint8(0, 7); + strView.setUint16(1, utf8Bytes.byteLength, false); + const strBytes = new Uint8Array(strView.buffer); + strBytes.set(utf8Bytes, 3); + return strBytes; + case "timestamp": + const tsBytes = new Uint8Array(9); + tsBytes[0] = 8; + tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1); + return tsBytes; + case "uuid": + if (!UUID_PATTERN.test(header.value)) { + throw new Error(`Invalid UUID received: ${header.value}`); + } + const uuidBytes = new Uint8Array(17); + uuidBytes[0] = 9; + uuidBytes.set(utilHexEncoding.fromHex(header.value.replace(/\-/g, "")), 1); + return uuidBytes; + } + } + }; + var UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; + var Int64 = class _Int64 { + bytes; + constructor(bytes) { + this.bytes = bytes; + if (bytes.byteLength !== 8) { + throw new Error("Int64 buffers must be exactly 8 bytes"); + } + } + static fromNumber(number) { + if (number > 9223372036854776e3 || number < -9223372036854776e3) { + throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`); + } + const bytes = new Uint8Array(8); + for (let i4 = 7, remaining = Math.abs(Math.round(number)); i4 > -1 && remaining > 0; i4--, remaining /= 256) { + bytes[i4] = remaining; + } + if (number < 0) { + negate(bytes); + } + return new _Int64(bytes); + } + valueOf() { + const bytes = this.bytes.slice(0); + const negative = bytes[0] & 128; + if (negative) { + negate(bytes); + } + return parseInt(utilHexEncoding.toHex(bytes), 16) * (negative ? -1 : 1); + } + toString() { + return String(this.valueOf()); + } + }; + function negate(bytes) { + for (let i4 = 0; i4 < 8; i4++) { + bytes[i4] ^= 255; + } + for (let i4 = 7; i4 > -1; i4--) { + bytes[i4]++; + if (bytes[i4] !== 0) + break; + } + } + var hasHeader = (soughtHeader, headers) => { + soughtHeader = soughtHeader.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + return true; + } + } + return false; + }; + var moveHeadersToQuery = (request, options = {}) => { + const { headers, query = {} } = protocolHttp.HttpRequest.clone(request); + for (const name of Object.keys(headers)) { + const lname = name.toLowerCase(); + if (lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname) || options.hoistableHeaders?.has(lname)) { + query[name] = headers[name]; + delete headers[name]; + } + } + return { + ...request, + headers, + query + }; + }; + var prepareRequest = (request) => { + request = protocolHttp.HttpRequest.clone(request); + for (const headerName of Object.keys(request.headers)) { + if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { + delete request.headers[headerName]; + } + } + return request; + }; + var getCanonicalQuery = ({ query = {} }) => { + const keys = []; + const serialized = {}; + for (const key of Object.keys(query)) { + if (key.toLowerCase() === SIGNATURE_HEADER) { + continue; + } + const encodedKey = utilUriEscape.escapeUri(key); + keys.push(encodedKey); + const value = query[key]; + if (typeof value === "string") { + serialized[encodedKey] = `${encodedKey}=${utilUriEscape.escapeUri(value)}`; + } else if (Array.isArray(value)) { + serialized[encodedKey] = value.slice(0).reduce((encoded, value2) => encoded.concat([`${encodedKey}=${utilUriEscape.escapeUri(value2)}`]), []).sort().join("&"); + } + } + return keys.sort().map((key) => serialized[key]).filter((serialized2) => serialized2).join("&"); + }; + var iso8601 = (time2) => toDate(time2).toISOString().replace(/\.\d{3}Z$/, "Z"); + var toDate = (time2) => { + if (typeof time2 === "number") { + return new Date(time2 * 1e3); + } + if (typeof time2 === "string") { + if (Number(time2)) { + return new Date(Number(time2) * 1e3); + } + return new Date(time2); + } + return time2; + }; + var SignatureV4Base = class { + service; + regionProvider; + credentialProvider; + sha256; + uriEscapePath; + applyChecksum; + constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) { + this.service = service; + this.sha256 = sha256; + this.uriEscapePath = uriEscapePath; + this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; + this.regionProvider = utilMiddleware.normalizeProvider(region); + this.credentialProvider = utilMiddleware.normalizeProvider(credentials); + } + createCanonicalRequest(request, canonicalHeaders, payloadHash) { + const sortedHeaders = Object.keys(canonicalHeaders).sort(); + return `${request.method} +${this.getCanonicalPath(request)} +${getCanonicalQuery(request)} +${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} + +${sortedHeaders.join(";")} +${payloadHash}`; + } + async createStringToSign(longDate, credentialScope, canonicalRequest, algorithmIdentifier) { + const hash = new this.sha256(); + hash.update(utilUtf8.toUint8Array(canonicalRequest)); + const hashedRequest = await hash.digest(); + return `${algorithmIdentifier} +${longDate} +${credentialScope} +${utilHexEncoding.toHex(hashedRequest)}`; + } + getCanonicalPath({ path }) { + if (this.uriEscapePath) { + const normalizedPathSegments = []; + for (const pathSegment of path.split("/")) { + if (pathSegment?.length === 0) + continue; + if (pathSegment === ".") + continue; + if (pathSegment === "..") { + normalizedPathSegments.pop(); + } else { + normalizedPathSegments.push(pathSegment); + } + } + const normalizedPath = `${path?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path?.endsWith("/") ? "/" : ""}`; + const doubleEncoded = utilUriEscape.escapeUri(normalizedPath); + return doubleEncoded.replace(/%2F/g, "/"); + } + return path; + } + validateResolvedCredentials(credentials) { + if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") { + throw new Error("Resolved credential object is not valid"); + } + } + formatDate(now) { + const longDate = iso8601(now).replace(/[\-:]/g, ""); + return { + longDate, + shortDate: longDate.slice(0, 8) + }; + } + getCanonicalHeaderList(headers) { + return Object.keys(headers).sort().join(";"); + } + }; + var SignatureV42 = class extends SignatureV4Base { + headerFormatter = new HeaderFormatter(); + constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) { + super({ + applyChecksum, + credentials, + region, + service, + sha256, + uriEscapePath + }); + } + async presign(originalRequest, options = {}) { + const { signingDate = /* @__PURE__ */ new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, hoistableHeaders, signingRegion, signingService } = options; + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? await this.regionProvider(); + const { longDate, shortDate } = this.formatDate(signingDate); + if (expiresIn > MAX_PRESIGNED_TTL) { + return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future"); + } + const scope = createScope(shortDate, region, signingService ?? this.service); + const request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders, hoistableHeaders }); + if (credentials.sessionToken) { + request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken; + } + request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER; + request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; + request.query[AMZ_DATE_QUERY_PARAM] = longDate; + request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10); + const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); + request.query[SIGNED_HEADERS_QUERY_PARAM] = this.getCanonicalHeaderList(canonicalHeaders); + request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256))); + return request; + } + async sign(toSign, options) { + if (typeof toSign === "string") { + return this.signString(toSign, options); + } else if (toSign.headers && toSign.payload) { + return this.signEvent(toSign, options); + } else if (toSign.message) { + return this.signMessage(toSign, options); + } else { + return this.signRequest(toSign, options); + } + } + async signEvent({ headers, payload: payload2 }, { signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService }) { + const region = signingRegion ?? await this.regionProvider(); + const { shortDate, longDate } = this.formatDate(signingDate); + const scope = createScope(shortDate, region, signingService ?? this.service); + const hashedPayload = await getPayloadHash({ headers: {}, body: payload2 }, this.sha256); + const hash = new this.sha256(); + hash.update(headers); + const hashedHeaders = utilHexEncoding.toHex(await hash.digest()); + const stringToSign = [ + EVENT_ALGORITHM_IDENTIFIER, + longDate, + scope, + priorSignature, + hashedHeaders, + hashedPayload + ].join("\n"); + return this.signString(stringToSign, { signingDate, signingRegion: region, signingService }); + } + async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService }) { + const promise = this.signEvent({ + headers: this.headerFormatter.format(signableMessage.message.headers), + payload: signableMessage.message.body + }, { + signingDate, + signingRegion, + signingService, + priorSignature: signableMessage.priorSignature + }); + return promise.then((signature) => { + return { message: signableMessage.message, signature }; + }); + } + async signString(stringToSign, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? await this.regionProvider(); + const { shortDate } = this.formatDate(signingDate); + const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); + hash.update(utilUtf8.toUint8Array(stringToSign)); + return utilHexEncoding.toHex(await hash.digest()); + } + async signRequest(requestToSign, { signingDate = /* @__PURE__ */ new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService } = {}) { + const credentials = await this.credentialProvider(); + this.validateResolvedCredentials(credentials); + const region = signingRegion ?? await this.regionProvider(); + const request = prepareRequest(requestToSign); + const { longDate, shortDate } = this.formatDate(signingDate); + const scope = createScope(shortDate, region, signingService ?? this.service); + request.headers[AMZ_DATE_HEADER] = longDate; + if (credentials.sessionToken) { + request.headers[TOKEN_HEADER] = credentials.sessionToken; + } + const payloadHash = await getPayloadHash(request, this.sha256); + if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) { + request.headers[SHA256_HEADER] = payloadHash; + } + const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); + const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash)); + request.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`; + return request; + } + async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { + const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest, ALGORITHM_IDENTIFIER); + const hash = new this.sha256(await keyPromise); + hash.update(utilUtf8.toUint8Array(stringToSign)); + return utilHexEncoding.toHex(await hash.digest()); + } + getSigningKey(credentials, region, shortDate, service) { + return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service); + } + }; + var signatureV4aContainer = { + SignatureV4a: null + }; + exports2.ALGORITHM_IDENTIFIER = ALGORITHM_IDENTIFIER; + exports2.ALGORITHM_IDENTIFIER_V4A = ALGORITHM_IDENTIFIER_V4A; + exports2.ALGORITHM_QUERY_PARAM = ALGORITHM_QUERY_PARAM; + exports2.ALWAYS_UNSIGNABLE_HEADERS = ALWAYS_UNSIGNABLE_HEADERS; + exports2.AMZ_DATE_HEADER = AMZ_DATE_HEADER; + exports2.AMZ_DATE_QUERY_PARAM = AMZ_DATE_QUERY_PARAM; + exports2.AUTH_HEADER = AUTH_HEADER; + exports2.CREDENTIAL_QUERY_PARAM = CREDENTIAL_QUERY_PARAM; + exports2.DATE_HEADER = DATE_HEADER; + exports2.EVENT_ALGORITHM_IDENTIFIER = EVENT_ALGORITHM_IDENTIFIER; + exports2.EXPIRES_QUERY_PARAM = EXPIRES_QUERY_PARAM; + exports2.GENERATED_HEADERS = GENERATED_HEADERS; + exports2.HOST_HEADER = HOST_HEADER; + exports2.KEY_TYPE_IDENTIFIER = KEY_TYPE_IDENTIFIER; + exports2.MAX_CACHE_SIZE = MAX_CACHE_SIZE; + exports2.MAX_PRESIGNED_TTL = MAX_PRESIGNED_TTL; + exports2.PROXY_HEADER_PATTERN = PROXY_HEADER_PATTERN; + exports2.REGION_SET_PARAM = REGION_SET_PARAM; + exports2.SEC_HEADER_PATTERN = SEC_HEADER_PATTERN; + exports2.SHA256_HEADER = SHA256_HEADER; + exports2.SIGNATURE_HEADER = SIGNATURE_HEADER; + exports2.SIGNATURE_QUERY_PARAM = SIGNATURE_QUERY_PARAM; + exports2.SIGNED_HEADERS_QUERY_PARAM = SIGNED_HEADERS_QUERY_PARAM; + exports2.SignatureV4 = SignatureV42; + exports2.SignatureV4Base = SignatureV4Base; + exports2.TOKEN_HEADER = TOKEN_HEADER; + exports2.TOKEN_QUERY_PARAM = TOKEN_QUERY_PARAM; + exports2.UNSIGNABLE_PATTERNS = UNSIGNABLE_PATTERNS; + exports2.UNSIGNED_PAYLOAD = UNSIGNED_PAYLOAD; + exports2.clearCredentialCache = clearCredentialCache; + exports2.createScope = createScope; + exports2.getCanonicalHeaders = getCanonicalHeaders; + exports2.getCanonicalQuery = getCanonicalQuery; + exports2.getPayloadHash = getPayloadHash; + exports2.getSigningKey = getSigningKey; + exports2.hasHeader = hasHeader; + exports2.moveHeadersToQuery = moveHeadersToQuery; + exports2.prepareRequest = prepareRequest; + exports2.signatureV4aContainer = signatureV4aContainer; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js +function normalizeCredentialProvider(config, { credentials, credentialDefaultProvider }) { + let credentialsProvider; + if (credentials) { + if (!credentials?.memoized) { + credentialsProvider = memoizeIdentityProvider(credentials, isIdentityExpired, doesIdentityRequireRefresh); + } else { + credentialsProvider = credentials; + } + } else { + if (credentialDefaultProvider) { + credentialsProvider = normalizeProvider(credentialDefaultProvider(Object.assign({}, config, { + parentClientConfig: config + }))); + } else { + credentialsProvider = async () => { + throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured."); + }; + } + } + credentialsProvider.memoized = true; + return credentialsProvider; +} +function bindCallerConfig(config, credentialsProvider) { + if (credentialsProvider.configBound) { + return credentialsProvider; + } + const fn2 = async (options) => credentialsProvider({ ...options, callerClientConfig: config }); + fn2.memoized = credentialsProvider.memoized; + fn2.configBound = true; + return fn2; +} +var import_signature_v4, resolveAwsSdkSigV4Config, resolveAWSSDKSigV4Config; +var init_resolveAwsSdkSigV4Config = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js"() { + init_client(); + init_dist_es(); + import_signature_v4 = __toESM(require_dist_cjs18()); + resolveAwsSdkSigV4Config = (config) => { + let inputCredentials = config.credentials; + let isUserSupplied = !!config.credentials; + let resolvedCredentials = void 0; + Object.defineProperty(config, "credentials", { + set(credentials) { + if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) { + isUserSupplied = true; + } + inputCredentials = credentials; + const memoizedProvider = normalizeCredentialProvider(config, { + credentials: inputCredentials, + credentialDefaultProvider: config.credentialDefaultProvider + }); + const boundProvider = bindCallerConfig(config, memoizedProvider); + if (isUserSupplied && !boundProvider.attributed) { + const isCredentialObject = typeof inputCredentials === "object" && inputCredentials !== null; + resolvedCredentials = async (options) => { + const creds = await boundProvider(options); + const attributedCreds = creds; + if (isCredentialObject && (!attributedCreds.$source || Object.keys(attributedCreds.$source).length === 0)) { + return setCredentialFeature(attributedCreds, "CREDENTIALS_CODE", "e"); + } + return attributedCreds; + }; + resolvedCredentials.memoized = boundProvider.memoized; + resolvedCredentials.configBound = boundProvider.configBound; + resolvedCredentials.attributed = true; + } else { + resolvedCredentials = boundProvider; + } + }, + get() { + return resolvedCredentials; + }, + enumerable: true, + configurable: true + }); + config.credentials = inputCredentials; + const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256 } = config; + let signer; + if (config.signer) { + signer = normalizeProvider(config.signer); + } else if (config.regionInfoProvider) { + signer = () => normalizeProvider(config.region)().then(async (region) => [ + await config.regionInfoProvider(region, { + useFipsEndpoint: await config.useFipsEndpoint(), + useDualstackEndpoint: await config.useDualstackEndpoint() + }) || {}, + region + ]).then(([regionInfo, region]) => { + const { signingRegion, signingService } = regionInfo; + config.signingRegion = config.signingRegion || signingRegion || region; + config.signingName = config.signingName || signingService || config.serviceId; + const params = { + ...config, + credentials: config.credentials, + region: config.signingRegion, + service: config.signingName, + sha256, + uriEscapePath: signingEscapePath + }; + const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4; + return new SignerCtor(params); + }); + } else { + signer = async (authScheme) => { + authScheme = Object.assign({}, { + name: "sigv4", + signingName: config.signingName || config.defaultSigningName, + signingRegion: await normalizeProvider(config.region)(), + properties: {} + }, authScheme); + const signingRegion = authScheme.signingRegion; + const signingService = authScheme.signingName; + config.signingRegion = config.signingRegion || signingRegion; + config.signingName = config.signingName || signingService || config.serviceId; + const params = { + ...config, + credentials: config.credentials, + region: config.signingRegion, + service: config.signingName, + sha256, + uriEscapePath: signingEscapePath + }; + const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4; + return new SignerCtor(params); + }; + } + const resolvedConfig = Object.assign(config, { + systemClockOffset, + signingEscapePath, + signer + }); + return resolvedConfig; + }; + resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js +var init_aws_sdk = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js"() { + init_AwsSdkSigV4Signer(); + init_AwsSdkSigV4ASigner(); + init_NODE_AUTH_SCHEME_PREFERENCE_OPTIONS(); + init_resolveAwsSdkSigV4AConfig(); + init_resolveAwsSdkSigV4Config(); + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js +var httpAuthSchemes_exports = {}; +__export(httpAuthSchemes_exports, { + AWSSDKSigV4Signer: () => AWSSDKSigV4Signer, + AwsSdkSigV4ASigner: () => AwsSdkSigV4ASigner, + AwsSdkSigV4Signer: () => AwsSdkSigV4Signer, + NODE_AUTH_SCHEME_PREFERENCE_OPTIONS: () => NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, + NODE_SIGV4A_CONFIG_OPTIONS: () => NODE_SIGV4A_CONFIG_OPTIONS, + getBearerTokenEnvKey: () => getBearerTokenEnvKey, + resolveAWSSDKSigV4Config: () => resolveAWSSDKSigV4Config, + resolveAwsSdkSigV4AConfig: () => resolveAwsSdkSigV4AConfig, + resolveAwsSdkSigV4Config: () => resolveAwsSdkSigV4Config, + validateSigningProperties: () => validateSigningProperties +}); +var init_httpAuthSchemes2 = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js"() { + init_aws_sdk(); + init_getBearerTokenEnvKey(); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/cbor/cbor-types.js +function alloc(size) { + return typeof Buffer !== "undefined" ? Buffer.alloc(size) : new Uint8Array(size); +} +function tag(data2) { + data2[tagSymbol] = true; + return data2; +} +var majorUint64, majorNegativeInt64, majorUnstructuredByteString, majorUtf8String, majorList, majorMap, majorTag, majorSpecial, specialFalse, specialTrue, specialNull, specialUndefined, extendedOneByte, extendedFloat16, extendedFloat32, extendedFloat64, minorIndefinite, tagSymbol; +var init_cbor_types = __esm({ + "node_modules/@smithy/core/dist-es/submodules/cbor/cbor-types.js"() { + majorUint64 = 0; + majorNegativeInt64 = 1; + majorUnstructuredByteString = 2; + majorUtf8String = 3; + majorList = 4; + majorMap = 5; + majorTag = 6; + majorSpecial = 7; + specialFalse = 20; + specialTrue = 21; + specialNull = 22; + specialUndefined = 23; + extendedOneByte = 24; + extendedFloat16 = 25; + extendedFloat32 = 26; + extendedFloat64 = 27; + minorIndefinite = 31; + tagSymbol = /* @__PURE__ */ Symbol("@smithy/core/cbor::tagSymbol"); + } +}); + +// node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js +function setPayload(bytes) { + payload = bytes; + dataView = new DataView(payload.buffer, payload.byteOffset, payload.byteLength); +} +function decode(at, to) { + if (at >= to) { + throw new Error("unexpected end of (decode) payload."); + } + const major = (payload[at] & 224) >> 5; + const minor = payload[at] & 31; + switch (major) { + case majorUint64: + case majorNegativeInt64: + case majorTag: + let unsignedInt; + let offset; + if (minor < 24) { + unsignedInt = minor; + offset = 1; + } else { + switch (minor) { + case extendedOneByte: + case extendedFloat16: + case extendedFloat32: + case extendedFloat64: + const countLength = minorValueToArgumentLength[minor]; + const countOffset = countLength + 1; + offset = countOffset; + if (to - at < countOffset) { + throw new Error(`countLength ${countLength} greater than remaining buf len.`); + } + const countIndex = at + 1; + if (countLength === 1) { + unsignedInt = payload[countIndex]; + } else if (countLength === 2) { + unsignedInt = dataView.getUint16(countIndex); + } else if (countLength === 4) { + unsignedInt = dataView.getUint32(countIndex); + } else { + unsignedInt = dataView.getBigUint64(countIndex); + } + break; + default: + throw new Error(`unexpected minor value ${minor}.`); + } + } + if (major === majorUint64) { + _offset = offset; + return castBigInt(unsignedInt); + } else if (major === majorNegativeInt64) { + let negativeInt; + if (typeof unsignedInt === "bigint") { + negativeInt = BigInt(-1) - unsignedInt; + } else { + negativeInt = -1 - unsignedInt; + } + _offset = offset; + return castBigInt(negativeInt); + } else { + if (minor === 2 || minor === 3) { + const length = decodeCount(at + offset, to); + let b4 = BigInt(0); + const start = at + offset + _offset; + for (let i4 = start; i4 < start + length; ++i4) { + b4 = b4 << BigInt(8) | BigInt(payload[i4]); + } + _offset = offset + _offset + length; + return minor === 3 ? -b4 - BigInt(1) : b4; + } else if (minor === 4) { + const decimalFraction = decode(at + offset, to); + const [exponent, mantissa] = decimalFraction; + const normalizer = mantissa < 0 ? -1 : 1; + const mantissaStr = "0".repeat(Math.abs(exponent) + 1) + String(BigInt(normalizer) * BigInt(mantissa)); + let numericString; + const sign = mantissa < 0 ? "-" : ""; + numericString = exponent === 0 ? mantissaStr : mantissaStr.slice(0, mantissaStr.length + exponent) + "." + mantissaStr.slice(exponent); + numericString = numericString.replace(/^0+/g, ""); + if (numericString === "") { + numericString = "0"; + } + if (numericString[0] === ".") { + numericString = "0" + numericString; + } + numericString = sign + numericString; + _offset = offset + _offset; + return nv(numericString); + } else { + const value = decode(at + offset, to); + const valueOffset = _offset; + _offset = offset + valueOffset; + return tag({ tag: castBigInt(unsignedInt), value }); + } + } + case majorUtf8String: + case majorMap: + case majorList: + case majorUnstructuredByteString: + if (minor === minorIndefinite) { + switch (major) { + case majorUtf8String: + return decodeUtf8StringIndefinite(at, to); + case majorMap: + return decodeMapIndefinite(at, to); + case majorList: + return decodeListIndefinite(at, to); + case majorUnstructuredByteString: + return decodeUnstructuredByteStringIndefinite(at, to); + } + } else { + switch (major) { + case majorUtf8String: + return decodeUtf8String(at, to); + case majorMap: + return decodeMap(at, to); + case majorList: + return decodeList(at, to); + case majorUnstructuredByteString: + return decodeUnstructuredByteString(at, to); + } + } + default: + return decodeSpecial(at, to); + } +} +function bytesToUtf8(bytes, at, to) { + if (USE_BUFFER && bytes.constructor?.name === "Buffer") { + return bytes.toString("utf-8", at, to); + } + if (textDecoder) { + return textDecoder.decode(bytes.subarray(at, to)); + } + return (0, import_util_utf84.toUtf8)(bytes.subarray(at, to)); +} +function demote(bigInteger) { + const num = Number(bigInteger); + if (num < Number.MIN_SAFE_INTEGER || Number.MAX_SAFE_INTEGER < num) { + console.warn(new Error(`@smithy/core/cbor - truncating BigInt(${bigInteger}) to ${num} with loss of precision.`)); + } + return num; +} +function bytesToFloat16(a4, b4) { + const sign = a4 >> 7; + const exponent = (a4 & 124) >> 2; + const fraction = (a4 & 3) << 8 | b4; + const scalar = sign === 0 ? 1 : -1; + let exponentComponent; + let summation; + if (exponent === 0) { + if (fraction === 0) { + return 0; + } else { + exponentComponent = Math.pow(2, 1 - 15); + summation = 0; + } + } else if (exponent === 31) { + if (fraction === 0) { + return scalar * Infinity; + } else { + return NaN; + } + } else { + exponentComponent = Math.pow(2, exponent - 15); + summation = 1; + } + summation += fraction / 1024; + return scalar * (exponentComponent * summation); +} +function decodeCount(at, to) { + const minor = payload[at] & 31; + if (minor < 24) { + _offset = 1; + return minor; + } + if (minor === extendedOneByte || minor === extendedFloat16 || minor === extendedFloat32 || minor === extendedFloat64) { + const countLength = minorValueToArgumentLength[minor]; + _offset = countLength + 1; + if (to - at < _offset) { + throw new Error(`countLength ${countLength} greater than remaining buf len.`); + } + const countIndex = at + 1; + if (countLength === 1) { + return payload[countIndex]; + } else if (countLength === 2) { + return dataView.getUint16(countIndex); + } else if (countLength === 4) { + return dataView.getUint32(countIndex); + } + return demote(dataView.getBigUint64(countIndex)); + } + throw new Error(`unexpected minor value ${minor}.`); +} +function decodeUtf8String(at, to) { + const length = decodeCount(at, to); + const offset = _offset; + at += offset; + if (to - at < length) { + throw new Error(`string len ${length} greater than remaining buf len.`); + } + const value = bytesToUtf8(payload, at, at + length); + _offset = offset + length; + return value; +} +function decodeUtf8StringIndefinite(at, to) { + at += 1; + const vector = []; + for (const base = at; at < to; ) { + if (payload[at] === 255) { + const data2 = alloc(vector.length); + data2.set(vector, 0); + _offset = at - base + 2; + return bytesToUtf8(data2, 0, data2.length); + } + const major = (payload[at] & 224) >> 5; + const minor = payload[at] & 31; + if (major !== majorUtf8String) { + throw new Error(`unexpected major type ${major} in indefinite string.`); + } + if (minor === minorIndefinite) { + throw new Error("nested indefinite string."); + } + const bytes = decodeUnstructuredByteString(at, to); + const length = _offset; + at += length; + for (let i4 = 0; i4 < bytes.length; ++i4) { + vector.push(bytes[i4]); + } + } + throw new Error("expected break marker."); +} +function decodeUnstructuredByteString(at, to) { + const length = decodeCount(at, to); + const offset = _offset; + at += offset; + if (to - at < length) { + throw new Error(`unstructured byte string len ${length} greater than remaining buf len.`); + } + const value = payload.subarray(at, at + length); + _offset = offset + length; + return value; +} +function decodeUnstructuredByteStringIndefinite(at, to) { + at += 1; + const vector = []; + for (const base = at; at < to; ) { + if (payload[at] === 255) { + const data2 = alloc(vector.length); + data2.set(vector, 0); + _offset = at - base + 2; + return data2; + } + const major = (payload[at] & 224) >> 5; + const minor = payload[at] & 31; + if (major !== majorUnstructuredByteString) { + throw new Error(`unexpected major type ${major} in indefinite string.`); + } + if (minor === minorIndefinite) { + throw new Error("nested indefinite string."); + } + const bytes = decodeUnstructuredByteString(at, to); + const length = _offset; + at += length; + for (let i4 = 0; i4 < bytes.length; ++i4) { + vector.push(bytes[i4]); + } + } + throw new Error("expected break marker."); +} +function decodeList(at, to) { + const listDataLength = decodeCount(at, to); + const offset = _offset; + at += offset; + const base = at; + const list2 = Array(listDataLength); + for (let i4 = 0; i4 < listDataLength; ++i4) { + const item = decode(at, to); + const itemOffset = _offset; + list2[i4] = item; + at += itemOffset; + } + _offset = offset + (at - base); + return list2; +} +function decodeListIndefinite(at, to) { + at += 1; + const list2 = []; + for (const base = at; at < to; ) { + if (payload[at] === 255) { + _offset = at - base + 2; + return list2; + } + const item = decode(at, to); + const n4 = _offset; + at += n4; + list2.push(item); + } + throw new Error("expected break marker."); +} +function decodeMap(at, to) { + const mapDataLength = decodeCount(at, to); + const offset = _offset; + at += offset; + const base = at; + const map2 = {}; + for (let i4 = 0; i4 < mapDataLength; ++i4) { + if (at >= to) { + throw new Error("unexpected end of map payload."); + } + const major = (payload[at] & 224) >> 5; + if (major !== majorUtf8String) { + throw new Error(`unexpected major type ${major} for map key at index ${at}.`); + } + const key = decode(at, to); + at += _offset; + const value = decode(at, to); + at += _offset; + map2[key] = value; + } + _offset = offset + (at - base); + return map2; +} +function decodeMapIndefinite(at, to) { + at += 1; + const base = at; + const map2 = {}; + for (; at < to; ) { + if (at >= to) { + throw new Error("unexpected end of map payload."); + } + if (payload[at] === 255) { + _offset = at - base + 2; + return map2; + } + const major = (payload[at] & 224) >> 5; + if (major !== majorUtf8String) { + throw new Error(`unexpected major type ${major} for map key.`); + } + const key = decode(at, to); + at += _offset; + const value = decode(at, to); + at += _offset; + map2[key] = value; + } + throw new Error("expected break marker."); +} +function decodeSpecial(at, to) { + const minor = payload[at] & 31; + switch (minor) { + case specialTrue: + case specialFalse: + _offset = 1; + return minor === specialTrue; + case specialNull: + _offset = 1; + return null; + case specialUndefined: + _offset = 1; + return null; + case extendedFloat16: + if (to - at < 3) { + throw new Error("incomplete float16 at end of buf."); + } + _offset = 3; + return bytesToFloat16(payload[at + 1], payload[at + 2]); + case extendedFloat32: + if (to - at < 5) { + throw new Error("incomplete float32 at end of buf."); + } + _offset = 5; + return dataView.getFloat32(at + 1); + case extendedFloat64: + if (to - at < 9) { + throw new Error("incomplete float64 at end of buf."); + } + _offset = 9; + return dataView.getFloat64(at + 1); + default: + throw new Error(`unexpected minor value ${minor}.`); + } +} +function castBigInt(bigInt) { + if (typeof bigInt === "number") { + return bigInt; + } + const num = Number(bigInt); + if (Number.MIN_SAFE_INTEGER <= num && num <= Number.MAX_SAFE_INTEGER) { + return num; + } + return bigInt; +} +var import_util_utf84, USE_TEXT_DECODER, USE_BUFFER, payload, dataView, textDecoder, _offset, minorValueToArgumentLength; +var init_cbor_decode = __esm({ + "node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js"() { + init_serde(); + import_util_utf84 = __toESM(require_dist_cjs8()); + init_cbor_types(); + USE_TEXT_DECODER = typeof TextDecoder !== "undefined"; + USE_BUFFER = typeof Buffer !== "undefined"; + payload = alloc(0); + dataView = new DataView(payload.buffer, payload.byteOffset, payload.byteLength); + textDecoder = USE_TEXT_DECODER ? new TextDecoder() : null; + _offset = 0; + minorValueToArgumentLength = { + [extendedOneByte]: 1, + [extendedFloat16]: 2, + [extendedFloat32]: 4, + [extendedFloat64]: 8 + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +function ensureSpace(bytes) { + const remaining = data.byteLength - cursor; + if (remaining < bytes) { + if (cursor < 16e6) { + resize(Math.max(data.byteLength * 4, data.byteLength + bytes)); + } else { + resize(data.byteLength + bytes + 16e6); + } + } +} +function toUint8Array() { + const out = alloc(cursor); + out.set(data.subarray(0, cursor), 0); + cursor = 0; + return out; +} +function resize(size) { + const old = data; + data = alloc(size); + if (old) { + if (old.copy) { + old.copy(data, 0, 0, old.byteLength); + } else { + data.set(old, 0); + } + } + dataView2 = new DataView(data.buffer, data.byteOffset, data.byteLength); +} +function encodeHeader(major, value) { + if (value < 24) { + data[cursor++] = major << 5 | value; + } else if (value < 1 << 8) { + data[cursor++] = major << 5 | 24; + data[cursor++] = value; + } else if (value < 1 << 16) { + data[cursor++] = major << 5 | extendedFloat16; + dataView2.setUint16(cursor, value); + cursor += 2; + } else if (value < 2 ** 32) { + data[cursor++] = major << 5 | extendedFloat32; + dataView2.setUint32(cursor, value); + cursor += 4; + } else { + data[cursor++] = major << 5 | extendedFloat64; + dataView2.setBigUint64(cursor, typeof value === "bigint" ? value : BigInt(value)); + cursor += 8; + } +} +function encode(_input) { + const encodeStack = [_input]; + while (encodeStack.length) { + const input = encodeStack.pop(); + ensureSpace(typeof input === "string" ? input.length * 4 : 64); + if (typeof input === "string") { + if (USE_BUFFER2) { + encodeHeader(majorUtf8String, Buffer.byteLength(input)); + cursor += data.write(input, cursor); + } else { + const bytes = (0, import_util_utf85.fromUtf8)(input); + encodeHeader(majorUtf8String, bytes.byteLength); + data.set(bytes, cursor); + cursor += bytes.byteLength; + } + continue; + } else if (typeof input === "number") { + if (Number.isInteger(input)) { + const nonNegative = input >= 0; + const major = nonNegative ? majorUint64 : majorNegativeInt64; + const value = nonNegative ? input : -input - 1; + if (value < 24) { + data[cursor++] = major << 5 | value; + } else if (value < 256) { + data[cursor++] = major << 5 | 24; + data[cursor++] = value; + } else if (value < 65536) { + data[cursor++] = major << 5 | extendedFloat16; + data[cursor++] = value >> 8; + data[cursor++] = value; + } else if (value < 4294967296) { + data[cursor++] = major << 5 | extendedFloat32; + dataView2.setUint32(cursor, value); + cursor += 4; + } else { + data[cursor++] = major << 5 | extendedFloat64; + dataView2.setBigUint64(cursor, BigInt(value)); + cursor += 8; + } + continue; + } + data[cursor++] = majorSpecial << 5 | extendedFloat64; + dataView2.setFloat64(cursor, input); + cursor += 8; + continue; + } else if (typeof input === "bigint") { + const nonNegative = input >= 0; + const major = nonNegative ? majorUint64 : majorNegativeInt64; + const value = nonNegative ? input : -input - BigInt(1); + const n4 = Number(value); + if (n4 < 24) { + data[cursor++] = major << 5 | n4; + } else if (n4 < 256) { + data[cursor++] = major << 5 | 24; + data[cursor++] = n4; + } else if (n4 < 65536) { + data[cursor++] = major << 5 | extendedFloat16; + data[cursor++] = n4 >> 8; + data[cursor++] = n4 & 255; + } else if (n4 < 4294967296) { + data[cursor++] = major << 5 | extendedFloat32; + dataView2.setUint32(cursor, n4); + cursor += 4; + } else if (value < BigInt("18446744073709551616")) { + data[cursor++] = major << 5 | extendedFloat64; + dataView2.setBigUint64(cursor, value); + cursor += 8; + } else { + const binaryBigInt = value.toString(2); + const bigIntBytes = new Uint8Array(Math.ceil(binaryBigInt.length / 8)); + let b4 = value; + let i4 = 0; + while (bigIntBytes.byteLength - ++i4 >= 0) { + bigIntBytes[bigIntBytes.byteLength - i4] = Number(b4 & BigInt(255)); + b4 >>= BigInt(8); + } + ensureSpace(bigIntBytes.byteLength * 2); + data[cursor++] = nonNegative ? 194 : 195; + if (USE_BUFFER2) { + encodeHeader(majorUnstructuredByteString, Buffer.byteLength(bigIntBytes)); + } else { + encodeHeader(majorUnstructuredByteString, bigIntBytes.byteLength); + } + data.set(bigIntBytes, cursor); + cursor += bigIntBytes.byteLength; + } + continue; + } else if (input === null) { + data[cursor++] = majorSpecial << 5 | specialNull; + continue; + } else if (typeof input === "boolean") { + data[cursor++] = majorSpecial << 5 | (input ? specialTrue : specialFalse); + continue; + } else if (typeof input === "undefined") { + throw new Error("@smithy/core/cbor: client may not serialize undefined value."); + } else if (Array.isArray(input)) { + for (let i4 = input.length - 1; i4 >= 0; --i4) { + encodeStack.push(input[i4]); + } + encodeHeader(majorList, input.length); + continue; + } else if (typeof input.byteLength === "number") { + ensureSpace(input.length * 2); + encodeHeader(majorUnstructuredByteString, input.length); + data.set(input, cursor); + cursor += input.byteLength; + continue; + } else if (typeof input === "object") { + if (input instanceof NumericValue) { + const decimalIndex = input.string.indexOf("."); + const exponent = decimalIndex === -1 ? 0 : decimalIndex - input.string.length + 1; + const mantissa = BigInt(input.string.replace(".", "")); + data[cursor++] = 196; + encodeStack.push(mantissa); + encodeStack.push(exponent); + encodeHeader(majorList, 2); + continue; + } + if (input[tagSymbol]) { + if ("tag" in input && "value" in input) { + encodeStack.push(input.value); + encodeHeader(majorTag, input.tag); + continue; + } else { + throw new Error("tag encountered with missing fields, need 'tag' and 'value', found: " + JSON.stringify(input)); + } + } + const keys = Object.keys(input); + for (let i4 = keys.length - 1; i4 >= 0; --i4) { + const key = keys[i4]; + encodeStack.push(input[key]); + encodeStack.push(key); + } + encodeHeader(majorMap, keys.length); + continue; + } + throw new Error(`data type ${input?.constructor?.name ?? typeof input} not compatible for encoding.`); + } +} +var import_util_utf85, USE_BUFFER2, initialSize, data, dataView2, cursor; +var init_cbor_encode = __esm({ + "node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js"() { + init_serde(); + import_util_utf85 = __toESM(require_dist_cjs8()); + init_cbor_types(); + USE_BUFFER2 = typeof Buffer !== "undefined"; + initialSize = 2048; + data = alloc(initialSize); + dataView2 = new DataView(data.buffer, data.byteOffset, data.byteLength); + cursor = 0; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/cbor/cbor.js +var cbor; +var init_cbor = __esm({ + "node_modules/@smithy/core/dist-es/submodules/cbor/cbor.js"() { + init_cbor_decode(); + init_cbor_encode(); + cbor = { + deserialize(payload2) { + setPayload(payload2); + return decode(0, payload2.length); + }, + serialize(input) { + try { + encode(input); + return toUint8Array(); + } catch (e4) { + toUint8Array(); + throw e4; + } + }, + resizeEncodingBuffer(size) { + resize(size); + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +var dateToTag, loadSmithyRpcV2CborErrorCode; +var init_parseCborBody = __esm({ + "node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js"() { + init_cbor_types(); + dateToTag = (date2) => { + return tag({ + tag: 1, + value: date2.getTime() / 1e3 + }); + }; + loadSmithyRpcV2CborErrorCode = (output, data2) => { + const sanitizeErrorCode = (rawValue) => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); + } + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; + } + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + if (data2["__type"] !== void 0) { + return sanitizeErrorCode(data2["__type"]); + } + const codeKey = Object.keys(data2).find((key) => key.toLowerCase() === "code"); + if (codeKey && data2[codeKey] !== void 0) { + return sanitizeErrorCode(data2[codeKey]); + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +var import_util_base643, CborCodec, CborShapeSerializer, CborShapeDeserializer; +var init_CborCodec = __esm({ + "node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js"() { + init_protocols(); + init_schema(); + init_serde(); + init_serde(); + import_util_base643 = __toESM(require_dist_cjs9()); + init_cbor(); + init_parseCborBody(); + CborCodec = class extends SerdeContext { + createSerializer() { + const serializer = new CborShapeSerializer(); + serializer.setSerdeContext(this.serdeContext); + return serializer; + } + createDeserializer() { + const deserializer = new CborShapeDeserializer(); + deserializer.setSerdeContext(this.serdeContext); + return deserializer; + } + }; + CborShapeSerializer = class extends SerdeContext { + value; + write(schema, value) { + this.value = this.serialize(schema, value); + } + serialize(schema, source) { + const ns = NormalizedSchema.of(schema); + if (source == null) { + if (ns.isIdempotencyToken()) { + return (0, import_uuid.v4)(); + } + return source; + } + if (ns.isBlobSchema()) { + if (typeof source === "string") { + return (this.serdeContext?.base64Decoder ?? import_util_base643.fromBase64)(source); + } + return source; + } + if (ns.isTimestampSchema()) { + if (typeof source === "number" || typeof source === "bigint") { + return dateToTag(new Date(Number(source) / 1e3 | 0)); + } + return dateToTag(source); + } + if (typeof source === "function" || typeof source === "object") { + const sourceObject = source; + if (ns.isListSchema() && Array.isArray(sourceObject)) { + const sparse = !!ns.getMergedTraits().sparse; + const newArray = []; + let i4 = 0; + for (const item of sourceObject) { + const value = this.serialize(ns.getValueSchema(), item); + if (value != null || sparse) { + newArray[i4++] = value; + } + } + return newArray; + } + if (sourceObject instanceof Date) { + return dateToTag(sourceObject); + } + const newObject = {}; + if (ns.isMapSchema()) { + const sparse = !!ns.getMergedTraits().sparse; + for (const key of Object.keys(sourceObject)) { + const value = this.serialize(ns.getValueSchema(), sourceObject[key]); + if (value != null || sparse) { + newObject[key] = value; + } + } + } else if (ns.isStructSchema()) { + for (const [key, memberSchema] of ns.structIterator()) { + const value = this.serialize(memberSchema, sourceObject[key]); + if (value != null) { + newObject[key] = value; + } + } + const isUnion = ns.isUnionSchema(); + if (isUnion && Array.isArray(sourceObject.$unknown)) { + const [k4, v4] = sourceObject.$unknown; + newObject[k4] = v4; + } else if (typeof sourceObject.__type === "string") { + for (const [k4, v4] of Object.entries(sourceObject)) { + if (!(k4 in newObject)) { + newObject[k4] = this.serialize(15, v4); + } + } + } + } else if (ns.isDocumentSchema()) { + for (const key of Object.keys(sourceObject)) { + newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]); + } + } else if (ns.isBigDecimalSchema()) { + return sourceObject; + } + return newObject; + } + return source; + } + flush() { + const buffer = cbor.serialize(this.value); + this.value = void 0; + return buffer; + } + }; + CborShapeDeserializer = class extends SerdeContext { + read(schema, bytes) { + const data2 = cbor.deserialize(bytes); + return this.readValue(schema, data2); + } + readValue(_schema, value) { + const ns = NormalizedSchema.of(_schema); + if (ns.isTimestampSchema()) { + if (typeof value === "number") { + return _parseEpochTimestamp(value); + } + if (typeof value === "object") { + if (value.tag === 1 && "value" in value) { + return _parseEpochTimestamp(value.value); + } + } + } + if (ns.isBlobSchema()) { + if (typeof value === "string") { + return (this.serdeContext?.base64Decoder ?? import_util_base643.fromBase64)(value); + } + return value; + } + if (typeof value === "undefined" || typeof value === "boolean" || typeof value === "number" || typeof value === "string" || typeof value === "bigint" || typeof value === "symbol") { + return value; + } else if (typeof value === "object") { + if (value === null) { + return null; + } + if ("byteLength" in value) { + return value; + } + if (value instanceof Date) { + return value; + } + if (ns.isDocumentSchema()) { + return value; + } + if (ns.isListSchema()) { + const newArray = []; + const memberSchema = ns.getValueSchema(); + const sparse = !!ns.getMergedTraits().sparse; + for (const item of value) { + const itemValue = this.readValue(memberSchema, item); + if (itemValue != null || sparse) { + newArray.push(itemValue); + } + } + return newArray; + } + const newObject = {}; + if (ns.isMapSchema()) { + const sparse = !!ns.getMergedTraits().sparse; + const targetSchema = ns.getValueSchema(); + for (const key of Object.keys(value)) { + const itemValue = this.readValue(targetSchema, value[key]); + if (itemValue != null || sparse) { + newObject[key] = itemValue; + } + } + } else if (ns.isStructSchema()) { + const isUnion = ns.isUnionSchema(); + let keys; + if (isUnion) { + keys = new Set(Object.keys(value).filter((k4) => k4 !== "__type")); + } + for (const [key, memberSchema] of ns.structIterator()) { + if (isUnion) { + keys.delete(key); + } + if (value[key] != null) { + newObject[key] = this.readValue(memberSchema, value[key]); + } + } + if (isUnion && keys?.size === 1 && Object.keys(newObject).length === 0) { + const k4 = keys.values().next().value; + newObject.$unknown = [k4, value[k4]]; + } else if (typeof value.__type === "string") { + for (const [k4, v4] of Object.entries(value)) { + if (!(k4 in newObject)) { + newObject[k4] = v4; + } + } + } + } else if (value instanceof NumericValue) { + return value; + } + return newObject; + } else { + return value; + } + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +var import_util_middleware5, SmithyRpcV2CborProtocol; +var init_SmithyRpcV2CborProtocol = __esm({ + "node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js"() { + init_protocols(); + init_schema(); + init_schema(); + import_util_middleware5 = __toESM(require_dist_cjs4()); + init_CborCodec(); + init_parseCborBody(); + SmithyRpcV2CborProtocol = class extends RpcProtocol { + codec = new CborCodec(); + serializer = this.codec.createSerializer(); + deserializer = this.codec.createDeserializer(); + constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries4 }) { + super({ defaultNamespace, errorTypeRegistries: errorTypeRegistries4 }); + } + getShapeId() { + return "smithy.protocols#rpcv2Cbor"; + } + getPayloadCodec() { + return this.codec; + } + async serializeRequest(operationSchema, input, context) { + const request = await super.serializeRequest(operationSchema, input, context); + Object.assign(request.headers, { + "content-type": this.getDefaultContentType(), + "smithy-protocol": "rpc-v2-cbor", + accept: this.getDefaultContentType() + }); + if (deref(operationSchema.input) === "unit") { + delete request.body; + delete request.headers["content-type"]; + } else { + if (!request.body) { + this.serializer.write(15, {}); + request.body = this.serializer.flush(); + } + try { + request.headers["content-length"] = String(request.body.byteLength); + } catch (e4) { + } + } + const { service, operation: operation2 } = (0, import_util_middleware5.getSmithyContext)(context); + const path = `/service/${service}/operation/${operation2}`; + if (request.path.endsWith("/")) { + request.path += path.slice(1); + } else { + request.path += path; + } + return request; + } + async deserializeResponse(operationSchema, context, response) { + return super.deserializeResponse(operationSchema, context, response); + } + async handleError(operationSchema, context, response, dataObject, metadata) { + const errorName = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown"; + const errorMetadata = { + $metadata: metadata, + $fault: response.statusCode <= 500 ? "client" : "server" + }; + let namespace = this.options.defaultNamespace; + if (errorName.includes("#")) { + [namespace] = errorName.split("#"); + } + const registry = this.compositeErrorRegistry; + const nsRegistry = TypeRegistry.for(namespace); + registry.copyFrom(nsRegistry); + let errorSchema; + try { + errorSchema = registry.getSchema(errorName); + } catch (e4) { + if (dataObject.Message) { + dataObject.message = dataObject.Message; + } + const syntheticRegistry = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace); + registry.copyFrom(syntheticRegistry); + const baseExceptionSchema = registry.getBaseException(); + if (baseExceptionSchema) { + const ErrorCtor2 = registry.getErrorCtor(baseExceptionSchema); + throw Object.assign(new ErrorCtor2({ name: errorName }), errorMetadata, dataObject); + } + throw Object.assign(new Error(errorName), errorMetadata, dataObject); + } + const ns = NormalizedSchema.of(errorSchema); + const ErrorCtor = registry.getErrorCtor(errorSchema); + const message2 = dataObject.message ?? dataObject.Message ?? "Unknown"; + const exception = new ErrorCtor(message2); + const output = {}; + for (const [name, member2] of ns.structIterator()) { + output[name] = this.deserializer.readValue(member2, dataObject[name]); + } + throw Object.assign(exception, errorMetadata, { + $fault: ns.getMergedTraits().error, + message: message2 + }, output); + } + getDefaultContentType() { + return "application/cbor"; + } + }; + } +}); + +// node_modules/@smithy/core/dist-es/submodules/cbor/index.js +var init_cbor2 = __esm({ + "node_modules/@smithy/core/dist-es/submodules/cbor/index.js"() { + init_parseCborBody(); + init_SmithyRpcV2CborProtocol(); + init_CborCodec(); + } +}); + +// node_modules/@smithy/middleware-stack/dist-cjs/index.js +var require_dist_cjs19 = __commonJS({ + "node_modules/@smithy/middleware-stack/dist-cjs/index.js"(exports2) { + "use strict"; + var getAllAliases = (name, aliases) => { + const _aliases = []; + if (name) { + _aliases.push(name); + } + if (aliases) { + for (const alias of aliases) { + _aliases.push(alias); + } + } + return _aliases; + }; + var getMiddlewareNameWithAliases = (name, aliases) => { + return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`; + }; + var constructStack = () => { + let absoluteEntries = []; + let relativeEntries = []; + let identifyOnResolve = false; + const entriesNameSet = /* @__PURE__ */ new Set(); + const sort = (entries) => entries.sort((a4, b4) => stepWeights[b4.step] - stepWeights[a4.step] || priorityWeights[b4.priority || "normal"] - priorityWeights[a4.priority || "normal"]); + const removeByName = (toRemove) => { + let isRemoved = false; + const filterCb = (entry) => { + const aliases = getAllAliases(entry.name, entry.aliases); + if (aliases.includes(toRemove)) { + isRemoved = true; + for (const alias of aliases) { + entriesNameSet.delete(alias); + } + return false; + } + return true; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }; + const removeByReference = (toRemove) => { + let isRemoved = false; + const filterCb = (entry) => { + if (entry.middleware === toRemove) { + isRemoved = true; + for (const alias of getAllAliases(entry.name, entry.aliases)) { + entriesNameSet.delete(alias); + } + return false; + } + return true; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }; + const cloneTo = (toStack) => { + absoluteEntries.forEach((entry) => { + toStack.add(entry.middleware, { ...entry }); + }); + relativeEntries.forEach((entry) => { + toStack.addRelativeTo(entry.middleware, { ...entry }); + }); + toStack.identifyOnResolve?.(stack2.identifyOnResolve()); + return toStack; + }; + const expandRelativeMiddlewareList = (from) => { + const expandedMiddlewareList = []; + from.before.forEach((entry) => { + if (entry.before.length === 0 && entry.after.length === 0) { + expandedMiddlewareList.push(entry); + } else { + expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); + } + }); + expandedMiddlewareList.push(from); + from.after.reverse().forEach((entry) => { + if (entry.before.length === 0 && entry.after.length === 0) { + expandedMiddlewareList.push(entry); + } else { + expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); + } + }); + return expandedMiddlewareList; + }; + const getMiddlewareList = (debug = false) => { + const normalizedAbsoluteEntries = []; + const normalizedRelativeEntries = []; + const normalizedEntriesNameMap = {}; + absoluteEntries.forEach((entry) => { + const normalizedEntry = { + ...entry, + before: [], + after: [] + }; + for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { + normalizedEntriesNameMap[alias] = normalizedEntry; + } + normalizedAbsoluteEntries.push(normalizedEntry); + }); + relativeEntries.forEach((entry) => { + const normalizedEntry = { + ...entry, + before: [], + after: [] + }; + for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { + normalizedEntriesNameMap[alias] = normalizedEntry; + } + normalizedRelativeEntries.push(normalizedEntry); + }); + normalizedRelativeEntries.forEach((entry) => { + if (entry.toMiddleware) { + const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware]; + if (toMiddleware === void 0) { + if (debug) { + return; + } + throw new Error(`${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}`); + } + if (entry.relation === "after") { + toMiddleware.after.push(entry); + } + if (entry.relation === "before") { + toMiddleware.before.push(entry); + } + } + }); + const mainChain = sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce((wholeList, expandedMiddlewareList) => { + wholeList.push(...expandedMiddlewareList); + return wholeList; + }, []); + return mainChain; + }; + const stack2 = { + add: (middleware, options = {}) => { + const { name, override, aliases: _aliases } = options; + const entry = { + step: "initialize", + priority: "normal", + middleware, + ...options + }; + const aliases = getAllAliases(name, _aliases); + if (aliases.length > 0) { + if (aliases.some((alias) => entriesNameSet.has(alias))) { + if (!override) + throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); + for (const alias of aliases) { + const toOverrideIndex = absoluteEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a4) => a4 === alias)); + if (toOverrideIndex === -1) { + continue; + } + const toOverride = absoluteEntries[toOverrideIndex]; + if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) { + throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware with ${entry.priority} priority in ${entry.step} step.`); + } + absoluteEntries.splice(toOverrideIndex, 1); + } + } + for (const alias of aliases) { + entriesNameSet.add(alias); + } + } + absoluteEntries.push(entry); + }, + addRelativeTo: (middleware, options) => { + const { name, override, aliases: _aliases } = options; + const entry = { + middleware, + ...options + }; + const aliases = getAllAliases(name, _aliases); + if (aliases.length > 0) { + if (aliases.some((alias) => entriesNameSet.has(alias))) { + if (!override) + throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); + for (const alias of aliases) { + const toOverrideIndex = relativeEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a4) => a4 === alias)); + if (toOverrideIndex === -1) { + continue; + } + const toOverride = relativeEntries[toOverrideIndex]; + if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) { + throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware ${entry.relation} "${entry.toMiddleware}" middleware.`); + } + relativeEntries.splice(toOverrideIndex, 1); + } + } + for (const alias of aliases) { + entriesNameSet.add(alias); + } + } + relativeEntries.push(entry); + }, + clone: () => cloneTo(constructStack()), + use: (plugin) => { + plugin.applyToStack(stack2); + }, + remove: (toRemove) => { + if (typeof toRemove === "string") + return removeByName(toRemove); + else + return removeByReference(toRemove); + }, + removeByTag: (toRemove) => { + let isRemoved = false; + const filterCb = (entry) => { + const { tags, name, aliases: _aliases } = entry; + if (tags && tags.includes(toRemove)) { + const aliases = getAllAliases(name, _aliases); + for (const alias of aliases) { + entriesNameSet.delete(alias); + } + isRemoved = true; + return false; + } + return true; + }; + absoluteEntries = absoluteEntries.filter(filterCb); + relativeEntries = relativeEntries.filter(filterCb); + return isRemoved; + }, + concat: (from) => { + const cloned = cloneTo(constructStack()); + cloned.use(from); + cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || (from.identifyOnResolve?.() ?? false)); + return cloned; + }, + applyToStack: cloneTo, + identify: () => { + return getMiddlewareList(true).map((mw) => { + const step = mw.step ?? mw.relation + " " + mw.toMiddleware; + return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step; + }); + }, + identifyOnResolve(toggle) { + if (typeof toggle === "boolean") + identifyOnResolve = toggle; + return identifyOnResolve; + }, + resolve: (handler2, context) => { + for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) { + handler2 = middleware(handler2, context); + } + if (identifyOnResolve) { + console.log(stack2.identify()); + } + return handler2; + } + }; + return stack2; + }; + var stepWeights = { + initialize: 5, + serialize: 4, + build: 3, + finalizeRequest: 2, + deserialize: 1 + }; + var priorityWeights = { + high: 3, + normal: 2, + low: 1 + }; + exports2.constructStack = constructStack; + } +}); + +// node_modules/@smithy/smithy-client/dist-cjs/index.js +var require_dist_cjs20 = __commonJS({ + "node_modules/@smithy/smithy-client/dist-cjs/index.js"(exports2) { + "use strict"; + var middlewareStack = require_dist_cjs19(); + var protocols = (init_protocols(), __toCommonJS(protocols_exports)); + var types = require_dist_cjs(); + var schema = (init_schema(), __toCommonJS(schema_exports)); + var serde = (init_serde(), __toCommonJS(serde_exports)); + var Client = class { + config; + middlewareStack = middlewareStack.constructStack(); + initConfig; + handlers; + constructor(config) { + this.config = config; + const { protocol, protocolSettings } = config; + if (protocolSettings) { + if (typeof protocol === "function") { + config.protocol = new protocol(protocolSettings); + } + } + } + send(command, optionsOrCb, cb) { + const options = typeof optionsOrCb !== "function" ? optionsOrCb : void 0; + const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb; + const useHandlerCache = options === void 0 && this.config.cacheMiddleware === true; + let handler2; + if (useHandlerCache) { + if (!this.handlers) { + this.handlers = /* @__PURE__ */ new WeakMap(); + } + const handlers = this.handlers; + if (handlers.has(command.constructor)) { + handler2 = handlers.get(command.constructor); + } else { + handler2 = command.resolveMiddleware(this.middlewareStack, this.config, options); + handlers.set(command.constructor, handler2); + } + } else { + delete this.handlers; + handler2 = command.resolveMiddleware(this.middlewareStack, this.config, options); + } + if (callback) { + handler2(command).then((result) => callback(null, result.output), (err) => callback(err)).catch(() => { + }); + } else { + return handler2(command).then((result) => result.output); + } + } + destroy() { + this.config?.requestHandler?.destroy?.(); + delete this.handlers; + } + }; + var SENSITIVE_STRING$1 = "***SensitiveInformation***"; + function schemaLogFilter(schema$1, data2) { + if (data2 == null) { + return data2; + } + const ns = schema.NormalizedSchema.of(schema$1); + if (ns.getMergedTraits().sensitive) { + return SENSITIVE_STRING$1; + } + if (ns.isListSchema()) { + const isSensitive = !!ns.getValueSchema().getMergedTraits().sensitive; + if (isSensitive) { + return SENSITIVE_STRING$1; + } + } else if (ns.isMapSchema()) { + const isSensitive = !!ns.getKeySchema().getMergedTraits().sensitive || !!ns.getValueSchema().getMergedTraits().sensitive; + if (isSensitive) { + return SENSITIVE_STRING$1; + } + } else if (ns.isStructSchema() && typeof data2 === "object") { + const object = data2; + const newObject = {}; + for (const [member2, memberNs] of ns.structIterator()) { + if (object[member2] != null) { + newObject[member2] = schemaLogFilter(memberNs, object[member2]); + } + } + return newObject; + } + return data2; + } + var Command = class { + middlewareStack = middlewareStack.constructStack(); + schema; + static classBuilder() { + return new ClassBuilder(); + } + resolveMiddlewareWithContext(clientStack, configuration, options, { middlewareFn, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, smithyContext, additionalContext, CommandCtor }) { + for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) { + this.middlewareStack.use(mw); + } + const stack2 = clientStack.concat(this.middlewareStack); + const { logger: logger3 } = configuration; + const handlerExecutionContext = { + logger: logger3, + clientName, + commandName, + inputFilterSensitiveLog, + outputFilterSensitiveLog, + [types.SMITHY_CONTEXT_KEY]: { + commandInstance: this, + ...smithyContext + }, + ...additionalContext + }; + const { requestHandler } = configuration; + return stack2.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext); + } + }; + var ClassBuilder = class { + _init = () => { + }; + _ep = {}; + _middlewareFn = () => []; + _commandName = ""; + _clientName = ""; + _additionalContext = {}; + _smithyContext = {}; + _inputFilterSensitiveLog = void 0; + _outputFilterSensitiveLog = void 0; + _serializer = null; + _deserializer = null; + _operationSchema; + init(cb) { + this._init = cb; + } + ep(endpointParameterInstructions) { + this._ep = endpointParameterInstructions; + return this; + } + m(middlewareSupplier) { + this._middlewareFn = middlewareSupplier; + return this; + } + s(service, operation2, smithyContext = {}) { + this._smithyContext = { + service, + operation: operation2, + ...smithyContext + }; + return this; + } + c(additionalContext = {}) { + this._additionalContext = additionalContext; + return this; + } + n(clientName, commandName) { + this._clientName = clientName; + this._commandName = commandName; + return this; + } + f(inputFilter = (_) => _, outputFilter = (_) => _) { + this._inputFilterSensitiveLog = inputFilter; + this._outputFilterSensitiveLog = outputFilter; + return this; + } + ser(serializer) { + this._serializer = serializer; + return this; + } + de(deserializer) { + this._deserializer = deserializer; + return this; + } + sc(operation2) { + this._operationSchema = operation2; + this._smithyContext.operationSchema = operation2; + return this; + } + build() { + const closure = this; + let CommandRef; + return CommandRef = class extends Command { + input; + static getEndpointParameterInstructions() { + return closure._ep; + } + constructor(...[input]) { + super(); + this.input = input ?? {}; + closure._init(this); + this.schema = closure._operationSchema; + } + resolveMiddleware(stack2, configuration, options) { + const op2 = closure._operationSchema; + const input = op2?.[4] ?? op2?.input; + const output = op2?.[5] ?? op2?.output; + return this.resolveMiddlewareWithContext(stack2, configuration, options, { + CommandCtor: CommandRef, + middlewareFn: closure._middlewareFn, + clientName: closure._clientName, + commandName: closure._commandName, + inputFilterSensitiveLog: closure._inputFilterSensitiveLog ?? (op2 ? schemaLogFilter.bind(null, input) : (_) => _), + outputFilterSensitiveLog: closure._outputFilterSensitiveLog ?? (op2 ? schemaLogFilter.bind(null, output) : (_) => _), + smithyContext: closure._smithyContext, + additionalContext: closure._additionalContext + }); + } + serialize = closure._serializer; + deserialize = closure._deserializer; + }; + } + }; + var SENSITIVE_STRING = "***SensitiveInformation***"; + var createAggregatedClient4 = (commands4, Client2, options) => { + for (const [command, CommandCtor] of Object.entries(commands4)) { + const methodImpl = async function(args2, optionsOrCb, cb) { + const command2 = new CommandCtor(args2); + if (typeof optionsOrCb === "function") { + this.send(command2, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expected http options but got ${typeof optionsOrCb}`); + this.send(command2, optionsOrCb || {}, cb); + } else { + return this.send(command2, optionsOrCb); + } + }; + const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, ""); + Client2.prototype[methodName] = methodImpl; + } + const { paginators = {}, waiters = {} } = options ?? {}; + for (const [paginatorName, paginatorFn] of Object.entries(paginators)) { + if (Client2.prototype[paginatorName] === void 0) { + Client2.prototype[paginatorName] = function(commandInput = {}, paginationConfiguration, ...rest) { + return paginatorFn({ + ...paginationConfiguration, + client: this + }, commandInput, ...rest); + }; + } + } + for (const [waiterName, waiterFn] of Object.entries(waiters)) { + if (Client2.prototype[waiterName] === void 0) { + Client2.prototype[waiterName] = async function(commandInput = {}, waiterConfiguration, ...rest) { + let config = waiterConfiguration; + if (typeof waiterConfiguration === "number") { + config = { + maxWaitTime: waiterConfiguration + }; + } + return waiterFn({ + ...config, + client: this + }, commandInput, ...rest); + }; + } + } + }; + var ServiceException = class _ServiceException extends Error { + $fault; + $response; + $retryable; + $metadata; + constructor(options) { + super(options.message); + Object.setPrototypeOf(this, Object.getPrototypeOf(this).constructor.prototype); + this.name = options.name; + this.$fault = options.$fault; + this.$metadata = options.$metadata; + } + static isInstance(value) { + if (!value) + return false; + const candidate = value; + return _ServiceException.prototype.isPrototypeOf(candidate) || Boolean(candidate.$fault) && Boolean(candidate.$metadata) && (candidate.$fault === "client" || candidate.$fault === "server"); + } + static [Symbol.hasInstance](instance) { + if (!instance) + return false; + const candidate = instance; + if (this === _ServiceException) { + return _ServiceException.isInstance(instance); + } + if (_ServiceException.isInstance(instance)) { + if (candidate.name && this.name) { + return this.prototype.isPrototypeOf(instance) || candidate.name === this.name; + } + return this.prototype.isPrototypeOf(instance); + } + return false; + } + }; + var decorateServiceException2 = (exception, additions = {}) => { + Object.entries(additions).filter(([, v4]) => v4 !== void 0).forEach(([k4, v4]) => { + if (exception[k4] == void 0 || exception[k4] === "") { + exception[k4] = v4; + } + }); + const message2 = exception.message || exception.Message || "UnknownError"; + exception.message = message2; + delete exception.Message; + return exception; + }; + var throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }) => { + const $metadata = deserializeMetadata(output); + const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : void 0; + const response = new exceptionCtor({ + name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || "UnknownError", + $fault: "client", + $metadata + }); + throw decorateServiceException2(response, parsedBody); + }; + var withBaseException = (ExceptionCtor) => { + return ({ output, parsedBody, errorCode }) => { + throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode }); + }; + }; + var deserializeMetadata = (output) => ({ + httpStatusCode: output.statusCode, + requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"] + }); + var loadConfigsForDefaultMode4 = (mode) => { + switch (mode) { + case "standard": + return { + retryMode: "standard", + connectionTimeout: 3100 + }; + case "in-region": + return { + retryMode: "standard", + connectionTimeout: 1100 + }; + case "cross-region": + return { + retryMode: "standard", + connectionTimeout: 3100 + }; + case "mobile": + return { + retryMode: "standard", + connectionTimeout: 3e4 + }; + default: + return {}; + } + }; + var warningEmitted = false; + var emitWarningIfUnsupportedVersion5 = (version) => { + if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) { + warningEmitted = true; + } + }; + var getChecksumConfiguration = (runtimeConfig) => { + const checksumAlgorithms = []; + for (const id in types.AlgorithmId) { + const algorithmId = types.AlgorithmId[id]; + if (runtimeConfig[algorithmId] === void 0) { + continue; + } + checksumAlgorithms.push({ + algorithmId: () => algorithmId, + checksumConstructor: () => runtimeConfig[algorithmId] + }); + } + return { + addChecksumAlgorithm(algo) { + checksumAlgorithms.push(algo); + }, + checksumAlgorithms() { + return checksumAlgorithms; + } + }; + }; + var resolveChecksumRuntimeConfig = (clientConfig) => { + const runtimeConfig = {}; + clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { + runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); + }); + return runtimeConfig; + }; + var getRetryConfiguration = (runtimeConfig) => { + return { + setRetryStrategy(retryStrategy) { + runtimeConfig.retryStrategy = retryStrategy; + }, + retryStrategy() { + return runtimeConfig.retryStrategy; + } + }; + }; + var resolveRetryRuntimeConfig = (retryStrategyConfiguration) => { + const runtimeConfig = {}; + runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); + return runtimeConfig; + }; + var getDefaultExtensionConfiguration4 = (runtimeConfig) => { + return Object.assign(getChecksumConfiguration(runtimeConfig), getRetryConfiguration(runtimeConfig)); + }; + var getDefaultClientConfiguration = getDefaultExtensionConfiguration4; + var resolveDefaultRuntimeConfig4 = (config) => { + return Object.assign(resolveChecksumRuntimeConfig(config), resolveRetryRuntimeConfig(config)); + }; + var getArrayIfSingleItem = (mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray]; + var getValueFromTextNode3 = (obj) => { + const textNodeName = "#text"; + for (const key in obj) { + if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== void 0) { + obj[key] = obj[key][textNodeName]; + } else if (typeof obj[key] === "object" && obj[key] !== null) { + obj[key] = getValueFromTextNode3(obj[key]); + } + } + return obj; + }; + var isSerializableHeaderValue = (value) => { + return value != null; + }; + var NoOpLogger4 = class { + trace() { + } + debug() { + } + info() { + } + warn() { + } + error() { + } + }; + function map2(arg0, arg1, arg2) { + let target; + let filter; + let instructions; + if (typeof arg1 === "undefined" && typeof arg2 === "undefined") { + target = {}; + instructions = arg0; + } else { + target = arg0; + if (typeof arg1 === "function") { + filter = arg1; + instructions = arg2; + return mapWithFilter(target, filter, instructions); + } else { + instructions = arg1; + } + } + for (const key of Object.keys(instructions)) { + if (!Array.isArray(instructions[key])) { + target[key] = instructions[key]; + continue; + } + applyInstruction(target, null, instructions, key); + } + return target; + } + var convertMap = (target) => { + const output = {}; + for (const [k4, v4] of Object.entries(target || {})) { + output[k4] = [, v4]; + } + return output; + }; + var take = (source, instructions) => { + const out = {}; + for (const key in instructions) { + applyInstruction(out, source, instructions, key); + } + return out; + }; + var mapWithFilter = (target, filter, instructions) => { + return map2(target, Object.entries(instructions).reduce((_instructions, [key, value]) => { + if (Array.isArray(value)) { + _instructions[key] = value; + } else { + if (typeof value === "function") { + _instructions[key] = [filter, value()]; + } else { + _instructions[key] = [filter, value]; + } + } + return _instructions; + }, {})); + }; + var applyInstruction = (target, source, instructions, targetKey) => { + if (source !== null) { + let instruction = instructions[targetKey]; + if (typeof instruction === "function") { + instruction = [, instruction]; + } + const [filter2 = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction; + if (typeof filter2 === "function" && filter2(source[sourceKey]) || typeof filter2 !== "function" && !!filter2) { + target[targetKey] = valueFn(source[sourceKey]); + } + return; + } + let [filter, value] = instructions[targetKey]; + if (typeof value === "function") { + let _value; + const defaultFilterPassed = filter === void 0 && (_value = value()) != null; + const customFilterPassed = typeof filter === "function" && !!filter(void 0) || typeof filter !== "function" && !!filter; + if (defaultFilterPassed) { + target[targetKey] = _value; + } else if (customFilterPassed) { + target[targetKey] = value(); + } + } else { + const defaultFilterPassed = filter === void 0 && value != null; + const customFilterPassed = typeof filter === "function" && !!filter(value) || typeof filter !== "function" && !!filter; + if (defaultFilterPassed || customFilterPassed) { + target[targetKey] = value; + } + } + }; + var nonNullish = (_) => _ != null; + var pass = (_) => _; + var serializeFloat = (value) => { + if (value !== value) { + return "NaN"; + } + switch (value) { + case Infinity: + return "Infinity"; + case -Infinity: + return "-Infinity"; + default: + return value; + } + }; + var serializeDateTime = (date2) => date2.toISOString().replace(".000Z", "Z"); + var _json = (obj) => { + if (obj == null) { + return {}; + } + if (Array.isArray(obj)) { + return obj.filter((_) => _ != null).map(_json); + } + if (typeof obj === "object") { + const target = {}; + for (const key of Object.keys(obj)) { + if (obj[key] == null) { + continue; + } + target[key] = _json(obj[key]); + } + return target; + } + return obj; + }; + Object.defineProperty(exports2, "collectBody", { + enumerable: true, + get: function() { + return protocols.collectBody; + } + }); + Object.defineProperty(exports2, "extendedEncodeURIComponent", { + enumerable: true, + get: function() { + return protocols.extendedEncodeURIComponent; + } + }); + Object.defineProperty(exports2, "resolvedPath", { + enumerable: true, + get: function() { + return protocols.resolvedPath; + } + }); + exports2.Client = Client; + exports2.Command = Command; + exports2.NoOpLogger = NoOpLogger4; + exports2.SENSITIVE_STRING = SENSITIVE_STRING; + exports2.ServiceException = ServiceException; + exports2._json = _json; + exports2.convertMap = convertMap; + exports2.createAggregatedClient = createAggregatedClient4; + exports2.decorateServiceException = decorateServiceException2; + exports2.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion5; + exports2.getArrayIfSingleItem = getArrayIfSingleItem; + exports2.getDefaultClientConfiguration = getDefaultClientConfiguration; + exports2.getDefaultExtensionConfiguration = getDefaultExtensionConfiguration4; + exports2.getValueFromTextNode = getValueFromTextNode3; + exports2.isSerializableHeaderValue = isSerializableHeaderValue; + exports2.loadConfigsForDefaultMode = loadConfigsForDefaultMode4; + exports2.map = map2; + exports2.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig4; + exports2.serializeDateTime = serializeDateTime; + exports2.serializeFloat = serializeFloat; + exports2.take = take; + exports2.throwDefaultError = throwDefaultError; + exports2.withBaseException = withBaseException; + Object.keys(serde).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return serde[k4]; + } + }); + }); + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js +var import_smithy_client, ProtocolLib; +var init_ProtocolLib = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js"() { + init_schema(); + import_smithy_client = __toESM(require_dist_cjs20()); + ProtocolLib = class { + queryCompat; + constructor(queryCompat = false) { + this.queryCompat = queryCompat; + } + resolveRestContentType(defaultContentType, inputSchema) { + const members = inputSchema.getMemberSchemas(); + const httpPayloadMember = Object.values(members).find((m4) => { + return !!m4.getMergedTraits().httpPayload; + }); + if (httpPayloadMember) { + const mediaType = httpPayloadMember.getMergedTraits().mediaType; + if (mediaType) { + return mediaType; + } else if (httpPayloadMember.isStringSchema()) { + return "text/plain"; + } else if (httpPayloadMember.isBlobSchema()) { + return "application/octet-stream"; + } else { + return defaultContentType; + } + } else if (!inputSchema.isUnitSchema()) { + const hasBody = Object.values(members).find((m4) => { + const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m4.getMergedTraits(); + const noPrefixHeaders = httpPrefixHeaders === void 0; + return !httpQuery && !httpQueryParams && !httpHeader && !httpLabel && noPrefixHeaders; + }); + if (hasBody) { + return defaultContentType; + } + } + } + async getErrorSchemaOrThrowBaseException(errorIdentifier, defaultNamespace, response, dataObject, metadata, getErrorSchema) { + let namespace = defaultNamespace; + let errorName = errorIdentifier; + if (errorIdentifier.includes("#")) { + [namespace, errorName] = errorIdentifier.split("#"); + } + const errorMetadata = { + $metadata: metadata, + $fault: response.statusCode < 500 ? "client" : "server" + }; + const registry = TypeRegistry.for(namespace); + try { + const errorSchema = getErrorSchema?.(registry, errorName) ?? registry.getSchema(errorIdentifier); + return { errorSchema, errorMetadata }; + } catch (e4) { + dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError"; + const synthetic = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace); + const baseExceptionSchema = synthetic.getBaseException(); + if (baseExceptionSchema) { + const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error; + throw this.decorateServiceException(Object.assign(new ErrorCtor({ name: errorName }), errorMetadata), dataObject); + } + throw this.decorateServiceException(Object.assign(new Error(errorName), errorMetadata), dataObject); + } + } + decorateServiceException(exception, additions = {}) { + if (this.queryCompat) { + const msg = exception.Message ?? additions.Message; + const error2 = (0, import_smithy_client.decorateServiceException)(exception, additions); + if (msg) { + error2.message = msg; + } + error2.Error = { + ...error2.Error, + Type: error2.Error.Type, + Code: error2.Error.Code, + Message: error2.Error.message ?? error2.Error.Message ?? msg + }; + const reqId = error2.$metadata.requestId; + if (reqId) { + error2.RequestId = reqId; + } + return error2; + } + return (0, import_smithy_client.decorateServiceException)(exception, additions); + } + setQueryCompatError(output, response) { + const queryErrorHeader = response.headers?.["x-amzn-query-error"]; + if (output !== void 0 && queryErrorHeader != null) { + const [Code, Type] = queryErrorHeader.split(";"); + const entries = Object.entries(output); + const Error2 = { + Code, + Type + }; + Object.assign(output, Error2); + for (const [k4, v4] of entries) { + Error2[k4 === "message" ? "Message" : k4] = v4; + } + delete Error2.__type; + output.Error = Error2; + } + } + queryCompatOutput(queryCompatErrorData, errorData) { + if (queryCompatErrorData.Error) { + errorData.Error = queryCompatErrorData.Error; + } + if (queryCompatErrorData.Type) { + errorData.Type = queryCompatErrorData.Type; + } + if (queryCompatErrorData.Code) { + errorData.Code = queryCompatErrorData.Code; + } + } + findQueryCompatibleError(registry, errorName) { + try { + return registry.getSchema(errorName); + } catch (e4) { + return registry.find((schema) => NormalizedSchema.of(schema).getMergedTraits().awsQueryError?.[0] === errorName); + } + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js +var AwsSmithyRpcV2CborProtocol; +var init_AwsSmithyRpcV2CborProtocol = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js"() { + init_cbor2(); + init_schema(); + init_ProtocolLib(); + AwsSmithyRpcV2CborProtocol = class extends SmithyRpcV2CborProtocol { + awsQueryCompatible; + mixin; + constructor({ defaultNamespace, awsQueryCompatible }) { + super({ defaultNamespace }); + this.awsQueryCompatible = !!awsQueryCompatible; + this.mixin = new ProtocolLib(this.awsQueryCompatible); + } + async serializeRequest(operationSchema, input, context) { + const request = await super.serializeRequest(operationSchema, input, context); + if (this.awsQueryCompatible) { + request.headers["x-amzn-query-mode"] = "true"; + } + return request; + } + async handleError(operationSchema, context, response, dataObject, metadata) { + if (this.awsQueryCompatible) { + this.mixin.setQueryCompatError(dataObject, response); + } + const errorName = (() => { + const compatHeader = response.headers["x-amzn-query-error"]; + if (compatHeader && this.awsQueryCompatible) { + return compatHeader.split(";")[0]; + } + return loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown"; + })(); + const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : void 0); + const ns = NormalizedSchema.of(errorSchema); + const message2 = dataObject.message ?? dataObject.Message ?? "Unknown"; + const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; + const exception = new ErrorCtor(message2); + const output = {}; + for (const [name, member2] of ns.structIterator()) { + if (dataObject[name] != null) { + output[name] = this.deserializer.readValue(member2, dataObject[name]); + } + } + if (this.awsQueryCompatible) { + this.mixin.queryCompatOutput(dataObject, output); + } + throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { + $fault: ns.getMergedTraits().error, + message: message2 + }, output), dataObject); + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js +var _toStr, _toBool, _toNum; +var init_coercing_serializers = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js"() { + _toStr = (val) => { + if (val == null) { + return val; + } + if (typeof val === "number" || typeof val === "bigint") { + const warning = new Error(`Received number ${val} where a string was expected.`); + warning.name = "Warning"; + console.warn(warning); + return String(val); + } + if (typeof val === "boolean") { + const warning = new Error(`Received boolean ${val} where a string was expected.`); + warning.name = "Warning"; + console.warn(warning); + return String(val); + } + return val; + }; + _toBool = (val) => { + if (val == null) { + return val; + } + if (typeof val === "number") { + } + if (typeof val === "string") { + const lowercase = val.toLowerCase(); + if (val !== "" && lowercase !== "false" && lowercase !== "true") { + const warning = new Error(`Received string "${val}" where a boolean was expected.`); + warning.name = "Warning"; + console.warn(warning); + } + return val !== "" && lowercase !== "false"; + } + return val; + }; + _toNum = (val) => { + if (val == null) { + return val; + } + if (typeof val === "boolean") { + } + if (typeof val === "string") { + const num = Number(val); + if (num.toString() !== val) { + const warning = new Error(`Received string "${val}" where a number was expected.`); + warning.name = "Warning"; + console.warn(warning); + return val; + } + return num; + } + return val; + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js +var SerdeContextConfig; +var init_ConfigurableSerdeContext = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js"() { + SerdeContextConfig = class { + serdeContext; + setSerdeContext(serdeContext) { + this.serdeContext = serdeContext; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js +var UnionSerde; +var init_UnionSerde = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js"() { + UnionSerde = class { + from; + to; + keys; + constructor(from, to) { + this.from = from; + this.to = to; + this.keys = new Set(Object.keys(this.from).filter((k4) => k4 !== "__type")); + } + mark(key) { + this.keys.delete(key); + } + hasUnknown() { + return this.keys.size === 1 && Object.keys(this.to).length === 0; + } + writeUnknown() { + if (this.hasUnknown()) { + const k4 = this.keys.values().next().value; + const v4 = this.from[k4]; + this.to.$unknown = [k4, v4]; + } + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js +function jsonReviver(key, value, context) { + if (context?.source) { + const numericString = context.source; + if (typeof value === "number") { + if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER || numericString !== String(value)) { + const isFractional = numericString.includes("."); + if (isFractional) { + return new NumericValue(numericString, "bigDecimal"); + } else { + return BigInt(numericString); + } + } + } + } + return value; +} +var init_jsonReviver = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js"() { + init_serde(); + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js +var import_smithy_client2, import_util_utf86, collectBodyString; +var init_common = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js"() { + import_smithy_client2 = __toESM(require_dist_cjs20()); + import_util_utf86 = __toESM(require_dist_cjs8()); + collectBodyString = (streamBody, context) => (0, import_smithy_client2.collectBody)(streamBody, context).then((body) => (context?.utf8Encoder ?? import_util_utf86.toUtf8)(body)); + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +var parseJsonBody, parseJsonErrorBody, loadRestJsonErrorCode; +var init_parseJsonBody = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js"() { + init_common(); + parseJsonBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + try { + return JSON.parse(encoded); + } catch (e4) { + if (e4?.name === "SyntaxError") { + Object.defineProperty(e4, "$responseBodyText", { + value: encoded + }); + } + throw e4; + } + } + return {}; + }); + parseJsonErrorBody = async (errorBody, context) => { + const value = await parseJsonBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; + }; + loadRestJsonErrorCode = (output, data2) => { + const findKey = (object, key) => Object.keys(object).find((k4) => k4.toLowerCase() === key.toLowerCase()); + const sanitizeErrorCode = (rawValue) => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); + } + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; + } + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== void 0) { + return sanitizeErrorCode(output.headers[headerKey]); + } + if (data2 && typeof data2 === "object") { + const codeKey = findKey(data2, "code"); + if (codeKey && data2[codeKey] !== void 0) { + return sanitizeErrorCode(data2[codeKey]); + } + if (data2["__type"] !== void 0) { + return sanitizeErrorCode(data2["__type"]); + } + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +var import_util_base644, JsonShapeDeserializer; +var init_JsonShapeDeserializer = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js"() { + init_protocols(); + init_schema(); + init_serde(); + import_util_base644 = __toESM(require_dist_cjs9()); + init_ConfigurableSerdeContext(); + init_UnionSerde(); + init_jsonReviver(); + init_parseJsonBody(); + JsonShapeDeserializer = class extends SerdeContextConfig { + settings; + constructor(settings) { + super(); + this.settings = settings; + } + async read(schema, data2) { + return this._read(schema, typeof data2 === "string" ? JSON.parse(data2, jsonReviver) : await parseJsonBody(data2, this.serdeContext)); + } + readObject(schema, data2) { + return this._read(schema, data2); + } + _read(schema, value) { + const isObject = value !== null && typeof value === "object"; + const ns = NormalizedSchema.of(schema); + if (isObject) { + if (ns.isStructSchema()) { + const record = value; + const union = ns.isUnionSchema(); + const out = {}; + let nameMap = void 0; + const { jsonName } = this.settings; + if (jsonName) { + nameMap = {}; + } + let unionSerde; + if (union) { + unionSerde = new UnionSerde(record, out); + } + for (const [memberName, memberSchema] of ns.structIterator()) { + let fromKey = memberName; + if (jsonName) { + fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey; + nameMap[fromKey] = memberName; + } + if (union) { + unionSerde.mark(fromKey); + } + if (record[fromKey] != null) { + out[memberName] = this._read(memberSchema, record[fromKey]); + } + } + if (union) { + unionSerde.writeUnknown(); + } else if (typeof record.__type === "string") { + for (const [k4, v4] of Object.entries(record)) { + const t4 = jsonName ? nameMap[k4] ?? k4 : k4; + if (!(t4 in out)) { + out[t4] = v4; + } + } + } + return out; + } + if (Array.isArray(value) && ns.isListSchema()) { + const listMember = ns.getValueSchema(); + const out = []; + const sparse = !!ns.getMergedTraits().sparse; + for (const item of value) { + if (sparse || item != null) { + out.push(this._read(listMember, item)); + } + } + return out; + } + if (ns.isMapSchema()) { + const mapMember = ns.getValueSchema(); + const out = {}; + const sparse = !!ns.getMergedTraits().sparse; + for (const [_k, _v] of Object.entries(value)) { + if (sparse || _v != null) { + out[_k] = this._read(mapMember, _v); + } + } + return out; + } + } + if (ns.isBlobSchema() && typeof value === "string") { + return (0, import_util_base644.fromBase64)(value); + } + const mediaType = ns.getMergedTraits().mediaType; + if (ns.isStringSchema() && typeof value === "string" && mediaType) { + const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); + if (isJson) { + return LazyJsonString.from(value); + } + return value; + } + if (ns.isTimestampSchema() && value != null) { + const format2 = determineTimestampFormat(ns, this.settings); + switch (format2) { + case 5: + return parseRfc3339DateTimeWithOffset(value); + case 6: + return parseRfc7231DateTime(value); + case 7: + return parseEpochTimestamp(value); + default: + console.warn("Missing timestamp format, parsing value with Date constructor:", value); + return new Date(value); + } + } + if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) { + return BigInt(value); + } + if (ns.isBigDecimalSchema() && value != void 0) { + if (value instanceof NumericValue) { + return value; + } + const untyped = value; + if (untyped.type === "bigDecimal" && "string" in untyped) { + return new NumericValue(untyped.string, untyped.type); + } + return new NumericValue(String(value), "bigDecimal"); + } + if (ns.isNumericSchema() && typeof value === "string") { + switch (value) { + case "Infinity": + return Infinity; + case "-Infinity": + return -Infinity; + case "NaN": + return NaN; + } + return value; + } + if (ns.isDocumentSchema()) { + if (isObject) { + const out = Array.isArray(value) ? [] : {}; + for (const [k4, v4] of Object.entries(value)) { + if (v4 instanceof NumericValue) { + out[k4] = v4; + } else { + out[k4] = this._read(ns, v4); + } + } + return out; + } else { + return structuredClone(value); + } + } + return value; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js +var NUMERIC_CONTROL_CHAR, JsonReplacer; +var init_jsonReplacer = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js"() { + init_serde(); + NUMERIC_CONTROL_CHAR = String.fromCharCode(925); + JsonReplacer = class { + values = /* @__PURE__ */ new Map(); + counter = 0; + stage = 0; + createReplacer() { + if (this.stage === 1) { + throw new Error("@aws-sdk/core/protocols - JsonReplacer already created."); + } + if (this.stage === 2) { + throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted."); + } + this.stage = 1; + return (key, value) => { + if (value instanceof NumericValue) { + const v4 = `${NUMERIC_CONTROL_CHAR + "nv" + this.counter++}_` + value.string; + this.values.set(`"${v4}"`, value.string); + return v4; + } + if (typeof value === "bigint") { + const s4 = value.toString(); + const v4 = `${NUMERIC_CONTROL_CHAR + "b" + this.counter++}_` + s4; + this.values.set(`"${v4}"`, s4); + return v4; + } + return value; + }; + } + replaceInJson(json) { + if (this.stage === 0) { + throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet."); + } + if (this.stage === 2) { + throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted."); + } + this.stage = 2; + if (this.counter === 0) { + return json; + } + for (const [key, value] of this.values) { + json = json.replace(key, value); + } + return json; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +var import_util_base645, JsonShapeSerializer; +var init_JsonShapeSerializer = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js"() { + init_protocols(); + init_schema(); + init_serde(); + import_util_base645 = __toESM(require_dist_cjs9()); + init_ConfigurableSerdeContext(); + init_jsonReplacer(); + JsonShapeSerializer = class extends SerdeContextConfig { + settings; + buffer; + useReplacer = false; + rootSchema; + constructor(settings) { + super(); + this.settings = settings; + } + write(schema, value) { + this.rootSchema = NormalizedSchema.of(schema); + this.buffer = this._write(this.rootSchema, value); + } + writeDiscriminatedDocument(schema, value) { + this.write(schema, value); + if (typeof this.buffer === "object") { + this.buffer.__type = NormalizedSchema.of(schema).getName(true); + } + } + flush() { + const { rootSchema, useReplacer } = this; + this.rootSchema = void 0; + this.useReplacer = false; + if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) { + if (!useReplacer) { + return JSON.stringify(this.buffer); + } + const replacer = new JsonReplacer(); + return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0)); + } + return this.buffer; + } + _write(schema, value, container) { + const isObject = value !== null && typeof value === "object"; + const ns = NormalizedSchema.of(schema); + if (isObject) { + if (ns.isStructSchema()) { + const record = value; + const out = {}; + const { jsonName } = this.settings; + let nameMap = void 0; + if (jsonName) { + nameMap = {}; + } + for (const [memberName, memberSchema] of ns.structIterator()) { + const serializableValue = this._write(memberSchema, record[memberName], ns); + if (serializableValue !== void 0) { + let targetKey = memberName; + if (jsonName) { + targetKey = memberSchema.getMergedTraits().jsonName ?? memberName; + nameMap[memberName] = targetKey; + } + out[targetKey] = serializableValue; + } + } + if (ns.isUnionSchema() && Object.keys(out).length === 0) { + const { $unknown } = record; + if (Array.isArray($unknown)) { + const [k4, v4] = $unknown; + out[k4] = this._write(15, v4); + } + } else if (typeof record.__type === "string") { + for (const [k4, v4] of Object.entries(record)) { + const targetKey = jsonName ? nameMap[k4] ?? k4 : k4; + if (!(targetKey in out)) { + out[targetKey] = this._write(15, v4); + } + } + } + return out; + } + if (Array.isArray(value) && ns.isListSchema()) { + const listMember = ns.getValueSchema(); + const out = []; + const sparse = !!ns.getMergedTraits().sparse; + for (const item of value) { + if (sparse || item != null) { + out.push(this._write(listMember, item)); + } + } + return out; + } + if (ns.isMapSchema()) { + const mapMember = ns.getValueSchema(); + const out = {}; + const sparse = !!ns.getMergedTraits().sparse; + for (const [_k, _v] of Object.entries(value)) { + if (sparse || _v != null) { + out[_k] = this._write(mapMember, _v); + } + } + return out; + } + if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) { + if (ns === this.rootSchema) { + return value; + } + return (this.serdeContext?.base64Encoder ?? import_util_base645.toBase64)(value); + } + if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) { + const format2 = determineTimestampFormat(ns, this.settings); + switch (format2) { + case 5: + return value.toISOString().replace(".000Z", "Z"); + case 6: + return dateToUtcString(value); + case 7: + return value.getTime() / 1e3; + default: + console.warn("Missing timestamp format, using epoch seconds", value); + return value.getTime() / 1e3; + } + } + if (value instanceof NumericValue) { + this.useReplacer = true; + } + } + if (value === null && container?.isStructSchema()) { + return void 0; + } + if (ns.isStringSchema()) { + if (typeof value === "undefined" && ns.isIdempotencyToken()) { + return (0, import_uuid.v4)(); + } + const mediaType = ns.getMergedTraits().mediaType; + if (value != null && mediaType) { + const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); + if (isJson) { + return LazyJsonString.from(value); + } + } + return value; + } + if (typeof value === "number" && ns.isNumericSchema()) { + if (Math.abs(value) === Infinity || isNaN(value)) { + return String(value); + } + return value; + } + if (typeof value === "string" && ns.isBlobSchema()) { + if (ns === this.rootSchema) { + return value; + } + return (this.serdeContext?.base64Encoder ?? import_util_base645.toBase64)(value); + } + if (typeof value === "bigint") { + this.useReplacer = true; + } + if (ns.isDocumentSchema()) { + if (isObject) { + const out = Array.isArray(value) ? [] : {}; + for (const [k4, v4] of Object.entries(value)) { + if (v4 instanceof NumericValue) { + this.useReplacer = true; + out[k4] = v4; + } else { + out[k4] = this._write(ns, v4); + } + } + return out; + } else { + return structuredClone(value); + } + } + return value; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonCodec.js +var JsonCodec; +var init_JsonCodec = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonCodec.js"() { + init_ConfigurableSerdeContext(); + init_JsonShapeDeserializer(); + init_JsonShapeSerializer(); + JsonCodec = class extends SerdeContextConfig { + settings; + constructor(settings) { + super(); + this.settings = settings; + } + createSerializer() { + const serializer = new JsonShapeSerializer(this.settings); + serializer.setSerdeContext(this.serdeContext); + return serializer; + } + createDeserializer() { + const deserializer = new JsonShapeDeserializer(this.settings); + deserializer.setSerdeContext(this.serdeContext); + return deserializer; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +var AwsJsonRpcProtocol; +var init_AwsJsonRpcProtocol = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js"() { + init_protocols(); + init_schema(); + init_ProtocolLib(); + init_JsonCodec(); + init_parseJsonBody(); + AwsJsonRpcProtocol = class extends RpcProtocol { + serializer; + deserializer; + serviceTarget; + codec; + mixin; + awsQueryCompatible; + constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec }) { + super({ + defaultNamespace + }); + this.serviceTarget = serviceTarget; + this.codec = jsonCodec ?? new JsonCodec({ + timestampFormat: { + useTrait: true, + default: 7 + }, + jsonName: false + }); + this.serializer = this.codec.createSerializer(); + this.deserializer = this.codec.createDeserializer(); + this.awsQueryCompatible = !!awsQueryCompatible; + this.mixin = new ProtocolLib(this.awsQueryCompatible); + } + async serializeRequest(operationSchema, input, context) { + const request = await super.serializeRequest(operationSchema, input, context); + if (!request.path.endsWith("/")) { + request.path += "/"; + } + Object.assign(request.headers, { + "content-type": `application/x-amz-json-${this.getJsonRpcVersion()}`, + "x-amz-target": `${this.serviceTarget}.${operationSchema.name}` + }); + if (this.awsQueryCompatible) { + request.headers["x-amzn-query-mode"] = "true"; + } + if (deref(operationSchema.input) === "unit" || !request.body) { + request.body = "{}"; + } + return request; + } + getPayloadCodec() { + return this.codec; + } + async handleError(operationSchema, context, response, dataObject, metadata) { + if (this.awsQueryCompatible) { + this.mixin.setQueryCompatError(dataObject, response); + } + const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown"; + const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : void 0); + const ns = NormalizedSchema.of(errorSchema); + const message2 = dataObject.message ?? dataObject.Message ?? "Unknown"; + const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; + const exception = new ErrorCtor(message2); + const output = {}; + for (const [name, member2] of ns.structIterator()) { + if (dataObject[name] != null) { + output[name] = this.codec.createDeserializer().readObject(member2, dataObject[name]); + } + } + if (this.awsQueryCompatible) { + this.mixin.queryCompatOutput(dataObject, output); + } + throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { + $fault: ns.getMergedTraits().error, + message: message2 + }, output), dataObject); + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js +var AwsJson1_0Protocol; +var init_AwsJson1_0Protocol = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js"() { + init_AwsJsonRpcProtocol(); + AwsJson1_0Protocol = class extends AwsJsonRpcProtocol { + constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec }) { + super({ + defaultNamespace, + serviceTarget, + awsQueryCompatible, + jsonCodec + }); + } + getShapeId() { + return "aws.protocols#awsJson1_0"; + } + getJsonRpcVersion() { + return "1.0"; + } + getDefaultContentType() { + return "application/x-amz-json-1.0"; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js +var AwsJson1_1Protocol; +var init_AwsJson1_1Protocol = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js"() { + init_AwsJsonRpcProtocol(); + AwsJson1_1Protocol = class extends AwsJsonRpcProtocol { + constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec }) { + super({ + defaultNamespace, + serviceTarget, + awsQueryCompatible, + jsonCodec + }); + } + getShapeId() { + return "aws.protocols#awsJson1_1"; + } + getJsonRpcVersion() { + return "1.1"; + } + getDefaultContentType() { + return "application/x-amz-json-1.1"; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +var AwsRestJsonProtocol; +var init_AwsRestJsonProtocol = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js"() { + init_protocols(); + init_schema(); + init_ProtocolLib(); + init_JsonCodec(); + init_parseJsonBody(); + AwsRestJsonProtocol = class extends HttpBindingProtocol { + serializer; + deserializer; + codec; + mixin = new ProtocolLib(); + constructor({ defaultNamespace }) { + super({ + defaultNamespace + }); + const settings = { + timestampFormat: { + useTrait: true, + default: 7 + }, + httpBindings: true, + jsonName: true + }; + this.codec = new JsonCodec(settings); + this.serializer = new HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings); + this.deserializer = new HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings); + } + getShapeId() { + return "aws.protocols#restJson1"; + } + getPayloadCodec() { + return this.codec; + } + setSerdeContext(serdeContext) { + this.codec.setSerdeContext(serdeContext); + super.setSerdeContext(serdeContext); + } + async serializeRequest(operationSchema, input, context) { + const request = await super.serializeRequest(operationSchema, input, context); + const inputSchema = NormalizedSchema.of(operationSchema.input); + if (!request.headers["content-type"]) { + const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); + if (contentType) { + request.headers["content-type"] = contentType; + } + } + if (request.body == null && request.headers["content-type"] === this.getDefaultContentType()) { + request.body = "{}"; + } + return request; + } + async deserializeResponse(operationSchema, context, response) { + const output = await super.deserializeResponse(operationSchema, context, response); + const outputSchema = NormalizedSchema.of(operationSchema.output); + for (const [name, member2] of outputSchema.structIterator()) { + if (member2.getMemberTraits().httpPayload && !(name in output)) { + output[name] = null; + } + } + return output; + } + async handleError(operationSchema, context, response, dataObject, metadata) { + const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown"; + const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); + const ns = NormalizedSchema.of(errorSchema); + const message2 = dataObject.message ?? dataObject.Message ?? "Unknown"; + const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; + const exception = new ErrorCtor(message2); + await this.deserializeHttpMessage(errorSchema, context, response, dataObject); + const output = {}; + for (const [name, member2] of ns.structIterator()) { + const target = member2.getMergedTraits().jsonName ?? name; + output[name] = this.codec.createDeserializer().readObject(member2, dataObject[target]); + } + throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { + $fault: ns.getMergedTraits().error, + message: message2 + }, output), dataObject); + } + getDefaultContentType() { + return "application/json"; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js +var import_smithy_client3, awsExpectUnion; +var init_awsExpectUnion = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js"() { + import_smithy_client3 = __toESM(require_dist_cjs20()); + awsExpectUnion = (value) => { + if (value == null) { + return void 0; + } + if (typeof value === "object" && "__type" in value) { + delete value.__type; + } + return (0, import_smithy_client3.expectUnion)(value); + }; + } +}); + +// node_modules/fast-xml-parser/lib/fxp.cjs +var require_fxp = __commonJS({ + "node_modules/fast-xml-parser/lib/fxp.cjs"(exports2, module2) { + (() => { + "use strict"; + var t4 = { d: (e5, i5) => { + for (var n5 in i5) t4.o(i5, n5) && !t4.o(e5, n5) && Object.defineProperty(e5, n5, { enumerable: true, get: i5[n5] }); + }, o: (t5, e5) => Object.prototype.hasOwnProperty.call(t5, e5), r: (t5) => { + "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t5, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t5, "__esModule", { value: true }); + } }, e4 = {}; + t4.r(e4), t4.d(e4, { XMLBuilder: () => ut, XMLParser: () => et, XMLValidator: () => ft }); + const i4 = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", n4 = new RegExp("^[" + i4 + "][" + i4 + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); + function s4(t5, e5) { + const i5 = []; + let n5 = e5.exec(t5); + for (; n5; ) { + const s5 = []; + s5.startIndex = e5.lastIndex - n5[0].length; + const r5 = n5.length; + for (let t6 = 0; t6 < r5; t6++) s5.push(n5[t6]); + i5.push(s5), n5 = e5.exec(t5); + } + return i5; + } + const r4 = function(t5) { + return !(null == n4.exec(t5)); + }, o4 = { allowBooleanAttributes: false, unpairedTags: [] }; + function a4(t5, e5) { + e5 = Object.assign({}, o4, e5); + const i5 = []; + let n5 = false, s5 = false; + "\uFEFF" === t5[0] && (t5 = t5.substr(1)); + for (let o5 = 0; o5 < t5.length; o5++) if ("<" === t5[o5] && "?" === t5[o5 + 1]) { + if (o5 += 2, o5 = u4(t5, o5), o5.err) return o5; + } else { + if ("<" !== t5[o5]) { + if (l4(t5[o5])) continue; + return x4("InvalidChar", "char '" + t5[o5] + "' is not expected.", b4(t5, o5)); + } + { + let a5 = o5; + if (o5++, "!" === t5[o5]) { + o5 = h4(t5, o5); + continue; + } + { + let d5 = false; + "/" === t5[o5] && (d5 = true, o5++); + let p5 = ""; + for (; o5 < t5.length && ">" !== t5[o5] && " " !== t5[o5] && " " !== t5[o5] && "\n" !== t5[o5] && "\r" !== t5[o5]; o5++) p5 += t5[o5]; + if (p5 = p5.trim(), "/" === p5[p5.length - 1] && (p5 = p5.substring(0, p5.length - 1), o5--), !r4(p5)) { + let e6; + return e6 = 0 === p5.trim().length ? "Invalid space after '<'." : "Tag '" + p5 + "' is an invalid name.", x4("InvalidTag", e6, b4(t5, o5)); + } + const c5 = f4(t5, o5); + if (false === c5) return x4("InvalidAttr", "Attributes for '" + p5 + "' have open quote.", b4(t5, o5)); + let N2 = c5.value; + if (o5 = c5.index, "/" === N2[N2.length - 1]) { + const i6 = o5 - N2.length; + N2 = N2.substring(0, N2.length - 1); + const s6 = g4(N2, e5); + if (true !== s6) return x4(s6.err.code, s6.err.msg, b4(t5, i6 + s6.err.line)); + n5 = true; + } else if (d5) { + if (!c5.tagClosed) return x4("InvalidTag", "Closing tag '" + p5 + "' doesn't have proper closing.", b4(t5, o5)); + if (N2.trim().length > 0) return x4("InvalidTag", "Closing tag '" + p5 + "' can't have attributes or invalid starting.", b4(t5, a5)); + if (0 === i5.length) return x4("InvalidTag", "Closing tag '" + p5 + "' has not been opened.", b4(t5, a5)); + { + const e6 = i5.pop(); + if (p5 !== e6.tagName) { + let i6 = b4(t5, e6.tagStartPos); + return x4("InvalidTag", "Expected closing tag '" + e6.tagName + "' (opened in line " + i6.line + ", col " + i6.col + ") instead of closing tag '" + p5 + "'.", b4(t5, a5)); + } + 0 == i5.length && (s5 = true); + } + } else { + const r5 = g4(N2, e5); + if (true !== r5) return x4(r5.err.code, r5.err.msg, b4(t5, o5 - N2.length + r5.err.line)); + if (true === s5) return x4("InvalidXml", "Multiple possible root nodes found.", b4(t5, o5)); + -1 !== e5.unpairedTags.indexOf(p5) || i5.push({ tagName: p5, tagStartPos: a5 }), n5 = true; + } + for (o5++; o5 < t5.length; o5++) if ("<" === t5[o5]) { + if ("!" === t5[o5 + 1]) { + o5++, o5 = h4(t5, o5); + continue; + } + if ("?" !== t5[o5 + 1]) break; + if (o5 = u4(t5, ++o5), o5.err) return o5; + } else if ("&" === t5[o5]) { + const e6 = m4(t5, o5); + if (-1 == e6) return x4("InvalidChar", "char '&' is not expected.", b4(t5, o5)); + o5 = e6; + } else if (true === s5 && !l4(t5[o5])) return x4("InvalidXml", "Extra text at the end", b4(t5, o5)); + "<" === t5[o5] && o5--; + } + } + } + return n5 ? 1 == i5.length ? x4("InvalidTag", "Unclosed tag '" + i5[0].tagName + "'.", b4(t5, i5[0].tagStartPos)) : !(i5.length > 0) || x4("InvalidXml", "Invalid '" + JSON.stringify(i5.map(((t6) => t6.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x4("InvalidXml", "Start tag expected.", 1); + } + function l4(t5) { + return " " === t5 || " " === t5 || "\n" === t5 || "\r" === t5; + } + function u4(t5, e5) { + const i5 = e5; + for (; e5 < t5.length; e5++) if ("?" != t5[e5] && " " != t5[e5]) ; + else { + const n5 = t5.substr(i5, e5 - i5); + if (e5 > 5 && "xml" === n5) return x4("InvalidXml", "XML declaration allowed only at the start of the document.", b4(t5, e5)); + if ("?" == t5[e5] && ">" == t5[e5 + 1]) { + e5++; + break; + } + } + return e5; + } + function h4(t5, e5) { + if (t5.length > e5 + 5 && "-" === t5[e5 + 1] && "-" === t5[e5 + 2]) { + for (e5 += 3; e5 < t5.length; e5++) if ("-" === t5[e5] && "-" === t5[e5 + 1] && ">" === t5[e5 + 2]) { + e5 += 2; + break; + } + } else if (t5.length > e5 + 8 && "D" === t5[e5 + 1] && "O" === t5[e5 + 2] && "C" === t5[e5 + 3] && "T" === t5[e5 + 4] && "Y" === t5[e5 + 5] && "P" === t5[e5 + 6] && "E" === t5[e5 + 7]) { + let i5 = 1; + for (e5 += 8; e5 < t5.length; e5++) if ("<" === t5[e5]) i5++; + else if (">" === t5[e5] && (i5--, 0 === i5)) break; + } else if (t5.length > e5 + 9 && "[" === t5[e5 + 1] && "C" === t5[e5 + 2] && "D" === t5[e5 + 3] && "A" === t5[e5 + 4] && "T" === t5[e5 + 5] && "A" === t5[e5 + 6] && "[" === t5[e5 + 7]) { + for (e5 += 8; e5 < t5.length; e5++) if ("]" === t5[e5] && "]" === t5[e5 + 1] && ">" === t5[e5 + 2]) { + e5 += 2; + break; + } + } + return e5; + } + const d4 = '"', p4 = "'"; + function f4(t5, e5) { + let i5 = "", n5 = "", s5 = false; + for (; e5 < t5.length; e5++) { + if (t5[e5] === d4 || t5[e5] === p4) "" === n5 ? n5 = t5[e5] : n5 !== t5[e5] || (n5 = ""); + else if (">" === t5[e5] && "" === n5) { + s5 = true; + break; + } + i5 += t5[e5]; + } + return "" === n5 && { value: i5, index: e5, tagClosed: s5 }; + } + const c4 = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function g4(t5, e5) { + const i5 = s4(t5, c4), n5 = {}; + for (let t6 = 0; t6 < i5.length; t6++) { + if (0 === i5[t6][1].length) return x4("InvalidAttr", "Attribute '" + i5[t6][2] + "' has no space in starting.", E2(i5[t6])); + if (void 0 !== i5[t6][3] && void 0 === i5[t6][4]) return x4("InvalidAttr", "Attribute '" + i5[t6][2] + "' is without value.", E2(i5[t6])); + if (void 0 === i5[t6][3] && !e5.allowBooleanAttributes) return x4("InvalidAttr", "boolean attribute '" + i5[t6][2] + "' is not allowed.", E2(i5[t6])); + const s5 = i5[t6][2]; + if (!N(s5)) return x4("InvalidAttr", "Attribute '" + s5 + "' is an invalid name.", E2(i5[t6])); + if (n5.hasOwnProperty(s5)) return x4("InvalidAttr", "Attribute '" + s5 + "' is repeated.", E2(i5[t6])); + n5[s5] = 1; + } + return true; + } + function m4(t5, e5) { + if (";" === t5[++e5]) return -1; + if ("#" === t5[e5]) return (function(t6, e6) { + let i6 = /\d/; + for ("x" === t6[e6] && (e6++, i6 = /[\da-fA-F]/); e6 < t6.length; e6++) { + if (";" === t6[e6]) return e6; + if (!t6[e6].match(i6)) break; + } + return -1; + })(t5, ++e5); + let i5 = 0; + for (; e5 < t5.length; e5++, i5++) if (!(t5[e5].match(/\w/) && i5 < 20)) { + if (";" === t5[e5]) break; + return -1; + } + return e5; + } + function x4(t5, e5, i5) { + return { err: { code: t5, msg: e5, line: i5.line || i5, col: i5.col } }; + } + function N(t5) { + return r4(t5); + } + function b4(t5, e5) { + const i5 = t5.substring(0, e5).split(/\r?\n/); + return { line: i5.length, col: i5[i5.length - 1].length + 1 }; + } + function E2(t5) { + return t5.startIndex + t5[1].length; + } + const v4 = { preserveOrder: false, attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, removeNSPrefix: false, allowBooleanAttributes: false, parseTagValue: true, parseAttributeValue: false, trimValues: true, cdataPropName: false, numberParseOptions: { hex: true, leadingZeros: true, eNotation: true }, tagValueProcessor: function(t5, e5) { + return e5; + }, attributeValueProcessor: function(t5, e5) { + return e5; + }, stopNodes: [], alwaysCreateTextNode: false, isArray: () => false, commentPropName: false, unpairedTags: [], processEntities: true, htmlEntities: false, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t5, e5, i5) { + return t5; + }, captureMetaData: false }; + let T; + T = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + class y2 { + constructor(t5) { + this.tagname = t5, this.child = [], this[":@"] = {}; + } + add(t5, e5) { + "__proto__" === t5 && (t5 = "#__proto__"), this.child.push({ [t5]: e5 }); + } + addChild(t5, e5) { + "__proto__" === t5.tagname && (t5.tagname = "#__proto__"), t5[":@"] && Object.keys(t5[":@"]).length > 0 ? this.child.push({ [t5.tagname]: t5.child, ":@": t5[":@"] }) : this.child.push({ [t5.tagname]: t5.child }), void 0 !== e5 && (this.child[this.child.length - 1][T] = { startIndex: e5 }); + } + static getMetaDataSymbol() { + return T; + } + } + class w4 { + constructor(t5) { + this.suppressValidationErr = !t5; + } + readDocType(t5, e5) { + const i5 = {}; + if ("O" !== t5[e5 + 3] || "C" !== t5[e5 + 4] || "T" !== t5[e5 + 5] || "Y" !== t5[e5 + 6] || "P" !== t5[e5 + 7] || "E" !== t5[e5 + 8]) throw new Error("Invalid Tag instead of DOCTYPE"); + { + e5 += 9; + let n5 = 1, s5 = false, r5 = false, o5 = ""; + for (; e5 < t5.length; e5++) if ("<" !== t5[e5] || r5) if (">" === t5[e5]) { + if (r5 ? "-" === t5[e5 - 1] && "-" === t5[e5 - 2] && (r5 = false, n5--) : n5--, 0 === n5) break; + } else "[" === t5[e5] ? s5 = true : o5 += t5[e5]; + else { + if (s5 && P(t5, "!ENTITY", e5)) { + let n6, s6; + e5 += 7, [n6, s6, e5] = this.readEntityExp(t5, e5 + 1, this.suppressValidationErr), -1 === s6.indexOf("&") && (i5[n6] = { regx: RegExp(`&${n6};`, "g"), val: s6 }); + } else if (s5 && P(t5, "!ELEMENT", e5)) { + e5 += 8; + const { index: i6 } = this.readElementExp(t5, e5 + 1); + e5 = i6; + } else if (s5 && P(t5, "!ATTLIST", e5)) e5 += 8; + else if (s5 && P(t5, "!NOTATION", e5)) { + e5 += 9; + const { index: i6 } = this.readNotationExp(t5, e5 + 1, this.suppressValidationErr); + e5 = i6; + } else { + if (!P(t5, "!--", e5)) throw new Error("Invalid DOCTYPE"); + r5 = true; + } + n5++, o5 = ""; + } + if (0 !== n5) throw new Error("Unclosed DOCTYPE"); + } + return { entities: i5, i: e5 }; + } + readEntityExp(t5, e5) { + e5 = I2(t5, e5); + let i5 = ""; + for (; e5 < t5.length && !/\s/.test(t5[e5]) && '"' !== t5[e5] && "'" !== t5[e5]; ) i5 += t5[e5], e5++; + if (O(i5), e5 = I2(t5, e5), !this.suppressValidationErr) { + if ("SYSTEM" === t5.substring(e5, e5 + 6).toUpperCase()) throw new Error("External entities are not supported"); + if ("%" === t5[e5]) throw new Error("Parameter entities are not supported"); + } + let n5 = ""; + return [e5, n5] = this.readIdentifierVal(t5, e5, "entity"), [i5, n5, --e5]; + } + readNotationExp(t5, e5) { + e5 = I2(t5, e5); + let i5 = ""; + for (; e5 < t5.length && !/\s/.test(t5[e5]); ) i5 += t5[e5], e5++; + !this.suppressValidationErr && O(i5), e5 = I2(t5, e5); + const n5 = t5.substring(e5, e5 + 6).toUpperCase(); + if (!this.suppressValidationErr && "SYSTEM" !== n5 && "PUBLIC" !== n5) throw new Error(`Expected SYSTEM or PUBLIC, found "${n5}"`); + e5 += n5.length, e5 = I2(t5, e5); + let s5 = null, r5 = null; + if ("PUBLIC" === n5) [e5, s5] = this.readIdentifierVal(t5, e5, "publicIdentifier"), '"' !== t5[e5 = I2(t5, e5)] && "'" !== t5[e5] || ([e5, r5] = this.readIdentifierVal(t5, e5, "systemIdentifier")); + else if ("SYSTEM" === n5 && ([e5, r5] = this.readIdentifierVal(t5, e5, "systemIdentifier"), !this.suppressValidationErr && !r5)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); + return { notationName: i5, publicIdentifier: s5, systemIdentifier: r5, index: --e5 }; + } + readIdentifierVal(t5, e5, i5) { + let n5 = ""; + const s5 = t5[e5]; + if ('"' !== s5 && "'" !== s5) throw new Error(`Expected quoted string, found "${s5}"`); + for (e5++; e5 < t5.length && t5[e5] !== s5; ) n5 += t5[e5], e5++; + if (t5[e5] !== s5) throw new Error(`Unterminated ${i5} value`); + return [++e5, n5]; + } + readElementExp(t5, e5) { + e5 = I2(t5, e5); + let i5 = ""; + for (; e5 < t5.length && !/\s/.test(t5[e5]); ) i5 += t5[e5], e5++; + if (!this.suppressValidationErr && !r4(i5)) throw new Error(`Invalid element name: "${i5}"`); + let n5 = ""; + if ("E" === t5[e5 = I2(t5, e5)] && P(t5, "MPTY", e5)) e5 += 4; + else if ("A" === t5[e5] && P(t5, "NY", e5)) e5 += 2; + else if ("(" === t5[e5]) { + for (e5++; e5 < t5.length && ")" !== t5[e5]; ) n5 += t5[e5], e5++; + if (")" !== t5[e5]) throw new Error("Unterminated content model"); + } else if (!this.suppressValidationErr) throw new Error(`Invalid Element Expression, found "${t5[e5]}"`); + return { elementName: i5, contentModel: n5.trim(), index: e5 }; + } + readAttlistExp(t5, e5) { + e5 = I2(t5, e5); + let i5 = ""; + for (; e5 < t5.length && !/\s/.test(t5[e5]); ) i5 += t5[e5], e5++; + O(i5), e5 = I2(t5, e5); + let n5 = ""; + for (; e5 < t5.length && !/\s/.test(t5[e5]); ) n5 += t5[e5], e5++; + if (!O(n5)) throw new Error(`Invalid attribute name: "${n5}"`); + e5 = I2(t5, e5); + let s5 = ""; + if ("NOTATION" === t5.substring(e5, e5 + 8).toUpperCase()) { + if (s5 = "NOTATION", "(" !== t5[e5 = I2(t5, e5 += 8)]) throw new Error(`Expected '(', found "${t5[e5]}"`); + e5++; + let i6 = []; + for (; e5 < t5.length && ")" !== t5[e5]; ) { + let n6 = ""; + for (; e5 < t5.length && "|" !== t5[e5] && ")" !== t5[e5]; ) n6 += t5[e5], e5++; + if (n6 = n6.trim(), !O(n6)) throw new Error(`Invalid notation name: "${n6}"`); + i6.push(n6), "|" === t5[e5] && (e5++, e5 = I2(t5, e5)); + } + if (")" !== t5[e5]) throw new Error("Unterminated list of notations"); + e5++, s5 += " (" + i6.join("|") + ")"; + } else { + for (; e5 < t5.length && !/\s/.test(t5[e5]); ) s5 += t5[e5], e5++; + const i6 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !i6.includes(s5.toUpperCase())) throw new Error(`Invalid attribute type: "${s5}"`); + } + e5 = I2(t5, e5); + let r5 = ""; + return "#REQUIRED" === t5.substring(e5, e5 + 8).toUpperCase() ? (r5 = "#REQUIRED", e5 += 8) : "#IMPLIED" === t5.substring(e5, e5 + 7).toUpperCase() ? (r5 = "#IMPLIED", e5 += 7) : [e5, r5] = this.readIdentifierVal(t5, e5, "ATTLIST"), { elementName: i5, attributeName: n5, attributeType: s5, defaultValue: r5, index: e5 }; + } + } + const I2 = (t5, e5) => { + for (; e5 < t5.length && /\s/.test(t5[e5]); ) e5++; + return e5; + }; + function P(t5, e5, i5) { + for (let n5 = 0; n5 < e5.length; n5++) if (e5[n5] !== t5[i5 + n5 + 1]) return false; + return true; + } + function O(t5) { + if (r4(t5)) return t5; + throw new Error(`Invalid entity name ${t5}`); + } + const A2 = /^[-+]?0x[a-fA-F0-9]+$/, S = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, C2 = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const V = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + function $(t5) { + return "function" == typeof t5 ? t5 : Array.isArray(t5) ? (e5) => { + for (const i5 of t5) { + if ("string" == typeof i5 && e5 === i5) return true; + if (i5 instanceof RegExp && i5.test(e5)) return true; + } + } : () => false; + } + class D2 { + constructor(t5) { + if (this.options = t5, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t6, e5) => Z(e5, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t6, e5) => Z(e5, 16, "&#x") } }, this.addExternalEntities = j4, this.parseXml = L, this.parseTextData = M, this.resolveNameSpace = F2, this.buildAttributesMap = k4, this.isItStopNode = Y, this.replaceEntitiesValue = B2, this.readStopNodeData = W, this.saveTextToParentTag = R, this.addChild = U, this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let t6 = 0; t6 < this.options.stopNodes.length; t6++) { + const e5 = this.options.stopNodes[t6]; + "string" == typeof e5 && (e5.startsWith("*.") ? this.stopNodesWildcard.add(e5.substring(2)) : this.stopNodesExact.add(e5)); + } + } + } + } + function j4(t5) { + const e5 = Object.keys(t5); + for (let i5 = 0; i5 < e5.length; i5++) { + const n5 = e5[i5]; + this.lastEntities[n5] = { regex: new RegExp("&" + n5 + ";", "g"), val: t5[n5] }; + } + } + function M(t5, e5, i5, n5, s5, r5, o5) { + if (void 0 !== t5 && (this.options.trimValues && !n5 && (t5 = t5.trim()), t5.length > 0)) { + o5 || (t5 = this.replaceEntitiesValue(t5)); + const n6 = this.options.tagValueProcessor(e5, t5, i5, s5, r5); + return null == n6 ? t5 : typeof n6 != typeof t5 || n6 !== t5 ? n6 : this.options.trimValues || t5.trim() === t5 ? q4(t5, this.options.parseTagValue, this.options.numberParseOptions) : t5; + } + } + function F2(t5) { + if (this.options.removeNSPrefix) { + const e5 = t5.split(":"), i5 = "/" === t5.charAt(0) ? "/" : ""; + if ("xmlns" === e5[0]) return ""; + 2 === e5.length && (t5 = i5 + e5[1]); + } + return t5; + } + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function k4(t5, e5) { + if (true !== this.options.ignoreAttributes && "string" == typeof t5) { + const i5 = s4(t5, _), n5 = i5.length, r5 = {}; + for (let t6 = 0; t6 < n5; t6++) { + const n6 = this.resolveNameSpace(i5[t6][1]); + if (this.ignoreAttributesFn(n6, e5)) continue; + let s5 = i5[t6][4], o5 = this.options.attributeNamePrefix + n6; + if (n6.length) if (this.options.transformAttributeName && (o5 = this.options.transformAttributeName(o5)), "__proto__" === o5 && (o5 = "#__proto__"), void 0 !== s5) { + this.options.trimValues && (s5 = s5.trim()), s5 = this.replaceEntitiesValue(s5); + const t7 = this.options.attributeValueProcessor(n6, s5, e5); + r5[o5] = null == t7 ? s5 : typeof t7 != typeof s5 || t7 !== s5 ? t7 : q4(s5, this.options.parseAttributeValue, this.options.numberParseOptions); + } else this.options.allowBooleanAttributes && (r5[o5] = true); + } + if (!Object.keys(r5).length) return; + if (this.options.attributesGroupName) { + const t6 = {}; + return t6[this.options.attributesGroupName] = r5, t6; + } + return r5; + } + } + const L = function(t5) { + t5 = t5.replace(/\r\n?/g, "\n"); + const e5 = new y2("!xml"); + let i5 = e5, n5 = "", s5 = ""; + const r5 = new w4(this.options.processEntities); + for (let o5 = 0; o5 < t5.length; o5++) if ("<" === t5[o5]) if ("/" === t5[o5 + 1]) { + const e6 = G2(t5, ">", o5, "Closing Tag is not closed."); + let r6 = t5.substring(o5 + 2, e6).trim(); + if (this.options.removeNSPrefix) { + const t6 = r6.indexOf(":"); + -1 !== t6 && (r6 = r6.substr(t6 + 1)); + } + this.options.transformTagName && (r6 = this.options.transformTagName(r6)), i5 && (n5 = this.saveTextToParentTag(n5, i5, s5)); + const a5 = s5.substring(s5.lastIndexOf(".") + 1); + if (r6 && -1 !== this.options.unpairedTags.indexOf(r6)) throw new Error(`Unpaired tag can not be used as closing tag: `); + let l5 = 0; + a5 && -1 !== this.options.unpairedTags.indexOf(a5) ? (l5 = s5.lastIndexOf(".", s5.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l5 = s5.lastIndexOf("."), s5 = s5.substring(0, l5), i5 = this.tagsNodeStack.pop(), n5 = "", o5 = e6; + } else if ("?" === t5[o5 + 1]) { + let e6 = X(t5, o5, false, "?>"); + if (!e6) throw new Error("Pi Tag is not closed."); + if (n5 = this.saveTextToParentTag(n5, i5, s5), this.options.ignoreDeclaration && "?xml" === e6.tagName || this.options.ignorePiTags) ; + else { + const t6 = new y2(e6.tagName); + t6.add(this.options.textNodeName, ""), e6.tagName !== e6.tagExp && e6.attrExpPresent && (t6[":@"] = this.buildAttributesMap(e6.tagExp, s5)), this.addChild(i5, t6, s5, o5); + } + o5 = e6.closeIndex + 1; + } else if ("!--" === t5.substr(o5 + 1, 3)) { + const e6 = G2(t5, "-->", o5 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const r6 = t5.substring(o5 + 4, e6 - 2); + n5 = this.saveTextToParentTag(n5, i5, s5), i5.add(this.options.commentPropName, [{ [this.options.textNodeName]: r6 }]); + } + o5 = e6; + } else if ("!D" === t5.substr(o5 + 1, 2)) { + const e6 = r5.readDocType(t5, o5); + this.docTypeEntities = e6.entities, o5 = e6.i; + } else if ("![" === t5.substr(o5 + 1, 2)) { + const e6 = G2(t5, "]]>", o5, "CDATA is not closed.") - 2, r6 = t5.substring(o5 + 9, e6); + n5 = this.saveTextToParentTag(n5, i5, s5); + let a5 = this.parseTextData(r6, i5.tagname, s5, true, false, true, true); + null == a5 && (a5 = ""), this.options.cdataPropName ? i5.add(this.options.cdataPropName, [{ [this.options.textNodeName]: r6 }]) : i5.add(this.options.textNodeName, a5), o5 = e6 + 2; + } else { + let r6 = X(t5, o5, this.options.removeNSPrefix), a5 = r6.tagName; + const l5 = r6.rawTagName; + let u5 = r6.tagExp, h5 = r6.attrExpPresent, d5 = r6.closeIndex; + if (this.options.transformTagName) { + const t6 = this.options.transformTagName(a5); + u5 === a5 && (u5 = t6), a5 = t6; + } + i5 && n5 && "!xml" !== i5.tagname && (n5 = this.saveTextToParentTag(n5, i5, s5, false)); + const p5 = i5; + p5 && -1 !== this.options.unpairedTags.indexOf(p5.tagname) && (i5 = this.tagsNodeStack.pop(), s5 = s5.substring(0, s5.lastIndexOf("."))), a5 !== e5.tagname && (s5 += s5 ? "." + a5 : a5); + const f5 = o5; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s5, a5)) { + let e6 = ""; + if (u5.length > 0 && u5.lastIndexOf("/") === u5.length - 1) "/" === a5[a5.length - 1] ? (a5 = a5.substr(0, a5.length - 1), s5 = s5.substr(0, s5.length - 1), u5 = a5) : u5 = u5.substr(0, u5.length - 1), o5 = r6.closeIndex; + else if (-1 !== this.options.unpairedTags.indexOf(a5)) o5 = r6.closeIndex; + else { + const i6 = this.readStopNodeData(t5, l5, d5 + 1); + if (!i6) throw new Error(`Unexpected end of ${l5}`); + o5 = i6.i, e6 = i6.tagContent; + } + const n6 = new y2(a5); + a5 !== u5 && h5 && (n6[":@"] = this.buildAttributesMap(u5, s5)), e6 && (e6 = this.parseTextData(e6, a5, s5, true, h5, true, true)), s5 = s5.substr(0, s5.lastIndexOf(".")), n6.add(this.options.textNodeName, e6), this.addChild(i5, n6, s5, f5); + } else { + if (u5.length > 0 && u5.lastIndexOf("/") === u5.length - 1) { + if ("/" === a5[a5.length - 1] ? (a5 = a5.substr(0, a5.length - 1), s5 = s5.substr(0, s5.length - 1), u5 = a5) : u5 = u5.substr(0, u5.length - 1), this.options.transformTagName) { + const t7 = this.options.transformTagName(a5); + u5 === a5 && (u5 = t7), a5 = t7; + } + const t6 = new y2(a5); + a5 !== u5 && h5 && (t6[":@"] = this.buildAttributesMap(u5, s5)), this.addChild(i5, t6, s5, f5), s5 = s5.substr(0, s5.lastIndexOf(".")); + } else { + const t6 = new y2(a5); + this.tagsNodeStack.push(i5), a5 !== u5 && h5 && (t6[":@"] = this.buildAttributesMap(u5, s5)), this.addChild(i5, t6, s5, f5), i5 = t6; + } + n5 = "", o5 = d5; + } + } + else n5 += t5[o5]; + return e5.child; + }; + function U(t5, e5, i5, n5) { + this.options.captureMetaData || (n5 = void 0); + const s5 = this.options.updateTag(e5.tagname, i5, e5[":@"]); + false === s5 || ("string" == typeof s5 ? (e5.tagname = s5, t5.addChild(e5, n5)) : t5.addChild(e5, n5)); + } + const B2 = function(t5) { + if (this.options.processEntities) { + for (let e5 in this.docTypeEntities) { + const i5 = this.docTypeEntities[e5]; + t5 = t5.replace(i5.regx, i5.val); + } + for (let e5 in this.lastEntities) { + const i5 = this.lastEntities[e5]; + t5 = t5.replace(i5.regex, i5.val); + } + if (this.options.htmlEntities) for (let e5 in this.htmlEntities) { + const i5 = this.htmlEntities[e5]; + t5 = t5.replace(i5.regex, i5.val); + } + t5 = t5.replace(this.ampEntity.regex, this.ampEntity.val); + } + return t5; + }; + function R(t5, e5, i5, n5) { + return t5 && (void 0 === n5 && (n5 = 0 === e5.child.length), void 0 !== (t5 = this.parseTextData(t5, e5.tagname, i5, false, !!e5[":@"] && 0 !== Object.keys(e5[":@"]).length, n5)) && "" !== t5 && e5.add(this.options.textNodeName, t5), t5 = ""), t5; + } + function Y(t5, e5, i5, n5) { + return !(!e5 || !e5.has(n5)) || !(!t5 || !t5.has(i5)); + } + function G2(t5, e5, i5, n5) { + const s5 = t5.indexOf(e5, i5); + if (-1 === s5) throw new Error(n5); + return s5 + e5.length - 1; + } + function X(t5, e5, i5, n5 = ">") { + const s5 = (function(t6, e6, i6 = ">") { + let n6, s6 = ""; + for (let r6 = e6; r6 < t6.length; r6++) { + let e7 = t6[r6]; + if (n6) e7 === n6 && (n6 = ""); + else if ('"' === e7 || "'" === e7) n6 = e7; + else if (e7 === i6[0]) { + if (!i6[1]) return { data: s6, index: r6 }; + if (t6[r6 + 1] === i6[1]) return { data: s6, index: r6 }; + } else " " === e7 && (e7 = " "); + s6 += e7; + } + })(t5, e5 + 1, n5); + if (!s5) return; + let r5 = s5.data; + const o5 = s5.index, a5 = r5.search(/\s/); + let l5 = r5, u5 = true; + -1 !== a5 && (l5 = r5.substring(0, a5), r5 = r5.substring(a5 + 1).trimStart()); + const h5 = l5; + if (i5) { + const t6 = l5.indexOf(":"); + -1 !== t6 && (l5 = l5.substr(t6 + 1), u5 = l5 !== s5.data.substr(t6 + 1)); + } + return { tagName: l5, tagExp: r5, closeIndex: o5, attrExpPresent: u5, rawTagName: h5 }; + } + function W(t5, e5, i5) { + const n5 = i5; + let s5 = 1; + for (; i5 < t5.length; i5++) if ("<" === t5[i5]) if ("/" === t5[i5 + 1]) { + const r5 = G2(t5, ">", i5, `${e5} is not closed`); + if (t5.substring(i5 + 2, r5).trim() === e5 && (s5--, 0 === s5)) return { tagContent: t5.substring(n5, i5), i: r5 }; + i5 = r5; + } else if ("?" === t5[i5 + 1]) i5 = G2(t5, "?>", i5 + 1, "StopNode is not closed."); + else if ("!--" === t5.substr(i5 + 1, 3)) i5 = G2(t5, "-->", i5 + 3, "StopNode is not closed."); + else if ("![" === t5.substr(i5 + 1, 2)) i5 = G2(t5, "]]>", i5, "StopNode is not closed.") - 2; + else { + const n6 = X(t5, i5, ">"); + n6 && ((n6 && n6.tagName) === e5 && "/" !== n6.tagExp[n6.tagExp.length - 1] && s5++, i5 = n6.closeIndex); + } + } + function q4(t5, e5, i5) { + if (e5 && "string" == typeof t5) { + const e6 = t5.trim(); + return "true" === e6 || "false" !== e6 && (function(t6, e7 = {}) { + if (e7 = Object.assign({}, C2, e7), !t6 || "string" != typeof t6) return t6; + let i6 = t6.trim(); + if (void 0 !== e7.skipLike && e7.skipLike.test(i6)) return t6; + if ("0" === t6) return 0; + if (e7.hex && A2.test(i6)) return (function(t7) { + if (parseInt) return parseInt(t7, 16); + if (Number.parseInt) return Number.parseInt(t7, 16); + if (window && window.parseInt) return window.parseInt(t7, 16); + throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); + })(i6); + if (-1 !== i6.search(/.+[eE].+/)) return (function(t7, e8, i7) { + if (!i7.eNotation) return t7; + const n6 = e8.match(V); + if (n6) { + let s5 = n6[1] || ""; + const r5 = -1 === n6[3].indexOf("e") ? "E" : "e", o5 = n6[2], a5 = s5 ? t7[o5.length + 1] === r5 : t7[o5.length] === r5; + return o5.length > 1 && a5 ? t7 : 1 !== o5.length || !n6[3].startsWith(`.${r5}`) && n6[3][0] !== r5 ? i7.leadingZeros && !a5 ? (e8 = (n6[1] || "") + n6[3], Number(e8)) : t7 : Number(e8); + } + return t7; + })(t6, i6, e7); + { + const s5 = S.exec(i6); + if (s5) { + const r5 = s5[1] || "", o5 = s5[2]; + let a5 = (n5 = s5[3]) && -1 !== n5.indexOf(".") ? ("." === (n5 = n5.replace(/0+$/, "")) ? n5 = "0" : "." === n5[0] ? n5 = "0" + n5 : "." === n5[n5.length - 1] && (n5 = n5.substring(0, n5.length - 1)), n5) : n5; + const l5 = r5 ? "." === t6[o5.length + 1] : "." === t6[o5.length]; + if (!e7.leadingZeros && (o5.length > 1 || 1 === o5.length && !l5)) return t6; + { + const n6 = Number(i6), s6 = String(n6); + if (0 === n6 || -0 === n6) return n6; + if (-1 !== s6.search(/[eE]/)) return e7.eNotation ? n6 : t6; + if (-1 !== i6.indexOf(".")) return "0" === s6 || s6 === a5 || s6 === `${r5}${a5}` ? n6 : t6; + let l6 = o5 ? a5 : i6; + return o5 ? l6 === s6 || r5 + l6 === s6 ? n6 : t6 : l6 === s6 || l6 === r5 + s6 ? n6 : t6; + } + } + return t6; + } + var n5; + })(t5, i5); + } + return void 0 !== t5 ? t5 : ""; + } + function Z(t5, e5, i5) { + const n5 = Number.parseInt(t5, e5); + return n5 >= 0 && n5 <= 1114111 ? String.fromCodePoint(n5) : i5 + t5 + ";"; + } + const K = y2.getMetaDataSymbol(); + function Q(t5, e5) { + return z2(t5, e5); + } + function z2(t5, e5, i5) { + let n5; + const s5 = {}; + for (let r5 = 0; r5 < t5.length; r5++) { + const o5 = t5[r5], a5 = J2(o5); + let l5 = ""; + if (l5 = void 0 === i5 ? a5 : i5 + "." + a5, a5 === e5.textNodeName) void 0 === n5 ? n5 = o5[a5] : n5 += "" + o5[a5]; + else { + if (void 0 === a5) continue; + if (o5[a5]) { + let t6 = z2(o5[a5], e5, l5); + const i6 = tt(t6, e5); + void 0 !== o5[K] && (t6[K] = o5[K]), o5[":@"] ? H2(t6, o5[":@"], l5, e5) : 1 !== Object.keys(t6).length || void 0 === t6[e5.textNodeName] || e5.alwaysCreateTextNode ? 0 === Object.keys(t6).length && (e5.alwaysCreateTextNode ? t6[e5.textNodeName] = "" : t6 = "") : t6 = t6[e5.textNodeName], void 0 !== s5[a5] && s5.hasOwnProperty(a5) ? (Array.isArray(s5[a5]) || (s5[a5] = [s5[a5]]), s5[a5].push(t6)) : e5.isArray(a5, l5, i6) ? s5[a5] = [t6] : s5[a5] = t6; + } + } + } + return "string" == typeof n5 ? n5.length > 0 && (s5[e5.textNodeName] = n5) : void 0 !== n5 && (s5[e5.textNodeName] = n5), s5; + } + function J2(t5) { + const e5 = Object.keys(t5); + for (let t6 = 0; t6 < e5.length; t6++) { + const i5 = e5[t6]; + if (":@" !== i5) return i5; + } + } + function H2(t5, e5, i5, n5) { + if (e5) { + const s5 = Object.keys(e5), r5 = s5.length; + for (let o5 = 0; o5 < r5; o5++) { + const r6 = s5[o5]; + n5.isArray(r6, i5 + "." + r6, true, true) ? t5[r6] = [e5[r6]] : t5[r6] = e5[r6]; + } + } + } + function tt(t5, e5) { + const { textNodeName: i5 } = e5, n5 = Object.keys(t5).length; + return 0 === n5 || !(1 !== n5 || !t5[i5] && "boolean" != typeof t5[i5] && 0 !== t5[i5]); + } + class et { + constructor(t5) { + this.externalEntities = {}, this.options = (function(t6) { + return Object.assign({}, v4, t6); + })(t5); + } + parse(t5, e5) { + if ("string" != typeof t5 && t5.toString) t5 = t5.toString(); + else if ("string" != typeof t5) throw new Error("XML data is accepted in String or Bytes[] form."); + if (e5) { + true === e5 && (e5 = {}); + const i6 = a4(t5, e5); + if (true !== i6) throw Error(`${i6.err.msg}:${i6.err.line}:${i6.err.col}`); + } + const i5 = new D2(this.options); + i5.addExternalEntities(this.externalEntities); + const n5 = i5.parseXml(t5); + return this.options.preserveOrder || void 0 === n5 ? n5 : Q(n5, this.options); + } + addEntity(t5, e5) { + if (-1 !== e5.indexOf("&")) throw new Error("Entity value can't have '&'"); + if (-1 !== t5.indexOf("&") || -1 !== t5.indexOf(";")) throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); + if ("&" === e5) throw new Error("An entity with value '&' is not permitted"); + this.externalEntities[t5] = e5; + } + static getMetaDataSymbol() { + return y2.getMetaDataSymbol(); + } + } + function it(t5, e5) { + let i5 = ""; + return e5.format && e5.indentBy.length > 0 && (i5 = "\n"), nt(t5, e5, "", i5); + } + function nt(t5, e5, i5, n5) { + let s5 = "", r5 = false; + for (let o5 = 0; o5 < t5.length; o5++) { + const a5 = t5[o5], l5 = st(a5); + if (void 0 === l5) continue; + let u5 = ""; + if (u5 = 0 === i5.length ? l5 : `${i5}.${l5}`, l5 === e5.textNodeName) { + let t6 = a5[l5]; + ot(u5, e5) || (t6 = e5.tagValueProcessor(l5, t6), t6 = at(t6, e5)), r5 && (s5 += n5), s5 += t6, r5 = false; + continue; + } + if (l5 === e5.cdataPropName) { + r5 && (s5 += n5), s5 += ``, r5 = false; + continue; + } + if (l5 === e5.commentPropName) { + s5 += n5 + ``, r5 = true; + continue; + } + if ("?" === l5[0]) { + const t6 = rt(a5[":@"], e5), i6 = "?xml" === l5 ? "" : n5; + let o6 = a5[l5][0][e5.textNodeName]; + o6 = 0 !== o6.length ? " " + o6 : "", s5 += i6 + `<${l5}${o6}${t6}?>`, r5 = true; + continue; + } + let h5 = n5; + "" !== h5 && (h5 += e5.indentBy); + const d5 = n5 + `<${l5}${rt(a5[":@"], e5)}`, p5 = nt(a5[l5], e5, u5, h5); + -1 !== e5.unpairedTags.indexOf(l5) ? e5.suppressUnpairedNode ? s5 += d5 + ">" : s5 += d5 + "/>" : p5 && 0 !== p5.length || !e5.suppressEmptyNode ? p5 && p5.endsWith(">") ? s5 += d5 + `>${p5}${n5}` : (s5 += d5 + ">", p5 && "" !== n5 && (p5.includes("/>") || p5.includes("`) : s5 += d5 + "/>", r5 = true; + } + return s5; + } + function st(t5) { + const e5 = Object.keys(t5); + for (let i5 = 0; i5 < e5.length; i5++) { + const n5 = e5[i5]; + if (t5.hasOwnProperty(n5) && ":@" !== n5) return n5; + } + } + function rt(t5, e5) { + let i5 = ""; + if (t5 && !e5.ignoreAttributes) for (let n5 in t5) { + if (!t5.hasOwnProperty(n5)) continue; + let s5 = e5.attributeValueProcessor(n5, t5[n5]); + s5 = at(s5, e5), true === s5 && e5.suppressBooleanAttributes ? i5 += ` ${n5.substr(e5.attributeNamePrefix.length)}` : i5 += ` ${n5.substr(e5.attributeNamePrefix.length)}="${s5}"`; + } + return i5; + } + function ot(t5, e5) { + let i5 = (t5 = t5.substr(0, t5.length - e5.textNodeName.length - 1)).substr(t5.lastIndexOf(".") + 1); + for (let n5 in e5.stopNodes) if (e5.stopNodes[n5] === t5 || e5.stopNodes[n5] === "*." + i5) return true; + return false; + } + function at(t5, e5) { + if (t5 && t5.length > 0 && e5.processEntities) for (let i5 = 0; i5 < e5.entities.length; i5++) { + const n5 = e5.entities[i5]; + t5 = t5.replace(n5.regex, n5.val); + } + return t5; + } + const lt = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t5, e5) { + return e5; + }, attributeValueProcessor: function(t5, e5) { + return e5; + }, preserveOrder: false, commentPropName: false, unpairedTags: [], entities: [{ regex: new RegExp("&", "g"), val: "&" }, { regex: new RegExp(">", "g"), val: ">" }, { regex: new RegExp("<", "g"), val: "<" }, { regex: new RegExp("'", "g"), val: "'" }, { regex: new RegExp('"', "g"), val: """ }], processEntities: true, stopNodes: [], oneListGroup: false }; + function ut(t5) { + this.options = Object.assign({}, lt, t5), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + return false; + } : (this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = pt), this.processTextOrObjNode = ht, this.options.format ? (this.indentate = dt, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + return ""; + }, this.tagEndChar = ">", this.newLine = ""); + } + function ht(t5, e5, i5, n5) { + const s5 = this.j2x(t5, i5 + 1, n5.concat(e5)); + return void 0 !== t5[this.options.textNodeName] && 1 === Object.keys(t5).length ? this.buildTextValNode(t5[this.options.textNodeName], e5, s5.attrStr, i5) : this.buildObjectNode(s5.val, e5, s5.attrStr, i5); + } + function dt(t5) { + return this.options.indentBy.repeat(t5); + } + function pt(t5) { + return !(!t5.startsWith(this.options.attributeNamePrefix) || t5 === this.options.textNodeName) && t5.substr(this.attrPrefixLen); + } + ut.prototype.build = function(t5) { + return this.options.preserveOrder ? it(t5, this.options) : (Array.isArray(t5) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t5 = { [this.options.arrayNodeName]: t5 }), this.j2x(t5, 0, []).val); + }, ut.prototype.j2x = function(t5, e5, i5) { + let n5 = "", s5 = ""; + const r5 = i5.join("."); + for (let o5 in t5) if (Object.prototype.hasOwnProperty.call(t5, o5)) if (void 0 === t5[o5]) this.isAttribute(o5) && (s5 += ""); + else if (null === t5[o5]) this.isAttribute(o5) || o5 === this.options.cdataPropName ? s5 += "" : "?" === o5[0] ? s5 += this.indentate(e5) + "<" + o5 + "?" + this.tagEndChar : s5 += this.indentate(e5) + "<" + o5 + "/" + this.tagEndChar; + else if (t5[o5] instanceof Date) s5 += this.buildTextValNode(t5[o5], o5, "", e5); + else if ("object" != typeof t5[o5]) { + const i6 = this.isAttribute(o5); + if (i6 && !this.ignoreAttributesFn(i6, r5)) n5 += this.buildAttrPairStr(i6, "" + t5[o5]); + else if (!i6) if (o5 === this.options.textNodeName) { + let e6 = this.options.tagValueProcessor(o5, "" + t5[o5]); + s5 += this.replaceEntitiesValue(e6); + } else s5 += this.buildTextValNode(t5[o5], o5, "", e5); + } else if (Array.isArray(t5[o5])) { + const n6 = t5[o5].length; + let r6 = "", a5 = ""; + for (let l5 = 0; l5 < n6; l5++) { + const n7 = t5[o5][l5]; + if (void 0 === n7) ; + else if (null === n7) "?" === o5[0] ? s5 += this.indentate(e5) + "<" + o5 + "?" + this.tagEndChar : s5 += this.indentate(e5) + "<" + o5 + "/" + this.tagEndChar; + else if ("object" == typeof n7) if (this.options.oneListGroup) { + const t6 = this.j2x(n7, e5 + 1, i5.concat(o5)); + r6 += t6.val, this.options.attributesGroupName && n7.hasOwnProperty(this.options.attributesGroupName) && (a5 += t6.attrStr); + } else r6 += this.processTextOrObjNode(n7, o5, e5, i5); + else if (this.options.oneListGroup) { + let t6 = this.options.tagValueProcessor(o5, n7); + t6 = this.replaceEntitiesValue(t6), r6 += t6; + } else r6 += this.buildTextValNode(n7, o5, "", e5); + } + this.options.oneListGroup && (r6 = this.buildObjectNode(r6, o5, a5, e5)), s5 += r6; + } else if (this.options.attributesGroupName && o5 === this.options.attributesGroupName) { + const e6 = Object.keys(t5[o5]), i6 = e6.length; + for (let s6 = 0; s6 < i6; s6++) n5 += this.buildAttrPairStr(e6[s6], "" + t5[o5][e6[s6]]); + } else s5 += this.processTextOrObjNode(t5[o5], o5, e5, i5); + return { attrStr: n5, val: s5 }; + }, ut.prototype.buildAttrPairStr = function(t5, e5) { + return e5 = this.options.attributeValueProcessor(t5, "" + e5), e5 = this.replaceEntitiesValue(e5), this.options.suppressBooleanAttributes && "true" === e5 ? " " + t5 : " " + t5 + '="' + e5 + '"'; + }, ut.prototype.buildObjectNode = function(t5, e5, i5, n5) { + if ("" === t5) return "?" === e5[0] ? this.indentate(n5) + "<" + e5 + i5 + "?" + this.tagEndChar : this.indentate(n5) + "<" + e5 + i5 + this.closeTag(e5) + this.tagEndChar; + { + let s5 = "` + this.newLine : this.indentate(n5) + "<" + e5 + i5 + r5 + this.tagEndChar + t5 + this.indentate(n5) + s5 : this.indentate(n5) + "<" + e5 + i5 + r5 + ">" + t5 + s5; + } + }, ut.prototype.closeTag = function(t5) { + let e5 = ""; + return -1 !== this.options.unpairedTags.indexOf(t5) ? this.options.suppressUnpairedNode || (e5 = "/") : e5 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; + if (false !== this.options.commentPropName && e5 === this.options.commentPropName) return this.indentate(n5) + `` + this.newLine; + if ("?" === e5[0]) return this.indentate(n5) + "<" + e5 + i5 + "?" + this.tagEndChar; + { + let s5 = this.options.tagValueProcessor(e5, t5); + return s5 = this.replaceEntitiesValue(s5), "" === s5 ? this.indentate(n5) + "<" + e5 + i5 + this.closeTag(e5) + this.tagEndChar : this.indentate(n5) + "<" + e5 + i5 + ">" + s5 + " 0 && this.options.processEntities) for (let e5 = 0; e5 < this.options.entities.length; e5++) { + const i5 = this.options.entities[e5]; + t5 = t5.replace(i5.regex, i5.val); + } + return t5; + }; + const ft = { validate: a4 }; + module2.exports = e4; + })(); + } +}); + +// node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +var require_xml_parser = __commonJS({ + "node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.parseXML = parseXML3; + var fast_xml_parser_1 = require_fxp(); + var parser = new fast_xml_parser_1.XMLParser({ + attributeNamePrefix: "", + htmlEntities: true, + ignoreAttributes: false, + ignoreDeclaration: true, + parseTagValue: false, + trimValues: false, + tagValueProcessor: (_, val) => val.trim() === "" && val.includes("\n") ? "" : void 0 + }); + parser.addEntity("#xD", "\r"); + parser.addEntity("#10", "\n"); + function parseXML3(xmlString) { + return parser.parse(xmlString, true); + } + } +}); + +// node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +var require_dist_cjs21 = __commonJS({ + "node_modules/@aws-sdk/xml-builder/dist-cjs/index.js"(exports2) { + "use strict"; + var xmlParser = require_xml_parser(); + function escapeAttribute(value) { + return value.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """); + } + function escapeElement(value) { + return value.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(//g, ">").replace(/\r/g, " ").replace(/\n/g, " ").replace(/\u0085/g, "…").replace(/\u2028/, "
"); + } + var XmlText2 = class { + value; + constructor(value) { + this.value = value; + } + toString() { + return escapeElement("" + this.value); + } + }; + var XmlNode2 = class _XmlNode { + name; + children; + attributes = {}; + static of(name, childText, withName) { + const node = new _XmlNode(name); + if (childText !== void 0) { + node.addChildNode(new XmlText2(childText)); + } + if (withName !== void 0) { + node.withName(withName); + } + return node; + } + constructor(name, children = []) { + this.name = name; + this.children = children; + } + withName(name) { + this.name = name; + return this; + } + addAttribute(name, value) { + this.attributes[name] = value; + return this; + } + addChildNode(child) { + this.children.push(child); + return this; + } + removeAttribute(name) { + delete this.attributes[name]; + return this; + } + n(name) { + this.name = name; + return this; + } + c(child) { + this.children.push(child); + return this; + } + a(name, value) { + if (value != null) { + this.attributes[name] = value; + } + return this; + } + cc(input, field, withName = field) { + if (input[field] != null) { + const node = _XmlNode.of(field, input[field]).withName(withName); + this.c(node); + } + } + l(input, listName, memberName, valueProvider) { + if (input[listName] != null) { + const nodes = valueProvider(); + nodes.map((node) => { + node.withName(memberName); + this.c(node); + }); + } + } + lc(input, listName, memberName, valueProvider) { + if (input[listName] != null) { + const nodes = valueProvider(); + const containerNode = new _XmlNode(memberName); + nodes.map((node) => { + containerNode.c(node); + }); + this.c(containerNode); + } + } + toString() { + const hasChildren = Boolean(this.children.length); + let xmlText = `<${this.name}`; + const attributes = this.attributes; + for (const attributeName of Object.keys(attributes)) { + const attribute = attributes[attributeName]; + if (attribute != null) { + xmlText += ` ${attributeName}="${escapeAttribute("" + attribute)}"`; + } + } + return xmlText += !hasChildren ? "/>" : `>${this.children.map((c4) => c4.toString()).join("")}`; + } + }; + Object.defineProperty(exports2, "parseXML", { + enumerable: true, + get: function() { + return xmlParser.parseXML; + } + }); + exports2.XmlNode = XmlNode2; + exports2.XmlText = XmlText2; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js +var import_xml_builder, import_smithy_client4, import_util_utf87, XmlShapeDeserializer; +var init_XmlShapeDeserializer = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js"() { + import_xml_builder = __toESM(require_dist_cjs21()); + init_protocols(); + init_schema(); + import_smithy_client4 = __toESM(require_dist_cjs20()); + import_util_utf87 = __toESM(require_dist_cjs8()); + init_ConfigurableSerdeContext(); + init_UnionSerde(); + XmlShapeDeserializer = class extends SerdeContextConfig { + settings; + stringDeserializer; + constructor(settings) { + super(); + this.settings = settings; + this.stringDeserializer = new FromStringShapeDeserializer(settings); + } + setSerdeContext(serdeContext) { + this.serdeContext = serdeContext; + this.stringDeserializer.setSerdeContext(serdeContext); + } + read(schema, bytes, key) { + const ns = NormalizedSchema.of(schema); + const memberSchemas = ns.getMemberSchemas(); + const isEventPayload = ns.isStructSchema() && ns.isMemberSchema() && !!Object.values(memberSchemas).find((memberNs) => { + return !!memberNs.getMemberTraits().eventPayload; + }); + if (isEventPayload) { + const output = {}; + const memberName = Object.keys(memberSchemas)[0]; + const eventMemberSchema = memberSchemas[memberName]; + if (eventMemberSchema.isBlobSchema()) { + output[memberName] = bytes; + } else { + output[memberName] = this.read(memberSchemas[memberName], bytes); + } + return output; + } + const xmlString = (this.serdeContext?.utf8Encoder ?? import_util_utf87.toUtf8)(bytes); + const parsedObject = this.parseXml(xmlString); + return this.readSchema(schema, key ? parsedObject[key] : parsedObject); + } + readSchema(_schema, value) { + const ns = NormalizedSchema.of(_schema); + if (ns.isUnitSchema()) { + return; + } + const traits = ns.getMergedTraits(); + if (ns.isListSchema() && !Array.isArray(value)) { + return this.readSchema(ns, [value]); + } + if (value == null) { + return value; + } + if (typeof value === "object") { + const sparse = !!traits.sparse; + const flat = !!traits.xmlFlattened; + if (ns.isListSchema()) { + const listValue = ns.getValueSchema(); + const buffer2 = []; + const sourceKey = listValue.getMergedTraits().xmlName ?? "member"; + const source = flat ? value : (value[0] ?? value)[sourceKey]; + const sourceArray = Array.isArray(source) ? source : [source]; + for (const v4 of sourceArray) { + if (v4 != null || sparse) { + buffer2.push(this.readSchema(listValue, v4)); + } + } + return buffer2; + } + const buffer = {}; + if (ns.isMapSchema()) { + const keyNs = ns.getKeySchema(); + const memberNs = ns.getValueSchema(); + let entries; + if (flat) { + entries = Array.isArray(value) ? value : [value]; + } else { + entries = Array.isArray(value.entry) ? value.entry : [value.entry]; + } + const keyProperty = keyNs.getMergedTraits().xmlName ?? "key"; + const valueProperty = memberNs.getMergedTraits().xmlName ?? "value"; + for (const entry of entries) { + const key = entry[keyProperty]; + const value2 = entry[valueProperty]; + if (value2 != null || sparse) { + buffer[key] = this.readSchema(memberNs, value2); + } + } + return buffer; + } + if (ns.isStructSchema()) { + const union = ns.isUnionSchema(); + let unionSerde; + if (union) { + unionSerde = new UnionSerde(value, buffer); + } + for (const [memberName, memberSchema] of ns.structIterator()) { + const memberTraits = memberSchema.getMergedTraits(); + const xmlObjectKey = !memberTraits.httpPayload ? memberSchema.getMemberTraits().xmlName ?? memberName : memberTraits.xmlName ?? memberSchema.getName(); + if (union) { + unionSerde.mark(xmlObjectKey); + } + if (value[xmlObjectKey] != null) { + buffer[memberName] = this.readSchema(memberSchema, value[xmlObjectKey]); + } + } + if (union) { + unionSerde.writeUnknown(); + } + return buffer; + } + if (ns.isDocumentSchema()) { + return value; + } + throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${ns.getName(true)}`); + } + if (ns.isListSchema()) { + return []; + } + if (ns.isMapSchema() || ns.isStructSchema()) { + return {}; + } + return this.stringDeserializer.read(ns, value); + } + parseXml(xml) { + if (xml.length) { + let parsedObj; + try { + parsedObj = (0, import_xml_builder.parseXML)(xml); + } catch (e4) { + if (e4 && typeof e4 === "object") { + Object.defineProperty(e4, "$responseBodyText", { + value: xml + }); + } + throw e4; + } + const textNodeName = "#text"; + const key = Object.keys(parsedObj)[0]; + const parsedObjToReturn = parsedObj[key]; + if (parsedObjToReturn[textNodeName]) { + parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; + delete parsedObjToReturn[textNodeName]; + } + return (0, import_smithy_client4.getValueFromTextNode)(parsedObjToReturn); + } + return {}; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js +var import_smithy_client5, import_util_base646, QueryShapeSerializer; +var init_QueryShapeSerializer = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js"() { + init_protocols(); + init_schema(); + init_serde(); + import_smithy_client5 = __toESM(require_dist_cjs20()); + import_util_base646 = __toESM(require_dist_cjs9()); + init_ConfigurableSerdeContext(); + QueryShapeSerializer = class extends SerdeContextConfig { + settings; + buffer; + constructor(settings) { + super(); + this.settings = settings; + } + write(schema, value, prefix = "") { + if (this.buffer === void 0) { + this.buffer = ""; + } + const ns = NormalizedSchema.of(schema); + if (prefix && !prefix.endsWith(".")) { + prefix += "."; + } + if (ns.isBlobSchema()) { + if (typeof value === "string" || value instanceof Uint8Array) { + this.writeKey(prefix); + this.writeValue((this.serdeContext?.base64Encoder ?? import_util_base646.toBase64)(value)); + } + } else if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isStringSchema()) { + if (value != null) { + this.writeKey(prefix); + this.writeValue(String(value)); + } else if (ns.isIdempotencyToken()) { + this.writeKey(prefix); + this.writeValue((0, import_uuid.v4)()); + } + } else if (ns.isBigIntegerSchema()) { + if (value != null) { + this.writeKey(prefix); + this.writeValue(String(value)); + } + } else if (ns.isBigDecimalSchema()) { + if (value != null) { + this.writeKey(prefix); + this.writeValue(value instanceof NumericValue ? value.string : String(value)); + } + } else if (ns.isTimestampSchema()) { + if (value instanceof Date) { + this.writeKey(prefix); + const format2 = determineTimestampFormat(ns, this.settings); + switch (format2) { + case 5: + this.writeValue(value.toISOString().replace(".000Z", "Z")); + break; + case 6: + this.writeValue((0, import_smithy_client5.dateToUtcString)(value)); + break; + case 7: + this.writeValue(String(value.getTime() / 1e3)); + break; + } + } + } else if (ns.isDocumentSchema()) { + if (Array.isArray(value)) { + this.write(64 | 15, value, prefix); + } else if (value instanceof Date) { + this.write(4, value, prefix); + } else if (value instanceof Uint8Array) { + this.write(21, value, prefix); + } else if (value && typeof value === "object") { + this.write(128 | 15, value, prefix); + } else { + this.writeKey(prefix); + this.writeValue(String(value)); + } + } else if (ns.isListSchema()) { + if (Array.isArray(value)) { + if (value.length === 0) { + if (this.settings.serializeEmptyLists) { + this.writeKey(prefix); + this.writeValue(""); + } + } else { + const member2 = ns.getValueSchema(); + const flat = this.settings.flattenLists || ns.getMergedTraits().xmlFlattened; + let i4 = 1; + for (const item of value) { + if (item == null) { + continue; + } + const traits = member2.getMergedTraits(); + const suffix = this.getKey("member", traits.xmlName, traits.ec2QueryName); + const key = flat ? `${prefix}${i4}` : `${prefix}${suffix}.${i4}`; + this.write(member2, item, key); + ++i4; + } + } + } + } else if (ns.isMapSchema()) { + if (value && typeof value === "object") { + const keySchema = ns.getKeySchema(); + const memberSchema = ns.getValueSchema(); + const flat = ns.getMergedTraits().xmlFlattened; + let i4 = 1; + for (const [k4, v4] of Object.entries(value)) { + if (v4 == null) { + continue; + } + const keyTraits = keySchema.getMergedTraits(); + const keySuffix = this.getKey("key", keyTraits.xmlName, keyTraits.ec2QueryName); + const key = flat ? `${prefix}${i4}.${keySuffix}` : `${prefix}entry.${i4}.${keySuffix}`; + const valTraits = memberSchema.getMergedTraits(); + const valueSuffix = this.getKey("value", valTraits.xmlName, valTraits.ec2QueryName); + const valueKey = flat ? `${prefix}${i4}.${valueSuffix}` : `${prefix}entry.${i4}.${valueSuffix}`; + this.write(keySchema, k4, key); + this.write(memberSchema, v4, valueKey); + ++i4; + } + } + } else if (ns.isStructSchema()) { + if (value && typeof value === "object") { + let didWriteMember = false; + for (const [memberName, member2] of ns.structIterator()) { + if (value[memberName] == null && !member2.isIdempotencyToken()) { + continue; + } + const traits = member2.getMergedTraits(); + const suffix = this.getKey(memberName, traits.xmlName, traits.ec2QueryName, "struct"); + const key = `${prefix}${suffix}`; + this.write(member2, value[memberName], key); + didWriteMember = true; + } + if (!didWriteMember && ns.isUnionSchema()) { + const { $unknown } = value; + if (Array.isArray($unknown)) { + const [k4, v4] = $unknown; + const key = `${prefix}${k4}`; + this.write(15, v4, key); + } + } + } + } else if (ns.isUnitSchema()) { + } else { + throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${ns.getName(true)}`); + } + } + flush() { + if (this.buffer === void 0) { + throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer."); + } + const str = this.buffer; + delete this.buffer; + return str; + } + getKey(memberName, xmlName, ec2QueryName, keySource) { + const { ec2, capitalizeKeys } = this.settings; + if (ec2 && ec2QueryName) { + return ec2QueryName; + } + const key = xmlName ?? memberName; + if (capitalizeKeys && keySource === "struct") { + return key[0].toUpperCase() + key.slice(1); + } + return key; + } + writeKey(key) { + if (key.endsWith(".")) { + key = key.slice(0, key.length - 1); + } + this.buffer += `&${extendedEncodeURIComponent(key)}=`; + } + writeValue(value) { + this.buffer += extendedEncodeURIComponent(value); + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +var AwsQueryProtocol; +var init_AwsQueryProtocol = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js"() { + init_protocols(); + init_schema(); + init_ProtocolLib(); + init_XmlShapeDeserializer(); + init_QueryShapeSerializer(); + AwsQueryProtocol = class extends RpcProtocol { + options; + serializer; + deserializer; + mixin = new ProtocolLib(); + constructor(options) { + super({ + defaultNamespace: options.defaultNamespace + }); + this.options = options; + const settings = { + timestampFormat: { + useTrait: true, + default: 5 + }, + httpBindings: false, + xmlNamespace: options.xmlNamespace, + serviceNamespace: options.defaultNamespace, + serializeEmptyLists: true + }; + this.serializer = new QueryShapeSerializer(settings); + this.deserializer = new XmlShapeDeserializer(settings); + } + getShapeId() { + return "aws.protocols#awsQuery"; + } + setSerdeContext(serdeContext) { + this.serializer.setSerdeContext(serdeContext); + this.deserializer.setSerdeContext(serdeContext); + } + getPayloadCodec() { + throw new Error("AWSQuery protocol has no payload codec."); + } + async serializeRequest(operationSchema, input, context) { + const request = await super.serializeRequest(operationSchema, input, context); + if (!request.path.endsWith("/")) { + request.path += "/"; + } + Object.assign(request.headers, { + "content-type": `application/x-www-form-urlencoded` + }); + if (deref(operationSchema.input) === "unit" || !request.body) { + request.body = ""; + } + const action = operationSchema.name.split("#")[1] ?? operationSchema.name; + request.body = `Action=${action}&Version=${this.options.version}` + request.body; + if (request.body.endsWith("&")) { + request.body = request.body.slice(-1); + } + return request; + } + async deserializeResponse(operationSchema, context, response) { + const deserializer = this.deserializer; + const ns = NormalizedSchema.of(operationSchema.output); + const dataObject = {}; + if (response.statusCode >= 300) { + const bytes2 = await collectBody(response.body, context); + if (bytes2.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(15, bytes2)); + } + await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); + } + for (const header in response.headers) { + const value = response.headers[header]; + delete response.headers[header]; + response.headers[header.toLowerCase()] = value; + } + const shortName = operationSchema.name.split("#")[1] ?? operationSchema.name; + const awsQueryResultKey = ns.isStructSchema() && this.useNestedResult() ? shortName + "Result" : void 0; + const bytes = await collectBody(response.body, context); + if (bytes.byteLength > 0) { + Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey)); + } + const output = { + $metadata: this.deserializeMetadata(response), + ...dataObject + }; + return output; + } + useNestedResult() { + return true; + } + async handleError(operationSchema, context, response, dataObject, metadata) { + const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? "Unknown"; + const errorData = this.loadQueryError(dataObject); + const message2 = this.loadQueryErrorMessage(dataObject); + errorData.message = message2; + errorData.Error = { + Type: errorData.Type, + Code: errorData.Code, + Message: message2 + }; + const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, this.mixin.findQueryCompatibleError); + const ns = NormalizedSchema.of(errorSchema); + const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; + const exception = new ErrorCtor(message2); + const output = { + Type: errorData.Error.Type, + Code: errorData.Error.Code, + Error: errorData.Error + }; + for (const [name, member2] of ns.structIterator()) { + const target = member2.getMergedTraits().xmlName ?? name; + const value = errorData[target] ?? dataObject[target]; + output[name] = this.deserializer.readSchema(member2, value); + } + throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { + $fault: ns.getMergedTraits().error, + message: message2 + }, output), dataObject); + } + loadQueryErrorCode(output, data2) { + const code = (data2.Errors?.[0]?.Error ?? data2.Errors?.Error ?? data2.Error)?.Code; + if (code !== void 0) { + return code; + } + if (output.statusCode == 404) { + return "NotFound"; + } + } + loadQueryError(data2) { + return data2.Errors?.[0]?.Error ?? data2.Errors?.Error ?? data2.Error; + } + loadQueryErrorMessage(data2) { + const errorData = this.loadQueryError(data2); + return errorData?.message ?? errorData?.Message ?? data2.message ?? data2.Message ?? "Unknown"; + } + getDefaultContentType() { + return "application/x-www-form-urlencoded"; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js +var AwsEc2QueryProtocol; +var init_AwsEc2QueryProtocol = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js"() { + init_AwsQueryProtocol(); + AwsEc2QueryProtocol = class extends AwsQueryProtocol { + options; + constructor(options) { + super(options); + this.options = options; + const ec2Settings = { + capitalizeKeys: true, + flattenLists: true, + serializeEmptyLists: false, + ec2: true + }; + Object.assign(this.serializer.settings, ec2Settings); + } + useNestedResult() { + return false; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js +var import_xml_builder2, import_smithy_client6, parseXmlBody, parseXmlErrorBody, loadRestXmlErrorCode; +var init_parseXmlBody = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js"() { + import_xml_builder2 = __toESM(require_dist_cjs21()); + import_smithy_client6 = __toESM(require_dist_cjs20()); + init_common(); + parseXmlBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + let parsedObj; + try { + parsedObj = (0, import_xml_builder2.parseXML)(encoded); + } catch (e4) { + if (e4 && typeof e4 === "object") { + Object.defineProperty(e4, "$responseBodyText", { + value: encoded + }); + } + throw e4; + } + const textNodeName = "#text"; + const key = Object.keys(parsedObj)[0]; + const parsedObjToReturn = parsedObj[key]; + if (parsedObjToReturn[textNodeName]) { + parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; + delete parsedObjToReturn[textNodeName]; + } + return (0, import_smithy_client6.getValueFromTextNode)(parsedObjToReturn); + } + return {}; + }); + parseXmlErrorBody = async (errorBody, context) => { + const value = await parseXmlBody(errorBody, context); + if (value.Error) { + value.Error.message = value.Error.message ?? value.Error.Message; + } + return value; + }; + loadRestXmlErrorCode = (output, data2) => { + if (data2?.Error?.Code !== void 0) { + return data2.Error.Code; + } + if (data2?.Code !== void 0) { + return data2.Code; + } + if (output.statusCode == 404) { + return "NotFound"; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js +var import_xml_builder3, import_smithy_client7, import_util_base647, XmlShapeSerializer; +var init_XmlShapeSerializer = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js"() { + import_xml_builder3 = __toESM(require_dist_cjs21()); + init_protocols(); + init_schema(); + init_serde(); + import_smithy_client7 = __toESM(require_dist_cjs20()); + import_util_base647 = __toESM(require_dist_cjs9()); + init_ConfigurableSerdeContext(); + XmlShapeSerializer = class extends SerdeContextConfig { + settings; + stringBuffer; + byteBuffer; + buffer; + constructor(settings) { + super(); + this.settings = settings; + } + write(schema, value) { + const ns = NormalizedSchema.of(schema); + if (ns.isStringSchema() && typeof value === "string") { + this.stringBuffer = value; + } else if (ns.isBlobSchema()) { + this.byteBuffer = "byteLength" in value ? value : (this.serdeContext?.base64Decoder ?? import_util_base647.fromBase64)(value); + } else { + this.buffer = this.writeStruct(ns, value, void 0); + const traits = ns.getMergedTraits(); + if (traits.httpPayload && !traits.xmlName) { + this.buffer.withName(ns.getName()); + } + } + } + flush() { + if (this.byteBuffer !== void 0) { + const bytes = this.byteBuffer; + delete this.byteBuffer; + return bytes; + } + if (this.stringBuffer !== void 0) { + const str = this.stringBuffer; + delete this.stringBuffer; + return str; + } + const buffer = this.buffer; + if (this.settings.xmlNamespace) { + if (!buffer?.attributes?.["xmlns"]) { + buffer.addAttribute("xmlns", this.settings.xmlNamespace); + } + } + delete this.buffer; + return buffer.toString(); + } + writeStruct(ns, value, parentXmlns) { + const traits = ns.getMergedTraits(); + const name = ns.isMemberSchema() && !traits.httpPayload ? ns.getMemberTraits().xmlName ?? ns.getMemberName() : traits.xmlName ?? ns.getName(); + if (!name || !ns.isStructSchema()) { + throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${ns.getName(true)}.`); + } + const structXmlNode = import_xml_builder3.XmlNode.of(name); + const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns); + for (const [memberName, memberSchema] of ns.structIterator()) { + const val = value[memberName]; + if (val != null || memberSchema.isIdempotencyToken()) { + if (memberSchema.getMergedTraits().xmlAttribute) { + structXmlNode.addAttribute(memberSchema.getMergedTraits().xmlName ?? memberName, this.writeSimple(memberSchema, val)); + continue; + } + if (memberSchema.isListSchema()) { + this.writeList(memberSchema, val, structXmlNode, xmlns); + } else if (memberSchema.isMapSchema()) { + this.writeMap(memberSchema, val, structXmlNode, xmlns); + } else if (memberSchema.isStructSchema()) { + structXmlNode.addChildNode(this.writeStruct(memberSchema, val, xmlns)); + } else { + const memberNode = import_xml_builder3.XmlNode.of(memberSchema.getMergedTraits().xmlName ?? memberSchema.getMemberName()); + this.writeSimpleInto(memberSchema, val, memberNode, xmlns); + structXmlNode.addChildNode(memberNode); + } + } + } + const { $unknown } = value; + if ($unknown && ns.isUnionSchema() && Array.isArray($unknown) && Object.keys(value).length === 1) { + const [k4, v4] = $unknown; + const node = import_xml_builder3.XmlNode.of(k4); + if (typeof v4 !== "string") { + if (value instanceof import_xml_builder3.XmlNode || value instanceof import_xml_builder3.XmlText) { + structXmlNode.addChildNode(value); + } else { + throw new Error(`@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.`); + } + } + this.writeSimpleInto(0, v4, node, xmlns); + structXmlNode.addChildNode(node); + } + if (xmlns) { + structXmlNode.addAttribute(xmlnsAttr, xmlns); + } + return structXmlNode; + } + writeList(listMember, array, container, parentXmlns) { + if (!listMember.isMemberSchema()) { + throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${listMember.getName(true)}`); + } + const listTraits = listMember.getMergedTraits(); + const listValueSchema = listMember.getValueSchema(); + const listValueTraits = listValueSchema.getMergedTraits(); + const sparse = !!listValueTraits.sparse; + const flat = !!listTraits.xmlFlattened; + const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(listMember, parentXmlns); + const writeItem = (container2, value) => { + if (listValueSchema.isListSchema()) { + this.writeList(listValueSchema, Array.isArray(value) ? value : [value], container2, xmlns); + } else if (listValueSchema.isMapSchema()) { + this.writeMap(listValueSchema, value, container2, xmlns); + } else if (listValueSchema.isStructSchema()) { + const struct2 = this.writeStruct(listValueSchema, value, xmlns); + container2.addChildNode(struct2.withName(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member")); + } else { + const listItemNode = import_xml_builder3.XmlNode.of(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member"); + this.writeSimpleInto(listValueSchema, value, listItemNode, xmlns); + container2.addChildNode(listItemNode); + } + }; + if (flat) { + for (const value of array) { + if (sparse || value != null) { + writeItem(container, value); + } + } + } else { + const listNode = import_xml_builder3.XmlNode.of(listTraits.xmlName ?? listMember.getMemberName()); + if (xmlns) { + listNode.addAttribute(xmlnsAttr, xmlns); + } + for (const value of array) { + if (sparse || value != null) { + writeItem(listNode, value); + } + } + container.addChildNode(listNode); + } + } + writeMap(mapMember, map2, container, parentXmlns, containerIsMap = false) { + if (!mapMember.isMemberSchema()) { + throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${mapMember.getName(true)}`); + } + const mapTraits = mapMember.getMergedTraits(); + const mapKeySchema = mapMember.getKeySchema(); + const mapKeyTraits = mapKeySchema.getMergedTraits(); + const keyTag = mapKeyTraits.xmlName ?? "key"; + const mapValueSchema = mapMember.getValueSchema(); + const mapValueTraits = mapValueSchema.getMergedTraits(); + const valueTag = mapValueTraits.xmlName ?? "value"; + const sparse = !!mapValueTraits.sparse; + const flat = !!mapTraits.xmlFlattened; + const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(mapMember, parentXmlns); + const addKeyValue = (entry, key, val) => { + const keyNode = import_xml_builder3.XmlNode.of(keyTag, key); + const [keyXmlnsAttr, keyXmlns] = this.getXmlnsAttribute(mapKeySchema, xmlns); + if (keyXmlns) { + keyNode.addAttribute(keyXmlnsAttr, keyXmlns); + } + entry.addChildNode(keyNode); + let valueNode = import_xml_builder3.XmlNode.of(valueTag); + if (mapValueSchema.isListSchema()) { + this.writeList(mapValueSchema, val, valueNode, xmlns); + } else if (mapValueSchema.isMapSchema()) { + this.writeMap(mapValueSchema, val, valueNode, xmlns, true); + } else if (mapValueSchema.isStructSchema()) { + valueNode = this.writeStruct(mapValueSchema, val, xmlns); + } else { + this.writeSimpleInto(mapValueSchema, val, valueNode, xmlns); + } + entry.addChildNode(valueNode); + }; + if (flat) { + for (const [key, val] of Object.entries(map2)) { + if (sparse || val != null) { + const entry = import_xml_builder3.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName()); + addKeyValue(entry, key, val); + container.addChildNode(entry); + } + } + } else { + let mapNode; + if (!containerIsMap) { + mapNode = import_xml_builder3.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName()); + if (xmlns) { + mapNode.addAttribute(xmlnsAttr, xmlns); + } + container.addChildNode(mapNode); + } + for (const [key, val] of Object.entries(map2)) { + if (sparse || val != null) { + const entry = import_xml_builder3.XmlNode.of("entry"); + addKeyValue(entry, key, val); + (containerIsMap ? container : mapNode).addChildNode(entry); + } + } + } + } + writeSimple(_schema, value) { + if (null === value) { + throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value."); + } + const ns = NormalizedSchema.of(_schema); + let nodeContents = null; + if (value && typeof value === "object") { + if (ns.isBlobSchema()) { + nodeContents = (this.serdeContext?.base64Encoder ?? import_util_base647.toBase64)(value); + } else if (ns.isTimestampSchema() && value instanceof Date) { + const format2 = determineTimestampFormat(ns, this.settings); + switch (format2) { + case 5: + nodeContents = value.toISOString().replace(".000Z", "Z"); + break; + case 6: + nodeContents = (0, import_smithy_client7.dateToUtcString)(value); + break; + case 7: + nodeContents = String(value.getTime() / 1e3); + break; + default: + console.warn("Missing timestamp format, using http date", value); + nodeContents = (0, import_smithy_client7.dateToUtcString)(value); + break; + } + } else if (ns.isBigDecimalSchema() && value) { + if (value instanceof NumericValue) { + return value.string; + } + return String(value); + } else if (ns.isMapSchema() || ns.isListSchema()) { + throw new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."); + } else { + throw new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${ns.getName(true)}`); + } + } + if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) { + nodeContents = String(value); + } + if (ns.isStringSchema()) { + if (value === void 0 && ns.isIdempotencyToken()) { + nodeContents = (0, import_uuid.v4)(); + } else { + nodeContents = String(value); + } + } + if (nodeContents === null) { + throw new Error(`Unhandled schema-value pair ${ns.getName(true)}=${value}`); + } + return nodeContents; + } + writeSimpleInto(_schema, value, into, parentXmlns) { + const nodeContents = this.writeSimple(_schema, value); + const ns = NormalizedSchema.of(_schema); + const content = new import_xml_builder3.XmlText(nodeContents); + const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns); + if (xmlns) { + into.addAttribute(xmlnsAttr, xmlns); + } + into.addChildNode(content); + } + getXmlnsAttribute(ns, parentXmlns) { + const traits = ns.getMergedTraits(); + const [prefix, xmlns] = traits.xmlNamespace ?? []; + if (xmlns && xmlns !== parentXmlns) { + return [prefix ? `xmlns:${prefix}` : "xmlns", xmlns]; + } + return [void 0, void 0]; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js +var XmlCodec; +var init_XmlCodec = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js"() { + init_ConfigurableSerdeContext(); + init_XmlShapeDeserializer(); + init_XmlShapeSerializer(); + XmlCodec = class extends SerdeContextConfig { + settings; + constructor(settings) { + super(); + this.settings = settings; + } + createSerializer() { + const serializer = new XmlShapeSerializer(this.settings); + serializer.setSerdeContext(this.serdeContext); + return serializer; + } + createDeserializer() { + const deserializer = new XmlShapeDeserializer(this.settings); + deserializer.setSerdeContext(this.serdeContext); + return deserializer; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +var AwsRestXmlProtocol; +var init_AwsRestXmlProtocol = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js"() { + init_protocols(); + init_schema(); + init_ProtocolLib(); + init_parseXmlBody(); + init_XmlCodec(); + AwsRestXmlProtocol = class extends HttpBindingProtocol { + codec; + serializer; + deserializer; + mixin = new ProtocolLib(); + constructor(options) { + super(options); + const settings = { + timestampFormat: { + useTrait: true, + default: 5 + }, + httpBindings: true, + xmlNamespace: options.xmlNamespace, + serviceNamespace: options.defaultNamespace + }; + this.codec = new XmlCodec(settings); + this.serializer = new HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings); + this.deserializer = new HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings); + } + getPayloadCodec() { + return this.codec; + } + getShapeId() { + return "aws.protocols#restXml"; + } + async serializeRequest(operationSchema, input, context) { + const request = await super.serializeRequest(operationSchema, input, context); + const inputSchema = NormalizedSchema.of(operationSchema.input); + if (!request.headers["content-type"]) { + const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); + if (contentType) { + request.headers["content-type"] = contentType; + } + } + if (typeof request.body === "string" && request.headers["content-type"] === this.getDefaultContentType() && !request.body.startsWith("' + request.body; + } + return request; + } + async deserializeResponse(operationSchema, context, response) { + return super.deserializeResponse(operationSchema, context, response); + } + async handleError(operationSchema, context, response, dataObject, metadata) { + const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown"; + if (dataObject.Error && typeof dataObject.Error === "object") { + for (const key of Object.keys(dataObject.Error)) { + dataObject[key] = dataObject.Error[key]; + if (key.toLowerCase() === "message") { + dataObject.message = dataObject.Error[key]; + } + } + } + if (dataObject.RequestId && !metadata.requestId) { + metadata.requestId = dataObject.RequestId; + } + const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); + const ns = NormalizedSchema.of(errorSchema); + const message2 = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown"; + const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error; + const exception = new ErrorCtor(message2); + await this.deserializeHttpMessage(errorSchema, context, response, dataObject); + const output = {}; + for (const [name, member2] of ns.structIterator()) { + const target = member2.getMergedTraits().xmlName ?? name; + const value = dataObject.Error?.[target] ?? dataObject[target]; + output[name] = this.codec.createDeserializer().readSchema(member2, value); + } + throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { + $fault: ns.getMergedTraits().error, + message: message2 + }, output), dataObject); + } + getDefaultContentType() { + return "application/xml"; + } + hasUnstructuredPayloadBinding(ns) { + for (const [, member2] of ns.structIterator()) { + if (member2.getMergedTraits().httpPayload) { + return !(member2.isStructSchema() || member2.isMapSchema() || member2.isListSchema()); + } + } + return false; + } + }; + } +}); + +// node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +var protocols_exports2 = {}; +__export(protocols_exports2, { + AwsEc2QueryProtocol: () => AwsEc2QueryProtocol, + AwsJson1_0Protocol: () => AwsJson1_0Protocol, + AwsJson1_1Protocol: () => AwsJson1_1Protocol, + AwsJsonRpcProtocol: () => AwsJsonRpcProtocol, + AwsQueryProtocol: () => AwsQueryProtocol, + AwsRestJsonProtocol: () => AwsRestJsonProtocol, + AwsRestXmlProtocol: () => AwsRestXmlProtocol, + AwsSmithyRpcV2CborProtocol: () => AwsSmithyRpcV2CborProtocol, + JsonCodec: () => JsonCodec, + JsonShapeDeserializer: () => JsonShapeDeserializer, + JsonShapeSerializer: () => JsonShapeSerializer, + XmlCodec: () => XmlCodec, + XmlShapeDeserializer: () => XmlShapeDeserializer, + XmlShapeSerializer: () => XmlShapeSerializer, + _toBool: () => _toBool, + _toNum: () => _toNum, + _toStr: () => _toStr, + awsExpectUnion: () => awsExpectUnion, + loadRestJsonErrorCode: () => loadRestJsonErrorCode, + loadRestXmlErrorCode: () => loadRestXmlErrorCode, + parseJsonBody: () => parseJsonBody, + parseJsonErrorBody: () => parseJsonErrorBody, + parseXmlBody: () => parseXmlBody, + parseXmlErrorBody: () => parseXmlErrorBody +}); +var init_protocols2 = __esm({ + "node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js"() { + init_AwsSmithyRpcV2CborProtocol(); + init_coercing_serializers(); + init_AwsJson1_0Protocol(); + init_AwsJson1_1Protocol(); + init_AwsJsonRpcProtocol(); + init_AwsRestJsonProtocol(); + init_JsonCodec(); + init_JsonShapeDeserializer(); + init_JsonShapeSerializer(); + init_awsExpectUnion(); + init_parseJsonBody(); + init_AwsEc2QueryProtocol(); + init_AwsQueryProtocol(); + init_AwsRestXmlProtocol(); + init_XmlCodec(); + init_XmlShapeDeserializer(); + init_XmlShapeSerializer(); + init_parseXmlBody(); + } +}); + +// node_modules/@aws-sdk/core/dist-es/index.js +var dist_es_exports2 = {}; +__export(dist_es_exports2, { + AWSSDKSigV4Signer: () => AWSSDKSigV4Signer, + AwsEc2QueryProtocol: () => AwsEc2QueryProtocol, + AwsJson1_0Protocol: () => AwsJson1_0Protocol, + AwsJson1_1Protocol: () => AwsJson1_1Protocol, + AwsJsonRpcProtocol: () => AwsJsonRpcProtocol, + AwsQueryProtocol: () => AwsQueryProtocol, + AwsRestJsonProtocol: () => AwsRestJsonProtocol, + AwsRestXmlProtocol: () => AwsRestXmlProtocol, + AwsSdkSigV4ASigner: () => AwsSdkSigV4ASigner, + AwsSdkSigV4Signer: () => AwsSdkSigV4Signer, + AwsSmithyRpcV2CborProtocol: () => AwsSmithyRpcV2CborProtocol, + JsonCodec: () => JsonCodec, + JsonShapeDeserializer: () => JsonShapeDeserializer, + JsonShapeSerializer: () => JsonShapeSerializer, + NODE_AUTH_SCHEME_PREFERENCE_OPTIONS: () => NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, + NODE_SIGV4A_CONFIG_OPTIONS: () => NODE_SIGV4A_CONFIG_OPTIONS, + XmlCodec: () => XmlCodec, + XmlShapeDeserializer: () => XmlShapeDeserializer, + XmlShapeSerializer: () => XmlShapeSerializer, + _toBool: () => _toBool, + _toNum: () => _toNum, + _toStr: () => _toStr, + awsExpectUnion: () => awsExpectUnion, + emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion, + getBearerTokenEnvKey: () => getBearerTokenEnvKey, + loadRestJsonErrorCode: () => loadRestJsonErrorCode, + loadRestXmlErrorCode: () => loadRestXmlErrorCode, + parseJsonBody: () => parseJsonBody, + parseJsonErrorBody: () => parseJsonErrorBody, + parseXmlBody: () => parseXmlBody, + parseXmlErrorBody: () => parseXmlErrorBody, + resolveAWSSDKSigV4Config: () => resolveAWSSDKSigV4Config, + resolveAwsSdkSigV4AConfig: () => resolveAwsSdkSigV4AConfig, + resolveAwsSdkSigV4Config: () => resolveAwsSdkSigV4Config, + setCredentialFeature: () => setCredentialFeature, + setFeature: () => setFeature, + setTokenFeature: () => setTokenFeature, + state: () => state, + validateSigningProperties: () => validateSigningProperties +}); +var init_dist_es2 = __esm({ + "node_modules/@aws-sdk/core/dist-es/index.js"() { + init_client(); + init_httpAuthSchemes2(); + init_protocols2(); + } +}); + +// node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +var require_dist_cjs22 = __commonJS({ + "node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + isArrayBuffer: () => isArrayBuffer + }); + module2.exports = __toCommonJS2(src_exports); + var isArrayBuffer = /* @__PURE__ */ __name((arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]", "isArrayBuffer"); + } +}); + +// node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +var require_dist_cjs23 = __commonJS({ + "node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + fromArrayBuffer: () => fromArrayBuffer, + fromString: () => fromString + }); + module2.exports = __toCommonJS2(src_exports); + var import_is_array_buffer = require_dist_cjs22(); + var import_buffer = require("buffer"); + var fromArrayBuffer = /* @__PURE__ */ __name((input, offset = 0, length = input.byteLength - offset) => { + if (!(0, import_is_array_buffer.isArrayBuffer)(input)) { + throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); + } + return import_buffer.Buffer.from(input, offset, length); + }, "fromArrayBuffer"); + var fromString = /* @__PURE__ */ __name((input, encoding) => { + if (typeof input !== "string") { + throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); + } + return encoding ? import_buffer.Buffer.from(input, encoding) : import_buffer.Buffer.from(input); + }, "fromString"); + } +}); + +// node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-cjs/index.js +var require_dist_cjs24 = __commonJS({ + "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-cjs/index.js"(exports2, module2) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __name = (target, value) => __defProp2(target, "name", { value, configurable: true }); + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var src_exports = {}; + __export2(src_exports, { + fromUtf8: () => fromUtf87, + toUint8Array: () => toUint8Array2, + toUtf8: () => toUtf810 + }); + module2.exports = __toCommonJS2(src_exports); + var import_util_buffer_from = require_dist_cjs23(); + var fromUtf87 = /* @__PURE__ */ __name((input) => { + const buf = (0, import_util_buffer_from.fromString)(input, "utf8"); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); + }, "fromUtf8"); + var toUint8Array2 = /* @__PURE__ */ __name((data2) => { + if (typeof data2 === "string") { + return fromUtf87(data2); + } + if (ArrayBuffer.isView(data2)) { + return new Uint8Array(data2.buffer, data2.byteOffset, data2.byteLength / Uint8Array.BYTES_PER_ELEMENT); + } + return new Uint8Array(data2); + }, "toUint8Array"); + var toUtf810 = /* @__PURE__ */ __name((input) => { + if (typeof input === "string") { + return input; + } + if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { + throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array."); + } + return (0, import_util_buffer_from.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); + }, "toUtf8"); + } +}); + +// node_modules/@aws-crypto/util/build/main/convertToBuffer.js +var require_convertToBuffer = __commonJS({ + "node_modules/@aws-crypto/util/build/main/convertToBuffer.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.convertToBuffer = void 0; + var util_utf8_1 = require_dist_cjs24(); + var fromUtf87 = typeof Buffer !== "undefined" && Buffer.from ? function(input) { + return Buffer.from(input, "utf8"); + } : util_utf8_1.fromUtf8; + function convertToBuffer(data2) { + if (data2 instanceof Uint8Array) + return data2; + if (typeof data2 === "string") { + return fromUtf87(data2); + } + if (ArrayBuffer.isView(data2)) { + return new Uint8Array(data2.buffer, data2.byteOffset, data2.byteLength / Uint8Array.BYTES_PER_ELEMENT); + } + return new Uint8Array(data2); + } + exports2.convertToBuffer = convertToBuffer; + } +}); + +// node_modules/@aws-crypto/util/build/main/isEmptyData.js +var require_isEmptyData = __commonJS({ + "node_modules/@aws-crypto/util/build/main/isEmptyData.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isEmptyData = void 0; + function isEmptyData(data2) { + if (typeof data2 === "string") { + return data2.length === 0; + } + return data2.byteLength === 0; + } + exports2.isEmptyData = isEmptyData; + } +}); + +// node_modules/@aws-crypto/util/build/main/numToUint8.js +var require_numToUint8 = __commonJS({ + "node_modules/@aws-crypto/util/build/main/numToUint8.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.numToUint8 = void 0; + function numToUint8(num) { + return new Uint8Array([ + (num & 4278190080) >> 24, + (num & 16711680) >> 16, + (num & 65280) >> 8, + num & 255 + ]); + } + exports2.numToUint8 = numToUint8; + } +}); + +// node_modules/@aws-crypto/util/build/main/uint32ArrayFrom.js +var require_uint32ArrayFrom = __commonJS({ + "node_modules/@aws-crypto/util/build/main/uint32ArrayFrom.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.uint32ArrayFrom = void 0; + function uint32ArrayFrom(a_lookUpTable) { + if (!Uint32Array.from) { + var return_array = new Uint32Array(a_lookUpTable.length); + var a_index = 0; + while (a_index < a_lookUpTable.length) { + return_array[a_index] = a_lookUpTable[a_index]; + a_index += 1; + } + return return_array; + } + return Uint32Array.from(a_lookUpTable); + } + exports2.uint32ArrayFrom = uint32ArrayFrom; + } +}); + +// node_modules/@aws-crypto/util/build/main/index.js +var require_main2 = __commonJS({ + "node_modules/@aws-crypto/util/build/main/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.uint32ArrayFrom = exports2.numToUint8 = exports2.isEmptyData = exports2.convertToBuffer = void 0; + var convertToBuffer_1 = require_convertToBuffer(); + Object.defineProperty(exports2, "convertToBuffer", { enumerable: true, get: function() { + return convertToBuffer_1.convertToBuffer; + } }); + var isEmptyData_1 = require_isEmptyData(); + Object.defineProperty(exports2, "isEmptyData", { enumerable: true, get: function() { + return isEmptyData_1.isEmptyData; + } }); + var numToUint8_1 = require_numToUint8(); + Object.defineProperty(exports2, "numToUint8", { enumerable: true, get: function() { + return numToUint8_1.numToUint8; + } }); + var uint32ArrayFrom_1 = require_uint32ArrayFrom(); + Object.defineProperty(exports2, "uint32ArrayFrom", { enumerable: true, get: function() { + return uint32ArrayFrom_1.uint32ArrayFrom; + } }); + } +}); + +// node_modules/@aws-crypto/crc32c/build/main/aws_crc32c.js +var require_aws_crc32c = __commonJS({ + "node_modules/@aws-crypto/crc32c/build/main/aws_crc32c.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AwsCrc32c = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var util_1 = require_main2(); + var index_1 = require_main3(); + var AwsCrc32c = ( + /** @class */ + (function() { + function AwsCrc32c2() { + this.crc32c = new index_1.Crc32c(); + } + AwsCrc32c2.prototype.update = function(toHash) { + if ((0, util_1.isEmptyData)(toHash)) + return; + this.crc32c.update((0, util_1.convertToBuffer)(toHash)); + }; + AwsCrc32c2.prototype.digest = function() { + return tslib_1.__awaiter(this, void 0, void 0, function() { + return tslib_1.__generator(this, function(_a2) { + return [2, (0, util_1.numToUint8)(this.crc32c.digest())]; + }); + }); + }; + AwsCrc32c2.prototype.reset = function() { + this.crc32c = new index_1.Crc32c(); + }; + return AwsCrc32c2; + })() + ); + exports2.AwsCrc32c = AwsCrc32c; + } +}); + +// node_modules/@aws-crypto/crc32c/build/main/index.js +var require_main3 = __commonJS({ + "node_modules/@aws-crypto/crc32c/build/main/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AwsCrc32c = exports2.Crc32c = exports2.crc32c = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var util_1 = require_main2(); + function crc32c(data2) { + return new Crc32c().update(data2).digest(); + } + exports2.crc32c = crc32c; + var Crc32c = ( + /** @class */ + (function() { + function Crc32c2() { + this.checksum = 4294967295; + } + Crc32c2.prototype.update = function(data2) { + var e_1, _a2; + try { + for (var data_1 = tslib_1.__values(data2), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) { + var byte = data_1_1.value; + this.checksum = this.checksum >>> 8 ^ lookupTable[(this.checksum ^ byte) & 255]; + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (data_1_1 && !data_1_1.done && (_a2 = data_1.return)) _a2.call(data_1); + } finally { + if (e_1) throw e_1.error; + } + } + return this; + }; + Crc32c2.prototype.digest = function() { + return (this.checksum ^ 4294967295) >>> 0; + }; + return Crc32c2; + })() + ); + exports2.Crc32c = Crc32c; + var a_lookupTable = [ + 0, + 4067132163, + 3778769143, + 324072436, + 3348797215, + 904991772, + 648144872, + 3570033899, + 2329499855, + 2024987596, + 1809983544, + 2575936315, + 1296289744, + 3207089363, + 2893594407, + 1578318884, + 274646895, + 3795141740, + 4049975192, + 51262619, + 3619967088, + 632279923, + 922689671, + 3298075524, + 2592579488, + 1760304291, + 2075979607, + 2312596564, + 1562183871, + 2943781820, + 3156637768, + 1313733451, + 549293790, + 3537243613, + 3246849577, + 871202090, + 3878099393, + 357341890, + 102525238, + 4101499445, + 2858735121, + 1477399826, + 1264559846, + 3107202533, + 1845379342, + 2677391885, + 2361733625, + 2125378298, + 820201905, + 3263744690, + 3520608582, + 598981189, + 4151959214, + 85089709, + 373468761, + 3827903834, + 3124367742, + 1213305469, + 1526817161, + 2842354314, + 2107672161, + 2412447074, + 2627466902, + 1861252501, + 1098587580, + 3004210879, + 2688576843, + 1378610760, + 2262928035, + 1955203488, + 1742404180, + 2511436119, + 3416409459, + 969524848, + 714683780, + 3639785095, + 205050476, + 4266873199, + 3976438427, + 526918040, + 1361435347, + 2739821008, + 2954799652, + 1114974503, + 2529119692, + 1691668175, + 2005155131, + 2247081528, + 3690758684, + 697762079, + 986182379, + 3366744552, + 476452099, + 3993867776, + 4250756596, + 255256311, + 1640403810, + 2477592673, + 2164122517, + 1922457750, + 2791048317, + 1412925310, + 1197962378, + 3037525897, + 3944729517, + 427051182, + 170179418, + 4165941337, + 746937522, + 3740196785, + 3451792453, + 1070968646, + 1905808397, + 2213795598, + 2426610938, + 1657317369, + 3053634322, + 1147748369, + 1463399397, + 2773627110, + 4215344322, + 153784257, + 444234805, + 3893493558, + 1021025245, + 3467647198, + 3722505002, + 797665321, + 2197175160, + 1889384571, + 1674398607, + 2443626636, + 1164749927, + 3070701412, + 2757221520, + 1446797203, + 137323447, + 4198817972, + 3910406976, + 461344835, + 3484808360, + 1037989803, + 781091935, + 3705997148, + 2460548119, + 1623424788, + 1939049696, + 2180517859, + 1429367560, + 2807687179, + 3020495871, + 1180866812, + 410100952, + 3927582683, + 4182430767, + 186734380, + 3756733383, + 763408580, + 1053836080, + 3434856499, + 2722870694, + 1344288421, + 1131464017, + 2971354706, + 1708204729, + 2545590714, + 2229949006, + 1988219213, + 680717673, + 3673779818, + 3383336350, + 1002577565, + 4010310262, + 493091189, + 238226049, + 4233660802, + 2987750089, + 1082061258, + 1395524158, + 2705686845, + 1972364758, + 2279892693, + 2494862625, + 1725896226, + 952904198, + 3399985413, + 3656866545, + 731699698, + 4283874585, + 222117402, + 510512622, + 3959836397, + 3280807620, + 837199303, + 582374963, + 3504198960, + 68661723, + 4135334616, + 3844915500, + 390545967, + 1230274059, + 3141532936, + 2825850620, + 1510247935, + 2395924756, + 2091215383, + 1878366691, + 2644384480, + 3553878443, + 565732008, + 854102364, + 3229815391, + 340358836, + 3861050807, + 4117890627, + 119113024, + 1493875044, + 2875275879, + 3090270611, + 1247431312, + 2660249211, + 1828433272, + 2141937292, + 2378227087, + 3811616794, + 291187481, + 34330861, + 4032846830, + 615137029, + 3603020806, + 3314634738, + 939183345, + 1776939221, + 2609017814, + 2295496738, + 2058945313, + 2926798794, + 1545135305, + 1330124605, + 3173225534, + 4084100981, + 17165430, + 307568514, + 3762199681, + 888469610, + 3332340585, + 3587147933, + 665062302, + 2042050490, + 2346497209, + 2559330125, + 1793573966, + 3190661285, + 1279665062, + 1595330642, + 2910671697 + ]; + var lookupTable = (0, util_1.uint32ArrayFrom)(a_lookupTable); + var aws_crc32c_1 = require_aws_crc32c(); + Object.defineProperty(exports2, "AwsCrc32c", { enumerable: true, get: function() { + return aws_crc32c_1.AwsCrc32c; + } }); + } +}); + +// node_modules/@aws-sdk/crc64-nvme/dist-cjs/index.js +var require_dist_cjs25 = __commonJS({ + "node_modules/@aws-sdk/crc64-nvme/dist-cjs/index.js"(exports2) { + "use strict"; + var generateCRC64NVMETable = () => { + const sliceLength = 8; + const tables = new Array(sliceLength); + for (let slice = 0; slice < sliceLength; slice++) { + const table = new Array(512); + for (let i4 = 0; i4 < 256; i4++) { + let crc = BigInt(i4); + for (let j4 = 0; j4 < 8 * (slice + 1); j4++) { + if (crc & 1n) { + crc = crc >> 1n ^ 0x9a6c9329ac4bc9b5n; + } else { + crc = crc >> 1n; + } + } + table[i4 * 2] = Number(crc >> 32n & 0xffffffffn); + table[i4 * 2 + 1] = Number(crc & 0xffffffffn); + } + tables[slice] = new Uint32Array(table); + } + return tables; + }; + var CRC64_NVME_REVERSED_TABLE; + var t0; + var t1; + var t22; + var t32; + var t4; + var t5; + var t6; + var t7; + var ensureTablesInitialized = () => { + if (!CRC64_NVME_REVERSED_TABLE) { + CRC64_NVME_REVERSED_TABLE = generateCRC64NVMETable(); + [t0, t1, t22, t32, t4, t5, t6, t7] = CRC64_NVME_REVERSED_TABLE; + } + }; + var Crc64Nvme = class { + c1 = 0; + c2 = 0; + constructor() { + ensureTablesInitialized(); + this.reset(); + } + update(data2) { + const len = data2.length; + let i4 = 0; + let crc1 = this.c1; + let crc2 = this.c2; + while (i4 + 8 <= len) { + const idx0 = ((crc2 ^ data2[i4++]) & 255) << 1; + const idx1 = ((crc2 >>> 8 ^ data2[i4++]) & 255) << 1; + const idx2 = ((crc2 >>> 16 ^ data2[i4++]) & 255) << 1; + const idx3 = ((crc2 >>> 24 ^ data2[i4++]) & 255) << 1; + const idx4 = ((crc1 ^ data2[i4++]) & 255) << 1; + const idx5 = ((crc1 >>> 8 ^ data2[i4++]) & 255) << 1; + const idx6 = ((crc1 >>> 16 ^ data2[i4++]) & 255) << 1; + const idx7 = ((crc1 >>> 24 ^ data2[i4++]) & 255) << 1; + crc1 = t7[idx0] ^ t6[idx1] ^ t5[idx2] ^ t4[idx3] ^ t32[idx4] ^ t22[idx5] ^ t1[idx6] ^ t0[idx7]; + crc2 = t7[idx0 + 1] ^ t6[idx1 + 1] ^ t5[idx2 + 1] ^ t4[idx3 + 1] ^ t32[idx4 + 1] ^ t22[idx5 + 1] ^ t1[idx6 + 1] ^ t0[idx7 + 1]; + } + while (i4 < len) { + const idx = ((crc2 ^ data2[i4]) & 255) << 1; + crc2 = (crc2 >>> 8 | (crc1 & 255) << 24) >>> 0; + crc1 = crc1 >>> 8 ^ t0[idx]; + crc2 ^= t0[idx + 1]; + i4++; + } + this.c1 = crc1; + this.c2 = crc2; + } + async digest() { + const c1 = this.c1 ^ 4294967295; + const c22 = this.c2 ^ 4294967295; + return new Uint8Array([ + c1 >>> 24, + c1 >>> 16 & 255, + c1 >>> 8 & 255, + c1 & 255, + c22 >>> 24, + c22 >>> 16 & 255, + c22 >>> 8 & 255, + c22 & 255 + ]); + } + reset() { + this.c1 = 4294967295; + this.c2 = 4294967295; + } + }; + var crc64NvmeCrtContainer = { + CrtCrc64Nvme: null + }; + exports2.Crc64Nvme = Crc64Nvme; + exports2.crc64NvmeCrtContainer = crc64NvmeCrtContainer; + } +}); + +// node_modules/@aws-crypto/crc32/build/main/aws_crc32.js +var require_aws_crc32 = __commonJS({ + "node_modules/@aws-crypto/crc32/build/main/aws_crc32.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AwsCrc32 = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var util_1 = require_main2(); + var index_1 = require_main4(); + var AwsCrc32 = ( + /** @class */ + (function() { + function AwsCrc322() { + this.crc32 = new index_1.Crc32(); + } + AwsCrc322.prototype.update = function(toHash) { + if ((0, util_1.isEmptyData)(toHash)) + return; + this.crc32.update((0, util_1.convertToBuffer)(toHash)); + }; + AwsCrc322.prototype.digest = function() { + return tslib_1.__awaiter(this, void 0, void 0, function() { + return tslib_1.__generator(this, function(_a2) { + return [2, (0, util_1.numToUint8)(this.crc32.digest())]; + }); + }); + }; + AwsCrc322.prototype.reset = function() { + this.crc32 = new index_1.Crc32(); + }; + return AwsCrc322; + })() + ); + exports2.AwsCrc32 = AwsCrc32; + } +}); + +// node_modules/@aws-crypto/crc32/build/main/index.js +var require_main4 = __commonJS({ + "node_modules/@aws-crypto/crc32/build/main/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AwsCrc32 = exports2.Crc32 = exports2.crc32 = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var util_1 = require_main2(); + function crc32(data2) { + return new Crc32().update(data2).digest(); + } + exports2.crc32 = crc32; + var Crc32 = ( + /** @class */ + (function() { + function Crc322() { + this.checksum = 4294967295; + } + Crc322.prototype.update = function(data2) { + var e_1, _a2; + try { + for (var data_1 = tslib_1.__values(data2), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) { + var byte = data_1_1.value; + this.checksum = this.checksum >>> 8 ^ lookupTable[(this.checksum ^ byte) & 255]; + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (data_1_1 && !data_1_1.done && (_a2 = data_1.return)) _a2.call(data_1); + } finally { + if (e_1) throw e_1.error; + } + } + return this; + }; + Crc322.prototype.digest = function() { + return (this.checksum ^ 4294967295) >>> 0; + }; + return Crc322; + })() + ); + exports2.Crc32 = Crc32; + var a_lookUpTable = [ + 0, + 1996959894, + 3993919788, + 2567524794, + 124634137, + 1886057615, + 3915621685, + 2657392035, + 249268274, + 2044508324, + 3772115230, + 2547177864, + 162941995, + 2125561021, + 3887607047, + 2428444049, + 498536548, + 1789927666, + 4089016648, + 2227061214, + 450548861, + 1843258603, + 4107580753, + 2211677639, + 325883990, + 1684777152, + 4251122042, + 2321926636, + 335633487, + 1661365465, + 4195302755, + 2366115317, + 997073096, + 1281953886, + 3579855332, + 2724688242, + 1006888145, + 1258607687, + 3524101629, + 2768942443, + 901097722, + 1119000684, + 3686517206, + 2898065728, + 853044451, + 1172266101, + 3705015759, + 2882616665, + 651767980, + 1373503546, + 3369554304, + 3218104598, + 565507253, + 1454621731, + 3485111705, + 3099436303, + 671266974, + 1594198024, + 3322730930, + 2970347812, + 795835527, + 1483230225, + 3244367275, + 3060149565, + 1994146192, + 31158534, + 2563907772, + 4023717930, + 1907459465, + 112637215, + 2680153253, + 3904427059, + 2013776290, + 251722036, + 2517215374, + 3775830040, + 2137656763, + 141376813, + 2439277719, + 3865271297, + 1802195444, + 476864866, + 2238001368, + 4066508878, + 1812370925, + 453092731, + 2181625025, + 4111451223, + 1706088902, + 314042704, + 2344532202, + 4240017532, + 1658658271, + 366619977, + 2362670323, + 4224994405, + 1303535960, + 984961486, + 2747007092, + 3569037538, + 1256170817, + 1037604311, + 2765210733, + 3554079995, + 1131014506, + 879679996, + 2909243462, + 3663771856, + 1141124467, + 855842277, + 2852801631, + 3708648649, + 1342533948, + 654459306, + 3188396048, + 3373015174, + 1466479909, + 544179635, + 3110523913, + 3462522015, + 1591671054, + 702138776, + 2966460450, + 3352799412, + 1504918807, + 783551873, + 3082640443, + 3233442989, + 3988292384, + 2596254646, + 62317068, + 1957810842, + 3939845945, + 2647816111, + 81470997, + 1943803523, + 3814918930, + 2489596804, + 225274430, + 2053790376, + 3826175755, + 2466906013, + 167816743, + 2097651377, + 4027552580, + 2265490386, + 503444072, + 1762050814, + 4150417245, + 2154129355, + 426522225, + 1852507879, + 4275313526, + 2312317920, + 282753626, + 1742555852, + 4189708143, + 2394877945, + 397917763, + 1622183637, + 3604390888, + 2714866558, + 953729732, + 1340076626, + 3518719985, + 2797360999, + 1068828381, + 1219638859, + 3624741850, + 2936675148, + 906185462, + 1090812512, + 3747672003, + 2825379669, + 829329135, + 1181335161, + 3412177804, + 3160834842, + 628085408, + 1382605366, + 3423369109, + 3138078467, + 570562233, + 1426400815, + 3317316542, + 2998733608, + 733239954, + 1555261956, + 3268935591, + 3050360625, + 752459403, + 1541320221, + 2607071920, + 3965973030, + 1969922972, + 40735498, + 2617837225, + 3943577151, + 1913087877, + 83908371, + 2512341634, + 3803740692, + 2075208622, + 213261112, + 2463272603, + 3855990285, + 2094854071, + 198958881, + 2262029012, + 4057260610, + 1759359992, + 534414190, + 2176718541, + 4139329115, + 1873836001, + 414664567, + 2282248934, + 4279200368, + 1711684554, + 285281116, + 2405801727, + 4167216745, + 1634467795, + 376229701, + 2685067896, + 3608007406, + 1308918612, + 956543938, + 2808555105, + 3495958263, + 1231636301, + 1047427035, + 2932959818, + 3654703836, + 1088359270, + 936918e3, + 2847714899, + 3736837829, + 1202900863, + 817233897, + 3183342108, + 3401237130, + 1404277552, + 615818150, + 3134207493, + 3453421203, + 1423857449, + 601450431, + 3009837614, + 3294710456, + 1567103746, + 711928724, + 3020668471, + 3272380065, + 1510334235, + 755167117 + ]; + var lookupTable = (0, util_1.uint32ArrayFrom)(a_lookUpTable); + var aws_crc32_1 = require_aws_crc32(); + Object.defineProperty(exports2, "AwsCrc32", { enumerable: true, get: function() { + return aws_crc32_1.AwsCrc32; + } }); + } +}); + +// node_modules/@aws-sdk/middleware-flexible-checksums/dist-cjs/getCrc32ChecksumAlgorithmFunction.js +var require_getCrc32ChecksumAlgorithmFunction = __commonJS({ + "node_modules/@aws-sdk/middleware-flexible-checksums/dist-cjs/getCrc32ChecksumAlgorithmFunction.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getCrc32ChecksumAlgorithmFunction = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var crc32_1 = require_main4(); + var util_1 = require_main2(); + var zlib = tslib_1.__importStar(require("zlib")); + var NodeCrc32 = class { + checksum = 0; + update(data2) { + this.checksum = zlib.crc32(data2, this.checksum); + } + async digest() { + return (0, util_1.numToUint8)(this.checksum); + } + reset() { + this.checksum = 0; + } + }; + var getCrc32ChecksumAlgorithmFunction = () => { + if (typeof zlib.crc32 === "undefined") { + return crc32_1.AwsCrc32; + } + return NodeCrc32; + }; + exports2.getCrc32ChecksumAlgorithmFunction = getCrc32ChecksumAlgorithmFunction; + } +}); + +// node_modules/@aws-sdk/middleware-flexible-checksums/dist-cjs/index.js +var require_dist_cjs26 = __commonJS({ + "node_modules/@aws-sdk/middleware-flexible-checksums/dist-cjs/index.js"(exports2) { + "use strict"; + var core = (init_dist_es2(), __toCommonJS(dist_es_exports2)); + var protocolHttp = require_dist_cjs2(); + var utilStream = require_dist_cjs15(); + var isArrayBuffer = require_dist_cjs6(); + var crc32c = require_main3(); + var crc64Nvme = require_dist_cjs25(); + var getCrc32ChecksumAlgorithmFunction = require_getCrc32ChecksumAlgorithmFunction(); + var utilUtf8 = require_dist_cjs8(); + var utilMiddleware = require_dist_cjs4(); + var RequestChecksumCalculation = { + WHEN_SUPPORTED: "WHEN_SUPPORTED", + WHEN_REQUIRED: "WHEN_REQUIRED" + }; + var DEFAULT_REQUEST_CHECKSUM_CALCULATION = RequestChecksumCalculation.WHEN_SUPPORTED; + var ResponseChecksumValidation = { + WHEN_SUPPORTED: "WHEN_SUPPORTED", + WHEN_REQUIRED: "WHEN_REQUIRED" + }; + var DEFAULT_RESPONSE_CHECKSUM_VALIDATION = RequestChecksumCalculation.WHEN_SUPPORTED; + exports2.ChecksumAlgorithm = void 0; + (function(ChecksumAlgorithm) { + ChecksumAlgorithm["MD5"] = "MD5"; + ChecksumAlgorithm["CRC32"] = "CRC32"; + ChecksumAlgorithm["CRC32C"] = "CRC32C"; + ChecksumAlgorithm["CRC64NVME"] = "CRC64NVME"; + ChecksumAlgorithm["SHA1"] = "SHA1"; + ChecksumAlgorithm["SHA256"] = "SHA256"; + })(exports2.ChecksumAlgorithm || (exports2.ChecksumAlgorithm = {})); + exports2.ChecksumLocation = void 0; + (function(ChecksumLocation) { + ChecksumLocation["HEADER"] = "header"; + ChecksumLocation["TRAILER"] = "trailer"; + })(exports2.ChecksumLocation || (exports2.ChecksumLocation = {})); + var DEFAULT_CHECKSUM_ALGORITHM = exports2.ChecksumAlgorithm.CRC32; + var SelectorType; + (function(SelectorType2) { + SelectorType2["ENV"] = "env"; + SelectorType2["CONFIG"] = "shared config entry"; + })(SelectorType || (SelectorType = {})); + var stringUnionSelector = (obj, key, union, type) => { + if (!(key in obj)) + return void 0; + const value = obj[key].toUpperCase(); + if (!Object.values(union).includes(value)) { + throw new TypeError(`Cannot load ${type} '${key}'. Expected one of ${Object.values(union)}, got '${obj[key]}'.`); + } + return value; + }; + var ENV_REQUEST_CHECKSUM_CALCULATION = "AWS_REQUEST_CHECKSUM_CALCULATION"; + var CONFIG_REQUEST_CHECKSUM_CALCULATION = "request_checksum_calculation"; + var NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => stringUnionSelector(env, ENV_REQUEST_CHECKSUM_CALCULATION, RequestChecksumCalculation, SelectorType.ENV), + configFileSelector: (profile) => stringUnionSelector(profile, CONFIG_REQUEST_CHECKSUM_CALCULATION, RequestChecksumCalculation, SelectorType.CONFIG), + default: DEFAULT_REQUEST_CHECKSUM_CALCULATION + }; + var ENV_RESPONSE_CHECKSUM_VALIDATION = "AWS_RESPONSE_CHECKSUM_VALIDATION"; + var CONFIG_RESPONSE_CHECKSUM_VALIDATION = "response_checksum_validation"; + var NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => stringUnionSelector(env, ENV_RESPONSE_CHECKSUM_VALIDATION, ResponseChecksumValidation, SelectorType.ENV), + configFileSelector: (profile) => stringUnionSelector(profile, CONFIG_RESPONSE_CHECKSUM_VALIDATION, ResponseChecksumValidation, SelectorType.CONFIG), + default: DEFAULT_RESPONSE_CHECKSUM_VALIDATION + }; + var CLIENT_SUPPORTED_ALGORITHMS = [ + exports2.ChecksumAlgorithm.CRC32, + exports2.ChecksumAlgorithm.CRC32C, + exports2.ChecksumAlgorithm.CRC64NVME, + exports2.ChecksumAlgorithm.SHA1, + exports2.ChecksumAlgorithm.SHA256 + ]; + var PRIORITY_ORDER_ALGORITHMS = [ + exports2.ChecksumAlgorithm.SHA256, + exports2.ChecksumAlgorithm.SHA1, + exports2.ChecksumAlgorithm.CRC32, + exports2.ChecksumAlgorithm.CRC32C, + exports2.ChecksumAlgorithm.CRC64NVME + ]; + var getChecksumAlgorithmForRequest = (input, { requestChecksumRequired, requestAlgorithmMember, requestChecksumCalculation }) => { + if (!requestAlgorithmMember) { + return requestChecksumCalculation === RequestChecksumCalculation.WHEN_SUPPORTED || requestChecksumRequired ? DEFAULT_CHECKSUM_ALGORITHM : void 0; + } + if (!input[requestAlgorithmMember]) { + return void 0; + } + const checksumAlgorithm = input[requestAlgorithmMember]; + if (!CLIENT_SUPPORTED_ALGORITHMS.includes(checksumAlgorithm)) { + throw new Error(`The checksum algorithm "${checksumAlgorithm}" is not supported by the client. Select one of ${CLIENT_SUPPORTED_ALGORITHMS}.`); + } + return checksumAlgorithm; + }; + var getChecksumLocationName = (algorithm) => algorithm === exports2.ChecksumAlgorithm.MD5 ? "content-md5" : `x-amz-checksum-${algorithm.toLowerCase()}`; + var hasHeader = (header, headers) => { + const soughtHeader = header.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (soughtHeader === headerName.toLowerCase()) { + return true; + } + } + return false; + }; + var hasHeaderWithPrefix = (headerPrefix, headers) => { + const soughtHeaderPrefix = headerPrefix.toLowerCase(); + for (const headerName of Object.keys(headers)) { + if (headerName.toLowerCase().startsWith(soughtHeaderPrefix)) { + return true; + } + } + return false; + }; + var isStreaming = (body) => body !== void 0 && typeof body !== "string" && !ArrayBuffer.isView(body) && !isArrayBuffer.isArrayBuffer(body); + var selectChecksumAlgorithmFunction = (checksumAlgorithm, config) => { + switch (checksumAlgorithm) { + case exports2.ChecksumAlgorithm.MD5: + return config.md5; + case exports2.ChecksumAlgorithm.CRC32: + return getCrc32ChecksumAlgorithmFunction.getCrc32ChecksumAlgorithmFunction(); + case exports2.ChecksumAlgorithm.CRC32C: + return crc32c.AwsCrc32c; + case exports2.ChecksumAlgorithm.CRC64NVME: + if (typeof crc64Nvme.crc64NvmeCrtContainer.CrtCrc64Nvme !== "function") { + return crc64Nvme.Crc64Nvme; + } + return crc64Nvme.crc64NvmeCrtContainer.CrtCrc64Nvme; + case exports2.ChecksumAlgorithm.SHA1: + return config.sha1; + case exports2.ChecksumAlgorithm.SHA256: + return config.sha256; + default: + throw new Error(`Unsupported checksum algorithm: ${checksumAlgorithm}`); + } + }; + var stringHasher = (checksumAlgorithmFn, body) => { + const hash = new checksumAlgorithmFn(); + hash.update(utilUtf8.toUint8Array(body || "")); + return hash.digest(); + }; + var flexibleChecksumsMiddlewareOptions = { + name: "flexibleChecksumsMiddleware", + step: "build", + tags: ["BODY_CHECKSUM"], + override: true + }; + var flexibleChecksumsMiddleware = (config, middlewareConfig) => (next, context) => async (args2) => { + if (!protocolHttp.HttpRequest.isInstance(args2.request)) { + return next(args2); + } + if (hasHeaderWithPrefix("x-amz-checksum-", args2.request.headers)) { + return next(args2); + } + const { request, input } = args2; + const { body: requestBody, headers } = request; + const { base64Encoder, streamHasher } = config; + const { requestChecksumRequired, requestAlgorithmMember } = middlewareConfig; + const requestChecksumCalculation = await config.requestChecksumCalculation(); + const requestAlgorithmMemberName = requestAlgorithmMember?.name; + const requestAlgorithmMemberHttpHeader = requestAlgorithmMember?.httpHeader; + if (requestAlgorithmMemberName && !input[requestAlgorithmMemberName]) { + if (requestChecksumCalculation === RequestChecksumCalculation.WHEN_SUPPORTED || requestChecksumRequired) { + input[requestAlgorithmMemberName] = DEFAULT_CHECKSUM_ALGORITHM; + if (requestAlgorithmMemberHttpHeader) { + headers[requestAlgorithmMemberHttpHeader] = DEFAULT_CHECKSUM_ALGORITHM; + } + } + } + const checksumAlgorithm = getChecksumAlgorithmForRequest(input, { + requestChecksumRequired, + requestAlgorithmMember: requestAlgorithmMember?.name, + requestChecksumCalculation + }); + let updatedBody = requestBody; + let updatedHeaders = headers; + if (checksumAlgorithm) { + switch (checksumAlgorithm) { + case exports2.ChecksumAlgorithm.CRC32: + core.setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_CRC32", "U"); + break; + case exports2.ChecksumAlgorithm.CRC32C: + core.setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_CRC32C", "V"); + break; + case exports2.ChecksumAlgorithm.CRC64NVME: + core.setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_CRC64", "W"); + break; + case exports2.ChecksumAlgorithm.SHA1: + core.setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_SHA1", "X"); + break; + case exports2.ChecksumAlgorithm.SHA256: + core.setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_SHA256", "Y"); + break; + } + const checksumLocationName = getChecksumLocationName(checksumAlgorithm); + const checksumAlgorithmFn = selectChecksumAlgorithmFunction(checksumAlgorithm, config); + if (isStreaming(requestBody)) { + const { getAwsChunkedEncodingStream, bodyLengthChecker } = config; + updatedBody = getAwsChunkedEncodingStream(typeof config.requestStreamBufferSize === "number" && config.requestStreamBufferSize >= 8 * 1024 ? utilStream.createBufferedReadable(requestBody, config.requestStreamBufferSize, context.logger) : requestBody, { + base64Encoder, + bodyLengthChecker, + checksumLocationName, + checksumAlgorithmFn, + streamHasher + }); + updatedHeaders = { + ...headers, + "content-encoding": headers["content-encoding"] ? `${headers["content-encoding"]},aws-chunked` : "aws-chunked", + "transfer-encoding": "chunked", + "x-amz-decoded-content-length": headers["content-length"], + "x-amz-content-sha256": "STREAMING-UNSIGNED-PAYLOAD-TRAILER", + "x-amz-trailer": checksumLocationName + }; + delete updatedHeaders["content-length"]; + } else if (!hasHeader(checksumLocationName, headers)) { + const rawChecksum = await stringHasher(checksumAlgorithmFn, requestBody); + updatedHeaders = { + ...headers, + [checksumLocationName]: base64Encoder(rawChecksum) + }; + } + } + try { + const result = await next({ + ...args2, + request: { + ...request, + headers: updatedHeaders, + body: updatedBody + } + }); + return result; + } catch (e4) { + if (e4 instanceof Error && e4.name === "InvalidChunkSizeError") { + try { + if (!e4.message.endsWith(".")) { + e4.message += "."; + } + e4.message += " Set [requestStreamBufferSize=number e.g. 65_536] in client constructor to instruct AWS SDK to buffer your input stream."; + } catch (ignored) { + } + } + throw e4; + } + }; + var flexibleChecksumsInputMiddlewareOptions = { + name: "flexibleChecksumsInputMiddleware", + toMiddleware: "serializerMiddleware", + relation: "before", + tags: ["BODY_CHECKSUM"], + override: true + }; + var flexibleChecksumsInputMiddleware = (config, middlewareConfig) => (next, context) => async (args2) => { + const input = args2.input; + const { requestValidationModeMember } = middlewareConfig; + const requestChecksumCalculation = await config.requestChecksumCalculation(); + const responseChecksumValidation = await config.responseChecksumValidation(); + switch (requestChecksumCalculation) { + case RequestChecksumCalculation.WHEN_REQUIRED: + core.setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED", "a"); + break; + case RequestChecksumCalculation.WHEN_SUPPORTED: + core.setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED", "Z"); + break; + } + switch (responseChecksumValidation) { + case ResponseChecksumValidation.WHEN_REQUIRED: + core.setFeature(context, "FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED", "c"); + break; + case ResponseChecksumValidation.WHEN_SUPPORTED: + core.setFeature(context, "FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED", "b"); + break; + } + if (requestValidationModeMember && !input[requestValidationModeMember]) { + if (responseChecksumValidation === ResponseChecksumValidation.WHEN_SUPPORTED) { + input[requestValidationModeMember] = "ENABLED"; + } + } + return next(args2); + }; + var getChecksumAlgorithmListForResponse = (responseAlgorithms = []) => { + const validChecksumAlgorithms = []; + for (const algorithm of PRIORITY_ORDER_ALGORITHMS) { + if (!responseAlgorithms.includes(algorithm) || !CLIENT_SUPPORTED_ALGORITHMS.includes(algorithm)) { + continue; + } + validChecksumAlgorithms.push(algorithm); + } + return validChecksumAlgorithms; + }; + var isChecksumWithPartNumber = (checksum) => { + const lastHyphenIndex = checksum.lastIndexOf("-"); + if (lastHyphenIndex !== -1) { + const numberPart = checksum.slice(lastHyphenIndex + 1); + if (!numberPart.startsWith("0")) { + const number = parseInt(numberPart, 10); + if (!isNaN(number) && number >= 1 && number <= 1e4) { + return true; + } + } + } + return false; + }; + var getChecksum = async (body, { checksumAlgorithmFn, base64Encoder }) => base64Encoder(await stringHasher(checksumAlgorithmFn, body)); + var validateChecksumFromResponse = async (response, { config, responseAlgorithms, logger: logger3 }) => { + const checksumAlgorithms = getChecksumAlgorithmListForResponse(responseAlgorithms); + const { body: responseBody, headers: responseHeaders } = response; + for (const algorithm of checksumAlgorithms) { + const responseHeader = getChecksumLocationName(algorithm); + const checksumFromResponse = responseHeaders[responseHeader]; + if (checksumFromResponse) { + let checksumAlgorithmFn; + try { + checksumAlgorithmFn = selectChecksumAlgorithmFunction(algorithm, config); + } catch (error2) { + if (algorithm === exports2.ChecksumAlgorithm.CRC64NVME) { + logger3?.warn(`Skipping ${exports2.ChecksumAlgorithm.CRC64NVME} checksum validation: ${error2.message}`); + continue; + } + throw error2; + } + const { base64Encoder } = config; + if (isStreaming(responseBody)) { + response.body = utilStream.createChecksumStream({ + expectedChecksum: checksumFromResponse, + checksumSourceLocation: responseHeader, + checksum: new checksumAlgorithmFn(), + source: responseBody, + base64Encoder + }); + return; + } + const checksum = await getChecksum(responseBody, { checksumAlgorithmFn, base64Encoder }); + if (checksum === checksumFromResponse) { + break; + } + throw new Error(`Checksum mismatch: expected "${checksum}" but received "${checksumFromResponse}" in response header "${responseHeader}".`); + } + } + }; + var flexibleChecksumsResponseMiddlewareOptions = { + name: "flexibleChecksumsResponseMiddleware", + toMiddleware: "deserializerMiddleware", + relation: "after", + tags: ["BODY_CHECKSUM"], + override: true + }; + var flexibleChecksumsResponseMiddleware = (config, middlewareConfig) => (next, context) => async (args2) => { + if (!protocolHttp.HttpRequest.isInstance(args2.request)) { + return next(args2); + } + const input = args2.input; + const result = await next(args2); + const response = result.response; + const { requestValidationModeMember, responseAlgorithms } = middlewareConfig; + if (requestValidationModeMember && input[requestValidationModeMember] === "ENABLED") { + const { clientName, commandName } = context; + const isS3WholeObjectMultipartGetResponseChecksum = clientName === "S3Client" && commandName === "GetObjectCommand" && getChecksumAlgorithmListForResponse(responseAlgorithms).every((algorithm) => { + const responseHeader = getChecksumLocationName(algorithm); + const checksumFromResponse = response.headers[responseHeader]; + return !checksumFromResponse || isChecksumWithPartNumber(checksumFromResponse); + }); + if (isS3WholeObjectMultipartGetResponseChecksum) { + return result; + } + await validateChecksumFromResponse(response, { + config, + responseAlgorithms, + logger: context.logger + }); + } + return result; + }; + var getFlexibleChecksumsPlugin = (config, middlewareConfig) => ({ + applyToStack: (clientStack) => { + clientStack.add(flexibleChecksumsMiddleware(config, middlewareConfig), flexibleChecksumsMiddlewareOptions); + clientStack.addRelativeTo(flexibleChecksumsInputMiddleware(config, middlewareConfig), flexibleChecksumsInputMiddlewareOptions); + clientStack.addRelativeTo(flexibleChecksumsResponseMiddleware(config, middlewareConfig), flexibleChecksumsResponseMiddlewareOptions); + } + }); + var resolveFlexibleChecksumsConfig = (input) => { + const { requestChecksumCalculation, responseChecksumValidation, requestStreamBufferSize } = input; + return Object.assign(input, { + requestChecksumCalculation: utilMiddleware.normalizeProvider(requestChecksumCalculation ?? DEFAULT_REQUEST_CHECKSUM_CALCULATION), + responseChecksumValidation: utilMiddleware.normalizeProvider(responseChecksumValidation ?? DEFAULT_RESPONSE_CHECKSUM_VALIDATION), + requestStreamBufferSize: Number(requestStreamBufferSize ?? 0) + }); + }; + exports2.CONFIG_REQUEST_CHECKSUM_CALCULATION = CONFIG_REQUEST_CHECKSUM_CALCULATION; + exports2.CONFIG_RESPONSE_CHECKSUM_VALIDATION = CONFIG_RESPONSE_CHECKSUM_VALIDATION; + exports2.DEFAULT_CHECKSUM_ALGORITHM = DEFAULT_CHECKSUM_ALGORITHM; + exports2.DEFAULT_REQUEST_CHECKSUM_CALCULATION = DEFAULT_REQUEST_CHECKSUM_CALCULATION; + exports2.DEFAULT_RESPONSE_CHECKSUM_VALIDATION = DEFAULT_RESPONSE_CHECKSUM_VALIDATION; + exports2.ENV_REQUEST_CHECKSUM_CALCULATION = ENV_REQUEST_CHECKSUM_CALCULATION; + exports2.ENV_RESPONSE_CHECKSUM_VALIDATION = ENV_RESPONSE_CHECKSUM_VALIDATION; + exports2.NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS = NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS; + exports2.NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS = NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS; + exports2.RequestChecksumCalculation = RequestChecksumCalculation; + exports2.ResponseChecksumValidation = ResponseChecksumValidation; + exports2.flexibleChecksumsMiddleware = flexibleChecksumsMiddleware; + exports2.flexibleChecksumsMiddlewareOptions = flexibleChecksumsMiddlewareOptions; + exports2.getFlexibleChecksumsPlugin = getFlexibleChecksumsPlugin; + exports2.resolveFlexibleChecksumsConfig = resolveFlexibleChecksumsConfig; + } +}); + +// node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js +var require_dist_cjs27 = __commonJS({ + "node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js"(exports2) { + "use strict"; + var protocolHttp = require_dist_cjs2(); + function resolveHostHeaderConfig4(input) { + return input; + } + var hostHeaderMiddleware = (options) => (next) => async (args2) => { + if (!protocolHttp.HttpRequest.isInstance(args2.request)) + return next(args2); + const { request } = args2; + const { handlerProtocol = "" } = options.requestHandler.metadata || {}; + if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) { + delete request.headers["host"]; + request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : ""); + } else if (!request.headers["host"]) { + let host = request.hostname; + if (request.port != null) + host += `:${request.port}`; + request.headers["host"] = host; + } + return next(args2); + }; + var hostHeaderMiddlewareOptions = { + name: "hostHeaderMiddleware", + step: "build", + priority: "low", + tags: ["HOST"], + override: true + }; + var getHostHeaderPlugin4 = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions); + } + }); + exports2.getHostHeaderPlugin = getHostHeaderPlugin4; + exports2.hostHeaderMiddleware = hostHeaderMiddleware; + exports2.hostHeaderMiddlewareOptions = hostHeaderMiddlewareOptions; + exports2.resolveHostHeaderConfig = resolveHostHeaderConfig4; + } +}); + +// node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js +var require_dist_cjs28 = __commonJS({ + "node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js"(exports2) { + "use strict"; + var loggerMiddleware = () => (next, context) => async (args2) => { + try { + const response = await next(args2); + const { clientName, commandName, logger: logger3, dynamoDbDocumentClientOptions = {} } = context; + const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions; + const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog; + const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog; + const { $metadata, ...outputWithoutMetadata } = response.output; + logger3?.info?.({ + clientName, + commandName, + input: inputFilterSensitiveLog(args2.input), + output: outputFilterSensitiveLog(outputWithoutMetadata), + metadata: $metadata + }); + return response; + } catch (error2) { + const { clientName, commandName, logger: logger3, dynamoDbDocumentClientOptions = {} } = context; + const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions; + const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog; + logger3?.error?.({ + clientName, + commandName, + input: inputFilterSensitiveLog(args2.input), + error: error2, + metadata: error2.$metadata + }); + throw error2; + } + }; + var loggerMiddlewareOptions = { + name: "loggerMiddleware", + tags: ["LOGGER"], + step: "initialize", + override: true + }; + var getLoggerPlugin4 = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(loggerMiddleware(), loggerMiddlewareOptions); + } + }); + exports2.getLoggerPlugin = getLoggerPlugin4; + exports2.loggerMiddleware = loggerMiddleware; + exports2.loggerMiddlewareOptions = loggerMiddlewareOptions; + } +}); + +// node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js +var invoke_store_exports = {}; +__export(invoke_store_exports, { + InvokeStore: () => InvokeStore, + InvokeStoreBase: () => InvokeStoreBase +}); +var PROTECTED_KEYS, NO_GLOBAL_AWS_LAMBDA, InvokeStoreBase, InvokeStoreSingle, InvokeStoreMulti, InvokeStore; +var init_invoke_store = __esm({ + "node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js"() { + PROTECTED_KEYS = { + REQUEST_ID: /* @__PURE__ */ Symbol.for("_AWS_LAMBDA_REQUEST_ID"), + X_RAY_TRACE_ID: /* @__PURE__ */ Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"), + TENANT_ID: /* @__PURE__ */ Symbol.for("_AWS_LAMBDA_TENANT_ID") + }; + NO_GLOBAL_AWS_LAMBDA = ["true", "1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA ?? ""); + if (!NO_GLOBAL_AWS_LAMBDA) { + globalThis.awslambda = globalThis.awslambda || {}; + } + InvokeStoreBase = class { + static PROTECTED_KEYS = PROTECTED_KEYS; + isProtectedKey(key) { + return Object.values(PROTECTED_KEYS).includes(key); + } + getRequestId() { + return this.get(PROTECTED_KEYS.REQUEST_ID) ?? "-"; + } + getXRayTraceId() { + return this.get(PROTECTED_KEYS.X_RAY_TRACE_ID); + } + getTenantId() { + return this.get(PROTECTED_KEYS.TENANT_ID); + } + }; + InvokeStoreSingle = class extends InvokeStoreBase { + currentContext; + getContext() { + return this.currentContext; + } + hasContext() { + return this.currentContext !== void 0; + } + get(key) { + return this.currentContext?.[key]; + } + set(key, value) { + if (this.isProtectedKey(key)) { + throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`); + } + this.currentContext = this.currentContext || {}; + this.currentContext[key] = value; + } + run(context, fn2) { + this.currentContext = context; + return fn2(); + } + }; + InvokeStoreMulti = class _InvokeStoreMulti extends InvokeStoreBase { + als; + static async create() { + const instance = new _InvokeStoreMulti(); + const asyncHooks = await import("node:async_hooks"); + instance.als = new asyncHooks.AsyncLocalStorage(); + return instance; + } + getContext() { + return this.als.getStore(); + } + hasContext() { + return this.als.getStore() !== void 0; + } + get(key) { + return this.als.getStore()?.[key]; + } + set(key, value) { + if (this.isProtectedKey(key)) { + throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`); + } + const store = this.als.getStore(); + if (!store) { + throw new Error("No context available"); + } + store[key] = value; + } + run(context, fn2) { + return this.als.run(context, fn2); + } + }; + (function(InvokeStore2) { + let instance = null; + async function getInstanceAsync() { + if (!instance) { + instance = (async () => { + const isMulti = "AWS_LAMBDA_MAX_CONCURRENCY" in process.env; + const newInstance = isMulti ? await InvokeStoreMulti.create() : new InvokeStoreSingle(); + if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda?.InvokeStore) { + return globalThis.awslambda.InvokeStore; + } else if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda) { + globalThis.awslambda.InvokeStore = newInstance; + return newInstance; + } else { + return newInstance; + } + })(); + } + return instance; + } + InvokeStore2.getInstanceAsync = getInstanceAsync; + InvokeStore2._testing = process.env.AWS_LAMBDA_BENCHMARK_MODE === "1" ? { + reset: () => { + instance = null; + if (globalThis.awslambda?.InvokeStore) { + delete globalThis.awslambda.InvokeStore; + } + globalThis.awslambda = { InvokeStore: void 0 }; + } + } : void 0; + })(InvokeStore || (InvokeStore = {})); + } +}); + +// node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.js +var require_recursionDetectionMiddleware = __commonJS({ + "node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.recursionDetectionMiddleware = void 0; + var lambda_invoke_store_1 = (init_invoke_store(), __toCommonJS(invoke_store_exports)); + var protocol_http_1 = require_dist_cjs2(); + var TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id"; + var ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"; + var ENV_TRACE_ID = "_X_AMZN_TRACE_ID"; + var recursionDetectionMiddleware = () => (next) => async (args2) => { + const { request } = args2; + if (!protocol_http_1.HttpRequest.isInstance(request)) { + return next(args2); + } + const traceIdHeader = Object.keys(request.headers ?? {}).find((h4) => h4.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ?? TRACE_ID_HEADER_NAME; + if (request.headers.hasOwnProperty(traceIdHeader)) { + return next(args2); + } + const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; + const traceIdFromEnv = process.env[ENV_TRACE_ID]; + const invokeStore = await lambda_invoke_store_1.InvokeStore.getInstanceAsync(); + const traceIdFromInvokeStore = invokeStore?.getXRayTraceId(); + const traceId = traceIdFromInvokeStore ?? traceIdFromEnv; + const nonEmptyString = (str) => typeof str === "string" && str.length > 0; + if (nonEmptyString(functionName) && nonEmptyString(traceId)) { + request.headers[TRACE_ID_HEADER_NAME] = traceId; + } + return next({ + ...args2, + request + }); + }; + exports2.recursionDetectionMiddleware = recursionDetectionMiddleware; + } +}); + +// node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js +var require_dist_cjs29 = __commonJS({ + "node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js"(exports2) { + "use strict"; + var recursionDetectionMiddleware = require_recursionDetectionMiddleware(); + var recursionDetectionMiddlewareOptions = { + step: "build", + tags: ["RECURSION_DETECTION"], + name: "recursionDetectionMiddleware", + override: true, + priority: "low" + }; + var getRecursionDetectionPlugin4 = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(recursionDetectionMiddleware.recursionDetectionMiddleware(), recursionDetectionMiddlewareOptions); + } + }); + exports2.getRecursionDetectionPlugin = getRecursionDetectionPlugin4; + Object.keys(recursionDetectionMiddleware).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return recursionDetectionMiddleware[k4]; + } + }); + }); + } +}); + +// node_modules/@aws-sdk/util-arn-parser/dist-cjs/index.js +var require_dist_cjs30 = __commonJS({ + "node_modules/@aws-sdk/util-arn-parser/dist-cjs/index.js"(exports2) { + "use strict"; + var validate = (str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6; + var parse = (arn) => { + const segments = arn.split(":"); + if (segments.length < 6 || segments[0] !== "arn") + throw new Error("Malformed ARN"); + const [, partition, service, region, accountId, ...resource] = segments; + return { + partition, + service, + region, + accountId, + resource: resource.join(":") + }; + }; + var build = (arnObject) => { + const { partition = "aws", service, region, accountId, resource } = arnObject; + if ([service, region, accountId, resource].some((segment) => typeof segment !== "string")) { + throw new Error("Input ARN object is invalid"); + } + return `arn:${partition}:${service}:${region}:${accountId}:${resource}`; + }; + exports2.build = build; + exports2.parse = parse; + exports2.validate = validate; + } +}); + +// node_modules/@smithy/util-config-provider/dist-cjs/index.js +var require_dist_cjs31 = __commonJS({ + "node_modules/@smithy/util-config-provider/dist-cjs/index.js"(exports2) { + "use strict"; + var booleanSelector = (obj, key, type) => { + if (!(key in obj)) + return void 0; + if (obj[key] === "true") + return true; + if (obj[key] === "false") + return false; + throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`); + }; + var numberSelector = (obj, key, type) => { + if (!(key in obj)) + return void 0; + const numberValue = parseInt(obj[key], 10); + if (Number.isNaN(numberValue)) { + throw new TypeError(`Cannot load ${type} '${key}'. Expected number, got '${obj[key]}'.`); + } + return numberValue; + }; + exports2.SelectorType = void 0; + (function(SelectorType) { + SelectorType["ENV"] = "env"; + SelectorType["CONFIG"] = "shared config entry"; + })(exports2.SelectorType || (exports2.SelectorType = {})); + exports2.booleanSelector = booleanSelector; + exports2.numberSelector = numberSelector; + } +}); + +// node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js +var require_dist_cjs32 = __commonJS({ + "node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js"(exports2) { + "use strict"; + var protocolHttp = require_dist_cjs2(); + var smithyClient = require_dist_cjs20(); + var utilStream = require_dist_cjs15(); + var utilArnParser = require_dist_cjs30(); + var signatureV4 = require_dist_cjs18(); + var utilConfigProvider = require_dist_cjs31(); + var core = (init_dist_es2(), __toCommonJS(dist_es_exports2)); + var core$1 = (init_dist_es(), __toCommonJS(dist_es_exports)); + require_dist_cjs(); + var utilMiddleware = require_dist_cjs4(); + var CONTENT_LENGTH_HEADER = "content-length"; + var DECODED_CONTENT_LENGTH_HEADER = "x-amz-decoded-content-length"; + function checkContentLengthHeader() { + return (next, context) => async (args2) => { + const { request } = args2; + if (protocolHttp.HttpRequest.isInstance(request)) { + if (!(CONTENT_LENGTH_HEADER in request.headers) && !(DECODED_CONTENT_LENGTH_HEADER in request.headers)) { + const message2 = `Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.`; + if (typeof context?.logger?.warn === "function" && !(context.logger instanceof smithyClient.NoOpLogger)) { + context.logger.warn(message2); + } else { + console.warn(message2); + } + } + } + return next({ ...args2 }); + }; + } + var checkContentLengthHeaderMiddlewareOptions = { + step: "finalizeRequest", + tags: ["CHECK_CONTENT_LENGTH_HEADER"], + name: "getCheckContentLengthHeaderPlugin", + override: true + }; + var getCheckContentLengthHeaderPlugin = (unused) => ({ + applyToStack: (clientStack) => { + clientStack.add(checkContentLengthHeader(), checkContentLengthHeaderMiddlewareOptions); + } + }); + var regionRedirectEndpointMiddleware = (config) => { + return (next, context) => async (args2) => { + const originalRegion = await config.region(); + const regionProviderRef = config.region; + let unlock = () => { + }; + if (context.__s3RegionRedirect) { + Object.defineProperty(config, "region", { + writable: false, + value: async () => { + return context.__s3RegionRedirect; + } + }); + unlock = () => Object.defineProperty(config, "region", { + writable: true, + value: regionProviderRef + }); + } + try { + const result = await next(args2); + if (context.__s3RegionRedirect) { + unlock(); + const region = await config.region(); + if (originalRegion !== region) { + throw new Error("Region was not restored following S3 region redirect."); + } + } + return result; + } catch (e4) { + unlock(); + throw e4; + } + }; + }; + var regionRedirectEndpointMiddlewareOptions = { + tags: ["REGION_REDIRECT", "S3"], + name: "regionRedirectEndpointMiddleware", + override: true, + relation: "before", + toMiddleware: "endpointV2Middleware" + }; + function regionRedirectMiddleware(clientConfig) { + return (next, context) => async (args2) => { + try { + return await next(args2); + } catch (err) { + if (clientConfig.followRegionRedirects) { + const statusCode = err?.$metadata?.httpStatusCode; + const isHeadBucket = context.commandName === "HeadBucketCommand"; + const bucketRegionHeader = err?.$response?.headers?.["x-amz-bucket-region"]; + if (bucketRegionHeader) { + if (statusCode === 301 || statusCode === 400 && (err?.name === "IllegalLocationConstraintException" || isHeadBucket)) { + try { + const actualRegion = bucketRegionHeader; + context.logger?.debug(`Redirecting from ${await clientConfig.region()} to ${actualRegion}`); + context.__s3RegionRedirect = actualRegion; + } catch (e4) { + throw new Error("Region redirect failed: " + e4); + } + return next(args2); + } + } + } + throw err; + } + }; + } + var regionRedirectMiddlewareOptions = { + step: "initialize", + tags: ["REGION_REDIRECT", "S3"], + name: "regionRedirectMiddleware", + override: true + }; + var getRegionRedirectMiddlewarePlugin = (clientConfig) => ({ + applyToStack: (clientStack) => { + clientStack.add(regionRedirectMiddleware(clientConfig), regionRedirectMiddlewareOptions); + clientStack.addRelativeTo(regionRedirectEndpointMiddleware(clientConfig), regionRedirectEndpointMiddlewareOptions); + } + }); + var s3ExpiresMiddleware = (config) => { + return (next, context) => async (args2) => { + const result = await next(args2); + const { response } = result; + if (protocolHttp.HttpResponse.isInstance(response)) { + if (response.headers.expires) { + response.headers.expiresstring = response.headers.expires; + try { + smithyClient.parseRfc7231DateTime(response.headers.expires); + } catch (e4) { + context.logger?.warn(`AWS SDK Warning for ${context.clientName}::${context.commandName} response parsing (${response.headers.expires}): ${e4}`); + delete response.headers.expires; + } + } + } + return result; + }; + }; + var s3ExpiresMiddlewareOptions = { + tags: ["S3"], + name: "s3ExpiresMiddleware", + override: true, + relation: "after", + toMiddleware: "deserializerMiddleware" + }; + var getS3ExpiresMiddlewarePlugin = (clientConfig) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(s3ExpiresMiddleware(), s3ExpiresMiddlewareOptions); + } + }); + var S3ExpressIdentityCache = class _S3ExpressIdentityCache { + data; + lastPurgeTime = Date.now(); + static EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS = 3e4; + constructor(data2 = {}) { + this.data = data2; + } + get(key) { + const entry = this.data[key]; + if (!entry) { + return; + } + return entry; + } + set(key, entry) { + this.data[key] = entry; + return entry; + } + delete(key) { + delete this.data[key]; + } + async purgeExpired() { + const now = Date.now(); + if (this.lastPurgeTime + _S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS > now) { + return; + } + for (const key in this.data) { + const entry = this.data[key]; + if (!entry.isRefreshing) { + const credential = await entry.identity; + if (credential.expiration) { + if (credential.expiration.getTime() < now) { + delete this.data[key]; + } + } + } + } + } + }; + var S3ExpressIdentityCacheEntry = class { + _identity; + isRefreshing; + accessed; + constructor(_identity, isRefreshing = false, accessed = Date.now()) { + this._identity = _identity; + this.isRefreshing = isRefreshing; + this.accessed = accessed; + } + get identity() { + this.accessed = Date.now(); + return this._identity; + } + }; + var S3ExpressIdentityProviderImpl = class _S3ExpressIdentityProviderImpl { + createSessionFn; + cache; + static REFRESH_WINDOW_MS = 6e4; + constructor(createSessionFn, cache4 = new S3ExpressIdentityCache()) { + this.createSessionFn = createSessionFn; + this.cache = cache4; + } + async getS3ExpressIdentity(awsIdentity, identityProperties) { + const key = identityProperties.Bucket; + const { cache: cache4 } = this; + const entry = cache4.get(key); + if (entry) { + return entry.identity.then((identity) => { + const isExpired = (identity.expiration?.getTime() ?? 0) < Date.now(); + if (isExpired) { + return cache4.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity; + } + const isExpiringSoon = (identity.expiration?.getTime() ?? 0) < Date.now() + _S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS; + if (isExpiringSoon && !entry.isRefreshing) { + entry.isRefreshing = true; + this.getIdentity(key).then((id) => { + cache4.set(key, new S3ExpressIdentityCacheEntry(Promise.resolve(id))); + }); + } + return identity; + }); + } + return cache4.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity; + } + async getIdentity(key) { + await this.cache.purgeExpired().catch((error2) => { + console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error2); + }); + const session = await this.createSessionFn(key); + if (!session.Credentials?.AccessKeyId || !session.Credentials?.SecretAccessKey) { + throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey."); + } + const identity = { + accessKeyId: session.Credentials.AccessKeyId, + secretAccessKey: session.Credentials.SecretAccessKey, + sessionToken: session.Credentials.SessionToken, + expiration: session.Credentials.Expiration ? new Date(session.Credentials.Expiration) : void 0 + }; + return identity; + } + }; + var S3_EXPRESS_BUCKET_TYPE = "Directory"; + var S3_EXPRESS_BACKEND = "S3Express"; + var S3_EXPRESS_AUTH_SCHEME = "sigv4-s3express"; + var SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token"; + var SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase(); + var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH"; + var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME = "s3_disable_express_session_auth"; + var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = { + environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME, utilConfigProvider.SelectorType.ENV), + configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, utilConfigProvider.SelectorType.CONFIG), + default: false + }; + var SignatureV4S3Express = class extends signatureV4.SignatureV4 { + async signWithCredentials(requestToSign, credentials, options) { + const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials); + requestToSign.headers[SESSION_TOKEN_HEADER] = credentials.sessionToken; + const privateAccess = this; + setSingleOverride(privateAccess, credentialsWithoutSessionToken); + return privateAccess.signRequest(requestToSign, options ?? {}); + } + async presignWithCredentials(requestToSign, credentials, options) { + const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials); + delete requestToSign.headers[SESSION_TOKEN_HEADER]; + requestToSign.headers[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken; + requestToSign.query = requestToSign.query ?? {}; + requestToSign.query[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken; + const privateAccess = this; + setSingleOverride(privateAccess, credentialsWithoutSessionToken); + return this.presign(requestToSign, options); + } + }; + function getCredentialsWithoutSessionToken(credentials) { + const credentialsWithoutSessionToken = { + accessKeyId: credentials.accessKeyId, + secretAccessKey: credentials.secretAccessKey, + expiration: credentials.expiration + }; + return credentialsWithoutSessionToken; + } + function setSingleOverride(privateAccess, credentialsWithoutSessionToken) { + const id = setTimeout(() => { + throw new Error("SignatureV4S3Express credential override was created but not called."); + }, 10); + const currentCredentialProvider = privateAccess.credentialProvider; + const overrideCredentialsProviderOnce = () => { + clearTimeout(id); + privateAccess.credentialProvider = currentCredentialProvider; + return Promise.resolve(credentialsWithoutSessionToken); + }; + privateAccess.credentialProvider = overrideCredentialsProviderOnce; + } + var s3ExpressMiddleware = (options) => { + return (next, context) => async (args2) => { + if (context.endpointV2) { + const endpoint = context.endpointV2; + const isS3ExpressAuth = endpoint.properties?.authSchemes?.[0]?.name === S3_EXPRESS_AUTH_SCHEME; + const isS3ExpressBucket = endpoint.properties?.backend === S3_EXPRESS_BACKEND || endpoint.properties?.bucketType === S3_EXPRESS_BUCKET_TYPE; + if (isS3ExpressBucket) { + core.setFeature(context, "S3_EXPRESS_BUCKET", "J"); + context.isS3ExpressBucket = true; + } + if (isS3ExpressAuth) { + const requestBucket = args2.input.Bucket; + if (requestBucket) { + const s3ExpressIdentity = await options.s3ExpressIdentityProvider.getS3ExpressIdentity(await options.credentials(), { + Bucket: requestBucket + }); + context.s3ExpressIdentity = s3ExpressIdentity; + if (protocolHttp.HttpRequest.isInstance(args2.request) && s3ExpressIdentity.sessionToken) { + args2.request.headers[SESSION_TOKEN_HEADER] = s3ExpressIdentity.sessionToken; + } + } + } + } + return next(args2); + }; + }; + var s3ExpressMiddlewareOptions = { + name: "s3ExpressMiddleware", + step: "build", + tags: ["S3", "S3_EXPRESS"], + override: true + }; + var getS3ExpressPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(s3ExpressMiddleware(options), s3ExpressMiddlewareOptions); + } + }); + var signS3Express = async (s3ExpressIdentity, signingOptions, request, sigV4MultiRegionSigner) => { + const signedRequest = await sigV4MultiRegionSigner.signWithCredentials(request, s3ExpressIdentity, {}); + if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) { + throw new Error("X-Amz-Security-Token must not be set for s3-express requests."); + } + return signedRequest; + }; + var defaultErrorHandler2 = (signingProperties) => (error2) => { + throw error2; + }; + var defaultSuccessHandler2 = (httpResponse, signingProperties) => { + }; + var s3ExpressHttpSigningMiddlewareOptions = core$1.httpSigningMiddlewareOptions; + var s3ExpressHttpSigningMiddleware = (config) => (next, context) => async (args2) => { + if (!protocolHttp.HttpRequest.isInstance(args2.request)) { + return next(args2); + } + const smithyContext = utilMiddleware.getSmithyContext(context); + const scheme = smithyContext.selectedHttpAuthScheme; + if (!scheme) { + throw new Error(`No HttpAuthScheme was selected: unable to sign request`); + } + const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme; + let request; + if (context.s3ExpressIdentity) { + request = await signS3Express(context.s3ExpressIdentity, signingProperties, args2.request, await config.signer()); + } else { + request = await signer.sign(args2.request, identity, signingProperties); + } + const output = await next({ + ...args2, + request + }).catch((signer.errorHandler || defaultErrorHandler2)(signingProperties)); + (signer.successHandler || defaultSuccessHandler2)(output.response, signingProperties); + return output; + }; + var getS3ExpressHttpSigningPlugin = (config) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(s3ExpressHttpSigningMiddleware(config), core$1.httpSigningMiddlewareOptions); + } + }); + var resolveS3Config = (input, { session }) => { + const [s3ClientProvider, CreateSessionCommandCtor] = session; + const { forcePathStyle, useAccelerateEndpoint, disableMultiregionAccessPoints, followRegionRedirects, s3ExpressIdentityProvider, bucketEndpoint, expectContinueHeader } = input; + return Object.assign(input, { + forcePathStyle: forcePathStyle ?? false, + useAccelerateEndpoint: useAccelerateEndpoint ?? false, + disableMultiregionAccessPoints: disableMultiregionAccessPoints ?? false, + followRegionRedirects: followRegionRedirects ?? false, + s3ExpressIdentityProvider: s3ExpressIdentityProvider ?? new S3ExpressIdentityProviderImpl(async (key) => s3ClientProvider().send(new CreateSessionCommandCtor({ + Bucket: key + }))), + bucketEndpoint: bucketEndpoint ?? false, + expectContinueHeader: expectContinueHeader ?? 2097152 + }); + }; + var THROW_IF_EMPTY_BODY = { + CopyObjectCommand: true, + UploadPartCopyCommand: true, + CompleteMultipartUploadCommand: true + }; + var MAX_BYTES_TO_INSPECT = 3e3; + var throw200ExceptionsMiddleware = (config) => (next, context) => async (args2) => { + const result = await next(args2); + const { response } = result; + if (!protocolHttp.HttpResponse.isInstance(response)) { + return result; + } + const { statusCode, body: sourceBody } = response; + if (statusCode < 200 || statusCode >= 300) { + return result; + } + const isSplittableStream = typeof sourceBody?.stream === "function" || typeof sourceBody?.pipe === "function" || typeof sourceBody?.tee === "function"; + if (!isSplittableStream) { + return result; + } + let bodyCopy = sourceBody; + let body = sourceBody; + if (sourceBody && typeof sourceBody === "object" && !(sourceBody instanceof Uint8Array)) { + [bodyCopy, body] = await utilStream.splitStream(sourceBody); + } + response.body = body; + const bodyBytes = await collectBody3(bodyCopy, { + streamCollector: async (stream) => { + return utilStream.headStream(stream, MAX_BYTES_TO_INSPECT); + } + }); + if (typeof bodyCopy?.destroy === "function") { + bodyCopy.destroy(); + } + const bodyStringTail = config.utf8Encoder(bodyBytes.subarray(bodyBytes.length - 16)); + if (bodyBytes.length === 0 && THROW_IF_EMPTY_BODY[context.commandName]) { + const err = new Error("S3 aborted request"); + err.name = "InternalError"; + throw err; + } + if (bodyStringTail && bodyStringTail.endsWith("")) { + response.statusCode = 400; + } + return result; + }; + var collectBody3 = (streamBody = new Uint8Array(), context) => { + if (streamBody instanceof Uint8Array) { + return Promise.resolve(streamBody); + } + return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); + }; + var throw200ExceptionsMiddlewareOptions = { + relation: "after", + toMiddleware: "deserializerMiddleware", + tags: ["THROW_200_EXCEPTIONS", "S3"], + name: "throw200ExceptionsMiddleware", + override: true + }; + var getThrow200ExceptionsPlugin = (config) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(throw200ExceptionsMiddleware(config), throw200ExceptionsMiddlewareOptions); + } + }); + function bucketEndpointMiddleware(options) { + return (next, context) => async (args2) => { + if (options.bucketEndpoint) { + const endpoint = context.endpointV2; + if (endpoint) { + const bucket = args2.input.Bucket; + if (typeof bucket === "string") { + try { + const bucketEndpointUrl = new URL(bucket); + context.endpointV2 = { + ...endpoint, + url: bucketEndpointUrl + }; + } catch (e4) { + const warning = `@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${bucket} could not be parsed as URL.`; + if (context.logger?.constructor?.name === "NoOpLogger") { + console.warn(warning); + } else { + context.logger?.warn?.(warning); + } + throw e4; + } + } + } + } + return next(args2); + }; + } + var bucketEndpointMiddlewareOptions = { + name: "bucketEndpointMiddleware", + override: true, + relation: "after", + toMiddleware: "endpointV2Middleware" + }; + function validateBucketNameMiddleware({ bucketEndpoint }) { + return (next) => async (args2) => { + const { input: { Bucket } } = args2; + if (!bucketEndpoint && typeof Bucket === "string" && !utilArnParser.validate(Bucket) && Bucket.indexOf("/") >= 0) { + const err = new Error(`Bucket name shouldn't contain '/', received '${Bucket}'`); + err.name = "InvalidBucketName"; + throw err; + } + return next({ ...args2 }); + }; + } + var validateBucketNameMiddlewareOptions = { + step: "initialize", + tags: ["VALIDATE_BUCKET_NAME"], + name: "validateBucketNameMiddleware", + override: true + }; + var getValidateBucketNamePlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(validateBucketNameMiddleware(options), validateBucketNameMiddlewareOptions); + clientStack.addRelativeTo(bucketEndpointMiddleware(options), bucketEndpointMiddlewareOptions); + } + }); + exports2.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS; + exports2.S3ExpressIdentityCache = S3ExpressIdentityCache; + exports2.S3ExpressIdentityCacheEntry = S3ExpressIdentityCacheEntry; + exports2.S3ExpressIdentityProviderImpl = S3ExpressIdentityProviderImpl; + exports2.SignatureV4S3Express = SignatureV4S3Express; + exports2.checkContentLengthHeader = checkContentLengthHeader; + exports2.checkContentLengthHeaderMiddlewareOptions = checkContentLengthHeaderMiddlewareOptions; + exports2.getCheckContentLengthHeaderPlugin = getCheckContentLengthHeaderPlugin; + exports2.getRegionRedirectMiddlewarePlugin = getRegionRedirectMiddlewarePlugin; + exports2.getS3ExpiresMiddlewarePlugin = getS3ExpiresMiddlewarePlugin; + exports2.getS3ExpressHttpSigningPlugin = getS3ExpressHttpSigningPlugin; + exports2.getS3ExpressPlugin = getS3ExpressPlugin; + exports2.getThrow200ExceptionsPlugin = getThrow200ExceptionsPlugin; + exports2.getValidateBucketNamePlugin = getValidateBucketNamePlugin; + exports2.regionRedirectEndpointMiddleware = regionRedirectEndpointMiddleware; + exports2.regionRedirectEndpointMiddlewareOptions = regionRedirectEndpointMiddlewareOptions; + exports2.regionRedirectMiddleware = regionRedirectMiddleware; + exports2.regionRedirectMiddlewareOptions = regionRedirectMiddlewareOptions; + exports2.resolveS3Config = resolveS3Config; + exports2.s3ExpiresMiddleware = s3ExpiresMiddleware; + exports2.s3ExpiresMiddlewareOptions = s3ExpiresMiddlewareOptions; + exports2.s3ExpressHttpSigningMiddleware = s3ExpressHttpSigningMiddleware; + exports2.s3ExpressHttpSigningMiddlewareOptions = s3ExpressHttpSigningMiddlewareOptions; + exports2.s3ExpressMiddleware = s3ExpressMiddleware; + exports2.s3ExpressMiddlewareOptions = s3ExpressMiddlewareOptions; + exports2.throw200ExceptionsMiddleware = throw200ExceptionsMiddleware; + exports2.throw200ExceptionsMiddlewareOptions = throw200ExceptionsMiddlewareOptions; + exports2.validateBucketNameMiddleware = validateBucketNameMiddleware; + exports2.validateBucketNameMiddlewareOptions = validateBucketNameMiddlewareOptions; + } +}); + +// node_modules/@smithy/util-endpoints/dist-cjs/index.js +var require_dist_cjs33 = __commonJS({ + "node_modules/@smithy/util-endpoints/dist-cjs/index.js"(exports2) { + "use strict"; + var types = require_dist_cjs(); + var EndpointCache4 = class { + capacity; + data = /* @__PURE__ */ new Map(); + parameters = []; + constructor({ size, params }) { + this.capacity = size ?? 50; + if (params) { + this.parameters = params; + } + } + get(endpointParams, resolver) { + const key = this.hash(endpointParams); + if (key === false) { + return resolver(); + } + if (!this.data.has(key)) { + if (this.data.size > this.capacity + 10) { + const keys = this.data.keys(); + let i4 = 0; + while (true) { + const { value, done } = keys.next(); + this.data.delete(value); + if (done || ++i4 > 10) { + break; + } + } + } + this.data.set(key, resolver()); + } + return this.data.get(key); + } + size() { + return this.data.size; + } + hash(endpointParams) { + let buffer = ""; + const { parameters } = this; + if (parameters.length === 0) { + return false; + } + for (const param of parameters) { + const val = String(endpointParams[param] ?? ""); + if (val.includes("|;")) { + return false; + } + buffer += val + "|;"; + } + return buffer; + } + }; + var IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`); + var isIpAddress = (value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]"); + var VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`); + var isValidHostLabel = (value, allowSubDomains = false) => { + if (!allowSubDomains) { + return VALID_HOST_LABEL_REGEX.test(value); + } + const labels = value.split("."); + for (const label of labels) { + if (!isValidHostLabel(label)) { + return false; + } + } + return true; + }; + var customEndpointFunctions4 = {}; + var debugId = "endpoints"; + function toDebugString(input) { + if (typeof input !== "object" || input == null) { + return input; + } + if ("ref" in input) { + return `$${toDebugString(input.ref)}`; + } + if ("fn" in input) { + return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`; + } + return JSON.stringify(input, null, 2); + } + var EndpointError = class extends Error { + constructor(message2) { + super(message2); + this.name = "EndpointError"; + } + }; + var booleanEquals = (value1, value2) => value1 === value2; + var getAttrPathList = (path) => { + const parts = path.split("."); + const pathList = []; + for (const part of parts) { + const squareBracketIndex = part.indexOf("["); + if (squareBracketIndex !== -1) { + if (part.indexOf("]") !== part.length - 1) { + throw new EndpointError(`Path: '${path}' does not end with ']'`); + } + const arrayIndex = part.slice(squareBracketIndex + 1, -1); + if (Number.isNaN(parseInt(arrayIndex))) { + throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`); + } + if (squareBracketIndex !== 0) { + pathList.push(part.slice(0, squareBracketIndex)); + } + pathList.push(arrayIndex); + } else { + pathList.push(part); + } + } + return pathList; + }; + var getAttr = (value, path) => getAttrPathList(path).reduce((acc, index) => { + if (typeof acc !== "object") { + throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`); + } else if (Array.isArray(acc)) { + return acc[parseInt(index)]; + } + return acc[index]; + }, value); + var isSet = (value) => value != null; + var not = (value) => !value; + var DEFAULT_PORTS = { + [types.EndpointURLScheme.HTTP]: 80, + [types.EndpointURLScheme.HTTPS]: 443 + }; + var parseURL = (value) => { + const whatwgURL = (() => { + try { + if (value instanceof URL) { + return value; + } + if (typeof value === "object" && "hostname" in value) { + const { hostname: hostname2, port, protocol: protocol2 = "", path = "", query = {} } = value; + const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path}`); + url.search = Object.entries(query).map(([k4, v4]) => `${k4}=${v4}`).join("&"); + return url; + } + return new URL(value); + } catch (error2) { + return null; + } + })(); + if (!whatwgURL) { + console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`); + return null; + } + const urlString = whatwgURL.href; + const { host, hostname, pathname, protocol, search } = whatwgURL; + if (search) { + return null; + } + const scheme = protocol.slice(0, -1); + if (!Object.values(types.EndpointURLScheme).includes(scheme)) { + return null; + } + const isIp = isIpAddress(hostname); + const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`); + const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`; + return { + scheme, + authority, + path: pathname, + normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`, + isIp + }; + }; + var stringEquals = (value1, value2) => value1 === value2; + var substring = (input, start, stop, reverse) => { + if (start >= stop || input.length < stop) { + return null; + } + if (!reverse) { + return input.substring(start, stop); + } + return input.substring(input.length - stop, input.length - start); + }; + var uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c4) => `%${c4.charCodeAt(0).toString(16).toUpperCase()}`); + var endpointFunctions = { + booleanEquals, + getAttr, + isSet, + isValidHostLabel, + not, + parseURL, + stringEquals, + substring, + uriEncode + }; + var evaluateTemplate = (template, options) => { + const evaluatedTemplateArr = []; + const templateContext = { + ...options.endpointParams, + ...options.referenceRecord + }; + let currentIndex = 0; + while (currentIndex < template.length) { + const openingBraceIndex = template.indexOf("{", currentIndex); + if (openingBraceIndex === -1) { + evaluatedTemplateArr.push(template.slice(currentIndex)); + break; + } + evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex)); + const closingBraceIndex = template.indexOf("}", openingBraceIndex); + if (closingBraceIndex === -1) { + evaluatedTemplateArr.push(template.slice(openingBraceIndex)); + break; + } + if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") { + evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex)); + currentIndex = closingBraceIndex + 2; + } + const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex); + if (parameterName.includes("#")) { + const [refName, attrName] = parameterName.split("#"); + evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName)); + } else { + evaluatedTemplateArr.push(templateContext[parameterName]); + } + currentIndex = closingBraceIndex + 1; + } + return evaluatedTemplateArr.join(""); + }; + var getReferenceValue = ({ ref }, options) => { + const referenceRecord = { + ...options.endpointParams, + ...options.referenceRecord + }; + return referenceRecord[ref]; + }; + var evaluateExpression = (obj, keyName, options) => { + if (typeof obj === "string") { + return evaluateTemplate(obj, options); + } else if (obj["fn"]) { + return group$2.callFunction(obj, options); + } else if (obj["ref"]) { + return getReferenceValue(obj, options); + } + throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); + }; + var callFunction = ({ fn: fn2, argv }, options) => { + const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : group$2.evaluateExpression(arg, "arg", options)); + const fnSegments = fn2.split("."); + if (fnSegments[0] in customEndpointFunctions4 && fnSegments[1] != null) { + return customEndpointFunctions4[fnSegments[0]][fnSegments[1]](...evaluatedArgs); + } + return endpointFunctions[fn2](...evaluatedArgs); + }; + var group$2 = { + evaluateExpression, + callFunction + }; + var evaluateCondition = ({ assign, ...fnArgs }, options) => { + if (assign && assign in options.referenceRecord) { + throw new EndpointError(`'${assign}' is already defined in Reference Record.`); + } + const value = callFunction(fnArgs, options); + options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`); + return { + result: value === "" ? true : !!value, + ...assign != null && { toAssign: { name: assign, value } } + }; + }; + var evaluateConditions = (conditions = [], options) => { + const conditionsReferenceRecord = {}; + for (const condition of conditions) { + const { result, toAssign } = evaluateCondition(condition, { + ...options, + referenceRecord: { + ...options.referenceRecord, + ...conditionsReferenceRecord + } + }); + if (!result) { + return { result }; + } + if (toAssign) { + conditionsReferenceRecord[toAssign.name] = toAssign.value; + options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`); + } + } + return { result: true, referenceRecord: conditionsReferenceRecord }; + }; + var getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({ + ...acc, + [headerKey]: headerVal.map((headerValEntry) => { + const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options); + if (typeof processedExpr !== "string") { + throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`); + } + return processedExpr; + }) + }), {}); + var getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({ + ...acc, + [propertyKey]: group$1.getEndpointProperty(propertyVal, options) + }), {}); + var getEndpointProperty = (property, options) => { + if (Array.isArray(property)) { + return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options)); + } + switch (typeof property) { + case "string": + return evaluateTemplate(property, options); + case "object": + if (property === null) { + throw new EndpointError(`Unexpected endpoint property: ${property}`); + } + return group$1.getEndpointProperties(property, options); + case "boolean": + return property; + default: + throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`); + } + }; + var group$1 = { + getEndpointProperty, + getEndpointProperties + }; + var getEndpointUrl = (endpointUrl, options) => { + const expression = evaluateExpression(endpointUrl, "Endpoint URL", options); + if (typeof expression === "string") { + try { + return new URL(expression); + } catch (error2) { + console.error(`Failed to construct URL with ${expression}`, error2); + throw error2; + } + } + throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); + }; + var evaluateEndpointRule = (endpointRule, options) => { + const { conditions, endpoint } = endpointRule; + const { result, referenceRecord } = evaluateConditions(conditions, options); + if (!result) { + return; + } + const endpointRuleOptions = { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord } + }; + const { url, properties, headers } = endpoint; + options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`); + return { + ...headers != void 0 && { + headers: getEndpointHeaders(headers, endpointRuleOptions) + }, + ...properties != void 0 && { + properties: getEndpointProperties(properties, endpointRuleOptions) + }, + url: getEndpointUrl(url, endpointRuleOptions) + }; + }; + var evaluateErrorRule = (errorRule, options) => { + const { conditions, error: error2 } = errorRule; + const { result, referenceRecord } = evaluateConditions(conditions, options); + if (!result) { + return; + } + throw new EndpointError(evaluateExpression(error2, "Error", { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord } + })); + }; + var evaluateRules = (rules, options) => { + for (const rule of rules) { + if (rule.type === "endpoint") { + const endpointOrUndefined = evaluateEndpointRule(rule, options); + if (endpointOrUndefined) { + return endpointOrUndefined; + } + } else if (rule.type === "error") { + evaluateErrorRule(rule, options); + } else if (rule.type === "tree") { + const endpointOrUndefined = group.evaluateTreeRule(rule, options); + if (endpointOrUndefined) { + return endpointOrUndefined; + } + } else { + throw new EndpointError(`Unknown endpoint rule: ${rule}`); + } + } + throw new EndpointError(`Rules evaluation failed`); + }; + var evaluateTreeRule = (treeRule, options) => { + const { conditions, rules } = treeRule; + const { result, referenceRecord } = evaluateConditions(conditions, options); + if (!result) { + return; + } + return group.evaluateRules(rules, { + ...options, + referenceRecord: { ...options.referenceRecord, ...referenceRecord } + }); + }; + var group = { + evaluateRules, + evaluateTreeRule + }; + var resolveEndpoint4 = (ruleSetObject, options) => { + const { endpointParams, logger: logger3 } = options; + const { parameters, rules } = ruleSetObject; + options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`); + const paramsWithDefault = Object.entries(parameters).filter(([, v4]) => v4.default != null).map(([k4, v4]) => [k4, v4.default]); + if (paramsWithDefault.length > 0) { + for (const [paramKey, paramDefaultValue] of paramsWithDefault) { + endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue; + } + } + const requiredParams = Object.entries(parameters).filter(([, v4]) => v4.required).map(([k4]) => k4); + for (const requiredParam of requiredParams) { + if (endpointParams[requiredParam] == null) { + throw new EndpointError(`Missing required parameter: '${requiredParam}'`); + } + } + const endpoint = evaluateRules(rules, { endpointParams, logger: logger3, referenceRecord: {} }); + options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`); + return endpoint; + }; + exports2.EndpointCache = EndpointCache4; + exports2.EndpointError = EndpointError; + exports2.customEndpointFunctions = customEndpointFunctions4; + exports2.isIpAddress = isIpAddress; + exports2.isValidHostLabel = isValidHostLabel; + exports2.resolveEndpoint = resolveEndpoint4; + } +}); + +// node_modules/@smithy/querystring-parser/dist-cjs/index.js +var require_dist_cjs34 = __commonJS({ + "node_modules/@smithy/querystring-parser/dist-cjs/index.js"(exports2) { + "use strict"; + function parseQueryString(querystring) { + const query = {}; + querystring = querystring.replace(/^\?/, ""); + if (querystring) { + for (const pair of querystring.split("&")) { + let [key, value = null] = pair.split("="); + key = decodeURIComponent(key); + if (value) { + value = decodeURIComponent(value); + } + if (!(key in query)) { + query[key] = value; + } else if (Array.isArray(query[key])) { + query[key].push(value); + } else { + query[key] = [query[key], value]; + } + } + } + return query; + } + exports2.parseQueryString = parseQueryString; + } +}); + +// node_modules/@smithy/url-parser/dist-cjs/index.js +var require_dist_cjs35 = __commonJS({ + "node_modules/@smithy/url-parser/dist-cjs/index.js"(exports2) { + "use strict"; + var querystringParser = require_dist_cjs34(); + var parseUrl4 = (url) => { + if (typeof url === "string") { + return parseUrl4(new URL(url)); + } + const { hostname, pathname, port, protocol, search } = url; + let query; + if (search) { + query = querystringParser.parseQueryString(search); + } + return { + hostname, + port: port ? parseInt(port) : void 0, + protocol, + path: pathname, + query + }; + }; + exports2.parseUrl = parseUrl4; + } +}); + +// node_modules/@aws-sdk/middleware-user-agent/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js +var require_dist_cjs36 = __commonJS({ + "node_modules/@aws-sdk/middleware-user-agent/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js"(exports2) { + "use strict"; + var utilEndpoints = require_dist_cjs33(); + var urlParser = require_dist_cjs35(); + var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { + if (allowSubDomains) { + for (const label of value.split(".")) { + if (!isVirtualHostableS3Bucket(label)) { + return false; + } + } + return true; + } + if (!utilEndpoints.isValidHostLabel(value)) { + return false; + } + if (value.length < 3 || value.length > 63) { + return false; + } + if (value !== value.toLowerCase()) { + return false; + } + if (utilEndpoints.isIpAddress(value)) { + return false; + } + return true; + }; + var ARN_DELIMITER = ":"; + var RESOURCE_DELIMITER = "/"; + var parseArn = (value) => { + const segments = value.split(ARN_DELIMITER); + if (segments.length < 6) + return null; + const [arn, partition2, service, region, accountId, ...resourcePath] = segments; + if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "") + return null; + const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat(); + return { + partition: partition2, + service, + region, + accountId, + resourceId + }; + }; + var partitions = [ + { + id: "aws", + outputs: { + dnsSuffix: "amazonaws.com", + dualStackDnsSuffix: "api.aws", + implicitGlobalRegion: "us-east-1", + name: "aws", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", + regions: { + "af-south-1": { + description: "Africa (Cape Town)" + }, + "ap-east-1": { + description: "Asia Pacific (Hong Kong)" + }, + "ap-east-2": { + description: "Asia Pacific (Taipei)" + }, + "ap-northeast-1": { + description: "Asia Pacific (Tokyo)" + }, + "ap-northeast-2": { + description: "Asia Pacific (Seoul)" + }, + "ap-northeast-3": { + description: "Asia Pacific (Osaka)" + }, + "ap-south-1": { + description: "Asia Pacific (Mumbai)" + }, + "ap-south-2": { + description: "Asia Pacific (Hyderabad)" + }, + "ap-southeast-1": { + description: "Asia Pacific (Singapore)" + }, + "ap-southeast-2": { + description: "Asia Pacific (Sydney)" + }, + "ap-southeast-3": { + description: "Asia Pacific (Jakarta)" + }, + "ap-southeast-4": { + description: "Asia Pacific (Melbourne)" + }, + "ap-southeast-5": { + description: "Asia Pacific (Malaysia)" + }, + "ap-southeast-6": { + description: "Asia Pacific (New Zealand)" + }, + "ap-southeast-7": { + description: "Asia Pacific (Thailand)" + }, + "aws-global": { + description: "aws global region" + }, + "ca-central-1": { + description: "Canada (Central)" + }, + "ca-west-1": { + description: "Canada West (Calgary)" + }, + "eu-central-1": { + description: "Europe (Frankfurt)" + }, + "eu-central-2": { + description: "Europe (Zurich)" + }, + "eu-north-1": { + description: "Europe (Stockholm)" + }, + "eu-south-1": { + description: "Europe (Milan)" + }, + "eu-south-2": { + description: "Europe (Spain)" + }, + "eu-west-1": { + description: "Europe (Ireland)" + }, + "eu-west-2": { + description: "Europe (London)" + }, + "eu-west-3": { + description: "Europe (Paris)" + }, + "il-central-1": { + description: "Israel (Tel Aviv)" + }, + "me-central-1": { + description: "Middle East (UAE)" + }, + "me-south-1": { + description: "Middle East (Bahrain)" + }, + "mx-central-1": { + description: "Mexico (Central)" + }, + "sa-east-1": { + description: "South America (Sao Paulo)" + }, + "us-east-1": { + description: "US East (N. Virginia)" + }, + "us-east-2": { + description: "US East (Ohio)" + }, + "us-west-1": { + description: "US West (N. California)" + }, + "us-west-2": { + description: "US West (Oregon)" + } + } + }, + { + id: "aws-cn", + outputs: { + dnsSuffix: "amazonaws.com.cn", + dualStackDnsSuffix: "api.amazonwebservices.com.cn", + implicitGlobalRegion: "cn-northwest-1", + name: "aws-cn", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^cn\\-\\w+\\-\\d+$", + regions: { + "aws-cn-global": { + description: "aws-cn global region" + }, + "cn-north-1": { + description: "China (Beijing)" + }, + "cn-northwest-1": { + description: "China (Ningxia)" + } + } + }, + { + id: "aws-eusc", + outputs: { + dnsSuffix: "amazonaws.eu", + dualStackDnsSuffix: "api.amazonwebservices.eu", + implicitGlobalRegion: "eusc-de-east-1", + name: "aws-eusc", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$", + regions: { + "eusc-de-east-1": { + description: "AWS European Sovereign Cloud (Germany)" + } + } + }, + { + id: "aws-iso", + outputs: { + dnsSuffix: "c2s.ic.gov", + dualStackDnsSuffix: "api.aws.ic.gov", + implicitGlobalRegion: "us-iso-east-1", + name: "aws-iso", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-iso\\-\\w+\\-\\d+$", + regions: { + "aws-iso-global": { + description: "aws-iso global region" + }, + "us-iso-east-1": { + description: "US ISO East" + }, + "us-iso-west-1": { + description: "US ISO WEST" + } + } + }, + { + id: "aws-iso-b", + outputs: { + dnsSuffix: "sc2s.sgov.gov", + dualStackDnsSuffix: "api.aws.scloud", + implicitGlobalRegion: "us-isob-east-1", + name: "aws-iso-b", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-isob\\-\\w+\\-\\d+$", + regions: { + "aws-iso-b-global": { + description: "aws-iso-b global region" + }, + "us-isob-east-1": { + description: "US ISOB East (Ohio)" + }, + "us-isob-west-1": { + description: "US ISOB West" + } + } + }, + { + id: "aws-iso-e", + outputs: { + dnsSuffix: "cloud.adc-e.uk", + dualStackDnsSuffix: "api.cloud-aws.adc-e.uk", + implicitGlobalRegion: "eu-isoe-west-1", + name: "aws-iso-e", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", + regions: { + "aws-iso-e-global": { + description: "aws-iso-e global region" + }, + "eu-isoe-west-1": { + description: "EU ISOE West" + } + } + }, + { + id: "aws-iso-f", + outputs: { + dnsSuffix: "csp.hci.ic.gov", + dualStackDnsSuffix: "api.aws.hci.ic.gov", + implicitGlobalRegion: "us-isof-south-1", + name: "aws-iso-f", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + regions: { + "aws-iso-f-global": { + description: "aws-iso-f global region" + }, + "us-isof-east-1": { + description: "US ISOF EAST" + }, + "us-isof-south-1": { + description: "US ISOF SOUTH" + } + } + }, + { + id: "aws-us-gov", + outputs: { + dnsSuffix: "amazonaws.com", + dualStackDnsSuffix: "api.aws", + implicitGlobalRegion: "us-gov-west-1", + name: "aws-us-gov", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", + regions: { + "aws-us-gov-global": { + description: "aws-us-gov global region" + }, + "us-gov-east-1": { + description: "AWS GovCloud (US-East)" + }, + "us-gov-west-1": { + description: "AWS GovCloud (US-West)" + } + } + } + ]; + var version = "1.1"; + var partitionsInfo = { + partitions, + version + }; + var selectedPartitionsInfo = partitionsInfo; + var selectedUserAgentPrefix = ""; + var partition = (value) => { + const { partitions: partitions2 } = selectedPartitionsInfo; + for (const partition2 of partitions2) { + const { regions, outputs } = partition2; + for (const [region, regionData] of Object.entries(regions)) { + if (region === value) { + return { + ...outputs, + ...regionData + }; + } + } + } + for (const partition2 of partitions2) { + const { regionRegex, outputs } = partition2; + if (new RegExp(regionRegex).test(value)) { + return { + ...outputs + }; + } + } + const DEFAULT_PARTITION = partitions2.find((partition2) => partition2.id === "aws"); + if (!DEFAULT_PARTITION) { + throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist."); + } + return { + ...DEFAULT_PARTITION.outputs + }; + }; + var setPartitionInfo = (partitionsInfo2, userAgentPrefix = "") => { + selectedPartitionsInfo = partitionsInfo2; + selectedUserAgentPrefix = userAgentPrefix; + }; + var useDefaultPartitionInfo = () => { + setPartitionInfo(partitionsInfo, ""); + }; + var getUserAgentPrefix = () => selectedUserAgentPrefix; + var awsEndpointFunctions4 = { + isVirtualHostableS3Bucket, + parseArn, + partition + }; + utilEndpoints.customEndpointFunctions.aws = awsEndpointFunctions4; + var resolveDefaultAwsRegionalEndpointsConfig = (input) => { + if (typeof input.endpointProvider !== "function") { + throw new Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client."); + } + const { endpoint } = input; + if (endpoint === void 0) { + input.endpoint = async () => { + return toEndpointV1(input.endpointProvider({ + Region: typeof input.region === "function" ? await input.region() : input.region, + UseDualStack: typeof input.useDualstackEndpoint === "function" ? await input.useDualstackEndpoint() : input.useDualstackEndpoint, + UseFIPS: typeof input.useFipsEndpoint === "function" ? await input.useFipsEndpoint() : input.useFipsEndpoint, + Endpoint: void 0 + }, { logger: input.logger })); + }; + } + return input; + }; + var toEndpointV1 = (endpoint) => urlParser.parseUrl(endpoint.url); + Object.defineProperty(exports2, "EndpointError", { + enumerable: true, + get: function() { + return utilEndpoints.EndpointError; + } + }); + Object.defineProperty(exports2, "isIpAddress", { + enumerable: true, + get: function() { + return utilEndpoints.isIpAddress; + } + }); + Object.defineProperty(exports2, "resolveEndpoint", { + enumerable: true, + get: function() { + return utilEndpoints.resolveEndpoint; + } + }); + exports2.awsEndpointFunctions = awsEndpointFunctions4; + exports2.getUserAgentPrefix = getUserAgentPrefix; + exports2.partition = partition; + exports2.resolveDefaultAwsRegionalEndpointsConfig = resolveDefaultAwsRegionalEndpointsConfig; + exports2.setPartitionInfo = setPartitionInfo; + exports2.toEndpointV1 = toEndpointV1; + exports2.useDefaultPartitionInfo = useDefaultPartitionInfo; + } +}); + +// node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js +var require_dist_cjs37 = __commonJS({ + "node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js"(exports2) { + "use strict"; + var core = (init_dist_es(), __toCommonJS(dist_es_exports)); + var utilEndpoints = require_dist_cjs36(); + var protocolHttp = require_dist_cjs2(); + var core$1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); + var DEFAULT_UA_APP_ID = void 0; + function isValidUserAgentAppId(appId) { + if (appId === void 0) { + return true; + } + return typeof appId === "string" && appId.length <= 50; + } + function resolveUserAgentConfig4(input) { + const normalizedAppIdProvider = core.normalizeProvider(input.userAgentAppId ?? DEFAULT_UA_APP_ID); + const { customUserAgent } = input; + return Object.assign(input, { + customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent, + userAgentAppId: async () => { + const appId = await normalizedAppIdProvider(); + if (!isValidUserAgentAppId(appId)) { + const logger3 = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger; + if (typeof appId !== "string") { + logger3?.warn("userAgentAppId must be a string or undefined."); + } else if (appId.length > 50) { + logger3?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters."); + } + } + return appId; + } + }); + } + var ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/; + async function checkFeatures(context, config, args2) { + const request = args2.request; + if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") { + core$1.setFeature(context, "PROTOCOL_RPC_V2_CBOR", "M"); + } + if (typeof config.retryStrategy === "function") { + const retryStrategy = await config.retryStrategy(); + if (typeof retryStrategy.acquireInitialRetryToken === "function") { + if (retryStrategy.constructor?.name?.includes("Adaptive")) { + core$1.setFeature(context, "RETRY_MODE_ADAPTIVE", "F"); + } else { + core$1.setFeature(context, "RETRY_MODE_STANDARD", "E"); + } + } else { + core$1.setFeature(context, "RETRY_MODE_LEGACY", "D"); + } + } + if (typeof config.accountIdEndpointMode === "function") { + const endpointV2 = context.endpointV2; + if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) { + core$1.setFeature(context, "ACCOUNT_ID_ENDPOINT", "O"); + } + switch (await config.accountIdEndpointMode?.()) { + case "disabled": + core$1.setFeature(context, "ACCOUNT_ID_MODE_DISABLED", "Q"); + break; + case "preferred": + core$1.setFeature(context, "ACCOUNT_ID_MODE_PREFERRED", "P"); + break; + case "required": + core$1.setFeature(context, "ACCOUNT_ID_MODE_REQUIRED", "R"); + break; + } + } + const identity = context.__smithy_context?.selectedHttpAuthScheme?.identity; + if (identity?.$source) { + const credentials = identity; + if (credentials.accountId) { + core$1.setFeature(context, "RESOLVED_ACCOUNT_ID", "T"); + } + for (const [key, value] of Object.entries(credentials.$source ?? {})) { + core$1.setFeature(context, key, value); + } + } + } + var USER_AGENT = "user-agent"; + var X_AMZ_USER_AGENT = "x-amz-user-agent"; + var SPACE = " "; + var UA_NAME_SEPARATOR = "/"; + var UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w]/g; + var UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w#]/g; + var UA_ESCAPE_CHAR = "-"; + var BYTE_LIMIT = 1024; + function encodeFeatures(features) { + let buffer = ""; + for (const key in features) { + const val = features[key]; + if (buffer.length + val.length + 1 <= BYTE_LIMIT) { + if (buffer.length) { + buffer += "," + val; + } else { + buffer += val; + } + continue; + } + break; + } + return buffer; + } + var userAgentMiddleware = (options) => (next, context) => async (args2) => { + const { request } = args2; + if (!protocolHttp.HttpRequest.isInstance(request)) { + return next(args2); + } + const { headers } = request; + const userAgent = context?.userAgent?.map(escapeUserAgent) || []; + const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent); + await checkFeatures(context, options, args2); + const awsContext = context; + defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`); + const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || []; + const appId = await options.userAgentAppId(); + if (appId) { + defaultUserAgent.push(escapeUserAgent([`app`, `${appId}`])); + } + const prefix = utilEndpoints.getUserAgentPrefix(); + const sdkUserAgentValue = (prefix ? [prefix] : []).concat([...defaultUserAgent, ...userAgent, ...customUserAgent]).join(SPACE); + const normalUAValue = [ + ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")), + ...customUserAgent + ].join(SPACE); + if (options.runtime !== "browser") { + if (normalUAValue) { + headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? `${headers[USER_AGENT]} ${normalUAValue}` : normalUAValue; + } + headers[USER_AGENT] = sdkUserAgentValue; + } else { + headers[X_AMZ_USER_AGENT] = sdkUserAgentValue; + } + return next({ + ...args2, + request + }); + }; + var escapeUserAgent = (userAgentPair) => { + const name = userAgentPair[0].split(UA_NAME_SEPARATOR).map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)).join(UA_NAME_SEPARATOR); + const version = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR); + const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR); + const prefix = name.substring(0, prefixSeparatorIndex); + let uaName = name.substring(prefixSeparatorIndex + 1); + if (prefix === "api") { + uaName = uaName.toLowerCase(); + } + return [prefix, uaName, version].filter((item) => item && item.length > 0).reduce((acc, item, index) => { + switch (index) { + case 0: + return item; + case 1: + return `${acc}/${item}`; + default: + return `${acc}#${item}`; + } + }, ""); + }; + var getUserAgentMiddlewareOptions = { + name: "getUserAgentMiddleware", + step: "build", + priority: "low", + tags: ["SET_USER_AGENT", "USER_AGENT"], + override: true + }; + var getUserAgentPlugin4 = (config) => ({ + applyToStack: (clientStack) => { + clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions); + } + }); + exports2.DEFAULT_UA_APP_ID = DEFAULT_UA_APP_ID; + exports2.getUserAgentMiddlewareOptions = getUserAgentMiddlewareOptions; + exports2.getUserAgentPlugin = getUserAgentPlugin4; + exports2.resolveUserAgentConfig = resolveUserAgentConfig4; + exports2.userAgentMiddleware = userAgentMiddleware; + } +}); + +// node_modules/@smithy/config-resolver/dist-cjs/index.js +var require_dist_cjs38 = __commonJS({ + "node_modules/@smithy/config-resolver/dist-cjs/index.js"(exports2) { + "use strict"; + var utilConfigProvider = require_dist_cjs31(); + var utilMiddleware = require_dist_cjs4(); + var utilEndpoints = require_dist_cjs33(); + var ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; + var CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; + var DEFAULT_USE_DUALSTACK_ENDPOINT = false; + var NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS4 = { + environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, ENV_USE_DUALSTACK_ENDPOINT, utilConfigProvider.SelectorType.ENV), + configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, utilConfigProvider.SelectorType.CONFIG), + default: false + }; + var ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; + var CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; + var DEFAULT_USE_FIPS_ENDPOINT = false; + var NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS4 = { + environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, ENV_USE_FIPS_ENDPOINT, utilConfigProvider.SelectorType.ENV), + configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, utilConfigProvider.SelectorType.CONFIG), + default: false + }; + var resolveCustomEndpointsConfig = (input) => { + const { tls, endpoint, urlParser, useDualstackEndpoint } = input; + return Object.assign(input, { + tls: tls ?? true, + endpoint: utilMiddleware.normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint), + isCustomEndpoint: true, + useDualstackEndpoint: utilMiddleware.normalizeProvider(useDualstackEndpoint ?? false) + }); + }; + var getEndpointFromRegion = async (input) => { + const { tls = true } = input; + const region = await input.region(); + const dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); + if (!dnsHostRegex.test(region)) { + throw new Error("Invalid region in client config"); + } + const useDualstackEndpoint = await input.useDualstackEndpoint(); + const useFipsEndpoint = await input.useFipsEndpoint(); + const { hostname } = await input.regionInfoProvider(region, { useDualstackEndpoint, useFipsEndpoint }) ?? {}; + if (!hostname) { + throw new Error("Cannot resolve hostname from client config"); + } + return input.urlParser(`${tls ? "https:" : "http:"}//${hostname}`); + }; + var resolveEndpointsConfig = (input) => { + const useDualstackEndpoint = utilMiddleware.normalizeProvider(input.useDualstackEndpoint ?? false); + const { endpoint, useFipsEndpoint, urlParser, tls } = input; + return Object.assign(input, { + tls: tls ?? true, + endpoint: endpoint ? utilMiddleware.normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint) : () => getEndpointFromRegion({ ...input, useDualstackEndpoint, useFipsEndpoint }), + isCustomEndpoint: !!endpoint, + useDualstackEndpoint + }); + }; + var REGION_ENV_NAME = "AWS_REGION"; + var REGION_INI_NAME = "region"; + var NODE_REGION_CONFIG_OPTIONS4 = { + environmentVariableSelector: (env) => env[REGION_ENV_NAME], + configFileSelector: (profile) => profile[REGION_INI_NAME], + default: () => { + throw new Error("Region is missing"); + } + }; + var NODE_REGION_CONFIG_FILE_OPTIONS4 = { + preferredFile: "credentials" + }; + var validRegions = /* @__PURE__ */ new Set(); + var checkRegion = (region, check = utilEndpoints.isValidHostLabel) => { + if (!validRegions.has(region) && !check(region)) { + if (region === "*") { + console.warn(`@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.`); + } else { + throw new Error(`Region not accepted: region="${region}" is not a valid hostname component.`); + } + } else { + validRegions.add(region); + } + }; + var isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); + var getRealRegion = (region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region; + var resolveRegionConfig4 = (input) => { + const { region, useFipsEndpoint } = input; + if (!region) { + throw new Error("Region is missing"); + } + return Object.assign(input, { + region: async () => { + const providedRegion = typeof region === "function" ? await region() : region; + const realRegion = getRealRegion(providedRegion); + checkRegion(realRegion); + return realRegion; + }, + useFipsEndpoint: async () => { + const providedRegion = typeof region === "string" ? region : await region(); + if (isFipsRegion(providedRegion)) { + return true; + } + return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); + } + }); + }; + var getHostnameFromVariants = (variants = [], { useFipsEndpoint, useDualstackEndpoint }) => variants.find(({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack"))?.hostname; + var getResolvedHostname = (resolvedRegion, { regionHostname, partitionHostname }) => regionHostname ? regionHostname : partitionHostname ? partitionHostname.replace("{region}", resolvedRegion) : void 0; + var getResolvedPartition = (region, { partitionHash }) => Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region)) ?? "aws"; + var getResolvedSigningRegion = (hostname, { signingRegion, regionRegex, useFipsEndpoint }) => { + if (signingRegion) { + return signingRegion; + } else if (useFipsEndpoint) { + const regionRegexJs = regionRegex.replace("\\\\", "\\").replace(/^\^/g, "\\.").replace(/\$$/g, "\\."); + const regionRegexmatchArray = hostname.match(regionRegexJs); + if (regionRegexmatchArray) { + return regionRegexmatchArray[0].slice(1, -1); + } + } + }; + var getRegionInfo = (region, { useFipsEndpoint = false, useDualstackEndpoint = false, signingService, regionHash, partitionHash }) => { + const partition = getResolvedPartition(region, { partitionHash }); + const resolvedRegion = region in regionHash ? region : partitionHash[partition]?.endpoint ?? region; + const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint }; + const regionHostname = getHostnameFromVariants(regionHash[resolvedRegion]?.variants, hostnameOptions); + const partitionHostname = getHostnameFromVariants(partitionHash[partition]?.variants, hostnameOptions); + const hostname = getResolvedHostname(resolvedRegion, { regionHostname, partitionHostname }); + if (hostname === void 0) { + throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`); + } + const signingRegion = getResolvedSigningRegion(hostname, { + signingRegion: regionHash[resolvedRegion]?.signingRegion, + regionRegex: partitionHash[partition].regionRegex, + useFipsEndpoint + }); + return { + partition, + signingService, + hostname, + ...signingRegion && { signingRegion }, + ...regionHash[resolvedRegion]?.signingService && { + signingService: regionHash[resolvedRegion].signingService + } + }; + }; + exports2.CONFIG_USE_DUALSTACK_ENDPOINT = CONFIG_USE_DUALSTACK_ENDPOINT; + exports2.CONFIG_USE_FIPS_ENDPOINT = CONFIG_USE_FIPS_ENDPOINT; + exports2.DEFAULT_USE_DUALSTACK_ENDPOINT = DEFAULT_USE_DUALSTACK_ENDPOINT; + exports2.DEFAULT_USE_FIPS_ENDPOINT = DEFAULT_USE_FIPS_ENDPOINT; + exports2.ENV_USE_DUALSTACK_ENDPOINT = ENV_USE_DUALSTACK_ENDPOINT; + exports2.ENV_USE_FIPS_ENDPOINT = ENV_USE_FIPS_ENDPOINT; + exports2.NODE_REGION_CONFIG_FILE_OPTIONS = NODE_REGION_CONFIG_FILE_OPTIONS4; + exports2.NODE_REGION_CONFIG_OPTIONS = NODE_REGION_CONFIG_OPTIONS4; + exports2.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS4; + exports2.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS4; + exports2.REGION_ENV_NAME = REGION_ENV_NAME; + exports2.REGION_INI_NAME = REGION_INI_NAME; + exports2.getRegionInfo = getRegionInfo; + exports2.resolveCustomEndpointsConfig = resolveCustomEndpointsConfig; + exports2.resolveEndpointsConfig = resolveEndpointsConfig; + exports2.resolveRegionConfig = resolveRegionConfig4; + } +}); + +// node_modules/@smithy/eventstream-serde-config-resolver/dist-cjs/index.js +var require_dist_cjs39 = __commonJS({ + "node_modules/@smithy/eventstream-serde-config-resolver/dist-cjs/index.js"(exports2) { + "use strict"; + var resolveEventStreamSerdeConfig = (input) => Object.assign(input, { + eventStreamMarshaller: input.eventStreamSerdeProvider(input) + }); + exports2.resolveEventStreamSerdeConfig = resolveEventStreamSerdeConfig; + } +}); + +// node_modules/@smithy/middleware-content-length/dist-cjs/index.js +var require_dist_cjs40 = __commonJS({ + "node_modules/@smithy/middleware-content-length/dist-cjs/index.js"(exports2) { + "use strict"; + var protocolHttp = require_dist_cjs2(); + var CONTENT_LENGTH_HEADER = "content-length"; + function contentLengthMiddleware(bodyLengthChecker) { + return (next) => async (args2) => { + const request = args2.request; + if (protocolHttp.HttpRequest.isInstance(request)) { + const { body, headers } = request; + if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) { + try { + const length = bodyLengthChecker(body); + request.headers = { + ...request.headers, + [CONTENT_LENGTH_HEADER]: String(length) + }; + } catch (error2) { + } + } + } + return next({ + ...args2, + request + }); + }; + } + var contentLengthMiddlewareOptions = { + step: "build", + tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], + name: "contentLengthMiddleware", + override: true + }; + var getContentLengthPlugin4 = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions); + } + }); + exports2.contentLengthMiddleware = contentLengthMiddleware; + exports2.contentLengthMiddlewareOptions = contentLengthMiddlewareOptions; + exports2.getContentLengthPlugin = getContentLengthPlugin4; + } +}); + +// node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js +var require_getHomeDir = __commonJS({ + "node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getHomeDir = void 0; + var os_1 = require("os"); + var path_1 = require("path"); + var homeDirCache = {}; + var getHomeDirCacheKey = () => { + if (process && process.geteuid) { + return `${process.geteuid()}`; + } + return "DEFAULT"; + }; + var getHomeDir = () => { + const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path_1.sep}` } = process.env; + if (HOME) + return HOME; + if (USERPROFILE) + return USERPROFILE; + if (HOMEPATH) + return `${HOMEDRIVE}${HOMEPATH}`; + const homeDirCacheKey = getHomeDirCacheKey(); + if (!homeDirCache[homeDirCacheKey]) + homeDirCache[homeDirCacheKey] = (0, os_1.homedir)(); + return homeDirCache[homeDirCacheKey]; + }; + exports2.getHomeDir = getHomeDir; + } +}); + +// node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js +var require_getSSOTokenFilepath = __commonJS({ + "node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getSSOTokenFilepath = void 0; + var crypto_1 = require("crypto"); + var path_1 = require("path"); + var getHomeDir_1 = require_getHomeDir(); + var getSSOTokenFilepath = (id) => { + const hasher = (0, crypto_1.createHash)("sha1"); + const cacheName = hasher.update(id).digest("hex"); + return (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "sso", "cache", `${cacheName}.json`); + }; + exports2.getSSOTokenFilepath = getSSOTokenFilepath; + } +}); + +// node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js +var require_getSSOTokenFromFile = __commonJS({ + "node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getSSOTokenFromFile = exports2.tokenIntercept = void 0; + var promises_1 = require("fs/promises"); + var getSSOTokenFilepath_1 = require_getSSOTokenFilepath(); + exports2.tokenIntercept = {}; + var getSSOTokenFromFile = async (id) => { + if (exports2.tokenIntercept[id]) { + return exports2.tokenIntercept[id]; + } + const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id); + const ssoTokenText = await (0, promises_1.readFile)(ssoTokenFilepath, "utf8"); + return JSON.parse(ssoTokenText); + }; + exports2.getSSOTokenFromFile = getSSOTokenFromFile; + } +}); + +// node_modules/@smithy/shared-ini-file-loader/dist-cjs/readFile.js +var require_readFile = __commonJS({ + "node_modules/@smithy/shared-ini-file-loader/dist-cjs/readFile.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.readFile = exports2.fileIntercept = exports2.filePromises = void 0; + var promises_1 = require("node:fs/promises"); + exports2.filePromises = {}; + exports2.fileIntercept = {}; + var readFile = (path, options) => { + if (exports2.fileIntercept[path] !== void 0) { + return exports2.fileIntercept[path]; + } + if (!exports2.filePromises[path] || options?.ignoreCache) { + exports2.filePromises[path] = (0, promises_1.readFile)(path, "utf8"); + } + return exports2.filePromises[path]; + }; + exports2.readFile = readFile; + } +}); + +// node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js +var require_dist_cjs41 = __commonJS({ + "node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js"(exports2) { + "use strict"; + var getHomeDir = require_getHomeDir(); + var getSSOTokenFilepath = require_getSSOTokenFilepath(); + var getSSOTokenFromFile = require_getSSOTokenFromFile(); + var path = require("path"); + var types = require_dist_cjs(); + var readFile = require_readFile(); + var ENV_PROFILE = "AWS_PROFILE"; + var DEFAULT_PROFILE = "default"; + var getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE; + var CONFIG_PREFIX_SEPARATOR = "."; + var getConfigData = (data2) => Object.entries(data2).filter(([key]) => { + const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); + if (indexOfSeparator === -1) { + return false; + } + return Object.values(types.IniSectionType).includes(key.substring(0, indexOfSeparator)); + }).reduce((acc, [key, value]) => { + const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); + const updatedKey = key.substring(0, indexOfSeparator) === types.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; + acc[updatedKey] = value; + return acc; + }, { + ...data2.default && { default: data2.default } + }); + var ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; + var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path.join(getHomeDir.getHomeDir(), ".aws", "config"); + var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; + var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path.join(getHomeDir.getHomeDir(), ".aws", "credentials"); + var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; + var profileNameBlockList = ["__proto__", "profile __proto__"]; + var parseIni = (iniData) => { + const map2 = {}; + let currentSection; + let currentSubSection; + for (const iniLine of iniData.split(/\r?\n/)) { + const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim(); + const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]"; + if (isSection) { + currentSection = void 0; + currentSubSection = void 0; + const sectionName = trimmedLine.substring(1, trimmedLine.length - 1); + const matches = prefixKeyRegex.exec(sectionName); + if (matches) { + const [, prefix, , name] = matches; + if (Object.values(types.IniSectionType).includes(prefix)) { + currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR); + } + } else { + currentSection = sectionName; + } + if (profileNameBlockList.includes(sectionName)) { + throw new Error(`Found invalid profile name "${sectionName}"`); + } + } else if (currentSection) { + const indexOfEqualsSign = trimmedLine.indexOf("="); + if (![0, -1].includes(indexOfEqualsSign)) { + const [name, value] = [ + trimmedLine.substring(0, indexOfEqualsSign).trim(), + trimmedLine.substring(indexOfEqualsSign + 1).trim() + ]; + if (value === "") { + currentSubSection = name; + } else { + if (currentSubSection && iniLine.trimStart() === iniLine) { + currentSubSection = void 0; + } + map2[currentSection] = map2[currentSection] || {}; + const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name; + map2[currentSection][key] = value; + } + } + } + } + return map2; + }; + var swallowError$1 = () => ({}); + var loadSharedConfigFiles = async (init = {}) => { + const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; + const homeDir = getHomeDir.getHomeDir(); + const relativeHomeDirPrefix = "~/"; + let resolvedFilepath = filepath; + if (filepath.startsWith(relativeHomeDirPrefix)) { + resolvedFilepath = path.join(homeDir, filepath.slice(2)); + } + let resolvedConfigFilepath = configFilepath; + if (configFilepath.startsWith(relativeHomeDirPrefix)) { + resolvedConfigFilepath = path.join(homeDir, configFilepath.slice(2)); + } + const parsedFiles = await Promise.all([ + readFile.readFile(resolvedConfigFilepath, { + ignoreCache: init.ignoreCache + }).then(parseIni).then(getConfigData).catch(swallowError$1), + readFile.readFile(resolvedFilepath, { + ignoreCache: init.ignoreCache + }).then(parseIni).catch(swallowError$1) + ]); + return { + configFile: parsedFiles[0], + credentialsFile: parsedFiles[1] + }; + }; + var getSsoSessionData = (data2) => Object.entries(data2).filter(([key]) => key.startsWith(types.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {}); + var swallowError = () => ({}); + var loadSsoSessionData = async (init = {}) => readFile.readFile(init.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError); + var mergeConfigFiles = (...files) => { + const merged = {}; + for (const file of files) { + for (const [key, values] of Object.entries(file)) { + if (merged[key] !== void 0) { + Object.assign(merged[key], values); + } else { + merged[key] = values; + } + } + } + return merged; + }; + var parseKnownFiles = async (init) => { + const parsedFiles = await loadSharedConfigFiles(init); + return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile); + }; + var externalDataInterceptor = { + getFileRecord() { + return readFile.fileIntercept; + }, + interceptFile(path2, contents) { + readFile.fileIntercept[path2] = Promise.resolve(contents); + }, + getTokenRecord() { + return getSSOTokenFromFile.tokenIntercept; + }, + interceptToken(id, contents) { + getSSOTokenFromFile.tokenIntercept[id] = contents; + } + }; + Object.defineProperty(exports2, "getSSOTokenFromFile", { + enumerable: true, + get: function() { + return getSSOTokenFromFile.getSSOTokenFromFile; + } + }); + Object.defineProperty(exports2, "readFile", { + enumerable: true, + get: function() { + return readFile.readFile; + } + }); + exports2.CONFIG_PREFIX_SEPARATOR = CONFIG_PREFIX_SEPARATOR; + exports2.DEFAULT_PROFILE = DEFAULT_PROFILE; + exports2.ENV_PROFILE = ENV_PROFILE; + exports2.externalDataInterceptor = externalDataInterceptor; + exports2.getProfileName = getProfileName; + exports2.loadSharedConfigFiles = loadSharedConfigFiles; + exports2.loadSsoSessionData = loadSsoSessionData; + exports2.parseKnownFiles = parseKnownFiles; + Object.keys(getHomeDir).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return getHomeDir[k4]; + } + }); + }); + Object.keys(getSSOTokenFilepath).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return getSSOTokenFilepath[k4]; + } + }); + }); + } +}); + +// node_modules/@smithy/node-config-provider/dist-cjs/index.js +var require_dist_cjs42 = __commonJS({ + "node_modules/@smithy/node-config-provider/dist-cjs/index.js"(exports2) { + "use strict"; + var propertyProvider = require_dist_cjs17(); + var sharedIniFileLoader = require_dist_cjs41(); + function getSelectorName(functionString) { + try { + const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? [])); + constants.delete("CONFIG"); + constants.delete("CONFIG_PREFIX_SEPARATOR"); + constants.delete("ENV"); + return [...constants].join(", "); + } catch (e4) { + return functionString; + } + } + var fromEnv = (envVarSelector, options) => async () => { + try { + const config = envVarSelector(process.env, options); + if (config === void 0) { + throw new Error(); + } + return config; + } catch (e4) { + throw new propertyProvider.CredentialsProviderError(e4.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: options?.logger }); + } + }; + var fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => { + const profile = sharedIniFileLoader.getProfileName(init); + const { configFile, credentialsFile } = await sharedIniFileLoader.loadSharedConfigFiles(init); + const profileFromCredentials = credentialsFile[profile] || {}; + const profileFromConfig = configFile[profile] || {}; + const mergedProfile = preferredFile === "config" ? { ...profileFromCredentials, ...profileFromConfig } : { ...profileFromConfig, ...profileFromCredentials }; + try { + const cfgFile = preferredFile === "config" ? configFile : credentialsFile; + const configValue = configSelector(mergedProfile, cfgFile); + if (configValue === void 0) { + throw new Error(); + } + return configValue; + } catch (e4) { + throw new propertyProvider.CredentialsProviderError(e4.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init.logger }); + } + }; + var isFunction = (func) => typeof func === "function"; + var fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : propertyProvider.fromStatic(defaultValue); + var loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => { + const { signingName, logger: logger3 } = configuration; + const envOptions = { signingName, logger: logger3 }; + return propertyProvider.memoize(propertyProvider.chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic(defaultValue))); + }; + exports2.loadConfig = loadConfig; + } +}); + +// node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js +var require_getEndpointUrlConfig = __commonJS({ + "node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getEndpointUrlConfig = void 0; + var shared_ini_file_loader_1 = require_dist_cjs41(); + var ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL"; + var CONFIG_ENDPOINT_URL = "endpoint_url"; + var getEndpointUrlConfig = (serviceId) => ({ + environmentVariableSelector: (env) => { + const serviceSuffixParts = serviceId.split(" ").map((w4) => w4.toUpperCase()); + const serviceEndpointUrl = env[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")]; + if (serviceEndpointUrl) + return serviceEndpointUrl; + const endpointUrl = env[ENV_ENDPOINT_URL]; + if (endpointUrl) + return endpointUrl; + return void 0; + }, + configFileSelector: (profile, config) => { + if (config && profile.services) { + const servicesSection = config[["services", profile.services].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; + if (servicesSection) { + const servicePrefixParts = serviceId.split(" ").map((w4) => w4.toLowerCase()); + const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; + if (endpointUrl2) + return endpointUrl2; + } + } + const endpointUrl = profile[CONFIG_ENDPOINT_URL]; + if (endpointUrl) + return endpointUrl; + return void 0; + }, + default: void 0 + }); + exports2.getEndpointUrlConfig = getEndpointUrlConfig; + } +}); + +// node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js +var require_getEndpointFromConfig = __commonJS({ + "node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getEndpointFromConfig = void 0; + var node_config_provider_1 = require_dist_cjs42(); + var getEndpointUrlConfig_1 = require_getEndpointUrlConfig(); + var getEndpointFromConfig = async (serviceId) => (0, node_config_provider_1.loadConfig)((0, getEndpointUrlConfig_1.getEndpointUrlConfig)(serviceId ?? ""))(); + exports2.getEndpointFromConfig = getEndpointFromConfig; + } +}); + +// node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +var require_dist_cjs43 = __commonJS({ + "node_modules/@smithy/middleware-endpoint/dist-cjs/index.js"(exports2) { + "use strict"; + var getEndpointFromConfig = require_getEndpointFromConfig(); + var urlParser = require_dist_cjs35(); + var core = (init_dist_es(), __toCommonJS(dist_es_exports)); + var utilMiddleware = require_dist_cjs4(); + var middlewareSerde = require_dist_cjs5(); + var resolveParamsForS3 = async (endpointParams) => { + const bucket = endpointParams?.Bucket || ""; + if (typeof endpointParams.Bucket === "string") { + endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); + } + if (isArnBucketName(bucket)) { + if (endpointParams.ForcePathStyle === true) { + throw new Error("Path-style addressing cannot be used with ARN buckets"); + } + } else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) { + endpointParams.ForcePathStyle = true; + } + if (endpointParams.DisableMultiRegionAccessPoints) { + endpointParams.disableMultiRegionAccessPoints = true; + endpointParams.DisableMRAP = true; + } + return endpointParams; + }; + var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; + var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; + var DOTS_PATTERN = /\.\./; + var isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); + var isArnBucketName = (bucketName) => { + const [arn, partition, service, , , bucket] = bucketName.split(":"); + const isArn = arn === "arn" && bucketName.split(":").length >= 6; + const isValidArn = Boolean(isArn && partition && service && bucket); + if (isArn && !isValidArn) { + throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); + } + return isValidArn; + }; + var createConfigValueProvider = (configKey, canonicalEndpointParamKey, config, isClientContextParam = false) => { + const configProvider = async () => { + let configValue; + if (isClientContextParam) { + const clientContextParams = config.clientContextParams; + const nestedValue = clientContextParams?.[configKey]; + configValue = nestedValue ?? config[configKey] ?? config[canonicalEndpointParamKey]; + } else { + configValue = config[configKey] ?? config[canonicalEndpointParamKey]; + } + if (typeof configValue === "function") { + return configValue(); + } + return configValue; + }; + if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") { + return async () => { + const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; + const configValue = credentials?.credentialScope ?? credentials?.CredentialScope; + return configValue; + }; + } + if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") { + return async () => { + const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; + const configValue = credentials?.accountId ?? credentials?.AccountId; + return configValue; + }; + } + if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { + return async () => { + if (config.isCustomEndpoint === false) { + return void 0; + } + const endpoint = await configProvider(); + if (endpoint && typeof endpoint === "object") { + if ("url" in endpoint) { + return endpoint.url.href; + } + if ("hostname" in endpoint) { + const { protocol, hostname, port, path } = endpoint; + return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`; + } + } + return endpoint; + }; + } + return configProvider; + }; + var toEndpointV1 = (endpoint) => { + if (typeof endpoint === "object") { + if ("url" in endpoint) { + return urlParser.parseUrl(endpoint.url); + } + return endpoint; + } + return urlParser.parseUrl(endpoint); + }; + var getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => { + if (!clientConfig.isCustomEndpoint) { + let endpointFromConfig; + if (clientConfig.serviceConfiguredEndpoint) { + endpointFromConfig = await clientConfig.serviceConfiguredEndpoint(); + } else { + endpointFromConfig = await getEndpointFromConfig.getEndpointFromConfig(clientConfig.serviceId); + } + if (endpointFromConfig) { + clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig)); + clientConfig.isCustomEndpoint = true; + } + } + const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig); + if (typeof clientConfig.endpointProvider !== "function") { + throw new Error("config.endpointProvider is not set."); + } + const endpoint = clientConfig.endpointProvider(endpointParams, context); + return endpoint; + }; + var resolveParams = async (commandInput, instructionsSupplier, clientConfig) => { + const endpointParams = {}; + const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {}; + for (const [name, instruction] of Object.entries(instructions)) { + switch (instruction.type) { + case "staticContextParams": + endpointParams[name] = instruction.value; + break; + case "contextParams": + endpointParams[name] = commandInput[instruction.name]; + break; + case "clientContextParams": + case "builtInParams": + endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig, instruction.type !== "builtInParams")(); + break; + case "operationContextParams": + endpointParams[name] = instruction.get(commandInput); + break; + default: + throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction)); + } + } + if (Object.keys(instructions).length === 0) { + Object.assign(endpointParams, clientConfig); + } + if (String(clientConfig.serviceId).toLowerCase() === "s3") { + await resolveParamsForS3(endpointParams); + } + return endpointParams; + }; + var endpointMiddleware = ({ config, instructions }) => { + return (next, context) => async (args2) => { + if (config.isCustomEndpoint) { + core.setFeature(context, "ENDPOINT_OVERRIDE", "N"); + } + const endpoint = await getEndpointFromInstructions(args2.input, { + getEndpointParameterInstructions() { + return instructions; + } + }, { ...config }, context); + context.endpointV2 = endpoint; + context.authSchemes = endpoint.properties?.authSchemes; + const authScheme = context.authSchemes?.[0]; + if (authScheme) { + context["signing_region"] = authScheme.signingRegion; + context["signing_service"] = authScheme.signingName; + const smithyContext = utilMiddleware.getSmithyContext(context); + const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption; + if (httpAuthOption) { + httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, { + signing_region: authScheme.signingRegion, + signingRegion: authScheme.signingRegion, + signing_service: authScheme.signingName, + signingName: authScheme.signingName, + signingRegionSet: authScheme.signingRegionSet + }, authScheme.properties); + } + } + return next({ + ...args2 + }); + }; + }; + var endpointMiddlewareOptions = { + step: "serialize", + tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], + name: "endpointV2Middleware", + override: true, + relation: "before", + toMiddleware: middlewareSerde.serializerMiddlewareOption.name + }; + var getEndpointPlugin5 = (config, instructions) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(endpointMiddleware({ + config, + instructions + }), endpointMiddlewareOptions); + } + }); + var resolveEndpointConfig4 = (input) => { + const tls = input.tls ?? true; + const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input; + const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await utilMiddleware.normalizeProvider(endpoint)()) : void 0; + const isCustomEndpoint = !!endpoint; + const resolvedConfig = Object.assign(input, { + endpoint: customEndpointProvider, + tls, + isCustomEndpoint, + useDualstackEndpoint: utilMiddleware.normalizeProvider(useDualstackEndpoint ?? false), + useFipsEndpoint: utilMiddleware.normalizeProvider(useFipsEndpoint ?? false) + }); + let configuredEndpointPromise = void 0; + resolvedConfig.serviceConfiguredEndpoint = async () => { + if (input.serviceId && !configuredEndpointPromise) { + configuredEndpointPromise = getEndpointFromConfig.getEndpointFromConfig(input.serviceId); + } + return configuredEndpointPromise; + }; + return resolvedConfig; + }; + var resolveEndpointRequiredConfig = (input) => { + const { endpoint } = input; + if (endpoint === void 0) { + input.endpoint = async () => { + throw new Error("@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint."); + }; + } + return input; + }; + exports2.endpointMiddleware = endpointMiddleware; + exports2.endpointMiddlewareOptions = endpointMiddlewareOptions; + exports2.getEndpointFromInstructions = getEndpointFromInstructions; + exports2.getEndpointPlugin = getEndpointPlugin5; + exports2.resolveEndpointConfig = resolveEndpointConfig4; + exports2.resolveEndpointRequiredConfig = resolveEndpointRequiredConfig; + exports2.resolveParams = resolveParams; + exports2.toEndpointV1 = toEndpointV1; + } +}); + +// node_modules/@smithy/service-error-classification/dist-cjs/index.js +var require_dist_cjs44 = __commonJS({ + "node_modules/@smithy/service-error-classification/dist-cjs/index.js"(exports2) { + "use strict"; + var CLOCK_SKEW_ERROR_CODES = [ + "AuthFailure", + "InvalidSignatureException", + "RequestExpired", + "RequestInTheFuture", + "RequestTimeTooSkewed", + "SignatureDoesNotMatch" + ]; + var THROTTLING_ERROR_CODES = [ + "BandwidthLimitExceeded", + "EC2ThrottledException", + "LimitExceededException", + "PriorRequestNotComplete", + "ProvisionedThroughputExceededException", + "RequestLimitExceeded", + "RequestThrottled", + "RequestThrottledException", + "SlowDown", + "ThrottledException", + "Throttling", + "ThrottlingException", + "TooManyRequestsException", + "TransactionInProgressException" + ]; + var TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; + var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; + var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; + var NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"]; + var isRetryableByTrait = (error2) => error2?.$retryable !== void 0; + var isClockSkewError = (error2) => CLOCK_SKEW_ERROR_CODES.includes(error2.name); + var isClockSkewCorrectedError = (error2) => error2.$metadata?.clockSkewCorrected; + var isBrowserNetworkError = (error2) => { + const errorMessages = /* @__PURE__ */ new Set([ + "Failed to fetch", + "NetworkError when attempting to fetch resource", + "The Internet connection appears to be offline", + "Load failed", + "Network request failed" + ]); + const isValid = error2 && error2 instanceof TypeError; + if (!isValid) { + return false; + } + return errorMessages.has(error2.message); + }; + var isThrottlingError = (error2) => error2.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error2.name) || error2.$retryable?.throttling == true; + var isTransientError = (error2, depth = 0) => isRetryableByTrait(error2) || isClockSkewCorrectedError(error2) || TRANSIENT_ERROR_CODES.includes(error2.name) || NODEJS_TIMEOUT_ERROR_CODES.includes(error2?.code || "") || NODEJS_NETWORK_ERROR_CODES.includes(error2?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error2.$metadata?.httpStatusCode || 0) || isBrowserNetworkError(error2) || error2.cause !== void 0 && depth <= 10 && isTransientError(error2.cause, depth + 1); + var isServerError = (error2) => { + if (error2.$metadata?.httpStatusCode !== void 0) { + const statusCode = error2.$metadata.httpStatusCode; + if (500 <= statusCode && statusCode <= 599 && !isTransientError(error2)) { + return true; + } + return false; + } + return false; + }; + exports2.isBrowserNetworkError = isBrowserNetworkError; + exports2.isClockSkewCorrectedError = isClockSkewCorrectedError; + exports2.isClockSkewError = isClockSkewError; + exports2.isRetryableByTrait = isRetryableByTrait; + exports2.isServerError = isServerError; + exports2.isThrottlingError = isThrottlingError; + exports2.isTransientError = isTransientError; + } +}); + +// node_modules/@smithy/util-retry/dist-cjs/index.js +var require_dist_cjs45 = __commonJS({ + "node_modules/@smithy/util-retry/dist-cjs/index.js"(exports2) { + "use strict"; + var serviceErrorClassification = require_dist_cjs44(); + exports2.RETRY_MODES = void 0; + (function(RETRY_MODES) { + RETRY_MODES["STANDARD"] = "standard"; + RETRY_MODES["ADAPTIVE"] = "adaptive"; + })(exports2.RETRY_MODES || (exports2.RETRY_MODES = {})); + var DEFAULT_MAX_ATTEMPTS = 3; + var DEFAULT_RETRY_MODE4 = exports2.RETRY_MODES.STANDARD; + var DefaultRateLimiter = class _DefaultRateLimiter { + static setTimeoutFn = setTimeout; + beta; + minCapacity; + minFillRate; + scaleConstant; + smooth; + currentCapacity = 0; + enabled = false; + lastMaxRate = 0; + measuredTxRate = 0; + requestCount = 0; + fillRate; + lastThrottleTime; + lastTimestamp = 0; + lastTxRateBucket; + maxCapacity; + timeWindow = 0; + constructor(options) { + this.beta = options?.beta ?? 0.7; + this.minCapacity = options?.minCapacity ?? 1; + this.minFillRate = options?.minFillRate ?? 0.5; + this.scaleConstant = options?.scaleConstant ?? 0.4; + this.smooth = options?.smooth ?? 0.8; + const currentTimeInSeconds = this.getCurrentTimeInSeconds(); + this.lastThrottleTime = currentTimeInSeconds; + this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()); + this.fillRate = this.minFillRate; + this.maxCapacity = this.minCapacity; + } + getCurrentTimeInSeconds() { + return Date.now() / 1e3; + } + async getSendToken() { + return this.acquireTokenBucket(1); + } + async acquireTokenBucket(amount) { + if (!this.enabled) { + return; + } + this.refillTokenBucket(); + if (amount > this.currentCapacity) { + const delay = (amount - this.currentCapacity) / this.fillRate * 1e3; + await new Promise((resolve) => _DefaultRateLimiter.setTimeoutFn(resolve, delay)); + } + this.currentCapacity = this.currentCapacity - amount; + } + refillTokenBucket() { + const timestamp = this.getCurrentTimeInSeconds(); + if (!this.lastTimestamp) { + this.lastTimestamp = timestamp; + return; + } + const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; + this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); + this.lastTimestamp = timestamp; + } + updateClientSendingRate(response) { + let calculatedRate; + this.updateMeasuredRate(); + if (serviceErrorClassification.isThrottlingError(response)) { + const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate); + this.lastMaxRate = rateToUse; + this.calculateTimeWindow(); + this.lastThrottleTime = this.getCurrentTimeInSeconds(); + calculatedRate = this.cubicThrottle(rateToUse); + this.enableTokenBucket(); + } else { + this.calculateTimeWindow(); + calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds()); + } + const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate); + this.updateTokenBucketRate(newRate); + } + calculateTimeWindow() { + this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3)); + } + cubicThrottle(rateToUse) { + return this.getPrecise(rateToUse * this.beta); + } + cubicSuccess(timestamp) { + return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate); + } + enableTokenBucket() { + this.enabled = true; + } + updateTokenBucketRate(newRate) { + this.refillTokenBucket(); + this.fillRate = Math.max(newRate, this.minFillRate); + this.maxCapacity = Math.max(newRate, this.minCapacity); + this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity); + } + updateMeasuredRate() { + const t4 = this.getCurrentTimeInSeconds(); + const timeBucket = Math.floor(t4 * 2) / 2; + this.requestCount++; + if (timeBucket > this.lastTxRateBucket) { + const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket); + this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth)); + this.requestCount = 0; + this.lastTxRateBucket = timeBucket; + } + } + getPrecise(num) { + return parseFloat(num.toFixed(8)); + } + }; + var DEFAULT_RETRY_DELAY_BASE = 100; + var MAXIMUM_RETRY_DELAY = 20 * 1e3; + var THROTTLING_RETRY_DELAY_BASE = 500; + var INITIAL_RETRY_TOKENS = 500; + var RETRY_COST = 5; + var TIMEOUT_RETRY_COST = 10; + var NO_RETRY_INCREMENT = 1; + var INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; + var REQUEST_HEADER = "amz-sdk-request"; + var getDefaultRetryBackoffStrategy = () => { + let delayBase = DEFAULT_RETRY_DELAY_BASE; + const computeNextBackoffDelay = (attempts) => { + return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); + }; + const setDelayBase = (delay) => { + delayBase = delay; + }; + return { + computeNextBackoffDelay, + setDelayBase + }; + }; + var createDefaultRetryToken = ({ retryDelay, retryCount, retryCost }) => { + const getRetryCount = () => retryCount; + const getRetryDelay = () => Math.min(MAXIMUM_RETRY_DELAY, retryDelay); + const getRetryCost = () => retryCost; + return { + getRetryCount, + getRetryDelay, + getRetryCost + }; + }; + var StandardRetryStrategy = class { + maxAttempts; + mode = exports2.RETRY_MODES.STANDARD; + capacity = INITIAL_RETRY_TOKENS; + retryBackoffStrategy = getDefaultRetryBackoffStrategy(); + maxAttemptsProvider; + constructor(maxAttempts) { + this.maxAttempts = maxAttempts; + this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts; + } + async acquireInitialRetryToken(retryTokenScope) { + return createDefaultRetryToken({ + retryDelay: DEFAULT_RETRY_DELAY_BASE, + retryCount: 0 + }); + } + async refreshRetryTokenForRetry(token, errorInfo) { + const maxAttempts = await this.getMaxAttempts(); + if (this.shouldRetry(token, errorInfo, maxAttempts)) { + const errorType = errorInfo.errorType; + this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE); + const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount()); + const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType; + const capacityCost = this.getCapacityCost(errorType); + this.capacity -= capacityCost; + return createDefaultRetryToken({ + retryDelay, + retryCount: token.getRetryCount() + 1, + retryCost: capacityCost + }); + } + throw new Error("No retry token available"); + } + recordSuccess(token) { + this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT)); + } + getCapacity() { + return this.capacity; + } + async getMaxAttempts() { + try { + return await this.maxAttemptsProvider(); + } catch (error2) { + console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`); + return DEFAULT_MAX_ATTEMPTS; + } + } + shouldRetry(tokenToRenew, errorInfo, maxAttempts) { + const attempts = tokenToRenew.getRetryCount() + 1; + return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType); + } + getCapacityCost(errorType) { + return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST; + } + isRetryableError(errorType) { + return errorType === "THROTTLING" || errorType === "TRANSIENT"; + } + }; + var AdaptiveRetryStrategy = class { + maxAttemptsProvider; + rateLimiter; + standardRetryStrategy; + mode = exports2.RETRY_MODES.ADAPTIVE; + constructor(maxAttemptsProvider, options) { + this.maxAttemptsProvider = maxAttemptsProvider; + const { rateLimiter } = options ?? {}; + this.rateLimiter = rateLimiter ?? new DefaultRateLimiter(); + this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider); + } + async acquireInitialRetryToken(retryTokenScope) { + await this.rateLimiter.getSendToken(); + return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); + } + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + this.rateLimiter.updateClientSendingRate(errorInfo); + return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + } + recordSuccess(token) { + this.rateLimiter.updateClientSendingRate({}); + this.standardRetryStrategy.recordSuccess(token); + } + }; + var ConfiguredRetryStrategy = class extends StandardRetryStrategy { + computeNextBackoffDelay; + constructor(maxAttempts, computeNextBackoffDelay = DEFAULT_RETRY_DELAY_BASE) { + super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts); + if (typeof computeNextBackoffDelay === "number") { + this.computeNextBackoffDelay = () => computeNextBackoffDelay; + } else { + this.computeNextBackoffDelay = computeNextBackoffDelay; + } + } + async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { + const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo); + token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount()); + return token; + } + }; + exports2.AdaptiveRetryStrategy = AdaptiveRetryStrategy; + exports2.ConfiguredRetryStrategy = ConfiguredRetryStrategy; + exports2.DEFAULT_MAX_ATTEMPTS = DEFAULT_MAX_ATTEMPTS; + exports2.DEFAULT_RETRY_DELAY_BASE = DEFAULT_RETRY_DELAY_BASE; + exports2.DEFAULT_RETRY_MODE = DEFAULT_RETRY_MODE4; + exports2.DefaultRateLimiter = DefaultRateLimiter; + exports2.INITIAL_RETRY_TOKENS = INITIAL_RETRY_TOKENS; + exports2.INVOCATION_ID_HEADER = INVOCATION_ID_HEADER; + exports2.MAXIMUM_RETRY_DELAY = MAXIMUM_RETRY_DELAY; + exports2.NO_RETRY_INCREMENT = NO_RETRY_INCREMENT; + exports2.REQUEST_HEADER = REQUEST_HEADER; + exports2.RETRY_COST = RETRY_COST; + exports2.StandardRetryStrategy = StandardRetryStrategy; + exports2.THROTTLING_RETRY_DELAY_BASE = THROTTLING_RETRY_DELAY_BASE; + exports2.TIMEOUT_RETRY_COST = TIMEOUT_RETRY_COST; + } +}); + +// node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js +var require_isStreamingPayload = __commonJS({ + "node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isStreamingPayload = void 0; + var stream_1 = require("stream"); + var isStreamingPayload = (request) => request?.body instanceof stream_1.Readable || typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream; + exports2.isStreamingPayload = isStreamingPayload; + } +}); + +// node_modules/@smithy/middleware-retry/dist-cjs/index.js +var require_dist_cjs46 = __commonJS({ + "node_modules/@smithy/middleware-retry/dist-cjs/index.js"(exports2) { + "use strict"; + var utilRetry = require_dist_cjs45(); + var protocolHttp = require_dist_cjs2(); + var serviceErrorClassification = require_dist_cjs44(); + var uuid = require_dist_cjs16(); + var utilMiddleware = require_dist_cjs4(); + var smithyClient = require_dist_cjs20(); + var isStreamingPayload = require_isStreamingPayload(); + var getDefaultRetryQuota = (initialRetryTokens, options) => { + const MAX_CAPACITY = initialRetryTokens; + const noRetryIncrement = utilRetry.NO_RETRY_INCREMENT; + const retryCost = utilRetry.RETRY_COST; + const timeoutRetryCost = utilRetry.TIMEOUT_RETRY_COST; + let availableCapacity = initialRetryTokens; + const getCapacityAmount = (error2) => error2.name === "TimeoutError" ? timeoutRetryCost : retryCost; + const hasRetryTokens = (error2) => getCapacityAmount(error2) <= availableCapacity; + const retrieveRetryTokens = (error2) => { + if (!hasRetryTokens(error2)) { + throw new Error("No retry token available"); + } + const capacityAmount = getCapacityAmount(error2); + availableCapacity -= capacityAmount; + return capacityAmount; + }; + const releaseRetryTokens = (capacityReleaseAmount) => { + availableCapacity += capacityReleaseAmount ?? noRetryIncrement; + availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); + }; + return Object.freeze({ + hasRetryTokens, + retrieveRetryTokens, + releaseRetryTokens + }); + }; + var defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(utilRetry.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); + var defaultRetryDecider = (error2) => { + if (!error2) { + return false; + } + return serviceErrorClassification.isRetryableByTrait(error2) || serviceErrorClassification.isClockSkewError(error2) || serviceErrorClassification.isThrottlingError(error2) || serviceErrorClassification.isTransientError(error2); + }; + var asSdkError = (error2) => { + if (error2 instanceof Error) + return error2; + if (error2 instanceof Object) + return Object.assign(new Error(), error2); + if (typeof error2 === "string") + return new Error(error2); + return new Error(`AWS SDK error wrapper for ${error2}`); + }; + var StandardRetryStrategy = class { + maxAttemptsProvider; + retryDecider; + delayDecider; + retryQuota; + mode = utilRetry.RETRY_MODES.STANDARD; + constructor(maxAttemptsProvider, options) { + this.maxAttemptsProvider = maxAttemptsProvider; + this.retryDecider = options?.retryDecider ?? defaultRetryDecider; + this.delayDecider = options?.delayDecider ?? defaultDelayDecider; + this.retryQuota = options?.retryQuota ?? getDefaultRetryQuota(utilRetry.INITIAL_RETRY_TOKENS); + } + shouldRetry(error2, attempts, maxAttempts) { + return attempts < maxAttempts && this.retryDecider(error2) && this.retryQuota.hasRetryTokens(error2); + } + async getMaxAttempts() { + let maxAttempts; + try { + maxAttempts = await this.maxAttemptsProvider(); + } catch (error2) { + maxAttempts = utilRetry.DEFAULT_MAX_ATTEMPTS; + } + return maxAttempts; + } + async retry(next, args2, options) { + let retryTokenAmount; + let attempts = 0; + let totalDelay = 0; + const maxAttempts = await this.getMaxAttempts(); + const { request } = args2; + if (protocolHttp.HttpRequest.isInstance(request)) { + request.headers[utilRetry.INVOCATION_ID_HEADER] = uuid.v4(); + } + while (true) { + try { + if (protocolHttp.HttpRequest.isInstance(request)) { + request.headers[utilRetry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; + } + if (options?.beforeRequest) { + await options.beforeRequest(); + } + const { response, output } = await next(args2); + if (options?.afterRequest) { + options.afterRequest(response); + } + this.retryQuota.releaseRetryTokens(retryTokenAmount); + output.$metadata.attempts = attempts + 1; + output.$metadata.totalRetryDelay = totalDelay; + return { response, output }; + } catch (e4) { + const err = asSdkError(e4); + attempts++; + if (this.shouldRetry(err, attempts, maxAttempts)) { + retryTokenAmount = this.retryQuota.retrieveRetryTokens(err); + const delayFromDecider = this.delayDecider(serviceErrorClassification.isThrottlingError(err) ? utilRetry.THROTTLING_RETRY_DELAY_BASE : utilRetry.DEFAULT_RETRY_DELAY_BASE, attempts); + const delayFromResponse = getDelayFromRetryAfterHeader(err.$response); + const delay = Math.max(delayFromResponse || 0, delayFromDecider); + totalDelay += delay; + await new Promise((resolve) => setTimeout(resolve, delay)); + continue; + } + if (!err.$metadata) { + err.$metadata = {}; + } + err.$metadata.attempts = attempts; + err.$metadata.totalRetryDelay = totalDelay; + throw err; + } + } + } + }; + var getDelayFromRetryAfterHeader = (response) => { + if (!protocolHttp.HttpResponse.isInstance(response)) + return; + const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); + if (!retryAfterHeaderName) + return; + const retryAfter = response.headers[retryAfterHeaderName]; + const retryAfterSeconds = Number(retryAfter); + if (!Number.isNaN(retryAfterSeconds)) + return retryAfterSeconds * 1e3; + const retryAfterDate = new Date(retryAfter); + return retryAfterDate.getTime() - Date.now(); + }; + var AdaptiveRetryStrategy = class extends StandardRetryStrategy { + rateLimiter; + constructor(maxAttemptsProvider, options) { + const { rateLimiter, ...superOptions } = options ?? {}; + super(maxAttemptsProvider, superOptions); + this.rateLimiter = rateLimiter ?? new utilRetry.DefaultRateLimiter(); + this.mode = utilRetry.RETRY_MODES.ADAPTIVE; + } + async retry(next, args2) { + return super.retry(next, args2, { + beforeRequest: async () => { + return this.rateLimiter.getSendToken(); + }, + afterRequest: (response) => { + this.rateLimiter.updateClientSendingRate(response); + } + }); + } + }; + var ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; + var CONFIG_MAX_ATTEMPTS = "max_attempts"; + var NODE_MAX_ATTEMPT_CONFIG_OPTIONS4 = { + environmentVariableSelector: (env) => { + const value = env[ENV_MAX_ATTEMPTS]; + if (!value) + return void 0; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`); + } + return maxAttempt; + }, + configFileSelector: (profile) => { + const value = profile[CONFIG_MAX_ATTEMPTS]; + if (!value) + return void 0; + const maxAttempt = parseInt(value); + if (Number.isNaN(maxAttempt)) { + throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); + } + return maxAttempt; + }, + default: utilRetry.DEFAULT_MAX_ATTEMPTS + }; + var resolveRetryConfig4 = (input) => { + const { retryStrategy, retryMode: _retryMode, maxAttempts: _maxAttempts } = input; + const maxAttempts = utilMiddleware.normalizeProvider(_maxAttempts ?? utilRetry.DEFAULT_MAX_ATTEMPTS); + return Object.assign(input, { + maxAttempts, + retryStrategy: async () => { + if (retryStrategy) { + return retryStrategy; + } + const retryMode = await utilMiddleware.normalizeProvider(_retryMode)(); + if (retryMode === utilRetry.RETRY_MODES.ADAPTIVE) { + return new utilRetry.AdaptiveRetryStrategy(maxAttempts); + } + return new utilRetry.StandardRetryStrategy(maxAttempts); + } + }); + }; + var ENV_RETRY_MODE = "AWS_RETRY_MODE"; + var CONFIG_RETRY_MODE = "retry_mode"; + var NODE_RETRY_MODE_CONFIG_OPTIONS4 = { + environmentVariableSelector: (env) => env[ENV_RETRY_MODE], + configFileSelector: (profile) => profile[CONFIG_RETRY_MODE], + default: utilRetry.DEFAULT_RETRY_MODE + }; + var omitRetryHeadersMiddleware = () => (next) => async (args2) => { + const { request } = args2; + if (protocolHttp.HttpRequest.isInstance(request)) { + delete request.headers[utilRetry.INVOCATION_ID_HEADER]; + delete request.headers[utilRetry.REQUEST_HEADER]; + } + return next(args2); + }; + var omitRetryHeadersMiddlewareOptions = { + name: "omitRetryHeadersMiddleware", + tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], + relation: "before", + toMiddleware: "awsAuthMiddleware", + override: true + }; + var getOmitRetryHeadersPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions); + } + }); + var retryMiddleware = (options) => (next, context) => async (args2) => { + let retryStrategy = await options.retryStrategy(); + const maxAttempts = await options.maxAttempts(); + if (isRetryStrategyV2(retryStrategy)) { + retryStrategy = retryStrategy; + let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]); + let lastError = new Error(); + let attempts = 0; + let totalRetryDelay = 0; + const { request } = args2; + const isRequest = protocolHttp.HttpRequest.isInstance(request); + if (isRequest) { + request.headers[utilRetry.INVOCATION_ID_HEADER] = uuid.v4(); + } + while (true) { + try { + if (isRequest) { + request.headers[utilRetry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; + } + const { response, output } = await next(args2); + retryStrategy.recordSuccess(retryToken); + output.$metadata.attempts = attempts + 1; + output.$metadata.totalRetryDelay = totalRetryDelay; + return { response, output }; + } catch (e4) { + const retryErrorInfo = getRetryErrorInfo(e4); + lastError = asSdkError(e4); + if (isRequest && isStreamingPayload.isStreamingPayload(request)) { + (context.logger instanceof smithyClient.NoOpLogger ? console : context.logger)?.warn("An error was encountered in a non-retryable streaming request."); + throw lastError; + } + try { + retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); + } catch (refreshError) { + if (!lastError.$metadata) { + lastError.$metadata = {}; + } + lastError.$metadata.attempts = attempts + 1; + lastError.$metadata.totalRetryDelay = totalRetryDelay; + throw lastError; + } + attempts = retryToken.getRetryCount(); + const delay = retryToken.getRetryDelay(); + totalRetryDelay += delay; + await new Promise((resolve) => setTimeout(resolve, delay)); + } + } + } else { + retryStrategy = retryStrategy; + if (retryStrategy?.mode) + context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]]; + return retryStrategy.retry(next, args2); + } + }; + var isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined"; + var getRetryErrorInfo = (error2) => { + const errorInfo = { + error: error2, + errorType: getRetryErrorType(error2) + }; + const retryAfterHint = getRetryAfterHint(error2.$response); + if (retryAfterHint) { + errorInfo.retryAfterHint = retryAfterHint; + } + return errorInfo; + }; + var getRetryErrorType = (error2) => { + if (serviceErrorClassification.isThrottlingError(error2)) + return "THROTTLING"; + if (serviceErrorClassification.isTransientError(error2)) + return "TRANSIENT"; + if (serviceErrorClassification.isServerError(error2)) + return "SERVER_ERROR"; + return "CLIENT_ERROR"; + }; + var retryMiddlewareOptions = { + name: "retryMiddleware", + tags: ["RETRY"], + step: "finalizeRequest", + priority: "high", + override: true + }; + var getRetryPlugin4 = (options) => ({ + applyToStack: (clientStack) => { + clientStack.add(retryMiddleware(options), retryMiddlewareOptions); + } + }); + var getRetryAfterHint = (response) => { + if (!protocolHttp.HttpResponse.isInstance(response)) + return; + const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); + if (!retryAfterHeaderName) + return; + const retryAfter = response.headers[retryAfterHeaderName]; + const retryAfterSeconds = Number(retryAfter); + if (!Number.isNaN(retryAfterSeconds)) + return new Date(retryAfterSeconds * 1e3); + const retryAfterDate = new Date(retryAfter); + return retryAfterDate; + }; + exports2.AdaptiveRetryStrategy = AdaptiveRetryStrategy; + exports2.CONFIG_MAX_ATTEMPTS = CONFIG_MAX_ATTEMPTS; + exports2.CONFIG_RETRY_MODE = CONFIG_RETRY_MODE; + exports2.ENV_MAX_ATTEMPTS = ENV_MAX_ATTEMPTS; + exports2.ENV_RETRY_MODE = ENV_RETRY_MODE; + exports2.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = NODE_MAX_ATTEMPT_CONFIG_OPTIONS4; + exports2.NODE_RETRY_MODE_CONFIG_OPTIONS = NODE_RETRY_MODE_CONFIG_OPTIONS4; + exports2.StandardRetryStrategy = StandardRetryStrategy; + exports2.defaultDelayDecider = defaultDelayDecider; + exports2.defaultRetryDecider = defaultRetryDecider; + exports2.getOmitRetryHeadersPlugin = getOmitRetryHeadersPlugin; + exports2.getRetryAfterHint = getRetryAfterHint; + exports2.getRetryPlugin = getRetryPlugin4; + exports2.omitRetryHeadersMiddleware = omitRetryHeadersMiddleware; + exports2.omitRetryHeadersMiddlewareOptions = omitRetryHeadersMiddlewareOptions; + exports2.resolveRetryConfig = resolveRetryConfig4; + exports2.retryMiddleware = retryMiddleware; + exports2.retryMiddlewareOptions = retryMiddlewareOptions; + } +}); + +// node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js +var require_dist_cjs47 = __commonJS({ + "node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js"(exports2) { + "use strict"; + var middlewareSdkS3 = require_dist_cjs32(); + var signatureV4 = require_dist_cjs18(); + var signatureV4CrtContainer = { + CrtSignerV4: null + }; + var SignatureV4MultiRegion = class { + sigv4aSigner; + sigv4Signer; + signerOptions; + static sigv4aDependency() { + if (typeof signatureV4CrtContainer.CrtSignerV4 === "function") { + return "crt"; + } else if (typeof signatureV4.signatureV4aContainer.SignatureV4a === "function") { + return "js"; + } + return "none"; + } + constructor(options) { + this.sigv4Signer = new middlewareSdkS3.SignatureV4S3Express(options); + this.signerOptions = options; + } + async sign(requestToSign, options = {}) { + if (options.signingRegion === "*") { + return this.getSigv4aSigner().sign(requestToSign, options); + } + return this.sigv4Signer.sign(requestToSign, options); + } + async signWithCredentials(requestToSign, credentials, options = {}) { + if (options.signingRegion === "*") { + const signer = this.getSigv4aSigner(); + const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4; + if (CrtSignerV4 && signer instanceof CrtSignerV4) { + return signer.signWithCredentials(requestToSign, credentials, options); + } else { + throw new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`); + } + } + return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options); + } + async presign(originalRequest, options = {}) { + if (options.signingRegion === "*") { + const signer = this.getSigv4aSigner(); + const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4; + if (CrtSignerV4 && signer instanceof CrtSignerV4) { + return signer.presign(originalRequest, options); + } else { + throw new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`); + } + } + return this.sigv4Signer.presign(originalRequest, options); + } + async presignWithCredentials(originalRequest, credentials, options = {}) { + if (options.signingRegion === "*") { + throw new Error("Method presignWithCredentials is not supported for [signingRegion=*]."); + } + return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options); + } + getSigv4aSigner() { + if (!this.sigv4aSigner) { + const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4; + const JsSigV4aSigner = signatureV4.signatureV4aContainer.SignatureV4a; + if (this.signerOptions.runtime === "node") { + if (!CrtSignerV4 && !JsSigV4aSigner) { + throw new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt"); + } + if (CrtSignerV4 && typeof CrtSignerV4 === "function") { + this.sigv4aSigner = new CrtSignerV4({ + ...this.signerOptions, + signingAlgorithm: 1 + }); + } else if (JsSigV4aSigner && typeof JsSigV4aSigner === "function") { + this.sigv4aSigner = new JsSigV4aSigner({ + ...this.signerOptions + }); + } else { + throw new Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt"); + } + } else { + if (!JsSigV4aSigner || typeof JsSigV4aSigner !== "function") { + throw new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a"); + } + this.sigv4aSigner = new JsSigV4aSigner({ + ...this.signerOptions + }); + } + } + return this.sigv4aSigner; + } + }; + exports2.SignatureV4MultiRegion = SignatureV4MultiRegion; + exports2.signatureV4CrtContainer = signatureV4CrtContainer; + } +}); + +// node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js +var require_dist_cjs48 = __commonJS({ + "node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js"(exports2) { + "use strict"; + var utilEndpoints = require_dist_cjs33(); + var urlParser = require_dist_cjs35(); + var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { + if (allowSubDomains) { + for (const label of value.split(".")) { + if (!isVirtualHostableS3Bucket(label)) { + return false; + } + } + return true; + } + if (!utilEndpoints.isValidHostLabel(value)) { + return false; + } + if (value.length < 3 || value.length > 63) { + return false; + } + if (value !== value.toLowerCase()) { + return false; + } + if (utilEndpoints.isIpAddress(value)) { + return false; + } + return true; + }; + var ARN_DELIMITER = ":"; + var RESOURCE_DELIMITER = "/"; + var parseArn = (value) => { + const segments = value.split(ARN_DELIMITER); + if (segments.length < 6) + return null; + const [arn, partition2, service, region, accountId, ...resourcePath] = segments; + if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "") + return null; + const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat(); + return { + partition: partition2, + service, + region, + accountId, + resourceId + }; + }; + var partitions = [ + { + id: "aws", + outputs: { + dnsSuffix: "amazonaws.com", + dualStackDnsSuffix: "api.aws", + implicitGlobalRegion: "us-east-1", + name: "aws", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", + regions: { + "af-south-1": { + description: "Africa (Cape Town)" + }, + "ap-east-1": { + description: "Asia Pacific (Hong Kong)" + }, + "ap-east-2": { + description: "Asia Pacific (Taipei)" + }, + "ap-northeast-1": { + description: "Asia Pacific (Tokyo)" + }, + "ap-northeast-2": { + description: "Asia Pacific (Seoul)" + }, + "ap-northeast-3": { + description: "Asia Pacific (Osaka)" + }, + "ap-south-1": { + description: "Asia Pacific (Mumbai)" + }, + "ap-south-2": { + description: "Asia Pacific (Hyderabad)" + }, + "ap-southeast-1": { + description: "Asia Pacific (Singapore)" + }, + "ap-southeast-2": { + description: "Asia Pacific (Sydney)" + }, + "ap-southeast-3": { + description: "Asia Pacific (Jakarta)" + }, + "ap-southeast-4": { + description: "Asia Pacific (Melbourne)" + }, + "ap-southeast-5": { + description: "Asia Pacific (Malaysia)" + }, + "ap-southeast-6": { + description: "Asia Pacific (New Zealand)" + }, + "ap-southeast-7": { + description: "Asia Pacific (Thailand)" + }, + "aws-global": { + description: "aws global region" + }, + "ca-central-1": { + description: "Canada (Central)" + }, + "ca-west-1": { + description: "Canada West (Calgary)" + }, + "eu-central-1": { + description: "Europe (Frankfurt)" + }, + "eu-central-2": { + description: "Europe (Zurich)" + }, + "eu-north-1": { + description: "Europe (Stockholm)" + }, + "eu-south-1": { + description: "Europe (Milan)" + }, + "eu-south-2": { + description: "Europe (Spain)" + }, + "eu-west-1": { + description: "Europe (Ireland)" + }, + "eu-west-2": { + description: "Europe (London)" + }, + "eu-west-3": { + description: "Europe (Paris)" + }, + "il-central-1": { + description: "Israel (Tel Aviv)" + }, + "me-central-1": { + description: "Middle East (UAE)" + }, + "me-south-1": { + description: "Middle East (Bahrain)" + }, + "mx-central-1": { + description: "Mexico (Central)" + }, + "sa-east-1": { + description: "South America (Sao Paulo)" + }, + "us-east-1": { + description: "US East (N. Virginia)" + }, + "us-east-2": { + description: "US East (Ohio)" + }, + "us-west-1": { + description: "US West (N. California)" + }, + "us-west-2": { + description: "US West (Oregon)" + } + } + }, + { + id: "aws-cn", + outputs: { + dnsSuffix: "amazonaws.com.cn", + dualStackDnsSuffix: "api.amazonwebservices.com.cn", + implicitGlobalRegion: "cn-northwest-1", + name: "aws-cn", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^cn\\-\\w+\\-\\d+$", + regions: { + "aws-cn-global": { + description: "aws-cn global region" + }, + "cn-north-1": { + description: "China (Beijing)" + }, + "cn-northwest-1": { + description: "China (Ningxia)" + } + } + }, + { + id: "aws-eusc", + outputs: { + dnsSuffix: "amazonaws.eu", + dualStackDnsSuffix: "api.amazonwebservices.eu", + implicitGlobalRegion: "eusc-de-east-1", + name: "aws-eusc", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$", + regions: { + "eusc-de-east-1": { + description: "AWS European Sovereign Cloud (Germany)" + } + } + }, + { + id: "aws-iso", + outputs: { + dnsSuffix: "c2s.ic.gov", + dualStackDnsSuffix: "api.aws.ic.gov", + implicitGlobalRegion: "us-iso-east-1", + name: "aws-iso", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-iso\\-\\w+\\-\\d+$", + regions: { + "aws-iso-global": { + description: "aws-iso global region" + }, + "us-iso-east-1": { + description: "US ISO East" + }, + "us-iso-west-1": { + description: "US ISO WEST" + } + } + }, + { + id: "aws-iso-b", + outputs: { + dnsSuffix: "sc2s.sgov.gov", + dualStackDnsSuffix: "api.aws.scloud", + implicitGlobalRegion: "us-isob-east-1", + name: "aws-iso-b", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-isob\\-\\w+\\-\\d+$", + regions: { + "aws-iso-b-global": { + description: "aws-iso-b global region" + }, + "us-isob-east-1": { + description: "US ISOB East (Ohio)" + }, + "us-isob-west-1": { + description: "US ISOB West" + } + } + }, + { + id: "aws-iso-e", + outputs: { + dnsSuffix: "cloud.adc-e.uk", + dualStackDnsSuffix: "api.cloud-aws.adc-e.uk", + implicitGlobalRegion: "eu-isoe-west-1", + name: "aws-iso-e", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", + regions: { + "aws-iso-e-global": { + description: "aws-iso-e global region" + }, + "eu-isoe-west-1": { + description: "EU ISOE West" + } + } + }, + { + id: "aws-iso-f", + outputs: { + dnsSuffix: "csp.hci.ic.gov", + dualStackDnsSuffix: "api.aws.hci.ic.gov", + implicitGlobalRegion: "us-isof-south-1", + name: "aws-iso-f", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + regions: { + "aws-iso-f-global": { + description: "aws-iso-f global region" + }, + "us-isof-east-1": { + description: "US ISOF EAST" + }, + "us-isof-south-1": { + description: "US ISOF SOUTH" + } + } + }, + { + id: "aws-us-gov", + outputs: { + dnsSuffix: "amazonaws.com", + dualStackDnsSuffix: "api.aws", + implicitGlobalRegion: "us-gov-west-1", + name: "aws-us-gov", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", + regions: { + "aws-us-gov-global": { + description: "aws-us-gov global region" + }, + "us-gov-east-1": { + description: "AWS GovCloud (US-East)" + }, + "us-gov-west-1": { + description: "AWS GovCloud (US-West)" + } + } + } + ]; + var version = "1.1"; + var partitionsInfo = { + partitions, + version + }; + var selectedPartitionsInfo = partitionsInfo; + var selectedUserAgentPrefix = ""; + var partition = (value) => { + const { partitions: partitions2 } = selectedPartitionsInfo; + for (const partition2 of partitions2) { + const { regions, outputs } = partition2; + for (const [region, regionData] of Object.entries(regions)) { + if (region === value) { + return { + ...outputs, + ...regionData + }; + } + } + } + for (const partition2 of partitions2) { + const { regionRegex, outputs } = partition2; + if (new RegExp(regionRegex).test(value)) { + return { + ...outputs + }; + } + } + const DEFAULT_PARTITION = partitions2.find((partition2) => partition2.id === "aws"); + if (!DEFAULT_PARTITION) { + throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist."); + } + return { + ...DEFAULT_PARTITION.outputs + }; + }; + var setPartitionInfo = (partitionsInfo2, userAgentPrefix = "") => { + selectedPartitionsInfo = partitionsInfo2; + selectedUserAgentPrefix = userAgentPrefix; + }; + var useDefaultPartitionInfo = () => { + setPartitionInfo(partitionsInfo, ""); + }; + var getUserAgentPrefix = () => selectedUserAgentPrefix; + var awsEndpointFunctions4 = { + isVirtualHostableS3Bucket, + parseArn, + partition + }; + utilEndpoints.customEndpointFunctions.aws = awsEndpointFunctions4; + var resolveDefaultAwsRegionalEndpointsConfig = (input) => { + if (typeof input.endpointProvider !== "function") { + throw new Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client."); + } + const { endpoint } = input; + if (endpoint === void 0) { + input.endpoint = async () => { + return toEndpointV1(input.endpointProvider({ + Region: typeof input.region === "function" ? await input.region() : input.region, + UseDualStack: typeof input.useDualstackEndpoint === "function" ? await input.useDualstackEndpoint() : input.useDualstackEndpoint, + UseFIPS: typeof input.useFipsEndpoint === "function" ? await input.useFipsEndpoint() : input.useFipsEndpoint, + Endpoint: void 0 + }, { logger: input.logger })); + }; + } + return input; + }; + var toEndpointV1 = (endpoint) => urlParser.parseUrl(endpoint.url); + Object.defineProperty(exports2, "EndpointError", { + enumerable: true, + get: function() { + return utilEndpoints.EndpointError; + } + }); + Object.defineProperty(exports2, "isIpAddress", { + enumerable: true, + get: function() { + return utilEndpoints.isIpAddress; + } + }); + Object.defineProperty(exports2, "resolveEndpoint", { + enumerable: true, + get: function() { + return utilEndpoints.resolveEndpoint; + } + }); + exports2.awsEndpointFunctions = awsEndpointFunctions4; + exports2.getUserAgentPrefix = getUserAgentPrefix; + exports2.partition = partition; + exports2.resolveDefaultAwsRegionalEndpointsConfig = resolveDefaultAwsRegionalEndpointsConfig; + exports2.setPartitionInfo = setPartitionInfo; + exports2.toEndpointV1 = toEndpointV1; + exports2.useDefaultPartitionInfo = useDefaultPartitionInfo; + } +}); + +// node_modules/@aws-sdk/client-s3/dist-cjs/endpoint/ruleset.js +var require_ruleset = __commonJS({ + "node_modules/@aws-sdk/client-s3/dist-cjs/endpoint/ruleset.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ruleSet = void 0; + var cs = "required"; + var ct = "type"; + var cu = "rules"; + var cv = "conditions"; + var cw = "fn"; + var cx = "argv"; + var cy = "ref"; + var cz = "assign"; + var cA = "url"; + var cB = "properties"; + var cC = "backend"; + var cD = "authSchemes"; + var cE = "disableDoubleEncoding"; + var cF = "signingName"; + var cG = "signingRegion"; + var cH = "headers"; + var cI = "signingRegionSet"; + var a4 = 6; + var b4 = false; + var c4 = true; + var d4 = "isSet"; + var e4 = "booleanEquals"; + var f4 = "error"; + var g4 = "aws.partition"; + var h4 = "stringEquals"; + var i4 = "getAttr"; + var j4 = "name"; + var k4 = "substring"; + var l4 = "bucketSuffix"; + var m4 = "parseURL"; + var n4 = "endpoint"; + var o4 = "tree"; + var p4 = "aws.isVirtualHostableS3Bucket"; + var q4 = "{url#scheme}://{Bucket}.{url#authority}{url#path}"; + var r4 = "not"; + var s4 = "accessPointSuffix"; + var t4 = "{url#scheme}://{url#authority}{url#path}"; + var u4 = "hardwareType"; + var v4 = "regionPrefix"; + var w4 = "bucketAliasSuffix"; + var x4 = "outpostId"; + var y2 = "isValidHostLabel"; + var z2 = "sigv4a"; + var A2 = "s3-outposts"; + var B2 = "s3"; + var C2 = "{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}"; + var D2 = "https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}"; + var E2 = "https://{Bucket}.s3.{partitionResult#dnsSuffix}"; + var F2 = "aws.parseArn"; + var G2 = "bucketArn"; + var H2 = "arnType"; + var I2 = ""; + var J2 = "s3-object-lambda"; + var K = "accesspoint"; + var L = "accessPointName"; + var M = "{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}"; + var N = "mrapPartition"; + var O = "outpostType"; + var P = "arnPrefix"; + var Q = "{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}"; + var R = "https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}"; + var S = "https://s3.{partitionResult#dnsSuffix}"; + var T = { [cs]: false, [ct]: "string" }; + var U = { [cs]: true, "default": false, [ct]: "boolean" }; + var V = { [cs]: false, [ct]: "boolean" }; + var W = { [cw]: e4, [cx]: [{ [cy]: "Accelerate" }, true] }; + var X = { [cw]: e4, [cx]: [{ [cy]: "UseFIPS" }, true] }; + var Y = { [cw]: e4, [cx]: [{ [cy]: "UseDualStack" }, true] }; + var Z = { [cw]: d4, [cx]: [{ [cy]: "Endpoint" }] }; + var aa = { [cw]: g4, [cx]: [{ [cy]: "Region" }], [cz]: "partitionResult" }; + var ab = { [cw]: h4, [cx]: [{ [cw]: i4, [cx]: [{ [cy]: "partitionResult" }, j4] }, "aws-cn"] }; + var ac = { [cw]: d4, [cx]: [{ [cy]: "Bucket" }] }; + var ad = { [cy]: "Bucket" }; + var ae = { [cv]: [W], [f4]: "S3Express does not support S3 Accelerate.", [ct]: f4 }; + var af = { [cv]: [Z, { [cw]: m4, [cx]: [{ [cy]: "Endpoint" }], [cz]: "url" }], [cu]: [{ [cv]: [{ [cw]: d4, [cx]: [{ [cy]: "DisableS3ExpressSessionAuth" }] }, { [cw]: e4, [cx]: [{ [cy]: "DisableS3ExpressSessionAuth" }, true] }], [cu]: [{ [cv]: [{ [cw]: e4, [cx]: [{ [cw]: i4, [cx]: [{ [cy]: "url" }, "isIp"] }, true] }], [cu]: [{ [cv]: [{ [cw]: "uriEncode", [cx]: [ad], [cz]: "uri_encoded_bucket" }], [cu]: [{ [n4]: { [cA]: "{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}", [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j4]: "sigv4", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n4 }], [ct]: o4 }], [ct]: o4 }, { [cv]: [{ [cw]: p4, [cx]: [ad, false] }], [cu]: [{ [n4]: { [cA]: q4, [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j4]: "sigv4", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n4 }], [ct]: o4 }, { [f4]: "S3Express bucket name is not a valid virtual hostable name.", [ct]: f4 }], [ct]: o4 }, { [cv]: [{ [cw]: e4, [cx]: [{ [cw]: i4, [cx]: [{ [cy]: "url" }, "isIp"] }, true] }], [cu]: [{ [cv]: [{ [cw]: "uriEncode", [cx]: [ad], [cz]: "uri_encoded_bucket" }], [cu]: [{ [n4]: { [cA]: "{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}", [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j4]: "sigv4-s3express", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n4 }], [ct]: o4 }], [ct]: o4 }, { [cv]: [{ [cw]: p4, [cx]: [ad, false] }], [cu]: [{ [n4]: { [cA]: q4, [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j4]: "sigv4-s3express", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n4 }], [ct]: o4 }, { [f4]: "S3Express bucket name is not a valid virtual hostable name.", [ct]: f4 }], [ct]: o4 }; + var ag = { [cw]: m4, [cx]: [{ [cy]: "Endpoint" }], [cz]: "url" }; + var ah = { [cw]: e4, [cx]: [{ [cw]: i4, [cx]: [{ [cy]: "url" }, "isIp"] }, true] }; + var ai = { [cy]: "url" }; + var aj = { [cw]: "uriEncode", [cx]: [ad], [cz]: "uri_encoded_bucket" }; + var ak = { [cC]: "S3Express", [cD]: [{ [cE]: true, [j4]: "sigv4", [cF]: "s3express", [cG]: "{Region}" }] }; + var al = {}; + var am = { [cw]: p4, [cx]: [ad, false] }; + var an = { [f4]: "S3Express bucket name is not a valid virtual hostable name.", [ct]: f4 }; + var ao = { [cw]: d4, [cx]: [{ [cy]: "UseS3ExpressControlEndpoint" }] }; + var ap = { [cw]: e4, [cx]: [{ [cy]: "UseS3ExpressControlEndpoint" }, true] }; + var aq = { [cw]: r4, [cx]: [Z] }; + var ar = { [cw]: e4, [cx]: [{ [cy]: "UseDualStack" }, false] }; + var as = { [cw]: e4, [cx]: [{ [cy]: "UseFIPS" }, false] }; + var at = { [f4]: "Unrecognized S3Express bucket name format.", [ct]: f4 }; + var au = { [cw]: r4, [cx]: [ac] }; + var av = { [cy]: u4 }; + var aw = { [cv]: [aq], [f4]: "Expected a endpoint to be specified but no endpoint was found", [ct]: f4 }; + var ax = { [cD]: [{ [cE]: true, [j4]: z2, [cF]: A2, [cI]: ["*"] }, { [cE]: true, [j4]: "sigv4", [cF]: A2, [cG]: "{Region}" }] }; + var ay = { [cw]: e4, [cx]: [{ [cy]: "ForcePathStyle" }, false] }; + var az = { [cy]: "ForcePathStyle" }; + var aA = { [cw]: e4, [cx]: [{ [cy]: "Accelerate" }, false] }; + var aB = { [cw]: h4, [cx]: [{ [cy]: "Region" }, "aws-global"] }; + var aC = { [cD]: [{ [cE]: true, [j4]: "sigv4", [cF]: B2, [cG]: "us-east-1" }] }; + var aD = { [cw]: r4, [cx]: [aB] }; + var aE = { [cw]: e4, [cx]: [{ [cy]: "UseGlobalEndpoint" }, true] }; + var aF = { [cA]: "https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: { [cD]: [{ [cE]: true, [j4]: "sigv4", [cF]: B2, [cG]: "{Region}" }] }, [cH]: {} }; + var aG = { [cD]: [{ [cE]: true, [j4]: "sigv4", [cF]: B2, [cG]: "{Region}" }] }; + var aH = { [cw]: e4, [cx]: [{ [cy]: "UseGlobalEndpoint" }, false] }; + var aI = { [cA]: "https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; + var aJ = { [cA]: "https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; + var aK = { [cA]: "https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; + var aL = { [cw]: e4, [cx]: [{ [cw]: i4, [cx]: [ai, "isIp"] }, false] }; + var aM = { [cA]: C2, [cB]: aG, [cH]: {} }; + var aN = { [cA]: q4, [cB]: aG, [cH]: {} }; + var aO = { [n4]: aN, [ct]: n4 }; + var aP = { [cA]: D2, [cB]: aG, [cH]: {} }; + var aQ = { [cA]: "https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; + var aR = { [f4]: "Invalid region: region was not a valid DNS name.", [ct]: f4 }; + var aS = { [cy]: G2 }; + var aT = { [cy]: H2 }; + var aU = { [cw]: i4, [cx]: [aS, "service"] }; + var aV = { [cy]: L }; + var aW = { [cv]: [Y], [f4]: "S3 Object Lambda does not support Dual-stack", [ct]: f4 }; + var aX = { [cv]: [W], [f4]: "S3 Object Lambda does not support S3 Accelerate", [ct]: f4 }; + var aY = { [cv]: [{ [cw]: d4, [cx]: [{ [cy]: "DisableAccessPoints" }] }, { [cw]: e4, [cx]: [{ [cy]: "DisableAccessPoints" }, true] }], [f4]: "Access points are not supported for this operation", [ct]: f4 }; + var aZ = { [cv]: [{ [cw]: d4, [cx]: [{ [cy]: "UseArnRegion" }] }, { [cw]: e4, [cx]: [{ [cy]: "UseArnRegion" }, false] }, { [cw]: r4, [cx]: [{ [cw]: h4, [cx]: [{ [cw]: i4, [cx]: [aS, "region"] }, "{Region}"] }] }], [f4]: "Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`", [ct]: f4 }; + var ba = { [cw]: i4, [cx]: [{ [cy]: "bucketPartition" }, j4] }; + var bb = { [cw]: i4, [cx]: [aS, "accountId"] }; + var bc = { [cD]: [{ [cE]: true, [j4]: "sigv4", [cF]: J2, [cG]: "{bucketArn#region}" }] }; + var bd = { [f4]: "Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`", [ct]: f4 }; + var be = { [f4]: "Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`", [ct]: f4 }; + var bf = { [f4]: "Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)", [ct]: f4 }; + var bg = { [f4]: "Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`", [ct]: f4 }; + var bh = { [f4]: "Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.", [ct]: f4 }; + var bi = { [f4]: "Invalid ARN: Expected a resource of the format `accesspoint:` but no name was provided", [ct]: f4 }; + var bj = { [cD]: [{ [cE]: true, [j4]: "sigv4", [cF]: B2, [cG]: "{bucketArn#region}" }] }; + var bk = { [cD]: [{ [cE]: true, [j4]: z2, [cF]: A2, [cI]: ["*"] }, { [cE]: true, [j4]: "sigv4", [cF]: A2, [cG]: "{bucketArn#region}" }] }; + var bl = { [cw]: F2, [cx]: [ad] }; + var bm = { [cA]: "https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: aG, [cH]: {} }; + var bn = { [cA]: "https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: aG, [cH]: {} }; + var bo = { [cA]: "https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: aG, [cH]: {} }; + var bp = { [cA]: Q, [cB]: aG, [cH]: {} }; + var bq = { [cA]: "https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: aG, [cH]: {} }; + var br = { [cy]: "UseObjectLambdaEndpoint" }; + var bs = { [cD]: [{ [cE]: true, [j4]: "sigv4", [cF]: J2, [cG]: "{Region}" }] }; + var bt = { [cA]: "https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; + var bu = { [cA]: "https://s3-fips.{Region}.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; + var bv = { [cA]: "https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; + var bw = { [cA]: t4, [cB]: aG, [cH]: {} }; + var bx = { [cA]: "https://s3.{Region}.{partitionResult#dnsSuffix}", [cB]: aG, [cH]: {} }; + var by = [{ [cy]: "Region" }]; + var bz = [{ [cy]: "Endpoint" }]; + var bA = [ad]; + var bB = [W]; + var bC = [Z, ag]; + var bD = [{ [cw]: d4, [cx]: [{ [cy]: "DisableS3ExpressSessionAuth" }] }, { [cw]: e4, [cx]: [{ [cy]: "DisableS3ExpressSessionAuth" }, true] }]; + var bE = [aj]; + var bF = [am]; + var bG = [aa]; + var bH = [X, Y]; + var bI = [X, ar]; + var bJ = [as, Y]; + var bK = [as, ar]; + var bL = [{ [cw]: k4, [cx]: [ad, 6, 14, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k4, [cx]: [ad, 14, 16, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h4, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; + var bM = [{ [cv]: [X, Y], [n4]: { [cA]: "https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: {} }, [ct]: n4 }, { [cv]: bI, [n4]: { [cA]: "https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: {} }, [ct]: n4 }, { [cv]: bJ, [n4]: { [cA]: "https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: {} }, [ct]: n4 }, { [cv]: bK, [n4]: { [cA]: "https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: {} }, [ct]: n4 }]; + var bN = [{ [cw]: k4, [cx]: [ad, 6, 15, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k4, [cx]: [ad, 15, 17, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h4, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; + var bO = [{ [cw]: k4, [cx]: [ad, 6, 19, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k4, [cx]: [ad, 19, 21, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h4, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; + var bP = [{ [cw]: k4, [cx]: [ad, 6, 20, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k4, [cx]: [ad, 20, 22, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h4, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; + var bQ = [{ [cw]: k4, [cx]: [ad, 6, 26, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k4, [cx]: [ad, 26, 28, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h4, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; + var bR = [{ [cv]: [X, Y], [n4]: { [cA]: "https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j4]: "sigv4-s3express", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n4 }, { [cv]: bI, [n4]: { [cA]: "https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}", [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j4]: "sigv4-s3express", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n4 }, { [cv]: bJ, [n4]: { [cA]: "https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j4]: "sigv4-s3express", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n4 }, { [cv]: bK, [n4]: { [cA]: "https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}", [cB]: { [cC]: "S3Express", [cD]: [{ [cE]: true, [j4]: "sigv4-s3express", [cF]: "s3express", [cG]: "{Region}" }] }, [cH]: {} }, [ct]: n4 }]; + var bS = [ad, 0, 7, true]; + var bT = [{ [cw]: k4, [cx]: [ad, 7, 15, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k4, [cx]: [ad, 15, 17, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h4, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; + var bU = [{ [cw]: k4, [cx]: [ad, 7, 16, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k4, [cx]: [ad, 16, 18, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h4, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; + var bV = [{ [cw]: k4, [cx]: [ad, 7, 20, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k4, [cx]: [ad, 20, 22, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h4, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; + var bW = [{ [cw]: k4, [cx]: [ad, 7, 21, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k4, [cx]: [ad, 21, 23, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h4, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; + var bX = [{ [cw]: k4, [cx]: [ad, 7, 27, true], [cz]: "s3expressAvailabilityZoneId" }, { [cw]: k4, [cx]: [ad, 27, 29, true], [cz]: "s3expressAvailabilityZoneDelim" }, { [cw]: h4, [cx]: [{ [cy]: "s3expressAvailabilityZoneDelim" }, "--"] }]; + var bY = [ac]; + var bZ = [{ [cw]: y2, [cx]: [{ [cy]: x4 }, false] }]; + var ca = [{ [cw]: h4, [cx]: [{ [cy]: v4 }, "beta"] }]; + var cb = ["*"]; + var cc = [{ [cw]: y2, [cx]: [{ [cy]: "Region" }, false] }]; + var cd = [{ [cw]: h4, [cx]: [{ [cy]: "Region" }, "us-east-1"] }]; + var ce = [{ [cw]: h4, [cx]: [aT, K] }]; + var cf = [{ [cw]: i4, [cx]: [aS, "resourceId[1]"], [cz]: L }, { [cw]: r4, [cx]: [{ [cw]: h4, [cx]: [aV, I2] }] }]; + var cg = [aS, "resourceId[1]"]; + var ch = [Y]; + var ci = [{ [cw]: r4, [cx]: [{ [cw]: h4, [cx]: [{ [cw]: i4, [cx]: [aS, "region"] }, I2] }] }]; + var cj = [{ [cw]: r4, [cx]: [{ [cw]: d4, [cx]: [{ [cw]: i4, [cx]: [aS, "resourceId[2]"] }] }] }]; + var ck = [aS, "resourceId[2]"]; + var cl = [{ [cw]: g4, [cx]: [{ [cw]: i4, [cx]: [aS, "region"] }], [cz]: "bucketPartition" }]; + var cm = [{ [cw]: h4, [cx]: [ba, { [cw]: i4, [cx]: [{ [cy]: "partitionResult" }, j4] }] }]; + var cn = [{ [cw]: y2, [cx]: [{ [cw]: i4, [cx]: [aS, "region"] }, true] }]; + var co = [{ [cw]: y2, [cx]: [bb, false] }]; + var cp = [{ [cw]: y2, [cx]: [aV, false] }]; + var cq = [X]; + var cr = [{ [cw]: y2, [cx]: [{ [cy]: "Region" }, true] }]; + var _data4 = { version: "1.0", parameters: { Bucket: T, Region: T, UseFIPS: U, UseDualStack: U, Endpoint: T, ForcePathStyle: U, Accelerate: U, UseGlobalEndpoint: U, UseObjectLambdaEndpoint: V, Key: T, Prefix: T, CopySource: T, DisableAccessPoints: V, DisableMultiRegionAccessPoints: U, UseArnRegion: V, UseS3ExpressControlEndpoint: V, DisableS3ExpressSessionAuth: V }, [cu]: [{ [cv]: [{ [cw]: d4, [cx]: by }], [cu]: [{ [cv]: [W, X], error: "Accelerate cannot be used with FIPS", [ct]: f4 }, { [cv]: [Y, Z], error: "Cannot set dual-stack in combination with a custom endpoint.", [ct]: f4 }, { [cv]: [Z, X], error: "A custom endpoint cannot be combined with FIPS", [ct]: f4 }, { [cv]: [Z, W], error: "A custom endpoint cannot be combined with S3 Accelerate", [ct]: f4 }, { [cv]: [X, aa, ab], error: "Partition does not support FIPS", [ct]: f4 }, { [cv]: [ac, { [cw]: k4, [cx]: [ad, 0, a4, c4], [cz]: l4 }, { [cw]: h4, [cx]: [{ [cy]: l4 }, "--x-s3"] }], [cu]: [ae, af, { [cv]: [ao, ap], [cu]: [{ [cv]: bG, [cu]: [{ [cv]: [aj, aq], [cu]: [{ [cv]: bH, endpoint: { [cA]: "https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: ak, [cH]: al }, [ct]: n4 }, { [cv]: bI, endpoint: { [cA]: "https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: ak, [cH]: al }, [ct]: n4 }, { [cv]: bJ, endpoint: { [cA]: "https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: ak, [cH]: al }, [ct]: n4 }, { [cv]: bK, endpoint: { [cA]: "https://s3express-control.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: ak, [cH]: al }, [ct]: n4 }], [ct]: o4 }], [ct]: o4 }], [ct]: o4 }, { [cv]: bF, [cu]: [{ [cv]: bG, [cu]: [{ [cv]: bD, [cu]: [{ [cv]: bL, [cu]: bM, [ct]: o4 }, { [cv]: bN, [cu]: bM, [ct]: o4 }, { [cv]: bO, [cu]: bM, [ct]: o4 }, { [cv]: bP, [cu]: bM, [ct]: o4 }, { [cv]: bQ, [cu]: bM, [ct]: o4 }, at], [ct]: o4 }, { [cv]: bL, [cu]: bR, [ct]: o4 }, { [cv]: bN, [cu]: bR, [ct]: o4 }, { [cv]: bO, [cu]: bR, [ct]: o4 }, { [cv]: bP, [cu]: bR, [ct]: o4 }, { [cv]: bQ, [cu]: bR, [ct]: o4 }, at], [ct]: o4 }], [ct]: o4 }, an], [ct]: o4 }, { [cv]: [ac, { [cw]: k4, [cx]: bS, [cz]: s4 }, { [cw]: h4, [cx]: [{ [cy]: s4 }, "--xa-s3"] }], [cu]: [ae, af, { [cv]: bF, [cu]: [{ [cv]: bG, [cu]: [{ [cv]: bD, [cu]: [{ [cv]: bT, [cu]: bM, [ct]: o4 }, { [cv]: bU, [cu]: bM, [ct]: o4 }, { [cv]: bV, [cu]: bM, [ct]: o4 }, { [cv]: bW, [cu]: bM, [ct]: o4 }, { [cv]: bX, [cu]: bM, [ct]: o4 }, at], [ct]: o4 }, { [cv]: bT, [cu]: bR, [ct]: o4 }, { [cv]: bU, [cu]: bR, [ct]: o4 }, { [cv]: bV, [cu]: bR, [ct]: o4 }, { [cv]: bW, [cu]: bR, [ct]: o4 }, { [cv]: bX, [cu]: bR, [ct]: o4 }, at], [ct]: o4 }], [ct]: o4 }, an], [ct]: o4 }, { [cv]: [au, ao, ap], [cu]: [{ [cv]: bG, [cu]: [{ [cv]: bC, endpoint: { [cA]: t4, [cB]: ak, [cH]: al }, [ct]: n4 }, { [cv]: bH, endpoint: { [cA]: "https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: al }, [ct]: n4 }, { [cv]: bI, endpoint: { [cA]: "https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: al }, [ct]: n4 }, { [cv]: bJ, endpoint: { [cA]: "https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: al }, [ct]: n4 }, { [cv]: bK, endpoint: { [cA]: "https://s3express-control.{Region}.{partitionResult#dnsSuffix}", [cB]: ak, [cH]: al }, [ct]: n4 }], [ct]: o4 }], [ct]: o4 }, { [cv]: [ac, { [cw]: k4, [cx]: [ad, 49, 50, c4], [cz]: u4 }, { [cw]: k4, [cx]: [ad, 8, 12, c4], [cz]: v4 }, { [cw]: k4, [cx]: bS, [cz]: w4 }, { [cw]: k4, [cx]: [ad, 32, 49, c4], [cz]: x4 }, { [cw]: g4, [cx]: by, [cz]: "regionPartition" }, { [cw]: h4, [cx]: [{ [cy]: w4 }, "--op-s3"] }], [cu]: [{ [cv]: bZ, [cu]: [{ [cv]: bF, [cu]: [{ [cv]: [{ [cw]: h4, [cx]: [av, "e"] }], [cu]: [{ [cv]: ca, [cu]: [aw, { [cv]: bC, endpoint: { [cA]: "https://{Bucket}.ec2.{url#authority}", [cB]: ax, [cH]: al }, [ct]: n4 }], [ct]: o4 }, { endpoint: { [cA]: "https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}", [cB]: ax, [cH]: al }, [ct]: n4 }], [ct]: o4 }, { [cv]: [{ [cw]: h4, [cx]: [av, "o"] }], [cu]: [{ [cv]: ca, [cu]: [aw, { [cv]: bC, endpoint: { [cA]: "https://{Bucket}.op-{outpostId}.{url#authority}", [cB]: ax, [cH]: al }, [ct]: n4 }], [ct]: o4 }, { endpoint: { [cA]: "https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}", [cB]: ax, [cH]: al }, [ct]: n4 }], [ct]: o4 }, { error: 'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"', [ct]: f4 }], [ct]: o4 }, { error: "Invalid Outposts Bucket alias - it must be a valid bucket name.", [ct]: f4 }], [ct]: o4 }, { error: "Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.", [ct]: f4 }], [ct]: o4 }, { [cv]: bY, [cu]: [{ [cv]: [Z, { [cw]: r4, [cx]: [{ [cw]: d4, [cx]: [{ [cw]: m4, [cx]: bz }] }] }], error: "Custom endpoint `{Endpoint}` was not a valid URI", [ct]: f4 }, { [cv]: [ay, am], [cu]: [{ [cv]: bG, [cu]: [{ [cv]: cc, [cu]: [{ [cv]: [W, ab], error: "S3 Accelerate cannot be used in this region", [ct]: f4 }, { [cv]: [Y, X, aA, aq, aB], endpoint: { [cA]: "https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [Y, X, aA, aq, aD, aE], [cu]: [{ endpoint: aF, [ct]: n4 }], [ct]: o4 }, { [cv]: [Y, X, aA, aq, aD, aH], endpoint: aF, [ct]: n4 }, { [cv]: [ar, X, aA, aq, aB], endpoint: { [cA]: "https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}", [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [ar, X, aA, aq, aD, aE], [cu]: [{ endpoint: aI, [ct]: n4 }], [ct]: o4 }, { [cv]: [ar, X, aA, aq, aD, aH], endpoint: aI, [ct]: n4 }, { [cv]: [Y, as, W, aq, aB], endpoint: { [cA]: "https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [Y, as, W, aq, aD, aE], [cu]: [{ endpoint: aJ, [ct]: n4 }], [ct]: o4 }, { [cv]: [Y, as, W, aq, aD, aH], endpoint: aJ, [ct]: n4 }, { [cv]: [Y, as, aA, aq, aB], endpoint: { [cA]: "https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [Y, as, aA, aq, aD, aE], [cu]: [{ endpoint: aK, [ct]: n4 }], [ct]: o4 }, { [cv]: [Y, as, aA, aq, aD, aH], endpoint: aK, [ct]: n4 }, { [cv]: [ar, as, aA, Z, ag, ah, aB], endpoint: { [cA]: C2, [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [ar, as, aA, Z, ag, aL, aB], endpoint: { [cA]: q4, [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [ar, as, aA, Z, ag, ah, aD, aE], [cu]: [{ [cv]: cd, endpoint: aM, [ct]: n4 }, { endpoint: aM, [ct]: n4 }], [ct]: o4 }, { [cv]: [ar, as, aA, Z, ag, aL, aD, aE], [cu]: [{ [cv]: cd, endpoint: aN, [ct]: n4 }, aO], [ct]: o4 }, { [cv]: [ar, as, aA, Z, ag, ah, aD, aH], endpoint: aM, [ct]: n4 }, { [cv]: [ar, as, aA, Z, ag, aL, aD, aH], endpoint: aN, [ct]: n4 }, { [cv]: [ar, as, W, aq, aB], endpoint: { [cA]: D2, [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [ar, as, W, aq, aD, aE], [cu]: [{ [cv]: cd, endpoint: aP, [ct]: n4 }, { endpoint: aP, [ct]: n4 }], [ct]: o4 }, { [cv]: [ar, as, W, aq, aD, aH], endpoint: aP, [ct]: n4 }, { [cv]: [ar, as, aA, aq, aB], endpoint: { [cA]: E2, [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [ar, as, aA, aq, aD, aE], [cu]: [{ [cv]: cd, endpoint: { [cA]: E2, [cB]: aG, [cH]: al }, [ct]: n4 }, { endpoint: aQ, [ct]: n4 }], [ct]: o4 }, { [cv]: [ar, as, aA, aq, aD, aH], endpoint: aQ, [ct]: n4 }], [ct]: o4 }, aR], [ct]: o4 }], [ct]: o4 }, { [cv]: [Z, ag, { [cw]: h4, [cx]: [{ [cw]: i4, [cx]: [ai, "scheme"] }, "http"] }, { [cw]: p4, [cx]: [ad, c4] }, ay, as, ar, aA], [cu]: [{ [cv]: bG, [cu]: [{ [cv]: cc, [cu]: [aO], [ct]: o4 }, aR], [ct]: o4 }], [ct]: o4 }, { [cv]: [ay, { [cw]: F2, [cx]: bA, [cz]: G2 }], [cu]: [{ [cv]: [{ [cw]: i4, [cx]: [aS, "resourceId[0]"], [cz]: H2 }, { [cw]: r4, [cx]: [{ [cw]: h4, [cx]: [aT, I2] }] }], [cu]: [{ [cv]: [{ [cw]: h4, [cx]: [aU, J2] }], [cu]: [{ [cv]: ce, [cu]: [{ [cv]: cf, [cu]: [aW, aX, { [cv]: ci, [cu]: [aY, { [cv]: cj, [cu]: [aZ, { [cv]: cl, [cu]: [{ [cv]: bG, [cu]: [{ [cv]: cm, [cu]: [{ [cv]: cn, [cu]: [{ [cv]: [{ [cw]: h4, [cx]: [bb, I2] }], error: "Invalid ARN: Missing account id", [ct]: f4 }, { [cv]: co, [cu]: [{ [cv]: cp, [cu]: [{ [cv]: bC, endpoint: { [cA]: M, [cB]: bc, [cH]: al }, [ct]: n4 }, { [cv]: cq, endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cB]: bc, [cH]: al }, [ct]: n4 }, { endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cB]: bc, [cH]: al }, [ct]: n4 }], [ct]: o4 }, bd], [ct]: o4 }, be], [ct]: o4 }, bf], [ct]: o4 }, bg], [ct]: o4 }], [ct]: o4 }], [ct]: o4 }, bh], [ct]: o4 }, { error: "Invalid ARN: bucket ARN is missing a region", [ct]: f4 }], [ct]: o4 }, bi], [ct]: o4 }, { error: "Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`", [ct]: f4 }], [ct]: o4 }, { [cv]: ce, [cu]: [{ [cv]: cf, [cu]: [{ [cv]: ci, [cu]: [{ [cv]: ce, [cu]: [{ [cv]: ci, [cu]: [aY, { [cv]: cj, [cu]: [aZ, { [cv]: cl, [cu]: [{ [cv]: bG, [cu]: [{ [cv]: [{ [cw]: h4, [cx]: [ba, "{partitionResult#name}"] }], [cu]: [{ [cv]: cn, [cu]: [{ [cv]: [{ [cw]: h4, [cx]: [aU, B2] }], [cu]: [{ [cv]: co, [cu]: [{ [cv]: cp, [cu]: [{ [cv]: bB, error: "Access Points do not support S3 Accelerate", [ct]: f4 }, { [cv]: bH, endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cB]: bj, [cH]: al }, [ct]: n4 }, { [cv]: bI, endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cB]: bj, [cH]: al }, [ct]: n4 }, { [cv]: bJ, endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cB]: bj, [cH]: al }, [ct]: n4 }, { [cv]: [as, ar, Z, ag], endpoint: { [cA]: M, [cB]: bj, [cH]: al }, [ct]: n4 }, { [cv]: bK, endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cB]: bj, [cH]: al }, [ct]: n4 }], [ct]: o4 }, bd], [ct]: o4 }, be], [ct]: o4 }, { error: "Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}", [ct]: f4 }], [ct]: o4 }, bf], [ct]: o4 }, bg], [ct]: o4 }], [ct]: o4 }], [ct]: o4 }, bh], [ct]: o4 }], [ct]: o4 }], [ct]: o4 }, { [cv]: [{ [cw]: y2, [cx]: [aV, c4] }], [cu]: [{ [cv]: ch, error: "S3 MRAP does not support dual-stack", [ct]: f4 }, { [cv]: cq, error: "S3 MRAP does not support FIPS", [ct]: f4 }, { [cv]: bB, error: "S3 MRAP does not support S3 Accelerate", [ct]: f4 }, { [cv]: [{ [cw]: e4, [cx]: [{ [cy]: "DisableMultiRegionAccessPoints" }, c4] }], error: "Invalid configuration: Multi-Region Access Point ARNs are disabled.", [ct]: f4 }, { [cv]: [{ [cw]: g4, [cx]: by, [cz]: N }], [cu]: [{ [cv]: [{ [cw]: h4, [cx]: [{ [cw]: i4, [cx]: [{ [cy]: N }, j4] }, { [cw]: i4, [cx]: [aS, "partition"] }] }], [cu]: [{ endpoint: { [cA]: "https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}", [cB]: { [cD]: [{ [cE]: c4, name: z2, [cF]: B2, [cI]: cb }] }, [cH]: al }, [ct]: n4 }], [ct]: o4 }, { error: "Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`", [ct]: f4 }], [ct]: o4 }], [ct]: o4 }, { error: "Invalid Access Point Name", [ct]: f4 }], [ct]: o4 }, bi], [ct]: o4 }, { [cv]: [{ [cw]: h4, [cx]: [aU, A2] }], [cu]: [{ [cv]: ch, error: "S3 Outposts does not support Dual-stack", [ct]: f4 }, { [cv]: cq, error: "S3 Outposts does not support FIPS", [ct]: f4 }, { [cv]: bB, error: "S3 Outposts does not support S3 Accelerate", [ct]: f4 }, { [cv]: [{ [cw]: d4, [cx]: [{ [cw]: i4, [cx]: [aS, "resourceId[4]"] }] }], error: "Invalid Arn: Outpost Access Point ARN contains sub resources", [ct]: f4 }, { [cv]: [{ [cw]: i4, [cx]: cg, [cz]: x4 }], [cu]: [{ [cv]: bZ, [cu]: [aZ, { [cv]: cl, [cu]: [{ [cv]: bG, [cu]: [{ [cv]: cm, [cu]: [{ [cv]: cn, [cu]: [{ [cv]: co, [cu]: [{ [cv]: [{ [cw]: i4, [cx]: ck, [cz]: O }], [cu]: [{ [cv]: [{ [cw]: i4, [cx]: [aS, "resourceId[3]"], [cz]: L }], [cu]: [{ [cv]: [{ [cw]: h4, [cx]: [{ [cy]: O }, K] }], [cu]: [{ [cv]: bC, endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}", [cB]: bk, [cH]: al }, [ct]: n4 }, { endpoint: { [cA]: "https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cB]: bk, [cH]: al }, [ct]: n4 }], [ct]: o4 }, { error: "Expected an outpost type `accesspoint`, found {outpostType}", [ct]: f4 }], [ct]: o4 }, { error: "Invalid ARN: expected an access point name", [ct]: f4 }], [ct]: o4 }, { error: "Invalid ARN: Expected a 4-component resource", [ct]: f4 }], [ct]: o4 }, be], [ct]: o4 }, bf], [ct]: o4 }, bg], [ct]: o4 }], [ct]: o4 }], [ct]: o4 }, { error: "Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`", [ct]: f4 }], [ct]: o4 }, { error: "Invalid ARN: The Outpost Id was not set", [ct]: f4 }], [ct]: o4 }, { error: "Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})", [ct]: f4 }], [ct]: o4 }, { error: "Invalid ARN: No ARN type specified", [ct]: f4 }], [ct]: o4 }, { [cv]: [{ [cw]: k4, [cx]: [ad, 0, 4, b4], [cz]: P }, { [cw]: h4, [cx]: [{ [cy]: P }, "arn:"] }, { [cw]: r4, [cx]: [{ [cw]: d4, [cx]: [bl] }] }], error: "Invalid ARN: `{Bucket}` was not a valid ARN", [ct]: f4 }, { [cv]: [{ [cw]: e4, [cx]: [az, c4] }, bl], error: "Path-style addressing cannot be used with ARN buckets", [ct]: f4 }, { [cv]: bE, [cu]: [{ [cv]: bG, [cu]: [{ [cv]: [aA], [cu]: [{ [cv]: [Y, aq, X, aB], endpoint: { [cA]: "https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [Y, aq, X, aD, aE], [cu]: [{ endpoint: bm, [ct]: n4 }], [ct]: o4 }, { [cv]: [Y, aq, X, aD, aH], endpoint: bm, [ct]: n4 }, { [cv]: [ar, aq, X, aB], endpoint: { [cA]: "https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [ar, aq, X, aD, aE], [cu]: [{ endpoint: bn, [ct]: n4 }], [ct]: o4 }, { [cv]: [ar, aq, X, aD, aH], endpoint: bn, [ct]: n4 }, { [cv]: [Y, aq, as, aB], endpoint: { [cA]: "https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [Y, aq, as, aD, aE], [cu]: [{ endpoint: bo, [ct]: n4 }], [ct]: o4 }, { [cv]: [Y, aq, as, aD, aH], endpoint: bo, [ct]: n4 }, { [cv]: [ar, Z, ag, as, aB], endpoint: { [cA]: Q, [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [ar, Z, ag, as, aD, aE], [cu]: [{ [cv]: cd, endpoint: bp, [ct]: n4 }, { endpoint: bp, [ct]: n4 }], [ct]: o4 }, { [cv]: [ar, Z, ag, as, aD, aH], endpoint: bp, [ct]: n4 }, { [cv]: [ar, aq, as, aB], endpoint: { [cA]: R, [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [ar, aq, as, aD, aE], [cu]: [{ [cv]: cd, endpoint: { [cA]: R, [cB]: aG, [cH]: al }, [ct]: n4 }, { endpoint: bq, [ct]: n4 }], [ct]: o4 }, { [cv]: [ar, aq, as, aD, aH], endpoint: bq, [ct]: n4 }], [ct]: o4 }, { error: "Path-style addressing cannot be used with S3 Accelerate", [ct]: f4 }], [ct]: o4 }], [ct]: o4 }], [ct]: o4 }, { [cv]: [{ [cw]: d4, [cx]: [br] }, { [cw]: e4, [cx]: [br, c4] }], [cu]: [{ [cv]: bG, [cu]: [{ [cv]: cr, [cu]: [aW, aX, { [cv]: bC, endpoint: { [cA]: t4, [cB]: bs, [cH]: al }, [ct]: n4 }, { [cv]: cq, endpoint: { [cA]: "https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}", [cB]: bs, [cH]: al }, [ct]: n4 }, { endpoint: { [cA]: "https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}", [cB]: bs, [cH]: al }, [ct]: n4 }], [ct]: o4 }, aR], [ct]: o4 }], [ct]: o4 }, { [cv]: [au], [cu]: [{ [cv]: bG, [cu]: [{ [cv]: cr, [cu]: [{ [cv]: [X, Y, aq, aB], endpoint: { [cA]: "https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [X, Y, aq, aD, aE], [cu]: [{ endpoint: bt, [ct]: n4 }], [ct]: o4 }, { [cv]: [X, Y, aq, aD, aH], endpoint: bt, [ct]: n4 }, { [cv]: [X, ar, aq, aB], endpoint: { [cA]: "https://s3-fips.us-east-1.{partitionResult#dnsSuffix}", [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [X, ar, aq, aD, aE], [cu]: [{ endpoint: bu, [ct]: n4 }], [ct]: o4 }, { [cv]: [X, ar, aq, aD, aH], endpoint: bu, [ct]: n4 }, { [cv]: [as, Y, aq, aB], endpoint: { [cA]: "https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [as, Y, aq, aD, aE], [cu]: [{ endpoint: bv, [ct]: n4 }], [ct]: o4 }, { [cv]: [as, Y, aq, aD, aH], endpoint: bv, [ct]: n4 }, { [cv]: [as, ar, Z, ag, aB], endpoint: { [cA]: t4, [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [as, ar, Z, ag, aD, aE], [cu]: [{ [cv]: cd, endpoint: bw, [ct]: n4 }, { endpoint: bw, [ct]: n4 }], [ct]: o4 }, { [cv]: [as, ar, Z, ag, aD, aH], endpoint: bw, [ct]: n4 }, { [cv]: [as, ar, aq, aB], endpoint: { [cA]: S, [cB]: aC, [cH]: al }, [ct]: n4 }, { [cv]: [as, ar, aq, aD, aE], [cu]: [{ [cv]: cd, endpoint: { [cA]: S, [cB]: aG, [cH]: al }, [ct]: n4 }, { endpoint: bx, [ct]: n4 }], [ct]: o4 }, { [cv]: [as, ar, aq, aD, aH], endpoint: bx, [ct]: n4 }], [ct]: o4 }, aR], [ct]: o4 }], [ct]: o4 }], [ct]: o4 }, { error: "A region must be set when sending requests to S3.", [ct]: f4 }] }; + exports2.ruleSet = _data4; + } +}); + +// node_modules/@aws-sdk/client-s3/dist-cjs/endpoint/endpointResolver.js +var require_endpointResolver = __commonJS({ + "node_modules/@aws-sdk/client-s3/dist-cjs/endpoint/endpointResolver.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.defaultEndpointResolver = void 0; + var util_endpoints_1 = require_dist_cjs48(); + var util_endpoints_2 = require_dist_cjs33(); + var ruleset_1 = require_ruleset(); + var cache4 = new util_endpoints_2.EndpointCache({ + size: 50, + params: [ + "Accelerate", + "Bucket", + "DisableAccessPoints", + "DisableMultiRegionAccessPoints", + "DisableS3ExpressSessionAuth", + "Endpoint", + "ForcePathStyle", + "Region", + "UseArnRegion", + "UseDualStack", + "UseFIPS", + "UseGlobalEndpoint", + "UseObjectLambdaEndpoint", + "UseS3ExpressControlEndpoint" + ] + }); + var defaultEndpointResolver4 = (endpointParams, context = {}) => { + return cache4.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { + endpointParams, + logger: context.logger + })); + }; + exports2.defaultEndpointResolver = defaultEndpointResolver4; + util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; + } +}); + +// node_modules/@aws-sdk/client-s3/dist-cjs/auth/httpAuthSchemeProvider.js +var require_httpAuthSchemeProvider = __commonJS({ + "node_modules/@aws-sdk/client-s3/dist-cjs/auth/httpAuthSchemeProvider.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.resolveHttpAuthSchemeConfig = exports2.defaultS3HttpAuthSchemeProvider = exports2.defaultS3HttpAuthSchemeParametersProvider = void 0; + var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); + var signature_v4_multi_region_1 = require_dist_cjs47(); + var middleware_endpoint_1 = require_dist_cjs43(); + var util_middleware_1 = require_dist_cjs4(); + var endpointResolver_1 = require_endpointResolver(); + var createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => { + if (!input) { + throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`"); + } + const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input); + const instructionsFn = (0, util_middleware_1.getSmithyContext)(context)?.commandInstance?.constructor?.getEndpointParameterInstructions; + if (!instructionsFn) { + throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`); + } + const endpointParameters = await (0, middleware_endpoint_1.resolveParams)(input, { getEndpointParameterInstructions: instructionsFn }, config); + return Object.assign(defaultParameters, endpointParameters); + }; + var _defaultS3HttpAuthSchemeParametersProvider = async (config, context, input) => { + return { + operation: (0, util_middleware_1.getSmithyContext)(context).operation, + region: await (0, util_middleware_1.normalizeProvider)(config.region)() || (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })() + }; + }; + exports2.defaultS3HttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultS3HttpAuthSchemeParametersProvider); + function createAwsAuthSigv4HttpAuthOption4(authParameters) { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "s3", + region: authParameters.region + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context + } + }) + }; + } + function createAwsAuthSigv4aHttpAuthOption(authParameters) { + return { + schemeId: "aws.auth#sigv4a", + signingProperties: { + name: "s3", + region: authParameters.region + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context + } + }) + }; + } + var createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver4, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => { + const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => { + const endpoint = defaultEndpointResolver4(authParameters); + const authSchemes = endpoint.properties?.authSchemes; + if (!authSchemes) { + return defaultHttpAuthSchemeResolver(authParameters); + } + const options = []; + for (const scheme of authSchemes) { + const { name: resolvedName, properties = {}, ...rest } = scheme; + const name = resolvedName.toLowerCase(); + if (resolvedName !== name) { + console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`); + } + let schemeId; + if (name === "sigv4a") { + schemeId = "aws.auth#sigv4a"; + const sigv4Present = authSchemes.find((s4) => { + const name2 = s4.name.toLowerCase(); + return name2 !== "sigv4a" && name2.startsWith("sigv4"); + }); + if (signature_v4_multi_region_1.SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) { + continue; + } + } else if (name.startsWith("sigv4")) { + schemeId = "aws.auth#sigv4"; + } else { + throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`); + } + const createOption = createHttpAuthOptionFunctions[schemeId]; + if (!createOption) { + throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`); + } + const option = createOption(authParameters); + option.schemeId = schemeId; + option.signingProperties = { ...option.signingProperties || {}, ...rest, ...properties }; + options.push(option); + } + return options; + }; + return endpointRuleSetHttpAuthSchemeProvider; + }; + var _defaultS3HttpAuthSchemeProvider = (authParameters) => { + const options = []; + switch (authParameters.operation) { + default: { + options.push(createAwsAuthSigv4HttpAuthOption4(authParameters)); + options.push(createAwsAuthSigv4aHttpAuthOption(authParameters)); + } + } + return options; + }; + exports2.defaultS3HttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(endpointResolver_1.defaultEndpointResolver, _defaultS3HttpAuthSchemeProvider, { + "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption4, + "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption + }); + var resolveHttpAuthSchemeConfig4 = (config) => { + const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); + const config_1 = (0, core_1.resolveAwsSdkSigV4AConfig)(config_0); + return Object.assign(config_1, { + authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []) + }); + }; + exports2.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig4; + } +}); + +// node_modules/@aws-sdk/client-s3/dist-cjs/models/S3ServiceException.js +var require_S3ServiceException = __commonJS({ + "node_modules/@aws-sdk/client-s3/dist-cjs/models/S3ServiceException.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.S3ServiceException = exports2.__ServiceException = void 0; + var smithy_client_1 = require_dist_cjs20(); + Object.defineProperty(exports2, "__ServiceException", { enumerable: true, get: function() { + return smithy_client_1.ServiceException; + } }); + var S3ServiceException = class _S3ServiceException extends smithy_client_1.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, _S3ServiceException.prototype); + } + }; + exports2.S3ServiceException = S3ServiceException; + } +}); + +// node_modules/@aws-sdk/client-s3/dist-cjs/models/errors.js +var require_errors4 = __commonJS({ + "node_modules/@aws-sdk/client-s3/dist-cjs/models/errors.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ObjectAlreadyInActiveTierError = exports2.IdempotencyParameterMismatch = exports2.TooManyParts = exports2.InvalidWriteOffset = exports2.InvalidRequest = exports2.EncryptionTypeMismatch = exports2.NotFound = exports2.NoSuchKey = exports2.InvalidObjectState = exports2.NoSuchBucket = exports2.BucketAlreadyOwnedByYou = exports2.BucketAlreadyExists = exports2.ObjectNotInActiveTierError = exports2.AccessDenied = exports2.NoSuchUpload = void 0; + var S3ServiceException_1 = require_S3ServiceException(); + var NoSuchUpload = class _NoSuchUpload extends S3ServiceException_1.S3ServiceException { + name = "NoSuchUpload"; + $fault = "client"; + constructor(opts) { + super({ + name: "NoSuchUpload", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _NoSuchUpload.prototype); + } + }; + exports2.NoSuchUpload = NoSuchUpload; + var AccessDenied = class _AccessDenied extends S3ServiceException_1.S3ServiceException { + name = "AccessDenied"; + $fault = "client"; + constructor(opts) { + super({ + name: "AccessDenied", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _AccessDenied.prototype); + } + }; + exports2.AccessDenied = AccessDenied; + var ObjectNotInActiveTierError = class _ObjectNotInActiveTierError extends S3ServiceException_1.S3ServiceException { + name = "ObjectNotInActiveTierError"; + $fault = "client"; + constructor(opts) { + super({ + name: "ObjectNotInActiveTierError", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _ObjectNotInActiveTierError.prototype); + } + }; + exports2.ObjectNotInActiveTierError = ObjectNotInActiveTierError; + var BucketAlreadyExists = class _BucketAlreadyExists extends S3ServiceException_1.S3ServiceException { + name = "BucketAlreadyExists"; + $fault = "client"; + constructor(opts) { + super({ + name: "BucketAlreadyExists", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _BucketAlreadyExists.prototype); + } + }; + exports2.BucketAlreadyExists = BucketAlreadyExists; + var BucketAlreadyOwnedByYou = class _BucketAlreadyOwnedByYou extends S3ServiceException_1.S3ServiceException { + name = "BucketAlreadyOwnedByYou"; + $fault = "client"; + constructor(opts) { + super({ + name: "BucketAlreadyOwnedByYou", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _BucketAlreadyOwnedByYou.prototype); + } + }; + exports2.BucketAlreadyOwnedByYou = BucketAlreadyOwnedByYou; + var NoSuchBucket = class _NoSuchBucket extends S3ServiceException_1.S3ServiceException { + name = "NoSuchBucket"; + $fault = "client"; + constructor(opts) { + super({ + name: "NoSuchBucket", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _NoSuchBucket.prototype); + } + }; + exports2.NoSuchBucket = NoSuchBucket; + var InvalidObjectState = class _InvalidObjectState extends S3ServiceException_1.S3ServiceException { + name = "InvalidObjectState"; + $fault = "client"; + StorageClass; + AccessTier; + constructor(opts) { + super({ + name: "InvalidObjectState", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _InvalidObjectState.prototype); + this.StorageClass = opts.StorageClass; + this.AccessTier = opts.AccessTier; + } + }; + exports2.InvalidObjectState = InvalidObjectState; + var NoSuchKey = class _NoSuchKey extends S3ServiceException_1.S3ServiceException { + name = "NoSuchKey"; + $fault = "client"; + constructor(opts) { + super({ + name: "NoSuchKey", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _NoSuchKey.prototype); + } + }; + exports2.NoSuchKey = NoSuchKey; + var NotFound = class _NotFound extends S3ServiceException_1.S3ServiceException { + name = "NotFound"; + $fault = "client"; + constructor(opts) { + super({ + name: "NotFound", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _NotFound.prototype); + } + }; + exports2.NotFound = NotFound; + var EncryptionTypeMismatch = class _EncryptionTypeMismatch extends S3ServiceException_1.S3ServiceException { + name = "EncryptionTypeMismatch"; + $fault = "client"; + constructor(opts) { + super({ + name: "EncryptionTypeMismatch", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _EncryptionTypeMismatch.prototype); + } + }; + exports2.EncryptionTypeMismatch = EncryptionTypeMismatch; + var InvalidRequest = class _InvalidRequest extends S3ServiceException_1.S3ServiceException { + name = "InvalidRequest"; + $fault = "client"; + constructor(opts) { + super({ + name: "InvalidRequest", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _InvalidRequest.prototype); + } + }; + exports2.InvalidRequest = InvalidRequest; + var InvalidWriteOffset = class _InvalidWriteOffset extends S3ServiceException_1.S3ServiceException { + name = "InvalidWriteOffset"; + $fault = "client"; + constructor(opts) { + super({ + name: "InvalidWriteOffset", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _InvalidWriteOffset.prototype); + } + }; + exports2.InvalidWriteOffset = InvalidWriteOffset; + var TooManyParts = class _TooManyParts extends S3ServiceException_1.S3ServiceException { + name = "TooManyParts"; + $fault = "client"; + constructor(opts) { + super({ + name: "TooManyParts", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _TooManyParts.prototype); + } + }; + exports2.TooManyParts = TooManyParts; + var IdempotencyParameterMismatch = class _IdempotencyParameterMismatch extends S3ServiceException_1.S3ServiceException { + name = "IdempotencyParameterMismatch"; + $fault = "client"; + constructor(opts) { + super({ + name: "IdempotencyParameterMismatch", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _IdempotencyParameterMismatch.prototype); + } + }; + exports2.IdempotencyParameterMismatch = IdempotencyParameterMismatch; + var ObjectAlreadyInActiveTierError = class _ObjectAlreadyInActiveTierError extends S3ServiceException_1.S3ServiceException { + name = "ObjectAlreadyInActiveTierError"; + $fault = "client"; + constructor(opts) { + super({ + name: "ObjectAlreadyInActiveTierError", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _ObjectAlreadyInActiveTierError.prototype); + } + }; + exports2.ObjectAlreadyInActiveTierError = ObjectAlreadyInActiveTierError; + } +}); + +// node_modules/@aws-sdk/client-s3/dist-cjs/schemas/schemas_0.js +var require_schemas_0 = __commonJS({ + "node_modules/@aws-sdk/client-s3/dist-cjs/schemas/schemas_0.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.CreateBucketMetadataTableConfigurationRequest$ = exports2.CreateBucketMetadataConfigurationRequest$ = exports2.CreateBucketConfiguration$ = exports2.CORSRule$ = exports2.CORSConfiguration$ = exports2.CopyPartResult$ = exports2.CopyObjectResult$ = exports2.CopyObjectRequest$ = exports2.CopyObjectOutput$ = exports2.ContinuationEvent$ = exports2.Condition$ = exports2.CompleteMultipartUploadRequest$ = exports2.CompleteMultipartUploadOutput$ = exports2.CompletedPart$ = exports2.CompletedMultipartUpload$ = exports2.CommonPrefix$ = exports2.Checksum$ = exports2.BucketLoggingStatus$ = exports2.BucketLifecycleConfiguration$ = exports2.BucketInfo$ = exports2.Bucket$ = exports2.BlockedEncryptionTypes$ = exports2.AnalyticsS3BucketDestination$ = exports2.AnalyticsExportDestination$ = exports2.AnalyticsConfiguration$ = exports2.AnalyticsAndOperator$ = exports2.AccessControlTranslation$ = exports2.AccessControlPolicy$ = exports2.AccelerateConfiguration$ = exports2.AbortMultipartUploadRequest$ = exports2.AbortMultipartUploadOutput$ = exports2.AbortIncompleteMultipartUpload$ = exports2.AbacStatus$ = exports2.errorTypeRegistries = exports2.TooManyParts$ = exports2.ObjectNotInActiveTierError$ = exports2.ObjectAlreadyInActiveTierError$ = exports2.NotFound$ = exports2.NoSuchUpload$ = exports2.NoSuchKey$ = exports2.NoSuchBucket$ = exports2.InvalidWriteOffset$ = exports2.InvalidRequest$ = exports2.InvalidObjectState$ = exports2.IdempotencyParameterMismatch$ = exports2.EncryptionTypeMismatch$ = exports2.BucketAlreadyOwnedByYou$ = exports2.BucketAlreadyExists$ = exports2.AccessDenied$ = exports2.S3ServiceException$ = void 0; + exports2.GetBucketAccelerateConfigurationRequest$ = exports2.GetBucketAccelerateConfigurationOutput$ = exports2.GetBucketAbacRequest$ = exports2.GetBucketAbacOutput$ = exports2.FilterRule$ = exports2.ExistingObjectReplication$ = exports2.EventBridgeConfiguration$ = exports2.ErrorDocument$ = exports2.ErrorDetails$ = exports2._Error$ = exports2.EndEvent$ = exports2.EncryptionConfiguration$ = exports2.Encryption$ = exports2.DestinationResult$ = exports2.Destination$ = exports2.DeletePublicAccessBlockRequest$ = exports2.DeleteObjectTaggingRequest$ = exports2.DeleteObjectTaggingOutput$ = exports2.DeleteObjectsRequest$ = exports2.DeleteObjectsOutput$ = exports2.DeleteObjectRequest$ = exports2.DeleteObjectOutput$ = exports2.DeleteMarkerReplication$ = exports2.DeleteMarkerEntry$ = exports2.DeletedObject$ = exports2.DeleteBucketWebsiteRequest$ = exports2.DeleteBucketTaggingRequest$ = exports2.DeleteBucketRequest$ = exports2.DeleteBucketReplicationRequest$ = exports2.DeleteBucketPolicyRequest$ = exports2.DeleteBucketOwnershipControlsRequest$ = exports2.DeleteBucketMetricsConfigurationRequest$ = exports2.DeleteBucketMetadataTableConfigurationRequest$ = exports2.DeleteBucketMetadataConfigurationRequest$ = exports2.DeleteBucketLifecycleRequest$ = exports2.DeleteBucketInventoryConfigurationRequest$ = exports2.DeleteBucketIntelligentTieringConfigurationRequest$ = exports2.DeleteBucketEncryptionRequest$ = exports2.DeleteBucketCorsRequest$ = exports2.DeleteBucketAnalyticsConfigurationRequest$ = exports2.Delete$ = exports2.DefaultRetention$ = exports2.CSVOutput$ = exports2.CSVInput$ = exports2.CreateSessionRequest$ = exports2.CreateSessionOutput$ = exports2.CreateMultipartUploadRequest$ = exports2.CreateMultipartUploadOutput$ = exports2.CreateBucketRequest$ = exports2.CreateBucketOutput$ = void 0; + exports2.GetObjectLegalHoldRequest$ = exports2.GetObjectLegalHoldOutput$ = exports2.GetObjectAttributesRequest$ = exports2.GetObjectAttributesParts$ = exports2.GetObjectAttributesOutput$ = exports2.GetObjectAclRequest$ = exports2.GetObjectAclOutput$ = exports2.GetBucketWebsiteRequest$ = exports2.GetBucketWebsiteOutput$ = exports2.GetBucketVersioningRequest$ = exports2.GetBucketVersioningOutput$ = exports2.GetBucketTaggingRequest$ = exports2.GetBucketTaggingOutput$ = exports2.GetBucketRequestPaymentRequest$ = exports2.GetBucketRequestPaymentOutput$ = exports2.GetBucketReplicationRequest$ = exports2.GetBucketReplicationOutput$ = exports2.GetBucketPolicyStatusRequest$ = exports2.GetBucketPolicyStatusOutput$ = exports2.GetBucketPolicyRequest$ = exports2.GetBucketPolicyOutput$ = exports2.GetBucketOwnershipControlsRequest$ = exports2.GetBucketOwnershipControlsOutput$ = exports2.GetBucketNotificationConfigurationRequest$ = exports2.GetBucketMetricsConfigurationRequest$ = exports2.GetBucketMetricsConfigurationOutput$ = exports2.GetBucketMetadataTableConfigurationResult$ = exports2.GetBucketMetadataTableConfigurationRequest$ = exports2.GetBucketMetadataTableConfigurationOutput$ = exports2.GetBucketMetadataConfigurationResult$ = exports2.GetBucketMetadataConfigurationRequest$ = exports2.GetBucketMetadataConfigurationOutput$ = exports2.GetBucketLoggingRequest$ = exports2.GetBucketLoggingOutput$ = exports2.GetBucketLocationRequest$ = exports2.GetBucketLocationOutput$ = exports2.GetBucketLifecycleConfigurationRequest$ = exports2.GetBucketLifecycleConfigurationOutput$ = exports2.GetBucketInventoryConfigurationRequest$ = exports2.GetBucketInventoryConfigurationOutput$ = exports2.GetBucketIntelligentTieringConfigurationRequest$ = exports2.GetBucketIntelligentTieringConfigurationOutput$ = exports2.GetBucketEncryptionRequest$ = exports2.GetBucketEncryptionOutput$ = exports2.GetBucketCorsRequest$ = exports2.GetBucketCorsOutput$ = exports2.GetBucketAnalyticsConfigurationRequest$ = exports2.GetBucketAnalyticsConfigurationOutput$ = exports2.GetBucketAclRequest$ = exports2.GetBucketAclOutput$ = void 0; + exports2.ListBucketInventoryConfigurationsRequest$ = exports2.ListBucketInventoryConfigurationsOutput$ = exports2.ListBucketIntelligentTieringConfigurationsRequest$ = exports2.ListBucketIntelligentTieringConfigurationsOutput$ = exports2.ListBucketAnalyticsConfigurationsRequest$ = exports2.ListBucketAnalyticsConfigurationsOutput$ = exports2.LifecycleRuleFilter$ = exports2.LifecycleRuleAndOperator$ = exports2.LifecycleRule$ = exports2.LifecycleExpiration$ = exports2.LambdaFunctionConfiguration$ = exports2.JSONOutput$ = exports2.JSONInput$ = exports2.JournalTableConfigurationUpdates$ = exports2.JournalTableConfigurationResult$ = exports2.JournalTableConfiguration$ = exports2.InventoryTableConfigurationUpdates$ = exports2.InventoryTableConfigurationResult$ = exports2.InventoryTableConfiguration$ = exports2.InventorySchedule$ = exports2.InventoryS3BucketDestination$ = exports2.InventoryFilter$ = exports2.InventoryEncryption$ = exports2.InventoryDestination$ = exports2.InventoryConfiguration$ = exports2.IntelligentTieringFilter$ = exports2.IntelligentTieringConfiguration$ = exports2.IntelligentTieringAndOperator$ = exports2.InputSerialization$ = exports2.Initiator$ = exports2.IndexDocument$ = exports2.HeadObjectRequest$ = exports2.HeadObjectOutput$ = exports2.HeadBucketRequest$ = exports2.HeadBucketOutput$ = exports2.Grantee$ = exports2.Grant$ = exports2.GlacierJobParameters$ = exports2.GetPublicAccessBlockRequest$ = exports2.GetPublicAccessBlockOutput$ = exports2.GetObjectTorrentRequest$ = exports2.GetObjectTorrentOutput$ = exports2.GetObjectTaggingRequest$ = exports2.GetObjectTaggingOutput$ = exports2.GetObjectRetentionRequest$ = exports2.GetObjectRetentionOutput$ = exports2.GetObjectRequest$ = exports2.GetObjectOutput$ = exports2.GetObjectLockConfigurationRequest$ = exports2.GetObjectLockConfigurationOutput$ = void 0; + exports2.Progress$ = exports2.PolicyStatus$ = exports2.PartitionedPrefix$ = exports2.Part$ = exports2.ParquetInput$ = exports2.OwnershipControlsRule$ = exports2.OwnershipControls$ = exports2.Owner$ = exports2.OutputSerialization$ = exports2.OutputLocation$ = exports2.ObjectVersion$ = exports2.ObjectPart$ = exports2.ObjectLockRule$ = exports2.ObjectLockRetention$ = exports2.ObjectLockLegalHold$ = exports2.ObjectLockConfiguration$ = exports2.ObjectIdentifier$ = exports2._Object$ = exports2.NotificationConfigurationFilter$ = exports2.NotificationConfiguration$ = exports2.NoncurrentVersionTransition$ = exports2.NoncurrentVersionExpiration$ = exports2.MultipartUpload$ = exports2.MetricsConfiguration$ = exports2.MetricsAndOperator$ = exports2.Metrics$ = exports2.MetadataTableEncryptionConfiguration$ = exports2.MetadataTableConfigurationResult$ = exports2.MetadataTableConfiguration$ = exports2.MetadataEntry$ = exports2.MetadataConfigurationResult$ = exports2.MetadataConfiguration$ = exports2.LoggingEnabled$ = exports2.LocationInfo$ = exports2.ListPartsRequest$ = exports2.ListPartsOutput$ = exports2.ListObjectVersionsRequest$ = exports2.ListObjectVersionsOutput$ = exports2.ListObjectsV2Request$ = exports2.ListObjectsV2Output$ = exports2.ListObjectsRequest$ = exports2.ListObjectsOutput$ = exports2.ListMultipartUploadsRequest$ = exports2.ListMultipartUploadsOutput$ = exports2.ListDirectoryBucketsRequest$ = exports2.ListDirectoryBucketsOutput$ = exports2.ListBucketsRequest$ = exports2.ListBucketsOutput$ = exports2.ListBucketMetricsConfigurationsRequest$ = exports2.ListBucketMetricsConfigurationsOutput$ = void 0; + exports2.RequestPaymentConfiguration$ = exports2.ReplicationTimeValue$ = exports2.ReplicationTime$ = exports2.ReplicationRuleFilter$ = exports2.ReplicationRuleAndOperator$ = exports2.ReplicationRule$ = exports2.ReplicationConfiguration$ = exports2.ReplicaModifications$ = exports2.RenameObjectRequest$ = exports2.RenameObjectOutput$ = exports2.RedirectAllRequestsTo$ = exports2.Redirect$ = exports2.RecordsEvent$ = exports2.RecordExpiration$ = exports2.QueueConfiguration$ = exports2.PutPublicAccessBlockRequest$ = exports2.PutObjectTaggingRequest$ = exports2.PutObjectTaggingOutput$ = exports2.PutObjectRetentionRequest$ = exports2.PutObjectRetentionOutput$ = exports2.PutObjectRequest$ = exports2.PutObjectOutput$ = exports2.PutObjectLockConfigurationRequest$ = exports2.PutObjectLockConfigurationOutput$ = exports2.PutObjectLegalHoldRequest$ = exports2.PutObjectLegalHoldOutput$ = exports2.PutObjectAclRequest$ = exports2.PutObjectAclOutput$ = exports2.PutBucketWebsiteRequest$ = exports2.PutBucketVersioningRequest$ = exports2.PutBucketTaggingRequest$ = exports2.PutBucketRequestPaymentRequest$ = exports2.PutBucketReplicationRequest$ = exports2.PutBucketPolicyRequest$ = exports2.PutBucketOwnershipControlsRequest$ = exports2.PutBucketNotificationConfigurationRequest$ = exports2.PutBucketMetricsConfigurationRequest$ = exports2.PutBucketLoggingRequest$ = exports2.PutBucketLifecycleConfigurationRequest$ = exports2.PutBucketLifecycleConfigurationOutput$ = exports2.PutBucketInventoryConfigurationRequest$ = exports2.PutBucketIntelligentTieringConfigurationRequest$ = exports2.PutBucketEncryptionRequest$ = exports2.PutBucketCorsRequest$ = exports2.PutBucketAnalyticsConfigurationRequest$ = exports2.PutBucketAclRequest$ = exports2.PutBucketAccelerateConfigurationRequest$ = exports2.PutBucketAbacRequest$ = exports2.PublicAccessBlockConfiguration$ = exports2.ProgressEvent$ = void 0; + exports2.SelectObjectContentEventStream$ = exports2.ObjectEncryption$ = exports2.MetricsFilter$ = exports2.AnalyticsFilter$ = exports2.WriteGetObjectResponseRequest$ = exports2.WebsiteConfiguration$ = exports2.VersioningConfiguration$ = exports2.UploadPartRequest$ = exports2.UploadPartOutput$ = exports2.UploadPartCopyRequest$ = exports2.UploadPartCopyOutput$ = exports2.UpdateObjectEncryptionResponse$ = exports2.UpdateObjectEncryptionRequest$ = exports2.UpdateBucketMetadataJournalTableConfigurationRequest$ = exports2.UpdateBucketMetadataInventoryTableConfigurationRequest$ = exports2.Transition$ = exports2.TopicConfiguration$ = exports2.Tiering$ = exports2.TargetObjectKeyFormat$ = exports2.TargetGrant$ = exports2.Tagging$ = exports2.Tag$ = exports2.StorageClassAnalysisDataExport$ = exports2.StorageClassAnalysis$ = exports2.StatsEvent$ = exports2.Stats$ = exports2.SSES3$ = exports2.SSEKMSEncryption$ = exports2.SseKmsEncryptedObjects$ = exports2.SSEKMS$ = exports2.SourceSelectionCriteria$ = exports2.SimplePrefix$ = exports2.SessionCredentials$ = exports2.ServerSideEncryptionRule$ = exports2.ServerSideEncryptionConfiguration$ = exports2.ServerSideEncryptionByDefault$ = exports2.SelectParameters$ = exports2.SelectObjectContentRequest$ = exports2.SelectObjectContentOutput$ = exports2.ScanRange$ = exports2.S3TablesDestinationResult$ = exports2.S3TablesDestination$ = exports2.S3Location$ = exports2.S3KeyFilter$ = exports2.RoutingRule$ = exports2.RestoreStatus$ = exports2.RestoreRequest$ = exports2.RestoreObjectRequest$ = exports2.RestoreObjectOutput$ = exports2.RequestProgress$ = void 0; + exports2.GetBucketWebsite$ = exports2.GetBucketVersioning$ = exports2.GetBucketTagging$ = exports2.GetBucketRequestPayment$ = exports2.GetBucketReplication$ = exports2.GetBucketPolicyStatus$ = exports2.GetBucketPolicy$ = exports2.GetBucketOwnershipControls$ = exports2.GetBucketNotificationConfiguration$ = exports2.GetBucketMetricsConfiguration$ = exports2.GetBucketMetadataTableConfiguration$ = exports2.GetBucketMetadataConfiguration$ = exports2.GetBucketLogging$ = exports2.GetBucketLocation$ = exports2.GetBucketLifecycleConfiguration$ = exports2.GetBucketInventoryConfiguration$ = exports2.GetBucketIntelligentTieringConfiguration$ = exports2.GetBucketEncryption$ = exports2.GetBucketCors$ = exports2.GetBucketAnalyticsConfiguration$ = exports2.GetBucketAcl$ = exports2.GetBucketAccelerateConfiguration$ = exports2.GetBucketAbac$ = exports2.DeletePublicAccessBlock$ = exports2.DeleteObjectTagging$ = exports2.DeleteObjects$ = exports2.DeleteObject$ = exports2.DeleteBucketWebsite$ = exports2.DeleteBucketTagging$ = exports2.DeleteBucketReplication$ = exports2.DeleteBucketPolicy$ = exports2.DeleteBucketOwnershipControls$ = exports2.DeleteBucketMetricsConfiguration$ = exports2.DeleteBucketMetadataTableConfiguration$ = exports2.DeleteBucketMetadataConfiguration$ = exports2.DeleteBucketLifecycle$ = exports2.DeleteBucketInventoryConfiguration$ = exports2.DeleteBucketIntelligentTieringConfiguration$ = exports2.DeleteBucketEncryption$ = exports2.DeleteBucketCors$ = exports2.DeleteBucketAnalyticsConfiguration$ = exports2.DeleteBucket$ = exports2.CreateSession$ = exports2.CreateMultipartUpload$ = exports2.CreateBucketMetadataTableConfiguration$ = exports2.CreateBucketMetadataConfiguration$ = exports2.CreateBucket$ = exports2.CopyObject$ = exports2.CompleteMultipartUpload$ = exports2.AbortMultipartUpload$ = void 0; + exports2.RestoreObject$ = exports2.RenameObject$ = exports2.PutPublicAccessBlock$ = exports2.PutObjectTagging$ = exports2.PutObjectRetention$ = exports2.PutObjectLockConfiguration$ = exports2.PutObjectLegalHold$ = exports2.PutObjectAcl$ = exports2.PutObject$ = exports2.PutBucketWebsite$ = exports2.PutBucketVersioning$ = exports2.PutBucketTagging$ = exports2.PutBucketRequestPayment$ = exports2.PutBucketReplication$ = exports2.PutBucketPolicy$ = exports2.PutBucketOwnershipControls$ = exports2.PutBucketNotificationConfiguration$ = exports2.PutBucketMetricsConfiguration$ = exports2.PutBucketLogging$ = exports2.PutBucketLifecycleConfiguration$ = exports2.PutBucketInventoryConfiguration$ = exports2.PutBucketIntelligentTieringConfiguration$ = exports2.PutBucketEncryption$ = exports2.PutBucketCors$ = exports2.PutBucketAnalyticsConfiguration$ = exports2.PutBucketAcl$ = exports2.PutBucketAccelerateConfiguration$ = exports2.PutBucketAbac$ = exports2.ListParts$ = exports2.ListObjectVersions$ = exports2.ListObjectsV2$ = exports2.ListObjects$ = exports2.ListMultipartUploads$ = exports2.ListDirectoryBuckets$ = exports2.ListBuckets$ = exports2.ListBucketMetricsConfigurations$ = exports2.ListBucketInventoryConfigurations$ = exports2.ListBucketIntelligentTieringConfigurations$ = exports2.ListBucketAnalyticsConfigurations$ = exports2.HeadObject$ = exports2.HeadBucket$ = exports2.GetPublicAccessBlock$ = exports2.GetObjectTorrent$ = exports2.GetObjectTagging$ = exports2.GetObjectRetention$ = exports2.GetObjectLockConfiguration$ = exports2.GetObjectLegalHold$ = exports2.GetObjectAttributes$ = exports2.GetObjectAcl$ = exports2.GetObject$ = void 0; + exports2.WriteGetObjectResponse$ = exports2.UploadPartCopy$ = exports2.UploadPart$ = exports2.UpdateObjectEncryption$ = exports2.UpdateBucketMetadataJournalTableConfiguration$ = exports2.UpdateBucketMetadataInventoryTableConfiguration$ = exports2.SelectObjectContent$ = void 0; + var _A2 = "Account"; + var _AAO = "AnalyticsAndOperator"; + var _AC = "AccelerateConfiguration"; + var _ACL = "AccessControlList"; + var _ACL_ = "ACL"; + var _ACLn = "AnalyticsConfigurationList"; + var _ACP = "AccessControlPolicy"; + var _ACT = "AccessControlTranslation"; + var _ACn = "AnalyticsConfiguration"; + var _AD = "AccessDenied"; + var _ADb = "AbortDate"; + var _AED = "AnalyticsExportDestination"; + var _AF = "AnalyticsFilter"; + var _AH = "AllowedHeaders"; + var _AHl = "AllowedHeader"; + var _AI = "AccountId"; + var _AIMU = "AbortIncompleteMultipartUpload"; + var _AKI2 = "AccessKeyId"; + var _AM = "AllowedMethods"; + var _AMU = "AbortMultipartUpload"; + var _AMUO = "AbortMultipartUploadOutput"; + var _AMUR = "AbortMultipartUploadRequest"; + var _AMl = "AllowedMethod"; + var _AO = "AllowedOrigins"; + var _AOl = "AllowedOrigin"; + var _APA = "AccessPointAlias"; + var _APAc = "AccessPointArn"; + var _AQRD = "AllowQuotedRecordDelimiter"; + var _AR2 = "AcceptRanges"; + var _ARI2 = "AbortRuleId"; + var _AS = "AbacStatus"; + var _ASBD = "AnalyticsS3BucketDestination"; + var _ASSEBD = "ApplyServerSideEncryptionByDefault"; + var _ASr = "ArchiveStatus"; + var _AT3 = "AccessTier"; + var _An = "And"; + var _B = "Bucket"; + var _BA = "BucketArn"; + var _BAE = "BucketAlreadyExists"; + var _BAI = "BucketAccountId"; + var _BAOBY = "BucketAlreadyOwnedByYou"; + var _BET = "BlockedEncryptionTypes"; + var _BGR = "BypassGovernanceRetention"; + var _BI = "BucketInfo"; + var _BKE = "BucketKeyEnabled"; + var _BLC = "BucketLifecycleConfiguration"; + var _BLN = "BucketLocationName"; + var _BLS = "BucketLoggingStatus"; + var _BLT = "BucketLocationType"; + var _BN = "BucketName"; + var _BP = "BytesProcessed"; + var _BPA = "BlockPublicAcls"; + var _BPP = "BlockPublicPolicy"; + var _BR = "BucketRegion"; + var _BRy = "BytesReturned"; + var _BS = "BytesScanned"; + var _Bo = "Body"; + var _Bu = "Buckets"; + var _C2 = "Checksum"; + var _CA2 = "ChecksumAlgorithm"; + var _CACL = "CannedACL"; + var _CB = "CreateBucket"; + var _CBC = "CreateBucketConfiguration"; + var _CBMC = "CreateBucketMetadataConfiguration"; + var _CBMCR = "CreateBucketMetadataConfigurationRequest"; + var _CBMTC = "CreateBucketMetadataTableConfiguration"; + var _CBMTCR = "CreateBucketMetadataTableConfigurationRequest"; + var _CBO = "CreateBucketOutput"; + var _CBR = "CreateBucketRequest"; + var _CC = "CacheControl"; + var _CCRC = "ChecksumCRC32"; + var _CCRCC = "ChecksumCRC32C"; + var _CCRCNVME = "ChecksumCRC64NVME"; + var _CC_ = "Cache-Control"; + var _CD = "CreationDate"; + var _CD_ = "Content-Disposition"; + var _CDo = "ContentDisposition"; + var _CE = "ContinuationEvent"; + var _CE_ = "Content-Encoding"; + var _CEo = "ContentEncoding"; + var _CF = "CloudFunction"; + var _CFC = "CloudFunctionConfiguration"; + var _CL = "ContentLanguage"; + var _CL_ = "Content-Language"; + var _CL__ = "Content-Length"; + var _CLo = "ContentLength"; + var _CM = "Content-MD5"; + var _CMD = "ContentMD5"; + var _CMU = "CompletedMultipartUpload"; + var _CMUO = "CompleteMultipartUploadOutput"; + var _CMUOr = "CreateMultipartUploadOutput"; + var _CMUR = "CompleteMultipartUploadResult"; + var _CMURo = "CompleteMultipartUploadRequest"; + var _CMURr = "CreateMultipartUploadRequest"; + var _CMUo = "CompleteMultipartUpload"; + var _CMUr = "CreateMultipartUpload"; + var _CMh = "ChecksumMode"; + var _CO = "CopyObject"; + var _COO = "CopyObjectOutput"; + var _COR = "CopyObjectResult"; + var _CORSC = "CORSConfiguration"; + var _CORSR = "CORSRules"; + var _CORSRu = "CORSRule"; + var _CORo = "CopyObjectRequest"; + var _CP = "CommonPrefix"; + var _CPL = "CommonPrefixList"; + var _CPLo = "CompletedPartList"; + var _CPR = "CopyPartResult"; + var _CPo = "CompletedPart"; + var _CPom = "CommonPrefixes"; + var _CR = "ContentRange"; + var _CRSBA = "ConfirmRemoveSelfBucketAccess"; + var _CR_ = "Content-Range"; + var _CS2 = "CopySource"; + var _CSHA = "ChecksumSHA1"; + var _CSHAh = "ChecksumSHA256"; + var _CSIM = "CopySourceIfMatch"; + var _CSIMS = "CopySourceIfModifiedSince"; + var _CSINM = "CopySourceIfNoneMatch"; + var _CSIUS = "CopySourceIfUnmodifiedSince"; + var _CSO = "CreateSessionOutput"; + var _CSR = "CreateSessionResult"; + var _CSRo = "CopySourceRange"; + var _CSRr = "CreateSessionRequest"; + var _CSSSECA = "CopySourceSSECustomerAlgorithm"; + var _CSSSECK = "CopySourceSSECustomerKey"; + var _CSSSECKMD = "CopySourceSSECustomerKeyMD5"; + var _CSV = "CSV"; + var _CSVI = "CopySourceVersionId"; + var _CSVIn = "CSVInput"; + var _CSVO = "CSVOutput"; + var _CSo = "ConfigurationState"; + var _CSr = "CreateSession"; + var _CT2 = "ChecksumType"; + var _CT_ = "Content-Type"; + var _CTl = "ClientToken"; + var _CTo = "ContentType"; + var _CTom = "CompressionType"; + var _CTon = "ContinuationToken"; + var _Co = "Condition"; + var _Cod = "Code"; + var _Com = "Comments"; + var _Con = "Contents"; + var _Cont = "Cont"; + var _Cr = "Credentials"; + var _D = "Days"; + var _DAI = "DaysAfterInitiation"; + var _DB = "DeleteBucket"; + var _DBAC = "DeleteBucketAnalyticsConfiguration"; + var _DBACR = "DeleteBucketAnalyticsConfigurationRequest"; + var _DBC = "DeleteBucketCors"; + var _DBCR = "DeleteBucketCorsRequest"; + var _DBE = "DeleteBucketEncryption"; + var _DBER = "DeleteBucketEncryptionRequest"; + var _DBIC = "DeleteBucketInventoryConfiguration"; + var _DBICR = "DeleteBucketInventoryConfigurationRequest"; + var _DBITC = "DeleteBucketIntelligentTieringConfiguration"; + var _DBITCR = "DeleteBucketIntelligentTieringConfigurationRequest"; + var _DBL = "DeleteBucketLifecycle"; + var _DBLR = "DeleteBucketLifecycleRequest"; + var _DBMC = "DeleteBucketMetadataConfiguration"; + var _DBMCR = "DeleteBucketMetadataConfigurationRequest"; + var _DBMCRe = "DeleteBucketMetricsConfigurationRequest"; + var _DBMCe = "DeleteBucketMetricsConfiguration"; + var _DBMTC = "DeleteBucketMetadataTableConfiguration"; + var _DBMTCR = "DeleteBucketMetadataTableConfigurationRequest"; + var _DBOC = "DeleteBucketOwnershipControls"; + var _DBOCR = "DeleteBucketOwnershipControlsRequest"; + var _DBP = "DeleteBucketPolicy"; + var _DBPR = "DeleteBucketPolicyRequest"; + var _DBR = "DeleteBucketRequest"; + var _DBRR = "DeleteBucketReplicationRequest"; + var _DBRe = "DeleteBucketReplication"; + var _DBT = "DeleteBucketTagging"; + var _DBTR = "DeleteBucketTaggingRequest"; + var _DBW = "DeleteBucketWebsite"; + var _DBWR = "DeleteBucketWebsiteRequest"; + var _DE = "DataExport"; + var _DIM = "DestinationIfMatch"; + var _DIMS = "DestinationIfModifiedSince"; + var _DINM = "DestinationIfNoneMatch"; + var _DIUS = "DestinationIfUnmodifiedSince"; + var _DM = "DeleteMarker"; + var _DME = "DeleteMarkerEntry"; + var _DMR = "DeleteMarkerReplication"; + var _DMVI = "DeleteMarkerVersionId"; + var _DMe = "DeleteMarkers"; + var _DN = "DisplayName"; + var _DO = "DeletedObject"; + var _DOO = "DeleteObjectOutput"; + var _DOOe = "DeleteObjectsOutput"; + var _DOR = "DeleteObjectRequest"; + var _DORe = "DeleteObjectsRequest"; + var _DOT = "DeleteObjectTagging"; + var _DOTO = "DeleteObjectTaggingOutput"; + var _DOTR = "DeleteObjectTaggingRequest"; + var _DOe = "DeletedObjects"; + var _DOel = "DeleteObject"; + var _DOele = "DeleteObjects"; + var _DPAB = "DeletePublicAccessBlock"; + var _DPABR = "DeletePublicAccessBlockRequest"; + var _DR = "DataRedundancy"; + var _DRe = "DefaultRetention"; + var _DRel = "DeleteResult"; + var _DRes = "DestinationResult"; + var _Da = "Date"; + var _De = "Delete"; + var _Del = "Deleted"; + var _Deli = "Delimiter"; + var _Des = "Destination"; + var _Desc = "Description"; + var _Det = "Details"; + var _E2 = "Expiration"; + var _EA = "EmailAddress"; + var _EBC = "EventBridgeConfiguration"; + var _EBO = "ExpectedBucketOwner"; + var _EC = "EncryptionConfiguration"; + var _ECr = "ErrorCode"; + var _ED = "ErrorDetails"; + var _EDr = "ErrorDocument"; + var _EE = "EndEvent"; + var _EH = "ExposeHeaders"; + var _EHx = "ExposeHeader"; + var _EM = "ErrorMessage"; + var _EODM = "ExpiredObjectDeleteMarker"; + var _EOR = "ExistingObjectReplication"; + var _ES = "ExpiresString"; + var _ESBO = "ExpectedSourceBucketOwner"; + var _ET = "EncryptionType"; + var _ETL = "EncryptionTypeList"; + var _ETM = "EncryptionTypeMismatch"; + var _ETa = "ETag"; + var _ETn = "EncodingType"; + var _ETv = "EventThreshold"; + var _ETx = "ExpressionType"; + var _En = "Encryption"; + var _Ena = "Enabled"; + var _End = "End"; + var _Er = "Errors"; + var _Err = "Error"; + var _Ev = "Events"; + var _Eve = "Event"; + var _Ex = "Expires"; + var _Exp = "Expression"; + var _F = "Filter"; + var _FD = "FieldDelimiter"; + var _FHI = "FileHeaderInfo"; + var _FO = "FetchOwner"; + var _FR = "FilterRule"; + var _FRL = "FilterRuleList"; + var _FRi = "FilterRules"; + var _Fi = "Field"; + var _Fo = "Format"; + var _Fr = "Frequency"; + var _G = "Grants"; + var _GBA = "GetBucketAbac"; + var _GBAC = "GetBucketAccelerateConfiguration"; + var _GBACO = "GetBucketAccelerateConfigurationOutput"; + var _GBACOe = "GetBucketAnalyticsConfigurationOutput"; + var _GBACR = "GetBucketAccelerateConfigurationRequest"; + var _GBACRe = "GetBucketAnalyticsConfigurationRequest"; + var _GBACe = "GetBucketAnalyticsConfiguration"; + var _GBAO = "GetBucketAbacOutput"; + var _GBAOe = "GetBucketAclOutput"; + var _GBAR = "GetBucketAbacRequest"; + var _GBARe = "GetBucketAclRequest"; + var _GBAe = "GetBucketAcl"; + var _GBC = "GetBucketCors"; + var _GBCO = "GetBucketCorsOutput"; + var _GBCR = "GetBucketCorsRequest"; + var _GBE = "GetBucketEncryption"; + var _GBEO = "GetBucketEncryptionOutput"; + var _GBER = "GetBucketEncryptionRequest"; + var _GBIC = "GetBucketInventoryConfiguration"; + var _GBICO = "GetBucketInventoryConfigurationOutput"; + var _GBICR = "GetBucketInventoryConfigurationRequest"; + var _GBITC = "GetBucketIntelligentTieringConfiguration"; + var _GBITCO = "GetBucketIntelligentTieringConfigurationOutput"; + var _GBITCR = "GetBucketIntelligentTieringConfigurationRequest"; + var _GBL = "GetBucketLocation"; + var _GBLC = "GetBucketLifecycleConfiguration"; + var _GBLCO = "GetBucketLifecycleConfigurationOutput"; + var _GBLCR = "GetBucketLifecycleConfigurationRequest"; + var _GBLO = "GetBucketLocationOutput"; + var _GBLOe = "GetBucketLoggingOutput"; + var _GBLR = "GetBucketLocationRequest"; + var _GBLRe = "GetBucketLoggingRequest"; + var _GBLe = "GetBucketLogging"; + var _GBMC = "GetBucketMetadataConfiguration"; + var _GBMCO = "GetBucketMetadataConfigurationOutput"; + var _GBMCOe = "GetBucketMetricsConfigurationOutput"; + var _GBMCR = "GetBucketMetadataConfigurationResult"; + var _GBMCRe = "GetBucketMetadataConfigurationRequest"; + var _GBMCRet = "GetBucketMetricsConfigurationRequest"; + var _GBMCe = "GetBucketMetricsConfiguration"; + var _GBMTC = "GetBucketMetadataTableConfiguration"; + var _GBMTCO = "GetBucketMetadataTableConfigurationOutput"; + var _GBMTCR = "GetBucketMetadataTableConfigurationResult"; + var _GBMTCRe = "GetBucketMetadataTableConfigurationRequest"; + var _GBNC = "GetBucketNotificationConfiguration"; + var _GBNCR = "GetBucketNotificationConfigurationRequest"; + var _GBOC = "GetBucketOwnershipControls"; + var _GBOCO = "GetBucketOwnershipControlsOutput"; + var _GBOCR = "GetBucketOwnershipControlsRequest"; + var _GBP = "GetBucketPolicy"; + var _GBPO = "GetBucketPolicyOutput"; + var _GBPR = "GetBucketPolicyRequest"; + var _GBPS = "GetBucketPolicyStatus"; + var _GBPSO = "GetBucketPolicyStatusOutput"; + var _GBPSR = "GetBucketPolicyStatusRequest"; + var _GBR = "GetBucketReplication"; + var _GBRO = "GetBucketReplicationOutput"; + var _GBRP = "GetBucketRequestPayment"; + var _GBRPO = "GetBucketRequestPaymentOutput"; + var _GBRPR = "GetBucketRequestPaymentRequest"; + var _GBRR = "GetBucketReplicationRequest"; + var _GBT = "GetBucketTagging"; + var _GBTO = "GetBucketTaggingOutput"; + var _GBTR = "GetBucketTaggingRequest"; + var _GBV = "GetBucketVersioning"; + var _GBVO = "GetBucketVersioningOutput"; + var _GBVR = "GetBucketVersioningRequest"; + var _GBW = "GetBucketWebsite"; + var _GBWO = "GetBucketWebsiteOutput"; + var _GBWR = "GetBucketWebsiteRequest"; + var _GFC = "GrantFullControl"; + var _GJP = "GlacierJobParameters"; + var _GO = "GetObject"; + var _GOA = "GetObjectAcl"; + var _GOAO = "GetObjectAclOutput"; + var _GOAOe = "GetObjectAttributesOutput"; + var _GOAP = "GetObjectAttributesParts"; + var _GOAR = "GetObjectAclRequest"; + var _GOARe = "GetObjectAttributesResponse"; + var _GOARet = "GetObjectAttributesRequest"; + var _GOAe = "GetObjectAttributes"; + var _GOLC = "GetObjectLockConfiguration"; + var _GOLCO = "GetObjectLockConfigurationOutput"; + var _GOLCR = "GetObjectLockConfigurationRequest"; + var _GOLH = "GetObjectLegalHold"; + var _GOLHO = "GetObjectLegalHoldOutput"; + var _GOLHR = "GetObjectLegalHoldRequest"; + var _GOO = "GetObjectOutput"; + var _GOR = "GetObjectRequest"; + var _GORO = "GetObjectRetentionOutput"; + var _GORR = "GetObjectRetentionRequest"; + var _GORe = "GetObjectRetention"; + var _GOT = "GetObjectTagging"; + var _GOTO = "GetObjectTaggingOutput"; + var _GOTOe = "GetObjectTorrentOutput"; + var _GOTR = "GetObjectTaggingRequest"; + var _GOTRe = "GetObjectTorrentRequest"; + var _GOTe = "GetObjectTorrent"; + var _GPAB = "GetPublicAccessBlock"; + var _GPABO = "GetPublicAccessBlockOutput"; + var _GPABR = "GetPublicAccessBlockRequest"; + var _GR = "GrantRead"; + var _GRACP = "GrantReadACP"; + var _GW = "GrantWrite"; + var _GWACP = "GrantWriteACP"; + var _Gr = "Grant"; + var _Gra = "Grantee"; + var _HB = "HeadBucket"; + var _HBO = "HeadBucketOutput"; + var _HBR = "HeadBucketRequest"; + var _HECRE = "HttpErrorCodeReturnedEquals"; + var _HN = "HostName"; + var _HO = "HeadObject"; + var _HOO = "HeadObjectOutput"; + var _HOR = "HeadObjectRequest"; + var _HRC = "HttpRedirectCode"; + var _I = "Id"; + var _IC = "InventoryConfiguration"; + var _ICL = "InventoryConfigurationList"; + var _ID = "ID"; + var _IDn = "IndexDocument"; + var _IDnv = "InventoryDestination"; + var _IE = "IsEnabled"; + var _IEn = "InventoryEncryption"; + var _IF = "InventoryFilter"; + var _IL = "IsLatest"; + var _IM = "IfMatch"; + var _IMIT = "IfMatchInitiatedTime"; + var _IMLMT = "IfMatchLastModifiedTime"; + var _IMS = "IfMatchSize"; + var _IMS_ = "If-Modified-Since"; + var _IMSf = "IfModifiedSince"; + var _IMUR = "InitiateMultipartUploadResult"; + var _IM_ = "If-Match"; + var _INM = "IfNoneMatch"; + var _INM_ = "If-None-Match"; + var _IOF = "InventoryOptionalFields"; + var _IOS = "InvalidObjectState"; + var _IOV = "IncludedObjectVersions"; + var _IP = "IsPublic"; + var _IPA = "IgnorePublicAcls"; + var _IPM = "IdempotencyParameterMismatch"; + var _IR = "InvalidRequest"; + var _IRIP = "IsRestoreInProgress"; + var _IS = "InputSerialization"; + var _ISBD = "InventoryS3BucketDestination"; + var _ISn = "InventorySchedule"; + var _IT2 = "IsTruncated"; + var _ITAO = "IntelligentTieringAndOperator"; + var _ITC = "IntelligentTieringConfiguration"; + var _ITCL = "IntelligentTieringConfigurationList"; + var _ITCR = "InventoryTableConfigurationResult"; + var _ITCU = "InventoryTableConfigurationUpdates"; + var _ITCn = "InventoryTableConfiguration"; + var _ITF = "IntelligentTieringFilter"; + var _IUS = "IfUnmodifiedSince"; + var _IUS_ = "If-Unmodified-Since"; + var _IWO = "InvalidWriteOffset"; + var _In = "Initiator"; + var _Ini = "Initiated"; + var _JSON = "JSON"; + var _JSONI = "JSONInput"; + var _JSONO = "JSONOutput"; + var _JTC = "JournalTableConfiguration"; + var _JTCR = "JournalTableConfigurationResult"; + var _JTCU = "JournalTableConfigurationUpdates"; + var _K2 = "Key"; + var _KC = "KeyCount"; + var _KI = "KeyId"; + var _KKA = "KmsKeyArn"; + var _KM = "KeyMarker"; + var _KMSC = "KMSContext"; + var _KMSKA = "KMSKeyArn"; + var _KMSKI = "KMSKeyId"; + var _KMSMKID = "KMSMasterKeyID"; + var _KPE = "KeyPrefixEquals"; + var _L = "Location"; + var _LAMBR = "ListAllMyBucketsResult"; + var _LAMDBR = "ListAllMyDirectoryBucketsResult"; + var _LB = "ListBuckets"; + var _LBAC = "ListBucketAnalyticsConfigurations"; + var _LBACO = "ListBucketAnalyticsConfigurationsOutput"; + var _LBACR = "ListBucketAnalyticsConfigurationResult"; + var _LBACRi = "ListBucketAnalyticsConfigurationsRequest"; + var _LBIC = "ListBucketInventoryConfigurations"; + var _LBICO = "ListBucketInventoryConfigurationsOutput"; + var _LBICR = "ListBucketInventoryConfigurationsRequest"; + var _LBITC = "ListBucketIntelligentTieringConfigurations"; + var _LBITCO = "ListBucketIntelligentTieringConfigurationsOutput"; + var _LBITCR = "ListBucketIntelligentTieringConfigurationsRequest"; + var _LBMC = "ListBucketMetricsConfigurations"; + var _LBMCO = "ListBucketMetricsConfigurationsOutput"; + var _LBMCR = "ListBucketMetricsConfigurationsRequest"; + var _LBO = "ListBucketsOutput"; + var _LBR = "ListBucketsRequest"; + var _LBRi = "ListBucketResult"; + var _LC = "LocationConstraint"; + var _LCi = "LifecycleConfiguration"; + var _LDB = "ListDirectoryBuckets"; + var _LDBO = "ListDirectoryBucketsOutput"; + var _LDBR = "ListDirectoryBucketsRequest"; + var _LE = "LoggingEnabled"; + var _LEi = "LifecycleExpiration"; + var _LFA = "LambdaFunctionArn"; + var _LFC = "LambdaFunctionConfiguration"; + var _LFCL = "LambdaFunctionConfigurationList"; + var _LFCa = "LambdaFunctionConfigurations"; + var _LH = "LegalHold"; + var _LI = "LocationInfo"; + var _LICR = "ListInventoryConfigurationsResult"; + var _LM = "LastModified"; + var _LMCR = "ListMetricsConfigurationsResult"; + var _LMT = "LastModifiedTime"; + var _LMU = "ListMultipartUploads"; + var _LMUO = "ListMultipartUploadsOutput"; + var _LMUR = "ListMultipartUploadsResult"; + var _LMURi = "ListMultipartUploadsRequest"; + var _LM_ = "Last-Modified"; + var _LO = "ListObjects"; + var _LOO = "ListObjectsOutput"; + var _LOR = "ListObjectsRequest"; + var _LOV = "ListObjectsV2"; + var _LOVO = "ListObjectsV2Output"; + var _LOVOi = "ListObjectVersionsOutput"; + var _LOVR = "ListObjectsV2Request"; + var _LOVRi = "ListObjectVersionsRequest"; + var _LOVi = "ListObjectVersions"; + var _LP = "ListParts"; + var _LPO = "ListPartsOutput"; + var _LPR = "ListPartsResult"; + var _LPRi = "ListPartsRequest"; + var _LR = "LifecycleRule"; + var _LRAO = "LifecycleRuleAndOperator"; + var _LRF = "LifecycleRuleFilter"; + var _LRi = "LifecycleRules"; + var _LVR = "ListVersionsResult"; + var _M = "Metadata"; + var _MAO = "MetricsAndOperator"; + var _MAS = "MaxAgeSeconds"; + var _MB = "MaxBuckets"; + var _MC = "MetadataConfiguration"; + var _MCL = "MetricsConfigurationList"; + var _MCR = "MetadataConfigurationResult"; + var _MCe = "MetricsConfiguration"; + var _MD = "MetadataDirective"; + var _MDB = "MaxDirectoryBuckets"; + var _MDf = "MfaDelete"; + var _ME = "MetadataEntry"; + var _MF = "MetricsFilter"; + var _MFA = "MFA"; + var _MFAD = "MFADelete"; + var _MK = "MaxKeys"; + var _MM = "MissingMeta"; + var _MOS = "MpuObjectSize"; + var _MP = "MaxParts"; + var _MTC = "MetadataTableConfiguration"; + var _MTCR = "MetadataTableConfigurationResult"; + var _MTEC = "MetadataTableEncryptionConfiguration"; + var _MU = "MultipartUpload"; + var _MUL = "MultipartUploadList"; + var _MUa = "MaxUploads"; + var _Ma = "Marker"; + var _Me = "Metrics"; + var _Mes = "Message"; + var _Mi = "Minutes"; + var _Mo = "Mode"; + var _N = "Name"; + var _NC = "NotificationConfiguration"; + var _NCF = "NotificationConfigurationFilter"; + var _NCT = "NextContinuationToken"; + var _ND = "NoncurrentDays"; + var _NEKKAS = "NonEmptyKmsKeyArnString"; + var _NF = "NotFound"; + var _NKM = "NextKeyMarker"; + var _NM = "NextMarker"; + var _NNV = "NewerNoncurrentVersions"; + var _NPNM = "NextPartNumberMarker"; + var _NSB = "NoSuchBucket"; + var _NSK = "NoSuchKey"; + var _NSU = "NoSuchUpload"; + var _NUIM = "NextUploadIdMarker"; + var _NVE = "NoncurrentVersionExpiration"; + var _NVIM = "NextVersionIdMarker"; + var _NVT = "NoncurrentVersionTransitions"; + var _NVTL = "NoncurrentVersionTransitionList"; + var _NVTo = "NoncurrentVersionTransition"; + var _O = "Owner"; + var _OA = "ObjectAttributes"; + var _OAIATE = "ObjectAlreadyInActiveTierError"; + var _OC = "OwnershipControls"; + var _OCR = "OwnershipControlsRule"; + var _OCRw = "OwnershipControlsRules"; + var _OE = "ObjectEncryption"; + var _OF = "OptionalFields"; + var _OI = "ObjectIdentifier"; + var _OIL = "ObjectIdentifierList"; + var _OL = "OutputLocation"; + var _OLC = "ObjectLockConfiguration"; + var _OLE = "ObjectLockEnabled"; + var _OLEFB = "ObjectLockEnabledForBucket"; + var _OLLH = "ObjectLockLegalHold"; + var _OLLHS = "ObjectLockLegalHoldStatus"; + var _OLM = "ObjectLockMode"; + var _OLR = "ObjectLockRetention"; + var _OLRUD = "ObjectLockRetainUntilDate"; + var _OLRb = "ObjectLockRule"; + var _OLb = "ObjectList"; + var _ONIATE = "ObjectNotInActiveTierError"; + var _OO = "ObjectOwnership"; + var _OOA = "OptionalObjectAttributes"; + var _OP = "ObjectParts"; + var _OPb = "ObjectPart"; + var _OS = "ObjectSize"; + var _OSGT = "ObjectSizeGreaterThan"; + var _OSLT = "ObjectSizeLessThan"; + var _OSV = "OutputSchemaVersion"; + var _OSu = "OutputSerialization"; + var _OV = "ObjectVersion"; + var _OVL = "ObjectVersionList"; + var _Ob = "Objects"; + var _Obj = "Object"; + var _P2 = "Prefix"; + var _PABC = "PublicAccessBlockConfiguration"; + var _PBA = "PutBucketAbac"; + var _PBAC = "PutBucketAccelerateConfiguration"; + var _PBACR = "PutBucketAccelerateConfigurationRequest"; + var _PBACRu = "PutBucketAnalyticsConfigurationRequest"; + var _PBACu = "PutBucketAnalyticsConfiguration"; + var _PBAR = "PutBucketAbacRequest"; + var _PBARu = "PutBucketAclRequest"; + var _PBAu = "PutBucketAcl"; + var _PBC = "PutBucketCors"; + var _PBCR = "PutBucketCorsRequest"; + var _PBE = "PutBucketEncryption"; + var _PBER = "PutBucketEncryptionRequest"; + var _PBIC = "PutBucketInventoryConfiguration"; + var _PBICR = "PutBucketInventoryConfigurationRequest"; + var _PBITC = "PutBucketIntelligentTieringConfiguration"; + var _PBITCR = "PutBucketIntelligentTieringConfigurationRequest"; + var _PBL = "PutBucketLogging"; + var _PBLC = "PutBucketLifecycleConfiguration"; + var _PBLCO = "PutBucketLifecycleConfigurationOutput"; + var _PBLCR = "PutBucketLifecycleConfigurationRequest"; + var _PBLR = "PutBucketLoggingRequest"; + var _PBMC = "PutBucketMetricsConfiguration"; + var _PBMCR = "PutBucketMetricsConfigurationRequest"; + var _PBNC = "PutBucketNotificationConfiguration"; + var _PBNCR = "PutBucketNotificationConfigurationRequest"; + var _PBOC = "PutBucketOwnershipControls"; + var _PBOCR = "PutBucketOwnershipControlsRequest"; + var _PBP = "PutBucketPolicy"; + var _PBPR = "PutBucketPolicyRequest"; + var _PBR = "PutBucketReplication"; + var _PBRP = "PutBucketRequestPayment"; + var _PBRPR = "PutBucketRequestPaymentRequest"; + var _PBRR = "PutBucketReplicationRequest"; + var _PBT = "PutBucketTagging"; + var _PBTR = "PutBucketTaggingRequest"; + var _PBV = "PutBucketVersioning"; + var _PBVR = "PutBucketVersioningRequest"; + var _PBW = "PutBucketWebsite"; + var _PBWR = "PutBucketWebsiteRequest"; + var _PC2 = "PartsCount"; + var _PDS = "PartitionDateSource"; + var _PE = "ProgressEvent"; + var _PI2 = "ParquetInput"; + var _PL = "PartsList"; + var _PN = "PartNumber"; + var _PNM = "PartNumberMarker"; + var _PO = "PutObject"; + var _POA = "PutObjectAcl"; + var _POAO = "PutObjectAclOutput"; + var _POAR = "PutObjectAclRequest"; + var _POLC = "PutObjectLockConfiguration"; + var _POLCO = "PutObjectLockConfigurationOutput"; + var _POLCR = "PutObjectLockConfigurationRequest"; + var _POLH = "PutObjectLegalHold"; + var _POLHO = "PutObjectLegalHoldOutput"; + var _POLHR = "PutObjectLegalHoldRequest"; + var _POO = "PutObjectOutput"; + var _POR = "PutObjectRequest"; + var _PORO = "PutObjectRetentionOutput"; + var _PORR = "PutObjectRetentionRequest"; + var _PORu = "PutObjectRetention"; + var _POT = "PutObjectTagging"; + var _POTO = "PutObjectTaggingOutput"; + var _POTR = "PutObjectTaggingRequest"; + var _PP = "PartitionedPrefix"; + var _PPAB = "PutPublicAccessBlock"; + var _PPABR = "PutPublicAccessBlockRequest"; + var _PS = "PolicyStatus"; + var _Pa = "Parts"; + var _Par = "Part"; + var _Parq = "Parquet"; + var _Pay = "Payer"; + var _Payl = "Payload"; + var _Pe = "Permission"; + var _Po = "Policy"; + var _Pr2 = "Progress"; + var _Pri = "Priority"; + var _Pro = "Protocol"; + var _Q = "Quiet"; + var _QA = "QueueArn"; + var _QC = "QuoteCharacter"; + var _QCL = "QueueConfigurationList"; + var _QCu = "QueueConfigurations"; + var _QCue = "QueueConfiguration"; + var _QEC = "QuoteEscapeCharacter"; + var _QF = "QuoteFields"; + var _Qu = "Queue"; + var _R = "Rules"; + var _RART = "RedirectAllRequestsTo"; + var _RC = "RequestCharged"; + var _RCC = "ResponseCacheControl"; + var _RCD = "ResponseContentDisposition"; + var _RCE = "ResponseContentEncoding"; + var _RCL = "ResponseContentLanguage"; + var _RCT = "ResponseContentType"; + var _RCe = "ReplicationConfiguration"; + var _RD = "RecordDelimiter"; + var _RE = "ResponseExpires"; + var _RED = "RestoreExpiryDate"; + var _REe = "RecordExpiration"; + var _REec = "RecordsEvent"; + var _RKKID = "ReplicaKmsKeyID"; + var _RKPW = "ReplaceKeyPrefixWith"; + var _RKW = "ReplaceKeyWith"; + var _RM = "ReplicaModifications"; + var _RO = "RenameObject"; + var _ROO = "RenameObjectOutput"; + var _ROOe = "RestoreObjectOutput"; + var _ROP = "RestoreOutputPath"; + var _ROR = "RenameObjectRequest"; + var _RORe = "RestoreObjectRequest"; + var _ROe = "RestoreObject"; + var _RP = "RequestPayer"; + var _RPB = "RestrictPublicBuckets"; + var _RPC = "RequestPaymentConfiguration"; + var _RPe = "RequestProgress"; + var _RR = "RoutingRules"; + var _RRAO = "ReplicationRuleAndOperator"; + var _RRF = "ReplicationRuleFilter"; + var _RRe = "ReplicationRule"; + var _RRep = "ReplicationRules"; + var _RReq = "RequestRoute"; + var _RRes = "RestoreRequest"; + var _RRo = "RoutingRule"; + var _RS = "ReplicationStatus"; + var _RSe = "RestoreStatus"; + var _RSen = "RenameSource"; + var _RT3 = "ReplicationTime"; + var _RTV = "ReplicationTimeValue"; + var _RTe = "RequestToken"; + var _RUD = "RetainUntilDate"; + var _Ra = "Range"; + var _Re = "Restore"; + var _Rec = "Records"; + var _Red = "Redirect"; + var _Ret = "Retention"; + var _Ro = "Role"; + var _Ru = "Rule"; + var _S = "Status"; + var _SA = "StartAfter"; + var _SAK2 = "SecretAccessKey"; + var _SAs = "SseAlgorithm"; + var _SB = "StreamingBlob"; + var _SBD = "S3BucketDestination"; + var _SC = "StorageClass"; + var _SCA = "StorageClassAnalysis"; + var _SCADE = "StorageClassAnalysisDataExport"; + var _SCV = "SessionCredentialValue"; + var _SCe = "SessionCredentials"; + var _SCt = "StatusCode"; + var _SDV = "SkipDestinationValidation"; + var _SE = "StatsEvent"; + var _SIM = "SourceIfMatch"; + var _SIMS = "SourceIfModifiedSince"; + var _SINM = "SourceIfNoneMatch"; + var _SIUS = "SourceIfUnmodifiedSince"; + var _SK = "SSE-KMS"; + var _SKEO = "SseKmsEncryptedObjects"; + var _SKF = "S3KeyFilter"; + var _SKe = "S3Key"; + var _SL = "S3Location"; + var _SM = "SessionMode"; + var _SOC = "SelectObjectContent"; + var _SOCES = "SelectObjectContentEventStream"; + var _SOCO = "SelectObjectContentOutput"; + var _SOCR = "SelectObjectContentRequest"; + var _SP = "SelectParameters"; + var _SPi = "SimplePrefix"; + var _SR = "ScanRange"; + var _SS = "SSE-S3"; + var _SSC = "SourceSelectionCriteria"; + var _SSE = "ServerSideEncryption"; + var _SSEA = "SSEAlgorithm"; + var _SSEBD = "ServerSideEncryptionByDefault"; + var _SSEC = "ServerSideEncryptionConfiguration"; + var _SSECA = "SSECustomerAlgorithm"; + var _SSECK = "SSECustomerKey"; + var _SSECKMD = "SSECustomerKeyMD5"; + var _SSEKMS = "SSEKMS"; + var _SSEKMSE = "SSEKMSEncryption"; + var _SSEKMSEC = "SSEKMSEncryptionContext"; + var _SSEKMSKI = "SSEKMSKeyId"; + var _SSER = "ServerSideEncryptionRule"; + var _SSERe = "ServerSideEncryptionRules"; + var _SSES = "SSES3"; + var _ST2 = "SessionToken"; + var _STD = "S3TablesDestination"; + var _STDR = "S3TablesDestinationResult"; + var _S_ = "S3"; + var _Sc = "Schedule"; + var _Si = "Size"; + var _St = "Start"; + var _Sta = "Stats"; + var _Su = "Suffix"; + var _T2 = "Tags"; + var _TA = "TableArn"; + var _TAo = "TopicArn"; + var _TB = "TargetBucket"; + var _TBA = "TableBucketArn"; + var _TBT = "TableBucketType"; + var _TC2 = "TagCount"; + var _TCL = "TopicConfigurationList"; + var _TCo = "TopicConfigurations"; + var _TCop = "TopicConfiguration"; + var _TD = "TaggingDirective"; + var _TDMOS = "TransitionDefaultMinimumObjectSize"; + var _TG = "TargetGrants"; + var _TGa = "TargetGrant"; + var _TL = "TieringList"; + var _TLr = "TransitionList"; + var _TMP = "TooManyParts"; + var _TN = "TableNamespace"; + var _TNa = "TableName"; + var _TOKF = "TargetObjectKeyFormat"; + var _TP = "TargetPrefix"; + var _TPC = "TotalPartsCount"; + var _TS = "TagSet"; + var _TSa = "TableStatus"; + var _Ta2 = "Tag"; + var _Tag = "Tagging"; + var _Ti = "Tier"; + var _Tie = "Tierings"; + var _Tier = "Tiering"; + var _Tim = "Time"; + var _To = "Token"; + var _Top = "Topic"; + var _Tr = "Transitions"; + var _Tra = "Transition"; + var _Ty = "Type"; + var _U = "Uploads"; + var _UBMITC = "UpdateBucketMetadataInventoryTableConfiguration"; + var _UBMITCR = "UpdateBucketMetadataInventoryTableConfigurationRequest"; + var _UBMJTC = "UpdateBucketMetadataJournalTableConfiguration"; + var _UBMJTCR = "UpdateBucketMetadataJournalTableConfigurationRequest"; + var _UI = "UploadId"; + var _UIM = "UploadIdMarker"; + var _UM = "UserMetadata"; + var _UOE = "UpdateObjectEncryption"; + var _UOER = "UpdateObjectEncryptionRequest"; + var _UOERp = "UpdateObjectEncryptionResponse"; + var _UP = "UploadPart"; + var _UPC = "UploadPartCopy"; + var _UPCO = "UploadPartCopyOutput"; + var _UPCR = "UploadPartCopyRequest"; + var _UPO = "UploadPartOutput"; + var _UPR = "UploadPartRequest"; + var _URI = "URI"; + var _Up = "Upload"; + var _V2 = "Value"; + var _VC = "VersioningConfiguration"; + var _VI = "VersionId"; + var _VIM = "VersionIdMarker"; + var _Ve = "Versions"; + var _Ver = "Version"; + var _WC = "WebsiteConfiguration"; + var _WGOR = "WriteGetObjectResponse"; + var _WGORR = "WriteGetObjectResponseRequest"; + var _WOB = "WriteOffsetBytes"; + var _WRL = "WebsiteRedirectLocation"; + var _Y = "Years"; + var _ar = "accept-ranges"; + var _br = "bucket-region"; + var _c4 = "client"; + var _ct = "continuation-token"; + var _d = "delimiter"; + var _e4 = "error"; + var _eP = "eventPayload"; + var _en = "endpoint"; + var _et = "encoding-type"; + var _fo = "fetch-owner"; + var _h3 = "http"; + var _hC = "httpChecksum"; + var _hE4 = "httpError"; + var _hH = "httpHeader"; + var _hL = "hostLabel"; + var _hP = "httpPayload"; + var _hPH = "httpPrefixHeaders"; + var _hQ = "httpQuery"; + var _hi = "http://www.w3.org/2001/XMLSchema-instance"; + var _i = "id"; + var _iT3 = "idempotencyToken"; + var _km = "key-marker"; + var _m3 = "marker"; + var _mb = "max-buckets"; + var _mdb = "max-directory-buckets"; + var _mk = "max-keys"; + var _mp = "max-parts"; + var _mu = "max-uploads"; + var _p = "prefix"; + var _pN = "partNumber"; + var _pnm = "part-number-marker"; + var _rcc = "response-cache-control"; + var _rcd = "response-content-disposition"; + var _rce = "response-content-encoding"; + var _rcl = "response-content-language"; + var _rct = "response-content-type"; + var _re = "response-expires"; + var _s4 = "smithy.ts.sdk.synthetic.com.amazonaws.s3"; + var _sa = "start-after"; + var _st = "streaming"; + var _uI = "uploadId"; + var _uim = "upload-id-marker"; + var _vI = "versionId"; + var _vim = "version-id-marker"; + var _x = "xsi"; + var _xA = "xmlAttribute"; + var _xF = "xmlFlattened"; + var _xN = "xmlName"; + var _xNm = "xmlNamespace"; + var _xaa = "x-amz-acl"; + var _xaad = "x-amz-abort-date"; + var _xaapa = "x-amz-access-point-alias"; + var _xaari = "x-amz-abort-rule-id"; + var _xaas = "x-amz-archive-status"; + var _xaba = "x-amz-bucket-arn"; + var _xabgr = "x-amz-bypass-governance-retention"; + var _xabln = "x-amz-bucket-location-name"; + var _xablt = "x-amz-bucket-location-type"; + var _xabole = "x-amz-bucket-object-lock-enabled"; + var _xabolt = "x-amz-bucket-object-lock-token"; + var _xabr = "x-amz-bucket-region"; + var _xaca = "x-amz-checksum-algorithm"; + var _xacc = "x-amz-checksum-crc32"; + var _xacc_ = "x-amz-checksum-crc32c"; + var _xacc__ = "x-amz-checksum-crc64nvme"; + var _xacm = "x-amz-checksum-mode"; + var _xacrsba = "x-amz-confirm-remove-self-bucket-access"; + var _xacs = "x-amz-checksum-sha1"; + var _xacs_ = "x-amz-checksum-sha256"; + var _xacs__ = "x-amz-copy-source"; + var _xacsim = "x-amz-copy-source-if-match"; + var _xacsims = "x-amz-copy-source-if-modified-since"; + var _xacsinm = "x-amz-copy-source-if-none-match"; + var _xacsius = "x-amz-copy-source-if-unmodified-since"; + var _xacsm = "x-amz-create-session-mode"; + var _xacsr = "x-amz-copy-source-range"; + var _xacssseca = "x-amz-copy-source-server-side-encryption-customer-algorithm"; + var _xacssseck = "x-amz-copy-source-server-side-encryption-customer-key"; + var _xacssseckM = "x-amz-copy-source-server-side-encryption-customer-key-MD5"; + var _xacsvi = "x-amz-copy-source-version-id"; + var _xact = "x-amz-checksum-type"; + var _xact_ = "x-amz-client-token"; + var _xadm = "x-amz-delete-marker"; + var _xae = "x-amz-expiration"; + var _xaebo = "x-amz-expected-bucket-owner"; + var _xafec = "x-amz-fwd-error-code"; + var _xafem = "x-amz-fwd-error-message"; + var _xafhCC = "x-amz-fwd-header-Cache-Control"; + var _xafhCD = "x-amz-fwd-header-Content-Disposition"; + var _xafhCE = "x-amz-fwd-header-Content-Encoding"; + var _xafhCL = "x-amz-fwd-header-Content-Language"; + var _xafhCR = "x-amz-fwd-header-Content-Range"; + var _xafhCT = "x-amz-fwd-header-Content-Type"; + var _xafhE = "x-amz-fwd-header-ETag"; + var _xafhE_ = "x-amz-fwd-header-Expires"; + var _xafhLM = "x-amz-fwd-header-Last-Modified"; + var _xafhar = "x-amz-fwd-header-accept-ranges"; + var _xafhxacc = "x-amz-fwd-header-x-amz-checksum-crc32"; + var _xafhxacc_ = "x-amz-fwd-header-x-amz-checksum-crc32c"; + var _xafhxacc__ = "x-amz-fwd-header-x-amz-checksum-crc64nvme"; + var _xafhxacs = "x-amz-fwd-header-x-amz-checksum-sha1"; + var _xafhxacs_ = "x-amz-fwd-header-x-amz-checksum-sha256"; + var _xafhxadm = "x-amz-fwd-header-x-amz-delete-marker"; + var _xafhxae = "x-amz-fwd-header-x-amz-expiration"; + var _xafhxamm = "x-amz-fwd-header-x-amz-missing-meta"; + var _xafhxampc = "x-amz-fwd-header-x-amz-mp-parts-count"; + var _xafhxaollh = "x-amz-fwd-header-x-amz-object-lock-legal-hold"; + var _xafhxaolm = "x-amz-fwd-header-x-amz-object-lock-mode"; + var _xafhxaolrud = "x-amz-fwd-header-x-amz-object-lock-retain-until-date"; + var _xafhxar = "x-amz-fwd-header-x-amz-restore"; + var _xafhxarc = "x-amz-fwd-header-x-amz-request-charged"; + var _xafhxars = "x-amz-fwd-header-x-amz-replication-status"; + var _xafhxasc = "x-amz-fwd-header-x-amz-storage-class"; + var _xafhxasse = "x-amz-fwd-header-x-amz-server-side-encryption"; + var _xafhxasseakki = "x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id"; + var _xafhxassebke = "x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled"; + var _xafhxasseca = "x-amz-fwd-header-x-amz-server-side-encryption-customer-algorithm"; + var _xafhxasseckM = "x-amz-fwd-header-x-amz-server-side-encryption-customer-key-MD5"; + var _xafhxatc = "x-amz-fwd-header-x-amz-tagging-count"; + var _xafhxavi = "x-amz-fwd-header-x-amz-version-id"; + var _xafs = "x-amz-fwd-status"; + var _xagfc = "x-amz-grant-full-control"; + var _xagr = "x-amz-grant-read"; + var _xagra = "x-amz-grant-read-acp"; + var _xagw = "x-amz-grant-write"; + var _xagwa = "x-amz-grant-write-acp"; + var _xaimit = "x-amz-if-match-initiated-time"; + var _xaimlmt = "x-amz-if-match-last-modified-time"; + var _xaims = "x-amz-if-match-size"; + var _xam = "x-amz-meta-"; + var _xam_ = "x-amz-mfa"; + var _xamd = "x-amz-metadata-directive"; + var _xamm = "x-amz-missing-meta"; + var _xamos = "x-amz-mp-object-size"; + var _xamp = "x-amz-max-parts"; + var _xampc = "x-amz-mp-parts-count"; + var _xaoa = "x-amz-object-attributes"; + var _xaollh = "x-amz-object-lock-legal-hold"; + var _xaolm = "x-amz-object-lock-mode"; + var _xaolrud = "x-amz-object-lock-retain-until-date"; + var _xaoo = "x-amz-object-ownership"; + var _xaooa = "x-amz-optional-object-attributes"; + var _xaos = "x-amz-object-size"; + var _xapnm = "x-amz-part-number-marker"; + var _xar = "x-amz-restore"; + var _xarc = "x-amz-request-charged"; + var _xarop = "x-amz-restore-output-path"; + var _xarp = "x-amz-request-payer"; + var _xarr = "x-amz-request-route"; + var _xars = "x-amz-replication-status"; + var _xars_ = "x-amz-rename-source"; + var _xarsim = "x-amz-rename-source-if-match"; + var _xarsims = "x-amz-rename-source-if-modified-since"; + var _xarsinm = "x-amz-rename-source-if-none-match"; + var _xarsius = "x-amz-rename-source-if-unmodified-since"; + var _xart = "x-amz-request-token"; + var _xasc = "x-amz-storage-class"; + var _xasca = "x-amz-sdk-checksum-algorithm"; + var _xasdv = "x-amz-skip-destination-validation"; + var _xasebo = "x-amz-source-expected-bucket-owner"; + var _xasse = "x-amz-server-side-encryption"; + var _xasseakki = "x-amz-server-side-encryption-aws-kms-key-id"; + var _xassebke = "x-amz-server-side-encryption-bucket-key-enabled"; + var _xassec = "x-amz-server-side-encryption-context"; + var _xasseca = "x-amz-server-side-encryption-customer-algorithm"; + var _xasseck = "x-amz-server-side-encryption-customer-key"; + var _xasseckM = "x-amz-server-side-encryption-customer-key-MD5"; + var _xat = "x-amz-tagging"; + var _xatc = "x-amz-tagging-count"; + var _xatd = "x-amz-tagging-directive"; + var _xatdmos = "x-amz-transition-default-minimum-object-size"; + var _xavi = "x-amz-version-id"; + var _xawob = "x-amz-write-offset-bytes"; + var _xawrl = "x-amz-website-redirect-location"; + var _xs = "xsi:type"; + var n04 = "com.amazonaws.s3"; + var schema_1 = (init_schema(), __toCommonJS(schema_exports)); + var errors_1 = require_errors4(); + var S3ServiceException_1 = require_S3ServiceException(); + var _s_registry4 = schema_1.TypeRegistry.for(_s4); + exports2.S3ServiceException$ = [-3, _s4, "S3ServiceException", 0, [], []]; + _s_registry4.registerError(exports2.S3ServiceException$, S3ServiceException_1.S3ServiceException); + var n0_registry4 = schema_1.TypeRegistry.for(n04); + exports2.AccessDenied$ = [ + -3, + n04, + _AD, + { [_e4]: _c4, [_hE4]: 403 }, + [], + [] + ]; + n0_registry4.registerError(exports2.AccessDenied$, errors_1.AccessDenied); + exports2.BucketAlreadyExists$ = [ + -3, + n04, + _BAE, + { [_e4]: _c4, [_hE4]: 409 }, + [], + [] + ]; + n0_registry4.registerError(exports2.BucketAlreadyExists$, errors_1.BucketAlreadyExists); + exports2.BucketAlreadyOwnedByYou$ = [ + -3, + n04, + _BAOBY, + { [_e4]: _c4, [_hE4]: 409 }, + [], + [] + ]; + n0_registry4.registerError(exports2.BucketAlreadyOwnedByYou$, errors_1.BucketAlreadyOwnedByYou); + exports2.EncryptionTypeMismatch$ = [ + -3, + n04, + _ETM, + { [_e4]: _c4, [_hE4]: 400 }, + [], + [] + ]; + n0_registry4.registerError(exports2.EncryptionTypeMismatch$, errors_1.EncryptionTypeMismatch); + exports2.IdempotencyParameterMismatch$ = [ + -3, + n04, + _IPM, + { [_e4]: _c4, [_hE4]: 400 }, + [], + [] + ]; + n0_registry4.registerError(exports2.IdempotencyParameterMismatch$, errors_1.IdempotencyParameterMismatch); + exports2.InvalidObjectState$ = [ + -3, + n04, + _IOS, + { [_e4]: _c4, [_hE4]: 403 }, + [_SC, _AT3], + [0, 0] + ]; + n0_registry4.registerError(exports2.InvalidObjectState$, errors_1.InvalidObjectState); + exports2.InvalidRequest$ = [ + -3, + n04, + _IR, + { [_e4]: _c4, [_hE4]: 400 }, + [], + [] + ]; + n0_registry4.registerError(exports2.InvalidRequest$, errors_1.InvalidRequest); + exports2.InvalidWriteOffset$ = [ + -3, + n04, + _IWO, + { [_e4]: _c4, [_hE4]: 400 }, + [], + [] + ]; + n0_registry4.registerError(exports2.InvalidWriteOffset$, errors_1.InvalidWriteOffset); + exports2.NoSuchBucket$ = [ + -3, + n04, + _NSB, + { [_e4]: _c4, [_hE4]: 404 }, + [], + [] + ]; + n0_registry4.registerError(exports2.NoSuchBucket$, errors_1.NoSuchBucket); + exports2.NoSuchKey$ = [ + -3, + n04, + _NSK, + { [_e4]: _c4, [_hE4]: 404 }, + [], + [] + ]; + n0_registry4.registerError(exports2.NoSuchKey$, errors_1.NoSuchKey); + exports2.NoSuchUpload$ = [ + -3, + n04, + _NSU, + { [_e4]: _c4, [_hE4]: 404 }, + [], + [] + ]; + n0_registry4.registerError(exports2.NoSuchUpload$, errors_1.NoSuchUpload); + exports2.NotFound$ = [ + -3, + n04, + _NF, + { [_e4]: _c4 }, + [], + [] + ]; + n0_registry4.registerError(exports2.NotFound$, errors_1.NotFound); + exports2.ObjectAlreadyInActiveTierError$ = [ + -3, + n04, + _OAIATE, + { [_e4]: _c4, [_hE4]: 403 }, + [], + [] + ]; + n0_registry4.registerError(exports2.ObjectAlreadyInActiveTierError$, errors_1.ObjectAlreadyInActiveTierError); + exports2.ObjectNotInActiveTierError$ = [ + -3, + n04, + _ONIATE, + { [_e4]: _c4, [_hE4]: 403 }, + [], + [] + ]; + n0_registry4.registerError(exports2.ObjectNotInActiveTierError$, errors_1.ObjectNotInActiveTierError); + exports2.TooManyParts$ = [ + -3, + n04, + _TMP, + { [_e4]: _c4, [_hE4]: 400 }, + [], + [] + ]; + n0_registry4.registerError(exports2.TooManyParts$, errors_1.TooManyParts); + exports2.errorTypeRegistries = [ + _s_registry4, + n0_registry4 + ]; + var CopySourceSSECustomerKey = [0, n04, _CSSSECK, 8, 0]; + var NonEmptyKmsKeyArnString = [0, n04, _NEKKAS, 8, 0]; + var SessionCredentialValue = [0, n04, _SCV, 8, 0]; + var SSECustomerKey = [0, n04, _SSECK, 8, 0]; + var SSEKMSEncryptionContext = [0, n04, _SSEKMSEC, 8, 0]; + var SSEKMSKeyId = [0, n04, _SSEKMSKI, 8, 0]; + var StreamingBlob = [0, n04, _SB, { [_st]: 1 }, 42]; + exports2.AbacStatus$ = [ + 3, + n04, + _AS, + 0, + [_S], + [0] + ]; + exports2.AbortIncompleteMultipartUpload$ = [ + 3, + n04, + _AIMU, + 0, + [_DAI], + [1] + ]; + exports2.AbortMultipartUploadOutput$ = [ + 3, + n04, + _AMUO, + 0, + [_RC], + [[0, { [_hH]: _xarc }]] + ]; + exports2.AbortMultipartUploadRequest$ = [ + 3, + n04, + _AMUR, + 0, + [_B, _K2, _UI, _RP, _EBO, _IMIT], + [[0, 1], [0, 1], [0, { [_hQ]: _uI }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }], [6, { [_hH]: _xaimit }]], + 3 + ]; + exports2.AccelerateConfiguration$ = [ + 3, + n04, + _AC, + 0, + [_S], + [0] + ]; + exports2.AccessControlPolicy$ = [ + 3, + n04, + _ACP, + 0, + [_G, _O], + [[() => Grants, { [_xN]: _ACL }], () => exports2.Owner$] + ]; + exports2.AccessControlTranslation$ = [ + 3, + n04, + _ACT, + 0, + [_O], + [0], + 1 + ]; + exports2.AnalyticsAndOperator$ = [ + 3, + n04, + _AAO, + 0, + [_P2, _T2], + [0, [() => TagSet, { [_xF]: 1, [_xN]: _Ta2 }]] + ]; + exports2.AnalyticsConfiguration$ = [ + 3, + n04, + _ACn, + 0, + [_I, _SCA, _F], + [0, () => exports2.StorageClassAnalysis$, [() => exports2.AnalyticsFilter$, 0]], + 2 + ]; + exports2.AnalyticsExportDestination$ = [ + 3, + n04, + _AED, + 0, + [_SBD], + [() => exports2.AnalyticsS3BucketDestination$], + 1 + ]; + exports2.AnalyticsS3BucketDestination$ = [ + 3, + n04, + _ASBD, + 0, + [_Fo, _B, _BAI, _P2], + [0, 0, 0, 0], + 2 + ]; + exports2.BlockedEncryptionTypes$ = [ + 3, + n04, + _BET, + 0, + [_ET], + [[() => EncryptionTypeList, { [_xF]: 1 }]] + ]; + exports2.Bucket$ = [ + 3, + n04, + _B, + 0, + [_N, _CD, _BR, _BA], + [0, 4, 0, 0] + ]; + exports2.BucketInfo$ = [ + 3, + n04, + _BI, + 0, + [_DR, _Ty], + [0, 0] + ]; + exports2.BucketLifecycleConfiguration$ = [ + 3, + n04, + _BLC, + 0, + [_R], + [[() => LifecycleRules, { [_xF]: 1, [_xN]: _Ru }]], + 1 + ]; + exports2.BucketLoggingStatus$ = [ + 3, + n04, + _BLS, + 0, + [_LE], + [[() => exports2.LoggingEnabled$, 0]] + ]; + exports2.Checksum$ = [ + 3, + n04, + _C2, + 0, + [_CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _CT2], + [0, 0, 0, 0, 0, 0] + ]; + exports2.CommonPrefix$ = [ + 3, + n04, + _CP, + 0, + [_P2], + [0] + ]; + exports2.CompletedMultipartUpload$ = [ + 3, + n04, + _CMU, + 0, + [_Pa], + [[() => CompletedPartList, { [_xF]: 1, [_xN]: _Par }]] + ]; + exports2.CompletedPart$ = [ + 3, + n04, + _CPo, + 0, + [_ETa, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _PN], + [0, 0, 0, 0, 0, 0, 1] + ]; + exports2.CompleteMultipartUploadOutput$ = [ + 3, + n04, + _CMUO, + { [_xN]: _CMUR }, + [_L, _B, _K2, _E2, _ETa, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _CT2, _SSE, _VI, _SSEKMSKI, _BKE, _RC], + [0, 0, 0, [0, { [_hH]: _xae }], 0, 0, 0, 0, 0, 0, 0, [0, { [_hH]: _xasse }], [0, { [_hH]: _xavi }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xarc }]] + ]; + exports2.CompleteMultipartUploadRequest$ = [ + 3, + n04, + _CMURo, + 0, + [_B, _K2, _UI, _MU, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _CT2, _MOS, _RP, _EBO, _IM, _INM, _SSECA, _SSECK, _SSECKMD], + [[0, 1], [0, 1], [0, { [_hQ]: _uI }], [() => exports2.CompletedMultipartUpload$, { [_hP]: 1, [_xN]: _CMUo }], [0, { [_hH]: _xacc }], [0, { [_hH]: _xacc_ }], [0, { [_hH]: _xacc__ }], [0, { [_hH]: _xacs }], [0, { [_hH]: _xacs_ }], [0, { [_hH]: _xact }], [1, { [_hH]: _xamos }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _IM_ }], [0, { [_hH]: _INM_ }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }]], + 3 + ]; + exports2.Condition$ = [ + 3, + n04, + _Co, + 0, + [_HECRE, _KPE], + [0, 0] + ]; + exports2.ContinuationEvent$ = [ + 3, + n04, + _CE, + 0, + [], + [] + ]; + exports2.CopyObjectOutput$ = [ + 3, + n04, + _COO, + 0, + [_COR, _E2, _CSVI, _VI, _SSE, _SSECA, _SSECKMD, _SSEKMSKI, _SSEKMSEC, _BKE, _RC], + [[() => exports2.CopyObjectResult$, 16], [0, { [_hH]: _xae }], [0, { [_hH]: _xacsvi }], [0, { [_hH]: _xavi }], [0, { [_hH]: _xasse }], [0, { [_hH]: _xasseca }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xarc }]] + ]; + exports2.CopyObjectRequest$ = [ + 3, + n04, + _CORo, + 0, + [_B, _CS2, _K2, _ACL_, _CC, _CA2, _CDo, _CEo, _CL, _CTo, _CSIM, _CSIMS, _CSINM, _CSIUS, _Ex, _GFC, _GR, _GRACP, _GWACP, _IM, _INM, _M, _MD, _TD, _SSE, _SC, _WRL, _SSECA, _SSECK, _SSECKMD, _SSEKMSKI, _SSEKMSEC, _BKE, _CSSSECA, _CSSSECK, _CSSSECKMD, _RP, _Tag, _OLM, _OLRUD, _OLLHS, _EBO, _ESBO], + [[0, 1], [0, { [_hH]: _xacs__ }], [0, 1], [0, { [_hH]: _xaa }], [0, { [_hH]: _CC_ }], [0, { [_hH]: _xaca }], [0, { [_hH]: _CD_ }], [0, { [_hH]: _CE_ }], [0, { [_hH]: _CL_ }], [0, { [_hH]: _CT_ }], [0, { [_hH]: _xacsim }], [4, { [_hH]: _xacsims }], [0, { [_hH]: _xacsinm }], [4, { [_hH]: _xacsius }], [4, { [_hH]: _Ex }], [0, { [_hH]: _xagfc }], [0, { [_hH]: _xagr }], [0, { [_hH]: _xagra }], [0, { [_hH]: _xagwa }], [0, { [_hH]: _IM_ }], [0, { [_hH]: _INM_ }], [128 | 0, { [_hPH]: _xam }], [0, { [_hH]: _xamd }], [0, { [_hH]: _xatd }], [0, { [_hH]: _xasse }], [0, { [_hH]: _xasc }], [0, { [_hH]: _xawrl }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xacssseca }], [() => CopySourceSSECustomerKey, { [_hH]: _xacssseck }], [0, { [_hH]: _xacssseckM }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xat }], [0, { [_hH]: _xaolm }], [5, { [_hH]: _xaolrud }], [0, { [_hH]: _xaollh }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xasebo }]], + 3 + ]; + exports2.CopyObjectResult$ = [ + 3, + n04, + _COR, + 0, + [_ETa, _LM, _CT2, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh], + [0, 4, 0, 0, 0, 0, 0, 0] + ]; + exports2.CopyPartResult$ = [ + 3, + n04, + _CPR, + 0, + [_ETa, _LM, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh], + [0, 4, 0, 0, 0, 0, 0] + ]; + exports2.CORSConfiguration$ = [ + 3, + n04, + _CORSC, + 0, + [_CORSR], + [[() => CORSRules, { [_xF]: 1, [_xN]: _CORSRu }]], + 1 + ]; + exports2.CORSRule$ = [ + 3, + n04, + _CORSRu, + 0, + [_AM, _AO, _ID, _AH, _EH, _MAS], + [[64 | 0, { [_xF]: 1, [_xN]: _AMl }], [64 | 0, { [_xF]: 1, [_xN]: _AOl }], 0, [64 | 0, { [_xF]: 1, [_xN]: _AHl }], [64 | 0, { [_xF]: 1, [_xN]: _EHx }], 1], + 2 + ]; + exports2.CreateBucketConfiguration$ = [ + 3, + n04, + _CBC, + 0, + [_LC, _L, _B, _T2], + [0, () => exports2.LocationInfo$, () => exports2.BucketInfo$, [() => TagSet, 0]] + ]; + exports2.CreateBucketMetadataConfigurationRequest$ = [ + 3, + n04, + _CBMCR, + 0, + [_B, _MC, _CMD, _CA2, _EBO], + [[0, 1], [() => exports2.MetadataConfiguration$, { [_hP]: 1, [_xN]: _MC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.CreateBucketMetadataTableConfigurationRequest$ = [ + 3, + n04, + _CBMTCR, + 0, + [_B, _MTC, _CMD, _CA2, _EBO], + [[0, 1], [() => exports2.MetadataTableConfiguration$, { [_hP]: 1, [_xN]: _MTC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.CreateBucketOutput$ = [ + 3, + n04, + _CBO, + 0, + [_L, _BA], + [[0, { [_hH]: _L }], [0, { [_hH]: _xaba }]] + ]; + exports2.CreateBucketRequest$ = [ + 3, + n04, + _CBR, + 0, + [_B, _ACL_, _CBC, _GFC, _GR, _GRACP, _GW, _GWACP, _OLEFB, _OO], + [[0, 1], [0, { [_hH]: _xaa }], [() => exports2.CreateBucketConfiguration$, { [_hP]: 1, [_xN]: _CBC }], [0, { [_hH]: _xagfc }], [0, { [_hH]: _xagr }], [0, { [_hH]: _xagra }], [0, { [_hH]: _xagw }], [0, { [_hH]: _xagwa }], [2, { [_hH]: _xabole }], [0, { [_hH]: _xaoo }]], + 1 + ]; + exports2.CreateMultipartUploadOutput$ = [ + 3, + n04, + _CMUOr, + { [_xN]: _IMUR }, + [_ADb, _ARI2, _B, _K2, _UI, _SSE, _SSECA, _SSECKMD, _SSEKMSKI, _SSEKMSEC, _BKE, _RC, _CA2, _CT2], + [[4, { [_hH]: _xaad }], [0, { [_hH]: _xaari }], [0, { [_xN]: _B }], 0, 0, [0, { [_hH]: _xasse }], [0, { [_hH]: _xasseca }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xarc }], [0, { [_hH]: _xaca }], [0, { [_hH]: _xact }]] + ]; + exports2.CreateMultipartUploadRequest$ = [ + 3, + n04, + _CMURr, + 0, + [_B, _K2, _ACL_, _CC, _CDo, _CEo, _CL, _CTo, _Ex, _GFC, _GR, _GRACP, _GWACP, _M, _SSE, _SC, _WRL, _SSECA, _SSECK, _SSECKMD, _SSEKMSKI, _SSEKMSEC, _BKE, _RP, _Tag, _OLM, _OLRUD, _OLLHS, _EBO, _CA2, _CT2], + [[0, 1], [0, 1], [0, { [_hH]: _xaa }], [0, { [_hH]: _CC_ }], [0, { [_hH]: _CD_ }], [0, { [_hH]: _CE_ }], [0, { [_hH]: _CL_ }], [0, { [_hH]: _CT_ }], [4, { [_hH]: _Ex }], [0, { [_hH]: _xagfc }], [0, { [_hH]: _xagr }], [0, { [_hH]: _xagra }], [0, { [_hH]: _xagwa }], [128 | 0, { [_hPH]: _xam }], [0, { [_hH]: _xasse }], [0, { [_hH]: _xasc }], [0, { [_hH]: _xawrl }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xat }], [0, { [_hH]: _xaolm }], [5, { [_hH]: _xaolrud }], [0, { [_hH]: _xaollh }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xaca }], [0, { [_hH]: _xact }]], + 2 + ]; + exports2.CreateSessionOutput$ = [ + 3, + n04, + _CSO, + { [_xN]: _CSR }, + [_Cr, _SSE, _SSEKMSKI, _SSEKMSEC, _BKE], + [[() => exports2.SessionCredentials$, { [_xN]: _Cr }], [0, { [_hH]: _xasse }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }]], + 1 + ]; + exports2.CreateSessionRequest$ = [ + 3, + n04, + _CSRr, + 0, + [_B, _SM, _SSE, _SSEKMSKI, _SSEKMSEC, _BKE], + [[0, 1], [0, { [_hH]: _xacsm }], [0, { [_hH]: _xasse }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }]], + 1 + ]; + exports2.CSVInput$ = [ + 3, + n04, + _CSVIn, + 0, + [_FHI, _Com, _QEC, _RD, _FD, _QC, _AQRD], + [0, 0, 0, 0, 0, 0, 2] + ]; + exports2.CSVOutput$ = [ + 3, + n04, + _CSVO, + 0, + [_QF, _QEC, _RD, _FD, _QC], + [0, 0, 0, 0, 0] + ]; + exports2.DefaultRetention$ = [ + 3, + n04, + _DRe, + 0, + [_Mo, _D, _Y], + [0, 1, 1] + ]; + exports2.Delete$ = [ + 3, + n04, + _De, + 0, + [_Ob, _Q], + [[() => ObjectIdentifierList, { [_xF]: 1, [_xN]: _Obj }], 2], + 1 + ]; + exports2.DeleteBucketAnalyticsConfigurationRequest$ = [ + 3, + n04, + _DBACR, + 0, + [_B, _I, _EBO], + [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.DeleteBucketCorsRequest$ = [ + 3, + n04, + _DBCR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.DeleteBucketEncryptionRequest$ = [ + 3, + n04, + _DBER, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.DeleteBucketIntelligentTieringConfigurationRequest$ = [ + 3, + n04, + _DBITCR, + 0, + [_B, _I, _EBO], + [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.DeleteBucketInventoryConfigurationRequest$ = [ + 3, + n04, + _DBICR, + 0, + [_B, _I, _EBO], + [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.DeleteBucketLifecycleRequest$ = [ + 3, + n04, + _DBLR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.DeleteBucketMetadataConfigurationRequest$ = [ + 3, + n04, + _DBMCR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.DeleteBucketMetadataTableConfigurationRequest$ = [ + 3, + n04, + _DBMTCR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.DeleteBucketMetricsConfigurationRequest$ = [ + 3, + n04, + _DBMCRe, + 0, + [_B, _I, _EBO], + [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.DeleteBucketOwnershipControlsRequest$ = [ + 3, + n04, + _DBOCR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.DeleteBucketPolicyRequest$ = [ + 3, + n04, + _DBPR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.DeleteBucketReplicationRequest$ = [ + 3, + n04, + _DBRR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.DeleteBucketRequest$ = [ + 3, + n04, + _DBR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.DeleteBucketTaggingRequest$ = [ + 3, + n04, + _DBTR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.DeleteBucketWebsiteRequest$ = [ + 3, + n04, + _DBWR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.DeletedObject$ = [ + 3, + n04, + _DO, + 0, + [_K2, _VI, _DM, _DMVI], + [0, 0, 2, 0] + ]; + exports2.DeleteMarkerEntry$ = [ + 3, + n04, + _DME, + 0, + [_O, _K2, _VI, _IL, _LM], + [() => exports2.Owner$, 0, 0, 2, 4] + ]; + exports2.DeleteMarkerReplication$ = [ + 3, + n04, + _DMR, + 0, + [_S], + [0] + ]; + exports2.DeleteObjectOutput$ = [ + 3, + n04, + _DOO, + 0, + [_DM, _VI, _RC], + [[2, { [_hH]: _xadm }], [0, { [_hH]: _xavi }], [0, { [_hH]: _xarc }]] + ]; + exports2.DeleteObjectRequest$ = [ + 3, + n04, + _DOR, + 0, + [_B, _K2, _MFA, _VI, _RP, _BGR, _EBO, _IM, _IMLMT, _IMS], + [[0, 1], [0, 1], [0, { [_hH]: _xam_ }], [0, { [_hQ]: _vI }], [0, { [_hH]: _xarp }], [2, { [_hH]: _xabgr }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _IM_ }], [6, { [_hH]: _xaimlmt }], [1, { [_hH]: _xaims }]], + 2 + ]; + exports2.DeleteObjectsOutput$ = [ + 3, + n04, + _DOOe, + { [_xN]: _DRel }, + [_Del, _RC, _Er], + [[() => DeletedObjects, { [_xF]: 1 }], [0, { [_hH]: _xarc }], [() => Errors, { [_xF]: 1, [_xN]: _Err }]] + ]; + exports2.DeleteObjectsRequest$ = [ + 3, + n04, + _DORe, + 0, + [_B, _De, _MFA, _RP, _BGR, _EBO, _CA2], + [[0, 1], [() => exports2.Delete$, { [_hP]: 1, [_xN]: _De }], [0, { [_hH]: _xam_ }], [0, { [_hH]: _xarp }], [2, { [_hH]: _xabgr }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xasca }]], + 2 + ]; + exports2.DeleteObjectTaggingOutput$ = [ + 3, + n04, + _DOTO, + 0, + [_VI], + [[0, { [_hH]: _xavi }]] + ]; + exports2.DeleteObjectTaggingRequest$ = [ + 3, + n04, + _DOTR, + 0, + [_B, _K2, _VI, _EBO], + [[0, 1], [0, 1], [0, { [_hQ]: _vI }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.DeletePublicAccessBlockRequest$ = [ + 3, + n04, + _DPABR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.Destination$ = [ + 3, + n04, + _Des, + 0, + [_B, _A2, _SC, _ACT, _EC, _RT3, _Me], + [0, 0, 0, () => exports2.AccessControlTranslation$, () => exports2.EncryptionConfiguration$, () => exports2.ReplicationTime$, () => exports2.Metrics$], + 1 + ]; + exports2.DestinationResult$ = [ + 3, + n04, + _DRes, + 0, + [_TBT, _TBA, _TN], + [0, 0, 0] + ]; + exports2.Encryption$ = [ + 3, + n04, + _En, + 0, + [_ET, _KMSKI, _KMSC], + [0, [() => SSEKMSKeyId, 0], 0], + 1 + ]; + exports2.EncryptionConfiguration$ = [ + 3, + n04, + _EC, + 0, + [_RKKID], + [0] + ]; + exports2.EndEvent$ = [ + 3, + n04, + _EE, + 0, + [], + [] + ]; + exports2._Error$ = [ + 3, + n04, + _Err, + 0, + [_K2, _VI, _Cod, _Mes], + [0, 0, 0, 0] + ]; + exports2.ErrorDetails$ = [ + 3, + n04, + _ED, + 0, + [_ECr, _EM], + [0, 0] + ]; + exports2.ErrorDocument$ = [ + 3, + n04, + _EDr, + 0, + [_K2], + [0], + 1 + ]; + exports2.EventBridgeConfiguration$ = [ + 3, + n04, + _EBC, + 0, + [], + [] + ]; + exports2.ExistingObjectReplication$ = [ + 3, + n04, + _EOR, + 0, + [_S], + [0], + 1 + ]; + exports2.FilterRule$ = [ + 3, + n04, + _FR, + 0, + [_N, _V2], + [0, 0] + ]; + exports2.GetBucketAbacOutput$ = [ + 3, + n04, + _GBAO, + 0, + [_AS], + [[() => exports2.AbacStatus$, 16]] + ]; + exports2.GetBucketAbacRequest$ = [ + 3, + n04, + _GBAR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketAccelerateConfigurationOutput$ = [ + 3, + n04, + _GBACO, + { [_xN]: _AC }, + [_S, _RC], + [0, [0, { [_hH]: _xarc }]] + ]; + exports2.GetBucketAccelerateConfigurationRequest$ = [ + 3, + n04, + _GBACR, + 0, + [_B, _EBO, _RP], + [[0, 1], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xarp }]], + 1 + ]; + exports2.GetBucketAclOutput$ = [ + 3, + n04, + _GBAOe, + { [_xN]: _ACP }, + [_O, _G], + [() => exports2.Owner$, [() => Grants, { [_xN]: _ACL }]] + ]; + exports2.GetBucketAclRequest$ = [ + 3, + n04, + _GBARe, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketAnalyticsConfigurationOutput$ = [ + 3, + n04, + _GBACOe, + 0, + [_ACn], + [[() => exports2.AnalyticsConfiguration$, 16]] + ]; + exports2.GetBucketAnalyticsConfigurationRequest$ = [ + 3, + n04, + _GBACRe, + 0, + [_B, _I, _EBO], + [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.GetBucketCorsOutput$ = [ + 3, + n04, + _GBCO, + { [_xN]: _CORSC }, + [_CORSR], + [[() => CORSRules, { [_xF]: 1, [_xN]: _CORSRu }]] + ]; + exports2.GetBucketCorsRequest$ = [ + 3, + n04, + _GBCR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketEncryptionOutput$ = [ + 3, + n04, + _GBEO, + 0, + [_SSEC], + [[() => exports2.ServerSideEncryptionConfiguration$, 16]] + ]; + exports2.GetBucketEncryptionRequest$ = [ + 3, + n04, + _GBER, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketIntelligentTieringConfigurationOutput$ = [ + 3, + n04, + _GBITCO, + 0, + [_ITC], + [[() => exports2.IntelligentTieringConfiguration$, 16]] + ]; + exports2.GetBucketIntelligentTieringConfigurationRequest$ = [ + 3, + n04, + _GBITCR, + 0, + [_B, _I, _EBO], + [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.GetBucketInventoryConfigurationOutput$ = [ + 3, + n04, + _GBICO, + 0, + [_IC], + [[() => exports2.InventoryConfiguration$, 16]] + ]; + exports2.GetBucketInventoryConfigurationRequest$ = [ + 3, + n04, + _GBICR, + 0, + [_B, _I, _EBO], + [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.GetBucketLifecycleConfigurationOutput$ = [ + 3, + n04, + _GBLCO, + { [_xN]: _LCi }, + [_R, _TDMOS], + [[() => LifecycleRules, { [_xF]: 1, [_xN]: _Ru }], [0, { [_hH]: _xatdmos }]] + ]; + exports2.GetBucketLifecycleConfigurationRequest$ = [ + 3, + n04, + _GBLCR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketLocationOutput$ = [ + 3, + n04, + _GBLO, + { [_xN]: _LC }, + [_LC], + [0] + ]; + exports2.GetBucketLocationRequest$ = [ + 3, + n04, + _GBLR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketLoggingOutput$ = [ + 3, + n04, + _GBLOe, + { [_xN]: _BLS }, + [_LE], + [[() => exports2.LoggingEnabled$, 0]] + ]; + exports2.GetBucketLoggingRequest$ = [ + 3, + n04, + _GBLRe, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketMetadataConfigurationOutput$ = [ + 3, + n04, + _GBMCO, + 0, + [_GBMCR], + [[() => exports2.GetBucketMetadataConfigurationResult$, 16]] + ]; + exports2.GetBucketMetadataConfigurationRequest$ = [ + 3, + n04, + _GBMCRe, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketMetadataConfigurationResult$ = [ + 3, + n04, + _GBMCR, + 0, + [_MCR], + [() => exports2.MetadataConfigurationResult$], + 1 + ]; + exports2.GetBucketMetadataTableConfigurationOutput$ = [ + 3, + n04, + _GBMTCO, + 0, + [_GBMTCR], + [[() => exports2.GetBucketMetadataTableConfigurationResult$, 16]] + ]; + exports2.GetBucketMetadataTableConfigurationRequest$ = [ + 3, + n04, + _GBMTCRe, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketMetadataTableConfigurationResult$ = [ + 3, + n04, + _GBMTCR, + 0, + [_MTCR, _S, _Err], + [() => exports2.MetadataTableConfigurationResult$, 0, () => exports2.ErrorDetails$], + 2 + ]; + exports2.GetBucketMetricsConfigurationOutput$ = [ + 3, + n04, + _GBMCOe, + 0, + [_MCe], + [[() => exports2.MetricsConfiguration$, 16]] + ]; + exports2.GetBucketMetricsConfigurationRequest$ = [ + 3, + n04, + _GBMCRet, + 0, + [_B, _I, _EBO], + [[0, 1], [0, { [_hQ]: _i }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.GetBucketNotificationConfigurationRequest$ = [ + 3, + n04, + _GBNCR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketOwnershipControlsOutput$ = [ + 3, + n04, + _GBOCO, + 0, + [_OC], + [[() => exports2.OwnershipControls$, 16]] + ]; + exports2.GetBucketOwnershipControlsRequest$ = [ + 3, + n04, + _GBOCR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketPolicyOutput$ = [ + 3, + n04, + _GBPO, + 0, + [_Po], + [[0, 16]] + ]; + exports2.GetBucketPolicyRequest$ = [ + 3, + n04, + _GBPR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketPolicyStatusOutput$ = [ + 3, + n04, + _GBPSO, + 0, + [_PS], + [[() => exports2.PolicyStatus$, 16]] + ]; + exports2.GetBucketPolicyStatusRequest$ = [ + 3, + n04, + _GBPSR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketReplicationOutput$ = [ + 3, + n04, + _GBRO, + 0, + [_RCe], + [[() => exports2.ReplicationConfiguration$, 16]] + ]; + exports2.GetBucketReplicationRequest$ = [ + 3, + n04, + _GBRR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketRequestPaymentOutput$ = [ + 3, + n04, + _GBRPO, + { [_xN]: _RPC }, + [_Pay], + [0] + ]; + exports2.GetBucketRequestPaymentRequest$ = [ + 3, + n04, + _GBRPR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketTaggingOutput$ = [ + 3, + n04, + _GBTO, + { [_xN]: _Tag }, + [_TS], + [[() => TagSet, 0]], + 1 + ]; + exports2.GetBucketTaggingRequest$ = [ + 3, + n04, + _GBTR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketVersioningOutput$ = [ + 3, + n04, + _GBVO, + { [_xN]: _VC }, + [_S, _MFAD], + [0, [0, { [_xN]: _MDf }]] + ]; + exports2.GetBucketVersioningRequest$ = [ + 3, + n04, + _GBVR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetBucketWebsiteOutput$ = [ + 3, + n04, + _GBWO, + { [_xN]: _WC }, + [_RART, _IDn, _EDr, _RR], + [() => exports2.RedirectAllRequestsTo$, () => exports2.IndexDocument$, () => exports2.ErrorDocument$, [() => RoutingRules, 0]] + ]; + exports2.GetBucketWebsiteRequest$ = [ + 3, + n04, + _GBWR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetObjectAclOutput$ = [ + 3, + n04, + _GOAO, + { [_xN]: _ACP }, + [_O, _G, _RC], + [() => exports2.Owner$, [() => Grants, { [_xN]: _ACL }], [0, { [_hH]: _xarc }]] + ]; + exports2.GetObjectAclRequest$ = [ + 3, + n04, + _GOAR, + 0, + [_B, _K2, _VI, _RP, _EBO], + [[0, 1], [0, 1], [0, { [_hQ]: _vI }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.GetObjectAttributesOutput$ = [ + 3, + n04, + _GOAOe, + { [_xN]: _GOARe }, + [_DM, _LM, _VI, _RC, _ETa, _C2, _OP, _SC, _OS], + [[2, { [_hH]: _xadm }], [4, { [_hH]: _LM_ }], [0, { [_hH]: _xavi }], [0, { [_hH]: _xarc }], 0, () => exports2.Checksum$, [() => exports2.GetObjectAttributesParts$, 0], 0, 1] + ]; + exports2.GetObjectAttributesParts$ = [ + 3, + n04, + _GOAP, + 0, + [_TPC, _PNM, _NPNM, _MP, _IT2, _Pa], + [[1, { [_xN]: _PC2 }], 0, 0, 1, 2, [() => PartsList, { [_xF]: 1, [_xN]: _Par }]] + ]; + exports2.GetObjectAttributesRequest$ = [ + 3, + n04, + _GOARet, + 0, + [_B, _K2, _OA, _VI, _MP, _PNM, _SSECA, _SSECK, _SSECKMD, _RP, _EBO], + [[0, 1], [0, 1], [64 | 0, { [_hH]: _xaoa }], [0, { [_hQ]: _vI }], [1, { [_hH]: _xamp }], [0, { [_hH]: _xapnm }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }]], + 3 + ]; + exports2.GetObjectLegalHoldOutput$ = [ + 3, + n04, + _GOLHO, + 0, + [_LH], + [[() => exports2.ObjectLockLegalHold$, { [_hP]: 1, [_xN]: _LH }]] + ]; + exports2.GetObjectLegalHoldRequest$ = [ + 3, + n04, + _GOLHR, + 0, + [_B, _K2, _VI, _RP, _EBO], + [[0, 1], [0, 1], [0, { [_hQ]: _vI }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.GetObjectLockConfigurationOutput$ = [ + 3, + n04, + _GOLCO, + 0, + [_OLC], + [[() => exports2.ObjectLockConfiguration$, 16]] + ]; + exports2.GetObjectLockConfigurationRequest$ = [ + 3, + n04, + _GOLCR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GetObjectOutput$ = [ + 3, + n04, + _GOO, + 0, + [_Bo, _DM, _AR2, _E2, _Re, _LM, _CLo, _ETa, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _CT2, _MM, _VI, _CC, _CDo, _CEo, _CL, _CR, _CTo, _Ex, _ES, _WRL, _SSE, _M, _SSECA, _SSECKMD, _SSEKMSKI, _BKE, _SC, _RC, _RS, _PC2, _TC2, _OLM, _OLRUD, _OLLHS], + [[() => StreamingBlob, 16], [2, { [_hH]: _xadm }], [0, { [_hH]: _ar }], [0, { [_hH]: _xae }], [0, { [_hH]: _xar }], [4, { [_hH]: _LM_ }], [1, { [_hH]: _CL__ }], [0, { [_hH]: _ETa }], [0, { [_hH]: _xacc }], [0, { [_hH]: _xacc_ }], [0, { [_hH]: _xacc__ }], [0, { [_hH]: _xacs }], [0, { [_hH]: _xacs_ }], [0, { [_hH]: _xact }], [1, { [_hH]: _xamm }], [0, { [_hH]: _xavi }], [0, { [_hH]: _CC_ }], [0, { [_hH]: _CD_ }], [0, { [_hH]: _CE_ }], [0, { [_hH]: _CL_ }], [0, { [_hH]: _CR_ }], [0, { [_hH]: _CT_ }], [4, { [_hH]: _Ex }], [0, { [_hH]: _ES }], [0, { [_hH]: _xawrl }], [0, { [_hH]: _xasse }], [128 | 0, { [_hPH]: _xam }], [0, { [_hH]: _xasseca }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xasc }], [0, { [_hH]: _xarc }], [0, { [_hH]: _xars }], [1, { [_hH]: _xampc }], [1, { [_hH]: _xatc }], [0, { [_hH]: _xaolm }], [5, { [_hH]: _xaolrud }], [0, { [_hH]: _xaollh }]] + ]; + exports2.GetObjectRequest$ = [ + 3, + n04, + _GOR, + 0, + [_B, _K2, _IM, _IMSf, _INM, _IUS, _Ra, _RCC, _RCD, _RCE, _RCL, _RCT, _RE, _VI, _SSECA, _SSECK, _SSECKMD, _RP, _PN, _EBO, _CMh], + [[0, 1], [0, 1], [0, { [_hH]: _IM_ }], [4, { [_hH]: _IMS_ }], [0, { [_hH]: _INM_ }], [4, { [_hH]: _IUS_ }], [0, { [_hH]: _Ra }], [0, { [_hQ]: _rcc }], [0, { [_hQ]: _rcd }], [0, { [_hQ]: _rce }], [0, { [_hQ]: _rcl }], [0, { [_hQ]: _rct }], [6, { [_hQ]: _re }], [0, { [_hQ]: _vI }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [0, { [_hH]: _xarp }], [1, { [_hQ]: _pN }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xacm }]], + 2 + ]; + exports2.GetObjectRetentionOutput$ = [ + 3, + n04, + _GORO, + 0, + [_Ret], + [[() => exports2.ObjectLockRetention$, { [_hP]: 1, [_xN]: _Ret }]] + ]; + exports2.GetObjectRetentionRequest$ = [ + 3, + n04, + _GORR, + 0, + [_B, _K2, _VI, _RP, _EBO], + [[0, 1], [0, 1], [0, { [_hQ]: _vI }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.GetObjectTaggingOutput$ = [ + 3, + n04, + _GOTO, + { [_xN]: _Tag }, + [_TS, _VI], + [[() => TagSet, 0], [0, { [_hH]: _xavi }]], + 1 + ]; + exports2.GetObjectTaggingRequest$ = [ + 3, + n04, + _GOTR, + 0, + [_B, _K2, _VI, _EBO, _RP], + [[0, 1], [0, 1], [0, { [_hQ]: _vI }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xarp }]], + 2 + ]; + exports2.GetObjectTorrentOutput$ = [ + 3, + n04, + _GOTOe, + 0, + [_Bo, _RC], + [[() => StreamingBlob, 16], [0, { [_hH]: _xarc }]] + ]; + exports2.GetObjectTorrentRequest$ = [ + 3, + n04, + _GOTRe, + 0, + [_B, _K2, _RP, _EBO], + [[0, 1], [0, 1], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.GetPublicAccessBlockOutput$ = [ + 3, + n04, + _GPABO, + 0, + [_PABC], + [[() => exports2.PublicAccessBlockConfiguration$, 16]] + ]; + exports2.GetPublicAccessBlockRequest$ = [ + 3, + n04, + _GPABR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.GlacierJobParameters$ = [ + 3, + n04, + _GJP, + 0, + [_Ti], + [0], + 1 + ]; + exports2.Grant$ = [ + 3, + n04, + _Gr, + 0, + [_Gra, _Pe], + [[() => exports2.Grantee$, { [_xNm]: [_x, _hi] }], 0] + ]; + exports2.Grantee$ = [ + 3, + n04, + _Gra, + 0, + [_Ty, _DN, _EA, _ID, _URI], + [[0, { [_xA]: 1, [_xN]: _xs }], 0, 0, 0, 0], + 1 + ]; + exports2.HeadBucketOutput$ = [ + 3, + n04, + _HBO, + 0, + [_BA, _BLT, _BLN, _BR, _APA], + [[0, { [_hH]: _xaba }], [0, { [_hH]: _xablt }], [0, { [_hH]: _xabln }], [0, { [_hH]: _xabr }], [2, { [_hH]: _xaapa }]] + ]; + exports2.HeadBucketRequest$ = [ + 3, + n04, + _HBR, + 0, + [_B, _EBO], + [[0, 1], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.HeadObjectOutput$ = [ + 3, + n04, + _HOO, + 0, + [_DM, _AR2, _E2, _Re, _ASr, _LM, _CLo, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _CT2, _ETa, _MM, _VI, _CC, _CDo, _CEo, _CL, _CTo, _CR, _Ex, _ES, _WRL, _SSE, _M, _SSECA, _SSECKMD, _SSEKMSKI, _BKE, _SC, _RC, _RS, _PC2, _TC2, _OLM, _OLRUD, _OLLHS], + [[2, { [_hH]: _xadm }], [0, { [_hH]: _ar }], [0, { [_hH]: _xae }], [0, { [_hH]: _xar }], [0, { [_hH]: _xaas }], [4, { [_hH]: _LM_ }], [1, { [_hH]: _CL__ }], [0, { [_hH]: _xacc }], [0, { [_hH]: _xacc_ }], [0, { [_hH]: _xacc__ }], [0, { [_hH]: _xacs }], [0, { [_hH]: _xacs_ }], [0, { [_hH]: _xact }], [0, { [_hH]: _ETa }], [1, { [_hH]: _xamm }], [0, { [_hH]: _xavi }], [0, { [_hH]: _CC_ }], [0, { [_hH]: _CD_ }], [0, { [_hH]: _CE_ }], [0, { [_hH]: _CL_ }], [0, { [_hH]: _CT_ }], [0, { [_hH]: _CR_ }], [4, { [_hH]: _Ex }], [0, { [_hH]: _ES }], [0, { [_hH]: _xawrl }], [0, { [_hH]: _xasse }], [128 | 0, { [_hPH]: _xam }], [0, { [_hH]: _xasseca }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xasc }], [0, { [_hH]: _xarc }], [0, { [_hH]: _xars }], [1, { [_hH]: _xampc }], [1, { [_hH]: _xatc }], [0, { [_hH]: _xaolm }], [5, { [_hH]: _xaolrud }], [0, { [_hH]: _xaollh }]] + ]; + exports2.HeadObjectRequest$ = [ + 3, + n04, + _HOR, + 0, + [_B, _K2, _IM, _IMSf, _INM, _IUS, _Ra, _RCC, _RCD, _RCE, _RCL, _RCT, _RE, _VI, _SSECA, _SSECK, _SSECKMD, _RP, _PN, _EBO, _CMh], + [[0, 1], [0, 1], [0, { [_hH]: _IM_ }], [4, { [_hH]: _IMS_ }], [0, { [_hH]: _INM_ }], [4, { [_hH]: _IUS_ }], [0, { [_hH]: _Ra }], [0, { [_hQ]: _rcc }], [0, { [_hQ]: _rcd }], [0, { [_hQ]: _rce }], [0, { [_hQ]: _rcl }], [0, { [_hQ]: _rct }], [6, { [_hQ]: _re }], [0, { [_hQ]: _vI }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [0, { [_hH]: _xarp }], [1, { [_hQ]: _pN }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xacm }]], + 2 + ]; + exports2.IndexDocument$ = [ + 3, + n04, + _IDn, + 0, + [_Su], + [0], + 1 + ]; + exports2.Initiator$ = [ + 3, + n04, + _In, + 0, + [_ID, _DN], + [0, 0] + ]; + exports2.InputSerialization$ = [ + 3, + n04, + _IS, + 0, + [_CSV, _CTom, _JSON, _Parq], + [() => exports2.CSVInput$, 0, () => exports2.JSONInput$, () => exports2.ParquetInput$] + ]; + exports2.IntelligentTieringAndOperator$ = [ + 3, + n04, + _ITAO, + 0, + [_P2, _T2], + [0, [() => TagSet, { [_xF]: 1, [_xN]: _Ta2 }]] + ]; + exports2.IntelligentTieringConfiguration$ = [ + 3, + n04, + _ITC, + 0, + [_I, _S, _Tie, _F], + [0, 0, [() => TieringList, { [_xF]: 1, [_xN]: _Tier }], [() => exports2.IntelligentTieringFilter$, 0]], + 3 + ]; + exports2.IntelligentTieringFilter$ = [ + 3, + n04, + _ITF, + 0, + [_P2, _Ta2, _An], + [0, () => exports2.Tag$, [() => exports2.IntelligentTieringAndOperator$, 0]] + ]; + exports2.InventoryConfiguration$ = [ + 3, + n04, + _IC, + 0, + [_Des, _IE, _I, _IOV, _Sc, _F, _OF], + [[() => exports2.InventoryDestination$, 0], 2, 0, 0, () => exports2.InventorySchedule$, () => exports2.InventoryFilter$, [() => InventoryOptionalFields, 0]], + 5 + ]; + exports2.InventoryDestination$ = [ + 3, + n04, + _IDnv, + 0, + [_SBD], + [[() => exports2.InventoryS3BucketDestination$, 0]], + 1 + ]; + exports2.InventoryEncryption$ = [ + 3, + n04, + _IEn, + 0, + [_SSES, _SSEKMS], + [[() => exports2.SSES3$, { [_xN]: _SS }], [() => exports2.SSEKMS$, { [_xN]: _SK }]] + ]; + exports2.InventoryFilter$ = [ + 3, + n04, + _IF, + 0, + [_P2], + [0], + 1 + ]; + exports2.InventoryS3BucketDestination$ = [ + 3, + n04, + _ISBD, + 0, + [_B, _Fo, _AI, _P2, _En], + [0, 0, 0, 0, [() => exports2.InventoryEncryption$, 0]], + 2 + ]; + exports2.InventorySchedule$ = [ + 3, + n04, + _ISn, + 0, + [_Fr], + [0], + 1 + ]; + exports2.InventoryTableConfiguration$ = [ + 3, + n04, + _ITCn, + 0, + [_CSo, _EC], + [0, () => exports2.MetadataTableEncryptionConfiguration$], + 1 + ]; + exports2.InventoryTableConfigurationResult$ = [ + 3, + n04, + _ITCR, + 0, + [_CSo, _TSa, _Err, _TNa, _TA], + [0, 0, () => exports2.ErrorDetails$, 0, 0], + 1 + ]; + exports2.InventoryTableConfigurationUpdates$ = [ + 3, + n04, + _ITCU, + 0, + [_CSo, _EC], + [0, () => exports2.MetadataTableEncryptionConfiguration$], + 1 + ]; + exports2.JournalTableConfiguration$ = [ + 3, + n04, + _JTC, + 0, + [_REe, _EC], + [() => exports2.RecordExpiration$, () => exports2.MetadataTableEncryptionConfiguration$], + 1 + ]; + exports2.JournalTableConfigurationResult$ = [ + 3, + n04, + _JTCR, + 0, + [_TSa, _TNa, _REe, _Err, _TA], + [0, 0, () => exports2.RecordExpiration$, () => exports2.ErrorDetails$, 0], + 3 + ]; + exports2.JournalTableConfigurationUpdates$ = [ + 3, + n04, + _JTCU, + 0, + [_REe], + [() => exports2.RecordExpiration$], + 1 + ]; + exports2.JSONInput$ = [ + 3, + n04, + _JSONI, + 0, + [_Ty], + [0] + ]; + exports2.JSONOutput$ = [ + 3, + n04, + _JSONO, + 0, + [_RD], + [0] + ]; + exports2.LambdaFunctionConfiguration$ = [ + 3, + n04, + _LFC, + 0, + [_LFA, _Ev, _I, _F], + [[0, { [_xN]: _CF }], [64 | 0, { [_xF]: 1, [_xN]: _Eve }], 0, [() => exports2.NotificationConfigurationFilter$, 0]], + 2 + ]; + exports2.LifecycleExpiration$ = [ + 3, + n04, + _LEi, + 0, + [_Da, _D, _EODM], + [5, 1, 2] + ]; + exports2.LifecycleRule$ = [ + 3, + n04, + _LR, + 0, + [_S, _E2, _ID, _P2, _F, _Tr, _NVT, _NVE, _AIMU], + [0, () => exports2.LifecycleExpiration$, 0, 0, [() => exports2.LifecycleRuleFilter$, 0], [() => TransitionList, { [_xF]: 1, [_xN]: _Tra }], [() => NoncurrentVersionTransitionList, { [_xF]: 1, [_xN]: _NVTo }], () => exports2.NoncurrentVersionExpiration$, () => exports2.AbortIncompleteMultipartUpload$], + 1 + ]; + exports2.LifecycleRuleAndOperator$ = [ + 3, + n04, + _LRAO, + 0, + [_P2, _T2, _OSGT, _OSLT], + [0, [() => TagSet, { [_xF]: 1, [_xN]: _Ta2 }], 1, 1] + ]; + exports2.LifecycleRuleFilter$ = [ + 3, + n04, + _LRF, + 0, + [_P2, _Ta2, _OSGT, _OSLT, _An], + [0, () => exports2.Tag$, 1, 1, [() => exports2.LifecycleRuleAndOperator$, 0]] + ]; + exports2.ListBucketAnalyticsConfigurationsOutput$ = [ + 3, + n04, + _LBACO, + { [_xN]: _LBACR }, + [_IT2, _CTon, _NCT, _ACLn], + [2, 0, 0, [() => AnalyticsConfigurationList, { [_xF]: 1, [_xN]: _ACn }]] + ]; + exports2.ListBucketAnalyticsConfigurationsRequest$ = [ + 3, + n04, + _LBACRi, + 0, + [_B, _CTon, _EBO], + [[0, 1], [0, { [_hQ]: _ct }], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.ListBucketIntelligentTieringConfigurationsOutput$ = [ + 3, + n04, + _LBITCO, + 0, + [_IT2, _CTon, _NCT, _ITCL], + [2, 0, 0, [() => IntelligentTieringConfigurationList, { [_xF]: 1, [_xN]: _ITC }]] + ]; + exports2.ListBucketIntelligentTieringConfigurationsRequest$ = [ + 3, + n04, + _LBITCR, + 0, + [_B, _CTon, _EBO], + [[0, 1], [0, { [_hQ]: _ct }], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.ListBucketInventoryConfigurationsOutput$ = [ + 3, + n04, + _LBICO, + { [_xN]: _LICR }, + [_CTon, _ICL, _IT2, _NCT], + [0, [() => InventoryConfigurationList, { [_xF]: 1, [_xN]: _IC }], 2, 0] + ]; + exports2.ListBucketInventoryConfigurationsRequest$ = [ + 3, + n04, + _LBICR, + 0, + [_B, _CTon, _EBO], + [[0, 1], [0, { [_hQ]: _ct }], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.ListBucketMetricsConfigurationsOutput$ = [ + 3, + n04, + _LBMCO, + { [_xN]: _LMCR }, + [_IT2, _CTon, _NCT, _MCL], + [2, 0, 0, [() => MetricsConfigurationList, { [_xF]: 1, [_xN]: _MCe }]] + ]; + exports2.ListBucketMetricsConfigurationsRequest$ = [ + 3, + n04, + _LBMCR, + 0, + [_B, _CTon, _EBO], + [[0, 1], [0, { [_hQ]: _ct }], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.ListBucketsOutput$ = [ + 3, + n04, + _LBO, + { [_xN]: _LAMBR }, + [_Bu, _O, _CTon, _P2], + [[() => Buckets, 0], () => exports2.Owner$, 0, 0] + ]; + exports2.ListBucketsRequest$ = [ + 3, + n04, + _LBR, + 0, + [_MB, _CTon, _P2, _BR], + [[1, { [_hQ]: _mb }], [0, { [_hQ]: _ct }], [0, { [_hQ]: _p }], [0, { [_hQ]: _br }]] + ]; + exports2.ListDirectoryBucketsOutput$ = [ + 3, + n04, + _LDBO, + { [_xN]: _LAMDBR }, + [_Bu, _CTon], + [[() => Buckets, 0], 0] + ]; + exports2.ListDirectoryBucketsRequest$ = [ + 3, + n04, + _LDBR, + 0, + [_CTon, _MDB], + [[0, { [_hQ]: _ct }], [1, { [_hQ]: _mdb }]] + ]; + exports2.ListMultipartUploadsOutput$ = [ + 3, + n04, + _LMUO, + { [_xN]: _LMUR }, + [_B, _KM, _UIM, _NKM, _P2, _Deli, _NUIM, _MUa, _IT2, _U, _CPom, _ETn, _RC], + [0, 0, 0, 0, 0, 0, 0, 1, 2, [() => MultipartUploadList, { [_xF]: 1, [_xN]: _Up }], [() => CommonPrefixList, { [_xF]: 1 }], 0, [0, { [_hH]: _xarc }]] + ]; + exports2.ListMultipartUploadsRequest$ = [ + 3, + n04, + _LMURi, + 0, + [_B, _Deli, _ETn, _KM, _MUa, _P2, _UIM, _EBO, _RP], + [[0, 1], [0, { [_hQ]: _d }], [0, { [_hQ]: _et }], [0, { [_hQ]: _km }], [1, { [_hQ]: _mu }], [0, { [_hQ]: _p }], [0, { [_hQ]: _uim }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xarp }]], + 1 + ]; + exports2.ListObjectsOutput$ = [ + 3, + n04, + _LOO, + { [_xN]: _LBRi }, + [_IT2, _Ma, _NM, _Con, _N, _P2, _Deli, _MK, _CPom, _ETn, _RC], + [2, 0, 0, [() => ObjectList, { [_xF]: 1 }], 0, 0, 0, 1, [() => CommonPrefixList, { [_xF]: 1 }], 0, [0, { [_hH]: _xarc }]] + ]; + exports2.ListObjectsRequest$ = [ + 3, + n04, + _LOR, + 0, + [_B, _Deli, _ETn, _Ma, _MK, _P2, _RP, _EBO, _OOA], + [[0, 1], [0, { [_hQ]: _d }], [0, { [_hQ]: _et }], [0, { [_hQ]: _m3 }], [1, { [_hQ]: _mk }], [0, { [_hQ]: _p }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }], [64 | 0, { [_hH]: _xaooa }]], + 1 + ]; + exports2.ListObjectsV2Output$ = [ + 3, + n04, + _LOVO, + { [_xN]: _LBRi }, + [_IT2, _Con, _N, _P2, _Deli, _MK, _CPom, _ETn, _KC, _CTon, _NCT, _SA, _RC], + [2, [() => ObjectList, { [_xF]: 1 }], 0, 0, 0, 1, [() => CommonPrefixList, { [_xF]: 1 }], 0, 1, 0, 0, 0, [0, { [_hH]: _xarc }]] + ]; + exports2.ListObjectsV2Request$ = [ + 3, + n04, + _LOVR, + 0, + [_B, _Deli, _ETn, _MK, _P2, _CTon, _FO, _SA, _RP, _EBO, _OOA], + [[0, 1], [0, { [_hQ]: _d }], [0, { [_hQ]: _et }], [1, { [_hQ]: _mk }], [0, { [_hQ]: _p }], [0, { [_hQ]: _ct }], [2, { [_hQ]: _fo }], [0, { [_hQ]: _sa }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }], [64 | 0, { [_hH]: _xaooa }]], + 1 + ]; + exports2.ListObjectVersionsOutput$ = [ + 3, + n04, + _LOVOi, + { [_xN]: _LVR }, + [_IT2, _KM, _VIM, _NKM, _NVIM, _Ve, _DMe, _N, _P2, _Deli, _MK, _CPom, _ETn, _RC], + [2, 0, 0, 0, 0, [() => ObjectVersionList, { [_xF]: 1, [_xN]: _Ver }], [() => DeleteMarkers, { [_xF]: 1, [_xN]: _DM }], 0, 0, 0, 1, [() => CommonPrefixList, { [_xF]: 1 }], 0, [0, { [_hH]: _xarc }]] + ]; + exports2.ListObjectVersionsRequest$ = [ + 3, + n04, + _LOVRi, + 0, + [_B, _Deli, _ETn, _KM, _MK, _P2, _VIM, _EBO, _RP, _OOA], + [[0, 1], [0, { [_hQ]: _d }], [0, { [_hQ]: _et }], [0, { [_hQ]: _km }], [1, { [_hQ]: _mk }], [0, { [_hQ]: _p }], [0, { [_hQ]: _vim }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xarp }], [64 | 0, { [_hH]: _xaooa }]], + 1 + ]; + exports2.ListPartsOutput$ = [ + 3, + n04, + _LPO, + { [_xN]: _LPR }, + [_ADb, _ARI2, _B, _K2, _UI, _PNM, _NPNM, _MP, _IT2, _Pa, _In, _O, _SC, _RC, _CA2, _CT2], + [[4, { [_hH]: _xaad }], [0, { [_hH]: _xaari }], 0, 0, 0, 0, 0, 1, 2, [() => Parts, { [_xF]: 1, [_xN]: _Par }], () => exports2.Initiator$, () => exports2.Owner$, 0, [0, { [_hH]: _xarc }], 0, 0] + ]; + exports2.ListPartsRequest$ = [ + 3, + n04, + _LPRi, + 0, + [_B, _K2, _UI, _MP, _PNM, _RP, _EBO, _SSECA, _SSECK, _SSECKMD], + [[0, 1], [0, 1], [0, { [_hQ]: _uI }], [1, { [_hQ]: _mp }], [0, { [_hQ]: _pnm }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }]], + 3 + ]; + exports2.LocationInfo$ = [ + 3, + n04, + _LI, + 0, + [_Ty, _N], + [0, 0] + ]; + exports2.LoggingEnabled$ = [ + 3, + n04, + _LE, + 0, + [_TB, _TP, _TG, _TOKF], + [0, 0, [() => TargetGrants, 0], [() => exports2.TargetObjectKeyFormat$, 0]], + 2 + ]; + exports2.MetadataConfiguration$ = [ + 3, + n04, + _MC, + 0, + [_JTC, _ITCn], + [() => exports2.JournalTableConfiguration$, () => exports2.InventoryTableConfiguration$], + 1 + ]; + exports2.MetadataConfigurationResult$ = [ + 3, + n04, + _MCR, + 0, + [_DRes, _JTCR, _ITCR], + [() => exports2.DestinationResult$, () => exports2.JournalTableConfigurationResult$, () => exports2.InventoryTableConfigurationResult$], + 1 + ]; + exports2.MetadataEntry$ = [ + 3, + n04, + _ME, + 0, + [_N, _V2], + [0, 0] + ]; + exports2.MetadataTableConfiguration$ = [ + 3, + n04, + _MTC, + 0, + [_STD], + [() => exports2.S3TablesDestination$], + 1 + ]; + exports2.MetadataTableConfigurationResult$ = [ + 3, + n04, + _MTCR, + 0, + [_STDR], + [() => exports2.S3TablesDestinationResult$], + 1 + ]; + exports2.MetadataTableEncryptionConfiguration$ = [ + 3, + n04, + _MTEC, + 0, + [_SAs, _KKA], + [0, 0], + 1 + ]; + exports2.Metrics$ = [ + 3, + n04, + _Me, + 0, + [_S, _ETv], + [0, () => exports2.ReplicationTimeValue$], + 1 + ]; + exports2.MetricsAndOperator$ = [ + 3, + n04, + _MAO, + 0, + [_P2, _T2, _APAc], + [0, [() => TagSet, { [_xF]: 1, [_xN]: _Ta2 }], 0] + ]; + exports2.MetricsConfiguration$ = [ + 3, + n04, + _MCe, + 0, + [_I, _F], + [0, [() => exports2.MetricsFilter$, 0]], + 1 + ]; + exports2.MultipartUpload$ = [ + 3, + n04, + _MU, + 0, + [_UI, _K2, _Ini, _SC, _O, _In, _CA2, _CT2], + [0, 0, 4, 0, () => exports2.Owner$, () => exports2.Initiator$, 0, 0] + ]; + exports2.NoncurrentVersionExpiration$ = [ + 3, + n04, + _NVE, + 0, + [_ND, _NNV], + [1, 1] + ]; + exports2.NoncurrentVersionTransition$ = [ + 3, + n04, + _NVTo, + 0, + [_ND, _SC, _NNV], + [1, 0, 1] + ]; + exports2.NotificationConfiguration$ = [ + 3, + n04, + _NC, + 0, + [_TCo, _QCu, _LFCa, _EBC], + [[() => TopicConfigurationList, { [_xF]: 1, [_xN]: _TCop }], [() => QueueConfigurationList, { [_xF]: 1, [_xN]: _QCue }], [() => LambdaFunctionConfigurationList, { [_xF]: 1, [_xN]: _CFC }], () => exports2.EventBridgeConfiguration$] + ]; + exports2.NotificationConfigurationFilter$ = [ + 3, + n04, + _NCF, + 0, + [_K2], + [[() => exports2.S3KeyFilter$, { [_xN]: _SKe }]] + ]; + exports2._Object$ = [ + 3, + n04, + _Obj, + 0, + [_K2, _LM, _ETa, _CA2, _CT2, _Si, _SC, _O, _RSe], + [0, 4, 0, [64 | 0, { [_xF]: 1 }], 0, 1, 0, () => exports2.Owner$, () => exports2.RestoreStatus$] + ]; + exports2.ObjectIdentifier$ = [ + 3, + n04, + _OI, + 0, + [_K2, _VI, _ETa, _LMT, _Si], + [0, 0, 0, 6, 1], + 1 + ]; + exports2.ObjectLockConfiguration$ = [ + 3, + n04, + _OLC, + 0, + [_OLE, _Ru], + [0, () => exports2.ObjectLockRule$] + ]; + exports2.ObjectLockLegalHold$ = [ + 3, + n04, + _OLLH, + 0, + [_S], + [0] + ]; + exports2.ObjectLockRetention$ = [ + 3, + n04, + _OLR, + 0, + [_Mo, _RUD], + [0, 5] + ]; + exports2.ObjectLockRule$ = [ + 3, + n04, + _OLRb, + 0, + [_DRe], + [() => exports2.DefaultRetention$] + ]; + exports2.ObjectPart$ = [ + 3, + n04, + _OPb, + 0, + [_PN, _Si, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh], + [1, 1, 0, 0, 0, 0, 0] + ]; + exports2.ObjectVersion$ = [ + 3, + n04, + _OV, + 0, + [_ETa, _CA2, _CT2, _Si, _SC, _K2, _VI, _IL, _LM, _O, _RSe], + [0, [64 | 0, { [_xF]: 1 }], 0, 1, 0, 0, 0, 2, 4, () => exports2.Owner$, () => exports2.RestoreStatus$] + ]; + exports2.OutputLocation$ = [ + 3, + n04, + _OL, + 0, + [_S_], + [[() => exports2.S3Location$, 0]] + ]; + exports2.OutputSerialization$ = [ + 3, + n04, + _OSu, + 0, + [_CSV, _JSON], + [() => exports2.CSVOutput$, () => exports2.JSONOutput$] + ]; + exports2.Owner$ = [ + 3, + n04, + _O, + 0, + [_DN, _ID], + [0, 0] + ]; + exports2.OwnershipControls$ = [ + 3, + n04, + _OC, + 0, + [_R], + [[() => OwnershipControlsRules, { [_xF]: 1, [_xN]: _Ru }]], + 1 + ]; + exports2.OwnershipControlsRule$ = [ + 3, + n04, + _OCR, + 0, + [_OO], + [0], + 1 + ]; + exports2.ParquetInput$ = [ + 3, + n04, + _PI2, + 0, + [], + [] + ]; + exports2.Part$ = [ + 3, + n04, + _Par, + 0, + [_PN, _LM, _ETa, _Si, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh], + [1, 4, 0, 1, 0, 0, 0, 0, 0] + ]; + exports2.PartitionedPrefix$ = [ + 3, + n04, + _PP, + { [_xN]: _PP }, + [_PDS], + [0] + ]; + exports2.PolicyStatus$ = [ + 3, + n04, + _PS, + 0, + [_IP], + [[2, { [_xN]: _IP }]] + ]; + exports2.Progress$ = [ + 3, + n04, + _Pr2, + 0, + [_BS, _BP, _BRy], + [1, 1, 1] + ]; + exports2.ProgressEvent$ = [ + 3, + n04, + _PE, + 0, + [_Det], + [[() => exports2.Progress$, { [_eP]: 1 }]] + ]; + exports2.PublicAccessBlockConfiguration$ = [ + 3, + n04, + _PABC, + 0, + [_BPA, _IPA, _BPP, _RPB], + [[2, { [_xN]: _BPA }], [2, { [_xN]: _IPA }], [2, { [_xN]: _BPP }], [2, { [_xN]: _RPB }]] + ]; + exports2.PutBucketAbacRequest$ = [ + 3, + n04, + _PBAR, + 0, + [_B, _AS, _CMD, _CA2, _EBO], + [[0, 1], [() => exports2.AbacStatus$, { [_hP]: 1, [_xN]: _AS }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.PutBucketAccelerateConfigurationRequest$ = [ + 3, + n04, + _PBACR, + 0, + [_B, _AC, _EBO, _CA2], + [[0, 1], [() => exports2.AccelerateConfiguration$, { [_hP]: 1, [_xN]: _AC }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xasca }]], + 2 + ]; + exports2.PutBucketAclRequest$ = [ + 3, + n04, + _PBARu, + 0, + [_B, _ACL_, _ACP, _CMD, _CA2, _GFC, _GR, _GRACP, _GW, _GWACP, _EBO], + [[0, 1], [0, { [_hH]: _xaa }], [() => exports2.AccessControlPolicy$, { [_hP]: 1, [_xN]: _ACP }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xagfc }], [0, { [_hH]: _xagr }], [0, { [_hH]: _xagra }], [0, { [_hH]: _xagw }], [0, { [_hH]: _xagwa }], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.PutBucketAnalyticsConfigurationRequest$ = [ + 3, + n04, + _PBACRu, + 0, + [_B, _I, _ACn, _EBO], + [[0, 1], [0, { [_hQ]: _i }], [() => exports2.AnalyticsConfiguration$, { [_hP]: 1, [_xN]: _ACn }], [0, { [_hH]: _xaebo }]], + 3 + ]; + exports2.PutBucketCorsRequest$ = [ + 3, + n04, + _PBCR, + 0, + [_B, _CORSC, _CMD, _CA2, _EBO], + [[0, 1], [() => exports2.CORSConfiguration$, { [_hP]: 1, [_xN]: _CORSC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.PutBucketEncryptionRequest$ = [ + 3, + n04, + _PBER, + 0, + [_B, _SSEC, _CMD, _CA2, _EBO], + [[0, 1], [() => exports2.ServerSideEncryptionConfiguration$, { [_hP]: 1, [_xN]: _SSEC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.PutBucketIntelligentTieringConfigurationRequest$ = [ + 3, + n04, + _PBITCR, + 0, + [_B, _I, _ITC, _EBO], + [[0, 1], [0, { [_hQ]: _i }], [() => exports2.IntelligentTieringConfiguration$, { [_hP]: 1, [_xN]: _ITC }], [0, { [_hH]: _xaebo }]], + 3 + ]; + exports2.PutBucketInventoryConfigurationRequest$ = [ + 3, + n04, + _PBICR, + 0, + [_B, _I, _IC, _EBO], + [[0, 1], [0, { [_hQ]: _i }], [() => exports2.InventoryConfiguration$, { [_hP]: 1, [_xN]: _IC }], [0, { [_hH]: _xaebo }]], + 3 + ]; + exports2.PutBucketLifecycleConfigurationOutput$ = [ + 3, + n04, + _PBLCO, + 0, + [_TDMOS], + [[0, { [_hH]: _xatdmos }]] + ]; + exports2.PutBucketLifecycleConfigurationRequest$ = [ + 3, + n04, + _PBLCR, + 0, + [_B, _CA2, _LCi, _EBO, _TDMOS], + [[0, 1], [0, { [_hH]: _xasca }], [() => exports2.BucketLifecycleConfiguration$, { [_hP]: 1, [_xN]: _LCi }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xatdmos }]], + 1 + ]; + exports2.PutBucketLoggingRequest$ = [ + 3, + n04, + _PBLR, + 0, + [_B, _BLS, _CMD, _CA2, _EBO], + [[0, 1], [() => exports2.BucketLoggingStatus$, { [_hP]: 1, [_xN]: _BLS }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.PutBucketMetricsConfigurationRequest$ = [ + 3, + n04, + _PBMCR, + 0, + [_B, _I, _MCe, _EBO], + [[0, 1], [0, { [_hQ]: _i }], [() => exports2.MetricsConfiguration$, { [_hP]: 1, [_xN]: _MCe }], [0, { [_hH]: _xaebo }]], + 3 + ]; + exports2.PutBucketNotificationConfigurationRequest$ = [ + 3, + n04, + _PBNCR, + 0, + [_B, _NC, _EBO, _SDV], + [[0, 1], [() => exports2.NotificationConfiguration$, { [_hP]: 1, [_xN]: _NC }], [0, { [_hH]: _xaebo }], [2, { [_hH]: _xasdv }]], + 2 + ]; + exports2.PutBucketOwnershipControlsRequest$ = [ + 3, + n04, + _PBOCR, + 0, + [_B, _OC, _CMD, _EBO, _CA2], + [[0, 1], [() => exports2.OwnershipControls$, { [_hP]: 1, [_xN]: _OC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xasca }]], + 2 + ]; + exports2.PutBucketPolicyRequest$ = [ + 3, + n04, + _PBPR, + 0, + [_B, _Po, _CMD, _CA2, _CRSBA, _EBO], + [[0, 1], [0, 16], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [2, { [_hH]: _xacrsba }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.PutBucketReplicationRequest$ = [ + 3, + n04, + _PBRR, + 0, + [_B, _RCe, _CMD, _CA2, _To, _EBO], + [[0, 1], [() => exports2.ReplicationConfiguration$, { [_hP]: 1, [_xN]: _RCe }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xabolt }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.PutBucketRequestPaymentRequest$ = [ + 3, + n04, + _PBRPR, + 0, + [_B, _RPC, _CMD, _CA2, _EBO], + [[0, 1], [() => exports2.RequestPaymentConfiguration$, { [_hP]: 1, [_xN]: _RPC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.PutBucketTaggingRequest$ = [ + 3, + n04, + _PBTR, + 0, + [_B, _Tag, _CMD, _CA2, _EBO], + [[0, 1], [() => exports2.Tagging$, { [_hP]: 1, [_xN]: _Tag }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.PutBucketVersioningRequest$ = [ + 3, + n04, + _PBVR, + 0, + [_B, _VC, _CMD, _CA2, _MFA, _EBO], + [[0, 1], [() => exports2.VersioningConfiguration$, { [_hP]: 1, [_xN]: _VC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xam_ }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.PutBucketWebsiteRequest$ = [ + 3, + n04, + _PBWR, + 0, + [_B, _WC, _CMD, _CA2, _EBO], + [[0, 1], [() => exports2.WebsiteConfiguration$, { [_hP]: 1, [_xN]: _WC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.PutObjectAclOutput$ = [ + 3, + n04, + _POAO, + 0, + [_RC], + [[0, { [_hH]: _xarc }]] + ]; + exports2.PutObjectAclRequest$ = [ + 3, + n04, + _POAR, + 0, + [_B, _K2, _ACL_, _ACP, _CMD, _CA2, _GFC, _GR, _GRACP, _GW, _GWACP, _RP, _VI, _EBO], + [[0, 1], [0, 1], [0, { [_hH]: _xaa }], [() => exports2.AccessControlPolicy$, { [_hP]: 1, [_xN]: _ACP }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xagfc }], [0, { [_hH]: _xagr }], [0, { [_hH]: _xagra }], [0, { [_hH]: _xagw }], [0, { [_hH]: _xagwa }], [0, { [_hH]: _xarp }], [0, { [_hQ]: _vI }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.PutObjectLegalHoldOutput$ = [ + 3, + n04, + _POLHO, + 0, + [_RC], + [[0, { [_hH]: _xarc }]] + ]; + exports2.PutObjectLegalHoldRequest$ = [ + 3, + n04, + _POLHR, + 0, + [_B, _K2, _LH, _RP, _VI, _CMD, _CA2, _EBO], + [[0, 1], [0, 1], [() => exports2.ObjectLockLegalHold$, { [_hP]: 1, [_xN]: _LH }], [0, { [_hH]: _xarp }], [0, { [_hQ]: _vI }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.PutObjectLockConfigurationOutput$ = [ + 3, + n04, + _POLCO, + 0, + [_RC], + [[0, { [_hH]: _xarc }]] + ]; + exports2.PutObjectLockConfigurationRequest$ = [ + 3, + n04, + _POLCR, + 0, + [_B, _OLC, _RP, _To, _CMD, _CA2, _EBO], + [[0, 1], [() => exports2.ObjectLockConfiguration$, { [_hP]: 1, [_xN]: _OLC }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xabolt }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 1 + ]; + exports2.PutObjectOutput$ = [ + 3, + n04, + _POO, + 0, + [_E2, _ETa, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _CT2, _SSE, _VI, _SSECA, _SSECKMD, _SSEKMSKI, _SSEKMSEC, _BKE, _Si, _RC], + [[0, { [_hH]: _xae }], [0, { [_hH]: _ETa }], [0, { [_hH]: _xacc }], [0, { [_hH]: _xacc_ }], [0, { [_hH]: _xacc__ }], [0, { [_hH]: _xacs }], [0, { [_hH]: _xacs_ }], [0, { [_hH]: _xact }], [0, { [_hH]: _xasse }], [0, { [_hH]: _xavi }], [0, { [_hH]: _xasseca }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }], [1, { [_hH]: _xaos }], [0, { [_hH]: _xarc }]] + ]; + exports2.PutObjectRequest$ = [ + 3, + n04, + _POR, + 0, + [_B, _K2, _ACL_, _Bo, _CC, _CDo, _CEo, _CL, _CLo, _CMD, _CTo, _CA2, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _Ex, _IM, _INM, _GFC, _GR, _GRACP, _GWACP, _WOB, _M, _SSE, _SC, _WRL, _SSECA, _SSECK, _SSECKMD, _SSEKMSKI, _SSEKMSEC, _BKE, _RP, _Tag, _OLM, _OLRUD, _OLLHS, _EBO], + [[0, 1], [0, 1], [0, { [_hH]: _xaa }], [() => StreamingBlob, 16], [0, { [_hH]: _CC_ }], [0, { [_hH]: _CD_ }], [0, { [_hH]: _CE_ }], [0, { [_hH]: _CL_ }], [1, { [_hH]: _CL__ }], [0, { [_hH]: _CM }], [0, { [_hH]: _CT_ }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xacc }], [0, { [_hH]: _xacc_ }], [0, { [_hH]: _xacc__ }], [0, { [_hH]: _xacs }], [0, { [_hH]: _xacs_ }], [4, { [_hH]: _Ex }], [0, { [_hH]: _IM_ }], [0, { [_hH]: _INM_ }], [0, { [_hH]: _xagfc }], [0, { [_hH]: _xagr }], [0, { [_hH]: _xagra }], [0, { [_hH]: _xagwa }], [1, { [_hH]: _xawob }], [128 | 0, { [_hPH]: _xam }], [0, { [_hH]: _xasse }], [0, { [_hH]: _xasc }], [0, { [_hH]: _xawrl }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [() => SSEKMSEncryptionContext, { [_hH]: _xassec }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xat }], [0, { [_hH]: _xaolm }], [5, { [_hH]: _xaolrud }], [0, { [_hH]: _xaollh }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.PutObjectRetentionOutput$ = [ + 3, + n04, + _PORO, + 0, + [_RC], + [[0, { [_hH]: _xarc }]] + ]; + exports2.PutObjectRetentionRequest$ = [ + 3, + n04, + _PORR, + 0, + [_B, _K2, _Ret, _RP, _VI, _BGR, _CMD, _CA2, _EBO], + [[0, 1], [0, 1], [() => exports2.ObjectLockRetention$, { [_hP]: 1, [_xN]: _Ret }], [0, { [_hH]: _xarp }], [0, { [_hQ]: _vI }], [2, { [_hH]: _xabgr }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.PutObjectTaggingOutput$ = [ + 3, + n04, + _POTO, + 0, + [_VI], + [[0, { [_hH]: _xavi }]] + ]; + exports2.PutObjectTaggingRequest$ = [ + 3, + n04, + _POTR, + 0, + [_B, _K2, _Tag, _VI, _CMD, _CA2, _EBO, _RP], + [[0, 1], [0, 1], [() => exports2.Tagging$, { [_hP]: 1, [_xN]: _Tag }], [0, { [_hQ]: _vI }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xarp }]], + 3 + ]; + exports2.PutPublicAccessBlockRequest$ = [ + 3, + n04, + _PPABR, + 0, + [_B, _PABC, _CMD, _CA2, _EBO], + [[0, 1], [() => exports2.PublicAccessBlockConfiguration$, { [_hP]: 1, [_xN]: _PABC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.QueueConfiguration$ = [ + 3, + n04, + _QCue, + 0, + [_QA, _Ev, _I, _F], + [[0, { [_xN]: _Qu }], [64 | 0, { [_xF]: 1, [_xN]: _Eve }], 0, [() => exports2.NotificationConfigurationFilter$, 0]], + 2 + ]; + exports2.RecordExpiration$ = [ + 3, + n04, + _REe, + 0, + [_E2, _D], + [0, 1], + 1 + ]; + exports2.RecordsEvent$ = [ + 3, + n04, + _REec, + 0, + [_Payl], + [[21, { [_eP]: 1 }]] + ]; + exports2.Redirect$ = [ + 3, + n04, + _Red, + 0, + [_HN, _HRC, _Pro, _RKPW, _RKW], + [0, 0, 0, 0, 0] + ]; + exports2.RedirectAllRequestsTo$ = [ + 3, + n04, + _RART, + 0, + [_HN, _Pro], + [0, 0], + 1 + ]; + exports2.RenameObjectOutput$ = [ + 3, + n04, + _ROO, + 0, + [], + [] + ]; + exports2.RenameObjectRequest$ = [ + 3, + n04, + _ROR, + 0, + [_B, _K2, _RSen, _DIM, _DINM, _DIMS, _DIUS, _SIM, _SINM, _SIMS, _SIUS, _CTl], + [[0, 1], [0, 1], [0, { [_hH]: _xars_ }], [0, { [_hH]: _IM_ }], [0, { [_hH]: _INM_ }], [4, { [_hH]: _IMS_ }], [4, { [_hH]: _IUS_ }], [0, { [_hH]: _xarsim }], [0, { [_hH]: _xarsinm }], [6, { [_hH]: _xarsims }], [6, { [_hH]: _xarsius }], [0, { [_hH]: _xact_, [_iT3]: 1 }]], + 3 + ]; + exports2.ReplicaModifications$ = [ + 3, + n04, + _RM, + 0, + [_S], + [0], + 1 + ]; + exports2.ReplicationConfiguration$ = [ + 3, + n04, + _RCe, + 0, + [_Ro, _R], + [0, [() => ReplicationRules, { [_xF]: 1, [_xN]: _Ru }]], + 2 + ]; + exports2.ReplicationRule$ = [ + 3, + n04, + _RRe, + 0, + [_S, _Des, _ID, _Pri, _P2, _F, _SSC, _EOR, _DMR], + [0, () => exports2.Destination$, 0, 1, 0, [() => exports2.ReplicationRuleFilter$, 0], () => exports2.SourceSelectionCriteria$, () => exports2.ExistingObjectReplication$, () => exports2.DeleteMarkerReplication$], + 2 + ]; + exports2.ReplicationRuleAndOperator$ = [ + 3, + n04, + _RRAO, + 0, + [_P2, _T2], + [0, [() => TagSet, { [_xF]: 1, [_xN]: _Ta2 }]] + ]; + exports2.ReplicationRuleFilter$ = [ + 3, + n04, + _RRF, + 0, + [_P2, _Ta2, _An], + [0, () => exports2.Tag$, [() => exports2.ReplicationRuleAndOperator$, 0]] + ]; + exports2.ReplicationTime$ = [ + 3, + n04, + _RT3, + 0, + [_S, _Tim], + [0, () => exports2.ReplicationTimeValue$], + 2 + ]; + exports2.ReplicationTimeValue$ = [ + 3, + n04, + _RTV, + 0, + [_Mi], + [1] + ]; + exports2.RequestPaymentConfiguration$ = [ + 3, + n04, + _RPC, + 0, + [_Pay], + [0], + 1 + ]; + exports2.RequestProgress$ = [ + 3, + n04, + _RPe, + 0, + [_Ena], + [2] + ]; + exports2.RestoreObjectOutput$ = [ + 3, + n04, + _ROOe, + 0, + [_RC, _ROP], + [[0, { [_hH]: _xarc }], [0, { [_hH]: _xarop }]] + ]; + exports2.RestoreObjectRequest$ = [ + 3, + n04, + _RORe, + 0, + [_B, _K2, _VI, _RRes, _RP, _CA2, _EBO], + [[0, 1], [0, 1], [0, { [_hQ]: _vI }], [() => exports2.RestoreRequest$, { [_hP]: 1, [_xN]: _RRes }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.RestoreRequest$ = [ + 3, + n04, + _RRes, + 0, + [_D, _GJP, _Ty, _Ti, _Desc, _SP, _OL], + [1, () => exports2.GlacierJobParameters$, 0, 0, 0, () => exports2.SelectParameters$, [() => exports2.OutputLocation$, 0]] + ]; + exports2.RestoreStatus$ = [ + 3, + n04, + _RSe, + 0, + [_IRIP, _RED], + [2, 4] + ]; + exports2.RoutingRule$ = [ + 3, + n04, + _RRo, + 0, + [_Red, _Co], + [() => exports2.Redirect$, () => exports2.Condition$], + 1 + ]; + exports2.S3KeyFilter$ = [ + 3, + n04, + _SKF, + 0, + [_FRi], + [[() => FilterRuleList, { [_xF]: 1, [_xN]: _FR }]] + ]; + exports2.S3Location$ = [ + 3, + n04, + _SL, + 0, + [_BN, _P2, _En, _CACL, _ACL, _Tag, _UM, _SC], + [0, 0, [() => exports2.Encryption$, 0], 0, [() => Grants, 0], [() => exports2.Tagging$, 0], [() => UserMetadata, 0], 0], + 2 + ]; + exports2.S3TablesDestination$ = [ + 3, + n04, + _STD, + 0, + [_TBA, _TNa], + [0, 0], + 2 + ]; + exports2.S3TablesDestinationResult$ = [ + 3, + n04, + _STDR, + 0, + [_TBA, _TNa, _TA, _TN], + [0, 0, 0, 0], + 4 + ]; + exports2.ScanRange$ = [ + 3, + n04, + _SR, + 0, + [_St, _End], + [1, 1] + ]; + exports2.SelectObjectContentOutput$ = [ + 3, + n04, + _SOCO, + 0, + [_Payl], + [[() => exports2.SelectObjectContentEventStream$, 16]] + ]; + exports2.SelectObjectContentRequest$ = [ + 3, + n04, + _SOCR, + 0, + [_B, _K2, _Exp, _ETx, _IS, _OSu, _SSECA, _SSECK, _SSECKMD, _RPe, _SR, _EBO], + [[0, 1], [0, 1], 0, 0, () => exports2.InputSerialization$, () => exports2.OutputSerialization$, [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], () => exports2.RequestProgress$, () => exports2.ScanRange$, [0, { [_hH]: _xaebo }]], + 6 + ]; + exports2.SelectParameters$ = [ + 3, + n04, + _SP, + 0, + [_IS, _ETx, _Exp, _OSu], + [() => exports2.InputSerialization$, 0, 0, () => exports2.OutputSerialization$], + 4 + ]; + exports2.ServerSideEncryptionByDefault$ = [ + 3, + n04, + _SSEBD, + 0, + [_SSEA, _KMSMKID], + [0, [() => SSEKMSKeyId, 0]], + 1 + ]; + exports2.ServerSideEncryptionConfiguration$ = [ + 3, + n04, + _SSEC, + 0, + [_R], + [[() => ServerSideEncryptionRules, { [_xF]: 1, [_xN]: _Ru }]], + 1 + ]; + exports2.ServerSideEncryptionRule$ = [ + 3, + n04, + _SSER, + 0, + [_ASSEBD, _BKE, _BET], + [[() => exports2.ServerSideEncryptionByDefault$, 0], 2, [() => exports2.BlockedEncryptionTypes$, 0]] + ]; + exports2.SessionCredentials$ = [ + 3, + n04, + _SCe, + 0, + [_AKI2, _SAK2, _ST2, _E2], + [[0, { [_xN]: _AKI2 }], [() => SessionCredentialValue, { [_xN]: _SAK2 }], [() => SessionCredentialValue, { [_xN]: _ST2 }], [4, { [_xN]: _E2 }]], + 4 + ]; + exports2.SimplePrefix$ = [ + 3, + n04, + _SPi, + { [_xN]: _SPi }, + [], + [] + ]; + exports2.SourceSelectionCriteria$ = [ + 3, + n04, + _SSC, + 0, + [_SKEO, _RM], + [() => exports2.SseKmsEncryptedObjects$, () => exports2.ReplicaModifications$] + ]; + exports2.SSEKMS$ = [ + 3, + n04, + _SSEKMS, + { [_xN]: _SK }, + [_KI], + [[() => SSEKMSKeyId, 0]], + 1 + ]; + exports2.SseKmsEncryptedObjects$ = [ + 3, + n04, + _SKEO, + 0, + [_S], + [0], + 1 + ]; + exports2.SSEKMSEncryption$ = [ + 3, + n04, + _SSEKMSE, + { [_xN]: _SK }, + [_KMSKA, _BKE], + [[() => NonEmptyKmsKeyArnString, 0], 2], + 1 + ]; + exports2.SSES3$ = [ + 3, + n04, + _SSES, + { [_xN]: _SS }, + [], + [] + ]; + exports2.Stats$ = [ + 3, + n04, + _Sta, + 0, + [_BS, _BP, _BRy], + [1, 1, 1] + ]; + exports2.StatsEvent$ = [ + 3, + n04, + _SE, + 0, + [_Det], + [[() => exports2.Stats$, { [_eP]: 1 }]] + ]; + exports2.StorageClassAnalysis$ = [ + 3, + n04, + _SCA, + 0, + [_DE], + [() => exports2.StorageClassAnalysisDataExport$] + ]; + exports2.StorageClassAnalysisDataExport$ = [ + 3, + n04, + _SCADE, + 0, + [_OSV, _Des], + [0, () => exports2.AnalyticsExportDestination$], + 2 + ]; + exports2.Tag$ = [ + 3, + n04, + _Ta2, + 0, + [_K2, _V2], + [0, 0], + 2 + ]; + exports2.Tagging$ = [ + 3, + n04, + _Tag, + 0, + [_TS], + [[() => TagSet, 0]], + 1 + ]; + exports2.TargetGrant$ = [ + 3, + n04, + _TGa, + 0, + [_Gra, _Pe], + [[() => exports2.Grantee$, { [_xNm]: [_x, _hi] }], 0] + ]; + exports2.TargetObjectKeyFormat$ = [ + 3, + n04, + _TOKF, + 0, + [_SPi, _PP], + [[() => exports2.SimplePrefix$, { [_xN]: _SPi }], [() => exports2.PartitionedPrefix$, { [_xN]: _PP }]] + ]; + exports2.Tiering$ = [ + 3, + n04, + _Tier, + 0, + [_D, _AT3], + [1, 0], + 2 + ]; + exports2.TopicConfiguration$ = [ + 3, + n04, + _TCop, + 0, + [_TAo, _Ev, _I, _F], + [[0, { [_xN]: _Top }], [64 | 0, { [_xF]: 1, [_xN]: _Eve }], 0, [() => exports2.NotificationConfigurationFilter$, 0]], + 2 + ]; + exports2.Transition$ = [ + 3, + n04, + _Tra, + 0, + [_Da, _D, _SC], + [5, 1, 0] + ]; + exports2.UpdateBucketMetadataInventoryTableConfigurationRequest$ = [ + 3, + n04, + _UBMITCR, + 0, + [_B, _ITCn, _CMD, _CA2, _EBO], + [[0, 1], [() => exports2.InventoryTableConfigurationUpdates$, { [_hP]: 1, [_xN]: _ITCn }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.UpdateBucketMetadataJournalTableConfigurationRequest$ = [ + 3, + n04, + _UBMJTCR, + 0, + [_B, _JTC, _CMD, _CA2, _EBO], + [[0, 1], [() => exports2.JournalTableConfigurationUpdates$, { [_hP]: 1, [_xN]: _JTC }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xaebo }]], + 2 + ]; + exports2.UpdateObjectEncryptionRequest$ = [ + 3, + n04, + _UOER, + 0, + [_B, _K2, _OE, _VI, _RP, _EBO, _CMD, _CA2], + [[0, 1], [0, 1], [() => exports2.ObjectEncryption$, 16], [0, { [_hQ]: _vI }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }]], + 3 + ]; + exports2.UpdateObjectEncryptionResponse$ = [ + 3, + n04, + _UOERp, + 0, + [_RC], + [[0, { [_hH]: _xarc }]] + ]; + exports2.UploadPartCopyOutput$ = [ + 3, + n04, + _UPCO, + 0, + [_CSVI, _CPR, _SSE, _SSECA, _SSECKMD, _SSEKMSKI, _BKE, _RC], + [[0, { [_hH]: _xacsvi }], [() => exports2.CopyPartResult$, 16], [0, { [_hH]: _xasse }], [0, { [_hH]: _xasseca }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xarc }]] + ]; + exports2.UploadPartCopyRequest$ = [ + 3, + n04, + _UPCR, + 0, + [_B, _CS2, _K2, _PN, _UI, _CSIM, _CSIMS, _CSINM, _CSIUS, _CSRo, _SSECA, _SSECK, _SSECKMD, _CSSSECA, _CSSSECK, _CSSSECKMD, _RP, _EBO, _ESBO], + [[0, 1], [0, { [_hH]: _xacs__ }], [0, 1], [1, { [_hQ]: _pN }], [0, { [_hQ]: _uI }], [0, { [_hH]: _xacsim }], [4, { [_hH]: _xacsims }], [0, { [_hH]: _xacsinm }], [4, { [_hH]: _xacsius }], [0, { [_hH]: _xacsr }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [0, { [_hH]: _xacssseca }], [() => CopySourceSSECustomerKey, { [_hH]: _xacssseck }], [0, { [_hH]: _xacssseckM }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }], [0, { [_hH]: _xasebo }]], + 5 + ]; + exports2.UploadPartOutput$ = [ + 3, + n04, + _UPO, + 0, + [_SSE, _ETa, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _SSECA, _SSECKMD, _SSEKMSKI, _BKE, _RC], + [[0, { [_hH]: _xasse }], [0, { [_hH]: _ETa }], [0, { [_hH]: _xacc }], [0, { [_hH]: _xacc_ }], [0, { [_hH]: _xacc__ }], [0, { [_hH]: _xacs }], [0, { [_hH]: _xacs_ }], [0, { [_hH]: _xasseca }], [0, { [_hH]: _xasseckM }], [() => SSEKMSKeyId, { [_hH]: _xasseakki }], [2, { [_hH]: _xassebke }], [0, { [_hH]: _xarc }]] + ]; + exports2.UploadPartRequest$ = [ + 3, + n04, + _UPR, + 0, + [_B, _K2, _PN, _UI, _Bo, _CLo, _CMD, _CA2, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _SSECA, _SSECK, _SSECKMD, _RP, _EBO], + [[0, 1], [0, 1], [1, { [_hQ]: _pN }], [0, { [_hQ]: _uI }], [() => StreamingBlob, 16], [1, { [_hH]: _CL__ }], [0, { [_hH]: _CM }], [0, { [_hH]: _xasca }], [0, { [_hH]: _xacc }], [0, { [_hH]: _xacc_ }], [0, { [_hH]: _xacc__ }], [0, { [_hH]: _xacs }], [0, { [_hH]: _xacs_ }], [0, { [_hH]: _xasseca }], [() => SSECustomerKey, { [_hH]: _xasseck }], [0, { [_hH]: _xasseckM }], [0, { [_hH]: _xarp }], [0, { [_hH]: _xaebo }]], + 4 + ]; + exports2.VersioningConfiguration$ = [ + 3, + n04, + _VC, + 0, + [_MFAD, _S], + [[0, { [_xN]: _MDf }], 0] + ]; + exports2.WebsiteConfiguration$ = [ + 3, + n04, + _WC, + 0, + [_EDr, _IDn, _RART, _RR], + [() => exports2.ErrorDocument$, () => exports2.IndexDocument$, () => exports2.RedirectAllRequestsTo$, [() => RoutingRules, 0]] + ]; + exports2.WriteGetObjectResponseRequest$ = [ + 3, + n04, + _WGORR, + 0, + [_RReq, _RTe, _Bo, _SCt, _ECr, _EM, _AR2, _CC, _CDo, _CEo, _CL, _CLo, _CR, _CTo, _CCRC, _CCRCC, _CCRCNVME, _CSHA, _CSHAh, _DM, _ETa, _Ex, _E2, _LM, _MM, _M, _OLM, _OLLHS, _OLRUD, _PC2, _RS, _RC, _Re, _SSE, _SSECA, _SSEKMSKI, _SSECKMD, _SC, _TC2, _VI, _BKE], + [[0, { [_hL]: 1, [_hH]: _xarr }], [0, { [_hH]: _xart }], [() => StreamingBlob, 16], [1, { [_hH]: _xafs }], [0, { [_hH]: _xafec }], [0, { [_hH]: _xafem }], [0, { [_hH]: _xafhar }], [0, { [_hH]: _xafhCC }], [0, { [_hH]: _xafhCD }], [0, { [_hH]: _xafhCE }], [0, { [_hH]: _xafhCL }], [1, { [_hH]: _CL__ }], [0, { [_hH]: _xafhCR }], [0, { [_hH]: _xafhCT }], [0, { [_hH]: _xafhxacc }], [0, { [_hH]: _xafhxacc_ }], [0, { [_hH]: _xafhxacc__ }], [0, { [_hH]: _xafhxacs }], [0, { [_hH]: _xafhxacs_ }], [2, { [_hH]: _xafhxadm }], [0, { [_hH]: _xafhE }], [4, { [_hH]: _xafhE_ }], [0, { [_hH]: _xafhxae }], [4, { [_hH]: _xafhLM }], [1, { [_hH]: _xafhxamm }], [128 | 0, { [_hPH]: _xam }], [0, { [_hH]: _xafhxaolm }], [0, { [_hH]: _xafhxaollh }], [5, { [_hH]: _xafhxaolrud }], [1, { [_hH]: _xafhxampc }], [0, { [_hH]: _xafhxars }], [0, { [_hH]: _xafhxarc }], [0, { [_hH]: _xafhxar }], [0, { [_hH]: _xafhxasse }], [0, { [_hH]: _xafhxasseca }], [() => SSEKMSKeyId, { [_hH]: _xafhxasseakki }], [0, { [_hH]: _xafhxasseckM }], [0, { [_hH]: _xafhxasc }], [1, { [_hH]: _xafhxatc }], [0, { [_hH]: _xafhxavi }], [2, { [_hH]: _xafhxassebke }]], + 2 + ]; + var __Unit = "unit"; + var AllowedHeaders = 64 | 0; + var AllowedMethods = 64 | 0; + var AllowedOrigins = 64 | 0; + var AnalyticsConfigurationList = [ + 1, + n04, + _ACLn, + 0, + [ + () => exports2.AnalyticsConfiguration$, + 0 + ] + ]; + var Buckets = [ + 1, + n04, + _Bu, + 0, + [ + () => exports2.Bucket$, + { [_xN]: _B } + ] + ]; + var ChecksumAlgorithmList = 64 | 0; + var CommonPrefixList = [ + 1, + n04, + _CPL, + 0, + () => exports2.CommonPrefix$ + ]; + var CompletedPartList = [ + 1, + n04, + _CPLo, + 0, + () => exports2.CompletedPart$ + ]; + var CORSRules = [ + 1, + n04, + _CORSR, + 0, + [ + () => exports2.CORSRule$, + 0 + ] + ]; + var DeletedObjects = [ + 1, + n04, + _DOe, + 0, + () => exports2.DeletedObject$ + ]; + var DeleteMarkers = [ + 1, + n04, + _DMe, + 0, + () => exports2.DeleteMarkerEntry$ + ]; + var EncryptionTypeList = [ + 1, + n04, + _ETL, + 0, + [ + 0, + { [_xN]: _ET } + ] + ]; + var Errors = [ + 1, + n04, + _Er, + 0, + () => exports2._Error$ + ]; + var EventList = 64 | 0; + var ExposeHeaders = 64 | 0; + var FilterRuleList = [ + 1, + n04, + _FRL, + 0, + () => exports2.FilterRule$ + ]; + var Grants = [ + 1, + n04, + _G, + 0, + [ + () => exports2.Grant$, + { [_xN]: _Gr } + ] + ]; + var IntelligentTieringConfigurationList = [ + 1, + n04, + _ITCL, + 0, + [ + () => exports2.IntelligentTieringConfiguration$, + 0 + ] + ]; + var InventoryConfigurationList = [ + 1, + n04, + _ICL, + 0, + [ + () => exports2.InventoryConfiguration$, + 0 + ] + ]; + var InventoryOptionalFields = [ + 1, + n04, + _IOF, + 0, + [ + 0, + { [_xN]: _Fi } + ] + ]; + var LambdaFunctionConfigurationList = [ + 1, + n04, + _LFCL, + 0, + [ + () => exports2.LambdaFunctionConfiguration$, + 0 + ] + ]; + var LifecycleRules = [ + 1, + n04, + _LRi, + 0, + [ + () => exports2.LifecycleRule$, + 0 + ] + ]; + var MetricsConfigurationList = [ + 1, + n04, + _MCL, + 0, + [ + () => exports2.MetricsConfiguration$, + 0 + ] + ]; + var MultipartUploadList = [ + 1, + n04, + _MUL, + 0, + () => exports2.MultipartUpload$ + ]; + var NoncurrentVersionTransitionList = [ + 1, + n04, + _NVTL, + 0, + () => exports2.NoncurrentVersionTransition$ + ]; + var ObjectAttributesList = 64 | 0; + var ObjectIdentifierList = [ + 1, + n04, + _OIL, + 0, + () => exports2.ObjectIdentifier$ + ]; + var ObjectList = [ + 1, + n04, + _OLb, + 0, + [ + () => exports2._Object$, + 0 + ] + ]; + var ObjectVersionList = [ + 1, + n04, + _OVL, + 0, + [ + () => exports2.ObjectVersion$, + 0 + ] + ]; + var OptionalObjectAttributesList = 64 | 0; + var OwnershipControlsRules = [ + 1, + n04, + _OCRw, + 0, + () => exports2.OwnershipControlsRule$ + ]; + var Parts = [ + 1, + n04, + _Pa, + 0, + () => exports2.Part$ + ]; + var PartsList = [ + 1, + n04, + _PL, + 0, + () => exports2.ObjectPart$ + ]; + var QueueConfigurationList = [ + 1, + n04, + _QCL, + 0, + [ + () => exports2.QueueConfiguration$, + 0 + ] + ]; + var ReplicationRules = [ + 1, + n04, + _RRep, + 0, + [ + () => exports2.ReplicationRule$, + 0 + ] + ]; + var RoutingRules = [ + 1, + n04, + _RR, + 0, + [ + () => exports2.RoutingRule$, + { [_xN]: _RRo } + ] + ]; + var ServerSideEncryptionRules = [ + 1, + n04, + _SSERe, + 0, + [ + () => exports2.ServerSideEncryptionRule$, + 0 + ] + ]; + var TagSet = [ + 1, + n04, + _TS, + 0, + [ + () => exports2.Tag$, + { [_xN]: _Ta2 } + ] + ]; + var TargetGrants = [ + 1, + n04, + _TG, + 0, + [ + () => exports2.TargetGrant$, + { [_xN]: _Gr } + ] + ]; + var TieringList = [ + 1, + n04, + _TL, + 0, + () => exports2.Tiering$ + ]; + var TopicConfigurationList = [ + 1, + n04, + _TCL, + 0, + [ + () => exports2.TopicConfiguration$, + 0 + ] + ]; + var TransitionList = [ + 1, + n04, + _TLr, + 0, + () => exports2.Transition$ + ]; + var UserMetadata = [ + 1, + n04, + _UM, + 0, + [ + () => exports2.MetadataEntry$, + { [_xN]: _ME } + ] + ]; + var Metadata = 128 | 0; + exports2.AnalyticsFilter$ = [ + 4, + n04, + _AF, + 0, + [_P2, _Ta2, _An], + [0, () => exports2.Tag$, [() => exports2.AnalyticsAndOperator$, 0]] + ]; + exports2.MetricsFilter$ = [ + 4, + n04, + _MF, + 0, + [_P2, _Ta2, _APAc, _An], + [0, () => exports2.Tag$, 0, [() => exports2.MetricsAndOperator$, 0]] + ]; + exports2.ObjectEncryption$ = [ + 4, + n04, + _OE, + 0, + [_SSEKMS], + [[() => exports2.SSEKMSEncryption$, { [_xN]: _SK }]] + ]; + exports2.SelectObjectContentEventStream$ = [ + 4, + n04, + _SOCES, + { [_st]: 1 }, + [_Rec, _Sta, _Pr2, _Cont, _End], + [[() => exports2.RecordsEvent$, 0], [() => exports2.StatsEvent$, 0], [() => exports2.ProgressEvent$, 0], () => exports2.ContinuationEvent$, () => exports2.EndEvent$] + ]; + exports2.AbortMultipartUpload$ = [ + 9, + n04, + _AMU, + { [_h3]: ["DELETE", "/{Key+}?x-id=AbortMultipartUpload", 204] }, + () => exports2.AbortMultipartUploadRequest$, + () => exports2.AbortMultipartUploadOutput$ + ]; + exports2.CompleteMultipartUpload$ = [ + 9, + n04, + _CMUo, + { [_h3]: ["POST", "/{Key+}", 200] }, + () => exports2.CompleteMultipartUploadRequest$, + () => exports2.CompleteMultipartUploadOutput$ + ]; + exports2.CopyObject$ = [ + 9, + n04, + _CO, + { [_h3]: ["PUT", "/{Key+}?x-id=CopyObject", 200] }, + () => exports2.CopyObjectRequest$, + () => exports2.CopyObjectOutput$ + ]; + exports2.CreateBucket$ = [ + 9, + n04, + _CB, + { [_h3]: ["PUT", "/", 200] }, + () => exports2.CreateBucketRequest$, + () => exports2.CreateBucketOutput$ + ]; + exports2.CreateBucketMetadataConfiguration$ = [ + 9, + n04, + _CBMC, + { [_hC]: "-", [_h3]: ["POST", "/?metadataConfiguration", 200] }, + () => exports2.CreateBucketMetadataConfigurationRequest$, + () => __Unit + ]; + exports2.CreateBucketMetadataTableConfiguration$ = [ + 9, + n04, + _CBMTC, + { [_hC]: "-", [_h3]: ["POST", "/?metadataTable", 200] }, + () => exports2.CreateBucketMetadataTableConfigurationRequest$, + () => __Unit + ]; + exports2.CreateMultipartUpload$ = [ + 9, + n04, + _CMUr, + { [_h3]: ["POST", "/{Key+}?uploads", 200] }, + () => exports2.CreateMultipartUploadRequest$, + () => exports2.CreateMultipartUploadOutput$ + ]; + exports2.CreateSession$ = [ + 9, + n04, + _CSr, + { [_h3]: ["GET", "/?session", 200] }, + () => exports2.CreateSessionRequest$, + () => exports2.CreateSessionOutput$ + ]; + exports2.DeleteBucket$ = [ + 9, + n04, + _DB, + { [_h3]: ["DELETE", "/", 204] }, + () => exports2.DeleteBucketRequest$, + () => __Unit + ]; + exports2.DeleteBucketAnalyticsConfiguration$ = [ + 9, + n04, + _DBAC, + { [_h3]: ["DELETE", "/?analytics", 204] }, + () => exports2.DeleteBucketAnalyticsConfigurationRequest$, + () => __Unit + ]; + exports2.DeleteBucketCors$ = [ + 9, + n04, + _DBC, + { [_h3]: ["DELETE", "/?cors", 204] }, + () => exports2.DeleteBucketCorsRequest$, + () => __Unit + ]; + exports2.DeleteBucketEncryption$ = [ + 9, + n04, + _DBE, + { [_h3]: ["DELETE", "/?encryption", 204] }, + () => exports2.DeleteBucketEncryptionRequest$, + () => __Unit + ]; + exports2.DeleteBucketIntelligentTieringConfiguration$ = [ + 9, + n04, + _DBITC, + { [_h3]: ["DELETE", "/?intelligent-tiering", 204] }, + () => exports2.DeleteBucketIntelligentTieringConfigurationRequest$, + () => __Unit + ]; + exports2.DeleteBucketInventoryConfiguration$ = [ + 9, + n04, + _DBIC, + { [_h3]: ["DELETE", "/?inventory", 204] }, + () => exports2.DeleteBucketInventoryConfigurationRequest$, + () => __Unit + ]; + exports2.DeleteBucketLifecycle$ = [ + 9, + n04, + _DBL, + { [_h3]: ["DELETE", "/?lifecycle", 204] }, + () => exports2.DeleteBucketLifecycleRequest$, + () => __Unit + ]; + exports2.DeleteBucketMetadataConfiguration$ = [ + 9, + n04, + _DBMC, + { [_h3]: ["DELETE", "/?metadataConfiguration", 204] }, + () => exports2.DeleteBucketMetadataConfigurationRequest$, + () => __Unit + ]; + exports2.DeleteBucketMetadataTableConfiguration$ = [ + 9, + n04, + _DBMTC, + { [_h3]: ["DELETE", "/?metadataTable", 204] }, + () => exports2.DeleteBucketMetadataTableConfigurationRequest$, + () => __Unit + ]; + exports2.DeleteBucketMetricsConfiguration$ = [ + 9, + n04, + _DBMCe, + { [_h3]: ["DELETE", "/?metrics", 204] }, + () => exports2.DeleteBucketMetricsConfigurationRequest$, + () => __Unit + ]; + exports2.DeleteBucketOwnershipControls$ = [ + 9, + n04, + _DBOC, + { [_h3]: ["DELETE", "/?ownershipControls", 204] }, + () => exports2.DeleteBucketOwnershipControlsRequest$, + () => __Unit + ]; + exports2.DeleteBucketPolicy$ = [ + 9, + n04, + _DBP, + { [_h3]: ["DELETE", "/?policy", 204] }, + () => exports2.DeleteBucketPolicyRequest$, + () => __Unit + ]; + exports2.DeleteBucketReplication$ = [ + 9, + n04, + _DBRe, + { [_h3]: ["DELETE", "/?replication", 204] }, + () => exports2.DeleteBucketReplicationRequest$, + () => __Unit + ]; + exports2.DeleteBucketTagging$ = [ + 9, + n04, + _DBT, + { [_h3]: ["DELETE", "/?tagging", 204] }, + () => exports2.DeleteBucketTaggingRequest$, + () => __Unit + ]; + exports2.DeleteBucketWebsite$ = [ + 9, + n04, + _DBW, + { [_h3]: ["DELETE", "/?website", 204] }, + () => exports2.DeleteBucketWebsiteRequest$, + () => __Unit + ]; + exports2.DeleteObject$ = [ + 9, + n04, + _DOel, + { [_h3]: ["DELETE", "/{Key+}?x-id=DeleteObject", 204] }, + () => exports2.DeleteObjectRequest$, + () => exports2.DeleteObjectOutput$ + ]; + exports2.DeleteObjects$ = [ + 9, + n04, + _DOele, + { [_hC]: "-", [_h3]: ["POST", "/?delete", 200] }, + () => exports2.DeleteObjectsRequest$, + () => exports2.DeleteObjectsOutput$ + ]; + exports2.DeleteObjectTagging$ = [ + 9, + n04, + _DOT, + { [_h3]: ["DELETE", "/{Key+}?tagging", 204] }, + () => exports2.DeleteObjectTaggingRequest$, + () => exports2.DeleteObjectTaggingOutput$ + ]; + exports2.DeletePublicAccessBlock$ = [ + 9, + n04, + _DPAB, + { [_h3]: ["DELETE", "/?publicAccessBlock", 204] }, + () => exports2.DeletePublicAccessBlockRequest$, + () => __Unit + ]; + exports2.GetBucketAbac$ = [ + 9, + n04, + _GBA, + { [_h3]: ["GET", "/?abac", 200] }, + () => exports2.GetBucketAbacRequest$, + () => exports2.GetBucketAbacOutput$ + ]; + exports2.GetBucketAccelerateConfiguration$ = [ + 9, + n04, + _GBAC, + { [_h3]: ["GET", "/?accelerate", 200] }, + () => exports2.GetBucketAccelerateConfigurationRequest$, + () => exports2.GetBucketAccelerateConfigurationOutput$ + ]; + exports2.GetBucketAcl$ = [ + 9, + n04, + _GBAe, + { [_h3]: ["GET", "/?acl", 200] }, + () => exports2.GetBucketAclRequest$, + () => exports2.GetBucketAclOutput$ + ]; + exports2.GetBucketAnalyticsConfiguration$ = [ + 9, + n04, + _GBACe, + { [_h3]: ["GET", "/?analytics&x-id=GetBucketAnalyticsConfiguration", 200] }, + () => exports2.GetBucketAnalyticsConfigurationRequest$, + () => exports2.GetBucketAnalyticsConfigurationOutput$ + ]; + exports2.GetBucketCors$ = [ + 9, + n04, + _GBC, + { [_h3]: ["GET", "/?cors", 200] }, + () => exports2.GetBucketCorsRequest$, + () => exports2.GetBucketCorsOutput$ + ]; + exports2.GetBucketEncryption$ = [ + 9, + n04, + _GBE, + { [_h3]: ["GET", "/?encryption", 200] }, + () => exports2.GetBucketEncryptionRequest$, + () => exports2.GetBucketEncryptionOutput$ + ]; + exports2.GetBucketIntelligentTieringConfiguration$ = [ + 9, + n04, + _GBITC, + { [_h3]: ["GET", "/?intelligent-tiering&x-id=GetBucketIntelligentTieringConfiguration", 200] }, + () => exports2.GetBucketIntelligentTieringConfigurationRequest$, + () => exports2.GetBucketIntelligentTieringConfigurationOutput$ + ]; + exports2.GetBucketInventoryConfiguration$ = [ + 9, + n04, + _GBIC, + { [_h3]: ["GET", "/?inventory&x-id=GetBucketInventoryConfiguration", 200] }, + () => exports2.GetBucketInventoryConfigurationRequest$, + () => exports2.GetBucketInventoryConfigurationOutput$ + ]; + exports2.GetBucketLifecycleConfiguration$ = [ + 9, + n04, + _GBLC, + { [_h3]: ["GET", "/?lifecycle", 200] }, + () => exports2.GetBucketLifecycleConfigurationRequest$, + () => exports2.GetBucketLifecycleConfigurationOutput$ + ]; + exports2.GetBucketLocation$ = [ + 9, + n04, + _GBL, + { [_h3]: ["GET", "/?location", 200] }, + () => exports2.GetBucketLocationRequest$, + () => exports2.GetBucketLocationOutput$ + ]; + exports2.GetBucketLogging$ = [ + 9, + n04, + _GBLe, + { [_h3]: ["GET", "/?logging", 200] }, + () => exports2.GetBucketLoggingRequest$, + () => exports2.GetBucketLoggingOutput$ + ]; + exports2.GetBucketMetadataConfiguration$ = [ + 9, + n04, + _GBMC, + { [_h3]: ["GET", "/?metadataConfiguration", 200] }, + () => exports2.GetBucketMetadataConfigurationRequest$, + () => exports2.GetBucketMetadataConfigurationOutput$ + ]; + exports2.GetBucketMetadataTableConfiguration$ = [ + 9, + n04, + _GBMTC, + { [_h3]: ["GET", "/?metadataTable", 200] }, + () => exports2.GetBucketMetadataTableConfigurationRequest$, + () => exports2.GetBucketMetadataTableConfigurationOutput$ + ]; + exports2.GetBucketMetricsConfiguration$ = [ + 9, + n04, + _GBMCe, + { [_h3]: ["GET", "/?metrics&x-id=GetBucketMetricsConfiguration", 200] }, + () => exports2.GetBucketMetricsConfigurationRequest$, + () => exports2.GetBucketMetricsConfigurationOutput$ + ]; + exports2.GetBucketNotificationConfiguration$ = [ + 9, + n04, + _GBNC, + { [_h3]: ["GET", "/?notification", 200] }, + () => exports2.GetBucketNotificationConfigurationRequest$, + () => exports2.NotificationConfiguration$ + ]; + exports2.GetBucketOwnershipControls$ = [ + 9, + n04, + _GBOC, + { [_h3]: ["GET", "/?ownershipControls", 200] }, + () => exports2.GetBucketOwnershipControlsRequest$, + () => exports2.GetBucketOwnershipControlsOutput$ + ]; + exports2.GetBucketPolicy$ = [ + 9, + n04, + _GBP, + { [_h3]: ["GET", "/?policy", 200] }, + () => exports2.GetBucketPolicyRequest$, + () => exports2.GetBucketPolicyOutput$ + ]; + exports2.GetBucketPolicyStatus$ = [ + 9, + n04, + _GBPS, + { [_h3]: ["GET", "/?policyStatus", 200] }, + () => exports2.GetBucketPolicyStatusRequest$, + () => exports2.GetBucketPolicyStatusOutput$ + ]; + exports2.GetBucketReplication$ = [ + 9, + n04, + _GBR, + { [_h3]: ["GET", "/?replication", 200] }, + () => exports2.GetBucketReplicationRequest$, + () => exports2.GetBucketReplicationOutput$ + ]; + exports2.GetBucketRequestPayment$ = [ + 9, + n04, + _GBRP, + { [_h3]: ["GET", "/?requestPayment", 200] }, + () => exports2.GetBucketRequestPaymentRequest$, + () => exports2.GetBucketRequestPaymentOutput$ + ]; + exports2.GetBucketTagging$ = [ + 9, + n04, + _GBT, + { [_h3]: ["GET", "/?tagging", 200] }, + () => exports2.GetBucketTaggingRequest$, + () => exports2.GetBucketTaggingOutput$ + ]; + exports2.GetBucketVersioning$ = [ + 9, + n04, + _GBV, + { [_h3]: ["GET", "/?versioning", 200] }, + () => exports2.GetBucketVersioningRequest$, + () => exports2.GetBucketVersioningOutput$ + ]; + exports2.GetBucketWebsite$ = [ + 9, + n04, + _GBW, + { [_h3]: ["GET", "/?website", 200] }, + () => exports2.GetBucketWebsiteRequest$, + () => exports2.GetBucketWebsiteOutput$ + ]; + exports2.GetObject$ = [ + 9, + n04, + _GO, + { [_hC]: "-", [_h3]: ["GET", "/{Key+}?x-id=GetObject", 200] }, + () => exports2.GetObjectRequest$, + () => exports2.GetObjectOutput$ + ]; + exports2.GetObjectAcl$ = [ + 9, + n04, + _GOA, + { [_h3]: ["GET", "/{Key+}?acl", 200] }, + () => exports2.GetObjectAclRequest$, + () => exports2.GetObjectAclOutput$ + ]; + exports2.GetObjectAttributes$ = [ + 9, + n04, + _GOAe, + { [_h3]: ["GET", "/{Key+}?attributes", 200] }, + () => exports2.GetObjectAttributesRequest$, + () => exports2.GetObjectAttributesOutput$ + ]; + exports2.GetObjectLegalHold$ = [ + 9, + n04, + _GOLH, + { [_h3]: ["GET", "/{Key+}?legal-hold", 200] }, + () => exports2.GetObjectLegalHoldRequest$, + () => exports2.GetObjectLegalHoldOutput$ + ]; + exports2.GetObjectLockConfiguration$ = [ + 9, + n04, + _GOLC, + { [_h3]: ["GET", "/?object-lock", 200] }, + () => exports2.GetObjectLockConfigurationRequest$, + () => exports2.GetObjectLockConfigurationOutput$ + ]; + exports2.GetObjectRetention$ = [ + 9, + n04, + _GORe, + { [_h3]: ["GET", "/{Key+}?retention", 200] }, + () => exports2.GetObjectRetentionRequest$, + () => exports2.GetObjectRetentionOutput$ + ]; + exports2.GetObjectTagging$ = [ + 9, + n04, + _GOT, + { [_h3]: ["GET", "/{Key+}?tagging", 200] }, + () => exports2.GetObjectTaggingRequest$, + () => exports2.GetObjectTaggingOutput$ + ]; + exports2.GetObjectTorrent$ = [ + 9, + n04, + _GOTe, + { [_h3]: ["GET", "/{Key+}?torrent", 200] }, + () => exports2.GetObjectTorrentRequest$, + () => exports2.GetObjectTorrentOutput$ + ]; + exports2.GetPublicAccessBlock$ = [ + 9, + n04, + _GPAB, + { [_h3]: ["GET", "/?publicAccessBlock", 200] }, + () => exports2.GetPublicAccessBlockRequest$, + () => exports2.GetPublicAccessBlockOutput$ + ]; + exports2.HeadBucket$ = [ + 9, + n04, + _HB, + { [_h3]: ["HEAD", "/", 200] }, + () => exports2.HeadBucketRequest$, + () => exports2.HeadBucketOutput$ + ]; + exports2.HeadObject$ = [ + 9, + n04, + _HO, + { [_h3]: ["HEAD", "/{Key+}", 200] }, + () => exports2.HeadObjectRequest$, + () => exports2.HeadObjectOutput$ + ]; + exports2.ListBucketAnalyticsConfigurations$ = [ + 9, + n04, + _LBAC, + { [_h3]: ["GET", "/?analytics&x-id=ListBucketAnalyticsConfigurations", 200] }, + () => exports2.ListBucketAnalyticsConfigurationsRequest$, + () => exports2.ListBucketAnalyticsConfigurationsOutput$ + ]; + exports2.ListBucketIntelligentTieringConfigurations$ = [ + 9, + n04, + _LBITC, + { [_h3]: ["GET", "/?intelligent-tiering&x-id=ListBucketIntelligentTieringConfigurations", 200] }, + () => exports2.ListBucketIntelligentTieringConfigurationsRequest$, + () => exports2.ListBucketIntelligentTieringConfigurationsOutput$ + ]; + exports2.ListBucketInventoryConfigurations$ = [ + 9, + n04, + _LBIC, + { [_h3]: ["GET", "/?inventory&x-id=ListBucketInventoryConfigurations", 200] }, + () => exports2.ListBucketInventoryConfigurationsRequest$, + () => exports2.ListBucketInventoryConfigurationsOutput$ + ]; + exports2.ListBucketMetricsConfigurations$ = [ + 9, + n04, + _LBMC, + { [_h3]: ["GET", "/?metrics&x-id=ListBucketMetricsConfigurations", 200] }, + () => exports2.ListBucketMetricsConfigurationsRequest$, + () => exports2.ListBucketMetricsConfigurationsOutput$ + ]; + exports2.ListBuckets$ = [ + 9, + n04, + _LB, + { [_h3]: ["GET", "/?x-id=ListBuckets", 200] }, + () => exports2.ListBucketsRequest$, + () => exports2.ListBucketsOutput$ + ]; + exports2.ListDirectoryBuckets$ = [ + 9, + n04, + _LDB, + { [_h3]: ["GET", "/?x-id=ListDirectoryBuckets", 200] }, + () => exports2.ListDirectoryBucketsRequest$, + () => exports2.ListDirectoryBucketsOutput$ + ]; + exports2.ListMultipartUploads$ = [ + 9, + n04, + _LMU, + { [_h3]: ["GET", "/?uploads", 200] }, + () => exports2.ListMultipartUploadsRequest$, + () => exports2.ListMultipartUploadsOutput$ + ]; + exports2.ListObjects$ = [ + 9, + n04, + _LO, + { [_h3]: ["GET", "/", 200] }, + () => exports2.ListObjectsRequest$, + () => exports2.ListObjectsOutput$ + ]; + exports2.ListObjectsV2$ = [ + 9, + n04, + _LOV, + { [_h3]: ["GET", "/?list-type=2", 200] }, + () => exports2.ListObjectsV2Request$, + () => exports2.ListObjectsV2Output$ + ]; + exports2.ListObjectVersions$ = [ + 9, + n04, + _LOVi, + { [_h3]: ["GET", "/?versions", 200] }, + () => exports2.ListObjectVersionsRequest$, + () => exports2.ListObjectVersionsOutput$ + ]; + exports2.ListParts$ = [ + 9, + n04, + _LP, + { [_h3]: ["GET", "/{Key+}?x-id=ListParts", 200] }, + () => exports2.ListPartsRequest$, + () => exports2.ListPartsOutput$ + ]; + exports2.PutBucketAbac$ = [ + 9, + n04, + _PBA, + { [_hC]: "-", [_h3]: ["PUT", "/?abac", 200] }, + () => exports2.PutBucketAbacRequest$, + () => __Unit + ]; + exports2.PutBucketAccelerateConfiguration$ = [ + 9, + n04, + _PBAC, + { [_hC]: "-", [_h3]: ["PUT", "/?accelerate", 200] }, + () => exports2.PutBucketAccelerateConfigurationRequest$, + () => __Unit + ]; + exports2.PutBucketAcl$ = [ + 9, + n04, + _PBAu, + { [_hC]: "-", [_h3]: ["PUT", "/?acl", 200] }, + () => exports2.PutBucketAclRequest$, + () => __Unit + ]; + exports2.PutBucketAnalyticsConfiguration$ = [ + 9, + n04, + _PBACu, + { [_h3]: ["PUT", "/?analytics", 200] }, + () => exports2.PutBucketAnalyticsConfigurationRequest$, + () => __Unit + ]; + exports2.PutBucketCors$ = [ + 9, + n04, + _PBC, + { [_hC]: "-", [_h3]: ["PUT", "/?cors", 200] }, + () => exports2.PutBucketCorsRequest$, + () => __Unit + ]; + exports2.PutBucketEncryption$ = [ + 9, + n04, + _PBE, + { [_hC]: "-", [_h3]: ["PUT", "/?encryption", 200] }, + () => exports2.PutBucketEncryptionRequest$, + () => __Unit + ]; + exports2.PutBucketIntelligentTieringConfiguration$ = [ + 9, + n04, + _PBITC, + { [_h3]: ["PUT", "/?intelligent-tiering", 200] }, + () => exports2.PutBucketIntelligentTieringConfigurationRequest$, + () => __Unit + ]; + exports2.PutBucketInventoryConfiguration$ = [ + 9, + n04, + _PBIC, + { [_h3]: ["PUT", "/?inventory", 200] }, + () => exports2.PutBucketInventoryConfigurationRequest$, + () => __Unit + ]; + exports2.PutBucketLifecycleConfiguration$ = [ + 9, + n04, + _PBLC, + { [_hC]: "-", [_h3]: ["PUT", "/?lifecycle", 200] }, + () => exports2.PutBucketLifecycleConfigurationRequest$, + () => exports2.PutBucketLifecycleConfigurationOutput$ + ]; + exports2.PutBucketLogging$ = [ + 9, + n04, + _PBL, + { [_hC]: "-", [_h3]: ["PUT", "/?logging", 200] }, + () => exports2.PutBucketLoggingRequest$, + () => __Unit + ]; + exports2.PutBucketMetricsConfiguration$ = [ + 9, + n04, + _PBMC, + { [_h3]: ["PUT", "/?metrics", 200] }, + () => exports2.PutBucketMetricsConfigurationRequest$, + () => __Unit + ]; + exports2.PutBucketNotificationConfiguration$ = [ + 9, + n04, + _PBNC, + { [_h3]: ["PUT", "/?notification", 200] }, + () => exports2.PutBucketNotificationConfigurationRequest$, + () => __Unit + ]; + exports2.PutBucketOwnershipControls$ = [ + 9, + n04, + _PBOC, + { [_hC]: "-", [_h3]: ["PUT", "/?ownershipControls", 200] }, + () => exports2.PutBucketOwnershipControlsRequest$, + () => __Unit + ]; + exports2.PutBucketPolicy$ = [ + 9, + n04, + _PBP, + { [_hC]: "-", [_h3]: ["PUT", "/?policy", 200] }, + () => exports2.PutBucketPolicyRequest$, + () => __Unit + ]; + exports2.PutBucketReplication$ = [ + 9, + n04, + _PBR, + { [_hC]: "-", [_h3]: ["PUT", "/?replication", 200] }, + () => exports2.PutBucketReplicationRequest$, + () => __Unit + ]; + exports2.PutBucketRequestPayment$ = [ + 9, + n04, + _PBRP, + { [_hC]: "-", [_h3]: ["PUT", "/?requestPayment", 200] }, + () => exports2.PutBucketRequestPaymentRequest$, + () => __Unit + ]; + exports2.PutBucketTagging$ = [ + 9, + n04, + _PBT, + { [_hC]: "-", [_h3]: ["PUT", "/?tagging", 200] }, + () => exports2.PutBucketTaggingRequest$, + () => __Unit + ]; + exports2.PutBucketVersioning$ = [ + 9, + n04, + _PBV, + { [_hC]: "-", [_h3]: ["PUT", "/?versioning", 200] }, + () => exports2.PutBucketVersioningRequest$, + () => __Unit + ]; + exports2.PutBucketWebsite$ = [ + 9, + n04, + _PBW, + { [_hC]: "-", [_h3]: ["PUT", "/?website", 200] }, + () => exports2.PutBucketWebsiteRequest$, + () => __Unit + ]; + exports2.PutObject$ = [ + 9, + n04, + _PO, + { [_hC]: "-", [_h3]: ["PUT", "/{Key+}?x-id=PutObject", 200] }, + () => exports2.PutObjectRequest$, + () => exports2.PutObjectOutput$ + ]; + exports2.PutObjectAcl$ = [ + 9, + n04, + _POA, + { [_hC]: "-", [_h3]: ["PUT", "/{Key+}?acl", 200] }, + () => exports2.PutObjectAclRequest$, + () => exports2.PutObjectAclOutput$ + ]; + exports2.PutObjectLegalHold$ = [ + 9, + n04, + _POLH, + { [_hC]: "-", [_h3]: ["PUT", "/{Key+}?legal-hold", 200] }, + () => exports2.PutObjectLegalHoldRequest$, + () => exports2.PutObjectLegalHoldOutput$ + ]; + exports2.PutObjectLockConfiguration$ = [ + 9, + n04, + _POLC, + { [_hC]: "-", [_h3]: ["PUT", "/?object-lock", 200] }, + () => exports2.PutObjectLockConfigurationRequest$, + () => exports2.PutObjectLockConfigurationOutput$ + ]; + exports2.PutObjectRetention$ = [ + 9, + n04, + _PORu, + { [_hC]: "-", [_h3]: ["PUT", "/{Key+}?retention", 200] }, + () => exports2.PutObjectRetentionRequest$, + () => exports2.PutObjectRetentionOutput$ + ]; + exports2.PutObjectTagging$ = [ + 9, + n04, + _POT, + { [_hC]: "-", [_h3]: ["PUT", "/{Key+}?tagging", 200] }, + () => exports2.PutObjectTaggingRequest$, + () => exports2.PutObjectTaggingOutput$ + ]; + exports2.PutPublicAccessBlock$ = [ + 9, + n04, + _PPAB, + { [_hC]: "-", [_h3]: ["PUT", "/?publicAccessBlock", 200] }, + () => exports2.PutPublicAccessBlockRequest$, + () => __Unit + ]; + exports2.RenameObject$ = [ + 9, + n04, + _RO, + { [_h3]: ["PUT", "/{Key+}?renameObject", 200] }, + () => exports2.RenameObjectRequest$, + () => exports2.RenameObjectOutput$ + ]; + exports2.RestoreObject$ = [ + 9, + n04, + _ROe, + { [_hC]: "-", [_h3]: ["POST", "/{Key+}?restore", 200] }, + () => exports2.RestoreObjectRequest$, + () => exports2.RestoreObjectOutput$ + ]; + exports2.SelectObjectContent$ = [ + 9, + n04, + _SOC, + { [_h3]: ["POST", "/{Key+}?select&select-type=2", 200] }, + () => exports2.SelectObjectContentRequest$, + () => exports2.SelectObjectContentOutput$ + ]; + exports2.UpdateBucketMetadataInventoryTableConfiguration$ = [ + 9, + n04, + _UBMITC, + { [_hC]: "-", [_h3]: ["PUT", "/?metadataInventoryTable", 200] }, + () => exports2.UpdateBucketMetadataInventoryTableConfigurationRequest$, + () => __Unit + ]; + exports2.UpdateBucketMetadataJournalTableConfiguration$ = [ + 9, + n04, + _UBMJTC, + { [_hC]: "-", [_h3]: ["PUT", "/?metadataJournalTable", 200] }, + () => exports2.UpdateBucketMetadataJournalTableConfigurationRequest$, + () => __Unit + ]; + exports2.UpdateObjectEncryption$ = [ + 9, + n04, + _UOE, + { [_hC]: "-", [_h3]: ["PUT", "/{Key+}?encryption", 200] }, + () => exports2.UpdateObjectEncryptionRequest$, + () => exports2.UpdateObjectEncryptionResponse$ + ]; + exports2.UploadPart$ = [ + 9, + n04, + _UP, + { [_hC]: "-", [_h3]: ["PUT", "/{Key+}?x-id=UploadPart", 200] }, + () => exports2.UploadPartRequest$, + () => exports2.UploadPartOutput$ + ]; + exports2.UploadPartCopy$ = [ + 9, + n04, + _UPC, + { [_h3]: ["PUT", "/{Key+}?x-id=UploadPartCopy", 200] }, + () => exports2.UploadPartCopyRequest$, + () => exports2.UploadPartCopyOutput$ + ]; + exports2.WriteGetObjectResponse$ = [ + 9, + n04, + _WGOR, + { [_en]: ["{RequestRoute}."], [_h3]: ["POST", "/WriteGetObjectResponse", 200] }, + () => exports2.WriteGetObjectResponseRequest$, + () => __Unit + ]; + } +}); + +// node_modules/@aws-sdk/client-s3/package.json +var require_package6 = __commonJS({ + "node_modules/@aws-sdk/client-s3/package.json"(exports2, module2) { + module2.exports = { + name: "@aws-sdk/client-s3", + description: "AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native", + version: "3.992.0", + scripts: { + build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs", + "build:cjs": "node ../../scripts/compilation/inline client-s3", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": 'yarn g:turbo run build -F="$npm_package_name"', + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + clean: "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo", + "extract:docs": "api-extractor run --local", + "generate:client": "node ../../scripts/generate-clients/single-service --solo s3", + test: "yarn g:vitest run", + "test:browser": "node ./test/browser-build/esbuild && yarn g:vitest run -c vitest.config.browser.mts", + "test:browser:watch": "node ./test/browser-build/esbuild && yarn g:vitest watch -c vitest.config.browser.mts", + "test:e2e": "yarn g:vitest run -c vitest.config.e2e.mts && yarn test:browser", + "test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.mts", + "test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs", + "test:integration": "yarn g:vitest run -c vitest.config.integ.mts", + "test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts", + "test:watch": "yarn g:vitest watch" + }, + main: "./dist-cjs/index.js", + types: "./dist-types/index.d.ts", + module: "./dist-es/index.js", + sideEffects: false, + dependencies: { + "@aws-crypto/sha1-browser": "5.2.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "^3.973.10", + "@aws-sdk/credential-provider-node": "^3.972.9", + "@aws-sdk/middleware-bucket-endpoint": "^3.972.3", + "@aws-sdk/middleware-expect-continue": "^3.972.3", + "@aws-sdk/middleware-flexible-checksums": "^3.972.8", + "@aws-sdk/middleware-host-header": "^3.972.3", + "@aws-sdk/middleware-location-constraint": "^3.972.3", + "@aws-sdk/middleware-logger": "^3.972.3", + "@aws-sdk/middleware-recursion-detection": "^3.972.3", + "@aws-sdk/middleware-sdk-s3": "^3.972.10", + "@aws-sdk/middleware-ssec": "^3.972.3", + "@aws-sdk/middleware-user-agent": "^3.972.10", + "@aws-sdk/region-config-resolver": "^3.972.3", + "@aws-sdk/signature-v4-multi-region": "3.992.0", + "@aws-sdk/types": "^3.973.1", + "@aws-sdk/util-endpoints": "3.992.0", + "@aws-sdk/util-user-agent-browser": "^3.972.3", + "@aws-sdk/util-user-agent-node": "^3.972.8", + "@smithy/config-resolver": "^4.4.6", + "@smithy/core": "^3.23.0", + "@smithy/eventstream-serde-browser": "^4.2.8", + "@smithy/eventstream-serde-config-resolver": "^4.3.8", + "@smithy/eventstream-serde-node": "^4.2.8", + "@smithy/fetch-http-handler": "^5.3.9", + "@smithy/hash-blob-browser": "^4.2.9", + "@smithy/hash-node": "^4.2.8", + "@smithy/hash-stream-node": "^4.2.8", + "@smithy/invalid-dependency": "^4.2.8", + "@smithy/md5-js": "^4.2.8", + "@smithy/middleware-content-length": "^4.2.8", + "@smithy/middleware-endpoint": "^4.4.14", + "@smithy/middleware-retry": "^4.4.31", + "@smithy/middleware-serde": "^4.2.9", + "@smithy/middleware-stack": "^4.2.8", + "@smithy/node-config-provider": "^4.3.8", + "@smithy/node-http-handler": "^4.4.10", + "@smithy/protocol-http": "^5.3.8", + "@smithy/smithy-client": "^4.11.3", + "@smithy/types": "^4.12.0", + "@smithy/url-parser": "^4.2.8", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-body-length-node": "^4.2.1", + "@smithy/util-defaults-mode-browser": "^4.3.30", + "@smithy/util-defaults-mode-node": "^4.2.33", + "@smithy/util-endpoints": "^3.2.8", + "@smithy/util-middleware": "^4.2.8", + "@smithy/util-retry": "^4.2.8", + "@smithy/util-stream": "^4.5.12", + "@smithy/util-utf8": "^4.2.0", + "@smithy/util-waiter": "^4.2.8", + tslib: "^2.6.2" + }, + devDependencies: { + "@aws-sdk/signature-v4-crt": "3.992.0", + "@tsconfig/node20": "20.1.8", + "@types/node": "^20.14.8", + concurrently: "7.0.0", + "downlevel-dts": "0.10.1", + premove: "4.0.0", + typescript: "~5.8.3" + }, + engines: { + node: ">=20.0.0" + }, + typesVersions: { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + files: [ + "dist-*/**" + ], + author: { + name: "AWS SDK for JavaScript Team", + url: "https://aws.amazon.com/javascript/" + }, + license: "Apache-2.0", + browser: { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3", + repository: { + type: "git", + url: "https://github.com/aws/aws-sdk-js-v3.git", + directory: "clients/client-s3" + } + }; + } +}); + +// node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +var require_dist_cjs49 = __commonJS({ + "node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js"(exports2) { + "use strict"; + var client = (init_client(), __toCommonJS(client_exports)); + var propertyProvider = require_dist_cjs17(); + var ENV_KEY = "AWS_ACCESS_KEY_ID"; + var ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; + var ENV_SESSION = "AWS_SESSION_TOKEN"; + var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; + var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE"; + var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID"; + var fromEnv = (init) => async () => { + init?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv"); + const accessKeyId = process.env[ENV_KEY]; + const secretAccessKey = process.env[ENV_SECRET]; + const sessionToken = process.env[ENV_SESSION]; + const expiry = process.env[ENV_EXPIRATION]; + const credentialScope = process.env[ENV_CREDENTIAL_SCOPE]; + const accountId = process.env[ENV_ACCOUNT_ID]; + if (accessKeyId && secretAccessKey) { + const credentials = { + accessKeyId, + secretAccessKey, + ...sessionToken && { sessionToken }, + ...expiry && { expiration: new Date(expiry) }, + ...credentialScope && { credentialScope }, + ...accountId && { accountId } + }; + client.setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS", "g"); + return credentials; + } + throw new propertyProvider.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init?.logger }); + }; + exports2.ENV_ACCOUNT_ID = ENV_ACCOUNT_ID; + exports2.ENV_CREDENTIAL_SCOPE = ENV_CREDENTIAL_SCOPE; + exports2.ENV_EXPIRATION = ENV_EXPIRATION; + exports2.ENV_KEY = ENV_KEY; + exports2.ENV_SECRET = ENV_SECRET; + exports2.ENV_SESSION = ENV_SESSION; + exports2.fromEnv = fromEnv; + } +}); + +// node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +var require_dist_cjs50 = __commonJS({ + "node_modules/@smithy/credential-provider-imds/dist-cjs/index.js"(exports2) { + "use strict"; + var propertyProvider = require_dist_cjs17(); + var url = require("url"); + var buffer = require("buffer"); + var http = require("http"); + var nodeConfigProvider = require_dist_cjs42(); + var urlParser = require_dist_cjs35(); + function httpRequest(options) { + return new Promise((resolve, reject) => { + const req = http.request({ + method: "GET", + ...options, + hostname: options.hostname?.replace(/^\[(.+)\]$/, "$1") + }); + req.on("error", (err) => { + reject(Object.assign(new propertyProvider.ProviderError("Unable to connect to instance metadata service"), err)); + req.destroy(); + }); + req.on("timeout", () => { + reject(new propertyProvider.ProviderError("TimeoutError from instance metadata service")); + req.destroy(); + }); + req.on("response", (res) => { + const { statusCode = 400 } = res; + if (statusCode < 200 || 300 <= statusCode) { + reject(Object.assign(new propertyProvider.ProviderError("Error response received from instance metadata service"), { statusCode })); + req.destroy(); + } + const chunks = []; + res.on("data", (chunk) => { + chunks.push(chunk); + }); + res.on("end", () => { + resolve(buffer.Buffer.concat(chunks)); + req.destroy(); + }); + }); + req.end(); + }); + } + var isImdsCredentials = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string"; + var fromImdsCredentials = (creds) => ({ + accessKeyId: creds.AccessKeyId, + secretAccessKey: creds.SecretAccessKey, + sessionToken: creds.Token, + expiration: new Date(creds.Expiration), + ...creds.AccountId && { accountId: creds.AccountId } + }); + var DEFAULT_TIMEOUT = 1e3; + var DEFAULT_MAX_RETRIES = 0; + var providerConfigFromInit = ({ maxRetries = DEFAULT_MAX_RETRIES, timeout = DEFAULT_TIMEOUT }) => ({ maxRetries, timeout }); + var retry = (toRetry, maxRetries) => { + let promise = toRetry(); + for (let i4 = 0; i4 < maxRetries; i4++) { + promise = promise.catch(toRetry); + } + return promise; + }; + var ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; + var ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; + var ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; + var fromContainerMetadata = (init = {}) => { + const { timeout, maxRetries } = providerConfigFromInit(init); + return () => retry(async () => { + const requestOptions = await getCmdsUri({ logger: init.logger }); + const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions)); + if (!isImdsCredentials(credsResponse)) { + throw new propertyProvider.CredentialsProviderError("Invalid response received from instance metadata service.", { + logger: init.logger + }); + } + return fromImdsCredentials(credsResponse); + }, maxRetries); + }; + var requestFromEcsImds = async (timeout, options) => { + if (process.env[ENV_CMDS_AUTH_TOKEN]) { + options.headers = { + ...options.headers, + Authorization: process.env[ENV_CMDS_AUTH_TOKEN] + }; + } + const buffer2 = await httpRequest({ + ...options, + timeout + }); + return buffer2.toString(); + }; + var CMDS_IP = "169.254.170.2"; + var GREENGRASS_HOSTS = { + localhost: true, + "127.0.0.1": true + }; + var GREENGRASS_PROTOCOLS = { + "http:": true, + "https:": true + }; + var getCmdsUri = async ({ logger: logger3 }) => { + if (process.env[ENV_CMDS_RELATIVE_URI]) { + return { + hostname: CMDS_IP, + path: process.env[ENV_CMDS_RELATIVE_URI] + }; + } + if (process.env[ENV_CMDS_FULL_URI]) { + const parsed = url.parse(process.env[ENV_CMDS_FULL_URI]); + if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) { + throw new propertyProvider.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, { + tryNextLink: false, + logger: logger3 + }); + } + if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) { + throw new propertyProvider.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, { + tryNextLink: false, + logger: logger3 + }); + } + return { + ...parsed, + port: parsed.port ? parseInt(parsed.port, 10) : void 0 + }; + } + throw new propertyProvider.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment variable is set`, { + tryNextLink: false, + logger: logger3 + }); + }; + var InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError extends propertyProvider.CredentialsProviderError { + tryNextLink; + name = "InstanceMetadataV1FallbackError"; + constructor(message2, tryNextLink = true) { + super(message2, tryNextLink); + this.tryNextLink = tryNextLink; + Object.setPrototypeOf(this, _InstanceMetadataV1FallbackError.prototype); + } + }; + exports2.Endpoint = void 0; + (function(Endpoint) { + Endpoint["IPv4"] = "http://169.254.169.254"; + Endpoint["IPv6"] = "http://[fd00:ec2::254]"; + })(exports2.Endpoint || (exports2.Endpoint = {})); + var ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; + var CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; + var ENDPOINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME], + configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME], + default: void 0 + }; + var EndpointMode; + (function(EndpointMode2) { + EndpointMode2["IPv4"] = "IPv4"; + EndpointMode2["IPv6"] = "IPv6"; + })(EndpointMode || (EndpointMode = {})); + var ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; + var CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; + var ENDPOINT_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME], + configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME], + default: EndpointMode.IPv4 + }; + var getInstanceMetadataEndpoint = async () => urlParser.parseUrl(await getFromEndpointConfig() || await getFromEndpointModeConfig()); + var getFromEndpointConfig = async () => nodeConfigProvider.loadConfig(ENDPOINT_CONFIG_OPTIONS)(); + var getFromEndpointModeConfig = async () => { + const endpointMode = await nodeConfigProvider.loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)(); + switch (endpointMode) { + case EndpointMode.IPv4: + return exports2.Endpoint.IPv4; + case EndpointMode.IPv6: + return exports2.Endpoint.IPv6; + default: + throw new Error(`Unsupported endpoint mode: ${endpointMode}. Select from ${Object.values(EndpointMode)}`); + } + }; + var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60; + var STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60; + var STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html"; + var getExtendedInstanceMetadataCredentials = (credentials, logger3) => { + const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS); + const newExpiration = new Date(Date.now() + refreshInterval * 1e3); + logger3.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}. +For more information, please visit: ` + STATIC_STABILITY_DOC_URL); + const originalExpiration = credentials.originalExpiration ?? credentials.expiration; + return { + ...credentials, + ...originalExpiration ? { originalExpiration } : {}, + expiration: newExpiration + }; + }; + var staticStabilityProvider = (provider, options = {}) => { + const logger3 = options?.logger || console; + let pastCredentials; + return async () => { + let credentials; + try { + credentials = await provider(); + if (credentials.expiration && credentials.expiration.getTime() < Date.now()) { + credentials = getExtendedInstanceMetadataCredentials(credentials, logger3); + } + } catch (e4) { + if (pastCredentials) { + logger3.warn("Credential renew failed: ", e4); + credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger3); + } else { + throw e4; + } + } + pastCredentials = credentials; + return credentials; + }; + }; + var IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; + var IMDS_TOKEN_PATH = "/latest/api/token"; + var AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED"; + var PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled"; + var X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token"; + var fromInstanceMetadata = (init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger }); + var getInstanceMetadataProvider = (init = {}) => { + let disableFetchToken = false; + const { logger: logger3, profile } = init; + const { timeout, maxRetries } = providerConfigFromInit(init); + const getCredentials = async (maxRetries2, options) => { + const isImdsV1Fallback = disableFetchToken || options.headers?.[X_AWS_EC2_METADATA_TOKEN] == null; + if (isImdsV1Fallback) { + let fallbackBlockedFromProfile = false; + let fallbackBlockedFromProcessEnv = false; + const configValue = await nodeConfigProvider.loadConfig({ + environmentVariableSelector: (env) => { + const envValue = env[AWS_EC2_METADATA_V1_DISABLED]; + fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false"; + if (envValue === void 0) { + throw new propertyProvider.CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, { logger: init.logger }); + } + return fallbackBlockedFromProcessEnv; + }, + configFileSelector: (profile2) => { + const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED]; + fallbackBlockedFromProfile = !!profileValue && profileValue !== "false"; + return fallbackBlockedFromProfile; + }, + default: false + }, { + profile + })(); + if (init.ec2MetadataV1Disabled || configValue) { + const causes = []; + if (init.ec2MetadataV1Disabled) + causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"); + if (fallbackBlockedFromProfile) + causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`); + if (fallbackBlockedFromProcessEnv) + causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`); + throw new InstanceMetadataV1FallbackError(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(", ")}].`); + } + } + const imdsProfile = (await retry(async () => { + let profile2; + try { + profile2 = await getProfile(options); + } catch (err) { + if (err.statusCode === 401) { + disableFetchToken = false; + } + throw err; + } + return profile2; + }, maxRetries2)).trim(); + return retry(async () => { + let creds; + try { + creds = await getCredentialsFromProfile(imdsProfile, options, init); + } catch (err) { + if (err.statusCode === 401) { + disableFetchToken = false; + } + throw err; + } + return creds; + }, maxRetries2); + }; + return async () => { + const endpoint = await getInstanceMetadataEndpoint(); + if (disableFetchToken) { + logger3?.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)"); + return getCredentials(maxRetries, { ...endpoint, timeout }); + } else { + let token; + try { + token = (await getMetadataToken({ ...endpoint, timeout })).toString(); + } catch (error2) { + if (error2?.statusCode === 400) { + throw Object.assign(error2, { + message: "EC2 Metadata token request returned error" + }); + } else if (error2.message === "TimeoutError" || [403, 404, 405].includes(error2.statusCode)) { + disableFetchToken = true; + } + logger3?.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)"); + return getCredentials(maxRetries, { ...endpoint, timeout }); + } + return getCredentials(maxRetries, { + ...endpoint, + headers: { + [X_AWS_EC2_METADATA_TOKEN]: token + }, + timeout + }); + } + }; + }; + var getMetadataToken = async (options) => httpRequest({ + ...options, + path: IMDS_TOKEN_PATH, + method: "PUT", + headers: { + "x-aws-ec2-metadata-token-ttl-seconds": "21600" + } + }); + var getProfile = async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString(); + var getCredentialsFromProfile = async (profile, options, init) => { + const credentialsResponse = JSON.parse((await httpRequest({ + ...options, + path: IMDS_PATH + profile + })).toString()); + if (!isImdsCredentials(credentialsResponse)) { + throw new propertyProvider.CredentialsProviderError("Invalid response received from instance metadata service.", { + logger: init.logger + }); + } + return fromImdsCredentials(credentialsResponse); + }; + exports2.DEFAULT_MAX_RETRIES = DEFAULT_MAX_RETRIES; + exports2.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT; + exports2.ENV_CMDS_AUTH_TOKEN = ENV_CMDS_AUTH_TOKEN; + exports2.ENV_CMDS_FULL_URI = ENV_CMDS_FULL_URI; + exports2.ENV_CMDS_RELATIVE_URI = ENV_CMDS_RELATIVE_URI; + exports2.fromContainerMetadata = fromContainerMetadata; + exports2.fromInstanceMetadata = fromInstanceMetadata; + exports2.getInstanceMetadataEndpoint = getInstanceMetadataEndpoint; + exports2.httpRequest = httpRequest; + exports2.providerConfigFromInit = providerConfigFromInit; + } +}); + +// node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js +var require_checkUrl = __commonJS({ + "node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.checkUrl = void 0; + var property_provider_1 = require_dist_cjs17(); + var ECS_CONTAINER_HOST = "169.254.170.2"; + var EKS_CONTAINER_HOST_IPv4 = "169.254.170.23"; + var EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]"; + var checkUrl = (url, logger3) => { + if (url.protocol === "https:") { + return; + } + if (url.hostname === ECS_CONTAINER_HOST || url.hostname === EKS_CONTAINER_HOST_IPv4 || url.hostname === EKS_CONTAINER_HOST_IPv6) { + return; + } + if (url.hostname.includes("[")) { + if (url.hostname === "[::1]" || url.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]") { + return; + } + } else { + if (url.hostname === "localhost") { + return; + } + const ipComponents = url.hostname.split("."); + const inRange = (component) => { + const num = parseInt(component, 10); + return 0 <= num && num <= 255; + }; + if (ipComponents[0] === "127" && inRange(ipComponents[1]) && inRange(ipComponents[2]) && inRange(ipComponents[3]) && ipComponents.length === 4) { + return; + } + } + throw new property_provider_1.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following: + - loopback CIDR 127.0.0.0/8 or [::1/128] + - ECS container host 169.254.170.2 + - EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger: logger3 }); + }; + exports2.checkUrl = checkUrl; + } +}); + +// node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js +var require_requestHelpers = __commonJS({ + "node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.createGetRequest = createGetRequest; + exports2.getCredentials = getCredentials; + var property_provider_1 = require_dist_cjs17(); + var protocol_http_1 = require_dist_cjs2(); + var smithy_client_1 = require_dist_cjs20(); + var util_stream_1 = require_dist_cjs15(); + function createGetRequest(url) { + return new protocol_http_1.HttpRequest({ + protocol: url.protocol, + hostname: url.hostname, + port: Number(url.port), + path: url.pathname, + query: Array.from(url.searchParams.entries()).reduce((acc, [k4, v4]) => { + acc[k4] = v4; + return acc; + }, {}), + fragment: url.hash + }); + } + async function getCredentials(response, logger3) { + const stream = (0, util_stream_1.sdkStreamMixin)(response.body); + const str = await stream.transformToString(); + if (response.statusCode === 200) { + const parsed = JSON.parse(str); + if (typeof parsed.AccessKeyId !== "string" || typeof parsed.SecretAccessKey !== "string" || typeof parsed.Token !== "string" || typeof parsed.Expiration !== "string") { + throw new property_provider_1.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger: logger3 }); + } + return { + accessKeyId: parsed.AccessKeyId, + secretAccessKey: parsed.SecretAccessKey, + sessionToken: parsed.Token, + expiration: (0, smithy_client_1.parseRfc3339DateTime)(parsed.Expiration) + }; + } + if (response.statusCode >= 400 && response.statusCode < 500) { + let parsedBody = {}; + try { + parsedBody = JSON.parse(str); + } catch (e4) { + } + throw Object.assign(new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger: logger3 }), { + Code: parsedBody.Code, + Message: parsedBody.Message + }); + } + throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger: logger3 }); + } + } +}); + +// node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js +var require_retry_wrapper = __commonJS({ + "node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.retryWrapper = void 0; + var retryWrapper = (toRetry, maxRetries, delayMs) => { + return async () => { + for (let i4 = 0; i4 < maxRetries; ++i4) { + try { + return await toRetry(); + } catch (e4) { + await new Promise((resolve) => setTimeout(resolve, delayMs)); + } + } + return await toRetry(); + }; + }; + exports2.retryWrapper = retryWrapper; + } +}); + +// node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +var require_fromHttp = __commonJS({ + "node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.fromHttp = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var client_1 = (init_client(), __toCommonJS(client_exports)); + var node_http_handler_1 = require_dist_cjs12(); + var property_provider_1 = require_dist_cjs17(); + var promises_1 = tslib_1.__importDefault(require("fs/promises")); + var checkUrl_1 = require_checkUrl(); + var requestHelpers_1 = require_requestHelpers(); + var retry_wrapper_1 = require_retry_wrapper(); + var AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; + var DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2"; + var AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; + var AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE"; + var AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; + var fromHttp = (options = {}) => { + options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp"); + let host; + const relative2 = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI]; + const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI]; + const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN]; + const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE]; + const warn = options.logger?.constructor?.name === "NoOpLogger" || !options.logger?.warn ? console.warn : options.logger.warn.bind(options.logger); + if (relative2 && full) { + warn("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."); + warn("awsContainerCredentialsFullUri will take precedence."); + } + if (token && tokenFile) { + warn("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."); + warn("awsContainerAuthorizationToken will take precedence."); + } + if (full) { + host = full; + } else if (relative2) { + host = `${DEFAULT_LINK_LOCAL_HOST}${relative2}`; + } else { + throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided. +Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger }); + } + const url = new URL(host); + (0, checkUrl_1.checkUrl)(url, options.logger); + const requestHandler = node_http_handler_1.NodeHttpHandler.create({ + requestTimeout: options.timeout ?? 1e3, + connectionTimeout: options.timeout ?? 1e3 + }); + return (0, retry_wrapper_1.retryWrapper)(async () => { + const request = (0, requestHelpers_1.createGetRequest)(url); + if (token) { + request.headers.Authorization = token; + } else if (tokenFile) { + request.headers.Authorization = (await promises_1.default.readFile(tokenFile)).toString(); + } + try { + const result = await requestHandler.handle(request); + return (0, requestHelpers_1.getCredentials)(result.response).then((creds) => (0, client_1.setCredentialFeature)(creds, "CREDENTIALS_HTTP", "z")); + } catch (e4) { + throw new property_provider_1.CredentialsProviderError(String(e4), { logger: options.logger }); + } + }, options.maxRetries ?? 3, options.timeout ?? 1e3); + }; + exports2.fromHttp = fromHttp; + } +}); + +// node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js +var require_dist_cjs51 = __commonJS({ + "node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.fromHttp = void 0; + var fromHttp_1 = require_fromHttp(); + Object.defineProperty(exports2, "fromHttp", { enumerable: true, get: function() { + return fromHttp_1.fromHttp; + } }); + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js +function createAwsAuthSigv4HttpAuthOption(authParameters) { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "sso-oauth", + region: authParameters.region + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context + } + }) + }; +} +function createSmithyApiNoAuthHttpAuthOption(authParameters) { + return { + schemeId: "smithy.api#noAuth" + }; +} +var import_util_middleware6, defaultSSOOIDCHttpAuthSchemeParametersProvider, defaultSSOOIDCHttpAuthSchemeProvider, resolveHttpAuthSchemeConfig; +var init_httpAuthSchemeProvider = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js"() { + init_dist_es2(); + import_util_middleware6 = __toESM(require_dist_cjs4()); + defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, input) => { + return { + operation: (0, import_util_middleware6.getSmithyContext)(context).operation, + region: await (0, import_util_middleware6.normalizeProvider)(config.region)() || (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })() + }; + }; + defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => { + const options = []; + switch (authParameters.operation) { + case "CreateToken": { + options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); + break; + } + default: { + options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); + } + } + return options; + }; + resolveHttpAuthSchemeConfig = (config) => { + const config_0 = resolveAwsSdkSigV4Config(config); + return Object.assign(config_0, { + authSchemePreference: (0, import_util_middleware6.normalizeProvider)(config.authSchemePreference ?? []) + }); + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/EndpointParameters.js +var resolveClientEndpointParameters, commonParams; +var init_EndpointParameters = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/EndpointParameters.js"() { + resolveClientEndpointParameters = (options) => { + return Object.assign(options, { + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "sso-oauth" + }); + }; + commonParams = { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/package.json +var package_default; +var init_package = __esm({ + "node_modules/@aws-sdk/nested-clients/package.json"() { + package_default = { + name: "@aws-sdk/nested-clients", + version: "3.990.0", + description: "Nested clients for AWS SDK packages.", + main: "./dist-cjs/index.js", + module: "./dist-es/index.js", + types: "./dist-types/index.d.ts", + scripts: { + build: "yarn lint && concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs", + "build:cjs": "node ../../scripts/compilation/inline nested-clients", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": 'yarn g:turbo run build -F="$npm_package_name"', + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + clean: "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo", + lint: "node ../../scripts/validation/submodules-linter.js --pkg nested-clients", + test: "yarn g:vitest run", + "test:watch": "yarn g:vitest watch" + }, + engines: { + node: ">=20.0.0" + }, + sideEffects: false, + author: { + name: "AWS SDK for JavaScript Team", + url: "https://aws.amazon.com/javascript/" + }, + license: "Apache-2.0", + dependencies: { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "^3.973.10", + "@aws-sdk/middleware-host-header": "^3.972.3", + "@aws-sdk/middleware-logger": "^3.972.3", + "@aws-sdk/middleware-recursion-detection": "^3.972.3", + "@aws-sdk/middleware-user-agent": "^3.972.10", + "@aws-sdk/region-config-resolver": "^3.972.3", + "@aws-sdk/types": "^3.973.1", + "@aws-sdk/util-endpoints": "3.990.0", + "@aws-sdk/util-user-agent-browser": "^3.972.3", + "@aws-sdk/util-user-agent-node": "^3.972.8", + "@smithy/config-resolver": "^4.4.6", + "@smithy/core": "^3.23.0", + "@smithy/fetch-http-handler": "^5.3.9", + "@smithy/hash-node": "^4.2.8", + "@smithy/invalid-dependency": "^4.2.8", + "@smithy/middleware-content-length": "^4.2.8", + "@smithy/middleware-endpoint": "^4.4.14", + "@smithy/middleware-retry": "^4.4.31", + "@smithy/middleware-serde": "^4.2.9", + "@smithy/middleware-stack": "^4.2.8", + "@smithy/node-config-provider": "^4.3.8", + "@smithy/node-http-handler": "^4.4.10", + "@smithy/protocol-http": "^5.3.8", + "@smithy/smithy-client": "^4.11.3", + "@smithy/types": "^4.12.0", + "@smithy/url-parser": "^4.2.8", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-body-length-node": "^4.2.1", + "@smithy/util-defaults-mode-browser": "^4.3.30", + "@smithy/util-defaults-mode-node": "^4.2.33", + "@smithy/util-endpoints": "^3.2.8", + "@smithy/util-middleware": "^4.2.8", + "@smithy/util-retry": "^4.2.8", + "@smithy/util-utf8": "^4.2.0", + tslib: "^2.6.2" + }, + devDependencies: { + concurrently: "7.0.0", + "downlevel-dts": "0.10.1", + premove: "4.0.0", + typescript: "~5.8.3" + }, + typesVersions: { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + files: [ + "./signin.d.ts", + "./signin.js", + "./sso-oidc.d.ts", + "./sso-oidc.js", + "./sts.d.ts", + "./sts.js", + "dist-*/**" + ], + browser: { + "./dist-es/submodules/signin/runtimeConfig": "./dist-es/submodules/signin/runtimeConfig.browser", + "./dist-es/submodules/sso-oidc/runtimeConfig": "./dist-es/submodules/sso-oidc/runtimeConfig.browser", + "./dist-es/submodules/sts/runtimeConfig": "./dist-es/submodules/sts/runtimeConfig.browser" + }, + "react-native": {}, + homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients", + repository: { + type: "git", + url: "https://github.com/aws/aws-sdk-js-v3.git", + directory: "packages/nested-clients" + }, + exports: { + "./package.json": "./package.json", + "./sso-oidc": { + types: "./dist-types/submodules/sso-oidc/index.d.ts", + module: "./dist-es/submodules/sso-oidc/index.js", + node: "./dist-cjs/submodules/sso-oidc/index.js", + import: "./dist-es/submodules/sso-oidc/index.js", + require: "./dist-cjs/submodules/sso-oidc/index.js" + }, + "./sts": { + types: "./dist-types/submodules/sts/index.d.ts", + module: "./dist-es/submodules/sts/index.js", + node: "./dist-cjs/submodules/sts/index.js", + import: "./dist-es/submodules/sts/index.js", + require: "./dist-cjs/submodules/sts/index.js" + }, + "./signin": { + types: "./dist-types/submodules/signin/index.d.ts", + module: "./dist-es/submodules/signin/index.js", + node: "./dist-cjs/submodules/signin/index.js", + import: "./dist-es/submodules/signin/index.js", + require: "./dist-cjs/submodules/signin/index.js" + } + } + }; + } +}); + +// node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +var require_dist_cjs52 = __commonJS({ + "node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js"(exports2) { + "use strict"; + var os = require("os"); + var process2 = require("process"); + var middlewareUserAgent = require_dist_cjs37(); + var crtAvailability = { + isCrtAvailable: false + }; + var isCrtAvailable = () => { + if (crtAvailability.isCrtAvailable) { + return ["md/crt-avail"]; + } + return null; + }; + var createDefaultUserAgentProvider4 = ({ serviceId, clientVersion }) => { + return async (config) => { + const sections = [ + ["aws-sdk-js", clientVersion], + ["ua", "2.1"], + [`os/${os.platform()}`, os.release()], + ["lang/js"], + ["md/nodejs", `${process2.versions.node}`] + ]; + const crtAvailable = isCrtAvailable(); + if (crtAvailable) { + sections.push(crtAvailable); + } + if (serviceId) { + sections.push([`api/${serviceId}`, clientVersion]); + } + if (process2.env.AWS_EXECUTION_ENV) { + sections.push([`exec-env/${process2.env.AWS_EXECUTION_ENV}`]); + } + const appId = await config?.userAgentAppId?.(); + const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; + return resolvedUserAgent; + }; + }; + var defaultUserAgent = createDefaultUserAgentProvider4; + var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; + var UA_APP_ID_INI_NAME = "sdk_ua_app_id"; + var UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id"; + var NODE_APP_ID_CONFIG_OPTIONS4 = { + environmentVariableSelector: (env) => env[UA_APP_ID_ENV_NAME], + configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED], + default: middlewareUserAgent.DEFAULT_UA_APP_ID + }; + exports2.NODE_APP_ID_CONFIG_OPTIONS = NODE_APP_ID_CONFIG_OPTIONS4; + exports2.UA_APP_ID_ENV_NAME = UA_APP_ID_ENV_NAME; + exports2.UA_APP_ID_INI_NAME = UA_APP_ID_INI_NAME; + exports2.createDefaultUserAgentProvider = createDefaultUserAgentProvider4; + exports2.crtAvailability = crtAvailability; + exports2.defaultUserAgent = defaultUserAgent; + } +}); + +// node_modules/@smithy/hash-node/dist-cjs/index.js +var require_dist_cjs53 = __commonJS({ + "node_modules/@smithy/hash-node/dist-cjs/index.js"(exports2) { + "use strict"; + var utilBufferFrom = require_dist_cjs7(); + var utilUtf8 = require_dist_cjs8(); + var buffer = require("buffer"); + var crypto2 = require("crypto"); + var Hash4 = class { + algorithmIdentifier; + secret; + hash; + constructor(algorithmIdentifier, secret) { + this.algorithmIdentifier = algorithmIdentifier; + this.secret = secret; + this.reset(); + } + update(toHash, encoding) { + this.hash.update(utilUtf8.toUint8Array(castSourceData(toHash, encoding))); + } + digest() { + return Promise.resolve(this.hash.digest()); + } + reset() { + this.hash = this.secret ? crypto2.createHmac(this.algorithmIdentifier, castSourceData(this.secret)) : crypto2.createHash(this.algorithmIdentifier); + } + }; + function castSourceData(toCast, encoding) { + if (buffer.Buffer.isBuffer(toCast)) { + return toCast; + } + if (typeof toCast === "string") { + return utilBufferFrom.fromString(toCast, encoding); + } + if (ArrayBuffer.isView(toCast)) { + return utilBufferFrom.fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength); + } + return utilBufferFrom.fromArrayBuffer(toCast); + } + exports2.Hash = Hash4; + } +}); + +// node_modules/@smithy/util-body-length-node/dist-cjs/index.js +var require_dist_cjs54 = __commonJS({ + "node_modules/@smithy/util-body-length-node/dist-cjs/index.js"(exports2) { + "use strict"; + var node_fs = require("node:fs"); + var calculateBodyLength4 = (body) => { + if (!body) { + return 0; + } + if (typeof body === "string") { + return Buffer.byteLength(body); + } else if (typeof body.byteLength === "number") { + return body.byteLength; + } else if (typeof body.size === "number") { + return body.size; + } else if (typeof body.start === "number" && typeof body.end === "number") { + return body.end + 1 - body.start; + } else if (body instanceof node_fs.ReadStream) { + if (body.path != null) { + return node_fs.lstatSync(body.path).size; + } else if (typeof body.fd === "number") { + return node_fs.fstatSync(body.fd).size; + } + } + throw new Error(`Body Length computation failed for ${body}`); + }; + exports2.calculateBodyLength = calculateBodyLength4; + } +}); + +// node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js +var require_dist_cjs55 = __commonJS({ + "node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js"(exports2) { + "use strict"; + var configResolver = require_dist_cjs38(); + var nodeConfigProvider = require_dist_cjs42(); + var propertyProvider = require_dist_cjs17(); + var AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; + var AWS_REGION_ENV = "AWS_REGION"; + var AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; + var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; + var DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; + var IMDS_REGION_PATH = "/latest/meta-data/placement/region"; + var AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; + var AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; + var NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => { + return env[AWS_DEFAULTS_MODE_ENV]; + }, + configFileSelector: (profile) => { + return profile[AWS_DEFAULTS_MODE_CONFIG]; + }, + default: "legacy" + }; + var resolveDefaultsModeConfig4 = ({ region = nodeConfigProvider.loadConfig(configResolver.NODE_REGION_CONFIG_OPTIONS), defaultsMode = nodeConfigProvider.loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) } = {}) => propertyProvider.memoize(async () => { + const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; + switch (mode?.toLowerCase()) { + case "auto": + return resolveNodeDefaultsModeAuto(region); + case "in-region": + case "cross-region": + case "mobile": + case "standard": + case "legacy": + return Promise.resolve(mode?.toLocaleLowerCase()); + case void 0: + return Promise.resolve("legacy"); + default: + throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); + } + }); + var resolveNodeDefaultsModeAuto = async (clientRegion) => { + if (clientRegion) { + const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion; + const inferredRegion = await inferPhysicalRegion(); + if (!inferredRegion) { + return "standard"; + } + if (resolvedRegion === inferredRegion) { + return "in-region"; + } else { + return "cross-region"; + } + } + return "standard"; + }; + var inferPhysicalRegion = async () => { + if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) { + return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV]; + } + if (!process.env[ENV_IMDS_DISABLED]) { + try { + const { getInstanceMetadataEndpoint, httpRequest } = await Promise.resolve().then(() => __toESM(require_dist_cjs50())); + const endpoint = await getInstanceMetadataEndpoint(); + return (await httpRequest({ ...endpoint, path: IMDS_REGION_PATH })).toString(); + } catch (e4) { + } + } + }; + exports2.resolveDefaultsModeConfig = resolveDefaultsModeConfig4; + } +}); + +// node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js +var require_dist_cjs56 = __commonJS({ + "node_modules/@aws-sdk/nested-clients/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js"(exports2) { + "use strict"; + var utilEndpoints = require_dist_cjs33(); + var urlParser = require_dist_cjs35(); + var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { + if (allowSubDomains) { + for (const label of value.split(".")) { + if (!isVirtualHostableS3Bucket(label)) { + return false; + } + } + return true; + } + if (!utilEndpoints.isValidHostLabel(value)) { + return false; + } + if (value.length < 3 || value.length > 63) { + return false; + } + if (value !== value.toLowerCase()) { + return false; + } + if (utilEndpoints.isIpAddress(value)) { + return false; + } + return true; + }; + var ARN_DELIMITER = ":"; + var RESOURCE_DELIMITER = "/"; + var parseArn = (value) => { + const segments = value.split(ARN_DELIMITER); + if (segments.length < 6) + return null; + const [arn, partition2, service, region, accountId, ...resourcePath] = segments; + if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "") + return null; + const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat(); + return { + partition: partition2, + service, + region, + accountId, + resourceId + }; + }; + var partitions = [ + { + id: "aws", + outputs: { + dnsSuffix: "amazonaws.com", + dualStackDnsSuffix: "api.aws", + implicitGlobalRegion: "us-east-1", + name: "aws", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", + regions: { + "af-south-1": { + description: "Africa (Cape Town)" + }, + "ap-east-1": { + description: "Asia Pacific (Hong Kong)" + }, + "ap-east-2": { + description: "Asia Pacific (Taipei)" + }, + "ap-northeast-1": { + description: "Asia Pacific (Tokyo)" + }, + "ap-northeast-2": { + description: "Asia Pacific (Seoul)" + }, + "ap-northeast-3": { + description: "Asia Pacific (Osaka)" + }, + "ap-south-1": { + description: "Asia Pacific (Mumbai)" + }, + "ap-south-2": { + description: "Asia Pacific (Hyderabad)" + }, + "ap-southeast-1": { + description: "Asia Pacific (Singapore)" + }, + "ap-southeast-2": { + description: "Asia Pacific (Sydney)" + }, + "ap-southeast-3": { + description: "Asia Pacific (Jakarta)" + }, + "ap-southeast-4": { + description: "Asia Pacific (Melbourne)" + }, + "ap-southeast-5": { + description: "Asia Pacific (Malaysia)" + }, + "ap-southeast-6": { + description: "Asia Pacific (New Zealand)" + }, + "ap-southeast-7": { + description: "Asia Pacific (Thailand)" + }, + "aws-global": { + description: "aws global region" + }, + "ca-central-1": { + description: "Canada (Central)" + }, + "ca-west-1": { + description: "Canada West (Calgary)" + }, + "eu-central-1": { + description: "Europe (Frankfurt)" + }, + "eu-central-2": { + description: "Europe (Zurich)" + }, + "eu-north-1": { + description: "Europe (Stockholm)" + }, + "eu-south-1": { + description: "Europe (Milan)" + }, + "eu-south-2": { + description: "Europe (Spain)" + }, + "eu-west-1": { + description: "Europe (Ireland)" + }, + "eu-west-2": { + description: "Europe (London)" + }, + "eu-west-3": { + description: "Europe (Paris)" + }, + "il-central-1": { + description: "Israel (Tel Aviv)" + }, + "me-central-1": { + description: "Middle East (UAE)" + }, + "me-south-1": { + description: "Middle East (Bahrain)" + }, + "mx-central-1": { + description: "Mexico (Central)" + }, + "sa-east-1": { + description: "South America (Sao Paulo)" + }, + "us-east-1": { + description: "US East (N. Virginia)" + }, + "us-east-2": { + description: "US East (Ohio)" + }, + "us-west-1": { + description: "US West (N. California)" + }, + "us-west-2": { + description: "US West (Oregon)" + } + } + }, + { + id: "aws-cn", + outputs: { + dnsSuffix: "amazonaws.com.cn", + dualStackDnsSuffix: "api.amazonwebservices.com.cn", + implicitGlobalRegion: "cn-northwest-1", + name: "aws-cn", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^cn\\-\\w+\\-\\d+$", + regions: { + "aws-cn-global": { + description: "aws-cn global region" + }, + "cn-north-1": { + description: "China (Beijing)" + }, + "cn-northwest-1": { + description: "China (Ningxia)" + } + } + }, + { + id: "aws-eusc", + outputs: { + dnsSuffix: "amazonaws.eu", + dualStackDnsSuffix: "api.amazonwebservices.eu", + implicitGlobalRegion: "eusc-de-east-1", + name: "aws-eusc", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$", + regions: { + "eusc-de-east-1": { + description: "AWS European Sovereign Cloud (Germany)" + } + } + }, + { + id: "aws-iso", + outputs: { + dnsSuffix: "c2s.ic.gov", + dualStackDnsSuffix: "api.aws.ic.gov", + implicitGlobalRegion: "us-iso-east-1", + name: "aws-iso", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-iso\\-\\w+\\-\\d+$", + regions: { + "aws-iso-global": { + description: "aws-iso global region" + }, + "us-iso-east-1": { + description: "US ISO East" + }, + "us-iso-west-1": { + description: "US ISO WEST" + } + } + }, + { + id: "aws-iso-b", + outputs: { + dnsSuffix: "sc2s.sgov.gov", + dualStackDnsSuffix: "api.aws.scloud", + implicitGlobalRegion: "us-isob-east-1", + name: "aws-iso-b", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-isob\\-\\w+\\-\\d+$", + regions: { + "aws-iso-b-global": { + description: "aws-iso-b global region" + }, + "us-isob-east-1": { + description: "US ISOB East (Ohio)" + }, + "us-isob-west-1": { + description: "US ISOB West" + } + } + }, + { + id: "aws-iso-e", + outputs: { + dnsSuffix: "cloud.adc-e.uk", + dualStackDnsSuffix: "api.cloud-aws.adc-e.uk", + implicitGlobalRegion: "eu-isoe-west-1", + name: "aws-iso-e", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", + regions: { + "aws-iso-e-global": { + description: "aws-iso-e global region" + }, + "eu-isoe-west-1": { + description: "EU ISOE West" + } + } + }, + { + id: "aws-iso-f", + outputs: { + dnsSuffix: "csp.hci.ic.gov", + dualStackDnsSuffix: "api.aws.hci.ic.gov", + implicitGlobalRegion: "us-isof-south-1", + name: "aws-iso-f", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + regions: { + "aws-iso-f-global": { + description: "aws-iso-f global region" + }, + "us-isof-east-1": { + description: "US ISOF EAST" + }, + "us-isof-south-1": { + description: "US ISOF SOUTH" + } + } + }, + { + id: "aws-us-gov", + outputs: { + dnsSuffix: "amazonaws.com", + dualStackDnsSuffix: "api.aws", + implicitGlobalRegion: "us-gov-west-1", + name: "aws-us-gov", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", + regions: { + "aws-us-gov-global": { + description: "aws-us-gov global region" + }, + "us-gov-east-1": { + description: "AWS GovCloud (US-East)" + }, + "us-gov-west-1": { + description: "AWS GovCloud (US-West)" + } + } + } + ]; + var version = "1.1"; + var partitionsInfo = { + partitions, + version + }; + var selectedPartitionsInfo = partitionsInfo; + var selectedUserAgentPrefix = ""; + var partition = (value) => { + const { partitions: partitions2 } = selectedPartitionsInfo; + for (const partition2 of partitions2) { + const { regions, outputs } = partition2; + for (const [region, regionData] of Object.entries(regions)) { + if (region === value) { + return { + ...outputs, + ...regionData + }; + } + } + } + for (const partition2 of partitions2) { + const { regionRegex, outputs } = partition2; + if (new RegExp(regionRegex).test(value)) { + return { + ...outputs + }; + } + } + const DEFAULT_PARTITION = partitions2.find((partition2) => partition2.id === "aws"); + if (!DEFAULT_PARTITION) { + throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist."); + } + return { + ...DEFAULT_PARTITION.outputs + }; + }; + var setPartitionInfo = (partitionsInfo2, userAgentPrefix = "") => { + selectedPartitionsInfo = partitionsInfo2; + selectedUserAgentPrefix = userAgentPrefix; + }; + var useDefaultPartitionInfo = () => { + setPartitionInfo(partitionsInfo, ""); + }; + var getUserAgentPrefix = () => selectedUserAgentPrefix; + var awsEndpointFunctions4 = { + isVirtualHostableS3Bucket, + parseArn, + partition + }; + utilEndpoints.customEndpointFunctions.aws = awsEndpointFunctions4; + var resolveDefaultAwsRegionalEndpointsConfig = (input) => { + if (typeof input.endpointProvider !== "function") { + throw new Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client."); + } + const { endpoint } = input; + if (endpoint === void 0) { + input.endpoint = async () => { + return toEndpointV1(input.endpointProvider({ + Region: typeof input.region === "function" ? await input.region() : input.region, + UseDualStack: typeof input.useDualstackEndpoint === "function" ? await input.useDualstackEndpoint() : input.useDualstackEndpoint, + UseFIPS: typeof input.useFipsEndpoint === "function" ? await input.useFipsEndpoint() : input.useFipsEndpoint, + Endpoint: void 0 + }, { logger: input.logger })); + }; + } + return input; + }; + var toEndpointV1 = (endpoint) => urlParser.parseUrl(endpoint.url); + Object.defineProperty(exports2, "EndpointError", { + enumerable: true, + get: function() { + return utilEndpoints.EndpointError; + } + }); + Object.defineProperty(exports2, "isIpAddress", { + enumerable: true, + get: function() { + return utilEndpoints.isIpAddress; + } + }); + Object.defineProperty(exports2, "resolveEndpoint", { + enumerable: true, + get: function() { + return utilEndpoints.resolveEndpoint; + } + }); + exports2.awsEndpointFunctions = awsEndpointFunctions4; + exports2.getUserAgentPrefix = getUserAgentPrefix; + exports2.partition = partition; + exports2.resolveDefaultAwsRegionalEndpointsConfig = resolveDefaultAwsRegionalEndpointsConfig; + exports2.setPartitionInfo = setPartitionInfo; + exports2.toEndpointV1 = toEndpointV1; + exports2.useDefaultPartitionInfo = useDefaultPartitionInfo; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/ruleset.js +var u, v, w, x, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, _data, ruleSet; +var init_ruleset = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/ruleset.js"() { + u = "required"; + v = "fn"; + w = "argv"; + x = "ref"; + a = true; + b = "isSet"; + c = "booleanEquals"; + d = "error"; + e = "endpoint"; + f = "tree"; + g = "PartitionResult"; + h = "getAttr"; + i = { [u]: false, "type": "string" }; + j = { [u]: true, "default": false, "type": "boolean" }; + k = { [x]: "Endpoint" }; + l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }; + m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }; + n = {}; + o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] }; + p = { [x]: g }; + q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] }; + r = [l]; + s = [m]; + t = [{ [x]: "Region" }]; + _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: r, rules: [{ conditions: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://oidc.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] }; + ruleSet = _data; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/endpointResolver.js +var import_util_endpoints, import_util_endpoints2, cache, defaultEndpointResolver; +var init_endpointResolver = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/endpointResolver.js"() { + import_util_endpoints = __toESM(require_dist_cjs56()); + import_util_endpoints2 = __toESM(require_dist_cjs33()); + init_ruleset(); + cache = new import_util_endpoints2.EndpointCache({ + size: 50, + params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] + }); + defaultEndpointResolver = (endpointParams, context = {}) => { + return cache.get(endpointParams, () => (0, import_util_endpoints2.resolveEndpoint)(ruleSet, { + endpointParams, + logger: context.logger + })); + }; + import_util_endpoints2.customEndpointFunctions.aws = import_util_endpoints.awsEndpointFunctions; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js +var import_smithy_client8, SSOOIDCServiceException; +var init_SSOOIDCServiceException = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js"() { + import_smithy_client8 = __toESM(require_dist_cjs20()); + SSOOIDCServiceException = class _SSOOIDCServiceException extends import_smithy_client8.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, _SSOOIDCServiceException.prototype); + } + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/errors.js +var AccessDeniedException, AuthorizationPendingException, ExpiredTokenException, InternalServerException, InvalidClientException, InvalidGrantException, InvalidRequestException, InvalidScopeException, SlowDownException, UnauthorizedClientException, UnsupportedGrantTypeException; +var init_errors = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/errors.js"() { + init_SSOOIDCServiceException(); + AccessDeniedException = class _AccessDeniedException extends SSOOIDCServiceException { + name = "AccessDeniedException"; + $fault = "client"; + error; + reason; + error_description; + constructor(opts) { + super({ + name: "AccessDeniedException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _AccessDeniedException.prototype); + this.error = opts.error; + this.reason = opts.reason; + this.error_description = opts.error_description; + } + }; + AuthorizationPendingException = class _AuthorizationPendingException extends SSOOIDCServiceException { + name = "AuthorizationPendingException"; + $fault = "client"; + error; + error_description; + constructor(opts) { + super({ + name: "AuthorizationPendingException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _AuthorizationPendingException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } + }; + ExpiredTokenException = class _ExpiredTokenException extends SSOOIDCServiceException { + name = "ExpiredTokenException"; + $fault = "client"; + error; + error_description; + constructor(opts) { + super({ + name: "ExpiredTokenException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _ExpiredTokenException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } + }; + InternalServerException = class _InternalServerException extends SSOOIDCServiceException { + name = "InternalServerException"; + $fault = "server"; + error; + error_description; + constructor(opts) { + super({ + name: "InternalServerException", + $fault: "server", + ...opts + }); + Object.setPrototypeOf(this, _InternalServerException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } + }; + InvalidClientException = class _InvalidClientException extends SSOOIDCServiceException { + name = "InvalidClientException"; + $fault = "client"; + error; + error_description; + constructor(opts) { + super({ + name: "InvalidClientException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _InvalidClientException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } + }; + InvalidGrantException = class _InvalidGrantException extends SSOOIDCServiceException { + name = "InvalidGrantException"; + $fault = "client"; + error; + error_description; + constructor(opts) { + super({ + name: "InvalidGrantException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _InvalidGrantException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } + }; + InvalidRequestException = class _InvalidRequestException extends SSOOIDCServiceException { + name = "InvalidRequestException"; + $fault = "client"; + error; + reason; + error_description; + constructor(opts) { + super({ + name: "InvalidRequestException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _InvalidRequestException.prototype); + this.error = opts.error; + this.reason = opts.reason; + this.error_description = opts.error_description; + } + }; + InvalidScopeException = class _InvalidScopeException extends SSOOIDCServiceException { + name = "InvalidScopeException"; + $fault = "client"; + error; + error_description; + constructor(opts) { + super({ + name: "InvalidScopeException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _InvalidScopeException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } + }; + SlowDownException = class _SlowDownException extends SSOOIDCServiceException { + name = "SlowDownException"; + $fault = "client"; + error; + error_description; + constructor(opts) { + super({ + name: "SlowDownException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _SlowDownException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } + }; + UnauthorizedClientException = class _UnauthorizedClientException extends SSOOIDCServiceException { + name = "UnauthorizedClientException"; + $fault = "client"; + error; + error_description; + constructor(opts) { + super({ + name: "UnauthorizedClientException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _UnauthorizedClientException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } + }; + UnsupportedGrantTypeException = class _UnsupportedGrantTypeException extends SSOOIDCServiceException { + name = "UnsupportedGrantTypeException"; + $fault = "client"; + error; + error_description; + constructor(opts) { + super({ + name: "UnsupportedGrantTypeException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _UnsupportedGrantTypeException.prototype); + this.error = opts.error; + this.error_description = opts.error_description; + } + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js +var _ADE, _APE, _AT, _CS, _CT, _CTR, _CTRr, _CV, _ETE, _ICE, _IGE, _IRE, _ISE, _ISEn, _IT, _RT, _SDE, _UCE, _UGTE, _aT, _c, _cI, _cS, _cV, _co, _dC, _e, _eI, _ed, _gT, _h, _hE, _iT, _r, _rT, _rU, _s, _sc, _se, _tT, n0, _s_registry, SSOOIDCServiceException$, n0_registry, AccessDeniedException$, AuthorizationPendingException$, ExpiredTokenException$, InternalServerException$, InvalidClientException$, InvalidGrantException$, InvalidRequestException$, InvalidScopeException$, SlowDownException$, UnauthorizedClientException$, UnsupportedGrantTypeException$, errorTypeRegistries, AccessToken, ClientSecret, CodeVerifier, IdToken, RefreshToken, CreateTokenRequest$, CreateTokenResponse$, Scopes, CreateToken$; +var init_schemas_0 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js"() { + init_schema(); + init_errors(); + init_SSOOIDCServiceException(); + _ADE = "AccessDeniedException"; + _APE = "AuthorizationPendingException"; + _AT = "AccessToken"; + _CS = "ClientSecret"; + _CT = "CreateToken"; + _CTR = "CreateTokenRequest"; + _CTRr = "CreateTokenResponse"; + _CV = "CodeVerifier"; + _ETE = "ExpiredTokenException"; + _ICE = "InvalidClientException"; + _IGE = "InvalidGrantException"; + _IRE = "InvalidRequestException"; + _ISE = "InternalServerException"; + _ISEn = "InvalidScopeException"; + _IT = "IdToken"; + _RT = "RefreshToken"; + _SDE = "SlowDownException"; + _UCE = "UnauthorizedClientException"; + _UGTE = "UnsupportedGrantTypeException"; + _aT = "accessToken"; + _c = "client"; + _cI = "clientId"; + _cS = "clientSecret"; + _cV = "codeVerifier"; + _co = "code"; + _dC = "deviceCode"; + _e = "error"; + _eI = "expiresIn"; + _ed = "error_description"; + _gT = "grantType"; + _h = "http"; + _hE = "httpError"; + _iT = "idToken"; + _r = "reason"; + _rT = "refreshToken"; + _rU = "redirectUri"; + _s = "smithy.ts.sdk.synthetic.com.amazonaws.ssooidc"; + _sc = "scope"; + _se = "server"; + _tT = "tokenType"; + n0 = "com.amazonaws.ssooidc"; + _s_registry = TypeRegistry.for(_s); + SSOOIDCServiceException$ = [-3, _s, "SSOOIDCServiceException", 0, [], []]; + _s_registry.registerError(SSOOIDCServiceException$, SSOOIDCServiceException); + n0_registry = TypeRegistry.for(n0); + AccessDeniedException$ = [ + -3, + n0, + _ADE, + { [_e]: _c, [_hE]: 400 }, + [_e, _r, _ed], + [0, 0, 0] + ]; + n0_registry.registerError(AccessDeniedException$, AccessDeniedException); + AuthorizationPendingException$ = [ + -3, + n0, + _APE, + { [_e]: _c, [_hE]: 400 }, + [_e, _ed], + [0, 0] + ]; + n0_registry.registerError(AuthorizationPendingException$, AuthorizationPendingException); + ExpiredTokenException$ = [-3, n0, _ETE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]]; + n0_registry.registerError(ExpiredTokenException$, ExpiredTokenException); + InternalServerException$ = [-3, n0, _ISE, { [_e]: _se, [_hE]: 500 }, [_e, _ed], [0, 0]]; + n0_registry.registerError(InternalServerException$, InternalServerException); + InvalidClientException$ = [-3, n0, _ICE, { [_e]: _c, [_hE]: 401 }, [_e, _ed], [0, 0]]; + n0_registry.registerError(InvalidClientException$, InvalidClientException); + InvalidGrantException$ = [-3, n0, _IGE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]]; + n0_registry.registerError(InvalidGrantException$, InvalidGrantException); + InvalidRequestException$ = [ + -3, + n0, + _IRE, + { [_e]: _c, [_hE]: 400 }, + [_e, _r, _ed], + [0, 0, 0] + ]; + n0_registry.registerError(InvalidRequestException$, InvalidRequestException); + InvalidScopeException$ = [-3, n0, _ISEn, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]]; + n0_registry.registerError(InvalidScopeException$, InvalidScopeException); + SlowDownException$ = [-3, n0, _SDE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]]; + n0_registry.registerError(SlowDownException$, SlowDownException); + UnauthorizedClientException$ = [ + -3, + n0, + _UCE, + { [_e]: _c, [_hE]: 400 }, + [_e, _ed], + [0, 0] + ]; + n0_registry.registerError(UnauthorizedClientException$, UnauthorizedClientException); + UnsupportedGrantTypeException$ = [ + -3, + n0, + _UGTE, + { [_e]: _c, [_hE]: 400 }, + [_e, _ed], + [0, 0] + ]; + n0_registry.registerError(UnsupportedGrantTypeException$, UnsupportedGrantTypeException); + errorTypeRegistries = [_s_registry, n0_registry]; + AccessToken = [0, n0, _AT, 8, 0]; + ClientSecret = [0, n0, _CS, 8, 0]; + CodeVerifier = [0, n0, _CV, 8, 0]; + IdToken = [0, n0, _IT, 8, 0]; + RefreshToken = [0, n0, _RT, 8, 0]; + CreateTokenRequest$ = [ + 3, + n0, + _CTR, + 0, + [_cI, _cS, _gT, _dC, _co, _rT, _sc, _rU, _cV], + [0, [() => ClientSecret, 0], 0, 0, 0, [() => RefreshToken, 0], 64 | 0, 0, [() => CodeVerifier, 0]], + 3 + ]; + CreateTokenResponse$ = [ + 3, + n0, + _CTRr, + 0, + [_aT, _tT, _eI, _rT, _iT], + [[() => AccessToken, 0], 0, 1, [() => RefreshToken, 0], [() => IdToken, 0]] + ]; + Scopes = 64 | 0; + CreateToken$ = [ + 9, + n0, + _CT, + { [_h]: ["POST", "/token", 200] }, + () => CreateTokenRequest$, + () => CreateTokenResponse$ + ]; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.shared.js +var import_smithy_client9, import_url_parser, import_util_base648, import_util_utf88, getRuntimeConfig; +var init_runtimeConfig_shared = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.shared.js"() { + init_dist_es2(); + init_protocols2(); + init_dist_es(); + import_smithy_client9 = __toESM(require_dist_cjs20()); + import_url_parser = __toESM(require_dist_cjs35()); + import_util_base648 = __toESM(require_dist_cjs9()); + import_util_utf88 = __toESM(require_dist_cjs8()); + init_httpAuthSchemeProvider(); + init_endpointResolver(); + init_schemas_0(); + getRuntimeConfig = (config) => { + return { + apiVersion: "2019-06-10", + base64Decoder: config?.base64Decoder ?? import_util_base648.fromBase64, + base64Encoder: config?.base64Encoder ?? import_util_base648.toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOOIDCHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new AwsSdkSigV4Signer() + }, + { + schemeId: "smithy.api#noAuth", + identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), + signer: new NoAuthSigner() + } + ], + logger: config?.logger ?? new import_smithy_client9.NoOpLogger(), + protocol: config?.protocol ?? AwsRestJsonProtocol, + protocolSettings: config?.protocolSettings ?? { + defaultNamespace: "com.amazonaws.ssooidc", + errorTypeRegistries, + version: "2019-06-10", + serviceTarget: "AWSSSOOIDCService" + }, + serviceId: config?.serviceId ?? "SSO OIDC", + urlParser: config?.urlParser ?? import_url_parser.parseUrl, + utf8Decoder: config?.utf8Decoder ?? import_util_utf88.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? import_util_utf88.toUtf8 + }; + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js +var import_util_user_agent_node, import_config_resolver, import_hash_node, import_middleware_retry, import_node_config_provider, import_node_http_handler, import_smithy_client10, import_util_body_length_node, import_util_defaults_mode_node, import_util_retry, getRuntimeConfig2; +var init_runtimeConfig = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js"() { + init_package(); + init_dist_es2(); + import_util_user_agent_node = __toESM(require_dist_cjs52()); + import_config_resolver = __toESM(require_dist_cjs38()); + import_hash_node = __toESM(require_dist_cjs53()); + import_middleware_retry = __toESM(require_dist_cjs46()); + import_node_config_provider = __toESM(require_dist_cjs42()); + import_node_http_handler = __toESM(require_dist_cjs12()); + import_smithy_client10 = __toESM(require_dist_cjs20()); + import_util_body_length_node = __toESM(require_dist_cjs54()); + import_util_defaults_mode_node = __toESM(require_dist_cjs55()); + import_util_retry = __toESM(require_dist_cjs45()); + init_runtimeConfig_shared(); + getRuntimeConfig2 = (config) => { + (0, import_smithy_client10.emitWarningIfUnsupportedVersion)(process.version); + const defaultsMode = (0, import_util_defaults_mode_node.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(import_smithy_client10.loadConfigsForDefaultMode); + const clientSharedValues = getRuntimeConfig(config); + emitWarningIfUnsupportedVersion(process.version); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + authSchemePreference: config?.authSchemePreference ?? (0, import_node_config_provider.loadConfig)(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), + bodyLengthChecker: config?.bodyLengthChecker ?? import_util_body_length_node.calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, import_util_user_agent_node.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }), + maxAttempts: config?.maxAttempts ?? (0, import_node_config_provider.loadConfig)(import_middleware_retry.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: config?.region ?? (0, import_node_config_provider.loadConfig)(import_config_resolver.NODE_REGION_CONFIG_OPTIONS, { ...import_config_resolver.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), + requestHandler: import_node_http_handler.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), + retryMode: config?.retryMode ?? (0, import_node_config_provider.loadConfig)({ + ...import_middleware_retry.NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || import_util_retry.DEFAULT_RETRY_MODE + }, config), + sha256: config?.sha256 ?? import_hash_node.Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? import_node_http_handler.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, import_node_config_provider.loadConfig)(import_config_resolver.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, import_node_config_provider.loadConfig)(import_config_resolver.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + userAgentAppId: config?.userAgentAppId ?? (0, import_node_config_provider.loadConfig)(import_util_user_agent_node.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) + }; + }; + } +}); + +// node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.js +var require_stsRegionDefaultResolver = __commonJS({ + "node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.warning = void 0; + exports2.stsRegionDefaultResolver = stsRegionDefaultResolver2; + var config_resolver_1 = require_dist_cjs38(); + var node_config_provider_1 = require_dist_cjs42(); + function stsRegionDefaultResolver2(loaderConfig = {}) { + return (0, node_config_provider_1.loadConfig)({ + ...config_resolver_1.NODE_REGION_CONFIG_OPTIONS, + async default() { + if (!exports2.warning.silence) { + console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."); + } + return "us-east-1"; + } + }, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }); + } + exports2.warning = { + silence: false + }; + } +}); + +// node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js +var require_dist_cjs57 = __commonJS({ + "node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js"(exports2) { + "use strict"; + var stsRegionDefaultResolver2 = require_stsRegionDefaultResolver(); + var configResolver = require_dist_cjs38(); + var getAwsRegionExtensionConfiguration4 = (runtimeConfig) => { + return { + setRegion(region) { + runtimeConfig.region = region; + }, + region() { + return runtimeConfig.region; + } + }; + }; + var resolveAwsRegionExtensionConfiguration4 = (awsRegionExtensionConfiguration) => { + return { + region: awsRegionExtensionConfiguration.region() + }; + }; + Object.defineProperty(exports2, "NODE_REGION_CONFIG_FILE_OPTIONS", { + enumerable: true, + get: function() { + return configResolver.NODE_REGION_CONFIG_FILE_OPTIONS; + } + }); + Object.defineProperty(exports2, "NODE_REGION_CONFIG_OPTIONS", { + enumerable: true, + get: function() { + return configResolver.NODE_REGION_CONFIG_OPTIONS; + } + }); + Object.defineProperty(exports2, "REGION_ENV_NAME", { + enumerable: true, + get: function() { + return configResolver.REGION_ENV_NAME; + } + }); + Object.defineProperty(exports2, "REGION_INI_NAME", { + enumerable: true, + get: function() { + return configResolver.REGION_INI_NAME; + } + }); + Object.defineProperty(exports2, "resolveRegionConfig", { + enumerable: true, + get: function() { + return configResolver.resolveRegionConfig; + } + }); + exports2.getAwsRegionExtensionConfiguration = getAwsRegionExtensionConfiguration4; + exports2.resolveAwsRegionExtensionConfiguration = resolveAwsRegionExtensionConfiguration4; + Object.keys(stsRegionDefaultResolver2).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return stsRegionDefaultResolver2[k4]; + } + }); + }); + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.js +var getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig; +var init_httpAuthExtensionConfiguration = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.js"() { + getHttpAuthExtensionConfiguration = (runtimeConfig) => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; + let _credentials = runtimeConfig.credentials; + return { + setHttpAuthScheme(httpAuthScheme) { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes() { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider) { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider() { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials) { + _credentials = credentials; + }, + credentials() { + return _credentials; + } + }; + }; + resolveHttpAuthRuntimeConfig = (config) => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials() + }; + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeExtensions.js +var import_region_config_resolver, import_protocol_http12, import_smithy_client11, resolveRuntimeExtensions; +var init_runtimeExtensions = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeExtensions.js"() { + import_region_config_resolver = __toESM(require_dist_cjs57()); + import_protocol_http12 = __toESM(require_dist_cjs2()); + import_smithy_client11 = __toESM(require_dist_cjs20()); + init_httpAuthExtensionConfiguration(); + resolveRuntimeExtensions = (runtimeConfig, extensions) => { + const extensionConfiguration = Object.assign((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, import_smithy_client11.getDefaultExtensionConfiguration)(runtimeConfig), (0, import_protocol_http12.getHttpHandlerExtensionConfiguration)(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig)); + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + return Object.assign(runtimeConfig, (0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, import_smithy_client11.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, import_protocol_http12.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration)); + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDCClient.js +var import_middleware_host_header, import_middleware_logger, import_middleware_recursion_detection, import_middleware_user_agent, import_config_resolver2, import_middleware_content_length, import_middleware_endpoint, import_middleware_retry2, import_smithy_client12, SSOOIDCClient; +var init_SSOOIDCClient = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDCClient.js"() { + import_middleware_host_header = __toESM(require_dist_cjs27()); + import_middleware_logger = __toESM(require_dist_cjs28()); + import_middleware_recursion_detection = __toESM(require_dist_cjs29()); + import_middleware_user_agent = __toESM(require_dist_cjs37()); + import_config_resolver2 = __toESM(require_dist_cjs38()); + init_dist_es(); + init_schema(); + import_middleware_content_length = __toESM(require_dist_cjs40()); + import_middleware_endpoint = __toESM(require_dist_cjs43()); + import_middleware_retry2 = __toESM(require_dist_cjs46()); + import_smithy_client12 = __toESM(require_dist_cjs20()); + init_httpAuthSchemeProvider(); + init_EndpointParameters(); + init_runtimeConfig(); + init_runtimeExtensions(); + SSOOIDCClient = class extends import_smithy_client12.Client { + config; + constructor(...[configuration]) { + const _config_0 = getRuntimeConfig2(configuration || {}); + super(_config_0); + this.initConfig = _config_0; + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1); + const _config_3 = (0, import_middleware_retry2.resolveRetryConfig)(_config_2); + const _config_4 = (0, import_config_resolver2.resolveRegionConfig)(_config_3); + const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4); + const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5); + const _config_7 = resolveHttpAuthSchemeConfig(_config_6); + const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); + this.config = _config_8; + this.middlewareStack.use(getSchemaSerdePlugin(this.config)); + this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_retry2.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config)); + this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: defaultSSOOIDCHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials + }) + })); + this.middlewareStack.use(getHttpSigningPlugin(this.config)); + } + destroy() { + super.destroy(); + } + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/CreateTokenCommand.js +var import_middleware_endpoint2, import_smithy_client13, CreateTokenCommand; +var init_CreateTokenCommand = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/CreateTokenCommand.js"() { + import_middleware_endpoint2 = __toESM(require_dist_cjs43()); + import_smithy_client13 = __toESM(require_dist_cjs20()); + init_EndpointParameters(); + init_schemas_0(); + CreateTokenCommand = class extends import_smithy_client13.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o4) { + return [(0, import_middleware_endpoint2.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())]; + }).s("AWSSSOOIDCService", "CreateToken", {}).n("SSOOIDCClient", "CreateTokenCommand").sc(CreateToken$).build() { + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDC.js +var import_smithy_client14, commands, SSOOIDC; +var init_SSOOIDC = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDC.js"() { + import_smithy_client14 = __toESM(require_dist_cjs20()); + init_CreateTokenCommand(); + init_SSOOIDCClient(); + commands = { + CreateTokenCommand + }; + SSOOIDC = class extends SSOOIDCClient { + }; + (0, import_smithy_client14.createAggregatedClient)(commands, SSOOIDC); + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/index.js +var init_commands = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/index.js"() { + init_CreateTokenCommand(); + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/enums.js +var AccessDeniedExceptionReason, InvalidRequestExceptionReason; +var init_enums = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/enums.js"() { + AccessDeniedExceptionReason = { + KMS_ACCESS_DENIED: "KMS_AccessDeniedException" + }; + InvalidRequestExceptionReason = { + KMS_DISABLED_KEY: "KMS_DisabledException", + KMS_INVALID_KEY_USAGE: "KMS_InvalidKeyUsageException", + KMS_INVALID_STATE: "KMS_InvalidStateException", + KMS_KEY_NOT_FOUND: "KMS_NotFoundException" + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/models_0.js +var init_models_0 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/models_0.js"() { + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/index.js +var sso_oidc_exports = {}; +__export(sso_oidc_exports, { + $Command: () => import_smithy_client13.Command, + AccessDeniedException: () => AccessDeniedException, + AccessDeniedException$: () => AccessDeniedException$, + AccessDeniedExceptionReason: () => AccessDeniedExceptionReason, + AuthorizationPendingException: () => AuthorizationPendingException, + AuthorizationPendingException$: () => AuthorizationPendingException$, + CreateToken$: () => CreateToken$, + CreateTokenCommand: () => CreateTokenCommand, + CreateTokenRequest$: () => CreateTokenRequest$, + CreateTokenResponse$: () => CreateTokenResponse$, + ExpiredTokenException: () => ExpiredTokenException, + ExpiredTokenException$: () => ExpiredTokenException$, + InternalServerException: () => InternalServerException, + InternalServerException$: () => InternalServerException$, + InvalidClientException: () => InvalidClientException, + InvalidClientException$: () => InvalidClientException$, + InvalidGrantException: () => InvalidGrantException, + InvalidGrantException$: () => InvalidGrantException$, + InvalidRequestException: () => InvalidRequestException, + InvalidRequestException$: () => InvalidRequestException$, + InvalidRequestExceptionReason: () => InvalidRequestExceptionReason, + InvalidScopeException: () => InvalidScopeException, + InvalidScopeException$: () => InvalidScopeException$, + SSOOIDC: () => SSOOIDC, + SSOOIDCClient: () => SSOOIDCClient, + SSOOIDCServiceException: () => SSOOIDCServiceException, + SSOOIDCServiceException$: () => SSOOIDCServiceException$, + SlowDownException: () => SlowDownException, + SlowDownException$: () => SlowDownException$, + UnauthorizedClientException: () => UnauthorizedClientException, + UnauthorizedClientException$: () => UnauthorizedClientException$, + UnsupportedGrantTypeException: () => UnsupportedGrantTypeException, + UnsupportedGrantTypeException$: () => UnsupportedGrantTypeException$, + __Client: () => import_smithy_client12.Client, + errorTypeRegistries: () => errorTypeRegistries +}); +var init_sso_oidc = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/index.js"() { + init_SSOOIDCClient(); + init_SSOOIDC(); + init_commands(); + init_schemas_0(); + init_enums(); + init_errors(); + init_models_0(); + init_SSOOIDCServiceException(); + } +}); + +// node_modules/@aws-sdk/token-providers/dist-cjs/index.js +var require_dist_cjs58 = __commonJS({ + "node_modules/@aws-sdk/token-providers/dist-cjs/index.js"(exports2) { + "use strict"; + var client = (init_client(), __toCommonJS(client_exports)); + var httpAuthSchemes = (init_httpAuthSchemes2(), __toCommonJS(httpAuthSchemes_exports)); + var propertyProvider = require_dist_cjs17(); + var sharedIniFileLoader = require_dist_cjs41(); + var fs = require("fs"); + var fromEnvSigningName = ({ logger: logger3, signingName } = {}) => async () => { + logger3?.debug?.("@aws-sdk/token-providers - fromEnvSigningName"); + if (!signingName) { + throw new propertyProvider.TokenProviderError("Please pass 'signingName' to compute environment variable key", { logger: logger3 }); + } + const bearerTokenKey = httpAuthSchemes.getBearerTokenEnvKey(signingName); + if (!(bearerTokenKey in process.env)) { + throw new propertyProvider.TokenProviderError(`Token not present in '${bearerTokenKey}' environment variable`, { logger: logger3 }); + } + const token = { token: process.env[bearerTokenKey] }; + client.setTokenFeature(token, "BEARER_SERVICE_ENV_VARS", "3"); + return token; + }; + var EXPIRE_WINDOW_MS = 5 * 60 * 1e3; + var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`; + var getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => { + const { SSOOIDCClient: SSOOIDCClient2 } = await Promise.resolve().then(() => (init_sso_oidc(), sso_oidc_exports)); + const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop] ?? callerClientConfig?.[prop]; + const ssoOidcClient = new SSOOIDCClient2(Object.assign({}, init.clientConfig ?? {}, { + region: ssoRegion ?? init.clientConfig?.region, + logger: coalesce("logger"), + userAgentAppId: coalesce("userAgentAppId") + })); + return ssoOidcClient; + }; + var getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => { + const { CreateTokenCommand: CreateTokenCommand2 } = await Promise.resolve().then(() => (init_sso_oidc(), sso_oidc_exports)); + const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig); + return ssoOidcClient.send(new CreateTokenCommand2({ + clientId: ssoToken.clientId, + clientSecret: ssoToken.clientSecret, + refreshToken: ssoToken.refreshToken, + grantType: "refresh_token" + })); + }; + var validateTokenExpiry = (token) => { + if (token.expiration && token.expiration.getTime() < Date.now()) { + throw new propertyProvider.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false); + } + }; + var validateTokenKey = (key, value, forRefresh = false) => { + if (typeof value === "undefined") { + throw new propertyProvider.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false); + } + }; + var { writeFile } = fs.promises; + var writeSSOTokenToFile = (id, ssoToken) => { + const tokenFilepath = sharedIniFileLoader.getSSOTokenFilepath(id); + const tokenString = JSON.stringify(ssoToken, null, 2); + return writeFile(tokenFilepath, tokenString); + }; + var lastRefreshAttemptTime = /* @__PURE__ */ new Date(0); + var fromSso = (init = {}) => async ({ callerClientConfig } = {}) => { + init.logger?.debug("@aws-sdk/token-providers - fromSso"); + const profiles = await sharedIniFileLoader.parseKnownFiles(init); + const profileName = sharedIniFileLoader.getProfileName({ + profile: init.profile ?? callerClientConfig?.profile + }); + const profile = profiles[profileName]; + if (!profile) { + throw new propertyProvider.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false); + } else if (!profile["sso_session"]) { + throw new propertyProvider.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`); + } + const ssoSessionName = profile["sso_session"]; + const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init); + const ssoSession = ssoSessions[ssoSessionName]; + if (!ssoSession) { + throw new propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false); + } + for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) { + if (!ssoSession[ssoSessionRequiredKey]) { + throw new propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false); + } + } + ssoSession["sso_start_url"]; + const ssoRegion = ssoSession["sso_region"]; + let ssoToken; + try { + ssoToken = await sharedIniFileLoader.getSSOTokenFromFile(ssoSessionName); + } catch (e4) { + throw new propertyProvider.TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false); + } + validateTokenKey("accessToken", ssoToken.accessToken); + validateTokenKey("expiresAt", ssoToken.expiresAt); + const { accessToken, expiresAt } = ssoToken; + const existingToken = { token: accessToken, expiration: new Date(expiresAt) }; + if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) { + return existingToken; + } + if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1e3) { + validateTokenExpiry(existingToken); + return existingToken; + } + validateTokenKey("clientId", ssoToken.clientId, true); + validateTokenKey("clientSecret", ssoToken.clientSecret, true); + validateTokenKey("refreshToken", ssoToken.refreshToken, true); + try { + lastRefreshAttemptTime.setTime(Date.now()); + const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init, callerClientConfig); + validateTokenKey("accessToken", newSsoOidcToken.accessToken); + validateTokenKey("expiresIn", newSsoOidcToken.expiresIn); + const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3); + try { + await writeSSOTokenToFile(ssoSessionName, { + ...ssoToken, + accessToken: newSsoOidcToken.accessToken, + expiresAt: newTokenExpiration.toISOString(), + refreshToken: newSsoOidcToken.refreshToken + }); + } catch (error2) { + } + return { + token: newSsoOidcToken.accessToken, + expiration: newTokenExpiration + }; + } catch (error2) { + validateTokenExpiry(existingToken); + return existingToken; + } + }; + var fromStatic = ({ token, logger: logger3 }) => async () => { + logger3?.debug("@aws-sdk/token-providers - fromStatic"); + if (!token || !token.token) { + throw new propertyProvider.TokenProviderError(`Please pass a valid token to fromStatic`, false); + } + return token; + }; + var nodeProvider = (init = {}) => propertyProvider.memoize(propertyProvider.chain(fromSso(init), async () => { + throw new propertyProvider.TokenProviderError("Could not load token from any providers", false); + }), (token) => token.expiration !== void 0 && token.expiration.getTime() - Date.now() < 3e5, (token) => token.expiration !== void 0); + exports2.fromEnvSigningName = fromEnvSigningName; + exports2.fromSso = fromSso; + exports2.fromStatic = fromStatic; + exports2.nodeProvider = nodeProvider; + } +}); + +// node_modules/@aws-sdk/client-sso/dist-cjs/auth/httpAuthSchemeProvider.js +var require_httpAuthSchemeProvider2 = __commonJS({ + "node_modules/@aws-sdk/client-sso/dist-cjs/auth/httpAuthSchemeProvider.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.resolveHttpAuthSchemeConfig = exports2.defaultSSOHttpAuthSchemeProvider = exports2.defaultSSOHttpAuthSchemeParametersProvider = void 0; + var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); + var util_middleware_1 = require_dist_cjs4(); + var defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => { + return { + operation: (0, util_middleware_1.getSmithyContext)(context).operation, + region: await (0, util_middleware_1.normalizeProvider)(config.region)() || (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })() + }; + }; + exports2.defaultSSOHttpAuthSchemeParametersProvider = defaultSSOHttpAuthSchemeParametersProvider; + function createAwsAuthSigv4HttpAuthOption4(authParameters) { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "awsssoportal", + region: authParameters.region + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context + } + }) + }; + } + function createSmithyApiNoAuthHttpAuthOption4(authParameters) { + return { + schemeId: "smithy.api#noAuth" + }; + } + var defaultSSOHttpAuthSchemeProvider = (authParameters) => { + const options = []; + switch (authParameters.operation) { + case "GetRoleCredentials": + { + options.push(createSmithyApiNoAuthHttpAuthOption4(authParameters)); + break; + } + ; + case "ListAccountRoles": + { + options.push(createSmithyApiNoAuthHttpAuthOption4(authParameters)); + break; + } + ; + case "ListAccounts": + { + options.push(createSmithyApiNoAuthHttpAuthOption4(authParameters)); + break; + } + ; + case "Logout": + { + options.push(createSmithyApiNoAuthHttpAuthOption4(authParameters)); + break; + } + ; + default: { + options.push(createAwsAuthSigv4HttpAuthOption4(authParameters)); + } + } + return options; + }; + exports2.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider; + var resolveHttpAuthSchemeConfig4 = (config) => { + const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); + return Object.assign(config_0, { + authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []) + }); + }; + exports2.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig4; + } +}); + +// node_modules/@aws-sdk/client-sso/package.json +var require_package7 = __commonJS({ + "node_modules/@aws-sdk/client-sso/package.json"(exports2, module2) { + module2.exports = { + name: "@aws-sdk/client-sso", + description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native", + version: "3.990.0", + scripts: { + build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs", + "build:cjs": "node ../../scripts/compilation/inline client-sso", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": 'yarn g:turbo run build -F="$npm_package_name"', + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + clean: "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo", + "extract:docs": "api-extractor run --local", + "generate:client": "node ../../scripts/generate-clients/single-service --solo sso", + "test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs" + }, + main: "./dist-cjs/index.js", + types: "./dist-types/index.d.ts", + module: "./dist-es/index.js", + sideEffects: false, + dependencies: { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "^3.973.10", + "@aws-sdk/middleware-host-header": "^3.972.3", + "@aws-sdk/middleware-logger": "^3.972.3", + "@aws-sdk/middleware-recursion-detection": "^3.972.3", + "@aws-sdk/middleware-user-agent": "^3.972.10", + "@aws-sdk/region-config-resolver": "^3.972.3", + "@aws-sdk/types": "^3.973.1", + "@aws-sdk/util-endpoints": "3.990.0", + "@aws-sdk/util-user-agent-browser": "^3.972.3", + "@aws-sdk/util-user-agent-node": "^3.972.8", + "@smithy/config-resolver": "^4.4.6", + "@smithy/core": "^3.23.0", + "@smithy/fetch-http-handler": "^5.3.9", + "@smithy/hash-node": "^4.2.8", + "@smithy/invalid-dependency": "^4.2.8", + "@smithy/middleware-content-length": "^4.2.8", + "@smithy/middleware-endpoint": "^4.4.14", + "@smithy/middleware-retry": "^4.4.31", + "@smithy/middleware-serde": "^4.2.9", + "@smithy/middleware-stack": "^4.2.8", + "@smithy/node-config-provider": "^4.3.8", + "@smithy/node-http-handler": "^4.4.10", + "@smithy/protocol-http": "^5.3.8", + "@smithy/smithy-client": "^4.11.3", + "@smithy/types": "^4.12.0", + "@smithy/url-parser": "^4.2.8", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-body-length-node": "^4.2.1", + "@smithy/util-defaults-mode-browser": "^4.3.30", + "@smithy/util-defaults-mode-node": "^4.2.33", + "@smithy/util-endpoints": "^3.2.8", + "@smithy/util-middleware": "^4.2.8", + "@smithy/util-retry": "^4.2.8", + "@smithy/util-utf8": "^4.2.0", + tslib: "^2.6.2" + }, + devDependencies: { + "@tsconfig/node20": "20.1.8", + "@types/node": "^20.14.8", + concurrently: "7.0.0", + "downlevel-dts": "0.10.1", + premove: "4.0.0", + typescript: "~5.8.3" + }, + engines: { + node: ">=20.0.0" + }, + typesVersions: { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + files: [ + "dist-*/**" + ], + author: { + name: "AWS SDK for JavaScript Team", + url: "https://aws.amazon.com/javascript/" + }, + license: "Apache-2.0", + browser: { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso", + repository: { + type: "git", + url: "https://github.com/aws/aws-sdk-js-v3.git", + directory: "clients/client-sso" + } + }; + } +}); + +// node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js +var require_dist_cjs59 = __commonJS({ + "node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js"(exports2) { + "use strict"; + var utilEndpoints = require_dist_cjs33(); + var urlParser = require_dist_cjs35(); + var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { + if (allowSubDomains) { + for (const label of value.split(".")) { + if (!isVirtualHostableS3Bucket(label)) { + return false; + } + } + return true; + } + if (!utilEndpoints.isValidHostLabel(value)) { + return false; + } + if (value.length < 3 || value.length > 63) { + return false; + } + if (value !== value.toLowerCase()) { + return false; + } + if (utilEndpoints.isIpAddress(value)) { + return false; + } + return true; + }; + var ARN_DELIMITER = ":"; + var RESOURCE_DELIMITER = "/"; + var parseArn = (value) => { + const segments = value.split(ARN_DELIMITER); + if (segments.length < 6) + return null; + const [arn, partition2, service, region, accountId, ...resourcePath] = segments; + if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "") + return null; + const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat(); + return { + partition: partition2, + service, + region, + accountId, + resourceId + }; + }; + var partitions = [ + { + id: "aws", + outputs: { + dnsSuffix: "amazonaws.com", + dualStackDnsSuffix: "api.aws", + implicitGlobalRegion: "us-east-1", + name: "aws", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", + regions: { + "af-south-1": { + description: "Africa (Cape Town)" + }, + "ap-east-1": { + description: "Asia Pacific (Hong Kong)" + }, + "ap-east-2": { + description: "Asia Pacific (Taipei)" + }, + "ap-northeast-1": { + description: "Asia Pacific (Tokyo)" + }, + "ap-northeast-2": { + description: "Asia Pacific (Seoul)" + }, + "ap-northeast-3": { + description: "Asia Pacific (Osaka)" + }, + "ap-south-1": { + description: "Asia Pacific (Mumbai)" + }, + "ap-south-2": { + description: "Asia Pacific (Hyderabad)" + }, + "ap-southeast-1": { + description: "Asia Pacific (Singapore)" + }, + "ap-southeast-2": { + description: "Asia Pacific (Sydney)" + }, + "ap-southeast-3": { + description: "Asia Pacific (Jakarta)" + }, + "ap-southeast-4": { + description: "Asia Pacific (Melbourne)" + }, + "ap-southeast-5": { + description: "Asia Pacific (Malaysia)" + }, + "ap-southeast-6": { + description: "Asia Pacific (New Zealand)" + }, + "ap-southeast-7": { + description: "Asia Pacific (Thailand)" + }, + "aws-global": { + description: "aws global region" + }, + "ca-central-1": { + description: "Canada (Central)" + }, + "ca-west-1": { + description: "Canada West (Calgary)" + }, + "eu-central-1": { + description: "Europe (Frankfurt)" + }, + "eu-central-2": { + description: "Europe (Zurich)" + }, + "eu-north-1": { + description: "Europe (Stockholm)" + }, + "eu-south-1": { + description: "Europe (Milan)" + }, + "eu-south-2": { + description: "Europe (Spain)" + }, + "eu-west-1": { + description: "Europe (Ireland)" + }, + "eu-west-2": { + description: "Europe (London)" + }, + "eu-west-3": { + description: "Europe (Paris)" + }, + "il-central-1": { + description: "Israel (Tel Aviv)" + }, + "me-central-1": { + description: "Middle East (UAE)" + }, + "me-south-1": { + description: "Middle East (Bahrain)" + }, + "mx-central-1": { + description: "Mexico (Central)" + }, + "sa-east-1": { + description: "South America (Sao Paulo)" + }, + "us-east-1": { + description: "US East (N. Virginia)" + }, + "us-east-2": { + description: "US East (Ohio)" + }, + "us-west-1": { + description: "US West (N. California)" + }, + "us-west-2": { + description: "US West (Oregon)" + } + } + }, + { + id: "aws-cn", + outputs: { + dnsSuffix: "amazonaws.com.cn", + dualStackDnsSuffix: "api.amazonwebservices.com.cn", + implicitGlobalRegion: "cn-northwest-1", + name: "aws-cn", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^cn\\-\\w+\\-\\d+$", + regions: { + "aws-cn-global": { + description: "aws-cn global region" + }, + "cn-north-1": { + description: "China (Beijing)" + }, + "cn-northwest-1": { + description: "China (Ningxia)" + } + } + }, + { + id: "aws-eusc", + outputs: { + dnsSuffix: "amazonaws.eu", + dualStackDnsSuffix: "api.amazonwebservices.eu", + implicitGlobalRegion: "eusc-de-east-1", + name: "aws-eusc", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$", + regions: { + "eusc-de-east-1": { + description: "AWS European Sovereign Cloud (Germany)" + } + } + }, + { + id: "aws-iso", + outputs: { + dnsSuffix: "c2s.ic.gov", + dualStackDnsSuffix: "api.aws.ic.gov", + implicitGlobalRegion: "us-iso-east-1", + name: "aws-iso", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-iso\\-\\w+\\-\\d+$", + regions: { + "aws-iso-global": { + description: "aws-iso global region" + }, + "us-iso-east-1": { + description: "US ISO East" + }, + "us-iso-west-1": { + description: "US ISO WEST" + } + } + }, + { + id: "aws-iso-b", + outputs: { + dnsSuffix: "sc2s.sgov.gov", + dualStackDnsSuffix: "api.aws.scloud", + implicitGlobalRegion: "us-isob-east-1", + name: "aws-iso-b", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-isob\\-\\w+\\-\\d+$", + regions: { + "aws-iso-b-global": { + description: "aws-iso-b global region" + }, + "us-isob-east-1": { + description: "US ISOB East (Ohio)" + }, + "us-isob-west-1": { + description: "US ISOB West" + } + } + }, + { + id: "aws-iso-e", + outputs: { + dnsSuffix: "cloud.adc-e.uk", + dualStackDnsSuffix: "api.cloud-aws.adc-e.uk", + implicitGlobalRegion: "eu-isoe-west-1", + name: "aws-iso-e", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", + regions: { + "aws-iso-e-global": { + description: "aws-iso-e global region" + }, + "eu-isoe-west-1": { + description: "EU ISOE West" + } + } + }, + { + id: "aws-iso-f", + outputs: { + dnsSuffix: "csp.hci.ic.gov", + dualStackDnsSuffix: "api.aws.hci.ic.gov", + implicitGlobalRegion: "us-isof-south-1", + name: "aws-iso-f", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + regions: { + "aws-iso-f-global": { + description: "aws-iso-f global region" + }, + "us-isof-east-1": { + description: "US ISOF EAST" + }, + "us-isof-south-1": { + description: "US ISOF SOUTH" + } + } + }, + { + id: "aws-us-gov", + outputs: { + dnsSuffix: "amazonaws.com", + dualStackDnsSuffix: "api.aws", + implicitGlobalRegion: "us-gov-west-1", + name: "aws-us-gov", + supportsDualStack: true, + supportsFIPS: true + }, + regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", + regions: { + "aws-us-gov-global": { + description: "aws-us-gov global region" + }, + "us-gov-east-1": { + description: "AWS GovCloud (US-East)" + }, + "us-gov-west-1": { + description: "AWS GovCloud (US-West)" + } + } + } + ]; + var version = "1.1"; + var partitionsInfo = { + partitions, + version + }; + var selectedPartitionsInfo = partitionsInfo; + var selectedUserAgentPrefix = ""; + var partition = (value) => { + const { partitions: partitions2 } = selectedPartitionsInfo; + for (const partition2 of partitions2) { + const { regions, outputs } = partition2; + for (const [region, regionData] of Object.entries(regions)) { + if (region === value) { + return { + ...outputs, + ...regionData + }; + } + } + } + for (const partition2 of partitions2) { + const { regionRegex, outputs } = partition2; + if (new RegExp(regionRegex).test(value)) { + return { + ...outputs + }; + } + } + const DEFAULT_PARTITION = partitions2.find((partition2) => partition2.id === "aws"); + if (!DEFAULT_PARTITION) { + throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist."); + } + return { + ...DEFAULT_PARTITION.outputs + }; + }; + var setPartitionInfo = (partitionsInfo2, userAgentPrefix = "") => { + selectedPartitionsInfo = partitionsInfo2; + selectedUserAgentPrefix = userAgentPrefix; + }; + var useDefaultPartitionInfo = () => { + setPartitionInfo(partitionsInfo, ""); + }; + var getUserAgentPrefix = () => selectedUserAgentPrefix; + var awsEndpointFunctions4 = { + isVirtualHostableS3Bucket, + parseArn, + partition + }; + utilEndpoints.customEndpointFunctions.aws = awsEndpointFunctions4; + var resolveDefaultAwsRegionalEndpointsConfig = (input) => { + if (typeof input.endpointProvider !== "function") { + throw new Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client."); + } + const { endpoint } = input; + if (endpoint === void 0) { + input.endpoint = async () => { + return toEndpointV1(input.endpointProvider({ + Region: typeof input.region === "function" ? await input.region() : input.region, + UseDualStack: typeof input.useDualstackEndpoint === "function" ? await input.useDualstackEndpoint() : input.useDualstackEndpoint, + UseFIPS: typeof input.useFipsEndpoint === "function" ? await input.useFipsEndpoint() : input.useFipsEndpoint, + Endpoint: void 0 + }, { logger: input.logger })); + }; + } + return input; + }; + var toEndpointV1 = (endpoint) => urlParser.parseUrl(endpoint.url); + Object.defineProperty(exports2, "EndpointError", { + enumerable: true, + get: function() { + return utilEndpoints.EndpointError; + } + }); + Object.defineProperty(exports2, "isIpAddress", { + enumerable: true, + get: function() { + return utilEndpoints.isIpAddress; + } + }); + Object.defineProperty(exports2, "resolveEndpoint", { + enumerable: true, + get: function() { + return utilEndpoints.resolveEndpoint; + } + }); + exports2.awsEndpointFunctions = awsEndpointFunctions4; + exports2.getUserAgentPrefix = getUserAgentPrefix; + exports2.partition = partition; + exports2.resolveDefaultAwsRegionalEndpointsConfig = resolveDefaultAwsRegionalEndpointsConfig; + exports2.setPartitionInfo = setPartitionInfo; + exports2.toEndpointV1 = toEndpointV1; + exports2.useDefaultPartitionInfo = useDefaultPartitionInfo; + } +}); + +// node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/ruleset.js +var require_ruleset2 = __commonJS({ + "node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/ruleset.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ruleSet = void 0; + var u4 = "required"; + var v4 = "fn"; + var w4 = "argv"; + var x4 = "ref"; + var a4 = true; + var b4 = "isSet"; + var c4 = "booleanEquals"; + var d4 = "error"; + var e4 = "endpoint"; + var f4 = "tree"; + var g4 = "PartitionResult"; + var h4 = "getAttr"; + var i4 = { [u4]: false, "type": "string" }; + var j4 = { [u4]: true, "default": false, "type": "boolean" }; + var k4 = { [x4]: "Endpoint" }; + var l4 = { [v4]: c4, [w4]: [{ [x4]: "UseFIPS" }, true] }; + var m4 = { [v4]: c4, [w4]: [{ [x4]: "UseDualStack" }, true] }; + var n4 = {}; + var o4 = { [v4]: h4, [w4]: [{ [x4]: g4 }, "supportsFIPS"] }; + var p4 = { [x4]: g4 }; + var q4 = { [v4]: c4, [w4]: [true, { [v4]: h4, [w4]: [p4, "supportsDualStack"] }] }; + var r4 = [l4]; + var s4 = [m4]; + var t4 = [{ [x4]: "Region" }]; + var _data4 = { version: "1.0", parameters: { Region: i4, UseDualStack: j4, UseFIPS: j4, Endpoint: i4 }, rules: [{ conditions: [{ [v4]: b4, [w4]: [k4] }], rules: [{ conditions: r4, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d4 }, { conditions: s4, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d4 }, { endpoint: { url: k4, properties: n4, headers: n4 }, type: e4 }], type: f4 }, { conditions: [{ [v4]: b4, [w4]: t4 }], rules: [{ conditions: [{ [v4]: "aws.partition", [w4]: t4, assign: g4 }], rules: [{ conditions: [l4, m4], rules: [{ conditions: [{ [v4]: c4, [w4]: [a4, o4] }, q4], rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n4, headers: n4 }, type: e4 }], type: f4 }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d4 }], type: f4 }, { conditions: r4, rules: [{ conditions: [{ [v4]: c4, [w4]: [o4, a4] }], rules: [{ conditions: [{ [v4]: "stringEquals", [w4]: [{ [v4]: h4, [w4]: [p4, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://portal.sso.{Region}.amazonaws.com", properties: n4, headers: n4 }, type: e4 }, { endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n4, headers: n4 }, type: e4 }], type: f4 }, { error: "FIPS is enabled but this partition does not support FIPS", type: d4 }], type: f4 }, { conditions: s4, rules: [{ conditions: [q4], rules: [{ endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n4, headers: n4 }, type: e4 }], type: f4 }, { error: "DualStack is enabled but this partition does not support DualStack", type: d4 }], type: f4 }, { endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: n4, headers: n4 }, type: e4 }], type: f4 }], type: f4 }, { error: "Invalid Configuration: Missing Region", type: d4 }] }; + exports2.ruleSet = _data4; + } +}); + +// node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/endpointResolver.js +var require_endpointResolver2 = __commonJS({ + "node_modules/@aws-sdk/client-sso/dist-cjs/endpoint/endpointResolver.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.defaultEndpointResolver = void 0; + var util_endpoints_1 = require_dist_cjs59(); + var util_endpoints_2 = require_dist_cjs33(); + var ruleset_1 = require_ruleset2(); + var cache4 = new util_endpoints_2.EndpointCache({ + size: 50, + params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] + }); + var defaultEndpointResolver4 = (endpointParams, context = {}) => { + return cache4.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, { + endpointParams, + logger: context.logger + })); + }; + exports2.defaultEndpointResolver = defaultEndpointResolver4; + util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; + } +}); + +// node_modules/@aws-sdk/client-sso/dist-cjs/models/SSOServiceException.js +var require_SSOServiceException = __commonJS({ + "node_modules/@aws-sdk/client-sso/dist-cjs/models/SSOServiceException.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.SSOServiceException = exports2.__ServiceException = void 0; + var smithy_client_1 = require_dist_cjs20(); + Object.defineProperty(exports2, "__ServiceException", { enumerable: true, get: function() { + return smithy_client_1.ServiceException; + } }); + var SSOServiceException = class _SSOServiceException extends smithy_client_1.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, _SSOServiceException.prototype); + } + }; + exports2.SSOServiceException = SSOServiceException; + } +}); + +// node_modules/@aws-sdk/client-sso/dist-cjs/models/errors.js +var require_errors5 = __commonJS({ + "node_modules/@aws-sdk/client-sso/dist-cjs/models/errors.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.UnauthorizedException = exports2.TooManyRequestsException = exports2.ResourceNotFoundException = exports2.InvalidRequestException = void 0; + var SSOServiceException_1 = require_SSOServiceException(); + var InvalidRequestException2 = class _InvalidRequestException extends SSOServiceException_1.SSOServiceException { + name = "InvalidRequestException"; + $fault = "client"; + constructor(opts) { + super({ + name: "InvalidRequestException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _InvalidRequestException.prototype); + } + }; + exports2.InvalidRequestException = InvalidRequestException2; + var ResourceNotFoundException = class _ResourceNotFoundException extends SSOServiceException_1.SSOServiceException { + name = "ResourceNotFoundException"; + $fault = "client"; + constructor(opts) { + super({ + name: "ResourceNotFoundException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _ResourceNotFoundException.prototype); + } + }; + exports2.ResourceNotFoundException = ResourceNotFoundException; + var TooManyRequestsException = class _TooManyRequestsException extends SSOServiceException_1.SSOServiceException { + name = "TooManyRequestsException"; + $fault = "client"; + constructor(opts) { + super({ + name: "TooManyRequestsException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _TooManyRequestsException.prototype); + } + }; + exports2.TooManyRequestsException = TooManyRequestsException; + var UnauthorizedException = class _UnauthorizedException extends SSOServiceException_1.SSOServiceException { + name = "UnauthorizedException"; + $fault = "client"; + constructor(opts) { + super({ + name: "UnauthorizedException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _UnauthorizedException.prototype); + } + }; + exports2.UnauthorizedException = UnauthorizedException; + } +}); + +// node_modules/@aws-sdk/client-sso/dist-cjs/schemas/schemas_0.js +var require_schemas_02 = __commonJS({ + "node_modules/@aws-sdk/client-sso/dist-cjs/schemas/schemas_0.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Logout$ = exports2.ListAccounts$ = exports2.ListAccountRoles$ = exports2.GetRoleCredentials$ = exports2.RoleInfo$ = exports2.RoleCredentials$ = exports2.LogoutRequest$ = exports2.ListAccountsResponse$ = exports2.ListAccountsRequest$ = exports2.ListAccountRolesResponse$ = exports2.ListAccountRolesRequest$ = exports2.GetRoleCredentialsResponse$ = exports2.GetRoleCredentialsRequest$ = exports2.AccountInfo$ = exports2.errorTypeRegistries = exports2.UnauthorizedException$ = exports2.TooManyRequestsException$ = exports2.ResourceNotFoundException$ = exports2.InvalidRequestException$ = exports2.SSOServiceException$ = void 0; + var _AI = "AccountInfo"; + var _ALT = "AccountListType"; + var _ATT = "AccessTokenType"; + var _GRC = "GetRoleCredentials"; + var _GRCR = "GetRoleCredentialsRequest"; + var _GRCRe = "GetRoleCredentialsResponse"; + var _IRE2 = "InvalidRequestException"; + var _L = "Logout"; + var _LA = "ListAccounts"; + var _LAR = "ListAccountsRequest"; + var _LARR = "ListAccountRolesRequest"; + var _LARRi = "ListAccountRolesResponse"; + var _LARi = "ListAccountsResponse"; + var _LARis = "ListAccountRoles"; + var _LR = "LogoutRequest"; + var _RC = "RoleCredentials"; + var _RI = "RoleInfo"; + var _RLT = "RoleListType"; + var _RNFE = "ResourceNotFoundException"; + var _SAKT = "SecretAccessKeyType"; + var _STT = "SessionTokenType"; + var _TMRE2 = "TooManyRequestsException"; + var _UE = "UnauthorizedException"; + var _aI = "accountId"; + var _aKI2 = "accessKeyId"; + var _aL = "accountList"; + var _aN = "accountName"; + var _aT3 = "accessToken"; + var _ai = "account_id"; + var _c4 = "client"; + var _e4 = "error"; + var _eA = "emailAddress"; + var _ex = "expiration"; + var _h3 = "http"; + var _hE4 = "httpError"; + var _hH = "httpHeader"; + var _hQ = "httpQuery"; + var _m3 = "message"; + var _mR = "maxResults"; + var _mr = "max_result"; + var _nT = "nextToken"; + var _nt = "next_token"; + var _rC = "roleCredentials"; + var _rL = "roleList"; + var _rN = "roleName"; + var _rn = "role_name"; + var _s4 = "smithy.ts.sdk.synthetic.com.amazonaws.sso"; + var _sAK2 = "secretAccessKey"; + var _sT2 = "sessionToken"; + var _xasbt = "x-amz-sso_bearer_token"; + var n04 = "com.amazonaws.sso"; + var schema_1 = (init_schema(), __toCommonJS(schema_exports)); + var errors_1 = require_errors5(); + var SSOServiceException_1 = require_SSOServiceException(); + var _s_registry4 = schema_1.TypeRegistry.for(_s4); + exports2.SSOServiceException$ = [-3, _s4, "SSOServiceException", 0, [], []]; + _s_registry4.registerError(exports2.SSOServiceException$, SSOServiceException_1.SSOServiceException); + var n0_registry4 = schema_1.TypeRegistry.for(n04); + exports2.InvalidRequestException$ = [ + -3, + n04, + _IRE2, + { [_e4]: _c4, [_hE4]: 400 }, + [_m3], + [0] + ]; + n0_registry4.registerError(exports2.InvalidRequestException$, errors_1.InvalidRequestException); + exports2.ResourceNotFoundException$ = [ + -3, + n04, + _RNFE, + { [_e4]: _c4, [_hE4]: 404 }, + [_m3], + [0] + ]; + n0_registry4.registerError(exports2.ResourceNotFoundException$, errors_1.ResourceNotFoundException); + exports2.TooManyRequestsException$ = [ + -3, + n04, + _TMRE2, + { [_e4]: _c4, [_hE4]: 429 }, + [_m3], + [0] + ]; + n0_registry4.registerError(exports2.TooManyRequestsException$, errors_1.TooManyRequestsException); + exports2.UnauthorizedException$ = [ + -3, + n04, + _UE, + { [_e4]: _c4, [_hE4]: 401 }, + [_m3], + [0] + ]; + n0_registry4.registerError(exports2.UnauthorizedException$, errors_1.UnauthorizedException); + exports2.errorTypeRegistries = [ + _s_registry4, + n0_registry4 + ]; + var AccessTokenType = [0, n04, _ATT, 8, 0]; + var SecretAccessKeyType = [0, n04, _SAKT, 8, 0]; + var SessionTokenType = [0, n04, _STT, 8, 0]; + exports2.AccountInfo$ = [ + 3, + n04, + _AI, + 0, + [_aI, _aN, _eA], + [0, 0, 0] + ]; + exports2.GetRoleCredentialsRequest$ = [ + 3, + n04, + _GRCR, + 0, + [_rN, _aI, _aT3], + [[0, { [_hQ]: _rn }], [0, { [_hQ]: _ai }], [() => AccessTokenType, { [_hH]: _xasbt }]], + 3 + ]; + exports2.GetRoleCredentialsResponse$ = [ + 3, + n04, + _GRCRe, + 0, + [_rC], + [[() => exports2.RoleCredentials$, 0]] + ]; + exports2.ListAccountRolesRequest$ = [ + 3, + n04, + _LARR, + 0, + [_aT3, _aI, _nT, _mR], + [[() => AccessTokenType, { [_hH]: _xasbt }], [0, { [_hQ]: _ai }], [0, { [_hQ]: _nt }], [1, { [_hQ]: _mr }]], + 2 + ]; + exports2.ListAccountRolesResponse$ = [ + 3, + n04, + _LARRi, + 0, + [_nT, _rL], + [0, () => RoleListType] + ]; + exports2.ListAccountsRequest$ = [ + 3, + n04, + _LAR, + 0, + [_aT3, _nT, _mR], + [[() => AccessTokenType, { [_hH]: _xasbt }], [0, { [_hQ]: _nt }], [1, { [_hQ]: _mr }]], + 1 + ]; + exports2.ListAccountsResponse$ = [ + 3, + n04, + _LARi, + 0, + [_nT, _aL], + [0, () => AccountListType] + ]; + exports2.LogoutRequest$ = [ + 3, + n04, + _LR, + 0, + [_aT3], + [[() => AccessTokenType, { [_hH]: _xasbt }]], + 1 + ]; + exports2.RoleCredentials$ = [ + 3, + n04, + _RC, + 0, + [_aKI2, _sAK2, _sT2, _ex], + [0, [() => SecretAccessKeyType, 0], [() => SessionTokenType, 0], 1] + ]; + exports2.RoleInfo$ = [ + 3, + n04, + _RI, + 0, + [_rN, _aI], + [0, 0] + ]; + var __Unit = "unit"; + var AccountListType = [ + 1, + n04, + _ALT, + 0, + () => exports2.AccountInfo$ + ]; + var RoleListType = [ + 1, + n04, + _RLT, + 0, + () => exports2.RoleInfo$ + ]; + exports2.GetRoleCredentials$ = [ + 9, + n04, + _GRC, + { [_h3]: ["GET", "/federation/credentials", 200] }, + () => exports2.GetRoleCredentialsRequest$, + () => exports2.GetRoleCredentialsResponse$ + ]; + exports2.ListAccountRoles$ = [ + 9, + n04, + _LARis, + { [_h3]: ["GET", "/assignment/roles", 200] }, + () => exports2.ListAccountRolesRequest$, + () => exports2.ListAccountRolesResponse$ + ]; + exports2.ListAccounts$ = [ + 9, + n04, + _LA, + { [_h3]: ["GET", "/assignment/accounts", 200] }, + () => exports2.ListAccountsRequest$, + () => exports2.ListAccountsResponse$ + ]; + exports2.Logout$ = [ + 9, + n04, + _L, + { [_h3]: ["POST", "/logout", 200] }, + () => exports2.LogoutRequest$, + () => __Unit + ]; + } +}); + +// node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js +var require_runtimeConfig_shared = __commonJS({ + "node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.shared.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getRuntimeConfig = void 0; + var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); + var protocols_1 = (init_protocols2(), __toCommonJS(protocols_exports2)); + var core_2 = (init_dist_es(), __toCommonJS(dist_es_exports)); + var smithy_client_1 = require_dist_cjs20(); + var url_parser_1 = require_dist_cjs35(); + var util_base64_1 = require_dist_cjs9(); + var util_utf8_1 = require_dist_cjs8(); + var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider2(); + var endpointResolver_1 = require_endpointResolver2(); + var schemas_0_1 = require_schemas_02(); + var getRuntimeConfig7 = (config) => { + return { + apiVersion: "2019-06-10", + base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64, + base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new core_1.AwsSdkSigV4Signer() + }, + { + schemeId: "smithy.api#noAuth", + identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), + signer: new core_2.NoAuthSigner() + } + ], + logger: config?.logger ?? new smithy_client_1.NoOpLogger(), + protocol: config?.protocol ?? protocols_1.AwsRestJsonProtocol, + protocolSettings: config?.protocolSettings ?? { + defaultNamespace: "com.amazonaws.sso", + errorTypeRegistries: schemas_0_1.errorTypeRegistries, + version: "2019-06-10", + serviceTarget: "SWBPortalService" + }, + serviceId: config?.serviceId ?? "SSO", + urlParser: config?.urlParser ?? url_parser_1.parseUrl, + utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8 + }; + }; + exports2.getRuntimeConfig = getRuntimeConfig7; + } +}); + +// node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.js +var require_runtimeConfig = __commonJS({ + "node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getRuntimeConfig = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var package_json_1 = tslib_1.__importDefault(require_package7()); + var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); + var util_user_agent_node_1 = require_dist_cjs52(); + var config_resolver_1 = require_dist_cjs38(); + var hash_node_1 = require_dist_cjs53(); + var middleware_retry_1 = require_dist_cjs46(); + var node_config_provider_1 = require_dist_cjs42(); + var node_http_handler_1 = require_dist_cjs12(); + var smithy_client_1 = require_dist_cjs20(); + var util_body_length_node_1 = require_dist_cjs54(); + var util_defaults_mode_node_1 = require_dist_cjs55(); + var util_retry_1 = require_dist_cjs45(); + var runtimeConfig_shared_1 = require_runtimeConfig_shared(); + var getRuntimeConfig7 = (config) => { + (0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version); + const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); + const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); + (0, core_1.emitWarningIfUnsupportedVersion)(process.version); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), + maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), + requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), + retryMode: config?.retryMode ?? (0, node_config_provider_1.loadConfig)({ + ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE + }, config), + sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) + }; + }; + exports2.getRuntimeConfig = getRuntimeConfig7; + } +}); + +// node_modules/@aws-sdk/client-sso/dist-cjs/index.js +var require_dist_cjs60 = __commonJS({ + "node_modules/@aws-sdk/client-sso/dist-cjs/index.js"(exports2) { + "use strict"; + var middlewareHostHeader = require_dist_cjs27(); + var middlewareLogger = require_dist_cjs28(); + var middlewareRecursionDetection = require_dist_cjs29(); + var middlewareUserAgent = require_dist_cjs37(); + var configResolver = require_dist_cjs38(); + var core = (init_dist_es(), __toCommonJS(dist_es_exports)); + var schema = (init_schema(), __toCommonJS(schema_exports)); + var middlewareContentLength = require_dist_cjs40(); + var middlewareEndpoint = require_dist_cjs43(); + var middlewareRetry = require_dist_cjs46(); + var smithyClient = require_dist_cjs20(); + var httpAuthSchemeProvider = require_httpAuthSchemeProvider2(); + var runtimeConfig = require_runtimeConfig(); + var regionConfigResolver = require_dist_cjs57(); + var protocolHttp = require_dist_cjs2(); + var schemas_0 = require_schemas_02(); + var errors = require_errors5(); + var SSOServiceException = require_SSOServiceException(); + var resolveClientEndpointParameters4 = (options) => { + return Object.assign(options, { + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "awsssoportal" + }); + }; + var commonParams4 = { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } + }; + var getHttpAuthExtensionConfiguration4 = (runtimeConfig2) => { + const _httpAuthSchemes = runtimeConfig2.httpAuthSchemes; + let _httpAuthSchemeProvider = runtimeConfig2.httpAuthSchemeProvider; + let _credentials = runtimeConfig2.credentials; + return { + setHttpAuthScheme(httpAuthScheme) { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes() { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider2) { + _httpAuthSchemeProvider = httpAuthSchemeProvider2; + }, + httpAuthSchemeProvider() { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials) { + _credentials = credentials; + }, + credentials() { + return _credentials; + } + }; + }; + var resolveHttpAuthRuntimeConfig4 = (config) => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials() + }; + }; + var resolveRuntimeExtensions4 = (runtimeConfig2, extensions) => { + const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig2), smithyClient.getDefaultExtensionConfiguration(runtimeConfig2), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig2), getHttpAuthExtensionConfiguration4(runtimeConfig2)); + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + return Object.assign(runtimeConfig2, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig4(extensionConfiguration)); + }; + var SSOClient = class extends smithyClient.Client { + config; + constructor(...[configuration]) { + const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {}); + super(_config_0); + this.initConfig = _config_0; + const _config_1 = resolveClientEndpointParameters4(_config_0); + const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1); + const _config_3 = middlewareRetry.resolveRetryConfig(_config_2); + const _config_4 = configResolver.resolveRegionConfig(_config_3); + const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4); + const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5); + const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6); + const _config_8 = resolveRuntimeExtensions4(_config_7, configuration?.extensions || []); + this.config = _config_8; + this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config)); + this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config)); + this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config)); + this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config)); + this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config)); + this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config)); + this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSSOHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials + }) + })); + this.middlewareStack.use(core.getHttpSigningPlugin(this.config)); + } + destroy() { + super.destroy(); + } + }; + var GetRoleCredentialsCommand = class extends smithyClient.Command.classBuilder().ep(commonParams4).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").sc(schemas_0.GetRoleCredentials$).build() { + }; + var ListAccountRolesCommand = class extends smithyClient.Command.classBuilder().ep(commonParams4).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("SWBPortalService", "ListAccountRoles", {}).n("SSOClient", "ListAccountRolesCommand").sc(schemas_0.ListAccountRoles$).build() { + }; + var ListAccountsCommand = class extends smithyClient.Command.classBuilder().ep(commonParams4).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("SWBPortalService", "ListAccounts", {}).n("SSOClient", "ListAccountsCommand").sc(schemas_0.ListAccounts$).build() { + }; + var LogoutCommand = class extends smithyClient.Command.classBuilder().ep(commonParams4).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("SWBPortalService", "Logout", {}).n("SSOClient", "LogoutCommand").sc(schemas_0.Logout$).build() { + }; + var paginateListAccountRoles = core.createPaginator(SSOClient, ListAccountRolesCommand, "nextToken", "nextToken", "maxResults"); + var paginateListAccounts = core.createPaginator(SSOClient, ListAccountsCommand, "nextToken", "nextToken", "maxResults"); + var commands4 = { + GetRoleCredentialsCommand, + ListAccountRolesCommand, + ListAccountsCommand, + LogoutCommand + }; + var paginators = { + paginateListAccountRoles, + paginateListAccounts + }; + var SSO = class extends SSOClient { + }; + smithyClient.createAggregatedClient(commands4, SSO, { paginators }); + Object.defineProperty(exports2, "$Command", { + enumerable: true, + get: function() { + return smithyClient.Command; + } + }); + Object.defineProperty(exports2, "__Client", { + enumerable: true, + get: function() { + return smithyClient.Client; + } + }); + Object.defineProperty(exports2, "SSOServiceException", { + enumerable: true, + get: function() { + return SSOServiceException.SSOServiceException; + } + }); + exports2.GetRoleCredentialsCommand = GetRoleCredentialsCommand; + exports2.ListAccountRolesCommand = ListAccountRolesCommand; + exports2.ListAccountsCommand = ListAccountsCommand; + exports2.LogoutCommand = LogoutCommand; + exports2.SSO = SSO; + exports2.SSOClient = SSOClient; + exports2.paginateListAccountRoles = paginateListAccountRoles; + exports2.paginateListAccounts = paginateListAccounts; + Object.keys(schemas_0).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return schemas_0[k4]; + } + }); + }); + Object.keys(errors).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return errors[k4]; + } + }); + }); + } +}); + +// node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-CVy8iqsZ.js +var require_loadSso_CVy8iqsZ = __commonJS({ + "node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-CVy8iqsZ.js"(exports2) { + "use strict"; + var clientSso = require_dist_cjs60(); + Object.defineProperty(exports2, "GetRoleCredentialsCommand", { + enumerable: true, + get: function() { + return clientSso.GetRoleCredentialsCommand; + } + }); + Object.defineProperty(exports2, "SSOClient", { + enumerable: true, + get: function() { + return clientSso.SSOClient; + } + }); + } +}); + +// node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +var require_dist_cjs61 = __commonJS({ + "node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js"(exports2) { + "use strict"; + var propertyProvider = require_dist_cjs17(); + var sharedIniFileLoader = require_dist_cjs41(); + var client = (init_client(), __toCommonJS(client_exports)); + var tokenProviders = require_dist_cjs58(); + var isSsoProfile = (arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string"); + var SHOULD_FAIL_CREDENTIAL_CHAIN = false; + var resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, callerClientConfig, profile, filepath, configFilepath, ignoreCache, logger: logger3 }) => { + let token; + const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`; + if (ssoSession) { + try { + const _token = await tokenProviders.fromSso({ + profile, + filepath, + configFilepath, + ignoreCache + })(); + token = { + accessToken: _token.token, + expiresAt: new Date(_token.expiration).toISOString() + }; + } catch (e4) { + throw new propertyProvider.CredentialsProviderError(e4.message, { + tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, + logger: logger3 + }); + } + } else { + try { + token = await sharedIniFileLoader.getSSOTokenFromFile(ssoStartUrl); + } catch (e4) { + throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, { + tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, + logger: logger3 + }); + } + } + if (new Date(token.expiresAt).getTime() - Date.now() <= 0) { + throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, { + tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, + logger: logger3 + }); + } + const { accessToken } = token; + const { SSOClient, GetRoleCredentialsCommand } = await Promise.resolve().then(function() { + return require_loadSso_CVy8iqsZ(); + }); + const sso = ssoClient || new SSOClient(Object.assign({}, clientConfig ?? {}, { + logger: clientConfig?.logger ?? callerClientConfig?.logger ?? parentClientConfig?.logger, + region: clientConfig?.region ?? ssoRegion, + userAgentAppId: clientConfig?.userAgentAppId ?? callerClientConfig?.userAgentAppId ?? parentClientConfig?.userAgentAppId + })); + let ssoResp; + try { + ssoResp = await sso.send(new GetRoleCredentialsCommand({ + accountId: ssoAccountId, + roleName: ssoRoleName, + accessToken + })); + } catch (e4) { + throw new propertyProvider.CredentialsProviderError(e4, { + tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, + logger: logger3 + }); + } + const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {} } = ssoResp; + if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) { + throw new propertyProvider.CredentialsProviderError("SSO returns an invalid temporary credential.", { + tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, + logger: logger3 + }); + } + const credentials = { + accessKeyId, + secretAccessKey, + sessionToken, + expiration: new Date(expiration), + ...credentialScope && { credentialScope }, + ...accountId && { accountId } + }; + if (ssoSession) { + client.setCredentialFeature(credentials, "CREDENTIALS_SSO", "s"); + } else { + client.setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u"); + } + return credentials; + }; + var validateSsoProfile = (profile, logger3) => { + const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile; + if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) { + throw new propertyProvider.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")} +Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger: logger3 }); + } + return profile; + }; + var fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => { + init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO"); + const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init; + const { ssoClient } = init; + const profileName = sharedIniFileLoader.getProfileName({ + profile: init.profile ?? callerClientConfig?.profile + }); + if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { + const profiles = await sharedIniFileLoader.parseKnownFiles(init); + const profile = profiles[profileName]; + if (!profile) { + throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger }); + } + if (!isSsoProfile(profile)) { + throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, { + logger: init.logger + }); + } + if (profile?.sso_session) { + const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init); + const session = ssoSessions[profile.sso_session]; + const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`; + if (ssoRegion && ssoRegion !== session.sso_region) { + throw new propertyProvider.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, { + tryNextLink: false, + logger: init.logger + }); + } + if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) { + throw new propertyProvider.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, { + tryNextLink: false, + logger: init.logger + }); + } + profile.sso_region = session.sso_region; + profile.sso_start_url = session.sso_start_url; + } + const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger); + return resolveSSOCredentials({ + ssoStartUrl: sso_start_url, + ssoSession: sso_session, + ssoAccountId: sso_account_id, + ssoRegion: sso_region, + ssoRoleName: sso_role_name, + ssoClient, + clientConfig: init.clientConfig, + parentClientConfig: init.parentClientConfig, + callerClientConfig: init.callerClientConfig, + profile: profileName, + filepath: init.filepath, + configFilepath: init.configFilepath, + ignoreCache: init.ignoreCache, + logger: init.logger + }); + } else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) { + throw new propertyProvider.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', { tryNextLink: false, logger: init.logger }); + } else { + return resolveSSOCredentials({ + ssoStartUrl, + ssoSession, + ssoAccountId, + ssoRegion, + ssoRoleName, + ssoClient, + clientConfig: init.clientConfig, + parentClientConfig: init.parentClientConfig, + callerClientConfig: init.callerClientConfig, + profile: profileName, + filepath: init.filepath, + configFilepath: init.configFilepath, + ignoreCache: init.ignoreCache, + logger: init.logger + }); + } + }; + exports2.fromSSO = fromSSO; + exports2.isSsoProfile = isSsoProfile; + exports2.validateSsoProfile = validateSsoProfile; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthSchemeProvider.js +function createAwsAuthSigv4HttpAuthOption2(authParameters) { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "signin", + region: authParameters.region + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context + } + }) + }; +} +function createSmithyApiNoAuthHttpAuthOption2(authParameters) { + return { + schemeId: "smithy.api#noAuth" + }; +} +var import_util_middleware7, defaultSigninHttpAuthSchemeParametersProvider, defaultSigninHttpAuthSchemeProvider, resolveHttpAuthSchemeConfig2; +var init_httpAuthSchemeProvider2 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthSchemeProvider.js"() { + init_dist_es2(); + import_util_middleware7 = __toESM(require_dist_cjs4()); + defaultSigninHttpAuthSchemeParametersProvider = async (config, context, input) => { + return { + operation: (0, import_util_middleware7.getSmithyContext)(context).operation, + region: await (0, import_util_middleware7.normalizeProvider)(config.region)() || (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })() + }; + }; + defaultSigninHttpAuthSchemeProvider = (authParameters) => { + const options = []; + switch (authParameters.operation) { + case "CreateOAuth2Token": { + options.push(createSmithyApiNoAuthHttpAuthOption2(authParameters)); + break; + } + default: { + options.push(createAwsAuthSigv4HttpAuthOption2(authParameters)); + } + } + return options; + }; + resolveHttpAuthSchemeConfig2 = (config) => { + const config_0 = resolveAwsSdkSigV4Config(config); + return Object.assign(config_0, { + authSchemePreference: (0, import_util_middleware7.normalizeProvider)(config.authSchemePreference ?? []) + }); + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/EndpointParameters.js +var resolveClientEndpointParameters2, commonParams2; +var init_EndpointParameters2 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/EndpointParameters.js"() { + resolveClientEndpointParameters2 = (options) => { + return Object.assign(options, { + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "signin" + }); + }; + commonParams2 = { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/ruleset.js +var u2, v2, w2, x2, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, _data2, ruleSet2; +var init_ruleset2 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/ruleset.js"() { + u2 = "required"; + v2 = "fn"; + w2 = "argv"; + x2 = "ref"; + a2 = true; + b2 = "isSet"; + c2 = "booleanEquals"; + d2 = "error"; + e2 = "endpoint"; + f2 = "tree"; + g2 = "PartitionResult"; + h2 = "stringEquals"; + i2 = { [u2]: true, "default": false, "type": "boolean" }; + j2 = { [u2]: false, "type": "string" }; + k2 = { [x2]: "Endpoint" }; + l2 = { [v2]: c2, [w2]: [{ [x2]: "UseFIPS" }, true] }; + m2 = { [v2]: c2, [w2]: [{ [x2]: "UseDualStack" }, true] }; + n2 = {}; + o2 = { [v2]: "getAttr", [w2]: [{ [x2]: g2 }, "name"] }; + p2 = { [v2]: c2, [w2]: [{ [x2]: "UseFIPS" }, false] }; + q2 = { [v2]: c2, [w2]: [{ [x2]: "UseDualStack" }, false] }; + r2 = { [v2]: "getAttr", [w2]: [{ [x2]: g2 }, "supportsFIPS"] }; + s2 = { [v2]: c2, [w2]: [true, { [v2]: "getAttr", [w2]: [{ [x2]: g2 }, "supportsDualStack"] }] }; + t2 = [{ [x2]: "Region" }]; + _data2 = { version: "1.0", parameters: { UseDualStack: i2, UseFIPS: i2, Endpoint: j2, Region: j2 }, rules: [{ conditions: [{ [v2]: b2, [w2]: [k2] }], rules: [{ conditions: [l2], error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d2 }, { rules: [{ conditions: [m2], error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d2 }, { endpoint: { url: k2, properties: n2, headers: n2 }, type: e2 }], type: f2 }], type: f2 }, { rules: [{ conditions: [{ [v2]: b2, [w2]: t2 }], rules: [{ conditions: [{ [v2]: "aws.partition", [w2]: t2, assign: g2 }], rules: [{ conditions: [{ [v2]: h2, [w2]: [o2, "aws"] }, p2, q2], endpoint: { url: "https://{Region}.signin.aws.amazon.com", properties: n2, headers: n2 }, type: e2 }, { conditions: [{ [v2]: h2, [w2]: [o2, "aws-cn"] }, p2, q2], endpoint: { url: "https://{Region}.signin.amazonaws.cn", properties: n2, headers: n2 }, type: e2 }, { conditions: [{ [v2]: h2, [w2]: [o2, "aws-us-gov"] }, p2, q2], endpoint: { url: "https://{Region}.signin.amazonaws-us-gov.com", properties: n2, headers: n2 }, type: e2 }, { conditions: [l2, m2], rules: [{ conditions: [{ [v2]: c2, [w2]: [a2, r2] }, s2], rules: [{ endpoint: { url: "https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n2, headers: n2 }, type: e2 }], type: f2 }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d2 }], type: f2 }, { conditions: [l2, q2], rules: [{ conditions: [{ [v2]: c2, [w2]: [r2, a2] }], rules: [{ endpoint: { url: "https://signin-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n2, headers: n2 }, type: e2 }], type: f2 }, { error: "FIPS is enabled but this partition does not support FIPS", type: d2 }], type: f2 }, { conditions: [p2, m2], rules: [{ conditions: [s2], rules: [{ endpoint: { url: "https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n2, headers: n2 }, type: e2 }], type: f2 }, { error: "DualStack is enabled but this partition does not support DualStack", type: d2 }], type: f2 }, { endpoint: { url: "https://signin.{Region}.{PartitionResult#dnsSuffix}", properties: n2, headers: n2 }, type: e2 }], type: f2 }], type: f2 }, { error: "Invalid Configuration: Missing Region", type: d2 }], type: f2 }] }; + ruleSet2 = _data2; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js +var import_util_endpoints3, import_util_endpoints4, cache2, defaultEndpointResolver2; +var init_endpointResolver2 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js"() { + import_util_endpoints3 = __toESM(require_dist_cjs56()); + import_util_endpoints4 = __toESM(require_dist_cjs33()); + init_ruleset2(); + cache2 = new import_util_endpoints4.EndpointCache({ + size: 50, + params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] + }); + defaultEndpointResolver2 = (endpointParams, context = {}) => { + return cache2.get(endpointParams, () => (0, import_util_endpoints4.resolveEndpoint)(ruleSet2, { + endpointParams, + logger: context.logger + })); + }; + import_util_endpoints4.customEndpointFunctions.aws = import_util_endpoints3.awsEndpointFunctions; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js +var import_smithy_client15, SigninServiceException; +var init_SigninServiceException = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js"() { + import_smithy_client15 = __toESM(require_dist_cjs20()); + SigninServiceException = class _SigninServiceException extends import_smithy_client15.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, _SigninServiceException.prototype); + } + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/errors.js +var AccessDeniedException2, InternalServerException2, TooManyRequestsError, ValidationException; +var init_errors2 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/errors.js"() { + init_SigninServiceException(); + AccessDeniedException2 = class _AccessDeniedException extends SigninServiceException { + name = "AccessDeniedException"; + $fault = "client"; + error; + constructor(opts) { + super({ + name: "AccessDeniedException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _AccessDeniedException.prototype); + this.error = opts.error; + } + }; + InternalServerException2 = class _InternalServerException extends SigninServiceException { + name = "InternalServerException"; + $fault = "server"; + error; + constructor(opts) { + super({ + name: "InternalServerException", + $fault: "server", + ...opts + }); + Object.setPrototypeOf(this, _InternalServerException.prototype); + this.error = opts.error; + } + }; + TooManyRequestsError = class _TooManyRequestsError extends SigninServiceException { + name = "TooManyRequestsError"; + $fault = "client"; + error; + constructor(opts) { + super({ + name: "TooManyRequestsError", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _TooManyRequestsError.prototype); + this.error = opts.error; + } + }; + ValidationException = class _ValidationException extends SigninServiceException { + name = "ValidationException"; + $fault = "client"; + error; + constructor(opts) { + super({ + name: "ValidationException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _ValidationException.prototype); + this.error = opts.error; + } + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js +var _ADE2, _AT2, _COAT, _COATR, _COATRB, _COATRBr, _COATRr, _ISE2, _RT2, _TMRE, _VE, _aKI, _aT2, _c2, _cI2, _cV2, _co2, _e2, _eI2, _gT2, _h2, _hE2, _iT2, _jN, _m, _rT2, _rU2, _s2, _sAK, _sT, _se2, _tI, _tO, _tT2, n02, _s_registry2, SigninServiceException$, n0_registry2, AccessDeniedException$2, InternalServerException$2, TooManyRequestsError$, ValidationException$, errorTypeRegistries2, RefreshToken2, AccessToken$, CreateOAuth2TokenRequest$, CreateOAuth2TokenRequestBody$, CreateOAuth2TokenResponse$, CreateOAuth2TokenResponseBody$, CreateOAuth2Token$; +var init_schemas_02 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js"() { + init_schema(); + init_errors2(); + init_SigninServiceException(); + _ADE2 = "AccessDeniedException"; + _AT2 = "AccessToken"; + _COAT = "CreateOAuth2Token"; + _COATR = "CreateOAuth2TokenRequest"; + _COATRB = "CreateOAuth2TokenRequestBody"; + _COATRBr = "CreateOAuth2TokenResponseBody"; + _COATRr = "CreateOAuth2TokenResponse"; + _ISE2 = "InternalServerException"; + _RT2 = "RefreshToken"; + _TMRE = "TooManyRequestsError"; + _VE = "ValidationException"; + _aKI = "accessKeyId"; + _aT2 = "accessToken"; + _c2 = "client"; + _cI2 = "clientId"; + _cV2 = "codeVerifier"; + _co2 = "code"; + _e2 = "error"; + _eI2 = "expiresIn"; + _gT2 = "grantType"; + _h2 = "http"; + _hE2 = "httpError"; + _iT2 = "idToken"; + _jN = "jsonName"; + _m = "message"; + _rT2 = "refreshToken"; + _rU2 = "redirectUri"; + _s2 = "smithy.ts.sdk.synthetic.com.amazonaws.signin"; + _sAK = "secretAccessKey"; + _sT = "sessionToken"; + _se2 = "server"; + _tI = "tokenInput"; + _tO = "tokenOutput"; + _tT2 = "tokenType"; + n02 = "com.amazonaws.signin"; + _s_registry2 = TypeRegistry.for(_s2); + SigninServiceException$ = [-3, _s2, "SigninServiceException", 0, [], []]; + _s_registry2.registerError(SigninServiceException$, SigninServiceException); + n0_registry2 = TypeRegistry.for(n02); + AccessDeniedException$2 = [-3, n02, _ADE2, { [_e2]: _c2 }, [_e2, _m], [0, 0], 2]; + n0_registry2.registerError(AccessDeniedException$2, AccessDeniedException2); + InternalServerException$2 = [-3, n02, _ISE2, { [_e2]: _se2, [_hE2]: 500 }, [_e2, _m], [0, 0], 2]; + n0_registry2.registerError(InternalServerException$2, InternalServerException2); + TooManyRequestsError$ = [-3, n02, _TMRE, { [_e2]: _c2, [_hE2]: 429 }, [_e2, _m], [0, 0], 2]; + n0_registry2.registerError(TooManyRequestsError$, TooManyRequestsError); + ValidationException$ = [-3, n02, _VE, { [_e2]: _c2, [_hE2]: 400 }, [_e2, _m], [0, 0], 2]; + n0_registry2.registerError(ValidationException$, ValidationException); + errorTypeRegistries2 = [_s_registry2, n0_registry2]; + RefreshToken2 = [0, n02, _RT2, 8, 0]; + AccessToken$ = [ + 3, + n02, + _AT2, + 8, + [_aKI, _sAK, _sT], + [ + [0, { [_jN]: _aKI }], + [0, { [_jN]: _sAK }], + [0, { [_jN]: _sT }] + ], + 3 + ]; + CreateOAuth2TokenRequest$ = [ + 3, + n02, + _COATR, + 0, + [_tI], + [[() => CreateOAuth2TokenRequestBody$, 16]], + 1 + ]; + CreateOAuth2TokenRequestBody$ = [ + 3, + n02, + _COATRB, + 0, + [_cI2, _gT2, _co2, _rU2, _cV2, _rT2], + [ + [0, { [_jN]: _cI2 }], + [0, { [_jN]: _gT2 }], + 0, + [0, { [_jN]: _rU2 }], + [0, { [_jN]: _cV2 }], + [() => RefreshToken2, { [_jN]: _rT2 }] + ], + 2 + ]; + CreateOAuth2TokenResponse$ = [ + 3, + n02, + _COATRr, + 0, + [_tO], + [[() => CreateOAuth2TokenResponseBody$, 16]], + 1 + ]; + CreateOAuth2TokenResponseBody$ = [ + 3, + n02, + _COATRBr, + 0, + [_aT2, _tT2, _eI2, _rT2, _iT2], + [ + [() => AccessToken$, { [_jN]: _aT2 }], + [0, { [_jN]: _tT2 }], + [1, { [_jN]: _eI2 }], + [() => RefreshToken2, { [_jN]: _rT2 }], + [0, { [_jN]: _iT2 }] + ], + 4 + ]; + CreateOAuth2Token$ = [ + 9, + n02, + _COAT, + { [_h2]: ["POST", "/v1/token", 200] }, + () => CreateOAuth2TokenRequest$, + () => CreateOAuth2TokenResponse$ + ]; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.shared.js +var import_smithy_client16, import_url_parser2, import_util_base649, import_util_utf89, getRuntimeConfig3; +var init_runtimeConfig_shared2 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.shared.js"() { + init_dist_es2(); + init_protocols2(); + init_dist_es(); + import_smithy_client16 = __toESM(require_dist_cjs20()); + import_url_parser2 = __toESM(require_dist_cjs35()); + import_util_base649 = __toESM(require_dist_cjs9()); + import_util_utf89 = __toESM(require_dist_cjs8()); + init_httpAuthSchemeProvider2(); + init_endpointResolver2(); + init_schemas_02(); + getRuntimeConfig3 = (config) => { + return { + apiVersion: "2023-01-01", + base64Decoder: config?.base64Decoder ?? import_util_base649.fromBase64, + base64Encoder: config?.base64Encoder ?? import_util_base649.toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver2, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSigninHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new AwsSdkSigV4Signer() + }, + { + schemeId: "smithy.api#noAuth", + identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), + signer: new NoAuthSigner() + } + ], + logger: config?.logger ?? new import_smithy_client16.NoOpLogger(), + protocol: config?.protocol ?? AwsRestJsonProtocol, + protocolSettings: config?.protocolSettings ?? { + defaultNamespace: "com.amazonaws.signin", + errorTypeRegistries: errorTypeRegistries2, + version: "2023-01-01", + serviceTarget: "Signin" + }, + serviceId: config?.serviceId ?? "Signin", + urlParser: config?.urlParser ?? import_url_parser2.parseUrl, + utf8Decoder: config?.utf8Decoder ?? import_util_utf89.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? import_util_utf89.toUtf8 + }; + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js +var import_util_user_agent_node2, import_config_resolver3, import_hash_node2, import_middleware_retry3, import_node_config_provider2, import_node_http_handler2, import_smithy_client17, import_util_body_length_node2, import_util_defaults_mode_node2, import_util_retry2, getRuntimeConfig4; +var init_runtimeConfig2 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js"() { + init_package(); + init_dist_es2(); + import_util_user_agent_node2 = __toESM(require_dist_cjs52()); + import_config_resolver3 = __toESM(require_dist_cjs38()); + import_hash_node2 = __toESM(require_dist_cjs53()); + import_middleware_retry3 = __toESM(require_dist_cjs46()); + import_node_config_provider2 = __toESM(require_dist_cjs42()); + import_node_http_handler2 = __toESM(require_dist_cjs12()); + import_smithy_client17 = __toESM(require_dist_cjs20()); + import_util_body_length_node2 = __toESM(require_dist_cjs54()); + import_util_defaults_mode_node2 = __toESM(require_dist_cjs55()); + import_util_retry2 = __toESM(require_dist_cjs45()); + init_runtimeConfig_shared2(); + getRuntimeConfig4 = (config) => { + (0, import_smithy_client17.emitWarningIfUnsupportedVersion)(process.version); + const defaultsMode = (0, import_util_defaults_mode_node2.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(import_smithy_client17.loadConfigsForDefaultMode); + const clientSharedValues = getRuntimeConfig3(config); + emitWarningIfUnsupportedVersion(process.version); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + authSchemePreference: config?.authSchemePreference ?? (0, import_node_config_provider2.loadConfig)(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), + bodyLengthChecker: config?.bodyLengthChecker ?? import_util_body_length_node2.calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, import_util_user_agent_node2.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }), + maxAttempts: config?.maxAttempts ?? (0, import_node_config_provider2.loadConfig)(import_middleware_retry3.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: config?.region ?? (0, import_node_config_provider2.loadConfig)(import_config_resolver3.NODE_REGION_CONFIG_OPTIONS, { ...import_config_resolver3.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), + requestHandler: import_node_http_handler2.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), + retryMode: config?.retryMode ?? (0, import_node_config_provider2.loadConfig)({ + ...import_middleware_retry3.NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || import_util_retry2.DEFAULT_RETRY_MODE + }, config), + sha256: config?.sha256 ?? import_hash_node2.Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? import_node_http_handler2.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, import_node_config_provider2.loadConfig)(import_config_resolver3.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, import_node_config_provider2.loadConfig)(import_config_resolver3.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + userAgentAppId: config?.userAgentAppId ?? (0, import_node_config_provider2.loadConfig)(import_util_user_agent_node2.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) + }; + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthExtensionConfiguration.js +var getHttpAuthExtensionConfiguration2, resolveHttpAuthRuntimeConfig2; +var init_httpAuthExtensionConfiguration2 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthExtensionConfiguration.js"() { + getHttpAuthExtensionConfiguration2 = (runtimeConfig) => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; + let _credentials = runtimeConfig.credentials; + return { + setHttpAuthScheme(httpAuthScheme) { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes() { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider) { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider() { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials) { + _credentials = credentials; + }, + credentials() { + return _credentials; + } + }; + }; + resolveHttpAuthRuntimeConfig2 = (config) => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials() + }; + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeExtensions.js +var import_region_config_resolver2, import_protocol_http13, import_smithy_client18, resolveRuntimeExtensions2; +var init_runtimeExtensions2 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeExtensions.js"() { + import_region_config_resolver2 = __toESM(require_dist_cjs57()); + import_protocol_http13 = __toESM(require_dist_cjs2()); + import_smithy_client18 = __toESM(require_dist_cjs20()); + init_httpAuthExtensionConfiguration2(); + resolveRuntimeExtensions2 = (runtimeConfig, extensions) => { + const extensionConfiguration = Object.assign((0, import_region_config_resolver2.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, import_smithy_client18.getDefaultExtensionConfiguration)(runtimeConfig), (0, import_protocol_http13.getHttpHandlerExtensionConfiguration)(runtimeConfig), getHttpAuthExtensionConfiguration2(runtimeConfig)); + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + return Object.assign(runtimeConfig, (0, import_region_config_resolver2.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, import_smithy_client18.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, import_protocol_http13.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), resolveHttpAuthRuntimeConfig2(extensionConfiguration)); + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/SigninClient.js +var import_middleware_host_header2, import_middleware_logger2, import_middleware_recursion_detection2, import_middleware_user_agent2, import_config_resolver4, import_middleware_content_length2, import_middleware_endpoint3, import_middleware_retry4, import_smithy_client19, SigninClient; +var init_SigninClient = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/SigninClient.js"() { + import_middleware_host_header2 = __toESM(require_dist_cjs27()); + import_middleware_logger2 = __toESM(require_dist_cjs28()); + import_middleware_recursion_detection2 = __toESM(require_dist_cjs29()); + import_middleware_user_agent2 = __toESM(require_dist_cjs37()); + import_config_resolver4 = __toESM(require_dist_cjs38()); + init_dist_es(); + init_schema(); + import_middleware_content_length2 = __toESM(require_dist_cjs40()); + import_middleware_endpoint3 = __toESM(require_dist_cjs43()); + import_middleware_retry4 = __toESM(require_dist_cjs46()); + import_smithy_client19 = __toESM(require_dist_cjs20()); + init_httpAuthSchemeProvider2(); + init_EndpointParameters2(); + init_runtimeConfig2(); + init_runtimeExtensions2(); + SigninClient = class extends import_smithy_client19.Client { + config; + constructor(...[configuration]) { + const _config_0 = getRuntimeConfig4(configuration || {}); + super(_config_0); + this.initConfig = _config_0; + const _config_1 = resolveClientEndpointParameters2(_config_0); + const _config_2 = (0, import_middleware_user_agent2.resolveUserAgentConfig)(_config_1); + const _config_3 = (0, import_middleware_retry4.resolveRetryConfig)(_config_2); + const _config_4 = (0, import_config_resolver4.resolveRegionConfig)(_config_3); + const _config_5 = (0, import_middleware_host_header2.resolveHostHeaderConfig)(_config_4); + const _config_6 = (0, import_middleware_endpoint3.resolveEndpointConfig)(_config_5); + const _config_7 = resolveHttpAuthSchemeConfig2(_config_6); + const _config_8 = resolveRuntimeExtensions2(_config_7, configuration?.extensions || []); + this.config = _config_8; + this.middlewareStack.use(getSchemaSerdePlugin(this.config)); + this.middlewareStack.use((0, import_middleware_user_agent2.getUserAgentPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_retry4.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_content_length2.getContentLengthPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_host_header2.getHostHeaderPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_logger2.getLoggerPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_recursion_detection2.getRecursionDetectionPlugin)(this.config)); + this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: defaultSigninHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials + }) + })); + this.middlewareStack.use(getHttpSigningPlugin(this.config)); + } + destroy() { + super.destroy(); + } + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js +var import_middleware_endpoint4, import_smithy_client20, CreateOAuth2TokenCommand; +var init_CreateOAuth2TokenCommand = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js"() { + import_middleware_endpoint4 = __toESM(require_dist_cjs43()); + import_smithy_client20 = __toESM(require_dist_cjs20()); + init_EndpointParameters2(); + init_schemas_02(); + CreateOAuth2TokenCommand = class extends import_smithy_client20.Command.classBuilder().ep(commonParams2).m(function(Command, cs, config, o4) { + return [(0, import_middleware_endpoint4.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())]; + }).s("Signin", "CreateOAuth2Token", {}).n("SigninClient", "CreateOAuth2TokenCommand").sc(CreateOAuth2Token$).build() { + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/Signin.js +var import_smithy_client21, commands2, Signin; +var init_Signin = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/Signin.js"() { + import_smithy_client21 = __toESM(require_dist_cjs20()); + init_CreateOAuth2TokenCommand(); + init_SigninClient(); + commands2 = { + CreateOAuth2TokenCommand + }; + Signin = class extends SigninClient { + }; + (0, import_smithy_client21.createAggregatedClient)(commands2, Signin); + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/index.js +var init_commands2 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/index.js"() { + init_CreateOAuth2TokenCommand(); + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js +var OAuth2ErrorCode; +var init_enums2 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js"() { + OAuth2ErrorCode = { + AUTHCODE_EXPIRED: "AUTHCODE_EXPIRED", + INSUFFICIENT_PERMISSIONS: "INSUFFICIENT_PERMISSIONS", + INVALID_REQUEST: "INVALID_REQUEST", + SERVER_ERROR: "server_error", + TOKEN_EXPIRED: "TOKEN_EXPIRED", + USER_CREDENTIALS_CHANGED: "USER_CREDENTIALS_CHANGED" + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/models_0.js +var init_models_02 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/models_0.js"() { + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/index.js +var signin_exports = {}; +__export(signin_exports, { + $Command: () => import_smithy_client20.Command, + AccessDeniedException: () => AccessDeniedException2, + AccessDeniedException$: () => AccessDeniedException$2, + AccessToken$: () => AccessToken$, + CreateOAuth2Token$: () => CreateOAuth2Token$, + CreateOAuth2TokenCommand: () => CreateOAuth2TokenCommand, + CreateOAuth2TokenRequest$: () => CreateOAuth2TokenRequest$, + CreateOAuth2TokenRequestBody$: () => CreateOAuth2TokenRequestBody$, + CreateOAuth2TokenResponse$: () => CreateOAuth2TokenResponse$, + CreateOAuth2TokenResponseBody$: () => CreateOAuth2TokenResponseBody$, + InternalServerException: () => InternalServerException2, + InternalServerException$: () => InternalServerException$2, + OAuth2ErrorCode: () => OAuth2ErrorCode, + Signin: () => Signin, + SigninClient: () => SigninClient, + SigninServiceException: () => SigninServiceException, + SigninServiceException$: () => SigninServiceException$, + TooManyRequestsError: () => TooManyRequestsError, + TooManyRequestsError$: () => TooManyRequestsError$, + ValidationException: () => ValidationException, + ValidationException$: () => ValidationException$, + __Client: () => import_smithy_client19.Client, + errorTypeRegistries: () => errorTypeRegistries2 +}); +var init_signin = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/index.js"() { + init_SigninClient(); + init_Signin(); + init_commands2(); + init_schemas_02(); + init_enums2(); + init_errors2(); + init_models_02(); + init_SigninServiceException(); + } +}); + +// node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js +var require_dist_cjs62 = __commonJS({ + "node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js"(exports2) { + "use strict"; + var client = (init_client(), __toCommonJS(client_exports)); + var propertyProvider = require_dist_cjs17(); + var sharedIniFileLoader = require_dist_cjs41(); + var protocolHttp = require_dist_cjs2(); + var node_crypto = require("node:crypto"); + var node_fs = require("node:fs"); + var node_os = require("node:os"); + var node_path = require("node:path"); + var LoginCredentialsFetcher = class _LoginCredentialsFetcher { + profileData; + init; + callerClientConfig; + static REFRESH_THRESHOLD = 5 * 60 * 1e3; + constructor(profileData, init, callerClientConfig) { + this.profileData = profileData; + this.init = init; + this.callerClientConfig = callerClientConfig; + } + async loadCredentials() { + const token = await this.loadToken(); + if (!token) { + throw new propertyProvider.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`, { tryNextLink: false, logger: this.logger }); + } + const accessToken = token.accessToken; + const now = Date.now(); + const expiryTime = new Date(accessToken.expiresAt).getTime(); + const timeUntilExpiry = expiryTime - now; + if (timeUntilExpiry <= _LoginCredentialsFetcher.REFRESH_THRESHOLD) { + return this.refresh(token); + } + return { + accessKeyId: accessToken.accessKeyId, + secretAccessKey: accessToken.secretAccessKey, + sessionToken: accessToken.sessionToken, + accountId: accessToken.accountId, + expiration: new Date(accessToken.expiresAt) + }; + } + get logger() { + return this.init?.logger; + } + get loginSession() { + return this.profileData.login_session; + } + async refresh(token) { + const { SigninClient: SigninClient2, CreateOAuth2TokenCommand: CreateOAuth2TokenCommand2 } = await Promise.resolve().then(() => (init_signin(), signin_exports)); + const { logger: logger3, userAgentAppId } = this.callerClientConfig ?? {}; + const isH22 = (requestHandler2) => { + return requestHandler2?.metadata?.handlerProtocol === "h2"; + }; + const requestHandler = isH22(this.callerClientConfig?.requestHandler) ? void 0 : this.callerClientConfig?.requestHandler; + const region = this.profileData.region ?? await this.callerClientConfig?.region?.() ?? process.env.AWS_REGION; + const client2 = new SigninClient2({ + credentials: { + accessKeyId: "", + secretAccessKey: "" + }, + region, + requestHandler, + logger: logger3, + userAgentAppId, + ...this.init?.clientConfig + }); + this.createDPoPInterceptor(client2.middlewareStack); + const commandInput = { + tokenInput: { + clientId: token.clientId, + refreshToken: token.refreshToken, + grantType: "refresh_token" + } + }; + try { + const response = await client2.send(new CreateOAuth2TokenCommand2(commandInput)); + const { accessKeyId, secretAccessKey, sessionToken } = response.tokenOutput?.accessToken ?? {}; + const { refreshToken, expiresIn } = response.tokenOutput ?? {}; + if (!accessKeyId || !secretAccessKey || !sessionToken || !refreshToken) { + throw new propertyProvider.CredentialsProviderError("Token refresh response missing required fields", { + logger: this.logger, + tryNextLink: false + }); + } + const expiresInMs = (expiresIn ?? 900) * 1e3; + const expiration = new Date(Date.now() + expiresInMs); + const updatedToken = { + ...token, + accessToken: { + ...token.accessToken, + accessKeyId, + secretAccessKey, + sessionToken, + expiresAt: expiration.toISOString() + }, + refreshToken + }; + await this.saveToken(updatedToken); + const newAccessToken = updatedToken.accessToken; + return { + accessKeyId: newAccessToken.accessKeyId, + secretAccessKey: newAccessToken.secretAccessKey, + sessionToken: newAccessToken.sessionToken, + accountId: newAccessToken.accountId, + expiration + }; + } catch (error2) { + if (error2.name === "AccessDeniedException") { + const errorType = error2.error; + let message2; + switch (errorType) { + case "TOKEN_EXPIRED": + message2 = "Your session has expired. Please reauthenticate."; + break; + case "USER_CREDENTIALS_CHANGED": + message2 = "Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password."; + break; + case "INSUFFICIENT_PERMISSIONS": + message2 = "Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action."; + break; + default: + message2 = `Failed to refresh token: ${String(error2)}. Please re-authenticate using \`aws login\``; + } + throw new propertyProvider.CredentialsProviderError(message2, { logger: this.logger, tryNextLink: false }); + } + throw new propertyProvider.CredentialsProviderError(`Failed to refresh token: ${String(error2)}. Please re-authenticate using aws login`, { logger: this.logger }); + } + } + async loadToken() { + const tokenFilePath = this.getTokenFilePath(); + try { + let tokenData; + try { + tokenData = await sharedIniFileLoader.readFile(tokenFilePath, { ignoreCache: this.init?.ignoreCache }); + } catch { + tokenData = await node_fs.promises.readFile(tokenFilePath, "utf8"); + } + const token = JSON.parse(tokenData); + const missingFields = ["accessToken", "clientId", "refreshToken", "dpopKey"].filter((k4) => !token[k4]); + if (!token.accessToken?.accountId) { + missingFields.push("accountId"); + } + if (missingFields.length > 0) { + throw new propertyProvider.CredentialsProviderError(`Token validation failed, missing fields: ${missingFields.join(", ")}`, { + logger: this.logger, + tryNextLink: false + }); + } + return token; + } catch (error2) { + throw new propertyProvider.CredentialsProviderError(`Failed to load token from ${tokenFilePath}: ${String(error2)}`, { + logger: this.logger, + tryNextLink: false + }); + } + } + async saveToken(token) { + const tokenFilePath = this.getTokenFilePath(); + const directory = node_path.dirname(tokenFilePath); + try { + await node_fs.promises.mkdir(directory, { recursive: true }); + } catch (error2) { + } + await node_fs.promises.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8"); + } + getTokenFilePath() { + const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? node_path.join(node_os.homedir(), ".aws", "login", "cache"); + const loginSessionBytes = Buffer.from(this.loginSession, "utf8"); + const loginSessionSha256 = node_crypto.createHash("sha256").update(loginSessionBytes).digest("hex"); + return node_path.join(directory, `${loginSessionSha256}.json`); + } + derToRawSignature(derSignature) { + let offset = 2; + if (derSignature[offset] !== 2) { + throw new Error("Invalid DER signature"); + } + offset++; + const rLength = derSignature[offset++]; + let r4 = derSignature.subarray(offset, offset + rLength); + offset += rLength; + if (derSignature[offset] !== 2) { + throw new Error("Invalid DER signature"); + } + offset++; + const sLength = derSignature[offset++]; + let s4 = derSignature.subarray(offset, offset + sLength); + r4 = r4[0] === 0 ? r4.subarray(1) : r4; + s4 = s4[0] === 0 ? s4.subarray(1) : s4; + const rPadded = Buffer.concat([Buffer.alloc(32 - r4.length), r4]); + const sPadded = Buffer.concat([Buffer.alloc(32 - s4.length), s4]); + return Buffer.concat([rPadded, sPadded]); + } + createDPoPInterceptor(middlewareStack) { + middlewareStack.add((next) => async (args2) => { + if (protocolHttp.HttpRequest.isInstance(args2.request)) { + const request = args2.request; + const actualEndpoint = `${request.protocol}//${request.hostname}${request.port ? `:${request.port}` : ""}${request.path}`; + const dpop = await this.generateDpop(request.method, actualEndpoint); + request.headers = { + ...request.headers, + DPoP: dpop + }; + } + return next(args2); + }, { + step: "finalizeRequest", + name: "dpopInterceptor", + override: true + }); + } + async generateDpop(method = "POST", endpoint) { + const token = await this.loadToken(); + try { + const privateKey = node_crypto.createPrivateKey({ + key: token.dpopKey, + format: "pem", + type: "sec1" + }); + const publicKey = node_crypto.createPublicKey(privateKey); + const publicDer = publicKey.export({ format: "der", type: "spki" }); + let pointStart = -1; + for (let i4 = 0; i4 < publicDer.length; i4++) { + if (publicDer[i4] === 4) { + pointStart = i4; + break; + } + } + const x4 = publicDer.slice(pointStart + 1, pointStart + 33); + const y2 = publicDer.slice(pointStart + 33, pointStart + 65); + const header = { + alg: "ES256", + typ: "dpop+jwt", + jwk: { + kty: "EC", + crv: "P-256", + x: x4.toString("base64url"), + y: y2.toString("base64url") + } + }; + const payload2 = { + jti: crypto.randomUUID(), + htm: method, + htu: endpoint, + iat: Math.floor(Date.now() / 1e3) + }; + const headerB64 = Buffer.from(JSON.stringify(header)).toString("base64url"); + const payloadB64 = Buffer.from(JSON.stringify(payload2)).toString("base64url"); + const message2 = `${headerB64}.${payloadB64}`; + const asn1Signature = node_crypto.sign("sha256", Buffer.from(message2), privateKey); + const rawSignature = this.derToRawSignature(asn1Signature); + const signatureB64 = rawSignature.toString("base64url"); + return `${message2}.${signatureB64}`; + } catch (error2) { + throw new propertyProvider.CredentialsProviderError(`Failed to generate Dpop proof: ${error2 instanceof Error ? error2.message : String(error2)}`, { logger: this.logger, tryNextLink: false }); + } + } + }; + var fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => { + init?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials"); + const profiles = await sharedIniFileLoader.parseKnownFiles(init || {}); + const profileName = sharedIniFileLoader.getProfileName({ + profile: init?.profile ?? callerClientConfig?.profile + }); + const profile = profiles[profileName]; + if (!profile?.login_session) { + throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} does not contain login_session.`, { + tryNextLink: true, + logger: init?.logger + }); + } + const fetcher = new LoginCredentialsFetcher(profile, init, callerClientConfig); + const credentials = await fetcher.loadCredentials(); + return client.setCredentialFeature(credentials, "CREDENTIALS_LOGIN", "AD"); + }; + exports2.fromLoginCredentials = fromLoginCredentials; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js +function createAwsAuthSigv4HttpAuthOption3(authParameters) { + return { + schemeId: "aws.auth#sigv4", + signingProperties: { + name: "sts", + region: authParameters.region + }, + propertiesExtractor: (config, context) => ({ + signingProperties: { + config, + context + } + }) + }; +} +function createSmithyApiNoAuthHttpAuthOption3(authParameters) { + return { + schemeId: "smithy.api#noAuth" + }; +} +var import_util_middleware8, defaultSTSHttpAuthSchemeParametersProvider, defaultSTSHttpAuthSchemeProvider, resolveStsAuthConfig, resolveHttpAuthSchemeConfig3; +var init_httpAuthSchemeProvider3 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js"() { + init_dist_es2(); + import_util_middleware8 = __toESM(require_dist_cjs4()); + init_STSClient(); + defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => { + return { + operation: (0, import_util_middleware8.getSmithyContext)(context).operation, + region: await (0, import_util_middleware8.normalizeProvider)(config.region)() || (() => { + throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); + })() + }; + }; + defaultSTSHttpAuthSchemeProvider = (authParameters) => { + const options = []; + switch (authParameters.operation) { + case "AssumeRoleWithWebIdentity": { + options.push(createSmithyApiNoAuthHttpAuthOption3(authParameters)); + break; + } + default: { + options.push(createAwsAuthSigv4HttpAuthOption3(authParameters)); + } + } + return options; + }; + resolveStsAuthConfig = (input) => Object.assign(input, { + stsClientCtor: STSClient + }); + resolveHttpAuthSchemeConfig3 = (config) => { + const config_0 = resolveStsAuthConfig(config); + const config_1 = resolveAwsSdkSigV4Config(config_0); + return Object.assign(config_1, { + authSchemePreference: (0, import_util_middleware8.normalizeProvider)(config.authSchemePreference ?? []) + }); + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/EndpointParameters.js +var resolveClientEndpointParameters3, commonParams3; +var init_EndpointParameters3 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/EndpointParameters.js"() { + resolveClientEndpointParameters3 = (options) => { + return Object.assign(options, { + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + useGlobalEndpoint: options.useGlobalEndpoint ?? false, + defaultSigningName: "sts" + }); + }; + commonParams3 = { + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/ruleset.js +var F, G, H, I, J, a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l3, m3, n3, o3, p3, q3, r3, s3, t3, u3, v3, w3, x3, y, z, A, B, C, D, E, _data3, ruleSet3; +var init_ruleset3 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/ruleset.js"() { + F = "required"; + G = "type"; + H = "fn"; + I = "argv"; + J = "ref"; + a3 = false; + b3 = true; + c3 = "booleanEquals"; + d3 = "stringEquals"; + e3 = "sigv4"; + f3 = "sts"; + g3 = "us-east-1"; + h3 = "endpoint"; + i3 = "https://sts.{Region}.{PartitionResult#dnsSuffix}"; + j3 = "tree"; + k3 = "error"; + l3 = "getAttr"; + m3 = { [F]: false, [G]: "string" }; + n3 = { [F]: true, "default": false, [G]: "boolean" }; + o3 = { [J]: "Endpoint" }; + p3 = { [H]: "isSet", [I]: [{ [J]: "Region" }] }; + q3 = { [J]: "Region" }; + r3 = { [H]: "aws.partition", [I]: [q3], "assign": "PartitionResult" }; + s3 = { [J]: "UseFIPS" }; + t3 = { [J]: "UseDualStack" }; + u3 = { "url": "https://sts.amazonaws.com", "properties": { "authSchemes": [{ "name": e3, "signingName": f3, "signingRegion": g3 }] }, "headers": {} }; + v3 = {}; + w3 = { "conditions": [{ [H]: d3, [I]: [q3, "aws-global"] }], [h3]: u3, [G]: h3 }; + x3 = { [H]: c3, [I]: [s3, true] }; + y = { [H]: c3, [I]: [t3, true] }; + z = { [H]: l3, [I]: [{ [J]: "PartitionResult" }, "supportsFIPS"] }; + A = { [J]: "PartitionResult" }; + B = { [H]: c3, [I]: [true, { [H]: l3, [I]: [A, "supportsDualStack"] }] }; + C = [{ [H]: "isSet", [I]: [o3] }]; + D = [x3]; + E = [y]; + _data3 = { version: "1.0", parameters: { Region: m3, UseDualStack: n3, UseFIPS: n3, Endpoint: m3, UseGlobalEndpoint: n3 }, rules: [{ conditions: [{ [H]: c3, [I]: [{ [J]: "UseGlobalEndpoint" }, b3] }, { [H]: "not", [I]: C }, p3, r3, { [H]: c3, [I]: [s3, a3] }, { [H]: c3, [I]: [t3, a3] }], rules: [{ conditions: [{ [H]: d3, [I]: [q3, "ap-northeast-1"] }], endpoint: u3, [G]: h3 }, { conditions: [{ [H]: d3, [I]: [q3, "ap-south-1"] }], endpoint: u3, [G]: h3 }, { conditions: [{ [H]: d3, [I]: [q3, "ap-southeast-1"] }], endpoint: u3, [G]: h3 }, { conditions: [{ [H]: d3, [I]: [q3, "ap-southeast-2"] }], endpoint: u3, [G]: h3 }, w3, { conditions: [{ [H]: d3, [I]: [q3, "ca-central-1"] }], endpoint: u3, [G]: h3 }, { conditions: [{ [H]: d3, [I]: [q3, "eu-central-1"] }], endpoint: u3, [G]: h3 }, { conditions: [{ [H]: d3, [I]: [q3, "eu-north-1"] }], endpoint: u3, [G]: h3 }, { conditions: [{ [H]: d3, [I]: [q3, "eu-west-1"] }], endpoint: u3, [G]: h3 }, { conditions: [{ [H]: d3, [I]: [q3, "eu-west-2"] }], endpoint: u3, [G]: h3 }, { conditions: [{ [H]: d3, [I]: [q3, "eu-west-3"] }], endpoint: u3, [G]: h3 }, { conditions: [{ [H]: d3, [I]: [q3, "sa-east-1"] }], endpoint: u3, [G]: h3 }, { conditions: [{ [H]: d3, [I]: [q3, g3] }], endpoint: u3, [G]: h3 }, { conditions: [{ [H]: d3, [I]: [q3, "us-east-2"] }], endpoint: u3, [G]: h3 }, { conditions: [{ [H]: d3, [I]: [q3, "us-west-1"] }], endpoint: u3, [G]: h3 }, { conditions: [{ [H]: d3, [I]: [q3, "us-west-2"] }], endpoint: u3, [G]: h3 }, { endpoint: { url: i3, properties: { authSchemes: [{ name: e3, signingName: f3, signingRegion: "{Region}" }] }, headers: v3 }, [G]: h3 }], [G]: j3 }, { conditions: C, rules: [{ conditions: D, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G]: k3 }, { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G]: k3 }, { endpoint: { url: o3, properties: v3, headers: v3 }, [G]: h3 }], [G]: j3 }, { conditions: [p3], rules: [{ conditions: [r3], rules: [{ conditions: [x3, y], rules: [{ conditions: [{ [H]: c3, [I]: [b3, z] }, B], rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v3, headers: v3 }, [G]: h3 }], [G]: j3 }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G]: k3 }], [G]: j3 }, { conditions: D, rules: [{ conditions: [{ [H]: c3, [I]: [z, b3] }], rules: [{ conditions: [{ [H]: d3, [I]: [{ [H]: l3, [I]: [A, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v3, headers: v3 }, [G]: h3 }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", properties: v3, headers: v3 }, [G]: h3 }], [G]: j3 }, { error: "FIPS is enabled but this partition does not support FIPS", [G]: k3 }], [G]: j3 }, { conditions: E, rules: [{ conditions: [B], rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v3, headers: v3 }, [G]: h3 }], [G]: j3 }, { error: "DualStack is enabled but this partition does not support DualStack", [G]: k3 }], [G]: j3 }, w3, { endpoint: { url: i3, properties: v3, headers: v3 }, [G]: h3 }], [G]: j3 }], [G]: j3 }, { error: "Invalid Configuration: Missing Region", [G]: k3 }] }; + ruleSet3 = _data3; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js +var import_util_endpoints5, import_util_endpoints6, cache3, defaultEndpointResolver3; +var init_endpointResolver3 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js"() { + import_util_endpoints5 = __toESM(require_dist_cjs56()); + import_util_endpoints6 = __toESM(require_dist_cjs33()); + init_ruleset3(); + cache3 = new import_util_endpoints6.EndpointCache({ + size: 50, + params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"] + }); + defaultEndpointResolver3 = (endpointParams, context = {}) => { + return cache3.get(endpointParams, () => (0, import_util_endpoints6.resolveEndpoint)(ruleSet3, { + endpointParams, + logger: context.logger + })); + }; + import_util_endpoints6.customEndpointFunctions.aws = import_util_endpoints5.awsEndpointFunctions; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js +var import_smithy_client22, STSServiceException; +var init_STSServiceException = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js"() { + import_smithy_client22 = __toESM(require_dist_cjs20()); + STSServiceException = class _STSServiceException extends import_smithy_client22.ServiceException { + constructor(options) { + super(options); + Object.setPrototypeOf(this, _STSServiceException.prototype); + } + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js +var ExpiredTokenException2, MalformedPolicyDocumentException, PackedPolicyTooLargeException, RegionDisabledException, IDPRejectedClaimException, InvalidIdentityTokenException, IDPCommunicationErrorException; +var init_errors3 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js"() { + init_STSServiceException(); + ExpiredTokenException2 = class _ExpiredTokenException extends STSServiceException { + name = "ExpiredTokenException"; + $fault = "client"; + constructor(opts) { + super({ + name: "ExpiredTokenException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _ExpiredTokenException.prototype); + } + }; + MalformedPolicyDocumentException = class _MalformedPolicyDocumentException extends STSServiceException { + name = "MalformedPolicyDocumentException"; + $fault = "client"; + constructor(opts) { + super({ + name: "MalformedPolicyDocumentException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype); + } + }; + PackedPolicyTooLargeException = class _PackedPolicyTooLargeException extends STSServiceException { + name = "PackedPolicyTooLargeException"; + $fault = "client"; + constructor(opts) { + super({ + name: "PackedPolicyTooLargeException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _PackedPolicyTooLargeException.prototype); + } + }; + RegionDisabledException = class _RegionDisabledException extends STSServiceException { + name = "RegionDisabledException"; + $fault = "client"; + constructor(opts) { + super({ + name: "RegionDisabledException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _RegionDisabledException.prototype); + } + }; + IDPRejectedClaimException = class _IDPRejectedClaimException extends STSServiceException { + name = "IDPRejectedClaimException"; + $fault = "client"; + constructor(opts) { + super({ + name: "IDPRejectedClaimException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _IDPRejectedClaimException.prototype); + } + }; + InvalidIdentityTokenException = class _InvalidIdentityTokenException extends STSServiceException { + name = "InvalidIdentityTokenException"; + $fault = "client"; + constructor(opts) { + super({ + name: "InvalidIdentityTokenException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _InvalidIdentityTokenException.prototype); + } + }; + IDPCommunicationErrorException = class _IDPCommunicationErrorException extends STSServiceException { + name = "IDPCommunicationErrorException"; + $fault = "client"; + constructor(opts) { + super({ + name: "IDPCommunicationErrorException", + $fault: "client", + ...opts + }); + Object.setPrototypeOf(this, _IDPCommunicationErrorException.prototype); + } + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js +var _A, _AKI, _AR, _ARI, _ARR, _ARRs, _ARU, _ARWWI, _ARWWIR, _ARWWIRs, _Au, _C, _CA, _DS, _E, _EI, _ETE2, _IDPCEE, _IDPRCE, _IITE, _K, _MPDE, _P, _PA, _PAr, _PC, _PCLT, _PCr, _PDT, _PI, _PPS, _PPTLE, _Pr, _RA, _RDE, _RSN, _SAK, _SFWIT, _SI, _SN, _ST, _T, _TC, _TTK, _Ta, _V, _WIT, _a, _aKST, _aQE, _c3, _cTT, _e3, _hE3, _m2, _pDLT, _s3, _tLT, n03, _s_registry3, STSServiceException$, n0_registry3, ExpiredTokenException$2, IDPCommunicationErrorException$, IDPRejectedClaimException$, InvalidIdentityTokenException$, MalformedPolicyDocumentException$, PackedPolicyTooLargeException$, RegionDisabledException$, errorTypeRegistries3, accessKeySecretType, clientTokenType, AssumedRoleUser$, AssumeRoleRequest$, AssumeRoleResponse$, AssumeRoleWithWebIdentityRequest$, AssumeRoleWithWebIdentityResponse$, Credentials$, PolicyDescriptorType$, ProvidedContext$, Tag$, policyDescriptorListType, ProvidedContextsListType, tagKeyListType, tagListType, AssumeRole$, AssumeRoleWithWebIdentity$; +var init_schemas_03 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js"() { + init_schema(); + init_errors3(); + init_STSServiceException(); + _A = "Arn"; + _AKI = "AccessKeyId"; + _AR = "AssumeRole"; + _ARI = "AssumedRoleId"; + _ARR = "AssumeRoleRequest"; + _ARRs = "AssumeRoleResponse"; + _ARU = "AssumedRoleUser"; + _ARWWI = "AssumeRoleWithWebIdentity"; + _ARWWIR = "AssumeRoleWithWebIdentityRequest"; + _ARWWIRs = "AssumeRoleWithWebIdentityResponse"; + _Au = "Audience"; + _C = "Credentials"; + _CA = "ContextAssertion"; + _DS = "DurationSeconds"; + _E = "Expiration"; + _EI = "ExternalId"; + _ETE2 = "ExpiredTokenException"; + _IDPCEE = "IDPCommunicationErrorException"; + _IDPRCE = "IDPRejectedClaimException"; + _IITE = "InvalidIdentityTokenException"; + _K = "Key"; + _MPDE = "MalformedPolicyDocumentException"; + _P = "Policy"; + _PA = "PolicyArns"; + _PAr = "ProviderArn"; + _PC = "ProvidedContexts"; + _PCLT = "ProvidedContextsListType"; + _PCr = "ProvidedContext"; + _PDT = "PolicyDescriptorType"; + _PI = "ProviderId"; + _PPS = "PackedPolicySize"; + _PPTLE = "PackedPolicyTooLargeException"; + _Pr = "Provider"; + _RA = "RoleArn"; + _RDE = "RegionDisabledException"; + _RSN = "RoleSessionName"; + _SAK = "SecretAccessKey"; + _SFWIT = "SubjectFromWebIdentityToken"; + _SI = "SourceIdentity"; + _SN = "SerialNumber"; + _ST = "SessionToken"; + _T = "Tags"; + _TC = "TokenCode"; + _TTK = "TransitiveTagKeys"; + _Ta = "Tag"; + _V = "Value"; + _WIT = "WebIdentityToken"; + _a = "arn"; + _aKST = "accessKeySecretType"; + _aQE = "awsQueryError"; + _c3 = "client"; + _cTT = "clientTokenType"; + _e3 = "error"; + _hE3 = "httpError"; + _m2 = "message"; + _pDLT = "policyDescriptorListType"; + _s3 = "smithy.ts.sdk.synthetic.com.amazonaws.sts"; + _tLT = "tagListType"; + n03 = "com.amazonaws.sts"; + _s_registry3 = TypeRegistry.for(_s3); + STSServiceException$ = [-3, _s3, "STSServiceException", 0, [], []]; + _s_registry3.registerError(STSServiceException$, STSServiceException); + n0_registry3 = TypeRegistry.for(n03); + ExpiredTokenException$2 = [ + -3, + n03, + _ETE2, + { [_aQE]: [`ExpiredTokenException`, 400], [_e3]: _c3, [_hE3]: 400 }, + [_m2], + [0] + ]; + n0_registry3.registerError(ExpiredTokenException$2, ExpiredTokenException2); + IDPCommunicationErrorException$ = [ + -3, + n03, + _IDPCEE, + { [_aQE]: [`IDPCommunicationError`, 400], [_e3]: _c3, [_hE3]: 400 }, + [_m2], + [0] + ]; + n0_registry3.registerError(IDPCommunicationErrorException$, IDPCommunicationErrorException); + IDPRejectedClaimException$ = [ + -3, + n03, + _IDPRCE, + { [_aQE]: [`IDPRejectedClaim`, 403], [_e3]: _c3, [_hE3]: 403 }, + [_m2], + [0] + ]; + n0_registry3.registerError(IDPRejectedClaimException$, IDPRejectedClaimException); + InvalidIdentityTokenException$ = [ + -3, + n03, + _IITE, + { [_aQE]: [`InvalidIdentityToken`, 400], [_e3]: _c3, [_hE3]: 400 }, + [_m2], + [0] + ]; + n0_registry3.registerError(InvalidIdentityTokenException$, InvalidIdentityTokenException); + MalformedPolicyDocumentException$ = [ + -3, + n03, + _MPDE, + { [_aQE]: [`MalformedPolicyDocument`, 400], [_e3]: _c3, [_hE3]: 400 }, + [_m2], + [0] + ]; + n0_registry3.registerError(MalformedPolicyDocumentException$, MalformedPolicyDocumentException); + PackedPolicyTooLargeException$ = [ + -3, + n03, + _PPTLE, + { [_aQE]: [`PackedPolicyTooLarge`, 400], [_e3]: _c3, [_hE3]: 400 }, + [_m2], + [0] + ]; + n0_registry3.registerError(PackedPolicyTooLargeException$, PackedPolicyTooLargeException); + RegionDisabledException$ = [ + -3, + n03, + _RDE, + { [_aQE]: [`RegionDisabledException`, 403], [_e3]: _c3, [_hE3]: 403 }, + [_m2], + [0] + ]; + n0_registry3.registerError(RegionDisabledException$, RegionDisabledException); + errorTypeRegistries3 = [_s_registry3, n0_registry3]; + accessKeySecretType = [0, n03, _aKST, 8, 0]; + clientTokenType = [0, n03, _cTT, 8, 0]; + AssumedRoleUser$ = [3, n03, _ARU, 0, [_ARI, _A], [0, 0], 2]; + AssumeRoleRequest$ = [ + 3, + n03, + _ARR, + 0, + [_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC], + [0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType], + 2 + ]; + AssumeRoleResponse$ = [ + 3, + n03, + _ARRs, + 0, + [_C, _ARU, _PPS, _SI], + [[() => Credentials$, 0], () => AssumedRoleUser$, 1, 0] + ]; + AssumeRoleWithWebIdentityRequest$ = [ + 3, + n03, + _ARWWIR, + 0, + [_RA, _RSN, _WIT, _PI, _PA, _P, _DS], + [0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1], + 3 + ]; + AssumeRoleWithWebIdentityResponse$ = [ + 3, + n03, + _ARWWIRs, + 0, + [_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI], + [[() => Credentials$, 0], 0, () => AssumedRoleUser$, 1, 0, 0, 0] + ]; + Credentials$ = [ + 3, + n03, + _C, + 0, + [_AKI, _SAK, _ST, _E], + [0, [() => accessKeySecretType, 0], 0, 4], + 4 + ]; + PolicyDescriptorType$ = [3, n03, _PDT, 0, [_a], [0]]; + ProvidedContext$ = [3, n03, _PCr, 0, [_PAr, _CA], [0, 0]]; + Tag$ = [3, n03, _Ta, 0, [_K, _V], [0, 0], 2]; + policyDescriptorListType = [1, n03, _pDLT, 0, () => PolicyDescriptorType$]; + ProvidedContextsListType = [1, n03, _PCLT, 0, () => ProvidedContext$]; + tagKeyListType = 64 | 0; + tagListType = [1, n03, _tLT, 0, () => Tag$]; + AssumeRole$ = [9, n03, _AR, 0, () => AssumeRoleRequest$, () => AssumeRoleResponse$]; + AssumeRoleWithWebIdentity$ = [ + 9, + n03, + _ARWWI, + 0, + () => AssumeRoleWithWebIdentityRequest$, + () => AssumeRoleWithWebIdentityResponse$ + ]; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js +var import_smithy_client23, import_url_parser3, import_util_base6410, import_util_utf810, getRuntimeConfig5; +var init_runtimeConfig_shared3 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js"() { + init_dist_es2(); + init_protocols2(); + init_dist_es(); + import_smithy_client23 = __toESM(require_dist_cjs20()); + import_url_parser3 = __toESM(require_dist_cjs35()); + import_util_base6410 = __toESM(require_dist_cjs9()); + import_util_utf810 = __toESM(require_dist_cjs8()); + init_httpAuthSchemeProvider3(); + init_endpointResolver3(); + init_schemas_03(); + getRuntimeConfig5 = (config) => { + return { + apiVersion: "2011-06-15", + base64Decoder: config?.base64Decoder ?? import_util_base6410.fromBase64, + base64Encoder: config?.base64Encoder ?? import_util_base6410.toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver3, + extensions: config?.extensions ?? [], + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSTSHttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new AwsSdkSigV4Signer() + }, + { + schemeId: "smithy.api#noAuth", + identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), + signer: new NoAuthSigner() + } + ], + logger: config?.logger ?? new import_smithy_client23.NoOpLogger(), + protocol: config?.protocol ?? AwsQueryProtocol, + protocolSettings: config?.protocolSettings ?? { + defaultNamespace: "com.amazonaws.sts", + errorTypeRegistries: errorTypeRegistries3, + xmlNamespace: "https://sts.amazonaws.com/doc/2011-06-15/", + version: "2011-06-15", + serviceTarget: "AWSSecurityTokenServiceV20110615" + }, + serviceId: config?.serviceId ?? "STS", + urlParser: config?.urlParser ?? import_url_parser3.parseUrl, + utf8Decoder: config?.utf8Decoder ?? import_util_utf810.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? import_util_utf810.toUtf8 + }; + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js +var import_util_user_agent_node3, import_config_resolver5, import_hash_node3, import_middleware_retry5, import_node_config_provider3, import_node_http_handler3, import_smithy_client24, import_util_body_length_node3, import_util_defaults_mode_node3, import_util_retry3, getRuntimeConfig6; +var init_runtimeConfig3 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js"() { + init_package(); + init_dist_es2(); + import_util_user_agent_node3 = __toESM(require_dist_cjs52()); + import_config_resolver5 = __toESM(require_dist_cjs38()); + init_dist_es(); + import_hash_node3 = __toESM(require_dist_cjs53()); + import_middleware_retry5 = __toESM(require_dist_cjs46()); + import_node_config_provider3 = __toESM(require_dist_cjs42()); + import_node_http_handler3 = __toESM(require_dist_cjs12()); + import_smithy_client24 = __toESM(require_dist_cjs20()); + import_util_body_length_node3 = __toESM(require_dist_cjs54()); + import_util_defaults_mode_node3 = __toESM(require_dist_cjs55()); + import_util_retry3 = __toESM(require_dist_cjs45()); + init_runtimeConfig_shared3(); + getRuntimeConfig6 = (config) => { + (0, import_smithy_client24.emitWarningIfUnsupportedVersion)(process.version); + const defaultsMode = (0, import_util_defaults_mode_node3.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(import_smithy_client24.loadConfigsForDefaultMode); + const clientSharedValues = getRuntimeConfig5(config); + emitWarningIfUnsupportedVersion(process.version); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + authSchemePreference: config?.authSchemePreference ?? (0, import_node_config_provider3.loadConfig)(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), + bodyLengthChecker: config?.bodyLengthChecker ?? import_util_body_length_node3.calculateBodyLength, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, import_util_user_agent_node3.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }), + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") || (async (idProps) => await config.credentialDefaultProvider(idProps?.__config || {})()), + signer: new AwsSdkSigV4Signer() + }, + { + schemeId: "smithy.api#noAuth", + identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), + signer: new NoAuthSigner() + } + ], + maxAttempts: config?.maxAttempts ?? (0, import_node_config_provider3.loadConfig)(import_middleware_retry5.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: config?.region ?? (0, import_node_config_provider3.loadConfig)(import_config_resolver5.NODE_REGION_CONFIG_OPTIONS, { ...import_config_resolver5.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), + requestHandler: import_node_http_handler3.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), + retryMode: config?.retryMode ?? (0, import_node_config_provider3.loadConfig)({ + ...import_middleware_retry5.NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || import_util_retry3.DEFAULT_RETRY_MODE + }, config), + sha256: config?.sha256 ?? import_hash_node3.Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? import_node_http_handler3.streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, import_node_config_provider3.loadConfig)(import_config_resolver5.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, import_node_config_provider3.loadConfig)(import_config_resolver5.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + userAgentAppId: config?.userAgentAppId ?? (0, import_node_config_provider3.loadConfig)(import_util_user_agent_node3.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) + }; + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthExtensionConfiguration.js +var getHttpAuthExtensionConfiguration3, resolveHttpAuthRuntimeConfig3; +var init_httpAuthExtensionConfiguration3 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthExtensionConfiguration.js"() { + getHttpAuthExtensionConfiguration3 = (runtimeConfig) => { + const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; + let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; + let _credentials = runtimeConfig.credentials; + return { + setHttpAuthScheme(httpAuthScheme) { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes() { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider) { + _httpAuthSchemeProvider = httpAuthSchemeProvider; + }, + httpAuthSchemeProvider() { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials) { + _credentials = credentials; + }, + credentials() { + return _credentials; + } + }; + }; + resolveHttpAuthRuntimeConfig3 = (config) => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials() + }; + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js +var import_region_config_resolver3, import_protocol_http14, import_smithy_client25, resolveRuntimeExtensions3; +var init_runtimeExtensions3 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js"() { + import_region_config_resolver3 = __toESM(require_dist_cjs57()); + import_protocol_http14 = __toESM(require_dist_cjs2()); + import_smithy_client25 = __toESM(require_dist_cjs20()); + init_httpAuthExtensionConfiguration3(); + resolveRuntimeExtensions3 = (runtimeConfig, extensions) => { + const extensionConfiguration = Object.assign((0, import_region_config_resolver3.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, import_smithy_client25.getDefaultExtensionConfiguration)(runtimeConfig), (0, import_protocol_http14.getHttpHandlerExtensionConfiguration)(runtimeConfig), getHttpAuthExtensionConfiguration3(runtimeConfig)); + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + return Object.assign(runtimeConfig, (0, import_region_config_resolver3.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, import_smithy_client25.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, import_protocol_http14.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), resolveHttpAuthRuntimeConfig3(extensionConfiguration)); + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js +var import_middleware_host_header3, import_middleware_logger3, import_middleware_recursion_detection3, import_middleware_user_agent3, import_config_resolver6, import_middleware_content_length3, import_middleware_endpoint5, import_middleware_retry6, import_smithy_client26, STSClient; +var init_STSClient = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js"() { + import_middleware_host_header3 = __toESM(require_dist_cjs27()); + import_middleware_logger3 = __toESM(require_dist_cjs28()); + import_middleware_recursion_detection3 = __toESM(require_dist_cjs29()); + import_middleware_user_agent3 = __toESM(require_dist_cjs37()); + import_config_resolver6 = __toESM(require_dist_cjs38()); + init_dist_es(); + init_schema(); + import_middleware_content_length3 = __toESM(require_dist_cjs40()); + import_middleware_endpoint5 = __toESM(require_dist_cjs43()); + import_middleware_retry6 = __toESM(require_dist_cjs46()); + import_smithy_client26 = __toESM(require_dist_cjs20()); + init_httpAuthSchemeProvider3(); + init_EndpointParameters3(); + init_runtimeConfig3(); + init_runtimeExtensions3(); + STSClient = class extends import_smithy_client26.Client { + config; + constructor(...[configuration]) { + const _config_0 = getRuntimeConfig6(configuration || {}); + super(_config_0); + this.initConfig = _config_0; + const _config_1 = resolveClientEndpointParameters3(_config_0); + const _config_2 = (0, import_middleware_user_agent3.resolveUserAgentConfig)(_config_1); + const _config_3 = (0, import_middleware_retry6.resolveRetryConfig)(_config_2); + const _config_4 = (0, import_config_resolver6.resolveRegionConfig)(_config_3); + const _config_5 = (0, import_middleware_host_header3.resolveHostHeaderConfig)(_config_4); + const _config_6 = (0, import_middleware_endpoint5.resolveEndpointConfig)(_config_5); + const _config_7 = resolveHttpAuthSchemeConfig3(_config_6); + const _config_8 = resolveRuntimeExtensions3(_config_7, configuration?.extensions || []); + this.config = _config_8; + this.middlewareStack.use(getSchemaSerdePlugin(this.config)); + this.middlewareStack.use((0, import_middleware_user_agent3.getUserAgentPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_retry6.getRetryPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_content_length3.getContentLengthPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_host_header3.getHostHeaderPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_logger3.getLoggerPlugin)(this.config)); + this.middlewareStack.use((0, import_middleware_recursion_detection3.getRecursionDetectionPlugin)(this.config)); + this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: defaultSTSHttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials + }) + })); + this.middlewareStack.use(getHttpSigningPlugin(this.config)); + } + destroy() { + super.destroy(); + } + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js +var import_middleware_endpoint6, import_smithy_client27, AssumeRoleCommand; +var init_AssumeRoleCommand = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js"() { + import_middleware_endpoint6 = __toESM(require_dist_cjs43()); + import_smithy_client27 = __toESM(require_dist_cjs20()); + init_EndpointParameters3(); + init_schemas_03(); + AssumeRoleCommand = class extends import_smithy_client27.Command.classBuilder().ep(commonParams3).m(function(Command, cs, config, o4) { + return [(0, import_middleware_endpoint6.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())]; + }).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").sc(AssumeRole$).build() { + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js +var import_middleware_endpoint7, import_smithy_client28, AssumeRoleWithWebIdentityCommand; +var init_AssumeRoleWithWebIdentityCommand = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js"() { + import_middleware_endpoint7 = __toESM(require_dist_cjs43()); + import_smithy_client28 = __toESM(require_dist_cjs20()); + init_EndpointParameters3(); + init_schemas_03(); + AssumeRoleWithWebIdentityCommand = class extends import_smithy_client28.Command.classBuilder().ep(commonParams3).m(function(Command, cs, config, o4) { + return [(0, import_middleware_endpoint7.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())]; + }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").sc(AssumeRoleWithWebIdentity$).build() { + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STS.js +var import_smithy_client29, commands3, STS; +var init_STS = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STS.js"() { + import_smithy_client29 = __toESM(require_dist_cjs20()); + init_AssumeRoleCommand(); + init_AssumeRoleWithWebIdentityCommand(); + init_STSClient(); + commands3 = { + AssumeRoleCommand, + AssumeRoleWithWebIdentityCommand + }; + STS = class extends STSClient { + }; + (0, import_smithy_client29.createAggregatedClient)(commands3, STS); + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/index.js +var init_commands3 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/index.js"() { + init_AssumeRoleCommand(); + init_AssumeRoleWithWebIdentityCommand(); + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/models_0.js +var init_models_03 = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/models_0.js"() { + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js +var import_region_config_resolver4, getAccountIdFromAssumedRoleUser, resolveRegion, getDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity, isH2; +var init_defaultStsRoleAssumers = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js"() { + init_client(); + import_region_config_resolver4 = __toESM(require_dist_cjs57()); + init_AssumeRoleCommand(); + init_AssumeRoleWithWebIdentityCommand(); + getAccountIdFromAssumedRoleUser = (assumedRoleUser) => { + if (typeof assumedRoleUser?.Arn === "string") { + const arnComponents = assumedRoleUser.Arn.split(":"); + if (arnComponents.length > 4 && arnComponents[4] !== "") { + return arnComponents[4]; + } + } + return void 0; + }; + resolveRegion = async (_region, _parentRegion, credentialProviderLogger, loaderConfig = {}) => { + const region = typeof _region === "function" ? await _region() : _region; + const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion; + let stsDefaultRegion = ""; + const resolvedRegion = region ?? parentRegion ?? (stsDefaultRegion = await (0, import_region_config_resolver4.stsRegionDefaultResolver)(loaderConfig)()); + credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (credential provider clientConfig)`, `${parentRegion} (contextual client)`, `${stsDefaultRegion} (STS default: AWS_REGION, profile region, or us-east-1)`); + return resolvedRegion; + }; + getDefaultRoleAssumer = (stsOptions, STSClient2) => { + let stsClient; + let closureSourceCreds; + return async (sourceCreds, params) => { + closureSourceCreds = sourceCreds; + if (!stsClient) { + const { logger: logger3 = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId } = stsOptions; + const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, { + logger: logger3, + profile + }); + const isCompatibleRequestHandler = !isH2(requestHandler); + stsClient = new STSClient2({ + ...stsOptions, + userAgentAppId, + profile, + credentialDefaultProvider: () => async () => closureSourceCreds, + region: resolvedRegion, + requestHandler: isCompatibleRequestHandler ? requestHandler : void 0, + logger: logger3 + }); + } + const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleCommand(params)); + if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { + throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`); + } + const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser); + const credentials = { + accessKeyId: Credentials.AccessKeyId, + secretAccessKey: Credentials.SecretAccessKey, + sessionToken: Credentials.SessionToken, + expiration: Credentials.Expiration, + ...Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }, + ...accountId && { accountId } + }; + setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i"); + return credentials; + }; + }; + getDefaultRoleAssumerWithWebIdentity = (stsOptions, STSClient2) => { + let stsClient; + return async (params) => { + if (!stsClient) { + const { logger: logger3 = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId } = stsOptions; + const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, { + logger: logger3, + profile + }); + const isCompatibleRequestHandler = !isH2(requestHandler); + stsClient = new STSClient2({ + ...stsOptions, + userAgentAppId, + profile, + region: resolvedRegion, + requestHandler: isCompatibleRequestHandler ? requestHandler : void 0, + logger: logger3 + }); + } + const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params)); + if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { + throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`); + } + const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser); + const credentials = { + accessKeyId: Credentials.AccessKeyId, + secretAccessKey: Credentials.SecretAccessKey, + sessionToken: Credentials.SessionToken, + expiration: Credentials.Expiration, + ...Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }, + ...accountId && { accountId } + }; + if (accountId) { + setCredentialFeature(credentials, "RESOLVED_ACCOUNT_ID", "T"); + } + setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k"); + return credentials; + }; + }; + isH2 = (requestHandler) => { + return requestHandler?.metadata?.handlerProtocol === "h2"; + }; + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultRoleAssumers.js +var getCustomizableStsClientCtor, getDefaultRoleAssumer2, getDefaultRoleAssumerWithWebIdentity2, decorateDefaultCredentialProvider; +var init_defaultRoleAssumers = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultRoleAssumers.js"() { + init_defaultStsRoleAssumers(); + init_STSClient(); + getCustomizableStsClientCtor = (baseCtor, customizations) => { + if (!customizations) + return baseCtor; + else + return class CustomizableSTSClient extends baseCtor { + constructor(config) { + super(config); + for (const customization of customizations) { + this.middlewareStack.use(customization); + } + } + }; + }; + getDefaultRoleAssumer2 = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumer(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins)); + getDefaultRoleAssumerWithWebIdentity2 = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins)); + decorateDefaultCredentialProvider = (provider) => (input) => provider({ + roleAssumer: getDefaultRoleAssumer2(input), + roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity2(input), + ...input + }); + } +}); + +// node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/index.js +var sts_exports = {}; +__export(sts_exports, { + AssumeRole$: () => AssumeRole$, + AssumeRoleCommand: () => AssumeRoleCommand, + AssumeRoleRequest$: () => AssumeRoleRequest$, + AssumeRoleResponse$: () => AssumeRoleResponse$, + AssumeRoleWithWebIdentity$: () => AssumeRoleWithWebIdentity$, + AssumeRoleWithWebIdentityCommand: () => AssumeRoleWithWebIdentityCommand, + AssumeRoleWithWebIdentityRequest$: () => AssumeRoleWithWebIdentityRequest$, + AssumeRoleWithWebIdentityResponse$: () => AssumeRoleWithWebIdentityResponse$, + AssumedRoleUser$: () => AssumedRoleUser$, + Credentials$: () => Credentials$, + ExpiredTokenException: () => ExpiredTokenException2, + ExpiredTokenException$: () => ExpiredTokenException$2, + IDPCommunicationErrorException: () => IDPCommunicationErrorException, + IDPCommunicationErrorException$: () => IDPCommunicationErrorException$, + IDPRejectedClaimException: () => IDPRejectedClaimException, + IDPRejectedClaimException$: () => IDPRejectedClaimException$, + InvalidIdentityTokenException: () => InvalidIdentityTokenException, + InvalidIdentityTokenException$: () => InvalidIdentityTokenException$, + MalformedPolicyDocumentException: () => MalformedPolicyDocumentException, + MalformedPolicyDocumentException$: () => MalformedPolicyDocumentException$, + PackedPolicyTooLargeException: () => PackedPolicyTooLargeException, + PackedPolicyTooLargeException$: () => PackedPolicyTooLargeException$, + PolicyDescriptorType$: () => PolicyDescriptorType$, + ProvidedContext$: () => ProvidedContext$, + RegionDisabledException: () => RegionDisabledException, + RegionDisabledException$: () => RegionDisabledException$, + STS: () => STS, + STSClient: () => STSClient, + STSServiceException: () => STSServiceException, + STSServiceException$: () => STSServiceException$, + Tag$: () => Tag$, + __Client: () => import_smithy_client26.Client, + decorateDefaultCredentialProvider: () => decorateDefaultCredentialProvider, + errorTypeRegistries: () => errorTypeRegistries3, + getDefaultRoleAssumer: () => getDefaultRoleAssumer2, + getDefaultRoleAssumerWithWebIdentity: () => getDefaultRoleAssumerWithWebIdentity2 +}); +var init_sts = __esm({ + "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/index.js"() { + init_STSClient(); + init_STS(); + init_commands3(); + init_schemas_03(); + init_errors3(); + init_models_03(); + init_defaultRoleAssumers(); + init_STSServiceException(); + } +}); + +// node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js +var require_dist_cjs63 = __commonJS({ + "node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js"(exports2) { + "use strict"; + var sharedIniFileLoader = require_dist_cjs41(); + var propertyProvider = require_dist_cjs17(); + var child_process = require("child_process"); + var util = require("util"); + var client = (init_client(), __toCommonJS(client_exports)); + var getValidatedProcessCredentials = (profileName, data2, profiles) => { + if (data2.Version !== 1) { + throw Error(`Profile ${profileName} credential_process did not return Version 1.`); + } + if (data2.AccessKeyId === void 0 || data2.SecretAccessKey === void 0) { + throw Error(`Profile ${profileName} credential_process returned invalid credentials.`); + } + if (data2.Expiration) { + const currentTime = /* @__PURE__ */ new Date(); + const expireTime = new Date(data2.Expiration); + if (expireTime < currentTime) { + throw Error(`Profile ${profileName} credential_process returned expired credentials.`); + } + } + let accountId = data2.AccountId; + if (!accountId && profiles?.[profileName]?.aws_account_id) { + accountId = profiles[profileName].aws_account_id; + } + const credentials = { + accessKeyId: data2.AccessKeyId, + secretAccessKey: data2.SecretAccessKey, + ...data2.SessionToken && { sessionToken: data2.SessionToken }, + ...data2.Expiration && { expiration: new Date(data2.Expiration) }, + ...data2.CredentialScope && { credentialScope: data2.CredentialScope }, + ...accountId && { accountId } + }; + client.setCredentialFeature(credentials, "CREDENTIALS_PROCESS", "w"); + return credentials; + }; + var resolveProcessCredentials = async (profileName, profiles, logger3) => { + const profile = profiles[profileName]; + if (profiles[profileName]) { + const credentialProcess = profile["credential_process"]; + if (credentialProcess !== void 0) { + const execPromise = util.promisify(sharedIniFileLoader.externalDataInterceptor?.getTokenRecord?.().exec ?? child_process.exec); + try { + const { stdout } = await execPromise(credentialProcess); + let data2; + try { + data2 = JSON.parse(stdout.trim()); + } catch { + throw Error(`Profile ${profileName} credential_process returned invalid JSON.`); + } + return getValidatedProcessCredentials(profileName, data2, profiles); + } catch (error2) { + throw new propertyProvider.CredentialsProviderError(error2.message, { logger: logger3 }); + } + } else { + throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger: logger3 }); + } + } else { + throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, { + logger: logger3 + }); + } + }; + var fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => { + init.logger?.debug("@aws-sdk/credential-provider-process - fromProcess"); + const profiles = await sharedIniFileLoader.parseKnownFiles(init); + return resolveProcessCredentials(sharedIniFileLoader.getProfileName({ + profile: init.profile ?? callerClientConfig?.profile + }), profiles, init.logger); + }; + exports2.fromProcess = fromProcess; + } +}); + +// node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js +var require_fromWebToken = __commonJS({ + "node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js"(exports2) { + "use strict"; + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + var desc = Object.getOwnPropertyDescriptor(m4, k4); + if (!desc || ("get" in desc ? !m4.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m4[k4]; + } }; + } + Object.defineProperty(o4, k22, desc); + }) : (function(o4, m4, k4, k22) { + if (k22 === void 0) k22 = k4; + o4[k22] = m4[k4]; + })); + var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o4, v4) { + Object.defineProperty(o4, "default", { enumerable: true, value: v4 }); + }) : function(o4, v4) { + o4["default"] = v4; + }); + var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { + var ownKeys2 = function(o4) { + ownKeys2 = Object.getOwnPropertyNames || function(o5) { + var ar = []; + for (var k4 in o5) if (Object.prototype.hasOwnProperty.call(o5, k4)) ar[ar.length] = k4; + return ar; + }; + return ownKeys2(o4); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k4 = ownKeys2(mod), i4 = 0; i4 < k4.length; i4++) if (k4[i4] !== "default") __createBinding2(result, mod, k4[i4]); + } + __setModuleDefault2(result, mod); + return result; + }; + })(); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.fromWebToken = void 0; + var fromWebToken = (init) => async (awsIdentityProperties) => { + init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken"); + const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init; + let { roleAssumerWithWebIdentity } = init; + if (!roleAssumerWithWebIdentity) { + const { getDefaultRoleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity3 } = await Promise.resolve().then(() => __importStar2((init_sts(), __toCommonJS(sts_exports)))); + roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity3({ + ...init.clientConfig, + credentialProviderLogger: init.logger, + parentClientConfig: { + ...awsIdentityProperties?.callerClientConfig, + ...init.parentClientConfig + } + }, init.clientPlugins); + } + return roleAssumerWithWebIdentity({ + RoleArn: roleArn, + RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`, + WebIdentityToken: webIdentityToken, + ProviderId: providerId, + PolicyArns: policyArns, + Policy: policy, + DurationSeconds: durationSeconds + }); + }; + exports2.fromWebToken = fromWebToken; + } +}); + +// node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js +var require_fromTokenFile = __commonJS({ + "node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.fromTokenFile = void 0; + var client_1 = (init_client(), __toCommonJS(client_exports)); + var property_provider_1 = require_dist_cjs17(); + var shared_ini_file_loader_1 = require_dist_cjs41(); + var fs_1 = require("fs"); + var fromWebToken_1 = require_fromWebToken(); + var ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE"; + var ENV_ROLE_ARN = "AWS_ROLE_ARN"; + var ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME"; + var fromTokenFile = (init = {}) => async (awsIdentityProperties) => { + init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile"); + const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE]; + const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN]; + const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME]; + if (!webIdentityTokenFile || !roleArn) { + throw new property_provider_1.CredentialsProviderError("Web identity configuration not specified", { + logger: init.logger + }); + } + const credentials = await (0, fromWebToken_1.fromWebToken)({ + ...init, + webIdentityToken: shared_ini_file_loader_1.externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ?? (0, fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }), + roleArn, + roleSessionName + })(awsIdentityProperties); + if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) { + (0, client_1.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN", "h"); + } + return credentials; + }; + exports2.fromTokenFile = fromTokenFile; + } +}); + +// node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +var require_dist_cjs64 = __commonJS({ + "node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js"(exports2) { + "use strict"; + var fromTokenFile = require_fromTokenFile(); + var fromWebToken = require_fromWebToken(); + Object.keys(fromTokenFile).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return fromTokenFile[k4]; + } + }); + }); + Object.keys(fromWebToken).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return fromWebToken[k4]; + } + }); + }); + } +}); + +// node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +var require_dist_cjs65 = __commonJS({ + "node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js"(exports2) { + "use strict"; + var sharedIniFileLoader = require_dist_cjs41(); + var propertyProvider = require_dist_cjs17(); + var client = (init_client(), __toCommonJS(client_exports)); + var credentialProviderLogin = require_dist_cjs62(); + var resolveCredentialSource = (credentialSource, profileName, logger3) => { + const sourceProvidersMap = { + EcsContainer: async (options) => { + const { fromHttp } = await Promise.resolve().then(() => __toESM(require_dist_cjs51())); + const { fromContainerMetadata } = await Promise.resolve().then(() => __toESM(require_dist_cjs50())); + logger3?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"); + return async () => propertyProvider.chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider); + }, + Ec2InstanceMetadata: async (options) => { + logger3?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata"); + const { fromInstanceMetadata } = await Promise.resolve().then(() => __toESM(require_dist_cjs50())); + return async () => fromInstanceMetadata(options)().then(setNamedProvider); + }, + Environment: async (options) => { + logger3?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment"); + const { fromEnv } = await Promise.resolve().then(() => __toESM(require_dist_cjs49())); + return async () => fromEnv(options)().then(setNamedProvider); + } + }; + if (credentialSource in sourceProvidersMap) { + return sourceProvidersMap[credentialSource]; + } else { + throw new propertyProvider.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger: logger3 }); + } + }; + var setNamedProvider = (creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p"); + var isAssumeRoleProfile = (arg, { profile = "default", logger: logger3 } = {}) => { + return Boolean(arg) && typeof arg === "object" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && (isAssumeRoleWithSourceProfile(arg, { profile, logger: logger3 }) || isCredentialSourceProfile(arg, { profile, logger: logger3 })); + }; + var isAssumeRoleWithSourceProfile = (arg, { profile, logger: logger3 }) => { + const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined"; + if (withSourceProfile) { + logger3?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`); + } + return withSourceProfile; + }; + var isCredentialSourceProfile = (arg, { profile, logger: logger3 }) => { + const withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined"; + if (withProviderProfile) { + logger3?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`); + } + return withProviderProfile; + }; + var resolveAssumeRoleCredentials = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, resolveProfileData2) => { + options.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)"); + const profileData = profiles[profileName]; + const { source_profile, region } = profileData; + if (!options.roleAssumer) { + const { getDefaultRoleAssumer: getDefaultRoleAssumer3 } = await Promise.resolve().then(() => (init_sts(), sts_exports)); + options.roleAssumer = getDefaultRoleAssumer3({ + ...options.clientConfig, + credentialProviderLogger: options.logger, + parentClientConfig: { + ...callerClientConfig, + ...options?.parentClientConfig, + region: region ?? options?.parentClientConfig?.region ?? callerClientConfig?.region + } + }, options.clientPlugins); + } + if (source_profile && source_profile in visitedProfiles) { + throw new propertyProvider.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${sharedIniFileLoader.getProfileName(options)}. Profiles visited: ` + Object.keys(visitedProfiles).join(", "), { logger: options.logger }); + } + options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`); + const sourceCredsProvider = source_profile ? resolveProfileData2(source_profile, profiles, options, callerClientConfig, { + ...visitedProfiles, + [source_profile]: true + }, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {})) : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))(); + if (isCredentialSourceWithoutRoleArn(profileData)) { + return sourceCredsProvider.then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o")); + } else { + const params = { + RoleArn: profileData.role_arn, + RoleSessionName: profileData.role_session_name || `aws-sdk-js-${Date.now()}`, + ExternalId: profileData.external_id, + DurationSeconds: parseInt(profileData.duration_seconds || "3600", 10) + }; + const { mfa_serial } = profileData; + if (mfa_serial) { + if (!options.mfaCodeProvider) { + throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, { logger: options.logger, tryNextLink: false }); + } + params.SerialNumber = mfa_serial; + params.TokenCode = await options.mfaCodeProvider(mfa_serial); + } + const sourceCreds = await sourceCredsProvider; + return options.roleAssumer(sourceCreds, params).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o")); + } + }; + var isCredentialSourceWithoutRoleArn = (section) => { + return !section.role_arn && !!section.credential_source; + }; + var isLoginProfile = (data2) => { + return Boolean(data2 && data2.login_session); + }; + var resolveLoginCredentials = async (profileName, options, callerClientConfig) => { + const credentials = await credentialProviderLogin.fromLoginCredentials({ + ...options, + profile: profileName + })({ callerClientConfig }); + return client.setCredentialFeature(credentials, "CREDENTIALS_PROFILE_LOGIN", "AC"); + }; + var isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string"; + var resolveProcessCredentials = async (options, profile) => Promise.resolve().then(() => __toESM(require_dist_cjs63())).then(({ fromProcess }) => fromProcess({ + ...options, + profile + })().then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_PROCESS", "v"))); + var resolveSsoCredentials = async (profile, profileData, options = {}, callerClientConfig) => { + const { fromSSO } = await Promise.resolve().then(() => __toESM(require_dist_cjs61())); + return fromSSO({ + profile, + logger: options.logger, + parentClientConfig: options.parentClientConfig, + clientConfig: options.clientConfig + })({ + callerClientConfig + }).then((creds) => { + if (profileData.sso_session) { + return client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO", "r"); + } else { + return client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO_LEGACY", "t"); + } + }); + }; + var isSsoProfile = (arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string"); + var isStaticCredsProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.aws_access_key_id === "string" && typeof arg.aws_secret_access_key === "string" && ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1 && ["undefined", "string"].indexOf(typeof arg.aws_account_id) > -1; + var resolveStaticCredentials = async (profile, options) => { + options?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials"); + const credentials = { + accessKeyId: profile.aws_access_key_id, + secretAccessKey: profile.aws_secret_access_key, + sessionToken: profile.aws_session_token, + ...profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope }, + ...profile.aws_account_id && { accountId: profile.aws_account_id } + }; + return client.setCredentialFeature(credentials, "CREDENTIALS_PROFILE", "n"); + }; + var isWebIdentityProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1; + var resolveWebIdentityCredentials = async (profile, options, callerClientConfig) => Promise.resolve().then(() => __toESM(require_dist_cjs64())).then(({ fromTokenFile }) => fromTokenFile({ + webIdentityTokenFile: profile.web_identity_token_file, + roleArn: profile.role_arn, + roleSessionName: profile.role_session_name, + roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity, + logger: options.logger, + parentClientConfig: options.parentClientConfig + })({ + callerClientConfig + }).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q"))); + var resolveProfileData = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => { + const data2 = profiles[profileName]; + if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data2)) { + return resolveStaticCredentials(data2, options); + } + if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data2, { profile: profileName, logger: options.logger })) { + return resolveAssumeRoleCredentials(profileName, profiles, options, callerClientConfig, visitedProfiles, resolveProfileData); + } + if (isStaticCredsProfile(data2)) { + return resolveStaticCredentials(data2, options); + } + if (isWebIdentityProfile(data2)) { + return resolveWebIdentityCredentials(data2, options, callerClientConfig); + } + if (isProcessProfile(data2)) { + return resolveProcessCredentials(options, profileName); + } + if (isSsoProfile(data2)) { + return await resolveSsoCredentials(profileName, data2, options, callerClientConfig); + } + if (isLoginProfile(data2)) { + return resolveLoginCredentials(profileName, options, callerClientConfig); + } + throw new propertyProvider.CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger }); + }; + var fromIni = (init = {}) => async ({ callerClientConfig } = {}) => { + init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni"); + const profiles = await sharedIniFileLoader.parseKnownFiles(init); + return resolveProfileData(sharedIniFileLoader.getProfileName({ + profile: init.profile ?? callerClientConfig?.profile + }), profiles, init, callerClientConfig); + }; + exports2.fromIni = fromIni; + } +}); + +// node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +var require_dist_cjs66 = __commonJS({ + "node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js"(exports2) { + "use strict"; + var credentialProviderEnv = require_dist_cjs49(); + var propertyProvider = require_dist_cjs17(); + var sharedIniFileLoader = require_dist_cjs41(); + var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; + var remoteProvider = async (init) => { + const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await Promise.resolve().then(() => __toESM(require_dist_cjs50())); + if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) { + init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata"); + const { fromHttp } = await Promise.resolve().then(() => __toESM(require_dist_cjs51())); + return propertyProvider.chain(fromHttp(init), fromContainerMetadata(init)); + } + if (process.env[ENV_IMDS_DISABLED] && process.env[ENV_IMDS_DISABLED] !== "false") { + return async () => { + throw new propertyProvider.CredentialsProviderError("EC2 Instance Metadata Service access disabled", { logger: init.logger }); + }; + } + init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"); + return fromInstanceMetadata(init); + }; + function memoizeChain(providers, treatAsExpired) { + const chain = internalCreateChain(providers); + let activeLock; + let passiveLock; + let credentials; + const provider = async (options) => { + if (options?.forceRefresh) { + return await chain(options); + } + if (credentials?.expiration) { + if (credentials?.expiration?.getTime() < Date.now()) { + credentials = void 0; + } + } + if (activeLock) { + await activeLock; + } else if (!credentials || treatAsExpired?.(credentials)) { + if (credentials) { + if (!passiveLock) { + passiveLock = chain(options).then((c4) => { + credentials = c4; + }).finally(() => { + passiveLock = void 0; + }); + } + } else { + activeLock = chain(options).then((c4) => { + credentials = c4; + }).finally(() => { + activeLock = void 0; + }); + return provider(options); + } + } + return credentials; + }; + return provider; + } + var internalCreateChain = (providers) => async (awsIdentityProperties) => { + let lastProviderError; + for (const provider of providers) { + try { + return await provider(awsIdentityProperties); + } catch (err) { + lastProviderError = err; + if (err?.tryNextLink) { + continue; + } + throw err; + } + } + throw lastProviderError; + }; + var multipleCredentialSourceWarningEmitted = false; + var defaultProvider = (init = {}) => memoizeChain([ + async () => { + const profile = init.profile ?? process.env[sharedIniFileLoader.ENV_PROFILE]; + if (profile) { + const envStaticCredentialsAreSet = process.env[credentialProviderEnv.ENV_KEY] && process.env[credentialProviderEnv.ENV_SECRET]; + if (envStaticCredentialsAreSet) { + if (!multipleCredentialSourceWarningEmitted) { + const warnFn = init.logger?.warn && init.logger?.constructor?.name !== "NoOpLogger" ? init.logger.warn.bind(init.logger) : console.warn; + warnFn(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING: + Multiple credential sources detected: + Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set. + This SDK will proceed with the AWS_PROFILE value. + + However, a future version may change this behavior to prefer the ENV static credentials. + Please ensure that your environment only sets either the AWS_PROFILE or the + AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair. +`); + multipleCredentialSourceWarningEmitted = true; + } + } + throw new propertyProvider.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.", { + logger: init.logger, + tryNextLink: true + }); + } + init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"); + return credentialProviderEnv.fromEnv(init)(); + }, + async (awsIdentityProperties) => { + init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO"); + const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init; + if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { + throw new propertyProvider.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).", { logger: init.logger }); + } + const { fromSSO } = await Promise.resolve().then(() => __toESM(require_dist_cjs61())); + return fromSSO(init)(awsIdentityProperties); + }, + async (awsIdentityProperties) => { + init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni"); + const { fromIni } = await Promise.resolve().then(() => __toESM(require_dist_cjs65())); + return fromIni(init)(awsIdentityProperties); + }, + async (awsIdentityProperties) => { + init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess"); + const { fromProcess } = await Promise.resolve().then(() => __toESM(require_dist_cjs63())); + return fromProcess(init)(awsIdentityProperties); + }, + async (awsIdentityProperties) => { + init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile"); + const { fromTokenFile } = await Promise.resolve().then(() => __toESM(require_dist_cjs64())); + return fromTokenFile(init)(awsIdentityProperties); + }, + async () => { + init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"); + return (await remoteProvider(init))(); + }, + async () => { + throw new propertyProvider.CredentialsProviderError("Could not load credentials from any providers", { + tryNextLink: false, + logger: init.logger + }); + } + ], credentialsTreatedAsExpired); + var credentialsWillNeedRefresh = (credentials) => credentials?.expiration !== void 0; + var credentialsTreatedAsExpired = (credentials) => credentials?.expiration !== void 0 && credentials.expiration.getTime() - Date.now() < 3e5; + exports2.credentialsTreatedAsExpired = credentialsTreatedAsExpired; + exports2.credentialsWillNeedRefresh = credentialsWillNeedRefresh; + exports2.defaultProvider = defaultProvider; + } +}); + +// node_modules/@aws-sdk/middleware-bucket-endpoint/dist-cjs/index.js +var require_dist_cjs67 = __commonJS({ + "node_modules/@aws-sdk/middleware-bucket-endpoint/dist-cjs/index.js"(exports2) { + "use strict"; + var utilConfigProvider = require_dist_cjs31(); + var utilArnParser = require_dist_cjs30(); + var protocolHttp = require_dist_cjs2(); + var NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME = "AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS"; + var NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME = "s3_disable_multiregion_access_points"; + var NODE_DISABLE_MULTIREGION_ACCESS_POINT_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME, utilConfigProvider.SelectorType.ENV), + configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME, utilConfigProvider.SelectorType.CONFIG), + default: false + }; + var NODE_USE_ARN_REGION_ENV_NAME = "AWS_S3_USE_ARN_REGION"; + var NODE_USE_ARN_REGION_INI_NAME = "s3_use_arn_region"; + var NODE_USE_ARN_REGION_CONFIG_OPTIONS = { + environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, NODE_USE_ARN_REGION_ENV_NAME, utilConfigProvider.SelectorType.ENV), + configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, NODE_USE_ARN_REGION_INI_NAME, utilConfigProvider.SelectorType.CONFIG), + default: void 0 + }; + var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; + var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; + var DOTS_PATTERN = /\.\./; + var DOT_PATTERN = /\./; + var S3_HOSTNAME_PATTERN = /^(.+\.)?s3(-fips)?(\.dualstack)?[.-]([a-z0-9-]+)\./; + var S3_US_EAST_1_ALTNAME_PATTERN = /^s3(-external-1)?\.amazonaws\.com$/; + var AWS_PARTITION_SUFFIX = "amazonaws.com"; + var isBucketNameOptions = (options) => typeof options.bucketName === "string"; + var isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); + var getRegionalSuffix = (hostname) => { + const parts = hostname.match(S3_HOSTNAME_PATTERN); + return [parts[4], hostname.replace(new RegExp(`^${parts[0]}`), "")]; + }; + var getSuffix = (hostname) => S3_US_EAST_1_ALTNAME_PATTERN.test(hostname) ? ["us-east-1", AWS_PARTITION_SUFFIX] : getRegionalSuffix(hostname); + var getSuffixForArnEndpoint = (hostname) => S3_US_EAST_1_ALTNAME_PATTERN.test(hostname) ? [hostname.replace(`.${AWS_PARTITION_SUFFIX}`, ""), AWS_PARTITION_SUFFIX] : getRegionalSuffix(hostname); + var validateArnEndpointOptions = (options) => { + if (options.pathStyleEndpoint) { + throw new Error("Path-style S3 endpoint is not supported when bucket is an ARN"); + } + if (options.accelerateEndpoint) { + throw new Error("Accelerate endpoint is not supported when bucket is an ARN"); + } + if (!options.tlsCompatible) { + throw new Error("HTTPS is required when bucket is an ARN"); + } + }; + var validateService = (service) => { + if (service !== "s3" && service !== "s3-outposts" && service !== "s3-object-lambda") { + throw new Error("Expect 's3' or 's3-outposts' or 's3-object-lambda' in ARN service component"); + } + }; + var validateS3Service = (service) => { + if (service !== "s3") { + throw new Error("Expect 's3' in Accesspoint ARN service component"); + } + }; + var validateOutpostService = (service) => { + if (service !== "s3-outposts") { + throw new Error("Expect 's3-posts' in Outpost ARN service component"); + } + }; + var validatePartition = (partition, options) => { + if (partition !== options.clientPartition) { + throw new Error(`Partition in ARN is incompatible, got "${partition}" but expected "${options.clientPartition}"`); + } + }; + var validateRegion = (region, options) => { + }; + var validateRegionalClient = (region) => { + if (["s3-external-1", "aws-global"].includes(region)) { + throw new Error(`Client region ${region} is not regional`); + } + }; + var validateAccountId = (accountId) => { + if (!/[0-9]{12}/.exec(accountId)) { + throw new Error("Access point ARN accountID does not match regex '[0-9]{12}'"); + } + }; + var validateDNSHostLabel = (label, options = { tlsCompatible: true }) => { + if (label.length >= 64 || !/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(label) || /(\d+\.){3}\d+/.test(label) || /[.-]{2}/.test(label) || options?.tlsCompatible && DOT_PATTERN.test(label)) { + throw new Error(`Invalid DNS label ${label}`); + } + }; + var validateCustomEndpoint = (options) => { + if (options.isCustomEndpoint) { + if (options.dualstackEndpoint) + throw new Error("Dualstack endpoint is not supported with custom endpoint"); + if (options.accelerateEndpoint) + throw new Error("Accelerate endpoint is not supported with custom endpoint"); + } + }; + var getArnResources = (resource) => { + const delimiter = resource.includes(":") ? ":" : "/"; + const [resourceType, ...rest] = resource.split(delimiter); + if (resourceType === "accesspoint") { + if (rest.length !== 1 || rest[0] === "") { + throw new Error(`Access Point ARN should have one resource accesspoint${delimiter}{accesspointname}`); + } + return { accesspointName: rest[0] }; + } else if (resourceType === "outpost") { + if (!rest[0] || rest[1] !== "accesspoint" || !rest[2] || rest.length !== 3) { + throw new Error(`Outpost ARN should have resource outpost${delimiter}{outpostId}${delimiter}accesspoint${delimiter}{accesspointName}`); + } + const [outpostId, _, accesspointName] = rest; + return { outpostId, accesspointName }; + } else { + throw new Error(`ARN resource should begin with 'accesspoint${delimiter}' or 'outpost${delimiter}'`); + } + }; + var validateNoDualstack = (dualstackEndpoint) => { + }; + var validateNoFIPS = (useFipsEndpoint) => { + if (useFipsEndpoint) + throw new Error(`FIPS region is not supported with Outpost.`); + }; + var validateMrapAlias = (name) => { + try { + name.split(".").forEach((label) => { + validateDNSHostLabel(label); + }); + } catch (e4) { + throw new Error(`"${name}" is not a DNS compatible name.`); + } + }; + var bucketHostname = (options) => { + validateCustomEndpoint(options); + return isBucketNameOptions(options) ? getEndpointFromBucketName(options) : getEndpointFromArn(options); + }; + var getEndpointFromBucketName = ({ accelerateEndpoint = false, clientRegion: region, baseHostname, bucketName, dualstackEndpoint = false, fipsEndpoint = false, pathStyleEndpoint = false, tlsCompatible = true, isCustomEndpoint = false }) => { + const [clientRegion, hostnameSuffix] = isCustomEndpoint ? [region, baseHostname] : getSuffix(baseHostname); + if (pathStyleEndpoint || !isDnsCompatibleBucketName(bucketName) || tlsCompatible && DOT_PATTERN.test(bucketName)) { + return { + bucketEndpoint: false, + hostname: dualstackEndpoint ? `s3.dualstack.${clientRegion}.${hostnameSuffix}` : baseHostname + }; + } + if (accelerateEndpoint) { + baseHostname = `s3-accelerate${dualstackEndpoint ? ".dualstack" : ""}.${hostnameSuffix}`; + } else if (dualstackEndpoint) { + baseHostname = `s3.dualstack.${clientRegion}.${hostnameSuffix}`; + } + return { + bucketEndpoint: true, + hostname: `${bucketName}.${baseHostname}` + }; + }; + var getEndpointFromArn = (options) => { + const { isCustomEndpoint, baseHostname, clientRegion } = options; + const hostnameSuffix = isCustomEndpoint ? baseHostname : getSuffixForArnEndpoint(baseHostname)[1]; + const { pathStyleEndpoint, accelerateEndpoint = false, fipsEndpoint = false, tlsCompatible = true, bucketName, clientPartition = "aws" } = options; + validateArnEndpointOptions({ pathStyleEndpoint, accelerateEndpoint, tlsCompatible }); + const { service, partition, accountId, region, resource } = bucketName; + validateService(service); + validatePartition(partition, { clientPartition }); + validateAccountId(accountId); + const { accesspointName, outpostId } = getArnResources(resource); + if (service === "s3-object-lambda") { + return getEndpointFromObjectLambdaArn({ ...options, tlsCompatible, bucketName, accesspointName, hostnameSuffix }); + } + if (region === "") { + return getEndpointFromMRAPArn({ ...options, mrapAlias: accesspointName, hostnameSuffix }); + } + if (outpostId) { + return getEndpointFromOutpostArn({ ...options, clientRegion, outpostId, accesspointName, hostnameSuffix }); + } + return getEndpointFromAccessPointArn({ ...options, clientRegion, accesspointName, hostnameSuffix }); + }; + var getEndpointFromObjectLambdaArn = ({ dualstackEndpoint = false, fipsEndpoint = false, tlsCompatible = true, useArnRegion, clientRegion, clientSigningRegion = clientRegion, accesspointName, bucketName, hostnameSuffix }) => { + const { accountId, region, service } = bucketName; + validateRegionalClient(clientRegion); + const DNSHostLabel = `${accesspointName}-${accountId}`; + validateDNSHostLabel(DNSHostLabel, { tlsCompatible }); + const endpointRegion = useArnRegion ? region : clientRegion; + const signingRegion = useArnRegion ? region : clientSigningRegion; + return { + bucketEndpoint: true, + hostname: `${DNSHostLabel}.${service}${fipsEndpoint ? "-fips" : ""}.${endpointRegion}.${hostnameSuffix}`, + signingRegion, + signingService: service + }; + }; + var getEndpointFromMRAPArn = ({ disableMultiregionAccessPoints, dualstackEndpoint = false, isCustomEndpoint, mrapAlias, hostnameSuffix }) => { + if (disableMultiregionAccessPoints === true) { + throw new Error("SDK is attempting to use a MRAP ARN. Please enable to feature."); + } + validateMrapAlias(mrapAlias); + return { + bucketEndpoint: true, + hostname: `${mrapAlias}${isCustomEndpoint ? "" : `.accesspoint.s3-global`}.${hostnameSuffix}`, + signingRegion: "*" + }; + }; + var getEndpointFromOutpostArn = ({ useArnRegion, clientRegion, clientSigningRegion = clientRegion, bucketName, outpostId, dualstackEndpoint = false, fipsEndpoint = false, tlsCompatible = true, accesspointName, isCustomEndpoint, hostnameSuffix }) => { + validateRegionalClient(clientRegion); + const DNSHostLabel = `${accesspointName}-${bucketName.accountId}`; + validateDNSHostLabel(DNSHostLabel, { tlsCompatible }); + const endpointRegion = useArnRegion ? bucketName.region : clientRegion; + const signingRegion = useArnRegion ? bucketName.region : clientSigningRegion; + validateOutpostService(bucketName.service); + validateDNSHostLabel(outpostId, { tlsCompatible }); + validateNoFIPS(fipsEndpoint); + const hostnamePrefix = `${DNSHostLabel}.${outpostId}`; + return { + bucketEndpoint: true, + hostname: `${hostnamePrefix}${isCustomEndpoint ? "" : `.s3-outposts.${endpointRegion}`}.${hostnameSuffix}`, + signingRegion, + signingService: "s3-outposts" + }; + }; + var getEndpointFromAccessPointArn = ({ useArnRegion, clientRegion, clientSigningRegion = clientRegion, bucketName, dualstackEndpoint = false, fipsEndpoint = false, tlsCompatible = true, accesspointName, isCustomEndpoint, hostnameSuffix }) => { + validateRegionalClient(clientRegion); + const hostnamePrefix = `${accesspointName}-${bucketName.accountId}`; + validateDNSHostLabel(hostnamePrefix, { tlsCompatible }); + const endpointRegion = useArnRegion ? bucketName.region : clientRegion; + const signingRegion = useArnRegion ? bucketName.region : clientSigningRegion; + validateS3Service(bucketName.service); + return { + bucketEndpoint: true, + hostname: `${hostnamePrefix}${isCustomEndpoint ? "" : `.s3-accesspoint${fipsEndpoint ? "-fips" : ""}${dualstackEndpoint ? ".dualstack" : ""}.${endpointRegion}`}.${hostnameSuffix}`, + signingRegion + }; + }; + var bucketEndpointMiddleware = (options) => (next, context) => async (args2) => { + const { Bucket: bucketName } = args2.input; + let replaceBucketInPath = options.bucketEndpoint; + const request = args2.request; + if (protocolHttp.HttpRequest.isInstance(request)) { + if (options.bucketEndpoint) { + request.hostname = bucketName; + } else if (utilArnParser.validate(bucketName)) { + const bucketArn = utilArnParser.parse(bucketName); + const clientRegion = await options.region(); + const useDualstackEndpoint = await options.useDualstackEndpoint(); + const useFipsEndpoint = await options.useFipsEndpoint(); + const { partition, signingRegion = clientRegion } = await options.regionInfoProvider(clientRegion, { useDualstackEndpoint, useFipsEndpoint }) || {}; + const useArnRegion = await options.useArnRegion(); + const { hostname, bucketEndpoint, signingRegion: modifiedSigningRegion, signingService } = bucketHostname({ + bucketName: bucketArn, + baseHostname: request.hostname, + accelerateEndpoint: options.useAccelerateEndpoint, + dualstackEndpoint: useDualstackEndpoint, + fipsEndpoint: useFipsEndpoint, + pathStyleEndpoint: options.forcePathStyle, + tlsCompatible: request.protocol === "https:", + useArnRegion, + clientPartition: partition, + clientSigningRegion: signingRegion, + clientRegion, + isCustomEndpoint: options.isCustomEndpoint, + disableMultiregionAccessPoints: await options.disableMultiregionAccessPoints() + }); + if (modifiedSigningRegion && modifiedSigningRegion !== signingRegion) { + context["signing_region"] = modifiedSigningRegion; + } + if (signingService && signingService !== "s3") { + context["signing_service"] = signingService; + } + request.hostname = hostname; + replaceBucketInPath = bucketEndpoint; + } else { + const clientRegion = await options.region(); + const dualstackEndpoint = await options.useDualstackEndpoint(); + const fipsEndpoint = await options.useFipsEndpoint(); + const { hostname, bucketEndpoint } = bucketHostname({ + bucketName, + clientRegion, + baseHostname: request.hostname, + accelerateEndpoint: options.useAccelerateEndpoint, + dualstackEndpoint, + fipsEndpoint, + pathStyleEndpoint: options.forcePathStyle, + tlsCompatible: request.protocol === "https:", + isCustomEndpoint: options.isCustomEndpoint + }); + request.hostname = hostname; + replaceBucketInPath = bucketEndpoint; + } + if (replaceBucketInPath) { + request.path = request.path.replace(/^(\/)?[^\/]+/, ""); + if (request.path === "") { + request.path = "/"; + } + } + } + return next({ ...args2, request }); + }; + var bucketEndpointMiddlewareOptions = { + tags: ["BUCKET_ENDPOINT"], + name: "bucketEndpointMiddleware", + relation: "before", + toMiddleware: "hostHeaderMiddleware", + override: true + }; + var getBucketEndpointPlugin = (options) => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(bucketEndpointMiddleware(options), bucketEndpointMiddlewareOptions); + } + }); + function resolveBucketEndpointConfig(input) { + const { bucketEndpoint = false, forcePathStyle = false, useAccelerateEndpoint = false, useArnRegion, disableMultiregionAccessPoints = false } = input; + return Object.assign(input, { + bucketEndpoint, + forcePathStyle, + useAccelerateEndpoint, + useArnRegion: typeof useArnRegion === "function" ? useArnRegion : () => Promise.resolve(useArnRegion), + disableMultiregionAccessPoints: typeof disableMultiregionAccessPoints === "function" ? disableMultiregionAccessPoints : () => Promise.resolve(disableMultiregionAccessPoints) + }); + } + exports2.NODE_DISABLE_MULTIREGION_ACCESS_POINT_CONFIG_OPTIONS = NODE_DISABLE_MULTIREGION_ACCESS_POINT_CONFIG_OPTIONS; + exports2.NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME = NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME; + exports2.NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME = NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME; + exports2.NODE_USE_ARN_REGION_CONFIG_OPTIONS = NODE_USE_ARN_REGION_CONFIG_OPTIONS; + exports2.NODE_USE_ARN_REGION_ENV_NAME = NODE_USE_ARN_REGION_ENV_NAME; + exports2.NODE_USE_ARN_REGION_INI_NAME = NODE_USE_ARN_REGION_INI_NAME; + exports2.bucketEndpointMiddleware = bucketEndpointMiddleware; + exports2.bucketEndpointMiddlewareOptions = bucketEndpointMiddlewareOptions; + exports2.bucketHostname = bucketHostname; + exports2.getArnResources = getArnResources; + exports2.getBucketEndpointPlugin = getBucketEndpointPlugin; + exports2.getSuffixForArnEndpoint = getSuffixForArnEndpoint; + exports2.resolveBucketEndpointConfig = resolveBucketEndpointConfig; + exports2.validateAccountId = validateAccountId; + exports2.validateDNSHostLabel = validateDNSHostLabel; + exports2.validateNoDualstack = validateNoDualstack; + exports2.validateNoFIPS = validateNoFIPS; + exports2.validateOutpostService = validateOutpostService; + exports2.validatePartition = validatePartition; + exports2.validateRegion = validateRegion; + } +}); + +// node_modules/@smithy/eventstream-codec/dist-cjs/index.js +var require_dist_cjs68 = __commonJS({ + "node_modules/@smithy/eventstream-codec/dist-cjs/index.js"(exports2) { + "use strict"; + var crc32 = require_main4(); + var utilHexEncoding = require_dist_cjs14(); + var Int64 = class _Int64 { + bytes; + constructor(bytes) { + this.bytes = bytes; + if (bytes.byteLength !== 8) { + throw new Error("Int64 buffers must be exactly 8 bytes"); + } + } + static fromNumber(number) { + if (number > 9223372036854776e3 || number < -9223372036854776e3) { + throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`); + } + const bytes = new Uint8Array(8); + for (let i4 = 7, remaining = Math.abs(Math.round(number)); i4 > -1 && remaining > 0; i4--, remaining /= 256) { + bytes[i4] = remaining; + } + if (number < 0) { + negate(bytes); + } + return new _Int64(bytes); + } + valueOf() { + const bytes = this.bytes.slice(0); + const negative = bytes[0] & 128; + if (negative) { + negate(bytes); + } + return parseInt(utilHexEncoding.toHex(bytes), 16) * (negative ? -1 : 1); + } + toString() { + return String(this.valueOf()); + } + }; + function negate(bytes) { + for (let i4 = 0; i4 < 8; i4++) { + bytes[i4] ^= 255; + } + for (let i4 = 7; i4 > -1; i4--) { + bytes[i4]++; + if (bytes[i4] !== 0) + break; + } + } + var HeaderMarshaller = class { + toUtf8; + fromUtf8; + constructor(toUtf810, fromUtf87) { + this.toUtf8 = toUtf810; + this.fromUtf8 = fromUtf87; + } + format(headers) { + const chunks = []; + for (const headerName of Object.keys(headers)) { + const bytes = this.fromUtf8(headerName); + chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName])); + } + const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0)); + let position = 0; + for (const chunk of chunks) { + out.set(chunk, position); + position += chunk.byteLength; + } + return out; + } + formatHeaderValue(header) { + switch (header.type) { + case "boolean": + return Uint8Array.from([header.value ? 0 : 1]); + case "byte": + return Uint8Array.from([2, header.value]); + case "short": + const shortView = new DataView(new ArrayBuffer(3)); + shortView.setUint8(0, 3); + shortView.setInt16(1, header.value, false); + return new Uint8Array(shortView.buffer); + case "integer": + const intView = new DataView(new ArrayBuffer(5)); + intView.setUint8(0, 4); + intView.setInt32(1, header.value, false); + return new Uint8Array(intView.buffer); + case "long": + const longBytes = new Uint8Array(9); + longBytes[0] = 5; + longBytes.set(header.value.bytes, 1); + return longBytes; + case "binary": + const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength)); + binView.setUint8(0, 6); + binView.setUint16(1, header.value.byteLength, false); + const binBytes = new Uint8Array(binView.buffer); + binBytes.set(header.value, 3); + return binBytes; + case "string": + const utf8Bytes = this.fromUtf8(header.value); + const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); + strView.setUint8(0, 7); + strView.setUint16(1, utf8Bytes.byteLength, false); + const strBytes = new Uint8Array(strView.buffer); + strBytes.set(utf8Bytes, 3); + return strBytes; + case "timestamp": + const tsBytes = new Uint8Array(9); + tsBytes[0] = 8; + tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1); + return tsBytes; + case "uuid": + if (!UUID_PATTERN.test(header.value)) { + throw new Error(`Invalid UUID received: ${header.value}`); + } + const uuidBytes = new Uint8Array(17); + uuidBytes[0] = 9; + uuidBytes.set(utilHexEncoding.fromHex(header.value.replace(/\-/g, "")), 1); + return uuidBytes; + } + } + parse(headers) { + const out = {}; + let position = 0; + while (position < headers.byteLength) { + const nameLength = headers.getUint8(position++); + const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength)); + position += nameLength; + switch (headers.getUint8(position++)) { + case 0: + out[name] = { + type: BOOLEAN_TAG, + value: true + }; + break; + case 1: + out[name] = { + type: BOOLEAN_TAG, + value: false + }; + break; + case 2: + out[name] = { + type: BYTE_TAG, + value: headers.getInt8(position++) + }; + break; + case 3: + out[name] = { + type: SHORT_TAG, + value: headers.getInt16(position, false) + }; + position += 2; + break; + case 4: + out[name] = { + type: INT_TAG, + value: headers.getInt32(position, false) + }; + position += 4; + break; + case 5: + out[name] = { + type: LONG_TAG, + value: new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)) + }; + position += 8; + break; + case 6: + const binaryLength = headers.getUint16(position, false); + position += 2; + out[name] = { + type: BINARY_TAG, + value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength) + }; + position += binaryLength; + break; + case 7: + const stringLength = headers.getUint16(position, false); + position += 2; + out[name] = { + type: STRING_TAG, + value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)) + }; + position += stringLength; + break; + case 8: + out[name] = { + type: TIMESTAMP_TAG, + value: new Date(new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()) + }; + position += 8; + break; + case 9: + const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16); + position += 16; + out[name] = { + type: UUID_TAG, + value: `${utilHexEncoding.toHex(uuidBytes.subarray(0, 4))}-${utilHexEncoding.toHex(uuidBytes.subarray(4, 6))}-${utilHexEncoding.toHex(uuidBytes.subarray(6, 8))}-${utilHexEncoding.toHex(uuidBytes.subarray(8, 10))}-${utilHexEncoding.toHex(uuidBytes.subarray(10))}` + }; + break; + default: + throw new Error(`Unrecognized header type tag`); + } + } + return out; + } + }; + var BOOLEAN_TAG = "boolean"; + var BYTE_TAG = "byte"; + var SHORT_TAG = "short"; + var INT_TAG = "integer"; + var LONG_TAG = "long"; + var BINARY_TAG = "binary"; + var STRING_TAG = "string"; + var TIMESTAMP_TAG = "timestamp"; + var UUID_TAG = "uuid"; + var UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; + var PRELUDE_MEMBER_LENGTH = 4; + var PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2; + var CHECKSUM_LENGTH = 4; + var MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2; + function splitMessage({ byteLength, byteOffset, buffer }) { + if (byteLength < MINIMUM_MESSAGE_LENGTH) { + throw new Error("Provided message too short to accommodate event stream message overhead"); + } + const view = new DataView(buffer, byteOffset, byteLength); + const messageLength = view.getUint32(0, false); + if (byteLength !== messageLength) { + throw new Error("Reported message length does not match received message length"); + } + const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false); + const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false); + const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false); + const checksummer = new crc32.Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH)); + if (expectedPreludeChecksum !== checksummer.digest()) { + throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`); + } + checksummer.update(new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH))); + if (expectedMessageChecksum !== checksummer.digest()) { + throw new Error(`The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}`); + } + return { + headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength), + body: new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)) + }; + } + var EventStreamCodec = class { + headerMarshaller; + messageBuffer; + isEndOfStream; + constructor(toUtf810, fromUtf87) { + this.headerMarshaller = new HeaderMarshaller(toUtf810, fromUtf87); + this.messageBuffer = []; + this.isEndOfStream = false; + } + feed(message2) { + this.messageBuffer.push(this.decode(message2)); + } + endOfStream() { + this.isEndOfStream = true; + } + getMessage() { + const message2 = this.messageBuffer.pop(); + const isEndOfStream = this.isEndOfStream; + return { + getMessage() { + return message2; + }, + isEndOfStream() { + return isEndOfStream; + } + }; + } + getAvailableMessages() { + const messages = this.messageBuffer; + this.messageBuffer = []; + const isEndOfStream = this.isEndOfStream; + return { + getMessages() { + return messages; + }, + isEndOfStream() { + return isEndOfStream; + } + }; + } + encode({ headers: rawHeaders, body }) { + const headers = this.headerMarshaller.format(rawHeaders); + const length = headers.byteLength + body.byteLength + 16; + const out = new Uint8Array(length); + const view = new DataView(out.buffer, out.byteOffset, out.byteLength); + const checksum = new crc32.Crc32(); + view.setUint32(0, length, false); + view.setUint32(4, headers.byteLength, false); + view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false); + out.set(headers, 12); + out.set(body, headers.byteLength + 12); + view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false); + return out; + } + decode(message2) { + const { headers, body } = splitMessage(message2); + return { headers: this.headerMarshaller.parse(headers), body }; + } + formatHeaders(rawHeaders) { + return this.headerMarshaller.format(rawHeaders); + } + }; + var MessageDecoderStream = class { + options; + constructor(options) { + this.options = options; + } + [Symbol.asyncIterator]() { + return this.asyncIterator(); + } + async *asyncIterator() { + for await (const bytes of this.options.inputStream) { + const decoded = this.options.decoder.decode(bytes); + yield decoded; + } + } + }; + var MessageEncoderStream = class { + options; + constructor(options) { + this.options = options; + } + [Symbol.asyncIterator]() { + return this.asyncIterator(); + } + async *asyncIterator() { + for await (const msg of this.options.messageStream) { + const encoded = this.options.encoder.encode(msg); + yield encoded; + } + if (this.options.includeEndFrame) { + yield new Uint8Array(0); + } + } + }; + var SmithyMessageDecoderStream = class { + options; + constructor(options) { + this.options = options; + } + [Symbol.asyncIterator]() { + return this.asyncIterator(); + } + async *asyncIterator() { + for await (const message2 of this.options.messageStream) { + const deserialized = await this.options.deserializer(message2); + if (deserialized === void 0) + continue; + yield deserialized; + } + } + }; + var SmithyMessageEncoderStream = class { + options; + constructor(options) { + this.options = options; + } + [Symbol.asyncIterator]() { + return this.asyncIterator(); + } + async *asyncIterator() { + for await (const chunk of this.options.inputStream) { + const payloadBuf = this.options.serializer(chunk); + yield payloadBuf; + } + } + }; + exports2.EventStreamCodec = EventStreamCodec; + exports2.HeaderMarshaller = HeaderMarshaller; + exports2.Int64 = Int64; + exports2.MessageDecoderStream = MessageDecoderStream; + exports2.MessageEncoderStream = MessageEncoderStream; + exports2.SmithyMessageDecoderStream = SmithyMessageDecoderStream; + exports2.SmithyMessageEncoderStream = SmithyMessageEncoderStream; + } +}); + +// node_modules/@smithy/eventstream-serde-universal/dist-cjs/index.js +var require_dist_cjs69 = __commonJS({ + "node_modules/@smithy/eventstream-serde-universal/dist-cjs/index.js"(exports2) { + "use strict"; + var eventstreamCodec = require_dist_cjs68(); + function getChunkedStream(source) { + let currentMessageTotalLength = 0; + let currentMessagePendingLength = 0; + let currentMessage = null; + let messageLengthBuffer = null; + const allocateMessage = (size) => { + if (typeof size !== "number") { + throw new Error("Attempted to allocate an event message where size was not a number: " + size); + } + currentMessageTotalLength = size; + currentMessagePendingLength = 4; + currentMessage = new Uint8Array(size); + const currentMessageView = new DataView(currentMessage.buffer); + currentMessageView.setUint32(0, size, false); + }; + const iterator = async function* () { + const sourceIterator = source[Symbol.asyncIterator](); + while (true) { + const { value, done } = await sourceIterator.next(); + if (done) { + if (!currentMessageTotalLength) { + return; + } else if (currentMessageTotalLength === currentMessagePendingLength) { + yield currentMessage; + } else { + throw new Error("Truncated event message received."); + } + return; + } + const chunkLength = value.length; + let currentOffset = 0; + while (currentOffset < chunkLength) { + if (!currentMessage) { + const bytesRemaining = chunkLength - currentOffset; + if (!messageLengthBuffer) { + messageLengthBuffer = new Uint8Array(4); + } + const numBytesForTotal = Math.min(4 - currentMessagePendingLength, bytesRemaining); + messageLengthBuffer.set(value.slice(currentOffset, currentOffset + numBytesForTotal), currentMessagePendingLength); + currentMessagePendingLength += numBytesForTotal; + currentOffset += numBytesForTotal; + if (currentMessagePendingLength < 4) { + break; + } + allocateMessage(new DataView(messageLengthBuffer.buffer).getUint32(0, false)); + messageLengthBuffer = null; + } + const numBytesToWrite = Math.min(currentMessageTotalLength - currentMessagePendingLength, chunkLength - currentOffset); + currentMessage.set(value.slice(currentOffset, currentOffset + numBytesToWrite), currentMessagePendingLength); + currentMessagePendingLength += numBytesToWrite; + currentOffset += numBytesToWrite; + if (currentMessageTotalLength && currentMessageTotalLength === currentMessagePendingLength) { + yield currentMessage; + currentMessage = null; + currentMessageTotalLength = 0; + currentMessagePendingLength = 0; + } + } + } + }; + return { + [Symbol.asyncIterator]: iterator + }; + } + function getMessageUnmarshaller(deserializer, toUtf810) { + return async function(message2) { + const { value: messageType } = message2.headers[":message-type"]; + if (messageType === "error") { + const unmodeledError = new Error(message2.headers[":error-message"].value || "UnknownError"); + unmodeledError.name = message2.headers[":error-code"].value; + throw unmodeledError; + } else if (messageType === "exception") { + const code = message2.headers[":exception-type"].value; + const exception = { [code]: message2 }; + const deserializedException = await deserializer(exception); + if (deserializedException.$unknown) { + const error2 = new Error(toUtf810(message2.body)); + error2.name = code; + throw error2; + } + throw deserializedException[code]; + } else if (messageType === "event") { + const event = { + [message2.headers[":event-type"].value]: message2 + }; + const deserialized = await deserializer(event); + if (deserialized.$unknown) + return; + return deserialized; + } else { + throw Error(`Unrecognizable event type: ${message2.headers[":event-type"].value}`); + } + }; + } + var EventStreamMarshaller = class { + eventStreamCodec; + utfEncoder; + constructor({ utf8Encoder, utf8Decoder }) { + this.eventStreamCodec = new eventstreamCodec.EventStreamCodec(utf8Encoder, utf8Decoder); + this.utfEncoder = utf8Encoder; + } + deserialize(body, deserializer) { + const inputStream = getChunkedStream(body); + return new eventstreamCodec.SmithyMessageDecoderStream({ + messageStream: new eventstreamCodec.MessageDecoderStream({ inputStream, decoder: this.eventStreamCodec }), + deserializer: getMessageUnmarshaller(deserializer, this.utfEncoder) + }); + } + serialize(inputStream, serializer) { + return new eventstreamCodec.MessageEncoderStream({ + messageStream: new eventstreamCodec.SmithyMessageEncoderStream({ inputStream, serializer }), + encoder: this.eventStreamCodec, + includeEndFrame: true + }); + } + }; + var eventStreamSerdeProvider = (options) => new EventStreamMarshaller(options); + exports2.EventStreamMarshaller = EventStreamMarshaller; + exports2.eventStreamSerdeProvider = eventStreamSerdeProvider; + } +}); + +// node_modules/@smithy/eventstream-serde-node/dist-cjs/index.js +var require_dist_cjs70 = __commonJS({ + "node_modules/@smithy/eventstream-serde-node/dist-cjs/index.js"(exports2) { + "use strict"; + var eventstreamSerdeUniversal = require_dist_cjs69(); + var stream = require("stream"); + async function* readabletoIterable(readStream) { + let streamEnded = false; + let generationEnded = false; + const records = new Array(); + readStream.on("error", (err) => { + if (!streamEnded) { + streamEnded = true; + } + if (err) { + throw err; + } + }); + readStream.on("data", (data2) => { + records.push(data2); + }); + readStream.on("end", () => { + streamEnded = true; + }); + while (!generationEnded) { + const value = await new Promise((resolve) => setTimeout(() => resolve(records.shift()), 0)); + if (value) { + yield value; + } + generationEnded = streamEnded && records.length === 0; + } + } + var EventStreamMarshaller = class { + universalMarshaller; + constructor({ utf8Encoder, utf8Decoder }) { + this.universalMarshaller = new eventstreamSerdeUniversal.EventStreamMarshaller({ + utf8Decoder, + utf8Encoder + }); + } + deserialize(body, deserializer) { + const bodyIterable = typeof body[Symbol.asyncIterator] === "function" ? body : readabletoIterable(body); + return this.universalMarshaller.deserialize(bodyIterable, deserializer); + } + serialize(input, serializer) { + return stream.Readable.from(this.universalMarshaller.serialize(input, serializer)); + } + }; + var eventStreamSerdeProvider = (options) => new EventStreamMarshaller(options); + exports2.EventStreamMarshaller = EventStreamMarshaller; + exports2.eventStreamSerdeProvider = eventStreamSerdeProvider; + } +}); + +// node_modules/@smithy/hash-stream-node/dist-cjs/index.js +var require_dist_cjs71 = __commonJS({ + "node_modules/@smithy/hash-stream-node/dist-cjs/index.js"(exports2) { + "use strict"; + var fs = require("fs"); + var utilUtf8 = require_dist_cjs8(); + var stream = require("stream"); + var HashCalculator = class extends stream.Writable { + hash; + constructor(hash, options) { + super(options); + this.hash = hash; + } + _write(chunk, encoding, callback) { + try { + this.hash.update(utilUtf8.toUint8Array(chunk)); + } catch (err) { + return callback(err); + } + callback(); + } + }; + var fileStreamHasher = (hashCtor, fileStream) => new Promise((resolve, reject) => { + if (!isReadStream(fileStream)) { + reject(new Error("Unable to calculate hash for non-file streams.")); + return; + } + const fileStreamTee = fs.createReadStream(fileStream.path, { + start: fileStream.start, + end: fileStream.end + }); + const hash = new hashCtor(); + const hashCalculator = new HashCalculator(hash); + fileStreamTee.pipe(hashCalculator); + fileStreamTee.on("error", (err) => { + hashCalculator.end(); + reject(err); + }); + hashCalculator.on("error", reject); + hashCalculator.on("finish", function() { + hash.digest().then(resolve).catch(reject); + }); + }); + var isReadStream = (stream2) => typeof stream2.path === "string"; + var readableStreamHasher = (hashCtor, readableStream) => { + if (readableStream.readableFlowing !== null) { + throw new Error("Unable to calculate hash for flowing readable stream"); + } + const hash = new hashCtor(); + const hashCalculator = new HashCalculator(hash); + readableStream.pipe(hashCalculator); + return new Promise((resolve, reject) => { + readableStream.on("error", (err) => { + hashCalculator.end(); + reject(err); + }); + hashCalculator.on("error", reject); + hashCalculator.on("finish", () => { + hash.digest().then(resolve).catch(reject); + }); + }); + }; + exports2.fileStreamHasher = fileStreamHasher; + exports2.readableStreamHasher = readableStreamHasher; + } +}); + +// node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.shared.js +var require_runtimeConfig_shared2 = __commonJS({ + "node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.shared.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getRuntimeConfig = void 0; + var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); + var protocols_1 = (init_protocols2(), __toCommonJS(protocols_exports2)); + var signature_v4_multi_region_1 = require_dist_cjs47(); + var smithy_client_1 = require_dist_cjs20(); + var url_parser_1 = require_dist_cjs35(); + var util_base64_1 = require_dist_cjs9(); + var util_stream_1 = require_dist_cjs15(); + var util_utf8_1 = require_dist_cjs8(); + var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider(); + var endpointResolver_1 = require_endpointResolver(); + var schemas_0_1 = require_schemas_0(); + var getRuntimeConfig7 = (config) => { + return { + apiVersion: "2006-03-01", + base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64, + base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, + extensions: config?.extensions ?? [], + getAwsChunkedEncodingStream: config?.getAwsChunkedEncodingStream ?? util_stream_1.getAwsChunkedEncodingStream, + httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultS3HttpAuthSchemeProvider, + httpAuthSchemes: config?.httpAuthSchemes ?? [ + { + schemeId: "aws.auth#sigv4", + identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), + signer: new core_1.AwsSdkSigV4Signer() + }, + { + schemeId: "aws.auth#sigv4a", + identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"), + signer: new core_1.AwsSdkSigV4ASigner() + } + ], + logger: config?.logger ?? new smithy_client_1.NoOpLogger(), + protocol: config?.protocol ?? protocols_1.AwsRestXmlProtocol, + protocolSettings: config?.protocolSettings ?? { + defaultNamespace: "com.amazonaws.s3", + errorTypeRegistries: schemas_0_1.errorTypeRegistries, + xmlNamespace: "http://s3.amazonaws.com/doc/2006-03-01/", + version: "2006-03-01", + serviceTarget: "AmazonS3" + }, + sdkStreamMixin: config?.sdkStreamMixin ?? util_stream_1.sdkStreamMixin, + serviceId: config?.serviceId ?? "S3", + signerConstructor: config?.signerConstructor ?? signature_v4_multi_region_1.SignatureV4MultiRegion, + signingEscapePath: config?.signingEscapePath ?? false, + urlParser: config?.urlParser ?? url_parser_1.parseUrl, + useArnRegion: config?.useArnRegion ?? void 0, + utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, + utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8 + }; + }; + exports2.getRuntimeConfig = getRuntimeConfig7; + } +}); + +// node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.js +var require_runtimeConfig2 = __commonJS({ + "node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getRuntimeConfig = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var package_json_1 = tslib_1.__importDefault(require_package6()); + var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2)); + var credential_provider_node_1 = require_dist_cjs66(); + var middleware_bucket_endpoint_1 = require_dist_cjs67(); + var middleware_flexible_checksums_1 = require_dist_cjs26(); + var middleware_sdk_s3_1 = require_dist_cjs32(); + var util_user_agent_node_1 = require_dist_cjs52(); + var config_resolver_1 = require_dist_cjs38(); + var eventstream_serde_node_1 = require_dist_cjs70(); + var hash_node_1 = require_dist_cjs53(); + var hash_stream_node_1 = require_dist_cjs71(); + var middleware_retry_1 = require_dist_cjs46(); + var node_config_provider_1 = require_dist_cjs42(); + var node_http_handler_1 = require_dist_cjs12(); + var smithy_client_1 = require_dist_cjs20(); + var util_body_length_node_1 = require_dist_cjs54(); + var util_defaults_mode_node_1 = require_dist_cjs55(); + var util_retry_1 = require_dist_cjs45(); + var runtimeConfig_shared_1 = require_runtimeConfig_shared2(); + var getRuntimeConfig7 = (config) => { + (0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version); + const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); + const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); + const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); + (0, core_1.emitWarningIfUnsupportedVersion)(process.version); + const loaderConfig = { + profile: config?.profile, + logger: clientSharedValues.logger + }; + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), + bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, + credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider, + defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), + disableS3ExpressSessionAuth: config?.disableS3ExpressSessionAuth ?? (0, node_config_provider_1.loadConfig)(middleware_sdk_s3_1.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS, loaderConfig), + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventstream_serde_node_1.eventStreamSerdeProvider, + maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + md5: config?.md5 ?? hash_node_1.Hash.bind(null, "md5"), + region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), + requestChecksumCalculation: config?.requestChecksumCalculation ?? (0, node_config_provider_1.loadConfig)(middleware_flexible_checksums_1.NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS, loaderConfig), + requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), + responseChecksumValidation: config?.responseChecksumValidation ?? (0, node_config_provider_1.loadConfig)(middleware_flexible_checksums_1.NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS, loaderConfig), + retryMode: config?.retryMode ?? (0, node_config_provider_1.loadConfig)({ + ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE + }, config), + sha1: config?.sha1 ?? hash_node_1.Hash.bind(null, "sha1"), + sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), + sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig), + streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector, + streamHasher: config?.streamHasher ?? hash_stream_node_1.readableStreamHasher, + useArnRegion: config?.useArnRegion ?? (0, node_config_provider_1.loadConfig)(middleware_bucket_endpoint_1.NODE_USE_ARN_REGION_CONFIG_OPTIONS, loaderConfig), + useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), + userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) + }; + }; + exports2.getRuntimeConfig = getRuntimeConfig7; + } +}); + +// node_modules/@aws-sdk/middleware-ssec/dist-cjs/index.js +var require_dist_cjs72 = __commonJS({ + "node_modules/@aws-sdk/middleware-ssec/dist-cjs/index.js"(exports2) { + "use strict"; + function ssecMiddleware(options) { + return (next) => async (args2) => { + const input = { ...args2.input }; + const properties = [ + { + target: "SSECustomerKey", + hash: "SSECustomerKeyMD5" + }, + { + target: "CopySourceSSECustomerKey", + hash: "CopySourceSSECustomerKeyMD5" + } + ]; + for (const prop of properties) { + const value = input[prop.target]; + if (value) { + let valueForHash; + if (typeof value === "string") { + if (isValidBase64EncodedSSECustomerKey(value, options)) { + valueForHash = options.base64Decoder(value); + } else { + valueForHash = options.utf8Decoder(value); + input[prop.target] = options.base64Encoder(valueForHash); + } + } else { + valueForHash = ArrayBuffer.isView(value) ? new Uint8Array(value.buffer, value.byteOffset, value.byteLength) : new Uint8Array(value); + input[prop.target] = options.base64Encoder(valueForHash); + } + const hash = new options.md5(); + hash.update(valueForHash); + input[prop.hash] = options.base64Encoder(await hash.digest()); + } + } + return next({ + ...args2, + input + }); + }; + } + var ssecMiddlewareOptions = { + name: "ssecMiddleware", + step: "initialize", + tags: ["SSE"], + override: true + }; + var getSsecPlugin = (config) => ({ + applyToStack: (clientStack) => { + clientStack.add(ssecMiddleware(config), ssecMiddlewareOptions); + } + }); + function isValidBase64EncodedSSECustomerKey(str, options) { + const base64Regex = /^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/; + if (!base64Regex.test(str)) + return false; + try { + const decodedBytes = options.base64Decoder(str); + return decodedBytes.length === 32; + } catch { + return false; + } + } + exports2.getSsecPlugin = getSsecPlugin; + exports2.isValidBase64EncodedSSECustomerKey = isValidBase64EncodedSSECustomerKey; + exports2.ssecMiddleware = ssecMiddleware; + exports2.ssecMiddlewareOptions = ssecMiddlewareOptions; + } +}); + +// node_modules/@aws-sdk/middleware-location-constraint/dist-cjs/index.js +var require_dist_cjs73 = __commonJS({ + "node_modules/@aws-sdk/middleware-location-constraint/dist-cjs/index.js"(exports2) { + "use strict"; + function locationConstraintMiddleware(options) { + return (next) => async (args2) => { + const { CreateBucketConfiguration } = args2.input; + const region = await options.region(); + if (!CreateBucketConfiguration?.LocationConstraint && !CreateBucketConfiguration?.Location) { + if (region !== "us-east-1") { + args2.input.CreateBucketConfiguration = args2.input.CreateBucketConfiguration ?? {}; + args2.input.CreateBucketConfiguration.LocationConstraint = region; + } + } + return next(args2); + }; + } + var locationConstraintMiddlewareOptions = { + step: "initialize", + tags: ["LOCATION_CONSTRAINT", "CREATE_BUCKET_CONFIGURATION"], + name: "locationConstraintMiddleware", + override: true + }; + var getLocationConstraintPlugin = (config) => ({ + applyToStack: (clientStack) => { + clientStack.add(locationConstraintMiddleware(config), locationConstraintMiddlewareOptions); + } + }); + exports2.getLocationConstraintPlugin = getLocationConstraintPlugin; + exports2.locationConstraintMiddleware = locationConstraintMiddleware; + exports2.locationConstraintMiddlewareOptions = locationConstraintMiddlewareOptions; + } +}); + +// node_modules/@smithy/util-waiter/dist-cjs/index.js +var require_dist_cjs74 = __commonJS({ + "node_modules/@smithy/util-waiter/dist-cjs/index.js"(exports2) { + "use strict"; + var getCircularReplacer = () => { + const seen = /* @__PURE__ */ new WeakSet(); + return (key, value) => { + if (typeof value === "object" && value !== null) { + if (seen.has(value)) { + return "[Circular]"; + } + seen.add(value); + } + return value; + }; + }; + var sleep = (seconds) => { + return new Promise((resolve) => setTimeout(resolve, seconds * 1e3)); + }; + var waiterServiceDefaults = { + minDelay: 2, + maxDelay: 120 + }; + exports2.WaiterState = void 0; + (function(WaiterState) { + WaiterState["ABORTED"] = "ABORTED"; + WaiterState["FAILURE"] = "FAILURE"; + WaiterState["SUCCESS"] = "SUCCESS"; + WaiterState["RETRY"] = "RETRY"; + WaiterState["TIMEOUT"] = "TIMEOUT"; + })(exports2.WaiterState || (exports2.WaiterState = {})); + var checkExceptions = (result) => { + if (result.state === exports2.WaiterState.ABORTED) { + const abortError = new Error(`${JSON.stringify({ + ...result, + reason: "Request was aborted" + }, getCircularReplacer())}`); + abortError.name = "AbortError"; + throw abortError; + } else if (result.state === exports2.WaiterState.TIMEOUT) { + const timeoutError = new Error(`${JSON.stringify({ + ...result, + reason: "Waiter has timed out" + }, getCircularReplacer())}`); + timeoutError.name = "TimeoutError"; + throw timeoutError; + } else if (result.state !== exports2.WaiterState.SUCCESS) { + throw new Error(`${JSON.stringify(result, getCircularReplacer())}`); + } + return result; + }; + var exponentialBackoffWithJitter = (minDelay, maxDelay, attemptCeiling, attempt) => { + if (attempt > attemptCeiling) + return maxDelay; + const delay = minDelay * 2 ** (attempt - 1); + return randomInRange(minDelay, delay); + }; + var randomInRange = (min, max) => min + Math.random() * (max - min); + var runPolling = async ({ minDelay, maxDelay, maxWaitTime, abortController, client, abortSignal }, input, acceptorChecks) => { + const observedResponses = {}; + const { state: state2, reason } = await acceptorChecks(client, input); + if (reason) { + const message2 = createMessageFromResponse(reason); + observedResponses[message2] |= 0; + observedResponses[message2] += 1; + } + if (state2 !== exports2.WaiterState.RETRY) { + return { state: state2, reason, observedResponses }; + } + let currentAttempt = 1; + const waitUntil = Date.now() + maxWaitTime * 1e3; + const attemptCeiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1; + while (true) { + if (abortController?.signal?.aborted || abortSignal?.aborted) { + const message2 = "AbortController signal aborted."; + observedResponses[message2] |= 0; + observedResponses[message2] += 1; + return { state: exports2.WaiterState.ABORTED, observedResponses }; + } + const delay = exponentialBackoffWithJitter(minDelay, maxDelay, attemptCeiling, currentAttempt); + if (Date.now() + delay * 1e3 > waitUntil) { + return { state: exports2.WaiterState.TIMEOUT, observedResponses }; + } + await sleep(delay); + const { state: state3, reason: reason2 } = await acceptorChecks(client, input); + if (reason2) { + const message2 = createMessageFromResponse(reason2); + observedResponses[message2] |= 0; + observedResponses[message2] += 1; + } + if (state3 !== exports2.WaiterState.RETRY) { + return { state: state3, reason: reason2, observedResponses }; + } + currentAttempt += 1; + } + }; + var createMessageFromResponse = (reason) => { + if (reason?.$responseBodyText) { + return `Deserialization error for body: ${reason.$responseBodyText}`; + } + if (reason?.$metadata?.httpStatusCode) { + if (reason.$response || reason.message) { + return `${reason.$response.statusCode ?? reason.$metadata.httpStatusCode ?? "Unknown"}: ${reason.message}`; + } + return `${reason.$metadata.httpStatusCode}: OK`; + } + return String(reason?.message ?? JSON.stringify(reason, getCircularReplacer()) ?? "Unknown"); + }; + var validateWaiterOptions = (options) => { + if (options.maxWaitTime <= 0) { + throw new Error(`WaiterConfiguration.maxWaitTime must be greater than 0`); + } else if (options.minDelay <= 0) { + throw new Error(`WaiterConfiguration.minDelay must be greater than 0`); + } else if (options.maxDelay <= 0) { + throw new Error(`WaiterConfiguration.maxDelay must be greater than 0`); + } else if (options.maxWaitTime <= options.minDelay) { + throw new Error(`WaiterConfiguration.maxWaitTime [${options.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`); + } else if (options.maxDelay < options.minDelay) { + throw new Error(`WaiterConfiguration.maxDelay [${options.maxDelay}] must be greater than WaiterConfiguration.minDelay [${options.minDelay}] for this waiter`); + } + }; + var abortTimeout = (abortSignal) => { + let onAbort; + const promise = new Promise((resolve) => { + onAbort = () => resolve({ state: exports2.WaiterState.ABORTED }); + if (typeof abortSignal.addEventListener === "function") { + abortSignal.addEventListener("abort", onAbort); + } else { + abortSignal.onabort = onAbort; + } + }); + return { + clearListener() { + if (typeof abortSignal.removeEventListener === "function") { + abortSignal.removeEventListener("abort", onAbort); + } + }, + aborted: promise + }; + }; + var createWaiter = async (options, input, acceptorChecks) => { + const params = { + ...waiterServiceDefaults, + ...options + }; + validateWaiterOptions(params); + const exitConditions = [runPolling(params, input, acceptorChecks)]; + const finalize = []; + if (options.abortSignal) { + const { aborted, clearListener } = abortTimeout(options.abortSignal); + finalize.push(clearListener); + exitConditions.push(aborted); + } + if (options.abortController?.signal) { + const { aborted, clearListener } = abortTimeout(options.abortController.signal); + finalize.push(clearListener); + exitConditions.push(aborted); + } + return Promise.race(exitConditions).then((result) => { + for (const fn2 of finalize) { + fn2(); + } + return result; + }); + }; + exports2.checkExceptions = checkExceptions; + exports2.createWaiter = createWaiter; + exports2.waiterServiceDefaults = waiterServiceDefaults; + } +}); + +// node_modules/@aws-sdk/client-s3/dist-cjs/index.js +var require_dist_cjs75 = __commonJS({ + "node_modules/@aws-sdk/client-s3/dist-cjs/index.js"(exports2) { + "use strict"; + var middlewareExpectContinue = require_dist_cjs3(); + var middlewareFlexibleChecksums = require_dist_cjs26(); + var middlewareHostHeader = require_dist_cjs27(); + var middlewareLogger = require_dist_cjs28(); + var middlewareRecursionDetection = require_dist_cjs29(); + var middlewareSdkS3 = require_dist_cjs32(); + var middlewareUserAgent = require_dist_cjs37(); + var configResolver = require_dist_cjs38(); + var core = (init_dist_es(), __toCommonJS(dist_es_exports)); + var schema = (init_schema(), __toCommonJS(schema_exports)); + var eventstreamSerdeConfigResolver = require_dist_cjs39(); + var middlewareContentLength = require_dist_cjs40(); + var middlewareEndpoint = require_dist_cjs43(); + var middlewareRetry = require_dist_cjs46(); + var smithyClient = require_dist_cjs20(); + var httpAuthSchemeProvider = require_httpAuthSchemeProvider(); + var schemas_0 = require_schemas_0(); + var runtimeConfig = require_runtimeConfig2(); + var regionConfigResolver = require_dist_cjs57(); + var protocolHttp = require_dist_cjs2(); + var middlewareSsec = require_dist_cjs72(); + var middlewareLocationConstraint = require_dist_cjs73(); + var utilWaiter = require_dist_cjs74(); + var errors = require_errors4(); + var S3ServiceException = require_S3ServiceException(); + var resolveClientEndpointParameters4 = (options) => { + return Object.assign(options, { + useFipsEndpoint: options.useFipsEndpoint ?? false, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + forcePathStyle: options.forcePathStyle ?? false, + useAccelerateEndpoint: options.useAccelerateEndpoint ?? false, + useGlobalEndpoint: options.useGlobalEndpoint ?? false, + disableMultiregionAccessPoints: options.disableMultiregionAccessPoints ?? false, + defaultSigningName: "s3", + clientContextParams: options.clientContextParams ?? {} + }); + }; + var commonParams4 = { + ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" }, + UseArnRegion: { type: "clientContextParams", name: "useArnRegion" }, + DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" }, + Accelerate: { type: "clientContextParams", name: "useAccelerateEndpoint" }, + DisableS3ExpressSessionAuth: { type: "clientContextParams", name: "disableS3ExpressSessionAuth" }, + UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } + }; + var CreateSessionCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + DisableS3ExpressSessionAuth: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "CreateSession", {}).n("S3Client", "CreateSessionCommand").sc(schemas_0.CreateSession$).build() { + }; + var getHttpAuthExtensionConfiguration4 = (runtimeConfig2) => { + const _httpAuthSchemes = runtimeConfig2.httpAuthSchemes; + let _httpAuthSchemeProvider = runtimeConfig2.httpAuthSchemeProvider; + let _credentials = runtimeConfig2.credentials; + return { + setHttpAuthScheme(httpAuthScheme) { + const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); + if (index === -1) { + _httpAuthSchemes.push(httpAuthScheme); + } else { + _httpAuthSchemes.splice(index, 1, httpAuthScheme); + } + }, + httpAuthSchemes() { + return _httpAuthSchemes; + }, + setHttpAuthSchemeProvider(httpAuthSchemeProvider2) { + _httpAuthSchemeProvider = httpAuthSchemeProvider2; + }, + httpAuthSchemeProvider() { + return _httpAuthSchemeProvider; + }, + setCredentials(credentials) { + _credentials = credentials; + }, + credentials() { + return _credentials; + } + }; + }; + var resolveHttpAuthRuntimeConfig4 = (config) => { + return { + httpAuthSchemes: config.httpAuthSchemes(), + httpAuthSchemeProvider: config.httpAuthSchemeProvider(), + credentials: config.credentials() + }; + }; + var resolveRuntimeExtensions4 = (runtimeConfig2, extensions) => { + const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig2), smithyClient.getDefaultExtensionConfiguration(runtimeConfig2), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig2), getHttpAuthExtensionConfiguration4(runtimeConfig2)); + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + return Object.assign(runtimeConfig2, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig4(extensionConfiguration)); + }; + var S3Client = class extends smithyClient.Client { + config; + constructor(...[configuration]) { + const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {}); + super(_config_0); + this.initConfig = _config_0; + const _config_1 = resolveClientEndpointParameters4(_config_0); + const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1); + const _config_3 = middlewareFlexibleChecksums.resolveFlexibleChecksumsConfig(_config_2); + const _config_4 = middlewareRetry.resolveRetryConfig(_config_3); + const _config_5 = configResolver.resolveRegionConfig(_config_4); + const _config_6 = middlewareHostHeader.resolveHostHeaderConfig(_config_5); + const _config_7 = middlewareEndpoint.resolveEndpointConfig(_config_6); + const _config_8 = eventstreamSerdeConfigResolver.resolveEventStreamSerdeConfig(_config_7); + const _config_9 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_8); + const _config_10 = middlewareSdkS3.resolveS3Config(_config_9, { session: [() => this, CreateSessionCommand] }); + const _config_11 = resolveRuntimeExtensions4(_config_10, configuration?.extensions || []); + this.config = _config_11; + this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config)); + this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config)); + this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config)); + this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config)); + this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config)); + this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config)); + this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { + httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultS3HttpAuthSchemeParametersProvider, + identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({ + "aws.auth#sigv4": config.credentials, + "aws.auth#sigv4a": config.credentials + }) + })); + this.middlewareStack.use(core.getHttpSigningPlugin(this.config)); + this.middlewareStack.use(middlewareSdkS3.getValidateBucketNamePlugin(this.config)); + this.middlewareStack.use(middlewareExpectContinue.getAddExpectContinuePlugin(this.config)); + this.middlewareStack.use(middlewareSdkS3.getRegionRedirectMiddlewarePlugin(this.config)); + this.middlewareStack.use(middlewareSdkS3.getS3ExpressPlugin(this.config)); + this.middlewareStack.use(middlewareSdkS3.getS3ExpressHttpSigningPlugin(this.config)); + } + destroy() { + super.destroy(); + } + }; + var AbortMultipartUploadCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "AbortMultipartUpload", {}).n("S3Client", "AbortMultipartUploadCommand").sc(schemas_0.AbortMultipartUpload$).build() { + }; + var CompleteMultipartUploadCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config), + middlewareSsec.getSsecPlugin(config) + ]; + }).s("AmazonS3", "CompleteMultipartUpload", {}).n("S3Client", "CompleteMultipartUploadCommand").sc(schemas_0.CompleteMultipartUpload$).build() { + }; + var CopyObjectCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + DisableS3ExpressSessionAuth: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" }, + CopySource: { type: "contextParams", name: "CopySource" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config), + middlewareSsec.getSsecPlugin(config) + ]; + }).s("AmazonS3", "CopyObject", {}).n("S3Client", "CopyObjectCommand").sc(schemas_0.CopyObject$).build() { + }; + var CreateBucketCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + DisableAccessPoints: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config), + middlewareLocationConstraint.getLocationConstraintPlugin(config) + ]; + }).s("AmazonS3", "CreateBucket", {}).n("S3Client", "CreateBucketCommand").sc(schemas_0.CreateBucket$).build() { + }; + var CreateBucketMetadataConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "CreateBucketMetadataConfiguration", {}).n("S3Client", "CreateBucketMetadataConfigurationCommand").sc(schemas_0.CreateBucketMetadataConfiguration$).build() { + }; + var CreateBucketMetadataTableConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "CreateBucketMetadataTableConfiguration", {}).n("S3Client", "CreateBucketMetadataTableConfigurationCommand").sc(schemas_0.CreateBucketMetadataTableConfiguration$).build() { + }; + var CreateMultipartUploadCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config), + middlewareSsec.getSsecPlugin(config) + ]; + }).s("AmazonS3", "CreateMultipartUpload", {}).n("S3Client", "CreateMultipartUploadCommand").sc(schemas_0.CreateMultipartUpload$).build() { + }; + var DeleteBucketAnalyticsConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucketAnalyticsConfiguration", {}).n("S3Client", "DeleteBucketAnalyticsConfigurationCommand").sc(schemas_0.DeleteBucketAnalyticsConfiguration$).build() { + }; + var DeleteBucketCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucket", {}).n("S3Client", "DeleteBucketCommand").sc(schemas_0.DeleteBucket$).build() { + }; + var DeleteBucketCorsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucketCors", {}).n("S3Client", "DeleteBucketCorsCommand").sc(schemas_0.DeleteBucketCors$).build() { + }; + var DeleteBucketEncryptionCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucketEncryption", {}).n("S3Client", "DeleteBucketEncryptionCommand").sc(schemas_0.DeleteBucketEncryption$).build() { + }; + var DeleteBucketIntelligentTieringConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucketIntelligentTieringConfiguration", {}).n("S3Client", "DeleteBucketIntelligentTieringConfigurationCommand").sc(schemas_0.DeleteBucketIntelligentTieringConfiguration$).build() { + }; + var DeleteBucketInventoryConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucketInventoryConfiguration", {}).n("S3Client", "DeleteBucketInventoryConfigurationCommand").sc(schemas_0.DeleteBucketInventoryConfiguration$).build() { + }; + var DeleteBucketLifecycleCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucketLifecycle", {}).n("S3Client", "DeleteBucketLifecycleCommand").sc(schemas_0.DeleteBucketLifecycle$).build() { + }; + var DeleteBucketMetadataConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucketMetadataConfiguration", {}).n("S3Client", "DeleteBucketMetadataConfigurationCommand").sc(schemas_0.DeleteBucketMetadataConfiguration$).build() { + }; + var DeleteBucketMetadataTableConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucketMetadataTableConfiguration", {}).n("S3Client", "DeleteBucketMetadataTableConfigurationCommand").sc(schemas_0.DeleteBucketMetadataTableConfiguration$).build() { + }; + var DeleteBucketMetricsConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucketMetricsConfiguration", {}).n("S3Client", "DeleteBucketMetricsConfigurationCommand").sc(schemas_0.DeleteBucketMetricsConfiguration$).build() { + }; + var DeleteBucketOwnershipControlsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucketOwnershipControls", {}).n("S3Client", "DeleteBucketOwnershipControlsCommand").sc(schemas_0.DeleteBucketOwnershipControls$).build() { + }; + var DeleteBucketPolicyCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucketPolicy", {}).n("S3Client", "DeleteBucketPolicyCommand").sc(schemas_0.DeleteBucketPolicy$).build() { + }; + var DeleteBucketReplicationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucketReplication", {}).n("S3Client", "DeleteBucketReplicationCommand").sc(schemas_0.DeleteBucketReplication$).build() { + }; + var DeleteBucketTaggingCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucketTagging", {}).n("S3Client", "DeleteBucketTaggingCommand").sc(schemas_0.DeleteBucketTagging$).build() { + }; + var DeleteBucketWebsiteCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeleteBucketWebsite", {}).n("S3Client", "DeleteBucketWebsiteCommand").sc(schemas_0.DeleteBucketWebsite$).build() { + }; + var DeleteObjectCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "DeleteObject", {}).n("S3Client", "DeleteObjectCommand").sc(schemas_0.DeleteObject$).build() { + }; + var DeleteObjectsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "DeleteObjects", {}).n("S3Client", "DeleteObjectsCommand").sc(schemas_0.DeleteObjects$).build() { + }; + var DeleteObjectTaggingCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "DeleteObjectTagging", {}).n("S3Client", "DeleteObjectTaggingCommand").sc(schemas_0.DeleteObjectTagging$).build() { + }; + var DeletePublicAccessBlockCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "DeletePublicAccessBlock", {}).n("S3Client", "DeletePublicAccessBlockCommand").sc(schemas_0.DeletePublicAccessBlock$).build() { + }; + var GetBucketAbacCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketAbac", {}).n("S3Client", "GetBucketAbacCommand").sc(schemas_0.GetBucketAbac$).build() { + }; + var GetBucketAccelerateConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketAccelerateConfiguration", {}).n("S3Client", "GetBucketAccelerateConfigurationCommand").sc(schemas_0.GetBucketAccelerateConfiguration$).build() { + }; + var GetBucketAclCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketAcl", {}).n("S3Client", "GetBucketAclCommand").sc(schemas_0.GetBucketAcl$).build() { + }; + var GetBucketAnalyticsConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketAnalyticsConfiguration", {}).n("S3Client", "GetBucketAnalyticsConfigurationCommand").sc(schemas_0.GetBucketAnalyticsConfiguration$).build() { + }; + var GetBucketCorsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketCors", {}).n("S3Client", "GetBucketCorsCommand").sc(schemas_0.GetBucketCors$).build() { + }; + var GetBucketEncryptionCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketEncryption", {}).n("S3Client", "GetBucketEncryptionCommand").sc(schemas_0.GetBucketEncryption$).build() { + }; + var GetBucketIntelligentTieringConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketIntelligentTieringConfiguration", {}).n("S3Client", "GetBucketIntelligentTieringConfigurationCommand").sc(schemas_0.GetBucketIntelligentTieringConfiguration$).build() { + }; + var GetBucketInventoryConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketInventoryConfiguration", {}).n("S3Client", "GetBucketInventoryConfigurationCommand").sc(schemas_0.GetBucketInventoryConfiguration$).build() { + }; + var GetBucketLifecycleConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketLifecycleConfiguration", {}).n("S3Client", "GetBucketLifecycleConfigurationCommand").sc(schemas_0.GetBucketLifecycleConfiguration$).build() { + }; + var GetBucketLocationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketLocation", {}).n("S3Client", "GetBucketLocationCommand").sc(schemas_0.GetBucketLocation$).build() { + }; + var GetBucketLoggingCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketLogging", {}).n("S3Client", "GetBucketLoggingCommand").sc(schemas_0.GetBucketLogging$).build() { + }; + var GetBucketMetadataConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketMetadataConfiguration", {}).n("S3Client", "GetBucketMetadataConfigurationCommand").sc(schemas_0.GetBucketMetadataConfiguration$).build() { + }; + var GetBucketMetadataTableConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketMetadataTableConfiguration", {}).n("S3Client", "GetBucketMetadataTableConfigurationCommand").sc(schemas_0.GetBucketMetadataTableConfiguration$).build() { + }; + var GetBucketMetricsConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketMetricsConfiguration", {}).n("S3Client", "GetBucketMetricsConfigurationCommand").sc(schemas_0.GetBucketMetricsConfiguration$).build() { + }; + var GetBucketNotificationConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketNotificationConfiguration", {}).n("S3Client", "GetBucketNotificationConfigurationCommand").sc(schemas_0.GetBucketNotificationConfiguration$).build() { + }; + var GetBucketOwnershipControlsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketOwnershipControls", {}).n("S3Client", "GetBucketOwnershipControlsCommand").sc(schemas_0.GetBucketOwnershipControls$).build() { + }; + var GetBucketPolicyCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketPolicy", {}).n("S3Client", "GetBucketPolicyCommand").sc(schemas_0.GetBucketPolicy$).build() { + }; + var GetBucketPolicyStatusCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketPolicyStatus", {}).n("S3Client", "GetBucketPolicyStatusCommand").sc(schemas_0.GetBucketPolicyStatus$).build() { + }; + var GetBucketReplicationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketReplication", {}).n("S3Client", "GetBucketReplicationCommand").sc(schemas_0.GetBucketReplication$).build() { + }; + var GetBucketRequestPaymentCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketRequestPayment", {}).n("S3Client", "GetBucketRequestPaymentCommand").sc(schemas_0.GetBucketRequestPayment$).build() { + }; + var GetBucketTaggingCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketTagging", {}).n("S3Client", "GetBucketTaggingCommand").sc(schemas_0.GetBucketTagging$).build() { + }; + var GetBucketVersioningCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketVersioning", {}).n("S3Client", "GetBucketVersioningCommand").sc(schemas_0.GetBucketVersioning$).build() { + }; + var GetBucketWebsiteCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetBucketWebsite", {}).n("S3Client", "GetBucketWebsiteCommand").sc(schemas_0.GetBucketWebsite$).build() { + }; + var GetObjectAclCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetObjectAcl", {}).n("S3Client", "GetObjectAclCommand").sc(schemas_0.GetObjectAcl$).build() { + }; + var GetObjectAttributesCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config), + middlewareSsec.getSsecPlugin(config) + ]; + }).s("AmazonS3", "GetObjectAttributes", {}).n("S3Client", "GetObjectAttributesCommand").sc(schemas_0.GetObjectAttributes$).build() { + }; + var GetObjectCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestChecksumRequired: false, + requestValidationModeMember: "ChecksumMode", + "responseAlgorithms": ["CRC64NVME", "CRC32", "CRC32C", "SHA256", "SHA1"] + }), + middlewareSsec.getSsecPlugin(config), + middlewareSdkS3.getS3ExpiresMiddlewarePlugin(config) + ]; + }).s("AmazonS3", "GetObject", {}).n("S3Client", "GetObjectCommand").sc(schemas_0.GetObject$).build() { + }; + var GetObjectLegalHoldCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetObjectLegalHold", {}).n("S3Client", "GetObjectLegalHoldCommand").sc(schemas_0.GetObjectLegalHold$).build() { + }; + var GetObjectLockConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetObjectLockConfiguration", {}).n("S3Client", "GetObjectLockConfigurationCommand").sc(schemas_0.GetObjectLockConfiguration$).build() { + }; + var GetObjectRetentionCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetObjectRetention", {}).n("S3Client", "GetObjectRetentionCommand").sc(schemas_0.GetObjectRetention$).build() { + }; + var GetObjectTaggingCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetObjectTagging", {}).n("S3Client", "GetObjectTaggingCommand").sc(schemas_0.GetObjectTagging$).build() { + }; + var GetObjectTorrentCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "GetObjectTorrent", {}).n("S3Client", "GetObjectTorrentCommand").sc(schemas_0.GetObjectTorrent$).build() { + }; + var GetPublicAccessBlockCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "GetPublicAccessBlock", {}).n("S3Client", "GetPublicAccessBlockCommand").sc(schemas_0.GetPublicAccessBlock$).build() { + }; + var HeadBucketCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "HeadBucket", {}).n("S3Client", "HeadBucketCommand").sc(schemas_0.HeadBucket$).build() { + }; + var HeadObjectCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config), + middlewareSsec.getSsecPlugin(config), + middlewareSdkS3.getS3ExpiresMiddlewarePlugin(config) + ]; + }).s("AmazonS3", "HeadObject", {}).n("S3Client", "HeadObjectCommand").sc(schemas_0.HeadObject$).build() { + }; + var ListBucketAnalyticsConfigurationsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "ListBucketAnalyticsConfigurations", {}).n("S3Client", "ListBucketAnalyticsConfigurationsCommand").sc(schemas_0.ListBucketAnalyticsConfigurations$).build() { + }; + var ListBucketIntelligentTieringConfigurationsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "ListBucketIntelligentTieringConfigurations", {}).n("S3Client", "ListBucketIntelligentTieringConfigurationsCommand").sc(schemas_0.ListBucketIntelligentTieringConfigurations$).build() { + }; + var ListBucketInventoryConfigurationsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "ListBucketInventoryConfigurations", {}).n("S3Client", "ListBucketInventoryConfigurationsCommand").sc(schemas_0.ListBucketInventoryConfigurations$).build() { + }; + var ListBucketMetricsConfigurationsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "ListBucketMetricsConfigurations", {}).n("S3Client", "ListBucketMetricsConfigurationsCommand").sc(schemas_0.ListBucketMetricsConfigurations$).build() { + }; + var ListBucketsCommand = class extends smithyClient.Command.classBuilder().ep(commonParams4).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "ListBuckets", {}).n("S3Client", "ListBucketsCommand").sc(schemas_0.ListBuckets$).build() { + }; + var ListDirectoryBucketsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "ListDirectoryBuckets", {}).n("S3Client", "ListDirectoryBucketsCommand").sc(schemas_0.ListDirectoryBuckets$).build() { + }; + var ListMultipartUploadsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Prefix: { type: "contextParams", name: "Prefix" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "ListMultipartUploads", {}).n("S3Client", "ListMultipartUploadsCommand").sc(schemas_0.ListMultipartUploads$).build() { + }; + var ListObjectsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Prefix: { type: "contextParams", name: "Prefix" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "ListObjects", {}).n("S3Client", "ListObjectsCommand").sc(schemas_0.ListObjects$).build() { + }; + var ListObjectsV2Command = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Prefix: { type: "contextParams", name: "Prefix" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "ListObjectsV2", {}).n("S3Client", "ListObjectsV2Command").sc(schemas_0.ListObjectsV2$).build() { + }; + var ListObjectVersionsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Prefix: { type: "contextParams", name: "Prefix" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "ListObjectVersions", {}).n("S3Client", "ListObjectVersionsCommand").sc(schemas_0.ListObjectVersions$).build() { + }; + var ListPartsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config), + middlewareSsec.getSsecPlugin(config) + ]; + }).s("AmazonS3", "ListParts", {}).n("S3Client", "ListPartsCommand").sc(schemas_0.ListParts$).build() { + }; + var PutBucketAbacCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: false + }) + ]; + }).s("AmazonS3", "PutBucketAbac", {}).n("S3Client", "PutBucketAbacCommand").sc(schemas_0.PutBucketAbac$).build() { + }; + var PutBucketAccelerateConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: false + }) + ]; + }).s("AmazonS3", "PutBucketAccelerateConfiguration", {}).n("S3Client", "PutBucketAccelerateConfigurationCommand").sc(schemas_0.PutBucketAccelerateConfiguration$).build() { + }; + var PutBucketAclCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "PutBucketAcl", {}).n("S3Client", "PutBucketAclCommand").sc(schemas_0.PutBucketAcl$).build() { + }; + var PutBucketAnalyticsConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "PutBucketAnalyticsConfiguration", {}).n("S3Client", "PutBucketAnalyticsConfigurationCommand").sc(schemas_0.PutBucketAnalyticsConfiguration$).build() { + }; + var PutBucketCorsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "PutBucketCors", {}).n("S3Client", "PutBucketCorsCommand").sc(schemas_0.PutBucketCors$).build() { + }; + var PutBucketEncryptionCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "PutBucketEncryption", {}).n("S3Client", "PutBucketEncryptionCommand").sc(schemas_0.PutBucketEncryption$).build() { + }; + var PutBucketIntelligentTieringConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "PutBucketIntelligentTieringConfiguration", {}).n("S3Client", "PutBucketIntelligentTieringConfigurationCommand").sc(schemas_0.PutBucketIntelligentTieringConfiguration$).build() { + }; + var PutBucketInventoryConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "PutBucketInventoryConfiguration", {}).n("S3Client", "PutBucketInventoryConfigurationCommand").sc(schemas_0.PutBucketInventoryConfiguration$).build() { + }; + var PutBucketLifecycleConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "PutBucketLifecycleConfiguration", {}).n("S3Client", "PutBucketLifecycleConfigurationCommand").sc(schemas_0.PutBucketLifecycleConfiguration$).build() { + }; + var PutBucketLoggingCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "PutBucketLogging", {}).n("S3Client", "PutBucketLoggingCommand").sc(schemas_0.PutBucketLogging$).build() { + }; + var PutBucketMetricsConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "PutBucketMetricsConfiguration", {}).n("S3Client", "PutBucketMetricsConfigurationCommand").sc(schemas_0.PutBucketMetricsConfiguration$).build() { + }; + var PutBucketNotificationConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "PutBucketNotificationConfiguration", {}).n("S3Client", "PutBucketNotificationConfigurationCommand").sc(schemas_0.PutBucketNotificationConfiguration$).build() { + }; + var PutBucketOwnershipControlsCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "PutBucketOwnershipControls", {}).n("S3Client", "PutBucketOwnershipControlsCommand").sc(schemas_0.PutBucketOwnershipControls$).build() { + }; + var PutBucketPolicyCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "PutBucketPolicy", {}).n("S3Client", "PutBucketPolicyCommand").sc(schemas_0.PutBucketPolicy$).build() { + }; + var PutBucketReplicationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "PutBucketReplication", {}).n("S3Client", "PutBucketReplicationCommand").sc(schemas_0.PutBucketReplication$).build() { + }; + var PutBucketRequestPaymentCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "PutBucketRequestPayment", {}).n("S3Client", "PutBucketRequestPaymentCommand").sc(schemas_0.PutBucketRequestPayment$).build() { + }; + var PutBucketTaggingCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "PutBucketTagging", {}).n("S3Client", "PutBucketTaggingCommand").sc(schemas_0.PutBucketTagging$).build() { + }; + var PutBucketVersioningCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "PutBucketVersioning", {}).n("S3Client", "PutBucketVersioningCommand").sc(schemas_0.PutBucketVersioning$).build() { + }; + var PutBucketWebsiteCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "PutBucketWebsite", {}).n("S3Client", "PutBucketWebsiteCommand").sc(schemas_0.PutBucketWebsite$).build() { + }; + var PutObjectAclCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "PutObjectAcl", {}).n("S3Client", "PutObjectAclCommand").sc(schemas_0.PutObjectAcl$).build() { + }; + var PutObjectCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: false + }), + middlewareSdkS3.getCheckContentLengthHeaderPlugin(config), + middlewareSdkS3.getThrow200ExceptionsPlugin(config), + middlewareSsec.getSsecPlugin(config) + ]; + }).s("AmazonS3", "PutObject", {}).n("S3Client", "PutObjectCommand").sc(schemas_0.PutObject$).build() { + }; + var PutObjectLegalHoldCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "PutObjectLegalHold", {}).n("S3Client", "PutObjectLegalHoldCommand").sc(schemas_0.PutObjectLegalHold$).build() { + }; + var PutObjectLockConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "PutObjectLockConfiguration", {}).n("S3Client", "PutObjectLockConfigurationCommand").sc(schemas_0.PutObjectLockConfiguration$).build() { + }; + var PutObjectRetentionCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "PutObjectRetention", {}).n("S3Client", "PutObjectRetentionCommand").sc(schemas_0.PutObjectRetention$).build() { + }; + var PutObjectTaggingCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "PutObjectTagging", {}).n("S3Client", "PutObjectTaggingCommand").sc(schemas_0.PutObjectTagging$).build() { + }; + var PutPublicAccessBlockCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "PutPublicAccessBlock", {}).n("S3Client", "PutPublicAccessBlockCommand").sc(schemas_0.PutPublicAccessBlock$).build() { + }; + var RenameObjectCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "RenameObject", {}).n("S3Client", "RenameObjectCommand").sc(schemas_0.RenameObject$).build() { + }; + var RestoreObjectCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: false + }), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "RestoreObject", {}).n("S3Client", "RestoreObjectCommand").sc(schemas_0.RestoreObject$).build() { + }; + var SelectObjectContentCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config), + middlewareSsec.getSsecPlugin(config) + ]; + }).s("AmazonS3", "SelectObjectContent", { + eventStream: { + output: true + } + }).n("S3Client", "SelectObjectContentCommand").sc(schemas_0.SelectObjectContent$).build() { + }; + var UpdateBucketMetadataInventoryTableConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "UpdateBucketMetadataInventoryTableConfiguration", {}).n("S3Client", "UpdateBucketMetadataInventoryTableConfigurationCommand").sc(schemas_0.UpdateBucketMetadataInventoryTableConfiguration$).build() { + }; + var UpdateBucketMetadataJournalTableConfigurationCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseS3ExpressControlEndpoint: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }) + ]; + }).s("AmazonS3", "UpdateBucketMetadataJournalTableConfiguration", {}).n("S3Client", "UpdateBucketMetadataJournalTableConfigurationCommand").sc(schemas_0.UpdateBucketMetadataJournalTableConfiguration$).build() { + }; + var UpdateObjectEncryptionCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: true + }), + middlewareSdkS3.getThrow200ExceptionsPlugin(config) + ]; + }).s("AmazonS3", "UpdateObjectEncryption", {}).n("S3Client", "UpdateObjectEncryptionCommand").sc(schemas_0.UpdateObjectEncryption$).build() { + }; + var UploadPartCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + Bucket: { type: "contextParams", name: "Bucket" }, + Key: { type: "contextParams", name: "Key" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareFlexibleChecksums.getFlexibleChecksumsPlugin(config, { + requestAlgorithmMember: { "httpHeader": "x-amz-sdk-checksum-algorithm", "name": "ChecksumAlgorithm" }, + requestChecksumRequired: false + }), + middlewareSdkS3.getThrow200ExceptionsPlugin(config), + middlewareSsec.getSsecPlugin(config) + ]; + }).s("AmazonS3", "UploadPart", {}).n("S3Client", "UploadPartCommand").sc(schemas_0.UploadPart$).build() { + }; + var UploadPartCopyCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + DisableS3ExpressSessionAuth: { type: "staticContextParams", value: true }, + Bucket: { type: "contextParams", name: "Bucket" } + }).m(function(Command, cs, config, o4) { + return [ + middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + middlewareSdkS3.getThrow200ExceptionsPlugin(config), + middlewareSsec.getSsecPlugin(config) + ]; + }).s("AmazonS3", "UploadPartCopy", {}).n("S3Client", "UploadPartCopyCommand").sc(schemas_0.UploadPartCopy$).build() { + }; + var WriteGetObjectResponseCommand = class extends smithyClient.Command.classBuilder().ep({ + ...commonParams4, + UseObjectLambdaEndpoint: { type: "staticContextParams", value: true } + }).m(function(Command, cs, config, o4) { + return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())]; + }).s("AmazonS3", "WriteGetObjectResponse", {}).n("S3Client", "WriteGetObjectResponseCommand").sc(schemas_0.WriteGetObjectResponse$).build() { + }; + var paginateListBuckets = core.createPaginator(S3Client, ListBucketsCommand, "ContinuationToken", "ContinuationToken", "MaxBuckets"); + var paginateListDirectoryBuckets = core.createPaginator(S3Client, ListDirectoryBucketsCommand, "ContinuationToken", "ContinuationToken", "MaxDirectoryBuckets"); + var paginateListObjectsV2 = core.createPaginator(S3Client, ListObjectsV2Command, "ContinuationToken", "NextContinuationToken", "MaxKeys"); + var paginateListParts = core.createPaginator(S3Client, ListPartsCommand, "PartNumberMarker", "NextPartNumberMarker", "MaxParts"); + var checkState$3 = async (client, input) => { + let reason; + try { + let result = await client.send(new HeadBucketCommand(input)); + reason = result; + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } catch (exception) { + reason = exception; + if (exception.name && exception.name == "NotFound") { + return { state: utilWaiter.WaiterState.RETRY, reason }; + } + } + return { state: utilWaiter.WaiterState.RETRY, reason }; + }; + var waitForBucketExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$3); + }; + var waitUntilBucketExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$3); + return utilWaiter.checkExceptions(result); + }; + var checkState$2 = async (client, input) => { + let reason; + try { + let result = await client.send(new HeadBucketCommand(input)); + reason = result; + } catch (exception) { + reason = exception; + if (exception.name && exception.name == "NotFound") { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + return { state: utilWaiter.WaiterState.RETRY, reason }; + }; + var waitForBucketNotExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$2); + }; + var waitUntilBucketNotExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$2); + return utilWaiter.checkExceptions(result); + }; + var checkState$1 = async (client, input) => { + let reason; + try { + let result = await client.send(new HeadObjectCommand(input)); + reason = result; + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } catch (exception) { + reason = exception; + if (exception.name && exception.name == "NotFound") { + return { state: utilWaiter.WaiterState.RETRY, reason }; + } + } + return { state: utilWaiter.WaiterState.RETRY, reason }; + }; + var waitForObjectExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$1); + }; + var waitUntilObjectExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState$1); + return utilWaiter.checkExceptions(result); + }; + var checkState = async (client, input) => { + let reason; + try { + let result = await client.send(new HeadObjectCommand(input)); + reason = result; + } catch (exception) { + reason = exception; + if (exception.name && exception.name == "NotFound") { + return { state: utilWaiter.WaiterState.SUCCESS, reason }; + } + } + return { state: utilWaiter.WaiterState.RETRY, reason }; + }; + var waitForObjectNotExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + return utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState); + }; + var waitUntilObjectNotExists = async (params, input) => { + const serviceDefaults = { minDelay: 5, maxDelay: 120 }; + const result = await utilWaiter.createWaiter({ ...serviceDefaults, ...params }, input, checkState); + return utilWaiter.checkExceptions(result); + }; + var commands4 = { + AbortMultipartUploadCommand, + CompleteMultipartUploadCommand, + CopyObjectCommand, + CreateBucketCommand, + CreateBucketMetadataConfigurationCommand, + CreateBucketMetadataTableConfigurationCommand, + CreateMultipartUploadCommand, + CreateSessionCommand, + DeleteBucketCommand, + DeleteBucketAnalyticsConfigurationCommand, + DeleteBucketCorsCommand, + DeleteBucketEncryptionCommand, + DeleteBucketIntelligentTieringConfigurationCommand, + DeleteBucketInventoryConfigurationCommand, + DeleteBucketLifecycleCommand, + DeleteBucketMetadataConfigurationCommand, + DeleteBucketMetadataTableConfigurationCommand, + DeleteBucketMetricsConfigurationCommand, + DeleteBucketOwnershipControlsCommand, + DeleteBucketPolicyCommand, + DeleteBucketReplicationCommand, + DeleteBucketTaggingCommand, + DeleteBucketWebsiteCommand, + DeleteObjectCommand, + DeleteObjectsCommand, + DeleteObjectTaggingCommand, + DeletePublicAccessBlockCommand, + GetBucketAbacCommand, + GetBucketAccelerateConfigurationCommand, + GetBucketAclCommand, + GetBucketAnalyticsConfigurationCommand, + GetBucketCorsCommand, + GetBucketEncryptionCommand, + GetBucketIntelligentTieringConfigurationCommand, + GetBucketInventoryConfigurationCommand, + GetBucketLifecycleConfigurationCommand, + GetBucketLocationCommand, + GetBucketLoggingCommand, + GetBucketMetadataConfigurationCommand, + GetBucketMetadataTableConfigurationCommand, + GetBucketMetricsConfigurationCommand, + GetBucketNotificationConfigurationCommand, + GetBucketOwnershipControlsCommand, + GetBucketPolicyCommand, + GetBucketPolicyStatusCommand, + GetBucketReplicationCommand, + GetBucketRequestPaymentCommand, + GetBucketTaggingCommand, + GetBucketVersioningCommand, + GetBucketWebsiteCommand, + GetObjectCommand, + GetObjectAclCommand, + GetObjectAttributesCommand, + GetObjectLegalHoldCommand, + GetObjectLockConfigurationCommand, + GetObjectRetentionCommand, + GetObjectTaggingCommand, + GetObjectTorrentCommand, + GetPublicAccessBlockCommand, + HeadBucketCommand, + HeadObjectCommand, + ListBucketAnalyticsConfigurationsCommand, + ListBucketIntelligentTieringConfigurationsCommand, + ListBucketInventoryConfigurationsCommand, + ListBucketMetricsConfigurationsCommand, + ListBucketsCommand, + ListDirectoryBucketsCommand, + ListMultipartUploadsCommand, + ListObjectsCommand, + ListObjectsV2Command, + ListObjectVersionsCommand, + ListPartsCommand, + PutBucketAbacCommand, + PutBucketAccelerateConfigurationCommand, + PutBucketAclCommand, + PutBucketAnalyticsConfigurationCommand, + PutBucketCorsCommand, + PutBucketEncryptionCommand, + PutBucketIntelligentTieringConfigurationCommand, + PutBucketInventoryConfigurationCommand, + PutBucketLifecycleConfigurationCommand, + PutBucketLoggingCommand, + PutBucketMetricsConfigurationCommand, + PutBucketNotificationConfigurationCommand, + PutBucketOwnershipControlsCommand, + PutBucketPolicyCommand, + PutBucketReplicationCommand, + PutBucketRequestPaymentCommand, + PutBucketTaggingCommand, + PutBucketVersioningCommand, + PutBucketWebsiteCommand, + PutObjectCommand, + PutObjectAclCommand, + PutObjectLegalHoldCommand, + PutObjectLockConfigurationCommand, + PutObjectRetentionCommand, + PutObjectTaggingCommand, + PutPublicAccessBlockCommand, + RenameObjectCommand, + RestoreObjectCommand, + SelectObjectContentCommand, + UpdateBucketMetadataInventoryTableConfigurationCommand, + UpdateBucketMetadataJournalTableConfigurationCommand, + UpdateObjectEncryptionCommand, + UploadPartCommand, + UploadPartCopyCommand, + WriteGetObjectResponseCommand + }; + var paginators = { + paginateListBuckets, + paginateListDirectoryBuckets, + paginateListObjectsV2, + paginateListParts + }; + var waiters = { + waitUntilBucketExists, + waitUntilBucketNotExists, + waitUntilObjectExists, + waitUntilObjectNotExists + }; + var S3 = class extends S3Client { + }; + smithyClient.createAggregatedClient(commands4, S3, { paginators, waiters }); + var BucketAbacStatus = { + Disabled: "Disabled", + Enabled: "Enabled" + }; + var RequestCharged = { + requester: "requester" + }; + var RequestPayer = { + requester: "requester" + }; + var BucketAccelerateStatus = { + Enabled: "Enabled", + Suspended: "Suspended" + }; + var Type = { + AmazonCustomerByEmail: "AmazonCustomerByEmail", + CanonicalUser: "CanonicalUser", + Group: "Group" + }; + var Permission = { + FULL_CONTROL: "FULL_CONTROL", + READ: "READ", + READ_ACP: "READ_ACP", + WRITE: "WRITE", + WRITE_ACP: "WRITE_ACP" + }; + var OwnerOverride = { + Destination: "Destination" + }; + var ChecksumType = { + COMPOSITE: "COMPOSITE", + FULL_OBJECT: "FULL_OBJECT" + }; + var ServerSideEncryption = { + AES256: "AES256", + aws_fsx: "aws:fsx", + aws_kms: "aws:kms", + aws_kms_dsse: "aws:kms:dsse" + }; + var ObjectCannedACL = { + authenticated_read: "authenticated-read", + aws_exec_read: "aws-exec-read", + bucket_owner_full_control: "bucket-owner-full-control", + bucket_owner_read: "bucket-owner-read", + private: "private", + public_read: "public-read", + public_read_write: "public-read-write" + }; + var ChecksumAlgorithm = { + CRC32: "CRC32", + CRC32C: "CRC32C", + CRC64NVME: "CRC64NVME", + SHA1: "SHA1", + SHA256: "SHA256" + }; + var MetadataDirective = { + COPY: "COPY", + REPLACE: "REPLACE" + }; + var ObjectLockLegalHoldStatus = { + OFF: "OFF", + ON: "ON" + }; + var ObjectLockMode = { + COMPLIANCE: "COMPLIANCE", + GOVERNANCE: "GOVERNANCE" + }; + var StorageClass = { + DEEP_ARCHIVE: "DEEP_ARCHIVE", + EXPRESS_ONEZONE: "EXPRESS_ONEZONE", + FSX_ONTAP: "FSX_ONTAP", + FSX_OPENZFS: "FSX_OPENZFS", + GLACIER: "GLACIER", + GLACIER_IR: "GLACIER_IR", + INTELLIGENT_TIERING: "INTELLIGENT_TIERING", + ONEZONE_IA: "ONEZONE_IA", + OUTPOSTS: "OUTPOSTS", + REDUCED_REDUNDANCY: "REDUCED_REDUNDANCY", + SNOW: "SNOW", + STANDARD: "STANDARD", + STANDARD_IA: "STANDARD_IA" + }; + var TaggingDirective = { + COPY: "COPY", + REPLACE: "REPLACE" + }; + var BucketCannedACL = { + authenticated_read: "authenticated-read", + private: "private", + public_read: "public-read", + public_read_write: "public-read-write" + }; + var DataRedundancy = { + SingleAvailabilityZone: "SingleAvailabilityZone", + SingleLocalZone: "SingleLocalZone" + }; + var BucketType = { + Directory: "Directory" + }; + var LocationType = { + AvailabilityZone: "AvailabilityZone", + LocalZone: "LocalZone" + }; + var BucketLocationConstraint = { + EU: "EU", + af_south_1: "af-south-1", + ap_east_1: "ap-east-1", + ap_northeast_1: "ap-northeast-1", + ap_northeast_2: "ap-northeast-2", + ap_northeast_3: "ap-northeast-3", + ap_south_1: "ap-south-1", + ap_south_2: "ap-south-2", + ap_southeast_1: "ap-southeast-1", + ap_southeast_2: "ap-southeast-2", + ap_southeast_3: "ap-southeast-3", + ap_southeast_4: "ap-southeast-4", + ap_southeast_5: "ap-southeast-5", + ca_central_1: "ca-central-1", + cn_north_1: "cn-north-1", + cn_northwest_1: "cn-northwest-1", + eu_central_1: "eu-central-1", + eu_central_2: "eu-central-2", + eu_north_1: "eu-north-1", + eu_south_1: "eu-south-1", + eu_south_2: "eu-south-2", + eu_west_1: "eu-west-1", + eu_west_2: "eu-west-2", + eu_west_3: "eu-west-3", + il_central_1: "il-central-1", + me_central_1: "me-central-1", + me_south_1: "me-south-1", + sa_east_1: "sa-east-1", + us_east_2: "us-east-2", + us_gov_east_1: "us-gov-east-1", + us_gov_west_1: "us-gov-west-1", + us_west_1: "us-west-1", + us_west_2: "us-west-2" + }; + var ObjectOwnership = { + BucketOwnerEnforced: "BucketOwnerEnforced", + BucketOwnerPreferred: "BucketOwnerPreferred", + ObjectWriter: "ObjectWriter" + }; + var InventoryConfigurationState = { + DISABLED: "DISABLED", + ENABLED: "ENABLED" + }; + var TableSseAlgorithm = { + AES256: "AES256", + aws_kms: "aws:kms" + }; + var ExpirationState = { + DISABLED: "DISABLED", + ENABLED: "ENABLED" + }; + var SessionMode = { + ReadOnly: "ReadOnly", + ReadWrite: "ReadWrite" + }; + var AnalyticsS3ExportFileFormat = { + CSV: "CSV" + }; + var StorageClassAnalysisSchemaVersion = { + V_1: "V_1" + }; + var EncryptionType = { + NONE: "NONE", + SSE_C: "SSE-C" + }; + var IntelligentTieringStatus = { + Disabled: "Disabled", + Enabled: "Enabled" + }; + var IntelligentTieringAccessTier = { + ARCHIVE_ACCESS: "ARCHIVE_ACCESS", + DEEP_ARCHIVE_ACCESS: "DEEP_ARCHIVE_ACCESS" + }; + var InventoryFormat = { + CSV: "CSV", + ORC: "ORC", + Parquet: "Parquet" + }; + var InventoryIncludedObjectVersions = { + All: "All", + Current: "Current" + }; + var InventoryOptionalField = { + BucketKeyStatus: "BucketKeyStatus", + ChecksumAlgorithm: "ChecksumAlgorithm", + ETag: "ETag", + EncryptionStatus: "EncryptionStatus", + IntelligentTieringAccessTier: "IntelligentTieringAccessTier", + IsMultipartUploaded: "IsMultipartUploaded", + LastModifiedDate: "LastModifiedDate", + LifecycleExpirationDate: "LifecycleExpirationDate", + ObjectAccessControlList: "ObjectAccessControlList", + ObjectLockLegalHoldStatus: "ObjectLockLegalHoldStatus", + ObjectLockMode: "ObjectLockMode", + ObjectLockRetainUntilDate: "ObjectLockRetainUntilDate", + ObjectOwner: "ObjectOwner", + ReplicationStatus: "ReplicationStatus", + Size: "Size", + StorageClass: "StorageClass" + }; + var InventoryFrequency = { + Daily: "Daily", + Weekly: "Weekly" + }; + var TransitionStorageClass = { + DEEP_ARCHIVE: "DEEP_ARCHIVE", + GLACIER: "GLACIER", + GLACIER_IR: "GLACIER_IR", + INTELLIGENT_TIERING: "INTELLIGENT_TIERING", + ONEZONE_IA: "ONEZONE_IA", + STANDARD_IA: "STANDARD_IA" + }; + var ExpirationStatus = { + Disabled: "Disabled", + Enabled: "Enabled" + }; + var TransitionDefaultMinimumObjectSize = { + all_storage_classes_128K: "all_storage_classes_128K", + varies_by_storage_class: "varies_by_storage_class" + }; + var BucketLogsPermission = { + FULL_CONTROL: "FULL_CONTROL", + READ: "READ", + WRITE: "WRITE" + }; + var PartitionDateSource = { + DeliveryTime: "DeliveryTime", + EventTime: "EventTime" + }; + var S3TablesBucketType = { + aws: "aws", + customer: "customer" + }; + var Event = { + s3_IntelligentTiering: "s3:IntelligentTiering", + s3_LifecycleExpiration_: "s3:LifecycleExpiration:*", + s3_LifecycleExpiration_Delete: "s3:LifecycleExpiration:Delete", + s3_LifecycleExpiration_DeleteMarkerCreated: "s3:LifecycleExpiration:DeleteMarkerCreated", + s3_LifecycleTransition: "s3:LifecycleTransition", + s3_ObjectAcl_Put: "s3:ObjectAcl:Put", + s3_ObjectCreated_: "s3:ObjectCreated:*", + s3_ObjectCreated_CompleteMultipartUpload: "s3:ObjectCreated:CompleteMultipartUpload", + s3_ObjectCreated_Copy: "s3:ObjectCreated:Copy", + s3_ObjectCreated_Post: "s3:ObjectCreated:Post", + s3_ObjectCreated_Put: "s3:ObjectCreated:Put", + s3_ObjectRemoved_: "s3:ObjectRemoved:*", + s3_ObjectRemoved_Delete: "s3:ObjectRemoved:Delete", + s3_ObjectRemoved_DeleteMarkerCreated: "s3:ObjectRemoved:DeleteMarkerCreated", + s3_ObjectRestore_: "s3:ObjectRestore:*", + s3_ObjectRestore_Completed: "s3:ObjectRestore:Completed", + s3_ObjectRestore_Delete: "s3:ObjectRestore:Delete", + s3_ObjectRestore_Post: "s3:ObjectRestore:Post", + s3_ObjectTagging_: "s3:ObjectTagging:*", + s3_ObjectTagging_Delete: "s3:ObjectTagging:Delete", + s3_ObjectTagging_Put: "s3:ObjectTagging:Put", + s3_ReducedRedundancyLostObject: "s3:ReducedRedundancyLostObject", + s3_Replication_: "s3:Replication:*", + s3_Replication_OperationFailedReplication: "s3:Replication:OperationFailedReplication", + s3_Replication_OperationMissedThreshold: "s3:Replication:OperationMissedThreshold", + s3_Replication_OperationNotTracked: "s3:Replication:OperationNotTracked", + s3_Replication_OperationReplicatedAfterThreshold: "s3:Replication:OperationReplicatedAfterThreshold" + }; + var FilterRuleName = { + prefix: "prefix", + suffix: "suffix" + }; + var DeleteMarkerReplicationStatus = { + Disabled: "Disabled", + Enabled: "Enabled" + }; + var MetricsStatus = { + Disabled: "Disabled", + Enabled: "Enabled" + }; + var ReplicationTimeStatus = { + Disabled: "Disabled", + Enabled: "Enabled" + }; + var ExistingObjectReplicationStatus = { + Disabled: "Disabled", + Enabled: "Enabled" + }; + var ReplicaModificationsStatus = { + Disabled: "Disabled", + Enabled: "Enabled" + }; + var SseKmsEncryptedObjectsStatus = { + Disabled: "Disabled", + Enabled: "Enabled" + }; + var ReplicationRuleStatus = { + Disabled: "Disabled", + Enabled: "Enabled" + }; + var Payer = { + BucketOwner: "BucketOwner", + Requester: "Requester" + }; + var MFADeleteStatus = { + Disabled: "Disabled", + Enabled: "Enabled" + }; + var BucketVersioningStatus = { + Enabled: "Enabled", + Suspended: "Suspended" + }; + var Protocol = { + http: "http", + https: "https" + }; + var ReplicationStatus = { + COMPLETE: "COMPLETE", + COMPLETED: "COMPLETED", + FAILED: "FAILED", + PENDING: "PENDING", + REPLICA: "REPLICA" + }; + var ChecksumMode = { + ENABLED: "ENABLED" + }; + var ObjectAttributes = { + CHECKSUM: "Checksum", + ETAG: "ETag", + OBJECT_PARTS: "ObjectParts", + OBJECT_SIZE: "ObjectSize", + STORAGE_CLASS: "StorageClass" + }; + var ObjectLockEnabled = { + Enabled: "Enabled" + }; + var ObjectLockRetentionMode = { + COMPLIANCE: "COMPLIANCE", + GOVERNANCE: "GOVERNANCE" + }; + var ArchiveStatus = { + ARCHIVE_ACCESS: "ARCHIVE_ACCESS", + DEEP_ARCHIVE_ACCESS: "DEEP_ARCHIVE_ACCESS" + }; + var EncodingType = { + url: "url" + }; + var ObjectStorageClass = { + DEEP_ARCHIVE: "DEEP_ARCHIVE", + EXPRESS_ONEZONE: "EXPRESS_ONEZONE", + FSX_ONTAP: "FSX_ONTAP", + FSX_OPENZFS: "FSX_OPENZFS", + GLACIER: "GLACIER", + GLACIER_IR: "GLACIER_IR", + INTELLIGENT_TIERING: "INTELLIGENT_TIERING", + ONEZONE_IA: "ONEZONE_IA", + OUTPOSTS: "OUTPOSTS", + REDUCED_REDUNDANCY: "REDUCED_REDUNDANCY", + SNOW: "SNOW", + STANDARD: "STANDARD", + STANDARD_IA: "STANDARD_IA" + }; + var OptionalObjectAttributes = { + RESTORE_STATUS: "RestoreStatus" + }; + var ObjectVersionStorageClass = { + STANDARD: "STANDARD" + }; + var MFADelete = { + Disabled: "Disabled", + Enabled: "Enabled" + }; + var Tier = { + Bulk: "Bulk", + Expedited: "Expedited", + Standard: "Standard" + }; + var ExpressionType = { + SQL: "SQL" + }; + var CompressionType = { + BZIP2: "BZIP2", + GZIP: "GZIP", + NONE: "NONE" + }; + var FileHeaderInfo = { + IGNORE: "IGNORE", + NONE: "NONE", + USE: "USE" + }; + var JSONType = { + DOCUMENT: "DOCUMENT", + LINES: "LINES" + }; + var QuoteFields = { + ALWAYS: "ALWAYS", + ASNEEDED: "ASNEEDED" + }; + var RestoreRequestType = { + SELECT: "SELECT" + }; + Object.defineProperty(exports2, "$Command", { + enumerable: true, + get: function() { + return smithyClient.Command; + } + }); + Object.defineProperty(exports2, "__Client", { + enumerable: true, + get: function() { + return smithyClient.Client; + } + }); + Object.defineProperty(exports2, "S3ServiceException", { + enumerable: true, + get: function() { + return S3ServiceException.S3ServiceException; + } + }); + exports2.AbortMultipartUploadCommand = AbortMultipartUploadCommand; + exports2.AnalyticsS3ExportFileFormat = AnalyticsS3ExportFileFormat; + exports2.ArchiveStatus = ArchiveStatus; + exports2.BucketAbacStatus = BucketAbacStatus; + exports2.BucketAccelerateStatus = BucketAccelerateStatus; + exports2.BucketCannedACL = BucketCannedACL; + exports2.BucketLocationConstraint = BucketLocationConstraint; + exports2.BucketLogsPermission = BucketLogsPermission; + exports2.BucketType = BucketType; + exports2.BucketVersioningStatus = BucketVersioningStatus; + exports2.ChecksumAlgorithm = ChecksumAlgorithm; + exports2.ChecksumMode = ChecksumMode; + exports2.ChecksumType = ChecksumType; + exports2.CompleteMultipartUploadCommand = CompleteMultipartUploadCommand; + exports2.CompressionType = CompressionType; + exports2.CopyObjectCommand = CopyObjectCommand; + exports2.CreateBucketCommand = CreateBucketCommand; + exports2.CreateBucketMetadataConfigurationCommand = CreateBucketMetadataConfigurationCommand; + exports2.CreateBucketMetadataTableConfigurationCommand = CreateBucketMetadataTableConfigurationCommand; + exports2.CreateMultipartUploadCommand = CreateMultipartUploadCommand; + exports2.CreateSessionCommand = CreateSessionCommand; + exports2.DataRedundancy = DataRedundancy; + exports2.DeleteBucketAnalyticsConfigurationCommand = DeleteBucketAnalyticsConfigurationCommand; + exports2.DeleteBucketCommand = DeleteBucketCommand; + exports2.DeleteBucketCorsCommand = DeleteBucketCorsCommand; + exports2.DeleteBucketEncryptionCommand = DeleteBucketEncryptionCommand; + exports2.DeleteBucketIntelligentTieringConfigurationCommand = DeleteBucketIntelligentTieringConfigurationCommand; + exports2.DeleteBucketInventoryConfigurationCommand = DeleteBucketInventoryConfigurationCommand; + exports2.DeleteBucketLifecycleCommand = DeleteBucketLifecycleCommand; + exports2.DeleteBucketMetadataConfigurationCommand = DeleteBucketMetadataConfigurationCommand; + exports2.DeleteBucketMetadataTableConfigurationCommand = DeleteBucketMetadataTableConfigurationCommand; + exports2.DeleteBucketMetricsConfigurationCommand = DeleteBucketMetricsConfigurationCommand; + exports2.DeleteBucketOwnershipControlsCommand = DeleteBucketOwnershipControlsCommand; + exports2.DeleteBucketPolicyCommand = DeleteBucketPolicyCommand; + exports2.DeleteBucketReplicationCommand = DeleteBucketReplicationCommand; + exports2.DeleteBucketTaggingCommand = DeleteBucketTaggingCommand; + exports2.DeleteBucketWebsiteCommand = DeleteBucketWebsiteCommand; + exports2.DeleteMarkerReplicationStatus = DeleteMarkerReplicationStatus; + exports2.DeleteObjectCommand = DeleteObjectCommand; + exports2.DeleteObjectTaggingCommand = DeleteObjectTaggingCommand; + exports2.DeleteObjectsCommand = DeleteObjectsCommand; + exports2.DeletePublicAccessBlockCommand = DeletePublicAccessBlockCommand; + exports2.EncodingType = EncodingType; + exports2.EncryptionType = EncryptionType; + exports2.Event = Event; + exports2.ExistingObjectReplicationStatus = ExistingObjectReplicationStatus; + exports2.ExpirationState = ExpirationState; + exports2.ExpirationStatus = ExpirationStatus; + exports2.ExpressionType = ExpressionType; + exports2.FileHeaderInfo = FileHeaderInfo; + exports2.FilterRuleName = FilterRuleName; + exports2.GetBucketAbacCommand = GetBucketAbacCommand; + exports2.GetBucketAccelerateConfigurationCommand = GetBucketAccelerateConfigurationCommand; + exports2.GetBucketAclCommand = GetBucketAclCommand; + exports2.GetBucketAnalyticsConfigurationCommand = GetBucketAnalyticsConfigurationCommand; + exports2.GetBucketCorsCommand = GetBucketCorsCommand; + exports2.GetBucketEncryptionCommand = GetBucketEncryptionCommand; + exports2.GetBucketIntelligentTieringConfigurationCommand = GetBucketIntelligentTieringConfigurationCommand; + exports2.GetBucketInventoryConfigurationCommand = GetBucketInventoryConfigurationCommand; + exports2.GetBucketLifecycleConfigurationCommand = GetBucketLifecycleConfigurationCommand; + exports2.GetBucketLocationCommand = GetBucketLocationCommand; + exports2.GetBucketLoggingCommand = GetBucketLoggingCommand; + exports2.GetBucketMetadataConfigurationCommand = GetBucketMetadataConfigurationCommand; + exports2.GetBucketMetadataTableConfigurationCommand = GetBucketMetadataTableConfigurationCommand; + exports2.GetBucketMetricsConfigurationCommand = GetBucketMetricsConfigurationCommand; + exports2.GetBucketNotificationConfigurationCommand = GetBucketNotificationConfigurationCommand; + exports2.GetBucketOwnershipControlsCommand = GetBucketOwnershipControlsCommand; + exports2.GetBucketPolicyCommand = GetBucketPolicyCommand; + exports2.GetBucketPolicyStatusCommand = GetBucketPolicyStatusCommand; + exports2.GetBucketReplicationCommand = GetBucketReplicationCommand; + exports2.GetBucketRequestPaymentCommand = GetBucketRequestPaymentCommand; + exports2.GetBucketTaggingCommand = GetBucketTaggingCommand; + exports2.GetBucketVersioningCommand = GetBucketVersioningCommand; + exports2.GetBucketWebsiteCommand = GetBucketWebsiteCommand; + exports2.GetObjectAclCommand = GetObjectAclCommand; + exports2.GetObjectAttributesCommand = GetObjectAttributesCommand; + exports2.GetObjectCommand = GetObjectCommand; + exports2.GetObjectLegalHoldCommand = GetObjectLegalHoldCommand; + exports2.GetObjectLockConfigurationCommand = GetObjectLockConfigurationCommand; + exports2.GetObjectRetentionCommand = GetObjectRetentionCommand; + exports2.GetObjectTaggingCommand = GetObjectTaggingCommand; + exports2.GetObjectTorrentCommand = GetObjectTorrentCommand; + exports2.GetPublicAccessBlockCommand = GetPublicAccessBlockCommand; + exports2.HeadBucketCommand = HeadBucketCommand; + exports2.HeadObjectCommand = HeadObjectCommand; + exports2.IntelligentTieringAccessTier = IntelligentTieringAccessTier; + exports2.IntelligentTieringStatus = IntelligentTieringStatus; + exports2.InventoryConfigurationState = InventoryConfigurationState; + exports2.InventoryFormat = InventoryFormat; + exports2.InventoryFrequency = InventoryFrequency; + exports2.InventoryIncludedObjectVersions = InventoryIncludedObjectVersions; + exports2.InventoryOptionalField = InventoryOptionalField; + exports2.JSONType = JSONType; + exports2.ListBucketAnalyticsConfigurationsCommand = ListBucketAnalyticsConfigurationsCommand; + exports2.ListBucketIntelligentTieringConfigurationsCommand = ListBucketIntelligentTieringConfigurationsCommand; + exports2.ListBucketInventoryConfigurationsCommand = ListBucketInventoryConfigurationsCommand; + exports2.ListBucketMetricsConfigurationsCommand = ListBucketMetricsConfigurationsCommand; + exports2.ListBucketsCommand = ListBucketsCommand; + exports2.ListDirectoryBucketsCommand = ListDirectoryBucketsCommand; + exports2.ListMultipartUploadsCommand = ListMultipartUploadsCommand; + exports2.ListObjectVersionsCommand = ListObjectVersionsCommand; + exports2.ListObjectsCommand = ListObjectsCommand; + exports2.ListObjectsV2Command = ListObjectsV2Command; + exports2.ListPartsCommand = ListPartsCommand; + exports2.LocationType = LocationType; + exports2.MFADelete = MFADelete; + exports2.MFADeleteStatus = MFADeleteStatus; + exports2.MetadataDirective = MetadataDirective; + exports2.MetricsStatus = MetricsStatus; + exports2.ObjectAttributes = ObjectAttributes; + exports2.ObjectCannedACL = ObjectCannedACL; + exports2.ObjectLockEnabled = ObjectLockEnabled; + exports2.ObjectLockLegalHoldStatus = ObjectLockLegalHoldStatus; + exports2.ObjectLockMode = ObjectLockMode; + exports2.ObjectLockRetentionMode = ObjectLockRetentionMode; + exports2.ObjectOwnership = ObjectOwnership; + exports2.ObjectStorageClass = ObjectStorageClass; + exports2.ObjectVersionStorageClass = ObjectVersionStorageClass; + exports2.OptionalObjectAttributes = OptionalObjectAttributes; + exports2.OwnerOverride = OwnerOverride; + exports2.PartitionDateSource = PartitionDateSource; + exports2.Payer = Payer; + exports2.Permission = Permission; + exports2.Protocol = Protocol; + exports2.PutBucketAbacCommand = PutBucketAbacCommand; + exports2.PutBucketAccelerateConfigurationCommand = PutBucketAccelerateConfigurationCommand; + exports2.PutBucketAclCommand = PutBucketAclCommand; + exports2.PutBucketAnalyticsConfigurationCommand = PutBucketAnalyticsConfigurationCommand; + exports2.PutBucketCorsCommand = PutBucketCorsCommand; + exports2.PutBucketEncryptionCommand = PutBucketEncryptionCommand; + exports2.PutBucketIntelligentTieringConfigurationCommand = PutBucketIntelligentTieringConfigurationCommand; + exports2.PutBucketInventoryConfigurationCommand = PutBucketInventoryConfigurationCommand; + exports2.PutBucketLifecycleConfigurationCommand = PutBucketLifecycleConfigurationCommand; + exports2.PutBucketLoggingCommand = PutBucketLoggingCommand; + exports2.PutBucketMetricsConfigurationCommand = PutBucketMetricsConfigurationCommand; + exports2.PutBucketNotificationConfigurationCommand = PutBucketNotificationConfigurationCommand; + exports2.PutBucketOwnershipControlsCommand = PutBucketOwnershipControlsCommand; + exports2.PutBucketPolicyCommand = PutBucketPolicyCommand; + exports2.PutBucketReplicationCommand = PutBucketReplicationCommand; + exports2.PutBucketRequestPaymentCommand = PutBucketRequestPaymentCommand; + exports2.PutBucketTaggingCommand = PutBucketTaggingCommand; + exports2.PutBucketVersioningCommand = PutBucketVersioningCommand; + exports2.PutBucketWebsiteCommand = PutBucketWebsiteCommand; + exports2.PutObjectAclCommand = PutObjectAclCommand; + exports2.PutObjectCommand = PutObjectCommand; + exports2.PutObjectLegalHoldCommand = PutObjectLegalHoldCommand; + exports2.PutObjectLockConfigurationCommand = PutObjectLockConfigurationCommand; + exports2.PutObjectRetentionCommand = PutObjectRetentionCommand; + exports2.PutObjectTaggingCommand = PutObjectTaggingCommand; + exports2.PutPublicAccessBlockCommand = PutPublicAccessBlockCommand; + exports2.QuoteFields = QuoteFields; + exports2.RenameObjectCommand = RenameObjectCommand; + exports2.ReplicaModificationsStatus = ReplicaModificationsStatus; + exports2.ReplicationRuleStatus = ReplicationRuleStatus; + exports2.ReplicationStatus = ReplicationStatus; + exports2.ReplicationTimeStatus = ReplicationTimeStatus; + exports2.RequestCharged = RequestCharged; + exports2.RequestPayer = RequestPayer; + exports2.RestoreObjectCommand = RestoreObjectCommand; + exports2.RestoreRequestType = RestoreRequestType; + exports2.S3 = S3; + exports2.S3Client = S3Client; + exports2.S3TablesBucketType = S3TablesBucketType; + exports2.SelectObjectContentCommand = SelectObjectContentCommand; + exports2.ServerSideEncryption = ServerSideEncryption; + exports2.SessionMode = SessionMode; + exports2.SseKmsEncryptedObjectsStatus = SseKmsEncryptedObjectsStatus; + exports2.StorageClass = StorageClass; + exports2.StorageClassAnalysisSchemaVersion = StorageClassAnalysisSchemaVersion; + exports2.TableSseAlgorithm = TableSseAlgorithm; + exports2.TaggingDirective = TaggingDirective; + exports2.Tier = Tier; + exports2.TransitionDefaultMinimumObjectSize = TransitionDefaultMinimumObjectSize; + exports2.TransitionStorageClass = TransitionStorageClass; + exports2.Type = Type; + exports2.UpdateBucketMetadataInventoryTableConfigurationCommand = UpdateBucketMetadataInventoryTableConfigurationCommand; + exports2.UpdateBucketMetadataJournalTableConfigurationCommand = UpdateBucketMetadataJournalTableConfigurationCommand; + exports2.UpdateObjectEncryptionCommand = UpdateObjectEncryptionCommand; + exports2.UploadPartCommand = UploadPartCommand; + exports2.UploadPartCopyCommand = UploadPartCopyCommand; + exports2.WriteGetObjectResponseCommand = WriteGetObjectResponseCommand; + exports2.paginateListBuckets = paginateListBuckets; + exports2.paginateListDirectoryBuckets = paginateListDirectoryBuckets; + exports2.paginateListObjectsV2 = paginateListObjectsV2; + exports2.paginateListParts = paginateListParts; + exports2.waitForBucketExists = waitForBucketExists; + exports2.waitForBucketNotExists = waitForBucketNotExists; + exports2.waitForObjectExists = waitForObjectExists; + exports2.waitForObjectNotExists = waitForObjectNotExists; + exports2.waitUntilBucketExists = waitUntilBucketExists; + exports2.waitUntilBucketNotExists = waitUntilBucketNotExists; + exports2.waitUntilObjectExists = waitUntilObjectExists; + exports2.waitUntilObjectNotExists = waitUntilObjectNotExists; + Object.keys(schemas_0).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return schemas_0[k4]; + } + }); + }); + Object.keys(errors).forEach(function(k4) { + if (k4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k4)) Object.defineProperty(exports2, k4, { + enumerable: true, + get: function() { + return errors[k4]; + } + }); + }); + } +}); + +// config/r2Client.js +var require_r2Client = __commonJS({ + "config/r2Client.js"(exports2, module2) { + var { S3Client } = require_dist_cjs75(); + var r22 = new S3Client({ + region: "auto", + endpoint: `https://${process.env.R2_ACCOUNT_ID}.r2.cloudflarestorage.com`, + credentials: { + accessKeyId: process.env.R2_ACCESS_KEY, + secretAccessKey: process.env.R2_SECRET_KEY + } + }); + module2.exports = r22; + } +}); + +// controller/ImageController.js +var require_ImageController = __commonJS({ + "controller/ImageController.js"(exports2, module2) { + var multer = require_multer(); + var sharp = require("sharp"); + var errorHandler = require_joiErrorHandler(); + var { + checkCategoryImageExistsDB + } = require_categoryController(); + var { checkMenuItemImageExistsDB } = require_menuItemController(); + var { checkAdsImageExistsDB } = require_adsController(); + var { checkRestaurantsImageExistDB } = require_restaurantController(); + var { PutObjectCommand } = require_dist_cjs75(); + var r22 = require_r2Client(); + var upload = multer({ storage: multer.memoryStorage() }); + var uploadImage = async (req, res) => { + try { + const file = req.file; + if (!file) { + return res.status(400).json({ + success: false, + message: "Image file is required" + }); + } + let buffer = await sharp(file.buffer).webp({ quality: 85 }).toBuffer(); + if (buffer.length > 2 * 1024 * 1024) { + buffer = await sharp(file.buffer).resize({ width: 1800 }).webp({ quality: 70 }).toBuffer(); + } + if (buffer.length > 2 * 1024 * 1024) { + buffer = await sharp(file.buffer).resize({ width: 1400 }).webp({ quality: 60 }).toBuffer(); + } + const fileName = `${Date.now()}-${file.originalname}`.replace( + /\.(jpg|jpeg|png|gif|webp)/gi, + ".webp" + ); + await r22.send( + new PutObjectCommand({ + Bucket: process.env.R2_BUCKET, + Key: fileName, + Body: buffer, + ContentType: "image/webp" + }) + ); + const imageUrl = `${process.env.R2_PUBLIC_URL}/${fileName}`; + return res.status(201).json({ + success: true, + message: "Image uploaded successfully", + url: imageUrl, + sizeKB: Math.round(buffer.length / 1024), + fileName + }); + } catch (error2) { + console.log("Upload Image Error:", error2); + return res.status(500).json({ + success: false, + message: "Image upload failed", + error: error2.message + }); + } + }; + var deleteImage = async (req, res) => { + try { + const { fileName, tableName, id } = req.body; + if (!fileName) { + return res.status(400).json({ + success: false, + message: "fileName is required" + }); + } + if (tableName) { + let response = null; + if (tableName == "category") { + response = await checkCategoryImageExistsDB(fileName, id); + } + if (tableName == "menu_item") { + response = await checkMenuItemImageExistsDB(fileName, id); + } + if (tableName == "ads") { + response = await checkAdsImageExistsDB(fileName, id); + } + if (tableName == "restaurants") { + response = await checkRestaurantsImageExistDB(fileName, id); + } + if (response?.exists) { + return res.status(200).json({ + success: true, + message: "It's a Shared Image, removed successfully" + }); + } + } + const { error: error2 } = await supabase.storage.from(process.env.SUPABASE_BUCKET).remove([fileName]); + if (error2) { + return res.status(500).json({ + success: false, + message: "Failed to delete image", + error: error2 + }); + } + return res.status(200).json({ + success: true, + message: "Image deleted successfully" + }); + } catch (error2) { + console.log("Delete Image Error:", error2); + return res.status(500).json(errorHandler(error2)); + } + }; + var uploadPdf = async (req, res) => { + try { + const file = req.file; + if (!file) { + return res.status(400).json({ + success: false, + message: "PDF file is required" + }); + } + const MAX_PDF_SIZE_MB = 5; + const MAX_PDF_SIZE_BYTES = MAX_PDF_SIZE_MB * 1024 * 1024; + if (file.buffer.length > MAX_PDF_SIZE_BYTES) { + return res.status(400).json({ + success: false, + message: `PDF file size exceeds the ${MAX_PDF_SIZE_MB}MB limit` + }); + } + const timestamp = Date.now(); + const fileName = `${timestamp}-${file.originalname.replace(/\.[^/.]+$/, "")}.pdf`; + const { error: error2 } = await supabase.storage.from(process.env.SUPABASE_BUCKET).upload(fileName, file.buffer, { + upsert: true, + contentType: "application/pdf" + }); + if (error2) { + return res.status(500).json({ + success: false, + message: "PDF upload failed", + error: error2 + }); + } + const { data: publicData } = supabase.storage.from(process.env.SUPABASE_BUCKET).getPublicUrl(fileName); + return res.status(201).json({ + success: true, + message: "PDF uploaded successfully", + url: publicData.publicUrl, + sizeKB: Math.round(file.buffer.length / 1024), + fileName + }); + } catch (error2) { + console.log("Upload PDF Error:", error2); + return res.status(500).json(errorHandler(error2)); + } + }; + var deletePdf = async (req, res) => { + try { + const { fileName } = req.body; + if (!fileName) { + return res.status(400).json({ + success: false, + message: "fileName is required" + }); + } + const { error: error2 } = await supabase.storage.from(process.env.SUPABASE_BUCKET).remove([fileName]); + if (error2) { + return res.status(500).json({ + success: false, + message: "Failed to delete PDF", + error: error2 + }); + } + return res.status(200).json({ + success: true, + message: "PDF deleted successfully" + }); + } catch (error2) { + console.log("Delete PDF Error:", error2); + return res.status(500).json(errorHandler(error2)); + } + }; + async function deleteImageDirectly(fileName) { + if (!fileName) return; + supabase.storage.from(process.env.SUPABASE_BUCKET).remove([fileName]).then(() => console.log("\u2714 Image deleted in background:", fileName)).catch((err) => console.log("\u2757 Async delete failed:", err.message)); + } + module2.exports = { + upload, + uploadImage, + deleteImage, + deleteImageDirectly, + uploadPdf, + deletePdf + }; + } +}); + +// routes/imageUpload.js +var require_imageUpload = __commonJS({ + "routes/imageUpload.js"(exports2, module2) { + var express2 = require_express2(); + var router = express2.Router(); + var { + upload, + uploadImage, + deletePdf, + uploadPdf + } = require_ImageController(); + var { deleteImage } = require_ImageController(); + router.post("/upload", upload.single("image"), uploadImage); + router.post("/delete", deleteImage); + router.post("/upload-pdf", upload.single("pdfFile"), uploadPdf); + router.post("/delete-pdf", deletePdf); + module2.exports = router; + } +}); + +// routes/menuItemRoute.js +var require_menuItemRoute = __commonJS({ + "routes/menuItemRoute.js"(exports2, module2) { + var express2 = require_express2(); + var router = express2.Router(); + var { + createMenuItem, + getMenuItems, + getItemsByCategory, + getMenuItemById, + updateMenuItem, + deleteMenuItem, + searchMenuItem, + updateMenuItemStatus, + getInactiveMenuItems + } = require_menuItemController(); + router.post("/", createMenuItem); + router.get("/", getMenuItems); + router.get("/inactive", getInactiveMenuItems); + router.get("/by-category/:category_id", getItemsByCategory); + router.get("/single/:id", getMenuItemById); + router.put("/:id", updateMenuItem); + router.delete("/:id", deleteMenuItem); + router.get("/search/:branch_id?", searchMenuItem); + router.put("/status/:id", updateMenuItemStatus); + module2.exports = router; + } +}); + +// model/specialTagModel.js +var require_specialTagModel = __commonJS({ + "model/specialTagModel.js"(exports2, module2) { + var mongoose2 = require_mongoose2(); + var Schema2 = mongoose2.Schema; + var specialTagSchema = new Schema2({ + branch_id: { + type: mongoose2.Schema.Types.ObjectId, + ref: "Branch" + }, + title: String, + display_order: Number, + is_active: Boolean, + menu_items: [{ + // Direct reference to MenuItems + type: mongoose2.Schema.Types.ObjectId, + ref: "MenuItem" + }] + }, { timestamps: true }); + specialTagSchema.index({ branch_id: 1, is_active: 1 }); + var SpecialTag = mongoose2.model("SpecialTag", specialTagSchema); + module2.exports = { SpecialTag }; + } +}); + +// controller/specialTagController.js +var require_specialTagController = __commonJS({ + "controller/specialTagController.js"(exports2, module2) { + var { SpecialTag } = require_specialTagModel(); + var { Branch } = require_resturantModel(); + var { MenuItem: MenuItem2 } = require_menuItemModel(); + var errorHandler = require_joiErrorHandler(); + var { sendResponse } = require_responseHelper(); + var createSpecialTag = async (req, res) => { + try { + const branch_id = req.user.branchId; + const { title, is_active, display_order } = req.body; + if (!branch_id || !title) { + return sendResponse(res, 400, "branch_id and title are required"); + } + const branch = await Branch.findById(branch_id); + if (!branch) { + return sendResponse(res, 404, "Branch not found"); + } + const exists = await SpecialTag.findOne({ + branch_id, + title: { $regex: new RegExp(`^${title.trim()}$`, "i") } + }); + if (exists) { + return sendResponse(res, 409, "Special tag already exists"); + } + const tag2 = await SpecialTag.create({ + branch_id, + title, + is_active: is_active ?? true, + display_order: display_order || 0, + menu_items: [] + }); + return sendResponse(res, 201, "Special tag created successfully", tag2); + } catch (error2) { + console.log("Create Special Tag Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var getSpecialTags = async (req, res) => { + try { + const branch_id = req.user.branchId; + const tags = await SpecialTag.find({ branch_id }).sort({ display_order: 1 }).lean(); + return sendResponse(res, 200, "Special tags fetched successfully", tags); + } catch (error2) { + return res.status(500).json(errorHandler(error2)); + } + }; + var updateSpecialTag = async (req, res) => { + try { + const { id } = req.params; + const tag2 = await SpecialTag.findById(id); + if (!tag2) { + return sendResponse(res, 404, "Special tag not found"); + } + const { title } = req.body; + if (title && title.trim()) { + const exists = await SpecialTag.findOne({ + title: { $regex: new RegExp(`^${title.trim()}$`, "i") }, + branch_id: tag2.branch_id, + _id: { $ne: id } + }); + if (exists) { + return sendResponse(res, 409, "Another tag with this name already exists"); + } + } + Object.assign(tag2, req.body); + await tag2.save(); + return sendResponse(res, 200, "Special tag updated successfully", tag2); + } catch (error2) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var deleteSpecialTag = async (req, res) => { + try { + const { id } = req.params; + const tag2 = await SpecialTag.findByIdAndDelete(id); + if (!tag2) { + return sendResponse(res, 404, "Special tag not found"); + } + return sendResponse(res, 200, "Special tag deleted successfully"); + } catch (error2) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var getSpecialTagItems = async (req, res) => { + try { + const { tag_id } = req.params; + const tag2 = await SpecialTag.findById(tag_id).populate({ + path: "menu_items", + select: "name image_url" + }).lean(); + if (!tag2) { + return sendResponse(res, 404, "Special tag not found"); + } + return sendResponse(res, 200, "Special tag items fetched successfully", tag2.menu_items || []); + } catch (error2) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var assignSpecialItems = async (req, res) => { + try { + const { special_tag_id, menu_item_ids } = req.body; + if (!special_tag_id || !menu_item_ids?.length) { + return sendResponse(res, 400, "special_tag_id & menu_item_ids required"); + } + await SpecialTag.updateOne( + { _id: special_tag_id }, + { $addToSet: { menu_items: { $each: menu_item_ids } } } + ); + return sendResponse(res, 200, "Items assigned successfully"); + } catch (error2) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var removeSpecialItem = async (req, res) => { + try { + const { special_tag_id, menu_item_id } = req.body; + if (!special_tag_id || !menu_item_id) { + return sendResponse(res, 400, "special_tag_id & menu_item_id are required"); + } + await SpecialTag.updateOne( + { _id: special_tag_id }, + { $pull: { menu_items: menu_item_id } } + ); + return sendResponse(res, 200, "Item removed from tag"); + } catch (error2) { + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + module2.exports = { + createSpecialTag, + getSpecialTags, + updateSpecialTag, + deleteSpecialTag, + getSpecialTagItems, + assignSpecialItems, + removeSpecialItem + }; + } +}); + +// routes/specialTagRoutes.js +var require_specialTagRoutes = __commonJS({ + "routes/specialTagRoutes.js"(exports2, module2) { + var express2 = require_express2(); + var router = express2.Router(); + var { + createSpecialTag, + getSpecialTags, + updateSpecialTag, + deleteSpecialTag, + getSpecialTagItems, + assignSpecialItems, + removeSpecialItem + } = require_specialTagController(); + router.post("/", createSpecialTag); + router.get("/", getSpecialTags); + router.put("/:id", updateSpecialTag); + router.delete("/:id", deleteSpecialTag); + router.get("/items/:tag_id", getSpecialTagItems); + router.post("/items/assign", assignSpecialItems); + router.post("/items/remove", removeSpecialItem); + module2.exports = router; + } +}); + +// routes/ads.js +var require_ads = __commonJS({ + "routes/ads.js"(exports2, module2) { + var express2 = require_express2(); + var router = express2.Router(); + var { + createAd, + getAds, + updateAd, + deleteAd, + getActiveAds + } = require_adsController(); + router.post("/", createAd); + router.get("/", getAds); + router.put("/:id", updateAd); + router.delete("/:id", deleteAd); + router.get("/active", getActiveAds); + module2.exports = router; + } +}); + +// controller/menuController.js +var require_menuController = __commonJS({ + "controller/menuController.js"(exports2, module2) { + var { Ads } = require_adsModal(); + var { Category } = require_categoryModel(); + var { MenuItem: MenuItem2 } = require_menuItemModel(); + var { Branch, Restaurant } = require_resturantModel(); + var { SpecialTag } = require_specialTagModel(); + var { MenuAccessLog } = require_menuAccessLogModel(); + var { sendResponse } = require_responseHelper(); + var errorHandler = require_joiErrorHandler(); + var getBranchDetailsByslug = async (req, res) => { + try { + const { slug } = req.params; + const branch = await Branch.findOne({ slug, is_active: true }).lean(); + if (!branch) { + return sendResponse(res, 404, "Branch not found"); + } + return sendResponse(res, 200, "Branch details fetched successfully", branch); + } catch (error2) { + console.error("Get Restaurant Details By Branch Slug Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var getCategoriesbyIdForMenu = async (req, res) => { + try { + const { branchId } = req.params; + if (!branchId) { + return res.status(400).json({ + success: false, + message: "Branch ID is required" + }); + } + const category = await Category.find({ + branch_id: branchId, + is_active: true, + is_deleted: false + }).sort({ display_order: 1 }).lean(); + return sendResponse(res, 200, "Categories fetched successfully", category); + } catch (error2) { + console.error("Get Category By Branch Slug Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var getMenuItemsByBranchIdForMenu = async (req, res) => { + try { + const { branchId } = req.params; + if (!branchId) { + return sendResponse(res, 404, "Branch not found"); + } + const branchCategories = await Category.find({ branch_id: branchId, is_deleted: false }).select("_id").lean(); + const categoryIds = branchCategories.map((c4) => c4._id); + const menuItems = await MenuItem2.find({ + category_id: { $in: categoryIds } + }).sort({ is_available: -1, created_at: 1 }).populate({ path: "category_id", select: "name" }).lean(); + return sendResponse(res, 200, "Menu items fetched successfully", menuItems); + } catch (error2) { + console.error("Get Menu Items By Branch Slug Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var getSpecialMenuItemsByBranchId = async (req, res) => { + try { + const { branchId } = req.params; + if (!branchId) { + return sendResponse(res, 400, "Branch ID is required"); + } + const specialMenuItems = await SpecialTag.find({ branch_id: branchId }).sort({ display_order: 1 }).populate({ + path: "menu_items", + model: "MenuItem" + }).lean(); + const finalData = specialMenuItems.map((tag2) => ({ + id: tag2._id, + title: tag2.title, + special_items: tag2.menu_items + })); + return sendResponse(res, 200, "Special menu items fetched successfully", finalData); + } catch (error2) { + console.error("Get Special Menu Items By Branch ID Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var getCarasoulByBranchId = async (req, res) => { + try { + const { branchId } = req.params; + if (!branchId) { + return sendResponse(res, 400, "Branch ID is required"); + } + const now = /* @__PURE__ */ new Date(); + const carasoulMenuItems = await Ads.find({ + branch_id: branchId, + is_expired: false, + valid_from: { $lte: now }, + valid_to: { $gte: now } + }).lean(); + console.log("Carousel items fetched successfully", carasoulMenuItems); + return sendResponse(res, 200, "Carousel items fetched successfully", carasoulMenuItems); + } catch (error2) { + console.error("Get Carasoul Menu Items By Branch ID Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var logMenuAccess = async (req, res) => { + try { + const { slug } = req.params; + const branch = await Branch.findOne({ slug, is_active: true }).select("_id"); + if (!branch) { + return sendResponse(res, 404, "Branch not found"); + } + const logEntry = new MenuAccessLog({ + branch_id: branch._id, + accessed_at: /* @__PURE__ */ new Date() + }); + await logEntry.save(); + return sendResponse(res, 201, "Menu access logged successfully", { + log_id: logEntry._id, + branch_id: logEntry.branch_id, + accessed_at: logEntry.accessed_at + }); + } catch (error2) { + console.error("Log Menu Access Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + var getFullMenuBySlug = async (req, res) => { + try { + const { slug } = req.params; + const branch = await Branch.findOne({ slug, is_active: true }).lean(); + if (!branch) { + return sendResponse(res, 404, "Branch not found"); + } + const branchId = branch._id; + const now = /* @__PURE__ */ new Date(); + const pSpecial = SpecialTag.find({ branch_id: branchId }).sort({ display_order: 1 }).populate({ + path: "menu_items", + model: "MenuItem" + }).lean(); + const pCarousel = Ads.find({ + branch_id: branchId, + is_expired: false, + valid_from: { $lte: now }, + valid_to: { $gte: now } + }).lean(); + const pCategoriesAndMenu = (async () => { + const categories = await Category.find({ + branch_id: branchId, + is_active: true, + is_deleted: false + }).sort({ display_order: 1 }).lean(); + const categoryIds = categories.map((c4) => c4._id); + if (categoryIds.length === 0) { + return { categories: [], menuItems: [] }; + } + const menuItems = await MenuItem2.find({ + category_id: { $in: categoryIds } + }).sort({ is_available: -1, created_at: 1 }).populate({ path: "category_id", select: "name" }).lean(); + return { categories, menuItems }; + })(); + const [specialTagsRaw, carasoulMenuItems, catAndMenu] = await Promise.all([ + pSpecial, + pCarousel, + pCategoriesAndMenu + ]); + const specialMenuItems = specialTagsRaw.map((tag2) => ({ + id: tag2._id, + title: tag2.title, + special_items: tag2.menu_items + })); + return sendResponse(res, 200, "Full menu retrieved successfully", { + restaurant: branch, + categories: catAndMenu.categories, + menuItems: catAndMenu.menuItems, + specialItems: specialMenuItems, + carousel: carasoulMenuItems + }); + } catch (error2) { + console.error("Get Full Menu By Slug Error:", error2); + return sendResponse(res, 500, "Internal Server Error", errorHandler(error2)); + } + }; + module2.exports = { + getFullMenuBySlug, + getBranchDetailsByslug, + getCategoriesbyIdForMenu, + getMenuItemsByBranchIdForMenu, + getSpecialMenuItemsByBranchId, + getCarasoulByBranchId, + logMenuAccess + }; + } +}); + +// routes/menu.js +var require_menu = __commonJS({ + "routes/menu.js"(exports2, module2) { + var express2 = require_express2(); + var router = express2.Router(); + var { getFullMenuBySlug, getBranchDetailsByslug, getCategoriesbyIdForMenu, getMenuItemsByBranchIdForMenu, getSpecialMenuItemsByBranchId, getCarasoulByBranchId, logMenuAccess } = require_menuController(); + router.get("/full/:slug", getFullMenuBySlug); + router.get("/:slug", getBranchDetailsByslug); + router.get("/category/:branchId", getCategoriesbyIdForMenu); + router.get("/menu/:branchId", getMenuItemsByBranchIdForMenu); + router.get("/special-item/:branchId", getSpecialMenuItemsByBranchId); + router.get("/carasoul/:branchId", getCarasoulByBranchId); + router.get("/access-log/:slug", logMenuAccess); + module2.exports = router; + } +}); + +// server.js +var createError = require_http_errors(); +var express = require_express2(); +var cookieParser = require_cookie_parser(); +var logger2 = require_morgan(); +var cors = require_lib3(); +var mongoose = require_mongoose2(); +var serverless = require_serverless_http(); +var connectDB = require_db_connect(); +var { authMiddleware } = require_authMiddleware(); +var usersRouter = require_users(); +var restaurantRouter = require_restaurantRoute(); +var categoryRouter = require_category(); +var imageUploadRouter = require_imageUpload(); +var menuItemRouter = require_menuItemRoute(); +var specialTagRouter = require_specialTagRoutes(); +var adsRouter = require_ads(); +var menuRouter = require_menu(); +var app = express(); +app.use(logger2("dev")); +app.use(express.json()); +app.use(express.urlencoded({ extended: false })); +app.use(cookieParser()); +var allowedOrigins = [ + "https://admin.digifymenu.com", + "https://menu.digifymenu.com", + "https://admin.digifymenu.in", + "https://menu.digifymenu.in", + "http://localhost:5173", + "http://localhost:5174", + "http://localhost:5001", + "http://localhost:3000" +]; +var corsMiddleware = cors({ + origin: function(origin, callback) { + if (!origin) return callback(null, true); + if (allowedOrigins.includes(origin)) { + return callback(null, true); + } + return callback(new Error("Not allowed by CORS")); + }, + credentials: true, + methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], + allowedHeaders: [ + "Content-Type", + "Authorization", + "X-Requested-With", + "Accept", + "Origin" + ] +}); +app.use(corsMiddleware); +app.options("*", corsMiddleware); +app.get("/api/v1/health", (req, res) => { + res.status(200).json({ message: "Health check successfull" }); +}); +app.use(authMiddleware); +app.use("/api/v1/users", usersRouter); +app.use("/api/v1/restaurant", restaurantRouter); +app.use("/api/v1/category", categoryRouter); +app.use("/api/v1/image-upload", imageUploadRouter); +app.use("/api/v1/menu-item", menuItemRouter); +app.use("/api/v1/special-tag", specialTagRouter); +app.use("/api/v1/ads", adsRouter); +app.use("/api/v1/menu", menuRouter); +app.use(function(req, res, next) { + next(createError(404)); +}); +app.use(function(err, req, res, next) { + const statusCode = err.status || 500; + res.status(statusCode).json({ + success: false, + message: err.message, + error: process.env.NODE_ENV === "development" ? err : {} + }); +}); +mongoose.connection.once("open", () => { + console.log("Connected to MongoDB"); +}); +var handler = serverless(app); +connectDB().catch((err) => console.error("Initial DB connection failed:", err)); +module.exports.handler = async (event, context) => { + context.callbackWaitsForEmptyEventLoop = false; + await connectDB(); + return handler(event, context); +}; +if (process.env.NODE_ENV !== "production") { + const PORT = process.env.PORT || 5001; + connectDB().then(() => { + app.listen(PORT, () => { + console.log(`Server running locally on port ${PORT}`); + }); + }); +} +/*! Bundled license information: + +depd/lib/compat/callsite-tostring.js: + (*! + * depd + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + *) + +depd/lib/compat/event-listener-count.js: + (*! + * depd + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + *) + +depd/lib/compat/index.js: + (*! + * depd + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + *) + +depd/index.js: + (*! + * depd + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + *) + +statuses/index.js: + (*! + * statuses + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + *) + +http-errors/index.js: + (*! + * http-errors + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + *) + +bytes/index.js: + (*! + * bytes + * Copyright(c) 2012-2014 TJ Holowaychuk + * Copyright(c) 2015 Jed Watson + * MIT Licensed + *) + +content-type/index.js: + (*! + * content-type + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + *) + +unpipe/index.js: + (*! + * unpipe + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + *) + +raw-body/index.js: + (*! + * raw-body + * Copyright(c) 2013-2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + *) + +ee-first/index.js: + (*! + * ee-first + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + *) + +on-finished/index.js: + (*! + * on-finished + * Copyright(c) 2013 Jonathan Ong + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + *) + +body-parser/lib/read.js: +body-parser/lib/types/raw.js: +body-parser/lib/types/text.js: +body-parser/index.js: + (*! + * body-parser + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + *) + +media-typer/index.js: + (*! + * media-typer + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + *) + +mime-db/index.js: + (*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015-2022 Douglas Christopher Wilson + * MIT Licensed + *) + +mime-types/index.js: + (*! + * mime-types + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + *) + +type-is/index.js: + (*! + * type-is + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + *) + +body-parser/lib/types/json.js: +body-parser/lib/types/urlencoded.js: + (*! + * body-parser + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + *) + +merge-descriptors/index.js: + (*! + * merge-descriptors + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + *) + +encodeurl/index.js: + (*! + * encodeurl + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + *) + +escape-html/index.js: + (*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + *) + +parseurl/index.js: + (*! + * parseurl + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + *) + +finalhandler/index.js: + (*! + * finalhandler + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + *) + +express/lib/router/layer.js: +express/lib/router/route.js: +express/lib/router/index.js: +express/lib/middleware/init.js: +express/lib/middleware/query.js: +express/lib/view.js: +express/lib/application.js: +express/lib/request.js: +express/lib/express.js: +express/index.js: + (*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + *) + +methods/index.js: + (*! + * methods + * Copyright(c) 2013-2014 TJ Holowaychuk + * Copyright(c) 2015-2016 Douglas Christopher Wilson + * MIT Licensed + *) + +content-disposition/index.js: + (*! + * content-disposition + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + *) + +destroy/index.js: + (*! + * destroy + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + *) + +etag/index.js: + (*! + * etag + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + *) + +fresh/index.js: + (*! + * fresh + * Copyright(c) 2012 TJ Holowaychuk + * Copyright(c) 2016-2017 Douglas Christopher Wilson + * MIT Licensed + *) + +range-parser/index.js: + (*! + * range-parser + * Copyright(c) 2012-2014 TJ Holowaychuk + * Copyright(c) 2015-2016 Douglas Christopher Wilson + * MIT Licensed + *) + +send/index.js: + (*! + * send + * Copyright(c) 2012 TJ Holowaychuk + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + *) + +forwarded/index.js: + (*! + * forwarded + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + *) + +proxy-addr/index.js: + (*! + * proxy-addr + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + *) + +express/lib/utils.js: +express/lib/response.js: + (*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + *) + +negotiator/index.js: + (*! + * negotiator + * Copyright(c) 2012 Federico Romero + * Copyright(c) 2012-2014 Isaac Z. Schlueter + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + *) + +accepts/index.js: + (*! + * accepts + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + *) + +cookie/index.js: +cookie/index.js: + (*! + * cookie + * Copyright(c) 2012-2014 Roman Shtylman + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + *) + +vary/index.js: + (*! + * vary + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + *) + +serve-static/index.js: + (*! + * serve-static + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + *) + +cookie-parser/index.js: + (*! + * cookie-parser + * Copyright(c) 2014 TJ Holowaychuk + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + *) + +basic-auth/index.js: + (*! + * basic-auth + * Copyright(c) 2013 TJ Holowaychuk + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015-2016 Douglas Christopher Wilson + * MIT Licensed + *) + +on-headers/index.js: + (*! + * on-headers + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + *) + +morgan/index.js: + (*! + * morgan + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + *) + +object-assign/index.js: + (* + object-assign + (c) Sindre Sorhus + @license MIT + *) + +mongoose/lib/connectionState.js: + (*! + * Connection states + *) + +mongoose/lib/helpers/immediate.js: + (*! + * Centralize this so we can more easily work around issues with people + * stubbing out `process.nextTick()` in tests using sinon: + * https://github.com/sinonjs/lolex#automatically-incrementing-mocked-time + * See gh-6074 + *) + +mongoose/lib/collection.js: + (*! + * Module dependencies. + *) + (*! + * ignore + *) + (*! + * Module exports. + *) + +mongoose/lib/error/mongooseError.js: +mongoose/lib/options.js: +mongoose/lib/helpers/clone.js: +mongoose/lib/helpers/error/combinePathErrors.js: +mongoose/lib/schema/operators/exists.js: +mongoose/lib/schema/operators/type.js: +mongoose/lib/helpers/schematype/handleImmutable.js: +mongoose/lib/helpers/document/applyDefaults.js: +mongoose/lib/helpers/document/cleanModifiedSubpaths.js: +mongoose/lib/helpers/projection/isDefiningProjection.js: +mongoose/lib/helpers/projection/isExclusive.js: +mongoose/lib/helpers/projection/isPathSelectedInclusive.js: +mongoose/lib/types/subdocument.js: +mongoose/lib/helpers/schema/idGetter.js: +mongoose/lib/helpers/schema/handleTimestampOption.js: +mongoose/lib/helpers/update/applyTimestampsToChildren.js: +mongoose/lib/helpers/update/applyTimestampsToUpdate.js: +mongoose/lib/constants.js: +mongoose/lib/helpers/model/applyHooks.js: +mongoose/lib/types/map.js: +mongoose/lib/options/schemaArrayOptions.js: +mongoose/lib/options/schemaNumberOptions.js: +mongoose/lib/options/schemaBufferOptions.js: +mongoose/lib/options/schemaDateOptions.js: +mongoose/lib/plugins/saveSubdocs.js: +mongoose/lib/plugins/sharding.js: +mongoose/lib/plugins/validateBeforeSave.js: +mongoose/lib/helpers/model/discriminator.js: +mongoose/lib/options/schemaDocumentArrayOptions.js: +mongoose/lib/schema/map.js: +mongoose/lib/options/schemaObjectIdOptions.js: +mongoose/lib/options/schemaStringOptions.js: +mongoose/lib/schema/union.js: +mongoose/lib/driver.js: +mongoose/lib/helpers/query/castUpdate.js: +mongoose/lib/helpers/projection/isInclusive.js: +mongoose/lib/helpers/query/hasDollarKeys.js: +mongoose/lib/helpers/query/selectPopulatedFields.js: +mongoose/lib/helpers/populate/leanPopulateMap.js: +mongoose/lib/helpers/populate/getVirtual.js: +mongoose/lib/helpers/populate/getSchemaTypes.js: +mongoose/lib/helpers/populate/getModelsMapForPopulate.js: +mongoose/lib/helpers/parallelLimit.js: +mongoose/lib/helpers/populate/removeDeselectedForeignField.js: + (*! + * ignore + *) + +mongoose/lib/types/objectid.js: + (*! + * Convenience `valueOf()` to allow comparing ObjectIds using double equals re: gh-7299 + *) + +mongoose/lib/drivers/node-mongodb-native/collection.js: + (*! + * Module dependencies. + *) + (*! + * Inherit from abstract Collection. + *) + (*! + * ignore + *) + (*! + * Module exports. + *) + +mongoose/lib/cursor/changeStream.js: +mongoose/lib/error/serverSelection.js: +mongoose/lib/stateMachine.js: +mongoose/lib/helpers/common.js: +mongoose/lib/utils.js: +mongoose/lib/schema/subdocument.js: +mongoose/lib/cursor/queryCursor.js: +mquery/lib/utils.js: +mongoose/lib/cursor/aggregationCursor.js: +mongoose/lib/documentProvider.js: + (*! + * Module dependencies. + *) + (*! + * ignore + *) + +mongoose/lib/error/cast.js: + (*! + * Module dependencies. + *) + (*! + * ignore + *) + (*! + * exports + *) + +mongoose/lib/error/notFound.js: +mongoose/lib/error/validator.js: +mongoose/lib/error/version.js: +mongoose/lib/error/parallelSave.js: +mongoose/lib/error/overwriteModel.js: +mongoose/lib/error/missingSchema.js: +mongoose/lib/error/bulkSaveIncompleteError.js: +mongoose/lib/error/divergentArray.js: +mongoose/lib/error/parallelValidate.js: +mongoose/lib/error/invalidSchemaOption.js: +mongoose/lib/error/bulkWriteError.js: +mongoose/lib/error/eachAsyncMultiError.js: + (*! + * Module dependencies. + *) + (*! + * exports + *) + +mongoose/lib/error/validation.js: +mongoose/lib/error/setOptionError.js: + (*! + * Module requirements + *) + (*! + * Module exports + *) + +mongoose/lib/error/strict.js: +mongoose/lib/error/strictPopulate.js: +mongoose/lib/error/objectExpected.js: +mongoose/lib/error/objectParameter.js: +mongoose/lib/cast.js: +mongoose/lib/error/syncIndexes.js: +mongoose/lib/helpers/cursor/eachAsync.js: +mongoose/lib/helpers/updateValidators.js: +mongoose/lib/index.js: + (*! + * Module dependencies. + *) + +mongoose/lib/error/index.js: +mongoose/lib/types/index.js: +mongoose/lib/schema/index.js: +mongoose/lib/drivers/node-mongodb-native/index.js: + (*! + * Module exports. + *) + +mpath/lib/index.js: + (*! + * Split a string path into components delimited by '.' or + * '[\d+]' + * + * #### Example: + * stringToParts('foo[0].bar.1'); // ['foo', '0', 'bar', '1'] + *) + (*! + * Recursively set nested arrays + *) + (*! + * Returns the value passed to it. + *) + +mongoose/lib/internal.js: + (*! + * Dependencies + *) + +mongoose/lib/types/buffer.js: + (*! + * Module dependencies. + *) + (*! + * Inherit from Buffer. + *) + (*! + * Compile other Buffer methods marking this buffer as modified. + *) + (*! + * Module exports. + *) + +mongoose/lib/schema/mixed.js: +mongoose/lib/schema/documentArrayElement.js: + (*! + * Module dependencies. + *) + (*! + * Inherits from SchemaType. + *) + (*! + * Module exports. + *) + +mongoose/lib/helpers/document/compile.js: + (*! + * exports + *) + +mongoose/lib/queryHelpers.js: + (*! + * Module dependencies + *) + (*! + * ignore + *) + +mongoose/lib/types/arraySubdocument.js: + (*! + * Module dependencies. + *) + (*! + * Inherit from Subdocument + *) + (*! + * ignore + *) + (*! + * Module exports. + *) + +mongoose/lib/types/array/methods/index.js: + (*! + * ignore + *) + (*! + * Minimize _just_ empty objects along the path chain specified + * by `parts`, ignoring all other paths. Useful in cases where + * you want to minimize after unsetting a path. + * + * #### Example: + * + * const obj = { foo: { bar: { baz: {} } }, a: {} }; + * _minimizePath(obj, 'foo.bar.baz'); + * obj; // { a: {} } + *) + (*! + * If `docs` isn't all instances of the right model, depopulate `arr` + *) + +mongoose/lib/types/array/index.js: +mongoose/lib/types/documentArray/index.js: + (*! + * Module dependencies. + *) + (*! + * Module exports. + *) + +mongoose/lib/document.js: + (*! + * Module dependencies. + *) + (*! + * ignore + *) + (*! + * Document exposes the NodeJS event emitter API, so you can use + * `on`, `once`, etc. + *) + (*! + * Converts to POJO when you use the document for querying + *) + (*! + * Runs queued functions + *) + (*! + * Internal shallow clone alternative to `$toObject()`: much faster, no options processing + *) + (*! + * Applies virtuals properties to `json`. + *) + (*! + * Check if the given document only has primitive values + *) + (*! + * Increment this document's version if necessary. + *) + (*! + * Module exports. + *) + +mongoose/lib/schemaType.js: + (*! + * Module dependencies. + *) + (*! + * ignore + *) + (*! + * If _duplicateKeyErrorMessage is a string, replace unique index errors "E11000 duplicate key error" with this string. + * + * @api private + *) + (*! + * Module exports. + *) + +mongoose/lib/virtualType.js: + (*! + * ignore + *) + (*! + * exports + *) + +mongoose/lib/schema/operators/bitwise.js: +mongoose/lib/schema/operators/helpers.js: +mongoose/lib/schema/operators/geospatial.js: + (*! + * Module requirements. + *) + (*! + * ignore + *) + +mongoose/lib/schema/number.js: + (*! + * Module requirements. + *) + (*! + * ignore + *) + (*! + * Inherits from SchemaType. + *) + (*! + * Module exports. + *) + +mongoose/lib/schema/array.js: + (*! + * Module dependencies. + *) + (*! + * ignore + *) + (*! + * Inherits from SchemaType. + *) + (*! + * Virtuals defined on this array itself. + *) + (*! + * Module exports. + *) + +mongoose/lib/schema/bigint.js: +mongoose/lib/schema/boolean.js: +mongoose/lib/schema/buffer.js: +mongoose/lib/schema/decimal128.js: +mongoose/lib/schema/double.js: +mongoose/lib/schema/int32.js: +mongoose/lib/schema/objectId.js: +mongoose/lib/schema/string.js: +mongoose/lib/schema/uuid.js: + (*! + * Module dependencies. + *) + (*! + * Inherits from SchemaType. + *) + (*! + * ignore + *) + (*! + * Module exports. + *) + +mongoose/lib/schema/date.js: + (*! + * Module requirements. + *) + (*! + * Inherits from SchemaType. + *) + (*! + * ignore + *) + (*! + * Module exports. + *) + +mongoose/lib/schema/documentArray.js: + (*! + * Module dependencies. + *) + (*! + * Inherits from SchemaArray. + *) + (*! + * ignore + *) + (*! + * Handle casting $elemMatch operators + *) + (*! + * Module exports. + *) + +mongoose/lib/schema.js: + (*! + * Module dependencies. + *) + (*! + * Inherit from EventEmitter. + *) + (*! + * ignore + *) + (*! + * Get this schema's default toObject/toJSON options, including Mongoose global + * options. + *) + (*! + * Recursively set options on implicitly created schemas + *) + (*! + * Module exports. + *) + +mongoose/lib/connection.js: + (*! + * Module dependencies. + *) + (*! + * Inherit from EventEmitter + *) + (*! + * Reset document state in between transaction retries re: gh-13698 + *) + (*! + * If transaction was aborted, we need to reset newly inserted documents' `isNew`. + *) + (*! + * Get the default buffer timeout for this connection + *) + (*! + * ignore + *) + (*! + * Called internally by `openUri()` to create a MongoClient instance. + *) + (*! + * Module exports. + *) + +mongoose/lib/drivers/node-mongodb-native/connection.js: + (*! + * Module dependencies. + *) + (*! + * Inherits from Connection. + *) + (*! + * ignore + *) + (*! + * Module exports. + *) + +mongoose/lib/validOptions.js: + (*! + * Valid mongoose options + *) + +mquery/lib/mquery.js: + (*! + * gt, gte, lt, lte, ne, in, nin, all, regex, size, maxDistance + * + * Thing.where('type').nin(array) + *) + (*! + * @ignore + *) + (*! + * limit, skip, batchSize, comment + * + * Sets these associated options. + * + * query.comment('feed query'); + *) + (*! + * Internal helper for updateMany, updateOne + *) + (*! + * Permissions + *) + (*! + * Exports. + *) + +mongoose/lib/query.js: + (*! + * Module dependencies. + *) + (*! + * inherit mquery + *) + (*! + * Overwrite mquery's `_distinct`, because Mongoose uses that name + * to store the field to apply distinct on. + *) + (*! + * ignore + *) + (*! + * If `translateAliases` option is set, call `Model.translateAliases()` + * on the following query properties: filter, projection, update, distinct. + *) + (*! + * Convert sort values + *) + (*! + * Export + *) + +mongoose/lib/aggregate.js: + (*! + * Module dependencies + *) + (*! + * define methods + *) + (*! + * Helpers + *) + (*! + * Exports + *) + +mongoose/lib/model.js: + (*! + * Module dependencies. + *) + (*! + * ignore + *) + (*! + * Give the constructor the ability to emit events. + *) + (*! + * Populates `docs` for a single `populateOptions` instance. + *) + (*! + * Applies query middleware from this model's schema to this model's + * Query constructor. + *) + (*! + * Module exports. + *) + +mongoose/lib/browserDocument.js: + (*! + * Module dependencies. + *) + (*! + * Inherit from the NodeJS document + *) + (*! + * ignore + *) + (*! + * Browser doc exposes the event emitter API + *) + (*! + * Module exports. + *) + +mongoose/lib/mongoose.js: + (*! + * Module dependencies. + *) + (*! + * ignore + *) + (*! + * Create a new default connection (`mongoose.connection`) for a Mongoose instance. + * No-op if there is already a default connection. + *) + +ejs/lib/ejs.js: + (** + * @file Embedded JavaScript templating engine. {@link http://ejs.co} + * @author Matthew Eernisse + * @author Tiancheng "Timothy" Gu + * @project EJS + * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0} + *) + +safe-buffer/index.js: + (*! safe-buffer. MIT License. Feross Aboukhadijeh *) +*/ diff --git a/middleware/authMiddleware.js b/middleware/authMiddleware.js index 82f2254..5223615 100644 --- a/middleware/authMiddleware.js +++ b/middleware/authMiddleware.js @@ -3,9 +3,9 @@ const { sendResponse } = require("../utils/responseHelper"); const authMiddleware = (req, res, next) => { - if (req.method === "OPTIONS") { - return res.sendStatus(204); - } + if (req.method === "OPTIONS") { + return next(); +} // Check for excluded routes const publicPaths = [ @@ -21,7 +21,6 @@ const authMiddleware = (req, res, next) => { ]; if (publicPaths.some((path) => req.path.startsWith(path))) { - console.log("public path", req.path); return next(); } @@ -85,8 +84,7 @@ const authMiddleware = (req, res, next) => { decoded = refreshDecoded; } - console.log(decoded); - + if (!decoded.branchId && !decoded.newUser) { return sendResponse(res, 401, "Branch id missing in token."); } diff --git a/model/adsModal.js b/model/adsModal.js index c3ace8f..b39c3e6 100644 --- a/model/adsModal.js +++ b/model/adsModal.js @@ -24,6 +24,9 @@ const adsSchema = new Schema({ } }, { timestamps: true }); +// Compound index covering carousel/banner queries +adsSchema.index({ branch_id: 1, is_expired: 1, valid_from: 1, valid_to: 1 }); + const Ads = mongoose.model('Ads', adsSchema); module.exports = { Ads }; diff --git a/model/categoryModel.js b/model/categoryModel.js index dc3dfac..ef7a606 100644 --- a/model/categoryModel.js +++ b/model/categoryModel.js @@ -16,8 +16,8 @@ const categorySchema = new Schema({ } }, { timestamps: true }); -// Compound index for fetching active categories by branch, ordered by display_order -categorySchema.index({ branch_id: 1, is_active: 1, display_order: 1 }); +// Compound index covering: { branch_id, is_active, is_deleted } sorted by display_order +categorySchema.index({ branch_id: 1, is_active: 1, is_deleted: 1, display_order: 1 }); const Category = mongoose.model('Category', categorySchema); diff --git a/model/menuAccessLogModel.js b/model/menuAccessLogModel.js index f3f8fb0..e4fddae 100644 --- a/model/menuAccessLogModel.js +++ b/model/menuAccessLogModel.js @@ -14,6 +14,9 @@ const menuAccessLogSchema = new Schema({ } }, { timestamps: true }); +// Compound index for analytics aggregation +menuAccessLogSchema.index({ branch_id: 1, accessed_at: -1 }); + const MenuAccessLog = mongoose.model('MenuAccessLog', menuAccessLogSchema); module.exports = { MenuAccessLog }; diff --git a/model/menuItemModel.js b/model/menuItemModel.js index fc9fb4d..902ac88 100644 --- a/model/menuItemModel.js +++ b/model/menuItemModel.js @@ -29,6 +29,7 @@ const menuItemSchema = new Schema({ // Indexes for performance menuItemSchema.index({ category_id: 1, is_available: 1 }); menuItemSchema.index({ name: 1 }); // For search +menuItemSchema.index({ image_url: 1 }); // For image-exists checks const MenuItem = mongoose.model('MenuItem', menuItemSchema); diff --git a/model/resturantModel.js b/model/resturantModel.js index 622a84c..51fba63 100644 --- a/model/resturantModel.js +++ b/model/resturantModel.js @@ -65,7 +65,7 @@ const branchSchema = new Schema({ // Indexes for performance branchSchema.index({ restaurant_id: 1 }); -branchSchema.index({ slug: 1 }); +// slug index is auto-created by `unique: true` — no need to duplicate branchSchema.index({ status: 1 }); branchSchema.index({ is_active: 1 }); diff --git a/package-lock.json b/package-lock.json index 86a793e..cbc03d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,8 +28,13 @@ "nodemailer": "^7.0.10", "nodemon": "^3.1.10", "otp-generator": "^4.0.1", + "serverless-http": "^4.0.0", "sharp": "^0.34.5", "tough-cookie": "^6.0.0" + }, + "devDependencies": { + "esbuild": "^0.27.4", + "npm-run-all": "^4.1.5" } }, "node_modules/@aws-crypto/crc32": { @@ -988,410 +993,516 @@ "tslib": "^2.4.0" } }, - "node_modules/@hapi/address": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@hapi/address/-/address-5.1.1.tgz", - "integrity": "sha512-A+po2d/dVoY7cYajycYI43ZbYMXukuopIsqCjh5QzsBCipDtdofHntljDlpccMjIfTy6UOkg+5KPriwYch2bXA==", - "license": "BSD-3-Clause", - "dependencies": { - "@hapi/hoek": "^11.0.2" - }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.4.tgz", + "integrity": "sha512-cQPwL2mp2nSmHHJlCyoXgHGhbEPMrEEU5xhkcy3Hs/O7nGZqEpZ2sUtLaL9MORLtDfRvVl2/3PAuEkYZH0Ty8Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], "engines": { - "node": ">=14.0.0" + "node": ">=18" } }, - "node_modules/@hapi/formula": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@hapi/formula/-/formula-3.0.2.tgz", - "integrity": "sha512-hY5YPNXzw1He7s0iqkRQi+uMGh383CGdyyIGYtB+W5N3KHPXoqychklvHhKCC9M3Xtv0OCs/IHw+r4dcHtBYWw==", - "license": "BSD-3-Clause" - }, - "node_modules/@hapi/hoek": { - "version": "11.0.7", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-11.0.7.tgz", - "integrity": "sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==", - "license": "BSD-3-Clause" - }, - "node_modules/@hapi/pinpoint": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@hapi/pinpoint/-/pinpoint-2.0.1.tgz", - "integrity": "sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q==", - "license": "BSD-3-Clause" - }, - "node_modules/@hapi/tlds": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@hapi/tlds/-/tlds-1.1.4.tgz", - "integrity": "sha512-Fq+20dxsxLaUn5jSSWrdtSRcIUba2JquuorF9UW1wIJS5cSUwxIsO2GIhaWynPRflvxSzFN+gxKte2HEW1OuoA==", - "license": "BSD-3-Clause", + "node_modules/@esbuild/android-arm": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.4.tgz", + "integrity": "sha512-X9bUgvxiC8CHAGKYufLIHGXPJWnr0OCdR0anD2e21vdvgCI8lIfqFbnoeOz7lBjdrAGUhqLZLcQo6MLhTO2DKQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=14.0.0" + "node": ">=18" } }, - "node_modules/@hapi/topo": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-6.0.2.tgz", - "integrity": "sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg==", - "license": "BSD-3-Clause", - "dependencies": { - "@hapi/hoek": "^11.0.2" + "node_modules/@esbuild/android-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.4.tgz", + "integrity": "sha512-gdLscB7v75wRfu7QSm/zg6Rx29VLdy9eTr2t44sfTW7CxwAtQghZ4ZnqHk3/ogz7xao0QAgrkradbBzcqFPasw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" } }, - "node_modules/@img/colour": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz", - "integrity": "sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==", + "node_modules/@esbuild/android-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.4.tgz", + "integrity": "sha512-PzPFnBNVF292sfpfhiyiXCGSn9HZg5BcAz+ivBuSsl6Rk4ga1oEXAamhOXRFyMcjwr2DVtm40G65N3GLeH1Lvw==", + "cpu": [ + "x64" + ], + "dev": true, "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { "node": ">=18" } }, - "node_modules/@img/sharp-darwin-arm64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", - "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==", + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.4.tgz", + "integrity": "sha512-b7xaGIwdJlht8ZFCvMkpDN6uiSmnxxK56N2GDTMYPr2/gzvfdQN8rTfBsvVKmIVY/X7EM+/hJKEIbbHs9oA4tQ==", "cpu": [ "arm64" ], - "license": "Apache-2.0", + "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.2.4" + "node": ">=18" } }, - "node_modules/@img/sharp-darwin-x64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", - "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==", + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.4.tgz", + "integrity": "sha512-sR+OiKLwd15nmCdqpXMnuJ9W2kpy0KigzqScqHI3Hqwr7IXxBp3Yva+yJwoqh7rE8V77tdoheRYataNKL4QrPw==", "cpu": [ "x64" ], - "license": "Apache-2.0", + "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.2.4" + "node": ">=18" } }, - "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", - "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==", + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.4.tgz", + "integrity": "sha512-jnfpKe+p79tCnm4GVav68A7tUFeKQwQyLgESwEAUzyxk/TJr4QdGog9sqWNcUbr/bZt/O/HXouspuQDd9JxFSw==", "cpu": [ "arm64" ], - "license": "LGPL-3.0-or-later", + "dev": true, + "license": "MIT", "optional": true, "os": [ - "darwin" + "freebsd" ], - "funding": { - "url": "https://opencollective.com/libvips" + "engines": { + "node": ">=18" } }, - "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", - "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==", + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.4.tgz", + "integrity": "sha512-2kb4ceA/CpfUrIcTUl1wrP/9ad9Atrp5J94Lq69w7UwOMolPIGrfLSvAKJp0RTvkPPyn6CIWrNy13kyLikZRZQ==", "cpu": [ "x64" ], - "license": "LGPL-3.0-or-later", + "dev": true, + "license": "MIT", "optional": true, "os": [ - "darwin" + "freebsd" ], - "funding": { - "url": "https://opencollective.com/libvips" + "engines": { + "node": ">=18" } }, - "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", - "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==", + "node_modules/@esbuild/linux-arm": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.4.tgz", + "integrity": "sha512-aBYgcIxX/wd5n2ys0yESGeYMGF+pv6g0DhZr3G1ZG4jMfruU9Tl1i2Z+Wnj9/KjGz1lTLCcorqE2viePZqj4Eg==", "cpu": [ "arm" ], - "license": "LGPL-3.0-or-later", + "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://opencollective.com/libvips" + "engines": { + "node": ">=18" } }, - "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", - "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==", + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.4.tgz", + "integrity": "sha512-7nQOttdzVGth1iz57kxg9uCz57dxQLHWxopL6mYuYthohPKEK0vU0C3O21CcBK6KDlkYVcnDXY099HcCDXd9dA==", "cpu": [ "arm64" ], - "license": "LGPL-3.0-or-later", + "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://opencollective.com/libvips" + "engines": { + "node": ">=18" } }, - "node_modules/@img/sharp-libvips-linux-ppc64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", - "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==", + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.4.tgz", + "integrity": "sha512-oPtixtAIzgvzYcKBQM/qZ3R+9TEUd1aNJQu0HhGyqtx6oS7qTpvjheIWBbes4+qu1bNlo2V4cbkISr8q6gRBFA==", "cpu": [ - "ppc64" + "ia32" ], - "license": "LGPL-3.0-or-later", + "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://opencollective.com/libvips" + "engines": { + "node": ">=18" } }, - "node_modules/@img/sharp-libvips-linux-riscv64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", - "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==", + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.4.tgz", + "integrity": "sha512-8mL/vh8qeCoRcFH2nM8wm5uJP+ZcVYGGayMavi8GmRJjuI3g1v6Z7Ni0JJKAJW+m0EtUuARb6Lmp4hMjzCBWzA==", "cpu": [ - "riscv64" + "loong64" ], - "license": "LGPL-3.0-or-later", + "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://opencollective.com/libvips" + "engines": { + "node": ">=18" } }, - "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", - "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==", + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.4.tgz", + "integrity": "sha512-1RdrWFFiiLIW7LQq9Q2NES+HiD4NyT8Itj9AUeCl0IVCA459WnPhREKgwrpaIfTOe+/2rdntisegiPWn/r/aAw==", "cpu": [ - "s390x" + "mips64el" ], - "license": "LGPL-3.0-or-later", + "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://opencollective.com/libvips" + "engines": { + "node": ">=18" } }, - "node_modules/@img/sharp-libvips-linux-x64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", - "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==", + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.4.tgz", + "integrity": "sha512-tLCwNG47l3sd9lpfyx9LAGEGItCUeRCWeAx6x2Jmbav65nAwoPXfewtAdtbtit/pJFLUWOhpv0FpS6GQAmPrHA==", "cpu": [ - "x64" + "ppc64" ], - "license": "LGPL-3.0-or-later", + "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://opencollective.com/libvips" + "engines": { + "node": ">=18" } }, - "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", - "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==", + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.4.tgz", + "integrity": "sha512-BnASypppbUWyqjd1KIpU4AUBiIhVr6YlHx/cnPgqEkNoVOhHg+YiSVxM1RLfiy4t9cAulbRGTNCKOcqHrEQLIw==", "cpu": [ - "arm64" + "riscv64" ], - "license": "LGPL-3.0-or-later", + "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://opencollective.com/libvips" + "engines": { + "node": ">=18" } }, - "node_modules/@img/sharp-libvips-linuxmusl-x64": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", - "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==", + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.4.tgz", + "integrity": "sha512-+eUqgb/Z7vxVLezG8bVB9SfBie89gMueS+I0xYh2tJdw3vqA/0ImZJ2ROeWwVJN59ihBeZ7Tu92dF/5dy5FttA==", "cpu": [ - "x64" + "s390x" ], - "license": "LGPL-3.0-or-later", + "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://opencollective.com/libvips" + "engines": { + "node": ">=18" } }, - "node_modules/@img/sharp-linux-arm": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", - "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==", + "node_modules/@esbuild/linux-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.4.tgz", + "integrity": "sha512-S5qOXrKV8BQEzJPVxAwnryi2+Iq5pB40gTEIT69BQONqR7JH1EPIcQ/Uiv9mCnn05jff9umq/5nqzxlqTOg9NA==", "cpu": [ - "arm" + "x64" ], - "license": "Apache-2.0", + "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.2.4" + "node": ">=18" } }, - "node_modules/@img/sharp-linux-arm64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", - "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==", + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.4.tgz", + "integrity": "sha512-xHT8X4sb0GS8qTqiwzHqpY00C95DPAq7nAwX35Ie/s+LO9830hrMd3oX0ZMKLvy7vsonee73x0lmcdOVXFzd6Q==", "cpu": [ "arm64" ], - "license": "Apache-2.0", + "dev": true, + "license": "MIT", "optional": true, "os": [ - "linux" + "netbsd" ], "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.2.4" + "node": ">=18" } }, - "node_modules/@img/sharp-linux-ppc64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", - "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==", + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.4.tgz", + "integrity": "sha512-RugOvOdXfdyi5Tyv40kgQnI0byv66BFgAqjdgtAKqHoZTbTF2QqfQrFwa7cHEORJf6X2ht+l9ABLMP0dnKYsgg==", "cpu": [ - "ppc64" + "x64" ], - "license": "Apache-2.0", + "dev": true, + "license": "MIT", "optional": true, "os": [ - "linux" + "netbsd" ], "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-ppc64": "1.2.4" + "node": ">=18" } }, - "node_modules/@img/sharp-linux-riscv64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", - "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==", + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.4.tgz", + "integrity": "sha512-2MyL3IAaTX+1/qP0O1SwskwcwCoOI4kV2IBX1xYnDDqthmq5ArrW94qSIKCAuRraMgPOmG0RDTA74mzYNQA9ow==", "cpu": [ - "riscv64" + "arm64" ], - "license": "Apache-2.0", + "dev": true, + "license": "MIT", "optional": true, "os": [ - "linux" + "openbsd" ], "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-riscv64": "1.2.4" + "node": ">=18" } }, - "node_modules/@img/sharp-linux-s390x": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", - "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==", + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.4.tgz", + "integrity": "sha512-u8fg/jQ5aQDfsnIV6+KwLOf1CmJnfu1ShpwqdwC0uA7ZPwFws55Ngc12vBdeUdnuWoQYx/SOQLGDcdlfXhYmXQ==", "cpu": [ - "s390x" + "x64" ], - "license": "Apache-2.0", + "dev": true, + "license": "MIT", "optional": true, "os": [ - "linux" + "openbsd" ], "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.2.4" + "node": ">=18" } }, - "node_modules/@img/sharp-linux-x64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", - "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==", + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.4.tgz", + "integrity": "sha512-JkTZrl6VbyO8lDQO3yv26nNr2RM2yZzNrNHEsj9bm6dOwwu9OYN28CjzZkH57bh4w0I2F7IodpQvUAEd1mbWXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.4.tgz", + "integrity": "sha512-/gOzgaewZJfeJTlsWhvUEmUG4tWEY2Spp5M20INYRg2ZKl9QPO3QEEgPeRtLjEWSW8FilRNacPOg8R1uaYkA6g==", "cpu": [ "x64" ], - "license": "Apache-2.0", + "dev": true, + "license": "MIT", "optional": true, "os": [ - "linux" + "sunos" ], "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.4.tgz", + "integrity": "sha512-Z9SExBg2y32smoDQdf1HRwHRt6vAHLXcxD2uGgO/v2jK7Y718Ix4ndsbNMU/+1Qiem9OiOdaqitioZwxivhXYg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.4.tgz", + "integrity": "sha512-DAyGLS0Jz5G5iixEbMHi5KdiApqHBWMGzTtMiJ72ZOLhbu/bzxgAe8Ue8CTS3n3HbIUHQz/L51yMdGMeoxXNJw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.4.tgz", + "integrity": "sha512-+knoa0BDoeXgkNvvV1vvbZX4+hizelrkwmGJBdT17t8FNPwG2lKemmuMZlmaNQ3ws3DKKCxpb4zRZEIp3UxFCg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@hapi/address": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@hapi/address/-/address-5.1.1.tgz", + "integrity": "sha512-A+po2d/dVoY7cYajycYI43ZbYMXukuopIsqCjh5QzsBCipDtdofHntljDlpccMjIfTy6UOkg+5KPriwYch2bXA==", + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^11.0.2" }, - "optionalDependencies": { - "@img/sharp-libvips-linux-x64": "1.2.4" + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@img/sharp-linuxmusl-arm64": { + "node_modules/@hapi/formula": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@hapi/formula/-/formula-3.0.2.tgz", + "integrity": "sha512-hY5YPNXzw1He7s0iqkRQi+uMGh383CGdyyIGYtB+W5N3KHPXoqychklvHhKCC9M3Xtv0OCs/IHw+r4dcHtBYWw==", + "license": "BSD-3-Clause" + }, + "node_modules/@hapi/hoek": { + "version": "11.0.7", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-11.0.7.tgz", + "integrity": "sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@hapi/pinpoint": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@hapi/pinpoint/-/pinpoint-2.0.1.tgz", + "integrity": "sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@hapi/tlds": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@hapi/tlds/-/tlds-1.1.4.tgz", + "integrity": "sha512-Fq+20dxsxLaUn5jSSWrdtSRcIUba2JquuorF9UW1wIJS5cSUwxIsO2GIhaWynPRflvxSzFN+gxKte2HEW1OuoA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@hapi/topo": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-6.0.2.tgz", + "integrity": "sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg==", + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^11.0.2" + } + }, + "node_modules/@img/colour": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz", + "integrity": "sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", - "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", + "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==", "cpu": [ "arm64" ], "license": "Apache-2.0", "optional": true, "os": [ - "linux" + "darwin" ], "engines": { "node": "^18.17.0 || ^20.3.0 || >=21.0.0" @@ -1400,20 +1511,20 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" + "@img/sharp-libvips-darwin-arm64": "1.2.4" } }, - "node_modules/@img/sharp-linuxmusl-x64": { + "node_modules/@img/sharp-darwin-x64": { "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", - "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", + "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==", "cpu": [ "x64" ], "license": "Apache-2.0", "optional": true, "os": [ - "linux" + "darwin" ], "engines": { "node": "^18.17.0 || ^20.3.0 || >=21.0.0" @@ -1422,100 +1533,1143 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-x64": "1.2.4" + "@img/sharp-libvips-darwin-x64": "1.2.4" } }, - "node_modules/@img/sharp-wasm32": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", - "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==", + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", + "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==", "cpu": [ - "wasm32" + "arm64" ], - "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "license": "LGPL-3.0-or-later", "optional": true, - "dependencies": { - "@emnapi/runtime": "^1.7.0" - }, - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, + "os": [ + "darwin" + ], "funding": { "url": "https://opencollective.com/libvips" } }, - "node_modules/@img/sharp-win32-arm64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", - "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==", + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", + "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==", "cpu": [ - "arm64" + "x64" ], - "license": "Apache-2.0 AND LGPL-3.0-or-later", + "license": "LGPL-3.0-or-later", "optional": true, "os": [ - "win32" + "darwin" ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, - "node_modules/@img/sharp-win32-ia32": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", - "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==", + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", + "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==", "cpu": [ - "ia32" + "arm" ], - "license": "Apache-2.0 AND LGPL-3.0-or-later", + "license": "LGPL-3.0-or-later", "optional": true, "os": [ - "win32" + "linux" ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, - "node_modules/@img/sharp-win32-x64": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", - "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", + "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==", "cpu": [ - "x64" + "arm64" ], - "license": "Apache-2.0 AND LGPL-3.0-or-later", + "license": "LGPL-3.0-or-later", "optional": true, "os": [ - "win32" + "linux" ], - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, "funding": { "url": "https://opencollective.com/libvips" } }, - "node_modules/@mongodb-js/saslprep": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.4.4.tgz", - "integrity": "sha512-p7X/ytJDIdwUfFL/CLOhKgdfJe1Fa8uw9seJYvdOmnP9JBWGWHW69HkOixXS6Wy9yvGf1MbhcS6lVmrhy4jm2g==", - "license": "MIT", + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", + "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==", + "cpu": [ + "ppc64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", + "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==", + "cpu": [ + "riscv64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", + "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==", + "cpu": [ + "s390x" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", + "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", + "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", + "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", + "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==", + "cpu": [ + "arm" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", + "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", + "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==", + "cpu": [ + "ppc64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", + "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==", + "cpu": [ + "riscv64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", + "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==", + "cpu": [ + "s390x" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", + "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", + "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", + "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", + "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.7.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", + "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", + "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", + "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.4.4.tgz", + "integrity": "sha512-p7X/ytJDIdwUfFL/CLOhKgdfJe1Fa8uw9seJYvdOmnP9JBWGWHW69HkOixXS6Wy9yvGf1MbhcS6lVmrhy4jm2g==", + "license": "MIT", + "dependencies": { + "sparse-bitfield": "^3.0.3" + } + }, + "node_modules/@smithy/abort-controller": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.2.8.tgz", + "integrity": "sha512-peuVfkYHAmS5ybKxWcfraK7WBBP0J+rkfUcbHJJKQ4ir3UAUNQI+Y4Vt/PqSzGqgloJ5O1dk7+WzNL8wcCSXbw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/chunked-blob-reader": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader/-/chunked-blob-reader-5.2.0.tgz", + "integrity": "sha512-WmU0TnhEAJLWvfSeMxBNe5xtbselEO8+4wG0NtZeL8oR21WgH1xiO37El+/Y+H/Ie4SCwBy3MxYWmOYaGgZueA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/chunked-blob-reader-native": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-4.2.1.tgz", + "integrity": "sha512-lX9Ay+6LisTfpLid2zZtIhSEjHMZoAR5hHCR4H7tBz/Zkfr5ea8RcQ7Tk4mi0P76p4cN+Btz16Ffno7YHpKXnQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-base64": "^4.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/config-resolver": { + "version": "4.4.6", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.4.6.tgz", + "integrity": "sha512-qJpzYC64kaj3S0fueiu3kXm8xPrR3PcXDPEgnaNMRn0EjNSZFoFjvbUp0YUDsRhN1CB90EnHJtbxWKevnH99UQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.3.8", + "@smithy/types": "^4.12.0", + "@smithy/util-config-provider": "^4.2.0", + "@smithy/util-endpoints": "^3.2.8", + "@smithy/util-middleware": "^4.2.8", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/core": { + "version": "3.23.2", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.23.2.tgz", + "integrity": "sha512-HaaH4VbGie4t0+9nY3tNBRSxVTr96wzIqexUa6C2qx3MPePAuz7lIxPxYtt1Wc//SPfJLNoZJzfdt0B6ksj2jA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/middleware-serde": "^4.2.9", + "@smithy/protocol-http": "^5.3.8", + "@smithy/types": "^4.12.0", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-middleware": "^4.2.8", + "@smithy/util-stream": "^4.5.12", + "@smithy/util-utf8": "^4.2.0", + "@smithy/uuid": "^1.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/credential-provider-imds": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.2.8.tgz", + "integrity": "sha512-FNT0xHS1c/CPN8upqbMFP83+ul5YgdisfCfkZ86Jh2NSmnqw/AJ6x5pEogVCTVvSm7j9MopRU89bmDelxuDMYw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.3.8", + "@smithy/property-provider": "^4.2.8", + "@smithy/types": "^4.12.0", + "@smithy/url-parser": "^4.2.8", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-codec": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-4.2.8.tgz", + "integrity": "sha512-jS/O5Q14UsufqoGhov7dHLOPCzkYJl9QDzusI2Psh4wyYx/izhzvX9P4D69aTxcdfVhEPhjK+wYyn/PzLjKbbw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/crc32": "5.2.0", + "@smithy/types": "^4.12.0", + "@smithy/util-hex-encoding": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-browser": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-4.2.8.tgz", + "integrity": "sha512-MTfQT/CRQz5g24ayXdjg53V0mhucZth4PESoA5IhvaWVDTOQLfo8qI9vzqHcPsdd2v6sqfTYqF5L/l+pea5Uyw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/eventstream-serde-universal": "^4.2.8", + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-config-resolver": { + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-4.3.8.tgz", + "integrity": "sha512-ah12+luBiDGzBruhu3efNy1IlbwSEdNiw8fOZksoKoWW1ZHvO/04MQsdnws/9Aj+5b0YXSSN2JXKy/ClIsW8MQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-node": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-4.2.8.tgz", + "integrity": "sha512-cYpCpp29z6EJHa5T9WL0KAlq3SOKUQkcgSoeRfRVwjGgSFl7Uh32eYGt7IDYCX20skiEdRffyDpvF2efEZPC0A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/eventstream-serde-universal": "^4.2.8", + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-universal": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-4.2.8.tgz", + "integrity": "sha512-iJ6YNJd0bntJYnX6s52NC4WFYcZeKrPUr1Kmmr5AwZcwCSzVpS7oavAmxMR7pMq7V+D1G4s9F5NJK0xwOsKAlQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/eventstream-codec": "^4.2.8", + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/fetch-http-handler": { + "version": "5.3.9", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.3.9.tgz", + "integrity": "sha512-I4UhmcTYXBrct03rwzQX1Y/iqQlzVQaPxWjCjula++5EmWq9YGBrx6bbGqluGc1f0XEfhSkiY4jhLgbsJUMKRA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^5.3.8", + "@smithy/querystring-builder": "^4.2.8", + "@smithy/types": "^4.12.0", + "@smithy/util-base64": "^4.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/hash-blob-browser": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/@smithy/hash-blob-browser/-/hash-blob-browser-4.2.9.tgz", + "integrity": "sha512-m80d/iicI7DlBDxyQP6Th7BW/ejDGiF0bgI754+tiwK0lgMkcaIBgvwwVc7OFbY4eUzpGtnig52MhPAEJ7iNYg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/chunked-blob-reader": "^5.2.0", + "@smithy/chunked-blob-reader-native": "^4.2.1", + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/hash-node": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.2.8.tgz", + "integrity": "sha512-7ZIlPbmaDGxVoxErDZnuFG18WekhbA/g2/i97wGj+wUBeS6pcUeAym8u4BXh/75RXWhgIJhyC11hBzig6MljwA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.12.0", + "@smithy/util-buffer-from": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/hash-stream-node": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/hash-stream-node/-/hash-stream-node-4.2.8.tgz", + "integrity": "sha512-v0FLTXgHrTeheYZFGhR+ehX5qUm4IQsjAiL9qehad2cyjMWcN2QG6/4mSwbSgEQzI7jwfoXj7z4fxZUx/Mhj2w==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.12.0", + "@smithy/util-utf8": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/invalid-dependency": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.2.8.tgz", + "integrity": "sha512-N9iozRybwAQ2dn9Fot9kI6/w9vos2oTXLhtK7ovGqwZjlOcxu6XhPlpLpC+INsxktqHinn5gS2DXDjDF2kG5sQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/is-array-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.2.0.tgz", + "integrity": "sha512-DZZZBvC7sjcYh4MazJSGiWMI2L7E0oCiRHREDzIxi/M2LY79/21iXt6aPLHge82wi5LsuRF5A06Ds3+0mlh6CQ==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/md5-js": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.2.8.tgz", + "integrity": "sha512-oGMaLj4tVZzLi3itBa9TCswgMBr7k9b+qKYowQ6x1rTyTuO1IU2YHdHUa+891OsOH+wCsH7aTPRsTJO3RMQmjQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.12.0", + "@smithy/util-utf8": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-content-length": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.2.8.tgz", + "integrity": "sha512-RO0jeoaYAB1qBRhfVyq0pMgBoUK34YEJxVxyjOWYZiOKOq2yMZ4MnVXMZCUDenpozHue207+9P5ilTV1zeda0A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^5.3.8", + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-endpoint": { + "version": "4.4.16", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.4.16.tgz", + "integrity": "sha512-L5GICFCSsNhbJ5JSKeWFGFy16Q2OhoBizb3X2DrxaJwXSEujVvjG9Jt386dpQn2t7jINglQl0b4K/Su69BdbMA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/core": "^3.23.2", + "@smithy/middleware-serde": "^4.2.9", + "@smithy/node-config-provider": "^4.3.8", + "@smithy/shared-ini-file-loader": "^4.4.3", + "@smithy/types": "^4.12.0", + "@smithy/url-parser": "^4.2.8", + "@smithy/util-middleware": "^4.2.8", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-retry": { + "version": "4.4.33", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.4.33.tgz", + "integrity": "sha512-jLqZOdJhtIL4lnA9hXnAG6GgnJlo1sD3FqsTxm9wSfjviqgWesY/TMBVnT84yr4O0Vfe0jWoXlfFbzsBVph3WA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.3.8", + "@smithy/protocol-http": "^5.3.8", + "@smithy/service-error-classification": "^4.2.8", + "@smithy/smithy-client": "^4.11.5", + "@smithy/types": "^4.12.0", + "@smithy/util-middleware": "^4.2.8", + "@smithy/util-retry": "^4.2.8", + "@smithy/uuid": "^1.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-serde": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.2.9.tgz", + "integrity": "sha512-eMNiej0u/snzDvlqRGSN3Vl0ESn3838+nKyVfF2FKNXFbi4SERYT6PR392D39iczngbqqGG0Jl1DlCnp7tBbXQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^5.3.8", + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-stack": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.2.8.tgz", + "integrity": "sha512-w6LCfOviTYQjBctOKSwy6A8FIkQy7ICvglrZFl6Bw4FmcQ1Z420fUtIhxaUZZshRe0VCq4kvDiPiXrPZAe8oRA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/node-config-provider": { + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.3.8.tgz", + "integrity": "sha512-aFP1ai4lrbVlWjfpAfRSL8KFcnJQYfTl5QxLJXY32vghJrDuFyPZ6LtUL+JEGYiFRG1PfPLHLoxj107ulncLIg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/property-provider": "^4.2.8", + "@smithy/shared-ini-file-loader": "^4.4.3", + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/node-http-handler": { + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.4.10.tgz", + "integrity": "sha512-u4YeUwOWRZaHbWaebvrs3UhwQwj+2VNmcVCwXcYTvPIuVyM7Ex1ftAj+fdbG/P4AkBwLq/+SKn+ydOI4ZJE9PA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/abort-controller": "^4.2.8", + "@smithy/protocol-http": "^5.3.8", + "@smithy/querystring-builder": "^4.2.8", + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/property-provider": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.2.8.tgz", + "integrity": "sha512-EtCTbyIveCKeOXDSWSdze3k612yCPq1YbXsbqX3UHhkOSW8zKsM9NOJG5gTIya0vbY2DIaieG8pKo1rITHYL0w==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/protocol-http": { + "version": "5.3.8", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.3.8.tgz", + "integrity": "sha512-QNINVDhxpZ5QnP3aviNHQFlRogQZDfYlCkQT+7tJnErPQbDhysondEjhikuANxgMsZrkGeiAxXy4jguEGsDrWQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/querystring-builder": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.2.8.tgz", + "integrity": "sha512-Xr83r31+DrE8CP3MqPgMJl+pQlLLmOfiEUnoyAlGzzJIrEsbKsPy1hqH0qySaQm4oWrCBlUqRt+idEgunKB+iw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.12.0", + "@smithy/util-uri-escape": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/querystring-parser": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.2.8.tgz", + "integrity": "sha512-vUurovluVy50CUlazOiXkPq40KGvGWSdmusa3130MwrR1UNnNgKAlj58wlOe61XSHRpUfIIh6cE0zZ8mzKaDPA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/service-error-classification": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.2.8.tgz", + "integrity": "sha512-mZ5xddodpJhEt3RkCjbmUQuXUOaPNTkbMGR0bcS8FE0bJDLMZlhmpgrvPNCYglVw5rsYTpSnv19womw9WWXKQQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.12.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/shared-ini-file-loader": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.4.3.tgz", + "integrity": "sha512-DfQjxXQnzC5UbCUPeC3Ie8u+rIWZTvuDPAGU/BxzrOGhRvgUanaP68kDZA+jaT3ZI+djOf+4dERGlm9mWfFDrg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/signature-v4": { + "version": "5.3.8", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.3.8.tgz", + "integrity": "sha512-6A4vdGj7qKNRF16UIcO8HhHjKW27thsxYci+5r/uVRkdcBEkOEiY8OMPuydLX4QHSrJqGHPJzPRwwVTqbLZJhg==", + "license": "Apache-2.0", "dependencies": { - "sparse-bitfield": "^3.0.3" + "@smithy/is-array-buffer": "^4.2.0", + "@smithy/protocol-http": "^5.3.8", + "@smithy/types": "^4.12.0", + "@smithy/util-hex-encoding": "^4.2.0", + "@smithy/util-middleware": "^4.2.8", + "@smithy/util-uri-escape": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@smithy/abort-controller": { + "node_modules/@smithy/smithy-client": { + "version": "4.11.5", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.11.5.tgz", + "integrity": "sha512-xixwBRqoeP2IUgcAl3U9dvJXc+qJum4lzo3maaJxifsZxKUYLfVfCXvhT4/jD01sRrHg5zjd1cw2Zmjr4/SuKQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/core": "^3.23.2", + "@smithy/middleware-endpoint": "^4.4.16", + "@smithy/middleware-stack": "^4.2.8", + "@smithy/protocol-http": "^5.3.8", + "@smithy/types": "^4.12.0", + "@smithy/util-stream": "^4.5.12", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/types": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.12.0.tgz", + "integrity": "sha512-9YcuJVTOBDjg9LWo23Qp0lTQ3D7fQsQtwle0jVfpbUHy9qBwCEgKuVH4FqFB3VYu0nwdHKiEMA+oXz7oV8X1kw==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/url-parser": { "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.2.8.tgz", - "integrity": "sha512-peuVfkYHAmS5ybKxWcfraK7WBBP0J+rkfUcbHJJKQ4ir3UAUNQI+Y4Vt/PqSzGqgloJ5O1dk7+WzNL8wcCSXbw==", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.2.8.tgz", + "integrity": "sha512-NQho9U68TGMEU639YkXnVMV3GEFFULmmaWdlu1E9qzyIePOHsoSnagTGSDv1Zi8DCNN6btxOSdgmy5E/hsZwhA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/querystring-parser": "^4.2.8", + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-base64": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.3.0.tgz", + "integrity": "sha512-GkXZ59JfyxsIwNTWFnjmFEI8kZpRNIBfxKjv09+nkAWPt/4aGaEWMM04m4sxgNVWkbt2MdSvE3KF/PfX4nFedQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-body-length-browser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.2.0.tgz", + "integrity": "sha512-Fkoh/I76szMKJnBXWPdFkQJl2r9SjPt3cMzLdOB6eJ4Pnpas8hVoWPYemX/peO0yrrvldgCUVJqOAjUrOLjbxg==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-body-length-node": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.2.1.tgz", + "integrity": "sha512-h53dz/pISVrVrfxV1iqXlx5pRg3V2YWFcSQyPyXZRrZoZj4R4DeWRDo1a7dd3CPTcFi3kE+98tuNyD2axyZReA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-buffer-from": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.2.0.tgz", + "integrity": "sha512-kAY9hTKulTNevM2nlRtxAG2FQ3B2OR6QIrPY3zE5LqJy1oxzmgBGsHLWTcNhWXKchgA0WHW+mZkQrng/pgcCew==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-config-provider": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.2.0.tgz", + "integrity": "sha512-YEjpl6XJ36FTKmD+kRJJWYvrHeUvm5ykaUS5xK+6oXffQPHeEM4/nXlZPe+Wu0lsgRUcNZiliYNh/y7q9c2y6Q==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-browser": { + "version": "4.3.32", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.3.32.tgz", + "integrity": "sha512-092sjYfFMQ/iaPH798LY/OJFBcYu0sSK34Oy9vdixhsU36zlZu8OcYjF3TD4e2ARupyK7xaxPXl+T0VIJTEkkg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/property-provider": "^4.2.8", + "@smithy/smithy-client": "^4.11.5", + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-node": { + "version": "4.2.35", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.2.35.tgz", + "integrity": "sha512-miz/ggz87M8VuM29y7jJZMYkn7+IErM5p5UgKIf8OtqVs/h2bXr1Bt3uTsREsI/4nK8a0PQERbAPsVPVNIsG7Q==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/config-resolver": "^4.4.6", + "@smithy/credential-provider-imds": "^4.2.8", + "@smithy/node-config-provider": "^4.3.8", + "@smithy/property-provider": "^4.2.8", + "@smithy/smithy-client": "^4.11.5", + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-endpoints": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.2.8.tgz", + "integrity": "sha512-8JaVTn3pBDkhZgHQ8R0epwWt+BqPSLCjdjXXusK1onwJlRuN69fbvSK66aIKKO7SwVFM6x2J2ox5X8pOaWcUEw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.3.8", + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-hex-encoding": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.2.0.tgz", + "integrity": "sha512-CCQBwJIvXMLKxVbO88IukazJD9a4kQ9ZN7/UMGBjBcJYvatpWk+9g870El4cB8/EJxfe+k+y0GmR9CAzkF+Nbw==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-middleware": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.2.8.tgz", + "integrity": "sha512-PMqfeJxLcNPMDgvPbbLl/2Vpin+luxqTGPpW3NAQVLbRrFRzTa4rNAASYeIGjRV9Ytuhzny39SpyU04EQreF+A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-retry": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.2.8.tgz", + "integrity": "sha512-CfJqwvoRY0kTGe5AkQokpURNCT1u/MkRzMTASWMPPo2hNSnKtF1D45dQl3DE2LKLr4m+PW9mCeBMJr5mCAVThg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/service-error-classification": "^4.2.8", + "@smithy/types": "^4.12.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-stream": { + "version": "4.5.12", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.5.12.tgz", + "integrity": "sha512-D8tgkrmhAX/UNeCZbqbEO3uqyghUnEmmoO9YEvRuwxjlkKKUE7FOgCJnqpTlQPe9MApdWPky58mNQQHbnCzoNg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/fetch-http-handler": "^5.3.9", + "@smithy/node-http-handler": "^4.4.10", + "@smithy/types": "^4.12.0", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-buffer-from": "^4.2.0", + "@smithy/util-hex-encoding": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-uri-escape": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.2.0.tgz", + "integrity": "sha512-igZpCKV9+E/Mzrpq6YacdTQ0qTiLm85gD6N/IrmyDvQFA4UnU3d5g3m8tMT/6zG/vVkWSU+VxeUyGonL62DuxA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-utf8": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.2.0.tgz", + "integrity": "sha512-zBPfuzoI8xyBtR2P6WQj63Rz8i3AmfAaJLuNG8dWsfvPe8lO4aCPYLn879mEgHndZH1zQ2oXmG8O1GGzzaoZiw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-waiter": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-4.2.8.tgz", + "integrity": "sha512-n+lahlMWk+aejGuax7DPWtqav8HYnWxQwR+LCG2BgCUmaGcTe9qZCFsmw8TMg9iG75HOwhrJCX9TCJRLH+Yzqg==", "license": "Apache-2.0", "dependencies": { + "@smithy/abort-controller": "^4.2.8", "@smithy/types": "^4.12.0", "tslib": "^2.6.2" }, @@ -1523,10 +2677,10 @@ "node": ">=18.0.0" } }, - "node_modules/@smithy/chunked-blob-reader": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader/-/chunked-blob-reader-5.2.0.tgz", - "integrity": "sha512-WmU0TnhEAJLWvfSeMxBNe5xtbselEO8+4wG0NtZeL8oR21WgH1xiO37El+/Y+H/Ie4SCwBy3MxYWmOYaGgZueA==", + "node_modules/@smithy/uuid": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/uuid/-/uuid-1.1.0.tgz", + "integrity": "sha512-4aUIteuyxtBUhVdiQqcDhKFitwfd9hqoSDYY2KRXiWtgoWJ9Bmise+KfEPDiVHWeJepvF8xJO9/9+WDIciMFFw==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" @@ -1535,1535 +2689,1779 @@ "node": ">=18.0.0" } }, - "node_modules/@smithy/chunked-blob-reader-native": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-4.2.1.tgz", - "integrity": "sha512-lX9Ay+6LisTfpLid2zZtIhSEjHMZoAR5hHCR4H7tBz/Zkfr5ea8RcQ7Tk4mi0P76p4cN+Btz16Ffno7YHpKXnQ==", - "license": "Apache-2.0", + "node_modules/@standard-schema/spec": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", + "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", + "license": "MIT" + }, + "node_modules/@supabase/auth-js": { + "version": "2.84.0", + "resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.84.0.tgz", + "integrity": "sha512-J6XKbqqg1HQPMfYkAT9BrC8anPpAiifl7qoVLsYhQq5B/dnu/lxab1pabnxtJEsvYG5rwI5HEVEGXMjoQ6Wz2Q==", + "license": "MIT", "dependencies": { - "@smithy/util-base64": "^4.3.0", - "tslib": "^2.6.2" + "tslib": "2.8.1" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@smithy/config-resolver": { - "version": "4.4.6", - "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.4.6.tgz", - "integrity": "sha512-qJpzYC64kaj3S0fueiu3kXm8xPrR3PcXDPEgnaNMRn0EjNSZFoFjvbUp0YUDsRhN1CB90EnHJtbxWKevnH99UQ==", - "license": "Apache-2.0", + "node_modules/@supabase/functions-js": { + "version": "2.84.0", + "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.84.0.tgz", + "integrity": "sha512-2oY5QBV4py/s64zMlhPEz+4RTdlwxzmfhM1k2xftD2v1DruRZKfoe7Yn9DCz1VondxX8evcvpc2udEIGzHI+VA==", + "license": "MIT", "dependencies": { - "@smithy/node-config-provider": "^4.3.8", - "@smithy/types": "^4.12.0", - "@smithy/util-config-provider": "^4.2.0", - "@smithy/util-endpoints": "^3.2.8", - "@smithy/util-middleware": "^4.2.8", - "tslib": "^2.6.2" + "tslib": "2.8.1" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@smithy/core": { - "version": "3.23.2", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.23.2.tgz", - "integrity": "sha512-HaaH4VbGie4t0+9nY3tNBRSxVTr96wzIqexUa6C2qx3MPePAuz7lIxPxYtt1Wc//SPfJLNoZJzfdt0B6ksj2jA==", - "license": "Apache-2.0", + "node_modules/@supabase/postgrest-js": { + "version": "2.84.0", + "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-2.84.0.tgz", + "integrity": "sha512-oplc/3jfJeVW4F0J8wqywHkjIZvOVHtqzF0RESijepDAv5Dn/LThlGW1ftysoP4+PXVIrnghAbzPHo88fNomPQ==", + "license": "MIT", "dependencies": { - "@smithy/middleware-serde": "^4.2.9", - "@smithy/protocol-http": "^5.3.8", - "@smithy/types": "^4.12.0", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-body-length-browser": "^4.2.0", - "@smithy/util-middleware": "^4.2.8", - "@smithy/util-stream": "^4.5.12", - "@smithy/util-utf8": "^4.2.0", - "@smithy/uuid": "^1.1.0", - "tslib": "^2.6.2" + "tslib": "2.8.1" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@smithy/credential-provider-imds": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.2.8.tgz", - "integrity": "sha512-FNT0xHS1c/CPN8upqbMFP83+ul5YgdisfCfkZ86Jh2NSmnqw/AJ6x5pEogVCTVvSm7j9MopRU89bmDelxuDMYw==", - "license": "Apache-2.0", + "node_modules/@supabase/realtime-js": { + "version": "2.84.0", + "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.84.0.tgz", + "integrity": "sha512-ThqjxiCwWiZAroHnYPmnNl6tZk6jxGcG2a7Hp/3kcolPcMj89kWjUTA3cHmhdIWYsP84fHp8MAQjYWMLf7HEUg==", + "license": "MIT", "dependencies": { - "@smithy/node-config-provider": "^4.3.8", - "@smithy/property-provider": "^4.2.8", - "@smithy/types": "^4.12.0", - "@smithy/url-parser": "^4.2.8", - "tslib": "^2.6.2" + "@types/phoenix": "^1.6.6", + "@types/ws": "^8.18.1", + "tslib": "2.8.1", + "ws": "^8.18.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@smithy/eventstream-codec": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-4.2.8.tgz", - "integrity": "sha512-jS/O5Q14UsufqoGhov7dHLOPCzkYJl9QDzusI2Psh4wyYx/izhzvX9P4D69aTxcdfVhEPhjK+wYyn/PzLjKbbw==", - "license": "Apache-2.0", + "node_modules/@supabase/storage-js": { + "version": "2.84.0", + "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.84.0.tgz", + "integrity": "sha512-vXvAJ1euCuhryOhC6j60dG8ky+lk0V06ubNo+CbhuoUv+sl39PyY0lc+k+qpQhTk/VcI6SiM0OECLN83+nyJ5A==", + "license": "MIT", "dependencies": { - "@aws-crypto/crc32": "5.2.0", - "@smithy/types": "^4.12.0", - "@smithy/util-hex-encoding": "^4.2.0", - "tslib": "^2.6.2" + "tslib": "2.8.1" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@smithy/eventstream-serde-browser": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-4.2.8.tgz", - "integrity": "sha512-MTfQT/CRQz5g24ayXdjg53V0mhucZth4PESoA5IhvaWVDTOQLfo8qI9vzqHcPsdd2v6sqfTYqF5L/l+pea5Uyw==", - "license": "Apache-2.0", + "node_modules/@supabase/supabase-js": { + "version": "2.84.0", + "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.84.0.tgz", + "integrity": "sha512-byMqYBvb91sx2jcZsdp0qLpmd4Dioe80e4OU/UexXftCkpTcgrkoENXHf5dO8FCSai8SgNeq16BKg10QiDI6xg==", + "license": "MIT", "dependencies": { - "@smithy/eventstream-serde-universal": "^4.2.8", - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" + "@supabase/auth-js": "2.84.0", + "@supabase/functions-js": "2.84.0", + "@supabase/postgrest-js": "2.84.0", + "@supabase/realtime-js": "2.84.0", + "@supabase/storage-js": "2.84.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@smithy/eventstream-serde-config-resolver": { - "version": "4.3.8", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-4.3.8.tgz", - "integrity": "sha512-ah12+luBiDGzBruhu3efNy1IlbwSEdNiw8fOZksoKoWW1ZHvO/04MQsdnws/9Aj+5b0YXSSN2JXKy/ClIsW8MQ==", - "license": "Apache-2.0", + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "license": "MIT", "dependencies": { - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" + "undici-types": "~7.16.0" + } + }, + "node_modules/@types/phoenix": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.6.tgz", + "integrity": "sha512-PIzZZlEppgrpoT2QgbnDU+MMzuR6BbCjllj0bM70lWoejMeNJAxCchxnv7J3XFkI8MpygtRpzXrIlmWUBclP5A==", + "license": "MIT" + }, + "node_modules/@types/webidl-conversions": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", + "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==", + "license": "MIT" + }, + "node_modules/@types/whatwg-url": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", + "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", + "license": "MIT", + "dependencies": { + "@types/webidl-conversions": "*" + } + }, + "node_modules/@types/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.6" } }, - "node_modules/@smithy/eventstream-serde-node": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-4.2.8.tgz", - "integrity": "sha512-cYpCpp29z6EJHa5T9WL0KAlq3SOKUQkcgSoeRfRVwjGgSFl7Uh32eYGt7IDYCX20skiEdRffyDpvF2efEZPC0A==", - "license": "Apache-2.0", + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "license": "MIT", "dependencies": { - "@smithy/eventstream-serde-universal": "^4.2.8", - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" + "color-convert": "^1.9.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=4" } }, - "node_modules/@smithy/eventstream-serde-universal": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-4.2.8.tgz", - "integrity": "sha512-iJ6YNJd0bntJYnX6s52NC4WFYcZeKrPUr1Kmmr5AwZcwCSzVpS7oavAmxMR7pMq7V+D1G4s9F5NJK0xwOsKAlQ==", - "license": "Apache-2.0", + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "license": "ISC", "dependencies": { - "@smithy/eventstream-codec": "^4.2.8", - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" }, "engines": { - "node": ">=18.0.0" + "node": ">= 8" } }, - "node_modules/@smithy/fetch-http-handler": { - "version": "5.3.9", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.3.9.tgz", - "integrity": "sha512-I4UhmcTYXBrct03rwzQX1Y/iqQlzVQaPxWjCjula++5EmWq9YGBrx6bbGqluGc1f0XEfhSkiY4jhLgbsJUMKRA==", - "license": "Apache-2.0", + "node_modules/append-field": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==", + "license": "MIT" + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, + "license": "MIT", "dependencies": { - "@smithy/protocol-http": "^5.3.8", - "@smithy/querystring-builder": "^4.2.8", - "@smithy/types": "^4.12.0", - "@smithy/util-base64": "^4.3.0", - "tslib": "^2.6.2" + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=18.0.0" + "node": ">= 0.4" } }, - "node_modules/@smithy/hash-blob-browser": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/@smithy/hash-blob-browser/-/hash-blob-browser-4.2.9.tgz", - "integrity": "sha512-m80d/iicI7DlBDxyQP6Th7BW/ejDGiF0bgI754+tiwK0lgMkcaIBgvwwVc7OFbY4eUzpGtnig52MhPAEJ7iNYg==", - "license": "Apache-2.0", + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", "dependencies": { - "@smithy/chunked-blob-reader": "^5.2.0", - "@smithy/chunked-blob-reader-native": "^4.2.1", - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" + "possible-typed-array-names": "^1.0.0" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/@smithy/hash-node": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.2.8.tgz", - "integrity": "sha512-7ZIlPbmaDGxVoxErDZnuFG18WekhbA/g2/i97wGj+wUBeS6pcUeAym8u4BXh/75RXWhgIJhyC11hBzig6MljwA==", - "license": "Apache-2.0", + "node_modules/axios": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", + "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", + "license": "MIT", "dependencies": { - "@smithy/types": "^4.12.0", - "@smithy/util-buffer-from": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" + "follow-redirects": "^1.15.6", + "form-data": "^4.0.4", + "proxy-from-env": "^1.1.0" } }, - "node_modules/@smithy/hash-stream-node": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/hash-stream-node/-/hash-stream-node-4.2.8.tgz", - "integrity": "sha512-v0FLTXgHrTeheYZFGhR+ehX5qUm4IQsjAiL9qehad2cyjMWcN2QG6/4mSwbSgEQzI7jwfoXj7z4fxZUx/Mhj2w==", - "license": "Apache-2.0", + "node_modules/axios-cookiejar-support": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/axios-cookiejar-support/-/axios-cookiejar-support-6.0.5.tgz", + "integrity": "sha512-ldPOQCJWB0ipugkTNVB8QRl/5L2UgfmVNVQtS9en1JQJ1wW588PqAmymnwmmgc12HLDzDtsJ28xE2ppj4rD4ng==", + "license": "MIT", "dependencies": { - "@smithy/types": "^4.12.0", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" + "http-cookie-agent": "^7.0.3" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/3846masa" + }, + "peerDependencies": { + "axios": ">=0.20.0", + "tough-cookie": ">=4.0.0" } }, - "node_modules/@smithy/invalid-dependency": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.2.8.tgz", - "integrity": "sha512-N9iozRybwAQ2dn9Fot9kI6/w9vos2oTXLhtK7ovGqwZjlOcxu6XhPlpLpC+INsxktqHinn5gS2DXDjDF2kG5sQ==", - "license": "Apache-2.0", + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "license": "MIT", "dependencies": { - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" + "safe-buffer": "5.1.2" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.8" } }, - "node_modules/@smithy/is-array-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.2.0.tgz", - "integrity": "sha512-DZZZBvC7sjcYh4MazJSGiWMI2L7E0oCiRHREDzIxi/M2LY79/21iXt6aPLHge82wi5LsuRF5A06Ds3+0mlh6CQ==", - "license": "Apache-2.0", + "node_modules/bcrypt": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-6.0.0.tgz", + "integrity": "sha512-cU8v/EGSrnH+HnxV2z0J7/blxH8gq7Xh2JFT6Aroax7UohdmiJJlxApMxtKfuI7z68NvvVcmR78k2LbT6efhRg==", + "hasInstallScript": true, + "license": "MIT", "dependencies": { - "tslib": "^2.6.2" + "node-addon-api": "^8.3.0", + "node-gyp-build": "^4.8.4" }, "engines": { - "node": ">=18.0.0" + "node": ">= 18" } }, - "node_modules/@smithy/md5-js": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.2.8.tgz", - "integrity": "sha512-oGMaLj4tVZzLi3itBa9TCswgMBr7k9b+qKYowQ6x1rTyTuO1IU2YHdHUa+891OsOH+wCsH7aTPRsTJO3RMQmjQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.12.0", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, + "node_modules/bcrypt/node_modules/node-addon-api": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.5.0.tgz", + "integrity": "sha512-/bRZty2mXUIFY/xU5HLvveNHlswNJej+RnxBjOMkidWfwZzgTbPG1E3K5TOxRLOR+5hX7bSofy8yf1hZevMS8A==", + "license": "MIT", "engines": { - "node": ">=18.0.0" + "node": "^18 || ^20 || >= 21" } }, - "node_modules/@smithy/middleware-content-length": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.2.8.tgz", - "integrity": "sha512-RO0jeoaYAB1qBRhfVyq0pMgBoUK34YEJxVxyjOWYZiOKOq2yMZ4MnVXMZCUDenpozHue207+9P5ilTV1zeda0A==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/protocol-http": "^5.3.8", - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" - }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "license": "MIT", "engines": { - "node": ">=18.0.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@smithy/middleware-endpoint": { - "version": "4.4.16", - "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.4.16.tgz", - "integrity": "sha512-L5GICFCSsNhbJ5JSKeWFGFy16Q2OhoBizb3X2DrxaJwXSEujVvjG9Jt386dpQn2t7jINglQl0b4K/Su69BdbMA==", - "license": "Apache-2.0", + "node_modules/body-parser": { + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", + "integrity": "sha512-YQyoqQG3sO8iCmf8+hyVpgHHOv0/hCEFiS4zTGUwTA1HjAFX66wRcNQrVCeJq9pgESMRvUAOvSil5MJlmccuKQ==", + "license": "MIT", "dependencies": { - "@smithy/core": "^3.23.2", - "@smithy/middleware-serde": "^4.2.9", - "@smithy/node-config-provider": "^4.3.8", - "@smithy/shared-ini-file-loader": "^4.4.3", - "@smithy/types": "^4.12.0", - "@smithy/url-parser": "^4.2.8", - "@smithy/util-middleware": "^4.2.8", - "tslib": "^2.6.2" + "bytes": "3.0.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "~1.6.3", + "iconv-lite": "0.4.23", + "on-finished": "~2.3.0", + "qs": "6.5.2", + "raw-body": "2.3.3", + "type-is": "~1.6.16" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.8" } }, - "node_modules/@smithy/middleware-retry": { - "version": "4.4.33", - "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.4.33.tgz", - "integrity": "sha512-jLqZOdJhtIL4lnA9hXnAG6GgnJlo1sD3FqsTxm9wSfjviqgWesY/TMBVnT84yr4O0Vfe0jWoXlfFbzsBVph3WA==", - "license": "Apache-2.0", + "node_modules/bowser": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.14.1.tgz", + "integrity": "sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg==", + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", "dependencies": { - "@smithy/node-config-provider": "^4.3.8", - "@smithy/protocol-http": "^5.3.8", - "@smithy/service-error-classification": "^4.2.8", - "@smithy/smithy-client": "^4.11.5", - "@smithy/types": "^4.12.0", - "@smithy/util-middleware": "^4.2.8", - "@smithy/util-retry": "^4.2.8", - "@smithy/uuid": "^1.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/@smithy/middleware-serde": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.2.9.tgz", - "integrity": "sha512-eMNiej0u/snzDvlqRGSN3Vl0ESn3838+nKyVfF2FKNXFbi4SERYT6PR392D39iczngbqqGG0Jl1DlCnp7tBbXQ==", - "license": "Apache-2.0", + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", "dependencies": { - "@smithy/protocol-http": "^5.3.8", - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" + "fill-range": "^7.1.1" }, "engines": { - "node": ">=18.0.0" + "node": ">=8" } }, - "node_modules/@smithy/middleware-stack": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.2.8.tgz", - "integrity": "sha512-w6LCfOviTYQjBctOKSwy6A8FIkQy7ICvglrZFl6Bw4FmcQ1Z420fUtIhxaUZZshRe0VCq4kvDiPiXrPZAe8oRA==", + "node_modules/bson": { + "version": "6.10.4", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.10.4.tgz", + "integrity": "sha512-WIsKqkSC0ABoBJuT1LEX+2HEvNmNKKgnTAyd0fL8qzK4SH2i9NXg+t08YtdZp/V9IZ33cxe3iV4yM0qg8lMQng==", "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" - }, "engines": { - "node": ">=18.0.0" + "node": ">=16.20.1" } }, - "node_modules/@smithy/node-config-provider": { - "version": "4.3.8", - "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.3.8.tgz", - "integrity": "sha512-aFP1ai4lrbVlWjfpAfRSL8KFcnJQYfTl5QxLJXY32vghJrDuFyPZ6LtUL+JEGYiFRG1PfPLHLoxj107ulncLIg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/property-provider": "^4.2.8", - "@smithy/shared-ini-file-loader": "^4.4.3", - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=10.16.0" } }, - "node_modules/@smithy/node-http-handler": { - "version": "4.4.10", - "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.4.10.tgz", - "integrity": "sha512-u4YeUwOWRZaHbWaebvrs3UhwQwj+2VNmcVCwXcYTvPIuVyM7Ex1ftAj+fdbG/P4AkBwLq/+SKn+ydOI4ZJE9PA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/abort-controller": "^4.2.8", - "@smithy/protocol-http": "^5.3.8", - "@smithy/querystring-builder": "^4.2.8", - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" - }, + "node_modules/bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", + "license": "MIT", "engines": { - "node": ">=18.0.0" + "node": ">= 0.8" } }, - "node_modules/@smithy/property-provider": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.2.8.tgz", - "integrity": "sha512-EtCTbyIveCKeOXDSWSdze3k612yCPq1YbXsbqX3UHhkOSW8zKsM9NOJG5gTIya0vbY2DIaieG8pKo1rITHYL0w==", - "license": "Apache-2.0", + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "license": "MIT", "dependencies": { - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/@smithy/protocol-http": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.3.8.tgz", - "integrity": "sha512-QNINVDhxpZ5QnP3aviNHQFlRogQZDfYlCkQT+7tJnErPQbDhysondEjhikuANxgMsZrkGeiAxXy4jguEGsDrWQ==", - "license": "Apache-2.0", + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", "dependencies": { - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.4" } }, - "node_modules/@smithy/querystring-builder": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.2.8.tgz", - "integrity": "sha512-Xr83r31+DrE8CP3MqPgMJl+pQlLLmOfiEUnoyAlGzzJIrEsbKsPy1hqH0qySaQm4oWrCBlUqRt+idEgunKB+iw==", - "license": "Apache-2.0", + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", "dependencies": { - "@smithy/types": "^4.12.0", - "@smithy/util-uri-escape": "^4.2.0", - "tslib": "^2.6.2" + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/@smithy/querystring-parser": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.2.8.tgz", - "integrity": "sha512-vUurovluVy50CUlazOiXkPq40KGvGWSdmusa3130MwrR1UNnNgKAlj58wlOe61XSHRpUfIIh6cE0zZ8mzKaDPA==", - "license": "Apache-2.0", + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "license": "MIT", "dependencies": { - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=4" } }, - "node_modules/@smithy/service-error-classification": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.2.8.tgz", - "integrity": "sha512-mZ5xddodpJhEt3RkCjbmUQuXUOaPNTkbMGR0bcS8FE0bJDLMZlhmpgrvPNCYglVw5rsYTpSnv19womw9WWXKQQ==", - "license": "Apache-2.0", + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "license": "MIT", "dependencies": { - "@smithy/types": "^4.12.0" + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" }, "engines": { - "node": ">=18.0.0" + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" } }, - "node_modules/@smithy/shared-ini-file-loader": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.4.3.tgz", - "integrity": "sha512-DfQjxXQnzC5UbCUPeC3Ie8u+rIWZTvuDPAGU/BxzrOGhRvgUanaP68kDZA+jaT3ZI+djOf+4dERGlm9mWfFDrg==", - "license": "Apache-2.0", + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", "dependencies": { - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" + "color-name": "1.1.3" } }, - "node_modules/@smithy/signature-v4": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.3.8.tgz", - "integrity": "sha512-6A4vdGj7qKNRF16UIcO8HhHjKW27thsxYci+5r/uVRkdcBEkOEiY8OMPuydLX4QHSrJqGHPJzPRwwVTqbLZJhg==", - "license": "Apache-2.0", + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", "dependencies": { - "@smithy/is-array-buffer": "^4.2.0", - "@smithy/protocol-http": "^5.3.8", - "@smithy/types": "^4.12.0", - "@smithy/util-hex-encoding": "^4.2.0", - "@smithy/util-middleware": "^4.2.8", - "@smithy/util-uri-escape": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" + "delayed-stream": "~1.0.0" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.8" } }, - "node_modules/@smithy/smithy-client": { - "version": "4.11.5", - "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.11.5.tgz", - "integrity": "sha512-xixwBRqoeP2IUgcAl3U9dvJXc+qJum4lzo3maaJxifsZxKUYLfVfCXvhT4/jD01sRrHg5zjd1cw2Zmjr4/SuKQ==", - "license": "Apache-2.0", + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT" + }, + "node_modules/concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "engines": [ + "node >= 6.0" + ], + "license": "MIT", "dependencies": { - "@smithy/core": "^3.23.2", - "@smithy/middleware-endpoint": "^4.4.16", - "@smithy/middleware-stack": "^4.2.8", - "@smithy/protocol-http": "^5.3.8", - "@smithy/types": "^4.12.0", - "@smithy/util-stream": "^4.5.12", - "tslib": "^2.6.2" - }, + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha512-kRGRZw3bLlFISDBgwTSA1TMBFN6J6GWDeubmDE3AF+3+yXL8hTWv8r5rkLbqYXY4RjPk/EzHnClI3zQf1cFmHA==", + "license": "MIT", "engines": { - "node": ">=18.0.0" + "node": ">= 0.6" } }, - "node_modules/@smithy/types": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.12.0.tgz", - "integrity": "sha512-9YcuJVTOBDjg9LWo23Qp0lTQ3D7fQsQtwle0jVfpbUHy9qBwCEgKuVH4FqFB3VYu0nwdHKiEMA+oXz7oV8X1kw==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", "engines": { - "node": ">=18.0.0" + "node": ">= 0.6" } }, - "node_modules/@smithy/url-parser": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.2.8.tgz", - "integrity": "sha512-NQho9U68TGMEU639YkXnVMV3GEFFULmmaWdlu1E9qzyIePOHsoSnagTGSDv1Zi8DCNN6btxOSdgmy5E/hsZwhA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/querystring-parser": "^4.2.8", - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" - }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", "engines": { - "node": ">=18.0.0" + "node": ">= 0.6" } }, - "node_modules/@smithy/util-base64": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.3.0.tgz", - "integrity": "sha512-GkXZ59JfyxsIwNTWFnjmFEI8kZpRNIBfxKjv09+nkAWPt/4aGaEWMM04m4sxgNVWkbt2MdSvE3KF/PfX4nFedQ==", - "license": "Apache-2.0", + "node_modules/cookie-parser": { + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.7.tgz", + "integrity": "sha512-nGUvgXnotP3BsjiLX2ypbQnWoGUPIIfHQNZkkC668ntrzGWEZVW70HDEB1qnNGMicPje6EttlIgzo51YSwNQGw==", + "license": "MIT", "dependencies": { - "@smithy/util-buffer-from": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" + "cookie": "0.7.2", + "cookie-signature": "1.0.6" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.8.0" } }, - "node_modules/@smithy/util-body-length-browser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.2.0.tgz", - "integrity": "sha512-Fkoh/I76szMKJnBXWPdFkQJl2r9SjPt3cMzLdOB6eJ4Pnpas8hVoWPYemX/peO0yrrvldgCUVJqOAjUrOLjbxg==", - "license": "Apache-2.0", + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", "dependencies": { - "tslib": "^2.6.2" + "object-assign": "^4", + "vary": "^1" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.10" } }, - "node_modules/@smithy/util-body-length-node": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.2.1.tgz", - "integrity": "sha512-h53dz/pISVrVrfxV1iqXlx5pRg3V2YWFcSQyPyXZRrZoZj4R4DeWRDo1a7dd3CPTcFi3kE+98tuNyD2axyZReA==", - "license": "Apache-2.0", + "node_modules/cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "dev": true, + "license": "MIT", "dependencies": { - "tslib": "^2.6.2" + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" }, "engines": { - "node": ">=18.0.0" + "node": ">=4.8" } }, - "node_modules/@smithy/util-buffer-from": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.2.0.tgz", - "integrity": "sha512-kAY9hTKulTNevM2nlRtxAG2FQ3B2OR6QIrPY3zE5LqJy1oxzmgBGsHLWTcNhWXKchgA0WHW+mZkQrng/pgcCew==", - "license": "Apache-2.0", + "node_modules/cross-spawn/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "license": "MIT", "dependencies": { - "@smithy/is-array-buffer": "^4.2.0", - "tslib": "^2.6.2" + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/@smithy/util-config-provider": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.2.0.tgz", - "integrity": "sha512-YEjpl6XJ36FTKmD+kRJJWYvrHeUvm5ykaUS5xK+6oXffQPHeEM4/nXlZPe+Wu0lsgRUcNZiliYNh/y7q9c2y6Q==", - "license": "Apache-2.0", + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "license": "MIT", "dependencies": { - "tslib": "^2.6.2" + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" } }, - "node_modules/@smithy/util-defaults-mode-browser": { - "version": "4.3.32", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.3.32.tgz", - "integrity": "sha512-092sjYfFMQ/iaPH798LY/OJFBcYu0sSK34Oy9vdixhsU36zlZu8OcYjF3TD4e2ARupyK7xaxPXl+T0VIJTEkkg==", - "license": "Apache-2.0", + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "license": "MIT", "dependencies": { - "@smithy/property-provider": "^4.2.8", - "@smithy/smithy-client": "^4.11.5", - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/@smithy/util-defaults-mode-node": { - "version": "4.2.35", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.2.35.tgz", - "integrity": "sha512-miz/ggz87M8VuM29y7jJZMYkn7+IErM5p5UgKIf8OtqVs/h2bXr1Bt3uTsREsI/4nK8a0PQERbAPsVPVNIsG7Q==", - "license": "Apache-2.0", + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { - "@smithy/config-resolver": "^4.4.6", - "@smithy/credential-provider-imds": "^4.2.8", - "@smithy/node-config-provider": "^4.3.8", - "@smithy/property-provider": "^4.2.8", - "@smithy/smithy-client": "^4.11.5", - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" + "ms": "2.0.0" } }, - "node_modules/@smithy/util-endpoints": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.2.8.tgz", - "integrity": "sha512-8JaVTn3pBDkhZgHQ8R0epwWt+BqPSLCjdjXXusK1onwJlRuN69fbvSK66aIKKO7SwVFM6x2J2ox5X8pOaWcUEw==", - "license": "Apache-2.0", + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", "dependencies": { - "@smithy/node-config-provider": "^4.3.8", - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/@smithy/util-hex-encoding": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.2.0.tgz", - "integrity": "sha512-CCQBwJIvXMLKxVbO88IukazJD9a4kQ9ZN7/UMGBjBcJYvatpWk+9g870El4cB8/EJxfe+k+y0GmR9CAzkF+Nbw==", - "license": "Apache-2.0", + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "license": "MIT", "dependencies": { - "tslib": "^2.6.2" + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/@smithy/util-middleware": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.2.8.tgz", - "integrity": "sha512-PMqfeJxLcNPMDgvPbbLl/2Vpin+luxqTGPpW3NAQVLbRrFRzTa4rNAASYeIGjRV9Ytuhzny39SpyU04EQreF+A==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" - }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", "engines": { - "node": ">=18.0.0" + "node": ">=0.4.0" } }, - "node_modules/@smithy/util-retry": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.2.8.tgz", - "integrity": "sha512-CfJqwvoRY0kTGe5AkQokpURNCT1u/MkRzMTASWMPPo2hNSnKtF1D45dQl3DE2LKLr4m+PW9mCeBMJr5mCAVThg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/service-error-classification": "^4.2.8", - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" - }, + "node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "license": "MIT", "engines": { - "node": ">=18.0.0" + "node": ">= 0.6" } }, - "node_modules/@smithy/util-stream": { - "version": "4.5.12", - "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.5.12.tgz", - "integrity": "sha512-D8tgkrmhAX/UNeCZbqbEO3uqyghUnEmmoO9YEvRuwxjlkKKUE7FOgCJnqpTlQPe9MApdWPky58mNQQHbnCzoNg==", + "node_modules/destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha512-3NdhDuEXnfun/z7x9GOElY49LoqVHoGScmOKwmxhsS8N5Y+Z8KyPPDnaSzqWgYt/ji4mqwfTS34Htrk0zPIXVg==", + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", "license": "Apache-2.0", - "dependencies": { - "@smithy/fetch-http-handler": "^5.3.9", - "@smithy/node-http-handler": "^4.4.10", - "@smithy/types": "^4.12.0", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-buffer-from": "^4.2.0", - "@smithy/util-hex-encoding": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, "engines": { - "node": ">=18.0.0" + "node": ">=8" } }, - "node_modules/@smithy/util-uri-escape": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.2.0.tgz", - "integrity": "sha512-igZpCKV9+E/Mzrpq6YacdTQ0qTiLm85gD6N/IrmyDvQFA4UnU3d5g3m8tMT/6zG/vVkWSU+VxeUyGonL62DuxA==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, + "node_modules/dotenv": { + "version": "17.2.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.3.tgz", + "integrity": "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==", + "license": "BSD-2-Clause", "engines": { - "node": ">=18.0.0" + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" } }, - "node_modules/@smithy/util-utf8": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.2.0.tgz", - "integrity": "sha512-zBPfuzoI8xyBtR2P6WQj63Rz8i3AmfAaJLuNG8dWsfvPe8lO4aCPYLn879mEgHndZH1zQ2oXmG8O1GGzzaoZiw==", - "license": "Apache-2.0", + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", "dependencies": { - "@smithy/util-buffer-from": "^4.2.0", - "tslib": "^2.6.2" + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" }, "engines": { - "node": ">=18.0.0" + "node": ">= 0.4" } }, - "node_modules/@smithy/util-waiter": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-4.2.8.tgz", - "integrity": "sha512-n+lahlMWk+aejGuax7DPWtqav8HYnWxQwR+LCG2BgCUmaGcTe9qZCFsmw8TMg9iG75HOwhrJCX9TCJRLH+Yzqg==", + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/abort-controller": "^4.2.8", - "@smithy/types": "^4.12.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" + "safe-buffer": "^5.0.1" } }, - "node_modules/@smithy/uuid": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@smithy/uuid/-/uuid-1.1.0.tgz", - "integrity": "sha512-4aUIteuyxtBUhVdiQqcDhKFitwfd9hqoSDYY2KRXiWtgoWJ9Bmise+KfEPDiVHWeJepvF8xJO9/9+WDIciMFFw==", + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/ejs": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.6.2.tgz", + "integrity": "sha512-PcW2a0tyTuPHz3tWyYqtK6r1fZ3gp+3Sop8Ph+ZYN81Ob5rwmbHEzaqs10N3BEsaGTkh/ooniXK+WwszGlc2+Q==", "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, "engines": { - "node": ">=18.0.0" + "node": ">=0.10.0" } }, - "node_modules/@standard-schema/spec": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", - "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", - "license": "MIT" + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } }, - "node_modules/@supabase/auth-js": { - "version": "2.84.0", - "resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.84.0.tgz", - "integrity": "sha512-J6XKbqqg1HQPMfYkAT9BrC8anPpAiifl7qoVLsYhQq5B/dnu/lxab1pabnxtJEsvYG5rwI5HEVEGXMjoQ6Wz2Q==", + "node_modules/error-ex": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", + "dev": true, "license": "MIT", "dependencies": { - "tslib": "2.8.1" + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.1.tgz", + "integrity": "sha512-zHXBLhP+QehSSbsS9Pt23Gg964240DPd6QCf8WpkqEXxQ7fhdZzYsocOr5u7apWonsS5EjZDmTF+/slGMyasvw==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.3.0", + "get-proto": "^1.0.1", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.2.1", + "is-set": "^2.0.3", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.1", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.4", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.4", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "stop-iteration-iterator": "^1.1.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.19" }, "engines": { - "node": ">=20.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/@supabase/functions-js": { - "version": "2.84.0", - "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.84.0.tgz", - "integrity": "sha512-2oY5QBV4py/s64zMlhPEz+4RTdlwxzmfhM1k2xftD2v1DruRZKfoe7Yn9DCz1VondxX8evcvpc2udEIGzHI+VA==", + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "license": "MIT", - "dependencies": { - "tslib": "2.8.1" - }, "engines": { - "node": ">=20.0.0" + "node": ">= 0.4" } }, - "node_modules/@supabase/postgrest-js": { - "version": "2.84.0", - "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-2.84.0.tgz", - "integrity": "sha512-oplc/3jfJeVW4F0J8wqywHkjIZvOVHtqzF0RESijepDAv5Dn/LThlGW1ftysoP4+PXVIrnghAbzPHo88fNomPQ==", + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "license": "MIT", - "dependencies": { - "tslib": "2.8.1" - }, "engines": { - "node": ">=20.0.0" + "node": ">= 0.4" } }, - "node_modules/@supabase/realtime-js": { - "version": "2.84.0", - "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.84.0.tgz", - "integrity": "sha512-ThqjxiCwWiZAroHnYPmnNl6tZk6jxGcG2a7Hp/3kcolPcMj89kWjUTA3cHmhdIWYsP84fHp8MAQjYWMLf7HEUg==", + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", "license": "MIT", "dependencies": { - "@types/phoenix": "^1.6.6", - "@types/ws": "^8.18.1", - "tslib": "2.8.1", - "ws": "^8.18.2" + "es-errors": "^1.3.0" }, "engines": { - "node": ">=20.0.0" + "node": ">= 0.4" } }, - "node_modules/@supabase/storage-js": { - "version": "2.84.0", - "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.84.0.tgz", - "integrity": "sha512-vXvAJ1euCuhryOhC6j60dG8ky+lk0V06ubNo+CbhuoUv+sl39PyY0lc+k+qpQhTk/VcI6SiM0OECLN83+nyJ5A==", + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "license": "MIT", "dependencies": { - "tslib": "2.8.1" + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { - "node": ">=20.0.0" + "node": ">= 0.4" } }, - "node_modules/@supabase/supabase-js": { - "version": "2.84.0", - "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.84.0.tgz", - "integrity": "sha512-byMqYBvb91sx2jcZsdp0qLpmd4Dioe80e4OU/UexXftCkpTcgrkoENXHf5dO8FCSai8SgNeq16BKg10QiDI6xg==", + "node_modules/es-to-primitive": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", + "dev": true, "license": "MIT", "dependencies": { - "@supabase/auth-js": "2.84.0", - "@supabase/functions-js": "2.84.0", - "@supabase/postgrest-js": "2.84.0", - "@supabase/realtime-js": "2.84.0", - "@supabase/storage-js": "2.84.0" + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" }, "engines": { - "node": ">=20.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/@types/node": { - "version": "24.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", - "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "node_modules/esbuild": { + "version": "0.27.4", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.4.tgz", + "integrity": "sha512-Rq4vbHnYkK5fws5NF7MYTU68FPRE1ajX7heQ/8QXXWqNgqqJ/GkmmyxIzUnf2Sr/bakf8l54716CcMGHYhMrrQ==", + "dev": true, + "hasInstallScript": true, "license": "MIT", - "dependencies": { - "undici-types": "~7.16.0" + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.4", + "@esbuild/android-arm": "0.27.4", + "@esbuild/android-arm64": "0.27.4", + "@esbuild/android-x64": "0.27.4", + "@esbuild/darwin-arm64": "0.27.4", + "@esbuild/darwin-x64": "0.27.4", + "@esbuild/freebsd-arm64": "0.27.4", + "@esbuild/freebsd-x64": "0.27.4", + "@esbuild/linux-arm": "0.27.4", + "@esbuild/linux-arm64": "0.27.4", + "@esbuild/linux-ia32": "0.27.4", + "@esbuild/linux-loong64": "0.27.4", + "@esbuild/linux-mips64el": "0.27.4", + "@esbuild/linux-ppc64": "0.27.4", + "@esbuild/linux-riscv64": "0.27.4", + "@esbuild/linux-s390x": "0.27.4", + "@esbuild/linux-x64": "0.27.4", + "@esbuild/netbsd-arm64": "0.27.4", + "@esbuild/netbsd-x64": "0.27.4", + "@esbuild/openbsd-arm64": "0.27.4", + "@esbuild/openbsd-x64": "0.27.4", + "@esbuild/openharmony-arm64": "0.27.4", + "@esbuild/sunos-x64": "0.27.4", + "@esbuild/win32-arm64": "0.27.4", + "@esbuild/win32-ia32": "0.27.4", + "@esbuild/win32-x64": "0.27.4" } }, - "node_modules/@types/phoenix": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.6.tgz", - "integrity": "sha512-PIzZZlEppgrpoT2QgbnDU+MMzuR6BbCjllj0bM70lWoejMeNJAxCchxnv7J3XFkI8MpygtRpzXrIlmWUBclP5A==", - "license": "MIT" - }, - "node_modules/@types/webidl-conversions": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", - "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==", + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", "license": "MIT" }, - "node_modules/@types/whatwg-url": { - "version": "11.0.5", - "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", - "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", - "license": "MIT", - "dependencies": { - "@types/webidl-conversions": "*" - } - }, - "node_modules/@types/ws": { - "version": "8.18.1", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", - "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, "license": "MIT", - "dependencies": { - "@types/node": "*" + "engines": { + "node": ">=0.8.0" } }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "license": "MIT", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, "engines": { "node": ">= 0.6" } }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "license": "ISC", + "node_modules/express": { + "version": "4.16.4", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", + "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", + "license": "MIT", "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" + "accepts": "~1.3.5", + "array-flatten": "1.1.1", + "body-parser": "1.18.3", + "content-disposition": "0.5.2", + "content-type": "~1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.1.1", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.4", + "qs": "6.5.2", + "range-parser": "~1.2.0", + "safe-buffer": "5.1.2", + "send": "0.16.2", + "serve-static": "1.13.2", + "setprototypeof": "1.1.0", + "statuses": "~1.4.0", + "type-is": "~1.6.16", + "utils-merge": "1.0.1", + "vary": "~1.1.2" }, "engines": { - "node": ">= 8" + "node": ">= 0.10.0" } }, - "node_modules/append-field": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", - "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==", - "license": "MIT" - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "license": "MIT" - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "license": "MIT" - }, - "node_modules/axios": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", - "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", + "node_modules/express/node_modules/cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha512-+IJOX0OqlHCszo2mBUq+SrEbCj6w7Kpffqx60zYbPTFaO4+yYgRjHwcZNpWvaTylDHaV7PPmBHzSecZiMhtPgw==", "license": "MIT", - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.4", - "proxy-from-env": "^1.1.0" + "engines": { + "node": ">= 0.6" } }, - "node_modules/axios-cookiejar-support": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/axios-cookiejar-support/-/axios-cookiejar-support-6.0.5.tgz", - "integrity": "sha512-ldPOQCJWB0ipugkTNVB8QRl/5L2UgfmVNVQtS9en1JQJ1wW588PqAmymnwmmgc12HLDzDtsJ28xE2ppj4rD4ng==", + "node_modules/fast-xml-parser": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.3.4.tgz", + "integrity": "sha512-EFd6afGmXlCx8H8WTZHhAoDaWaGyuIBoZJ2mknrNxug+aZKjkp0a0dlars9Izl+jF+7Gu1/5f/2h68cQpe0IiA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], "license": "MIT", "dependencies": { - "http-cookie-agent": "^7.0.3" - }, - "engines": { - "node": ">=20.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/3846masa" + "strnum": "^2.1.0" }, - "peerDependencies": { - "axios": ">=0.20.0", - "tough-cookie": ">=4.0.0" + "bin": { + "fxparser": "src/cli/cli.js" } }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "license": "MIT" - }, - "node_modules/basic-auth": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", - "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "license": "MIT", "dependencies": { - "safe-buffer": "5.1.2" + "to-regex-range": "^5.0.1" }, "engines": { - "node": ">= 0.8" + "node": ">=8" } }, - "node_modules/bcrypt": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-6.0.0.tgz", - "integrity": "sha512-cU8v/EGSrnH+HnxV2z0J7/blxH8gq7Xh2JFT6Aroax7UohdmiJJlxApMxtKfuI7z68NvvVcmR78k2LbT6efhRg==", - "hasInstallScript": true, + "node_modules/finalhandler": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "license": "MIT", "dependencies": { - "node-addon-api": "^8.3.0", - "node-gyp-build": "^4.8.4" + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", + "unpipe": "~1.0.0" }, "engines": { - "node": ">= 18" + "node": ">= 0.8" } }, - "node_modules/bcrypt/node_modules/node-addon-api": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.5.0.tgz", - "integrity": "sha512-/bRZty2mXUIFY/xU5HLvveNHlswNJej+RnxBjOMkidWfwZzgTbPG1E3K5TOxRLOR+5hX7bSofy8yf1hZevMS8A==", + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], "license": "MIT", "engines": { - "node": "^18 || ^20 || >= 21" + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } } }, - "node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, "engines": { - "node": ">=8" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/body-parser": { - "version": "1.18.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", - "integrity": "sha512-YQyoqQG3sO8iCmf8+hyVpgHHOv0/hCEFiS4zTGUwTA1HjAFX66wRcNQrVCeJq9pgESMRvUAOvSil5MJlmccuKQ==", + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", "license": "MIT", "dependencies": { - "bytes": "3.0.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "~1.6.3", - "iconv-lite": "0.4.23", - "on-finished": "~2.3.0", - "qs": "6.5.2", - "raw-body": "2.3.3", - "type-is": "~1.6.16" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" }, "engines": { - "node": ">= 0.8" + "node": ">= 6" } }, - "node_modules/bowser": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.14.1.tgz", - "integrity": "sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg==", - "license": "MIT" - }, - "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "engines": { + "node": ">= 0.6" } }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "license": "MIT", - "dependencies": { - "fill-range": "^7.1.1" - }, "engines": { - "node": ">=8" + "node": ">= 0.6" } }, - "node_modules/bson": { - "version": "6.10.4", - "resolved": "https://registry.npmjs.org/bson/-/bson-6.10.4.tgz", - "integrity": "sha512-WIsKqkSC0ABoBJuT1LEX+2HEvNmNKKgnTAyd0fL8qzK4SH2i9NXg+t08YtdZp/V9IZ33cxe3iV4yM0qg8lMQng==", - "license": "Apache-2.0", + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=16.20.1" + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", - "license": "BSD-3-Clause" - }, - "node_modules/buffer-from": { + "node_modules/function-bind": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "node_modules/busboy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", - "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "node_modules/function.prototype.name": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", + "dev": true, + "license": "MIT", "dependencies": { - "streamsearch": "^1.1.0" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" }, "engines": { - "node": ">=10.16.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, "license": "MIT", - "engines": { - "node": ">= 0.8" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "node_modules/generator-function": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", + "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", + "dev": true, "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, "engines": { "node": ">= 0.4" } }, - "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "license": "MIT", "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { - "node": ">= 8.10.0" + "node": ">= 0.4" }, "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", "license": "MIT", "dependencies": { - "delayed-stream": "~1.0.0" + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" }, "engines": { - "node": ">= 0.8" + "node": ">= 0.4" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "license": "MIT" - }, - "node_modules/concat-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", - "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", - "engines": [ - "node >= 6.0" - ], + "node_modules/get-symbol-description": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", + "dev": true, "license": "MIT", "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.0.2", - "typedarray": "^0.0.6" + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha512-kRGRZw3bLlFISDBgwTSA1TMBFN6J6GWDeubmDE3AF+3+yXL8hTWv8r5rkLbqYXY4RjPk/EzHnClI3zQf1cFmHA==", - "license": "MIT", + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, "engines": { - "node": ">= 0.6" + "node": ">= 6" } }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, "engines": { - "node": ">= 0.6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/cookie": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "license": "MIT", "engines": { - "node": ">= 0.6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/cookie-parser": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.7.tgz", - "integrity": "sha512-nGUvgXnotP3BsjiLX2ypbQnWoGUPIIfHQNZkkC668ntrzGWEZVW70HDEB1qnNGMicPje6EttlIgzo51YSwNQGw==", + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-bigints": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", + "dev": true, "license": "MIT", - "dependencies": { - "cookie": "0.7.2", - "cookie-signature": "1.0.6" - }, "engines": { - "node": ">= 0.8.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", - "license": "MIT" - }, - "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "license": "MIT", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, "engines": { - "node": ">= 0.10" + "node": ">=4" } }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, "license": "MIT", "dependencies": { - "ms": "2.0.0" + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "node_modules/has-proto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", + "dev": true, "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, "engines": { - "node": ">=0.4.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "license": "MIT", "engines": { - "node": ">= 0.6" - } - }, - "node_modules/destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha512-3NdhDuEXnfun/z7x9GOElY49LoqVHoGScmOKwmxhsS8N5Y+Z8KyPPDnaSzqWgYt/ji4mqwfTS34Htrk0zPIXVg==", - "license": "MIT" - }, - "node_modules/detect-libc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", - "license": "Apache-2.0", - "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/dotenv": { - "version": "17.2.3", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.3.tgz", - "integrity": "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==", - "license": "BSD-2-Clause", + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, "engines": { - "node": ">=12" + "node": ">= 0.4" }, "funding": { - "url": "https://dotenvx.com" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "license": "MIT", "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" + "function-bind": "^1.1.2" }, "engines": { "node": ">= 0.4" } }, - "node_modules/ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "license": "Apache-2.0", + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true, + "license": "ISC" + }, + "node_modules/http-cookie-agent": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/http-cookie-agent/-/http-cookie-agent-7.0.3.tgz", + "integrity": "sha512-EeZo7CGhfqPW6R006rJa4QtZZUpBygDa2HZH3DJqsTzTjyRE6foDBVQIv/pjVsxHC8z2GIdbB1Hvn9SRorP3WQ==", + "license": "MIT", "dependencies": { - "safe-buffer": "^5.0.1" + "agent-base": "^7.1.4" + }, + "engines": { + "node": ">=20.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/3846masa" + }, + "peerDependencies": { + "tough-cookie": "^4.0.0 || ^5.0.0 || ^6.0.0", + "undici": "^7.0.0" + }, + "peerDependenciesMeta": { + "undici": { + "optional": true + } } }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "license": "MIT" + "node_modules/http-cookie-agent/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", + "engines": { + "node": ">= 14" + } }, - "node_modules/ejs": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.6.2.tgz", - "integrity": "sha512-PcW2a0tyTuPHz3tWyYqtK6r1fZ3gp+3Sop8Ph+ZYN81Ob5rwmbHEzaqs10N3BEsaGTkh/ooniXK+WwszGlc2+Q==", - "license": "Apache-2.0", + "node_modules/http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", + "license": "MIT", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.6" } }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "node_modules/iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, "engines": { - "node": ">= 0.8" + "node": ">=0.10.0" } }, - "node_modules/es-define-property": { + "node_modules/ignore-by-default": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "license": "ISC" + }, + "node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", + "license": "ISC" + }, + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + }, "engines": { "node": ">= 0.4" } }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "node_modules/ip-address": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz", + "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==", "license": "MIT", + "optional": true, + "peer": true, "engines": { - "node": ">= 0.4" + "node": ">= 12" } }, - "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", "engines": { - "node": ">= 0.4" + "node": ">= 0.10" } }, - "node_modules/es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, "license": "MIT", "dependencies": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, "license": "MIT" }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.16.4", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", - "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, "license": "MIT", "dependencies": { - "accepts": "~1.3.5", - "array-flatten": "1.1.1", - "body-parser": "1.18.3", - "content-disposition": "0.5.2", - "content-type": "~1.0.4", - "cookie": "0.3.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.1.1", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.4", - "qs": "6.5.2", - "range-parser": "~1.2.0", - "safe-buffer": "5.1.2", - "send": "0.16.2", - "serve-static": "1.13.2", - "setprototypeof": "1.1.0", - "statuses": "~1.4.0", - "type-is": "~1.6.16", - "utils-merge": "1.0.1", - "vary": "~1.1.2" + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" }, "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/express/node_modules/cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha512-+IJOX0OqlHCszo2mBUq+SrEbCj6w7Kpffqx60zYbPTFaO4+yYgRjHwcZNpWvaTylDHaV7PPmBHzSecZiMhtPgw==", - "license": "MIT", - "engines": { - "node": ">= 0.6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/fast-xml-parser": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.3.4.tgz", - "integrity": "sha512-EFd6afGmXlCx8H8WTZHhAoDaWaGyuIBoZJ2mknrNxug+aZKjkp0a0dlars9Izl+jF+7Gu1/5f/2h68cQpe0IiA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" - } - ], + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, "license": "MIT", "dependencies": { - "strnum": "^2.1.0" + "has-bigints": "^1.0.2" }, - "bin": { - "fxparser": "src/cli/cli.js" + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "license": "MIT", "dependencies": { - "to-regex-range": "^5.0.1" + "binary-extensions": "^2.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/finalhandler": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", - "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "node_modules/is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", + "dev": true, "license": "MIT", "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "statuses": "~1.4.0", - "unpipe": "~1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { - "node": ">= 0.8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/follow-redirects": { - "version": "1.15.11", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", - "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, "license": "MIT", "engines": { - "node": ">=4.0" + "node": ">= 0.4" }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/form-data": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", - "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, "license": "MIT", "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.12" + "hasown": "^2.0.2" }, "engines": { - "node": ">= 6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", + "dev": true, "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + }, "engines": { - "node": ">= 0.6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, "engines": { - "node": ">= 0.6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node": ">=0.10.0" } }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "node_modules/is-generator-function": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", + "dev": true, "license": "MIT", "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -3072,35 +4470,36 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "license": "MIT", "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" + "is-extglob": "^2.1.1" }, "engines": { - "node": ">= 0.4" + "node": ">=0.10.0" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "license": "MIT", "engines": { - "node": ">= 6" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3109,20 +4508,25 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "license": "MIT", "engines": { - "node": ">=4" + "node": ">=0.12.0" } }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, "engines": { "node": ">= 0.4" }, @@ -3130,13 +4534,17 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, "license": "MIT", "dependencies": { - "has-symbols": "^1.0.3" + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -3145,151 +4553,145 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/http-cookie-agent": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/http-cookie-agent/-/http-cookie-agent-7.0.3.tgz", - "integrity": "sha512-EeZo7CGhfqPW6R006rJa4QtZZUpBygDa2HZH3DJqsTzTjyRE6foDBVQIv/pjVsxHC8z2GIdbB1Hvn9SRorP3WQ==", + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, "license": "MIT", "dependencies": { - "agent-base": "^7.1.4" + "call-bound": "^1.0.3" }, "engines": { - "node": ">=20.0.0" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/3846masa" - }, - "peerDependencies": { - "tough-cookie": "^4.0.0 || ^5.0.0 || ^6.0.0", - "undici": "^7.0.0" - }, - "peerDependenciesMeta": { - "undici": { - "optional": true - } - } - }, - "node_modules/http-cookie-agent/node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "license": "MIT", - "engines": { - "node": ">= 14" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, "license": "MIT", "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { - "node": ">= 0.6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/iconv-lite": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, "license": "MIT", "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", - "license": "ISC" - }, - "node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", - "license": "ISC" - }, - "node_modules/ip-address": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz", - "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==", + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, "license": "MIT", - "optional": true, - "peer": true, + "dependencies": { + "which-typed-array": "^1.1.16" + }, "engines": { - "node": ">= 12" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, "license": "MIT", "engines": { - "node": ">= 0.10" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "dev": true, "license": "MIT", "dependencies": { - "binary-extensions": "^2.0.0" + "call-bound": "^1.0.3" }, "engines": { - "node": ">=8" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, "license": "MIT", "dependencies": { - "is-extglob": "^2.1.1" + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" }, "node_modules/joi": { "version": "18.0.1", @@ -3309,6 +4711,13 @@ "node": ">= 20" } }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true, + "license": "MIT" + }, "node_modules/jsonwebtoken": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", @@ -3367,6 +4776,22 @@ "node": ">=12.0.0" } }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", @@ -3433,6 +4858,15 @@ "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", "license": "MIT" }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, "node_modules/merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -3688,6 +5122,13 @@ "node": ">= 0.6" } }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true, + "license": "MIT" + }, "node_modules/node-gyp-build": { "version": "4.8.4", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", @@ -3759,6 +5200,29 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -3768,6 +5232,32 @@ "node": ">=0.10.0" } }, + "node_modules/npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": ">= 4" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -3777,6 +5267,50 @@ "node": ">=0.10.0" } }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -3807,21 +5341,83 @@ "node": ">=14.10.0" } }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "license": "MIT", + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "license": "MIT", "engines": { - "node": ">= 0.8" + "node": ">= 0.8" + } + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" } }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, "node_modules/path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", "license": "MIT" }, + "node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -3834,6 +5430,39 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true, + "license": "MIT", + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -3901,6 +5530,21 @@ "node": ">= 0.8" } }, + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -3927,12 +5571,132 @@ "node": ">=8.10.0" } }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "license": "MIT" }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -3971,73 +5735,243 @@ "range-parser": "~1.2.0", "statuses": "~1.4.0" }, - "engines": { - "node": ">= 0.8.0" + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "license": "MIT", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", + "send": "0.16.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/serverless-http": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serverless-http/-/serverless-http-4.0.0.tgz", + "integrity": "sha512-KKl9h1+VApX9y2vHsVMogf906UXBwO3FDYiWPzqS0mCjEEx4Sx91JrssbWA7RN43HBuxrtoh8MkocZPvjyGnLg==", + "license": "MIT", + "engines": { + "node": ">=12.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "license": "ISC" + }, + "node_modules/sharp": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", + "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.2", + "semver": "^7.7.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.34.5", + "@img/sharp-darwin-x64": "0.34.5", + "@img/sharp-libvips-darwin-arm64": "1.2.4", + "@img/sharp-libvips-darwin-x64": "1.2.4", + "@img/sharp-libvips-linux-arm": "1.2.4", + "@img/sharp-libvips-linux-arm64": "1.2.4", + "@img/sharp-libvips-linux-ppc64": "1.2.4", + "@img/sharp-libvips-linux-riscv64": "1.2.4", + "@img/sharp-libvips-linux-s390x": "1.2.4", + "@img/sharp-libvips-linux-x64": "1.2.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", + "@img/sharp-libvips-linuxmusl-x64": "1.2.4", + "@img/sharp-linux-arm": "0.34.5", + "@img/sharp-linux-arm64": "0.34.5", + "@img/sharp-linux-ppc64": "0.34.5", + "@img/sharp-linux-riscv64": "0.34.5", + "@img/sharp-linux-s390x": "0.34.5", + "@img/sharp-linux-x64": "0.34.5", + "@img/sharp-linuxmusl-arm64": "0.34.5", + "@img/sharp-linuxmusl-x64": "0.34.5", + "@img/sharp-wasm32": "0.34.5", + "@img/sharp-win32-arm64": "0.34.5", + "@img/sharp-win32-ia32": "0.34.5", + "@img/sharp-win32-x64": "0.34.5" + } + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shell-quote": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, "license": "MIT", "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.2", - "send": "0.16.2" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" }, "engines": { - "node": ">= 0.8.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "license": "ISC" - }, - "node_modules/sharp": { - "version": "0.34.5", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", - "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", - "hasInstallScript": true, - "license": "Apache-2.0", + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "license": "MIT", "dependencies": { - "@img/colour": "^1.0.0", - "detect-libc": "^2.1.2", - "semver": "^7.7.3" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" }, "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + "node": ">= 0.4" }, "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.34.5", - "@img/sharp-darwin-x64": "0.34.5", - "@img/sharp-libvips-darwin-arm64": "1.2.4", - "@img/sharp-libvips-darwin-x64": "1.2.4", - "@img/sharp-libvips-linux-arm": "1.2.4", - "@img/sharp-libvips-linux-arm64": "1.2.4", - "@img/sharp-libvips-linux-ppc64": "1.2.4", - "@img/sharp-libvips-linux-riscv64": "1.2.4", - "@img/sharp-libvips-linux-s390x": "1.2.4", - "@img/sharp-libvips-linux-x64": "1.2.4", - "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", - "@img/sharp-libvips-linuxmusl-x64": "1.2.4", - "@img/sharp-linux-arm": "0.34.5", - "@img/sharp-linux-arm64": "0.34.5", - "@img/sharp-linux-ppc64": "0.34.5", - "@img/sharp-linux-riscv64": "0.34.5", - "@img/sharp-linux-s390x": "0.34.5", - "@img/sharp-linux-x64": "0.34.5", - "@img/sharp-linuxmusl-arm64": "0.34.5", - "@img/sharp-linuxmusl-x64": "0.34.5", - "@img/sharp-wasm32": "0.34.5", - "@img/sharp-win32-arm64": "0.34.5", - "@img/sharp-win32-ia32": "0.34.5", - "@img/sharp-win32-x64": "0.34.5" + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/sift": { @@ -4095,6 +6029,42 @@ "memory-pager": "^1.0.2" } }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.23", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.23.tgz", + "integrity": "sha512-CWLcCCH7VLu13TgOH+r8p1O/Znwhqv/dbb6lqWy67G+pT1kHmeD/+V36AVb/vq8QMIQwVShJ6Ssl5FPh0fuSdw==", + "dev": true, + "license": "CC0-1.0" + }, "node_modules/statuses": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", @@ -4104,6 +6074,20 @@ "node": ">= 0.6" } }, + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/streamsearch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", @@ -4141,6 +6125,94 @@ ], "license": "MIT" }, + "node_modules/string.prototype.padend": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", + "integrity": "sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/strnum": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.2.tgz", @@ -4165,6 +6237,19 @@ "node": ">=4" } }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/tldts": { "version": "7.0.19", "resolved": "https://registry.npmjs.org/tldts/-/tldts-7.0.19.tgz", @@ -4247,12 +6332,109 @@ "node": ">= 0.6" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", "license": "MIT" }, + "node_modules/unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/undefsafe": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", @@ -4289,6 +6471,17 @@ "node": ">= 0.4.0" } }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -4320,6 +6513,108 @@ "node": ">=18" } }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.20", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.20.tgz", + "integrity": "sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/ws": { "version": "8.18.3", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", diff --git a/package.json b/package.json index bad8531..2d9b6f2 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "version": "0.0.0", "private": true, "scripts": { - "start": "nodemon ./bin/www" + "start": "nodemon server.js", + "build": "node esbuild.config.js" }, "dependencies": { "@aws-sdk/client-s3": "^3.992.0", @@ -26,7 +27,12 @@ "nodemailer": "^7.0.10", "nodemon": "^3.1.10", "otp-generator": "^4.0.1", + "serverless-http": "^4.0.0", "sharp": "^0.34.5", "tough-cookie": "^6.0.0" + }, + "devDependencies": { + "esbuild": "^0.27.4", + "npm-run-all": "^4.1.5" } } diff --git a/routes/menu.js b/routes/menu.js index 061ed3c..8085aea 100644 --- a/routes/menu.js +++ b/routes/menu.js @@ -1,8 +1,20 @@ const express = require("express"); const router = express.Router(); -const { getBranchDetailsByslug, getCategoriesbyIdForMenu, getMenuItemsByBranchIdForMenu, getSpecialMenuItemsByBranchId, getCarasoulByBranchId, logMenuAccess } = require("../controller/menuController"); +const { + getFullMenuBySlug, + getBranchDetailsByslug, + getCategoriesbyIdForMenu, + getMenuItemsByBranchIdForMenu, + getSpecialMenuItemsByBranchId, + getCarasoulByBranchId, + logMenuAccess, +} = require("../controller/menuController"); +// Extremely optimized full payload +router.get("/full/:slug", getFullMenuBySlug); + +// old backups router.get("/:slug", getBranchDetailsByslug); router.get("/category/:branchId", getCategoriesbyIdForMenu); router.get("/menu/:branchId", getMenuItemsByBranchIdForMenu); @@ -10,5 +22,4 @@ router.get("/special-item/:branchId", getSpecialMenuItemsByBranchId); router.get("/carasoul/:branchId", getCarasoulByBranchId); router.get("/access-log/:slug", logMenuAccess); - module.exports = router; diff --git a/server.js b/server.js index 3c8b5c3..719c501 100644 --- a/server.js +++ b/server.js @@ -1,14 +1,15 @@ - var createError = require("http-errors"); var express = require("express"); var cookieParser = require("cookie-parser"); var logger = require("morgan"); var cors = require("cors"); const mongoose = require("mongoose"); -const connectDB = require("./config/db.connect"); +const serverless = require("serverless-http"); +const connectDB = require("./config/db.connect"); const { authMiddleware } = require("./middleware/authMiddleware"); +/* -------------------- ROUTES -------------------- */ var usersRouter = require("./routes/users.js"); var restaurantRouter = require("./routes/restaurantRoute"); var categoryRouter = require("./routes/category.js"); @@ -18,32 +19,34 @@ var specialTagRouter = require("./routes/specialTagRoutes.js"); var adsRouter = require("./routes/ads.js"); var menuRouter = require("./routes/menu.js"); -// Connect to MongoDB -connectDB(); - +/* -------------------- CREATE APP -------------------- */ var app = express(); /* -------------------- BASIC MIDDLEWARE -------------------- */ -app.use(logger("dev")); +// Disable Morgan in production Lambda — each log is synchronous I/O overhead +if (process.env.NODE_ENV !== "production") { + app.use(logger("dev")); +} app.use(express.json()); -app.use(express.urlencoded({ extended: false })); app.use(cookieParser()); -/* -------------------- CORS (FINAL) -------------------- */ -const allowedOrigins = [ +/* -------------------- CORS -------------------- */ +const allowedOrigins = new Set([ "https://admin.digifymenu.com", "https://menu.digifymenu.com", + "https://admin.digifymenu.in", + "https://menu.digifymenu.in", "http://localhost:5173", "http://localhost:5174", "http://localhost:5001", - "http://localhost:3000" -]; + "http://localhost:3000", +]); const corsMiddleware = cors({ origin: function (origin, callback) { if (!origin) return callback(null, true); // Postman, curl - if (allowedOrigins.includes(origin)) { + if (allowedOrigins.has(origin)) { return callback(null, true); } @@ -60,12 +63,13 @@ const corsMiddleware = cors({ ], }); -/* 🔥 CORS MUST COME BEFORE AUTH */ app.use(corsMiddleware); - -/* 🔥 EXPLICIT OPTIONS HANDLER (MANDATORY) */ app.options("*", corsMiddleware); +app.get("/api/v1/health", (req, res) => { + res.status(200).json({ message: "Health check successfull" }); +}); + /* -------------------- AUTH -------------------- */ app.use(authMiddleware); @@ -90,12 +94,38 @@ app.use(function (err, req, res, next) { res.status(statusCode).json({ success: false, message: err.message, - error: req.app.get("env") === "development" ? err : {}, + error: process.env.NODE_ENV === "development" ? err : {}, }); }); -mongoose.connection.once('open', () => { - console.log('Connected to MongoDB'); +/* -------------------- MONGO LOG -------------------- */ +mongoose.connection.once("open", () => { + console.log("Connected to MongoDB"); }); -module.exports = app; +/* -------------------- EXPORT FOR LAMBDA -------------------- */ +const handler = serverless(app); + +// Start connection during the Lambda INIT phase to mitigate cold start latency +connectDB().catch((err) => console.error("Initial DB connection failed:", err)); + +module.exports.handler = async (event, context) => { + // Prevents Lambda from waiting for open MongoDB connections + // Without this, Lambda hangs until timeout after the response is sent + context.callbackWaitsForEmptyEventLoop = false; + + // Connect to DB (connectDB must have readyState check inside it) + await connectDB(); + + return handler(event, context); +}; + +/* -------------------- LOCAL SERVER (ONLY FOR DEV) -------------------- */ +if (process.env.NODE_ENV !== "production") { + const PORT = process.env.PORT || 5000; + connectDB().then(() => { + app.listen(PORT, () => { + console.log(`Server running locally on port ${PORT}`); + }); + }); +} diff --git a/utils/otpHandler.js b/utils/otpHandler.js index 3e39a41..aab419d 100644 --- a/utils/otpHandler.js +++ b/utils/otpHandler.js @@ -25,8 +25,7 @@ const transporter = nodemailer.createTransport({ const sendOTPEmail = async (email, otp, userName) => { try { const templatePath = path.join( - __dirname, - "..", + process.cwd(), "templates", "signupOtpEmail.ejs" );