Compare commits
23
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03ee337e28 | ||
|
|
48ffd7e49b | ||
|
|
8df94bca26 | ||
|
|
d2aced396f | ||
|
|
4e93722ba5 | ||
|
|
33a5996bee | ||
|
|
90475d4130 | ||
|
|
8e984e609b | ||
|
|
b48502c34a | ||
|
|
978992057a | ||
|
|
ed0fb8dd64 | ||
|
|
828bc89890 | ||
|
|
b8bf4f88cc | ||
|
|
f74587376e | ||
|
|
a135196cb5 | ||
|
|
cfdcb573de | ||
|
|
f17215f236 | ||
|
|
5e60614588 | ||
|
|
e385049652 | ||
|
|
ef295e0994 | ||
|
|
c3382a422d | ||
|
|
5d47e6d291 | ||
|
|
957ba6c72c |
No files matched your search
@@ -1,2 +1,4 @@
|
||||
.env
|
||||
node_modules
|
||||
server/dist
|
||||
dist
|
||||
@@ -0,0 +1,126 @@
|
||||
# To AI Agent: Implement Smart Date-Based Accordion Auto-Expansion and Smooth Viewport Auto-Scroll
|
||||
|
||||
## 1. Context & UI/UX Requirements
|
||||
We are enhancing the routing UX between `MemberDashboard.tsx` and `ItineraryTimeline.tsx` based on `image_cc31a4.png`.
|
||||
|
||||
### Functional Specifications:
|
||||
1. **Date-Matching Evaluation:** When a user clicks "Chi tiết hành trình" on a tour card, calculate if the current user system local date falls inside any Stage/Leg timeline block.
|
||||
2. **Auto-Expansion State:** On timeline page load, the matched Leg accordion must be expanded by default (`expandedStageId === leg.id`).
|
||||
3. **Smart Auto-Scroll Layout:** The viewport must smoothly auto-scroll so that the expanded Leg's title bar lands **exactly below the sticky navigation tab bar** ("Lộ trình", "Chi phí", etc.), making it fully visible at the top of the viewport without layout clipping.
|
||||
|
||||
---
|
||||
|
||||
## 2. Technical Architecture & Layout Constraints
|
||||
|
||||
- **The Sticky Header Challenge:** Since the top navigation tab bar uses sticky/fixed positioning, a naive `scrollIntoView({ block: 'start' })` will cause the Leg's title to crawl *underneath* the tabs, hiding it.
|
||||
- **The Solution:** We will inject a dynamic CSS scroll-margin-top parameter (`scroll-mt-[70px]` or matching header height) on each Leg container, and trigger a minor delayed layout effect pool using a React `setTimeout` to wait for the DOM accordion expansion reflow before pulling the scroll trigger.
|
||||
|
||||
---
|
||||
|
||||
## 3. Code Refactoring Blueprint
|
||||
|
||||
### Step 1: Update Navigation Payload Handler in Dashboard Component
|
||||
Ensure the `MemberDashboard.tsx` accurately packages the matched target identifier into the client route state bucket:
|
||||
|
||||
```typescript
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleNavigateToItinerary = (tour: any) => {
|
||||
let targetLegId = null;
|
||||
|
||||
if (tour?.legs && tour.legs.length > 0) {
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
|
||||
for (const leg of tour.legs) {
|
||||
const rawStart = leg.startDate || leg.plannedStart || leg.date;
|
||||
const rawEnd = leg.endDate || leg.plannedEnd || leg.date;
|
||||
|
||||
if (rawStart) {
|
||||
const startBound = new Date(rawStart);
|
||||
startBound.setHours(0, 0, 0, 0);
|
||||
|
||||
const endBound = rawEnd ? new Date(rawEnd) : new Date(rawStart);
|
||||
endBound.setHours(23, 59, 59, 999);
|
||||
|
||||
if (today >= startBound && today <= endBound) {
|
||||
targetLegId = leg.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!targetLegId) {
|
||||
targetLegId = tour.legs[0].id; // Fallback to Chặng 1 if out of tour bounds
|
||||
}
|
||||
}
|
||||
|
||||
navigate(`/tour/${tour.id}`, {
|
||||
state: { defaultExpandedLegId: targetLegId, shouldScrollToTarget: true }
|
||||
});
|
||||
};
|
||||
|
||||
### Step 2: Inject Safe Identifiers and Scroll Margin inside ItineraryTimeline
|
||||
Locate the top-level outer container div of each Leg item inside the timeline loop (currentTour.legs.map). Assign a unique id and a scroll margin class utility:
|
||||
|
||||
{currentTour.legs.map((leg: any, legIdx: number) => (
|
||||
<div
|
||||
key={leg.id}
|
||||
id={`leg-anchor-node-${leg.id}`}
|
||||
/* CRITICAL: scroll-mt-[70px] leaves a 70px buffer space at the top.
|
||||
Adjust '70px' to match the exact height of your white Tour Navigation Tabs bar!
|
||||
*/
|
||||
className="scroll-mt-[70px] transition-all w-full mb-4"
|
||||
>
|
||||
{/* Accordion Header Title ("Chặng 2: Dạo chơi ở xứ hoa vàng...") */}
|
||||
<div className="flex items-center justify-between ...">
|
||||
...
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
### Step 3: Implement Lifecycle Interaction Trigger Engine
|
||||
Inside ItineraryTimeline.tsx, listen to the passed history route parameters. Set the state, then handle the async smooth scrolling action:
|
||||
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
const location = useLocation();
|
||||
const [expandedStageId, setExpandedStageId] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (location.state?.defaultExpandedLegId) {
|
||||
const targetId = location.state.defaultExpandedLegId;
|
||||
|
||||
// 1. Instantly trigger the accordion state layout expansion
|
||||
setExpandedStageId(targetId);
|
||||
|
||||
// 2. Schedule a deferred macro-task callback to allow DOM re-renders to finish
|
||||
if (location.state?.shouldScrollToTarget) {
|
||||
const scrollTimer = setTimeout(() => {
|
||||
const targetElement = document.getElementById(`leg-anchor-node-${targetId}`);
|
||||
if (targetElement) {
|
||||
targetElement.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'start'
|
||||
});
|
||||
}
|
||||
|
||||
// Clear history router state token flags to prevent repeating scroll on subsequent reload shifts
|
||||
window.history.replaceState({}, document.title);
|
||||
}, 150); // 150ms ensures smooth accordion height deployment transition finishes
|
||||
|
||||
return () => clearTimeout(scrollTimer);
|
||||
}
|
||||
} else if (currentTour?.legs && currentTour.legs.length > 0 && !expandedStageId) {
|
||||
setExpandedStageId(currentTour.legs[0].id);
|
||||
}
|
||||
}, [location.state, currentTour]);
|
||||
|
||||
## 4. Quality Control & Acceptance Verification
|
||||
[ ] Date Matching Accuracy: Set today's date context matching a target Leg configuration profile. Tap the transition interface button from dashboard. The page must route directly and expand the target container block node.
|
||||
|
||||
[ ] Flush Viewport Ceiling Test: The animated target header segment node must slide upwards smoothly. It must lock positions cleanly right below the lowest baseline layer shadow boundary of the Tab Controller without passing behind it.
|
||||
|
||||
[ ] State Cleanliness Check: Refreshing or navigating back and forth within the active Timeline panel after the initial landing should not lock or force layout views to keep jumping scroll heights automatically.
|
||||
@@ -0,0 +1,104 @@
|
||||
# To AI Agent: Fix Infinite Re-render Loop and Flickering "ĐANG TÌM ĐƯỜNG TỐI ƯU..." Label
|
||||
|
||||
## 1. Context & Layout Bug Analysis
|
||||
We are resolving a critical performance and UI bug inside the Map routing engine interface (`image.png`):
|
||||
- **The Issue:** The floating loading indicator badge reading `"ĐANG TÌM ĐƯỜNG TỐI ƯU..."` keeps flashing, flickering, or appearing and disappearing in an infinite execution loop.
|
||||
- **Root Cause:** This is caused by a broken React lifecycle loop. Every time the map triggers a directions route query, it toggles a loading state variable (`isSearching: true`). Once the route loads, the state updates (`isSearching: false`), forcing a component re-render. If the coordinates object (`origin`, `destination`) or the map instance ref inside the `useEffect` dependency array changes its reference pointer on every render, the hook fires *again*, creating an endless loop of API fetching and component flashing.
|
||||
|
||||
---
|
||||
|
||||
## 2. Technical Execution Strategy
|
||||
To terminate this flickering cycle, we must enforce a strict guard rail on the network/calculation trigger pipeline:
|
||||
1. **Coordinate Reference Stability:** Deconstruct the input latitude/longitude objects into raw primitive string values (e.g., `origin.lat`, `origin.lng`) inside the hook dependency array to avoid object reference mutations triggering re-renders.
|
||||
2. **Locking Ref Mechanism:** Implement a mutable React tracking reference (`const queryInProgress = useRef(false)`) to lock the execution window. If a fetch operation is active, block subsequent duplicate queries from firing.
|
||||
3. **Clean Loading State Termination:** Turn off the search state flag explicitly only *after* the route geometry polyline has completely finished rendering onto the map viewport layout.
|
||||
|
||||
---
|
||||
|
||||
## 3. Code Refactoring Blueprint
|
||||
|
||||
Locate your map navigation layer or modal component (e.g., `LocationNavigationModal.tsx`) and refactor the execution lifecycle loop as defined below:
|
||||
|
||||
```typescript
|
||||
import React, { useEffect, useState, useRef } from 'react';
|
||||
|
||||
// Inside your Map Navigation Modal / Layer component wrapper:
|
||||
export const LocationNavigationModal = ({ isOpen, routeData }) => {
|
||||
const [isSearchingRoute, setIsSearchingRoute] = useState(false);
|
||||
const mapInstanceRef = useRef<any>(null);
|
||||
|
||||
// CRITICAL FIX 2: Guard mechanism to block concurrent duplicated queries
|
||||
const fetchLockRef = useRef(false);
|
||||
|
||||
// Deconstruct coordinate primitives to secure a stable dependency array
|
||||
const originLat = routeData?.origin?.lat;
|
||||
const originLng = routeData?.origin?.lng;
|
||||
const destLat = routeData?.destination?.lat;
|
||||
const destLng = routeData?.destination?.lng;
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen || !originLat || !originLng || !destLat || !destLng) return;
|
||||
|
||||
// If an operation is already locked and active, bail out immediately to prevent loops
|
||||
if (fetchLockRef.current) return;
|
||||
|
||||
const calculateOptimalRoute = async () => {
|
||||
try {
|
||||
// 1. Activate loading feedback banner
|
||||
setIsSearchingRoute(true);
|
||||
fetchLockRef.current = true; // Engage execution lock
|
||||
|
||||
console.log("Fetching route coordinates exactly once...");
|
||||
|
||||
// --- YOUR MAP COMPONENT ROUTING LOGIC START ---
|
||||
// Example: const response = await directionsService.route({...});
|
||||
// await mapInstanceRef.current.drawPolyline(response);
|
||||
// --- YOUR MAP COMPONENT ROUTING LOGIC END ---
|
||||
|
||||
} catch (error) {
|
||||
console.error("Failed to compile route optimization maps:", error);
|
||||
} finally {
|
||||
// 2. Safe, definitive termination of the tracking states
|
||||
setIsSearchingRoute(false);
|
||||
fetchLockRef.current = false; // Disengage execution lock
|
||||
}
|
||||
};
|
||||
|
||||
calculateOptimalRoute();
|
||||
|
||||
// Cleanup phase: Reset execution parameters when inputs dismantle or modal closes
|
||||
return () => {
|
||||
fetchLockRef.current = false;
|
||||
setIsSearchingRoute(false);
|
||||
};
|
||||
|
||||
/* CRITICAL FIX 1: Explicitly tracking primitives only.
|
||||
Do NOT pass full 'routeData', 'mapInstanceRef' or object literals here!
|
||||
*/
|
||||
}, [isOpen, originLat, originLng, destLat, destLng]);
|
||||
|
||||
return (
|
||||
<div className="relative w-full h-full">
|
||||
{/* Map Content Target Canvas */}
|
||||
<div id="navigation-viewport-map-canvas" className="w-full h-full" />
|
||||
|
||||
{/* RENDER CONTROLLER: Only mount the label if routing calculations are actively processing */}
|
||||
{isSearchingRoute && (
|
||||
<div className="absolute top-16 left-4 z-30 bg-white/95 dark:bg-slate-900/95 border border-slate-200 dark:border-slate-800 px-3 py-1.5 rounded-full shadow-lg flex items-center gap-2 animate-pulse">
|
||||
{/* Circular Loading Spinner Element */}
|
||||
<div className="w-3.5 h-3.5 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" />
|
||||
<span className="text-[11px] font-bold text-slate-700 dark:text-slate-200 uppercase tracking-wider">
|
||||
ĐANG TÌM ĐƯỜNG TỐI ƯU...
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
## 4. Verification & Quality Acceptance Criteria
|
||||
[ ] Single Instance Trigger: Check console telemetry outputs. When the map modal mounts, the route compilation routine must print its trace log exactly once.
|
||||
|
||||
[ ] Flicker Nullification: The "ĐANG TÌM ĐƯỜNG TỐI ƯU..." badge must display smoothly with an animation pulse. It must not shake, blink, flash, or rapid-cycle on and off.
|
||||
|
||||
[ ] Deterministic Hiding: As soon as the blue route line draws completely across the map terrain grid layout, the loading badge must cleanly unmount and disappear from view without reappearing unless a new destination node button is clicked.
|
||||
@@ -0,0 +1,132 @@
|
||||
# To AI Agent: Implement Clickable Google Maps Hyperlinks in PDF Export Table
|
||||
|
||||
## 1. Context & Feature Objective
|
||||
We are upgrading the PDF export functionality within the Yotrip Travel Planner application. Currently, the PDF generates a static table containing location names, addresses, and coordinates.
|
||||
**Objective:** Automatically turn every location row inside the PDF table into an interactive, clickable hyperlink. When a user clicks on the location cell in the generated PDF document, it must immediately open a browser tab navigating directly to that exact location on Google Maps.
|
||||
|
||||
---
|
||||
|
||||
## 2. Technical Architecture & Data Strategy
|
||||
|
||||
Because `jspdf-autotable` draws text onto a canvas layout, raw HTML tags like `<a>` will fail. We must implement a two-step rendering lifecycle:
|
||||
1. **Extraction & Styling State:** During the data loop, verify coordinates or address data. Generate a standard universal Google Maps search URL, save it into a coordinate-tracking index object, and transform the raw text cell into a styled cell object (Yale Blue text `#28536b` to mimic an online link).
|
||||
2. **Link Injection Layer:** Utilize the `didDrawCell` hook callback inside the `doc.autoTable` configuration to position a native invisible link window (`doc.link()`) precisely over the drawn dimensions of that specific location cell.
|
||||
|
||||
---
|
||||
|
||||
## 3. Code Refactoring Specification
|
||||
|
||||
### Step 1: Update Data Preparation Loop
|
||||
Locate the loop processing `currentTour.legs` inside your PDF generation code block. Initialize a temporary lookup map array named `pdfMapLinks` and refactor the item distribution logic as follows:
|
||||
|
||||
```typescript
|
||||
// Initialize an index mapping registry for hyperlinks before the loop execution
|
||||
const pdfMapLinks: { [key: number]: string } = {};
|
||||
|
||||
if (currentTour?.legs && currentTour.legs.length > 0) {
|
||||
currentTour.legs.forEach((leg: any, legIdx: number) => {
|
||||
const legName = leg.note || `Chặng ${legIdx + 1}`;
|
||||
const legLocations = (leg.locations || []).filter((loc: any) =>
|
||||
loc && (loc.plannedStart || loc.plannedEnd || loc.name)
|
||||
);
|
||||
|
||||
const startRow = globalRowIndex;
|
||||
|
||||
if (legLocations.length > 0) {
|
||||
legRowRanges[leg.id] = { start: startRow, count: legLocations.length };
|
||||
|
||||
legLocations.forEach((loc: any, locIdx: number) => {
|
||||
const isStartPoint = loc.plannedStart && new Date(loc.plannedStart).getTime() === 0;
|
||||
const timeSource = isStartPoint ? loc.plannedEnd : loc.plannedStart;
|
||||
const timeStr = timeSource ? formatDateTime(timeSource) : '';
|
||||
|
||||
const locName = loc.name || '';
|
||||
const addressStr = loc.address || '';
|
||||
const coordStr = loc.latitude && loc.longitude
|
||||
? `\n${loc.latitude}, ${loc.longitude}`
|
||||
: '';
|
||||
const locationText = [locName, addressStr, coordStr].filter(Boolean).join('\n');
|
||||
const noteText = loc.note || '';
|
||||
|
||||
// 1. Generate standard universal Google Maps URL query pattern
|
||||
let mapUrl = '';
|
||||
if (loc.latitude && loc.longitude) {
|
||||
// Absolute Precision using GPS coordinates
|
||||
mapUrl = `https://www.google.com/maps/search/?api=1&query=${loc.latitude},${loc.longitude}`;
|
||||
} else if (addressStr || locName) {
|
||||
// Text-search query fallback if GPS coordinates are missing
|
||||
mapUrl = `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(addressStr || locName)}`;
|
||||
}
|
||||
|
||||
// 2. Register current row array position to map lookup index
|
||||
const currentRowPosition = tableRows.length;
|
||||
if (mapUrl) {
|
||||
pdfMapLinks[currentRowPosition] = mapUrl;
|
||||
}
|
||||
|
||||
// 3. Convert raw string into custom styled autoTable Cell configuration object
|
||||
const locationCellObj = {
|
||||
content: locationText,
|
||||
// Apply custom link colors matching theme style #28536b (Yale Blue)
|
||||
styles: mapUrl ? { textColor: [40, 83, 107], fontStyle: 'bold' as const } : {}
|
||||
};
|
||||
|
||||
tableRows.push([
|
||||
stt++,
|
||||
timeStr,
|
||||
locIdx === 0 ? legName : '',
|
||||
locationCellObj, // Injected as cell structure object
|
||||
noteText
|
||||
]);
|
||||
globalRowIndex++;
|
||||
});
|
||||
} else {
|
||||
legRowRanges[leg.id] = { start: startRow, count: 1 };
|
||||
tableRows.push([
|
||||
stt++,
|
||||
'',
|
||||
legName,
|
||||
'Chưa có địa điểm trong chặng này',
|
||||
''
|
||||
]);
|
||||
globalRowIndex++;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
### Step 2: Inject Coordinate-Based Overlay inside doc.autoTable
|
||||
Locate the core configuration module block where doc.autoTable({}) is invoked. Inject the didDrawCell event engine to deploy the link bounds:
|
||||
|
||||
doc.autoTable({
|
||||
head: [['STT', 'Thời gian', 'Chặng', 'Địa điểm', 'Ghi chú']],
|
||||
body: tableRows,
|
||||
theme: 'grid',
|
||||
|
||||
// HOOK HANDLER: Overlays active coordinate zones on top of native cells after writing
|
||||
didDrawCell: (data: any) => {
|
||||
// Target explicitly: body section only + column index 3 (Location Column)
|
||||
if (data.section === 'body' && data.column.index === 3) {
|
||||
const activeRowIndex = data.row.index;
|
||||
const targetMapUrl = pdfMapLinks[activeRowIndex];
|
||||
|
||||
if (targetMapUrl) {
|
||||
// Build active link container utilizing jsPDF coordinates framework
|
||||
data.doc.link(
|
||||
data.cell.x,
|
||||
data.cell.y,
|
||||
data.cell.width,
|
||||
data.cell.height,
|
||||
{ url: targetMapUrl }
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
styles: { font: 'Roboto' } // Retain existing styling structure
|
||||
});
|
||||
|
||||
## 4. Quality Control & Acceptance Criteria
|
||||
[ ] Visual Differentiation: Location text cells containing map URLs must render cleanly in bold dark-blue ([40, 83, 107]) while empty state texts stay muted.
|
||||
|
||||
[ ] Coordinate Precision: Clicking a location card possessing explicit coordinates (latitude, longitude) must directly map to those absolute markers instead of doing an inaccurate keyword address query.
|
||||
|
||||
[ ] Boundary Accuracy: The click targets must fit perfectly inside the grid cell borders. Clicking near the edges of column 3 must register properly, while clicking column 2 (Leg name) or column 4 (Notes) must remain non-reactive.
|
||||
-105
@@ -1,105 +0,0 @@
|
||||
Markdown
|
||||
# To AI Agent: Implement Automatic Tour Note Generation & Dynamic Timeline Quick Note Insertion
|
||||
|
||||
## 1. Context & Feature Overview
|
||||
We are implementing an interconnected Note System for the Yotrip Travel Planner application. The feature spans across three core components: `TourDetailPage.tsx`, `MyNotePage.tsx`, and `ItineraryTimeline.tsx`.
|
||||
|
||||
### Core Requirements:
|
||||
1. **Auto-Note Initialization:** When a new Tour is created in `TourDetailPage.tsx`, the system must automatically instantiate a matching master note record inside the `MyNotePage.tsx` system linked by `tourId`.
|
||||
2. **Strict Document Schema Hierarchy:** The note content must format itself using structured headings reflecting the tour's legs (stages) and location points.
|
||||
3. **Timeline Quick Note Insertion:** Inside `ItineraryTimeline.tsx`, each location node must feature a "Quick Note Button". Clicking it must immediately stringify location metadata (Timestamp + Reverse-Geocoded Address + User Text) and `INSERT` it dynamically under the correct Stage section inside the master note.
|
||||
|
||||
---
|
||||
|
||||
## 2. Note Structure & Markdown Payload Template
|
||||
|
||||
When initializing a tour or syncing content, the document data payload within the database/state framework must stringify exactly to this structural template:
|
||||
|
||||
```markdown
|
||||
# [Tên Tour]
|
||||
|
||||
## Ghi chú chung
|
||||
*(Nội dung ghi chú tổng quan của chuyến đi...)*
|
||||
|
||||
## Ghi chú: [Tên Chặng 1]
|
||||
#### 📅 [Ngày giờ] | 📍 [Tên địa điểm - Phân giải từ tọa độ]
|
||||
- **Nhật ký:** [Nội dung người dùng nhập vào ở Điểm này trên Timeline]
|
||||
|
||||
## Ghi chú: [Tên Chặng 2]
|
||||
#### ...
|
||||
|
||||
## 3. Detailed Logic & Component Specifications
|
||||
### Step 1: TourDetailPage.tsx - Creation Hook Handler
|
||||
When the user submits the "Create Tour" form successfully, inject an asynchronous action handler to create the accompanying node container:
|
||||
|
||||
TypeScript
|
||||
// Blueprint for Tour Creation Action Hook
|
||||
const handleCreateTour = async (tourData: any) => {
|
||||
const newTour = await api.tours.create(tourData);
|
||||
|
||||
if (newTour) {
|
||||
// Generate the initial markdown note layout template
|
||||
const initialNoteBody = `# ${newTour.title}\n\n## Ghi chú chung\n\n`;
|
||||
|
||||
await api.notes.create({
|
||||
tourId: newTour.id,
|
||||
title: `Ghi chú: ${newTour.title}`,
|
||||
content: initialNoteBody,
|
||||
createdAt: new Date().toISOString()
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
### Step 2: ItineraryTimeline.tsx - Quick Note Component Injection
|
||||
Locate the location list renderer (leg.locations.map) adjacent to the white circular checkpoint nodes. Insert a small "Quick Note" button (utilizing Lucide icon FileText or similar).
|
||||
|
||||
JSX Target Insertion Blueprint
|
||||
JavaScript
|
||||
|
||||
{/* Quick Note Button Interface sitting right near the action buttons of the card */}
|
||||
<button
|
||||
onClick={() => handleQuickNoteInsert(leg.id, location.id, location)}
|
||||
className="p-1.5 text-yotripLight-steel hover:text-yotripLight-text dark:text-yotripDark-muted dark:hover:text-yotripDark-lime rounded-lg hover:bg-gray-100 dark:hover:bg-yotripDark-surface-muted transition-colors"
|
||||
title="Ghi chú nhanh điểm này"
|
||||
>
|
||||
<FileText className="w-4 h-4" />
|
||||
</button>
|
||||
|
||||
### Step 3: Coordinate Resolution & String Insertion Engine
|
||||
Implement the core method to reverse-geocode latitudes/longitudes, construct the standard string layout, and push the patch to the existing text repository of the note.
|
||||
|
||||
TypeScript
|
||||
|
||||
const handleQuickNoteInsert = async (legId: string, locationId: string, locationData: any) => {
|
||||
// 1. Resolve coordinates to a readable address string
|
||||
const resolvedAddress = await reverseGeocode(locationData.lat, locationData.lng) || locationData.addressName;
|
||||
|
||||
// 2. Format localized Date/Time
|
||||
const formattedTime = locationData.plannedStart
|
||||
? new Date(locationData.plannedStart).toLocaleString('vi-VN')
|
||||
: "Thời gian tùy hứng";
|
||||
|
||||
// 3. Extract user text inputted on the timeline card
|
||||
const userInputText = locationData.timelineComment || "Không có ghi chú thêm.";
|
||||
|
||||
// 4. Synthesize the injection block
|
||||
const noteSnippet = `#### 📅 ${formattedTime} | 📍 ${resolvedAddress}\n- **Nhật ký:** ${userInputText}\n\n`;
|
||||
|
||||
// 5. Trigger API/State update to find the master note by tourId,
|
||||
// locate or append the '## Ghi chú: [Tên Chặng]' marker, and inject the snippet directly below it.
|
||||
await api.notes.insertSectionByTourId(tourId, legId, noteSnippet);
|
||||
};
|
||||
|
||||
## 4. UI Style Integration Constraints
|
||||
Apply the application design system colors directly to the new buttons.
|
||||
|
||||
In Light mode, buttons must remain a clean #28536b (Yale Blue) or soft #7ea8be (Steel Blue).
|
||||
|
||||
In Dark mode, hover interactions must transition to #bce784 (Lime Cream) with a smooth transition-colors duration-200 modifier.
|
||||
|
||||
## 5. Acceptance Criteria for Verification
|
||||
[ ] Instantiation Check: Create a test Tour titled "Hoa vàng cỏ xanh 2026". Navigate to MyNotePage and confirm a note document with the exact title has been instantly spawned.
|
||||
|
||||
[ ] Geocoding & String Format Check: Click the Quick Note button on a location card with coordinates (e.g., 15.56, 108.49). The string appended to the note must fully resolve the address (e.g., "Tam Kỳ, Quảng Nam") instead of dumping raw coordinate numbers.
|
||||
|
||||
[ ] Structural Targeting: Ensure that inserting a quick note from Chặng 2 appends the text directly beneath the ## Ghi chú: Chặng 2 markdown anchor block, without scrambling or overwriting the text blocks of Chặng 1.
|
||||
@@ -1,86 +0,0 @@
|
||||
# To AI Agent: Fix Overlapping Text and Layout Overflow in MyNotePage Note Cards
|
||||
|
||||
## 1. Context & Layout Bug Analysis
|
||||
We are fixing a severe rendering and layout bug inside the Note Card component of `MyNotePage.tsx` as captured in `image.png`:
|
||||
|
||||
- **Bug 1 (Chữ đè chồng lên nhau):** The text lines inside the note body (headings, dates, journal contents) are collapsing vertically and rendering directly on top of each other. This is caused by rogue `absolute` positioning or a broken flex/grid system on inner content elements.
|
||||
- **Bug 2 (Tràn ra khỏi Board chứa):** Long text strings (such as resolved address lines with "Đà Nẵng, Vietnam" or "Tuy Hòa, Phú Yên") are breaking out horizontally and vertically beyond the rounded border bounds of the card.
|
||||
- **Goal:** Clean up the typography layout engine so that elements stack naturally in a vertical flow (`block` or `flex-col`), wrap text cleanly when boundaries are met, and respect the container's height/scroll rules.
|
||||
|
||||
---
|
||||
|
||||
## 2. Refactoring Instructions
|
||||
|
||||
### Step 1: Clean Up the Note Content Wrapper Class
|
||||
Locate the container rendering the inner markdown text inside the note board card. Force it to follow a regular vertical block layout flow and ensure text wrapping is active.
|
||||
|
||||
```jsx
|
||||
{/* ❌ OLD COLLAPSED CONTAINER (Dự đoán đang bị sai class) */}
|
||||
<div className="absolute ..."> or <div className="h-full ...">
|
||||
|
||||
{/* ✅ NEW FIXED CONTAINER STRUCTURE */}
|
||||
<div className="flex flex-col gap-3 w-full text-left overflow-y-auto max-h-[250px] pr-2 scrollbar-thin">
|
||||
{/* Ensure markdown rendering outputs elements as block-level */}
|
||||
<div className="prose prose-sm dark:prose-invert max-w-none break-words whitespace-pre-wrap text-yotripDark-text-primary">
|
||||
{/* Inside here, headings (##, ####) and lists (-) must stack naturally */}
|
||||
{note.content}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
### Step 2: Fix Inner Line Items Styles (If parsing strings manually)
|
||||
If you are split-parsing the lines manually (e.g., parsing 📅 and 📍 into individual rows), ensure NO element inside uses absolute. Every line item must be relative or static.
|
||||
|
||||
/* Inject these explicit fixes into index.css under @layer components if needed */
|
||||
.note-content-line {
|
||||
position: relative !important; /* Force breakout from any absolute parent trap */
|
||||
display: block !important; /* Clear any inline overlap */
|
||||
width: 100% !important;
|
||||
word-break: break-word !important; /* Force text to wrap instead of bleeding out */
|
||||
white-space: normal !important; /* Overwrite any nowrap rule */
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
## 3. Full Component JSX Layout Optimization Blueprint
|
||||
Update the single Note Card render template inside MyNotePage.tsx to match this stable layout standard:
|
||||
|
||||
export const NoteCard = ({ note }) => {
|
||||
return (
|
||||
<div className="relative w-full bg-yotripDark-surface border border-yotripDark-border rounded-2xl p-5 shadow-md hover:shadow-lg transition-all flex flex-col gap-4">
|
||||
|
||||
{/* 1. Header Zone (Title & Date) */}
|
||||
<div className="flex flex-col gap-1 border-b border-yotripDark-border pb-3">
|
||||
<h3 className="text-lg font-bold text-white break-words pr-8">
|
||||
{note.title}
|
||||
</h3>
|
||||
<span className="text-xs text-yotripDark-muted flex items-center gap-1.5">
|
||||
<Calendar className="w-3.5 h-3.5" />
|
||||
{note.date}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* 2. Content Zone - FIXES THE BUG IN IMAGE */}
|
||||
<div className="w-full flex flex-col gap-3 overflow-y-auto max-h-[280px] text-sm text-slate-200 pr-1">
|
||||
{/* Dynamic content rendering with forced layout safety rails */}
|
||||
<div className="space-y-3 break-words whitespace-pre-wrap text-left select-text">
|
||||
{/* Ensure raw strings or processed lines flow down smoothly */}
|
||||
{note.content.split('\n').map((line, index) => {
|
||||
if (line.trim() === '') return null;
|
||||
return (
|
||||
<p key={index} className="leading-relaxed text-slate-200 block w-full m-0 p-0">
|
||||
{line}
|
||||
</p>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
## 4. Verification Checklist for AI Agent
|
||||
[ ] No Overlap: Verify that the "## Ghi chú chung...", "Ghi chú: Xuất phát", and "📅 Thời gian tùy hứng" text elements sit on unique vertical lines. They must never occupy the same space.
|
||||
|
||||
[ ] Horizontal Bound Test: Long addresses (e.g., Apec mandala Victor condotel, Hùng Vương, Phường Tuy Hòa...) must trigger a soft wrap onto line 2 and line 3 instead of punching through the card's right border.
|
||||
|
||||
[ ] Scroll Containment: If the text length exceeds the card's designated size, it must elegantly clip inside and provide a clean vertical scrollbar, rather than dripping out underneath the board container.
|
||||
-129
@@ -1,129 +0,0 @@
|
||||
# NOTE_EDIT.md
|
||||
|
||||
## MyNotePage.tsx
|
||||
**Đường dẫn:** `frontend/src/pages/MyNotePage.tsx`
|
||||
|
||||
### Mục đích
|
||||
Trang quản lý ghi chú cá nhân (My Notes) của người dùng trong một tour. Hỗ trợ tạo, sửa, xóa, tìm kiếm ghi chú và đồng bộ dữ liệu giữa client và server.
|
||||
|
||||
### Cấu trúc & Luồng hoạt động chính
|
||||
- **State quản lý:**
|
||||
- `notes`: danh sách ghi chú hiện tại
|
||||
- `isCreating`: điều khiển hiển thị form tạo/sửa ghi chú
|
||||
- `editingNoteId`: xác định đang sửa ghi chú nào
|
||||
- `noteForm`: lưu trữ form data `{ title, content }`
|
||||
- `searchQuery`: từ khóa tìm kiếm
|
||||
- **Render có 3 nhánh:**
|
||||
1. Không tạo ghi chú + không có ghi chú: hiển thị màn hình trống + nút "Tạo ghi chú mới"
|
||||
2. `isCreating = true`: hiển thị form nhập tiêu đề + ReactQuill + nút Lưu/Hủy
|
||||
3. `filteredNotes.length > 0`: hiển thị danh sách ghi chú dạng grid card
|
||||
- **Lưu ghi chú (handleSaveNote):**
|
||||
- Nếu đang `edit`: cập nhật note trong `notes` gọi API PUT
|
||||
- Nếu `create` mới: tạo `temp_` id, thêm vào đầu mảng `notes`, gọi API POST để lấy id thật
|
||||
- Sau khi API thành công: cập nhật `id` thật và đánh dấu `synced: true`
|
||||
- **Xóa ghi chú:** hỏi confirm → đánh dấu `deletedLocally: true` → gọi API DELETE → xóa khỏi UI
|
||||
- **Đồng bộ offline (syncLocalNotesToServer):**
|
||||
- Xử lý tuần tự 3 nhóm: `deletedLocally` → `temp_` (chưa đồng bộ) → `edited` (synced: false)
|
||||
- Mỗi nhóm có retry riêng, lỗi chỉ log console
|
||||
- **Fetch & Cache (fetchServerNotes + useEffect):**
|
||||
- Khi load trang: đọc `localStorage` key `my_journey_notes_{tourId}` làm cache ban đầu
|
||||
- Gọi API GET `/api/v1/tours/${tourId}/notes` để lấy dữ liệu server
|
||||
- Merge: giữ `unsyncedNotes` (temp_, synced:false, deletedLocally) + lọc khỏi server
|
||||
- Sort theo `createdAt` giảm dần (mới nhất lên đầu)
|
||||
- Lưu lại `localStorage` sau mỗi thay đổi
|
||||
- **Tìm kiếm (filteredNotes):**
|
||||
- Lọc theo title HOẶC content (strip HTML tag)
|
||||
- Không lọc note đã `deletedLocally`
|
||||
|
||||
### ReactQuill configuration
|
||||
- Module: table, header(1,2), bold/italic/underline/strike, align, indent, bullet/check list, link/image/table/clean
|
||||
- Custom Icons: gán SVG từ `lucide-react` vào `Quill.import('ui/icons')`
|
||||
- Table handler: dùng `prompt` nhập số hàng/cột → gọi `quill.getModule('table').insertTable()`
|
||||
|
||||
### Theme/Class cần lưu ý
|
||||
- Wrapper ReactQuill: `bg-[var(--surface)] rounded-2xl border border-[var(--border)] shadow-sm min-h-[500px] flex flex-col`
|
||||
- CSS class ở ReactQuill đã fix: `.ql-container` lấy `h-full, min-h-0`; `.ql-editor` lấy `flex-1, overflow-y-auto` để nội dung dài cuộn trong khung
|
||||
- Note card: `bg-[var(--surface)] dark:bg-[var(--surface-muted)] p-5 rounded-3xl`
|
||||
- Màu chính: `text-amber-500` cho buttons, header
|
||||
|
||||
---
|
||||
|
||||
## TourDetailPage.tsx
|
||||
**Đường dẫn:** `frontend/src/pages/TourDetailPage.tsx`
|
||||
|
||||
### Mục đích
|
||||
Trang chi tiết tour, tổng hợp toàn bộ thông tin: bản đồ interactive, lộ trình, gallery ảnh, manage members, quản lý chi phí, chat, và chức năng share. Trang này rất nặng (~3400 dòng) nên cần chú ý các captured props và callback pattern.
|
||||
|
||||
### Cấu trúc chính
|
||||
- **Header:** sticky top bar có các tab: Timeline | Spot / Location | Expenses | Chat
|
||||
- **Tabs switch:** điều khiển hiển thị `ItineraryTimeline`, `ExpenseManager`, `TourChat`
|
||||
- **Map section:** leaflet map kết hợp MarkerCluster, Polyline vẽ lộ trình OSRM, Recenter button
|
||||
|
||||
### Key logic/Data flow
|
||||
- `useTourStore` là state chính: lưu `currentTour`, `legs`, `locations`, `userRole`, `mapCenter`
|
||||
- **OSRM Routes:** kết quả từ backend đa segment, `combineSegmentRoutes()` gộp thành 1 polyline
|
||||
- **Sync data:** `addLocation`, `editLocation`, `deleteLocation` gọi API và cập nhật store
|
||||
- **PDF Export:** dùng `jsPDF` + `jspdf-autotable` xuất hóa đơn/nhật ký tour
|
||||
- **ShareJourney button:** tạo public link hoặc mở share modal
|
||||
- **Socket.IO:** `io()` kết nối realtime cho chat và comment
|
||||
- **Offline-first:** nhiều actions gọi API nhưng không block UI; có try/catch và fallback
|
||||
|
||||
### Các modal/components con được gọi
|
||||
- `AddLocationModal`, `MembersTab`, `ExpenseManager`, `CommentModal`, `AddPhotoModal`, `TourChat`
|
||||
- `MapContextMenu`: menu right-click trên map để bắt đầu/kết thúc/add to leg
|
||||
- `MapRotationHandler`: xoay map theo hướng di chuyển (cumulative rotation để tránh nhảy -360→0)
|
||||
- `MapHoverTip`: tooltip xuất hiện sau 3s khi hover trên map (cho user biết tip right-click)
|
||||
|
||||
### Theme & Styling cần lưu ý
|
||||
- Map marker icon: dùng `unpkg.com/leaflet@1.9.4` (fixed URL) do Vite bundler không nhận asset mặc định
|
||||
- Màu primary tour: `text-blue-600`, accent: `text-amber-500`
|
||||
- Sticky header: `bg-[var(--surface)]/80 backdrop-blur-md`
|
||||
|
||||
---
|
||||
|
||||
## ItineraryTimeline.tsx
|
||||
**Đường dẫn:** `frontend/src/components/ItineraryTimeline.tsx`
|
||||
|
||||
### Mục đích
|
||||
Component hiển thị lộ trình đa chặng (multi-leg itinerary) dạng timeline accordion. Mỗi `leg` là 1 section có thể expand/collapse độc lập (exclusive mode).
|
||||
|
||||
### Cấu trúc chính
|
||||
- **props:**
|
||||
- `onAddLocation(legId, isStart?, isEnd?)`: callback mở modal thêm địa điểm
|
||||
- `onEditLocation(location)`: callback mở modal sửa địa điểm
|
||||
- `onQuickNote(name)`: callback mở modal ghi chú nhanh
|
||||
- `onNavigate(location)`: callback điều hướng trên map
|
||||
- `onSuccess()`: callback sau khi xóa/edit thành công
|
||||
- `isPublicView`: boolean, hide edit/delete buttons khi true
|
||||
- **State:**
|
||||
- `expandedStageId`: id của leg đang mở (chỉ 1 mở tại 1 thời điểm) → mặc định leg đầu tiên
|
||||
- `isEditModalOpen`, `editingLegData`: modal sửa chặng
|
||||
- `isCommentModalOpen`, `commentLocationId`, `commentLocationName`: modal comment
|
||||
|
||||
### Logic đặc biệt
|
||||
- **Exclusive expansion:** `toggleStageExpanded` đảm bảo chỉ 1 leg mở tại 1 thời điểm (click lại để đóng)
|
||||
- **Distance & Travel time:**
|
||||
- Tính haversine giữa 2 điểm liên tiếp (`allLocations` flat)
|
||||
- Convert giữa các chặng: lấy `prevLegLastLoc` → tính khoảng cách → hiển thị "Tiếp nối từ ..."
|
||||
- `leg.totalDistance` + `formatTravelTime()` để đổi sang "X giờ Y phút"
|
||||
- **Dwell time:** thời gian dừng tại mỗi điểm = `plannedEnd - plannedStart`
|
||||
- **Marker milestones:**
|
||||
- Start point: `plannedStart` timestamp = 0
|
||||
- End point: `plannedEnd` timestamp = 0
|
||||
- `TimeVariance`: so sánh actual vs planned, hiển thị "Trễ X phút" / "Đúng giờ" / "Sớm X phút"
|
||||
- **Accordion CSS:** dùng `grid-template-rows: 0fr → 1fr` transition (`folder-child-content-box`) để animate mở/đóng mượt
|
||||
- **Comment count:** `handleCommentIncrement/Decrement` trực tiếp mutate `useTourStore` để cập nhật UI gần như tức thì mà không cần re-fetch API
|
||||
|
||||
### Giao tiếp với cha (TourDetailPage)
|
||||
- `onAddLocation?.(leg.id, isFirst, isLast)` ↔ mở `AddLocationModal`
|
||||
- `onEditLocation(loc)` ↔ pre-fill modal edit
|
||||
- `onNavigate(loc)` ↔ mở notification/guide "Đang điều hướng" rồi gọi map navigate
|
||||
- `onSuccess?.()` gọi sau delete/edit thành công để refresh từ cha
|
||||
|
||||
---
|
||||
|
||||
## Lưu ý chung
|
||||
- Cả 3 file đều dùng Tailwind CSS + theme variables từ `index.css`
|
||||
- Offline/sync-first: ghi chú lưu localStorage trước, API sau
|
||||
- Khi gọi API từ các hook, header gắn `Authorization: Bearer ${localStorage.getItem('token')}`
|
||||
- `react-quill-new` dùng thay cho `react-quill` do tương thích React 18+
|
||||
@@ -0,0 +1,133 @@
|
||||
# Travel Planning - Multi-User Travel Itinerary Management System
|
||||
|
||||
A comprehensive travel planning application that enables collaborative itinerary planning, expense tracking, and photo sharing for travel groups.
|
||||
|
||||
## Features
|
||||
|
||||
- **Tour Management**: Create and manage travel tours with multiple legs (stages) and locations
|
||||
- **Multi-user Collaboration**: Invite friends to join tours with role-based access control
|
||||
- **Interactive Maps**: Visual tour planning with Leaflet.js integration
|
||||
- **Expense Tracking**: Automatic cost splitting with configurable adult/child discounts
|
||||
- **Photo Sharing**: Secure photo album with privacy controls (PUBLIC, TOUR_ONLY, PRIVATE)
|
||||
- **Real-time Navigation**: Live GPS tracking and route optimization using OSRM API
|
||||
|
||||
## Tech Stack
|
||||
|
||||
| Layer | Technology | Purpose |
|
||||
|-------|-----------|---------|
|
||||
| **Frontend** | React + Vite | Single Page Application with fast HMR |
|
||||
| | TailwindCSS | Utility-first CSS framework |
|
||||
| | Zustand | Lightweight state management |
|
||||
| | Leaflet.js | Interactive map rendering |
|
||||
| **Backend** | NestJS | Scalable Node.js framework |
|
||||
| | JWT | Authentication & authorization |
|
||||
| | Prisma ORM | Type-safe database access |
|
||||
| | PostgreSQL + PostGIS | Spatial database for geographic data |
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
travelplanning/
|
||||
├── backend/ # Backend API server
|
||||
│ ├── src/
|
||||
│ │ ├── auth/ # Authentication modules
|
||||
│ │ ├── main.ts # NestJS entry point
|
||||
│ │ └── v1/ # API v1 endpoints
|
||||
│ └── prisma/
|
||||
│ └── schema.prisma # Database schema
|
||||
├── frontend/ # React frontend
|
||||
│ └── src/
|
||||
│ ├── pages/ # Main pages
|
||||
│ ├── components/ # Reusable UI components
|
||||
│ ├── hooks/ # Custom React hooks
|
||||
│ └── store/ # Zustand stores
|
||||
├── docs/ # Documentation
|
||||
│ ├── ARCHITECTURE.md # System architecture
|
||||
│ └── UITourDesign.md # UI design specifications
|
||||
└── .env # Environment variables
|
||||
```
|
||||
|
||||
## Database Schema
|
||||
|
||||
The application uses PostgreSQL with Prisma ORM. Key models include:
|
||||
|
||||
- **User**: Registered users with admin capability
|
||||
- **Tour**: Travel itineraries with date ranges and participant management
|
||||
- **Leg**: Stages within a tour (ordered sequence)
|
||||
- **Location**: Geographic points with timing and status tracking
|
||||
- **Expense**: Cost tracking linked to legs/locations
|
||||
- **Photo**: Media storage with privacy controls
|
||||
- **TourParticipant**: Many-to-many relationship with role-based permissions
|
||||
|
||||
### User Roles
|
||||
|
||||
| Role | Permissions |
|
||||
|------|-------------|
|
||||
| OWNER | Full access to all features |
|
||||
| MANAGER | Can edit tour content and manage members |
|
||||
| MEMBER | View tour and participate, access financial data |
|
||||
| MEMBER_NO_FINANCE | View tour only, no financial access |
|
||||
| VIEWER_ONLY | Read-only access to itinerary and photos |
|
||||
|
||||
## API Endpoints
|
||||
|
||||
### Tours
|
||||
- `GET /api/v1/tours` - Get all public tours
|
||||
- `POST /api/v1/tours` - Create new tour
|
||||
- `GET /api/v1/tours/:id` - Get tour details
|
||||
- `PUT /api/v1/tours/:id` - Update tour
|
||||
|
||||
### Authentication
|
||||
- `POST /api/v1/auth/login` - User login
|
||||
- `POST /api/v1/auth/register` - User registration
|
||||
- `POST /api/v1/auth/promote-admin` - Admin role promotion (with secret key)
|
||||
|
||||
### Photos
|
||||
- `GET /api/v1/public-photos` - Get public photos
|
||||
- `POST /api/v1/tours/:id/photos` - Upload tour photos
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Prerequisites
|
||||
- Node.js 18+
|
||||
- PostgreSQL with PostGIS extension
|
||||
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
npm install
|
||||
cd frontend && npm install
|
||||
cd ../backend && npm install
|
||||
|
||||
# Set up database
|
||||
npx prisma migrate dev
|
||||
npx prisma generate
|
||||
|
||||
# Start development servers
|
||||
npm run dev # Frontend (Vite)
|
||||
npm run start:backend # Backend (NestJS)
|
||||
```
|
||||
|
||||
### Environment Variables
|
||||
|
||||
Create `.env` in the root directory:
|
||||
|
||||
```env
|
||||
DATABASE_URL="postgresql://user:password@localhost:5432/traveldb"
|
||||
JWT_SECRET="your-secret-key"
|
||||
```
|
||||
|
||||
## Mobile Optimization
|
||||
|
||||
The application is built mobile-first with support for:
|
||||
- Safe area insets for notch displays (iOS/Android)
|
||||
- Touch gestures for map interactions
|
||||
- Responsive layouts for all screen sizes
|
||||
- Device orientation and compass integration
|
||||
|
||||
## Documentation
|
||||
|
||||
See the `docs/` directory for detailed documentation:
|
||||
- [ARCHITECTURE.md](docs/ARCHITECTURE.md) - System architecture and data models
|
||||
- [UITourDesign.md](docs/UITourDesign.md) - UI design specifications
|
||||
-116
@@ -1,116 +0,0 @@
|
||||
# To AI Agent: Implement Unified Dual-Theme System (Light & Dark) for Yotrip App
|
||||
|
||||
## 1. Context & Design System Overview
|
||||
We are building a robust, high-contrast, yet eye-friendly dual-theme system (Light and Dark modes) for our mobile application (`yotrip.labz.io.vn`).
|
||||
- **Dark Theme Constraint:** Must use the pre-configured smoky grape base (`Vintage Grape` & `Dusty Grape`) with vivid lime/aquatic accents. No pitch-black.
|
||||
- **Light Theme Constraint:** Must use the soft parchment base (`Parchment`) to eliminate screen glare, using deep academic blue (`Yale Blue`) for high-contrast readability. No pure blazing white backgrounds.
|
||||
|
||||
---
|
||||
|
||||
## 2. Comprehensive Color Token Mapping
|
||||
|
||||
### A. LIGHT THEME PALETTE ("Classic Heritage & Soft Sand")
|
||||
- **`Parchment` (`#f6f0ed`):** Map to **Global Page Backgrounds**. A warm, ancient-manuscript off-white that eliminates mobile screen glare.
|
||||
- **`Yale Blue` (`#28536b`):** Map to **Primary Text, Main Titles, and Primary Action Buttons**. Provides dependable trust and sharp contrast.
|
||||
- **`Steel Blue` (`#7ea8be`):** Map to **Active Navigation Tabs, Active Icons, and Secondary Actions**.
|
||||
- **`Khaki Beige` (`#bbb193`):** Map to **Borders, Dividers, and Deactivated/Muted States**.
|
||||
- **`Rosy Taupe` (`#c2948a`):** Map to **Special Highlight Badges, Notification Banners, or Warm Accent Elements**.
|
||||
|
||||
### B. DARK THEME PALETTE ("Vintage Velvet & Aquatic Zest")
|
||||
- **`Vintage Grape` (`#513b56`):** Map to **Global Page Backgrounds**.
|
||||
- **`Dusty Grape` (`#525174`):** Map to **Component Surfaces (Cards, Chat Bubbles, Accordion Rows)**.
|
||||
- **`Lime Cream` (`#bce784`):** Map to **Brand Text Highlights, Active Icons**.
|
||||
- **`Bondi Blue` (`#348aa7`):** Map to **Primary Action Buttons, Links**.
|
||||
- **`Emerald` (`#5dd39e`):** Map to **Success Utilities & "Tối ưu" badges**.
|
||||
|
||||
---
|
||||
|
||||
## 3. Technical Global Configuration
|
||||
|
||||
### Option A: Clean CSS Variables (`global.css`)
|
||||
Replace or update the root variable tokens inside your main stylesheet:
|
||||
|
||||
```css
|
||||
/* --- THEME SÁNG (Mềm mại, Tương phản cao, Không chói) --- */
|
||||
:root {
|
||||
--background: #f6f0ed; /* Parchment */
|
||||
--surface: #ffffff; /* Pure White for crisp card layers */
|
||||
--surface-muted: #bbb193; /* Khaki Beige */
|
||||
|
||||
--border: #bbb193; /* Khaki Beige */
|
||||
|
||||
--text-primary: #28536b; /* Yale Blue (High contrast text) */
|
||||
--text-secondary: #7ea8be; /* Steel Blue */
|
||||
--text-accent: #c2948a; /* Rosy Taupe */
|
||||
|
||||
--primary: #28536b; /* Yale Blue for main buttons */
|
||||
--primary-hover: #1f4154;
|
||||
--secondary-active: #7ea8be; /* Steel Blue */
|
||||
}
|
||||
|
||||
/* --- THEME TỐI (Dịu mắt, Sang trọng, Không đen kịt) --- */
|
||||
:root.dark {
|
||||
--background: #513b56; /* Vintage Grape */
|
||||
--surface: #525174; /* Dusty Grape */
|
||||
--surface-muted: #626186;
|
||||
|
||||
--border: #626186;
|
||||
|
||||
--text-primary: #f8fafc; /* Soft White */
|
||||
--text-secondary: #94a3b8; /* Muted Slate */
|
||||
--text-brand: #bce784; /* Lime Cream */
|
||||
|
||||
--primary: #348aa7; /* Bondi Blue */
|
||||
--primary-hover: #296f86;
|
||||
--success-accent: #5dd39e; /* Emerald */
|
||||
}
|
||||
|
||||
### Option B: Tailwind Extension Configuration (tailwind.config.js)
|
||||
Expose these custom design tokens cleanly into the utility library framework:
|
||||
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
yotripLight: {
|
||||
bg: '#f6f0ed', // Parchment
|
||||
text: '#28536b', // Yale Blue
|
||||
steel: '#7ea8be', // Steel Blue
|
||||
khaki: '#bbb193', // Khaki Beige
|
||||
rosy: '#c2948a', // Rosy Taupe
|
||||
},
|
||||
yotripDark: {
|
||||
bg: '#513b56', // Vintage Grape
|
||||
surface: '#525174', // Dusty Grape
|
||||
lime: '#bce784', // Lime Cream
|
||||
bondi: '#348aa7', // Bondi Blue
|
||||
emerald: '#5dd39e', // Emerald
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
## 4. UI Component Application Reference
|
||||
Apply these unified color classes to ensure the interface flips seamlessly:
|
||||
|
||||
Chat Wrapper & Itinerary Timelines: - Light Mode: Background is yotripLight-bg, General Text is yotripLight-text.
|
||||
|
||||
Dark Mode: Background is yotripDark-bg, General Text is #f8fafc.
|
||||
|
||||
Navigation Tabs Menu:
|
||||
|
||||
Light Mode: Inactive text is yotripLight-steel. Active tab gets a yotripLight-text highlight indicator.
|
||||
|
||||
Dark Mode: Inactive text is yotripDark-surface. Active tab gets a yotripDark-lime highlight indicator.
|
||||
|
||||
Main Action Call-To-Actions (e.g., "Thêm địa điểm"):
|
||||
|
||||
Light Mode: Background is yotripLight-text (Yale Blue) with clean white text.
|
||||
|
||||
Dark Mode: Background is yotripDark-bondi (Bondi Blue) with clean white text.
|
||||
|
||||
## 5. Acceptance Criteria for Verification
|
||||
[ ] Ensure that toggling the .dark class on the <html> root triggers a global transition without style flashes (transition-colors duration-200).
|
||||
|
||||
[ ] Text legibility inside Light Mode satisfies standard WCAG accessibility contrast limits on mobile displays out in the sun.
|
||||
|
||||
[ ] The background of the expanded folder nodes/chat bubbles maps cleanly to their respective surface tokens across both system states.
|
||||
@@ -0,0 +1,134 @@
|
||||
# To AI Agent: Audit Location Lock Bug and Refactor GPS Tracking into a Toggle Stateful Button
|
||||
|
||||
## 1. Context & Problem Statement
|
||||
Currently, in our travel planner application map engine (on pages like `TourNavigationPage.tsx`, `LocationNavigationModal.tsx`, or map utilities), the viewport is continuously forced to lock onto the user's live GPS position. This architecture severely damages mobile UX because:
|
||||
1. It prevents users from manually dragging, panning, or scouting other areas of the map terrain.
|
||||
2. There is no control interface to temporarily mute or disable live GPS tracking.
|
||||
|
||||
**Objective:** - Run a global audit across the entire codebase to locate functions driving this forced-center trap (e.g., custom hooks, `requestGpsPosition`, native geolocation callbacks, or reactive map state updates).
|
||||
- Refactor the logic so that live tracking is bound strictly to an independent toggle state button. The map must **ONLY** lock/re-center on the user's coordinates when this tracking toggle button is actively switched **ON**.
|
||||
|
||||
---
|
||||
|
||||
## 2. Phase 1: Codebase Audit Plan (Where to Search)
|
||||
|
||||
Scan the entire project repository (specifically `/frontend/src`) using code search patterns to intercept the lock mechanism. Target the following files and keywords:
|
||||
|
||||
### Key Target Files to Inspect:
|
||||
- `frontend/src/pages/TourNavigationPage.tsx`
|
||||
- `frontend/src/components/LocationNavigationModal.tsx`
|
||||
- Any custom hooks or contexts handling geography, such as `useGeolocation.ts`, `useMap.ts`, or generic map setup wrappers.
|
||||
|
||||
### Regex & Keyword Global Search Queries:
|
||||
- Search for native background watchers: `navigator.geolocation.watchPosition` or `navigator.geolocation.getCurrentPosition`
|
||||
- Search for custom map-centering loops: `requestGpsPosition`, `followUser`, `centerToUser`
|
||||
- Search for viewport mutation commands specific to our active map engine stack:
|
||||
- **Leaflet:** `.setView(`, `.panTo(`, `center={`
|
||||
- **Mapbox GL JS:** `.flyTo(`, `.easeTo(`, `.jumpTo(`
|
||||
|
||||
---
|
||||
|
||||
## 3. Phase 2: Technical Refactoring Blueprint
|
||||
|
||||
Once the tracking logic code blocks are isolated from Phase 1, implement the structural state safety rails below:
|
||||
|
||||
### Step 1: Initialize the Tracking State Guard
|
||||
Introduce a state hook controller (`isTrackingLocation`) to manage whether the view should actively mirror device coordinates:
|
||||
|
||||
```typescript
|
||||
// Add inside the map controller/page container component
|
||||
const [isTrackingLocation, setIsTrackingLocation] = useState(false);
|
||||
const watchIdRef = useRef<number | null>(null);
|
||||
|
||||
### Step 2: Encapsulate the Geolocation Watcher Handler
|
||||
Wrap your positioning tracking engine loop inside a conditional check governed directly by the state guard. Ensure that if the tracking state is disabled, the background watcher cleanly unmounts:
|
||||
|
||||
useEffect(() => {
|
||||
if (isTrackingLocation) {
|
||||
if (navigator.geolocation) {
|
||||
console.log("GPS Location Tracking engaged. Syncing viewport to center...");
|
||||
|
||||
watchIdRef.current = navigator.geolocation.watchPosition(
|
||||
(position) => {
|
||||
const { latitude, longitude, heading } = position.coords;
|
||||
|
||||
if (mapRef.current) {
|
||||
// ✅ CORRECTION: Viewport ONLY repositions center when tracking button is active
|
||||
mapRef.current.easeTo({
|
||||
center: [longitude, latitude],
|
||||
zoom: 16, // Lock to comfortable navigation zoom level
|
||||
duration: 600
|
||||
});
|
||||
}
|
||||
},
|
||||
(error) => console.error("GPS stream tracking lost:", error),
|
||||
{ enableHighAccuracy: true }
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// Clean up tracking process instantly when toggled OFF
|
||||
if (watchIdRef.current !== null) {
|
||||
navigator.geolocation.clearWatch(watchIdRef.current);
|
||||
watchIdRef.current = null;
|
||||
console.log("GPS Location Tracking disabled. Map control released to user.");
|
||||
}
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (watchIdRef.current !== null) navigator.geolocation.clearWatch(watchIdRef.current);
|
||||
};
|
||||
}, [isTrackingLocation]);
|
||||
|
||||
### Step 3: Implement Gesture Detection (UX Safety Rail)
|
||||
If the user manually drags the screen while tracking is active, the tracking state must automatically toggle OFF so the viewport doesn't fight against the user's finger movements:
|
||||
|
||||
useEffect(() => {
|
||||
if (!mapRef.current) return;
|
||||
const map = mapRef.current;
|
||||
|
||||
const breakTrackingOnGesture = () => {
|
||||
if (isTrackingLocation) {
|
||||
console.log("User touch map interaction detected. Disengaging auto-center lock.");
|
||||
setIsTrackingLocation(false); // Automatically drop tracking flag on map pan/zoom
|
||||
}
|
||||
};
|
||||
|
||||
map.on('dragstart', breakTrackingOnGesture);
|
||||
map.on('zoomstart', breakTrackingOnGesture);
|
||||
map.on('movestart', breakTrackingOnGesture);
|
||||
|
||||
return () => {
|
||||
map.off('dragstart', breakTrackingOnGesture);
|
||||
map.off('zoomstart', breakTrackingOnGesture);
|
||||
map.off('movestart', breakTrackingOnGesture);
|
||||
};
|
||||
}, [isTrackingLocation]);
|
||||
|
||||
### Step 4: Render the UI Toggle Button UI Component
|
||||
Deploy a new independent floating button on top of the map canvas workspace (placed at bottom-24 right-6, just right above your custom Compass button layout):
|
||||
|
||||
{/* FLOATING LIVE GPS TRACKING CENTER LOCK BUTTON */}
|
||||
<button
|
||||
onClick={() => setIsTrackingLocation(!isTrackingLocation)}
|
||||
className={`absolute bottom-24 right-6 z-40 w-14 h-14 rounded-full border-2 flex items-center justify-center shadow-2xl transition-all active:scale-95 ${
|
||||
isTrackingLocation
|
||||
? 'bg-green-600 border-green-400 text-white animate-pulse'
|
||||
: 'bg-white dark:bg-slate-900 border-slate-200 dark:border-slate-700 text-slate-600 dark:text-green-500'
|
||||
}`}
|
||||
title={isTrackingLocation ? "Tắt tự động định tâm vị trí" : "Bật tự động định tâm theo vị trí của bạn"}
|
||||
>
|
||||
{/* Replace Crosshair icon element with your active layout icon package asset */}
|
||||
<svg xmlns="[http://www.w3.org/2000/svg](http://www.w3.org/2000/svg)" className="w-7 h-7" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
|
||||
<path strokeLinecap="round" strokeLinejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
## 4. Verification & Quality Acceptance Criteria
|
||||
|
||||
[ ] Code Erasure Verification: Confirm that old continuous loops or uncontrolled recursive .setView/.easeTo methods triggered instantly on map load are fully removed or properly contained inside the state block.
|
||||
|
||||
[ ] Default State Freedom: Upon opening the map page path, tracking must default to OFF. Users must be able to drag the map anywhere in the world without the screen snapped or yanked back to their physical house position.
|
||||
|
||||
[ ] Toggle Activation Centering: Pressing the new GPS tracking button must instantly engage the animation, center the map view directly on top of the user blue dot icon, and follow them smoothly if they move.
|
||||
|
||||
[ ] Manual Override Interception: Turn tracking ON. Drag the map manually with a finger gesture. Verify that the tracking button instantly changes style states back to deactivated and tracking shuts down cleanly.
|
||||
Vendored
+66
-17
@@ -824,27 +824,13 @@ let TourController = class TourController {
|
||||
}
|
||||
}
|
||||
});
|
||||
const noteContent = `<h2>${filteredTitle} - Initial Planning</h2>
|
||||
<p><strong>Start Date:</strong> ${startDate ? new Date(startDate).toLocaleDateString() : 'TBD'}</p>
|
||||
<p><strong>End Date:</strong> ${endDate ? new Date(endDate).toLocaleDateString() : 'TBD'}</p>
|
||||
<p><strong>Adult Participants:</strong> ${adultCount || 1}</p>
|
||||
<p><strong>Child Participants:</strong> ${childCount || 0}</p>
|
||||
<h3>Key Items to Plan:</h3>
|
||||
<ul>
|
||||
<li>Accommodations</li>
|
||||
<li>Transportation</li>
|
||||
<li>Activities & Attractions</li>
|
||||
<li>Budget & Expenses</li>
|
||||
<li>Important Contact Numbers</li>
|
||||
<li>Special Requirements & Notes</li>
|
||||
</ul>
|
||||
<p><em>Add your planning notes here...</em></p>`;
|
||||
const noteContent = `<h1>${filteredTitle}</h1><h2>Ghi chú chung</h2><p><em>Nội dung ghi chú tổng quan của chuyến đi...</em></p>`;
|
||||
try {
|
||||
await this.prisma.tourNote.create({
|
||||
data: {
|
||||
tourId: tour.id,
|
||||
userId: req.user.id,
|
||||
title: `[${filteredTitle}] - Initial Planning`,
|
||||
title: `Ghi chú: ${filteredTitle}`,
|
||||
content: noteContent
|
||||
}
|
||||
});
|
||||
@@ -2260,6 +2246,19 @@ let PhotoController = class PhotoController {
|
||||
console.log(`[EXIF GPS] Sử dụng tọa độ dự phòng từ Frontend: lat=${lat}, lng=${lng}`);
|
||||
}
|
||||
}
|
||||
let tags = [];
|
||||
if (req.body.tags) {
|
||||
try {
|
||||
tags = JSON.parse(req.body.tags);
|
||||
if (!Array.isArray(tags)) {
|
||||
tags = [];
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
const errorMsg = e instanceof Error ? e.message : 'Unknown error';
|
||||
console.warn('[TAGS] Failed to parse tags from request:', errorMsg);
|
||||
}
|
||||
}
|
||||
if (lat === undefined || lng === undefined) {
|
||||
lat = 10.7769;
|
||||
lng = 106.7009;
|
||||
@@ -2293,7 +2292,8 @@ let PhotoController = class PhotoController {
|
||||
privacy: 'PUBLIC',
|
||||
metadata: {
|
||||
lat: lat,
|
||||
lng: lng
|
||||
lng: lng,
|
||||
tags: tags
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -4210,6 +4210,45 @@ let TourNoteController = class TourNoteController {
|
||||
});
|
||||
return { success: true };
|
||||
}
|
||||
async insertSection(tourId, body, req) {
|
||||
const tour = await this.prisma.tour.findUnique({ where: { id: tourId } });
|
||||
if (!tour)
|
||||
throw new common_1.NotFoundException('Không tìm thấy tour');
|
||||
const masterNote = await this.prisma.tourNote.findFirst({
|
||||
where: { tourId, title: `Ghi chú: ${tour.title}`, isDeleted: false, userId: req.user.id }
|
||||
});
|
||||
let note = masterNote;
|
||||
if (!note) {
|
||||
note = await this.prisma.tourNote.create({
|
||||
data: {
|
||||
tourId,
|
||||
userId: req.user.id,
|
||||
title: `Ghi chú: ${tour.title}`,
|
||||
content: `# ${tour.title}\n\n## Ghi chú chung\n\n*(Nội dung ghi chú tổng quan của chuyến đi...)*\n\n`
|
||||
}
|
||||
});
|
||||
}
|
||||
const leg = await this.prisma.leg.findUnique({ where: { id: body.legId } });
|
||||
const stageHeader = leg ? `<h2>Ghi chú: ${leg.note || `Chặng ${leg.sequence}`}</h2>` : '<h2>Ghi chú:</h2>';
|
||||
let content = note.content;
|
||||
const stageIndex = content.indexOf(stageHeader);
|
||||
if (stageIndex === -1) {
|
||||
content += `<br><br>${stageHeader}${body.noteSnippet}`;
|
||||
}
|
||||
else {
|
||||
const nextHeaderIndex = content.indexOf('<h2>', stageIndex + stageHeader.length);
|
||||
if (nextHeaderIndex !== -1) {
|
||||
content = content.slice(0, nextHeaderIndex) + body.noteSnippet + content.slice(nextHeaderIndex);
|
||||
}
|
||||
else {
|
||||
content += body.noteSnippet;
|
||||
}
|
||||
}
|
||||
return this.prisma.tourNote.update({
|
||||
where: { id: note.id },
|
||||
data: { content }
|
||||
});
|
||||
}
|
||||
};
|
||||
__decorate([
|
||||
(0, exports.Roles)(client_1.ParticipantRole.OWNER, client_1.ParticipantRole.MANAGER, client_1.ParticipantRole.MEMBER, client_1.ParticipantRole.MEMBER_NO_FINANCE),
|
||||
@@ -4250,6 +4289,16 @@ __decorate([
|
||||
__metadata("design:paramtypes", [String, String, Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], TourNoteController.prototype, "deleteNote", null);
|
||||
__decorate([
|
||||
(0, exports.Roles)(client_1.ParticipantRole.OWNER, client_1.ParticipantRole.MANAGER, client_1.ParticipantRole.MEMBER, client_1.ParticipantRole.MEMBER_NO_FINANCE),
|
||||
(0, common_1.Post)('insert'),
|
||||
__param(0, (0, common_1.Param)('tourId')),
|
||||
__param(1, (0, common_1.Body)()),
|
||||
__param(2, (0, common_1.Req)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String, Object, Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], TourNoteController.prototype, "insertSection", null);
|
||||
TourNoteController = __decorate([
|
||||
(0, common_1.Controller)('tours/:tourId/notes'),
|
||||
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, TourRoleGuard),
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAC7B,uCAAyB;AACzB,+CAAiC;AACjC,2CAA6D;AAE7D,4BAA0B;AAC1B,2CAA6B;AAC7B,+BAAiC;AACjC,kDAA0B;AAC1B,kDAA0B;AAC1B,gEAAuC;AACvC,uCAA2C;AAC3C,2CAA6S;AAE7S,+DAA4D;AAE5D,mDAAmI;AACnI,yCAA2C;AAC3C,6DAAyD;AACzD,2CAAiD;AACjD,+CAAiC;AACjC,oDAAgD;AAChD,uDAAyC;AACzC,qCAAoD;AACpD,0DAAqD;AACrD,0DAAgE;AAChE,sDAAkD;AAClD,uCAAyC;AACzC,2CAA4E;AAC5E,yDAAmE;AAEnE,qEAAqD;AAErD,oFAA+E;AAG/E,MAAM,IAAI,GAAG,IAAA,gBAAS,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClC,MAAM,MAAM,GAAG,IAAA,gBAAS,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAGtC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,CAAC;AAGjD,IAAM,cAAc,GAApB,MAAM,cAAc;IAGzB,gBAAgB,CAAC,MAAc;QAC7B,OAAO,CAAC,GAAG,CAAC,0BAA0B,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC;IAGD,cAAc,CAAC,MAAc,EAAE,MAAc;QAC3C,MAAM,CAAC,IAAI,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,EAAE,sBAAsB,MAAM,EAAE,CAAC,CAAC;IACtE,CAAC;IAGD,eAAe,CAAC,MAAc,EAAE,OAAe;QAC7C,MAAM,CAAC,IAAI,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,EAAE,uBAAuB,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,gBAAgB,CAAC,MAAc,EAAE,IAAS;QAExC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED,qBAAqB,CAAC,OAAe,EAAE,IAAS;QAE9C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;IAGD,cAAc,CAAC,MAAc,EAAE,MAAc;QAC3C,MAAM,CAAC,IAAI,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,EAAE,2BAA2B,MAAM,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,gBAAgB,CAAC,UAAkB,EAAE,IAAS;QAC5C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;IAED,wBAAwB,CAAC,WAAmB,EAAE,IAAS;QACrD,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;IACzE,CAAC;IAED,yBAAyB,CAAC,MAAc,EAAE,IAAS;QACjD,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;CACF,CAAA;AA9CY,wCAAc;AACN;IAAlB,IAAA,4BAAe,GAAE;8BAAS,kBAAM;8CAAC;AAOlC;IADC,IAAA,6BAAgB,EAAC,UAAU,CAAC;;qCACN,kBAAM;;oDAG5B;AAGD;IADC,IAAA,6BAAgB,EAAC,WAAW,CAAC;;qCACN,kBAAM;;qDAG7B;AAaD;IADC,IAAA,6BAAgB,EAAC,UAAU,CAAC;;qCACN,kBAAM;;oDAG5B;yBAjCU,cAAc;IAD1B,IAAA,6BAAgB,EAAC,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC;GAC/B,cAAc,CA8C1B;AAGD,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE,MAAM;IACf,gBAAgB,EAAE,OAAO;IACzB,SAAS,EAAE,MAAM;CAClB,CAAC;AAEF,KAAK,UAAU,SAAS;IAGtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAyB,SAAS,CAAC,CAAC;IACxE,GAAG,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IAE9B,GAAG,CAAC,UAAU,EAAE,CAAC;IAGjB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAChC,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACjD,CAAC;IAGD,GAAG,CAAC,eAAe,CAAC,WAAW,EAAE;QAC/B,MAAM,EAAE,WAAW;KACpB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,8BAAa,CAAC,CAAC;IACtC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAEzB,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;AAChE,CAAC;AAGY,QAAA,SAAS,GAAG,OAAO,CAAC;AAC1B,MAAM,KAAK,GAAG,CAAC,GAAG,KAAwB,EAAE,EAAE,CAAC,IAAA,oBAAW,EAAC,iBAAS,EAAE,KAAK,CAAC,CAAC;AAAvE,QAAA,KAAK,SAAkE;AAK7E,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YACU,SAAoB,EACpB,MAAqB,EACE,YAAmB;QAF1C,cAAS,GAAT,SAAS,CAAW;QACpB,WAAM,GAAN,MAAM,CAAe;QACE,iBAAY,GAAZ,YAAY,CAAO;IACjD,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,OAAyB;QACzC,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAoB,iBAAS,EAAE;YACnF,OAAO,CAAC,UAAU,EAAE;YACpB,OAAO,CAAC,QAAQ,EAAE;SACnB,CAAC,CAAC;QAGH,MAAM,YAAY,GAAG,CAAC,wBAAe,CAAC,KAAK,EAAE,wBAAe,CAAC,OAAO,CAAC,CAAC;QACtE,MAAM,YAAY,GAAG,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC;QAE9F,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACpD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAE1B,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;QACnC,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;QAG1F,IAAI,CAAC,MAAM,IAAI,UAAU,EAAE,CAAC;YAC1B,MAAM,WAAW,GAAG,eAAe,UAAU,EAAE,CAAC;YAChD,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAS,WAAW,CAAC,CAAC;YAExE,IAAI,cAAc,EAAE,CAAC;gBACnB,IAAI,CAAC;oBACH,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC;oBAClD,MAAM,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;gBACnC,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC;gBAC1C,CAAC;YACH,CAAC;iBAAM,CAAC;gBAER,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;gBACtG,IAAI,MAAM,EAAE,CAAC;oBACX,MAAM,GAAG,UAAU,CAAC;gBACtB,CAAC;qBAAM,CAAC;oBAEN,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;oBACtG,IAAI,GAAG,EAAE,CAAC;wBACR,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;oBACtB,CAAC;yBAAM,CAAC;wBAEN,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;4BAChD,KAAK,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE;4BACzB,OAAO,EAAE,EAAE,GAAG,EAALine truncated
|
||||
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAC7B,uCAAyB;AACzB,+CAAiC;AACjC,2CAA6D;AAE7D,4BAA0B;AAC1B,2CAA6B;AAC7B,+BAAiC;AACjC,kDAA0B;AAC1B,kDAA0B;AAC1B,gEAAuC;AACvC,uCAA2C;AAC3C,2CAA6S;AAE7S,+DAA4D;AAE5D,mDAAmI;AACnI,yCAA2C;AAC3C,6DAAyD;AACzD,2CAAiD;AACjD,+CAAiC;AACjC,oDAAgD;AAChD,uDAAyC;AACzC,qCAAoD;AACpD,0DAAqD;AACrD,0DAAgE;AAChE,sDAAkD;AAClD,uCAAyC;AACzC,2CAA4E;AAC5E,yDAAmE;AAEnE,qEAAqD;AAErD,oFAA+E;AAG/E,MAAM,IAAI,GAAG,IAAA,gBAAS,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClC,MAAM,MAAM,GAAG,IAAA,gBAAS,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAGtC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,CAAC;AAGjD,IAAM,cAAc,GAApB,MAAM,cAAc;IAGzB,gBAAgB,CAAC,MAAc;QAC7B,OAAO,CAAC,GAAG,CAAC,0BAA0B,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC;IAGD,cAAc,CAAC,MAAc,EAAE,MAAc;QAC3C,MAAM,CAAC,IAAI,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,EAAE,sBAAsB,MAAM,EAAE,CAAC,CAAC;IACtE,CAAC;IAGD,eAAe,CAAC,MAAc,EAAE,OAAe;QAC7C,MAAM,CAAC,IAAI,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,EAAE,uBAAuB,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,gBAAgB,CAAC,MAAc,EAAE,IAAS;QAExC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED,qBAAqB,CAAC,OAAe,EAAE,IAAS;QAE9C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;IAGD,cAAc,CAAC,MAAc,EAAE,MAAc;QAC3C,MAAM,CAAC,IAAI,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,EAAE,2BAA2B,MAAM,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,gBAAgB,CAAC,UAAkB,EAAE,IAAS;QAC5C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;IAED,wBAAwB,CAAC,WAAmB,EAAE,IAAS;QACrD,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;IACzE,CAAC;IAED,yBAAyB,CAAC,MAAc,EAAE,IAAS;QACjD,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;CACF,CAAA;AA9CY,wCAAc;AACN;IAAlB,IAAA,4BAAe,GAAE;8BAAS,kBAAM;8CAAC;AAOlC;IADC,IAAA,6BAAgB,EAAC,UAAU,CAAC;;qCACN,kBAAM;;oDAG5B;AAGD;IADC,IAAA,6BAAgB,EAAC,WAAW,CAAC;;qCACN,kBAAM;;qDAG7B;AAaD;IADC,IAAA,6BAAgB,EAAC,UAAU,CAAC;;qCACN,kBAAM;;oDAG5B;yBAjCU,cAAc;IAD1B,IAAA,6BAAgB,EAAC,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC;GAC/B,cAAc,CA8C1B;AAGD,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE,MAAM;IACf,gBAAgB,EAAE,OAAO;IACzB,SAAS,EAAE,MAAM;CAClB,CAAC;AAEF,KAAK,UAAU,SAAS;IAGtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAyB,SAAS,CAAC,CAAC;IACxE,GAAG,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IAE9B,GAAG,CAAC,UAAU,EAAE,CAAC;IAGjB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAChC,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACjD,CAAC;IAGD,GAAG,CAAC,eAAe,CAAC,WAAW,EAAE;QAC/B,MAAM,EAAE,WAAW;KACpB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,8BAAa,CAAC,CAAC;IACtC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAEzB,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;AAChE,CAAC;AAGY,QAAA,SAAS,GAAG,OAAO,CAAC;AAC1B,MAAM,KAAK,GAAG,CAAC,GAAG,KAAwB,EAAE,EAAE,CAAC,IAAA,oBAAW,EAAC,iBAAS,EAAE,KAAK,CAAC,CAAC;AAAvE,QAAA,KAAK,SAAkE;AAK7E,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YACU,SAAoB,EACpB,MAAqB,EACE,YAAmB;QAF1C,cAAS,GAAT,SAAS,CAAW;QACpB,WAAM,GAAN,MAAM,CAAe;QACE,iBAAY,GAAZ,YAAY,CAAO;IACjD,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,OAAyB;QACzC,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAoB,iBAAS,EAAE;YACnF,OAAO,CAAC,UAAU,EAAE;YACpB,OAAO,CAAC,QAAQ,EAAE;SACnB,CAAC,CAAC;QAGH,MAAM,YAAY,GAAG,CAAC,wBAAe,CAAC,KAAK,EAAE,wBAAe,CAAC,OAAO,CAAC,CAAC;QACtE,MAAM,YAAY,GAAG,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC;QAE9F,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACpD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAE1B,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;QACnC,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;QAG1F,IAAI,CAAC,MAAM,IAAI,UAAU,EAAE,CAAC;YAC1B,MAAM,WAAW,GAAG,eAAe,UAAU,EAAE,CAAC;YAChD,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAS,WAAW,CAAC,CAAC;YAExE,IAAI,cAAc,EAAE,CAAC;gBACnB,IAAI,CAAC;oBACH,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC;oBAClD,MAAM,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;gBACnC,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC;gBAC1C,CAAC;YACH,CAAC;iBAAM,CAAC;gBAER,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;gBACtG,IAAI,MAAM,EAAE,CAAC;oBACX,MAAM,GAAG,UAAU,CAAC;gBACtB,CAAC;qBAAM,CAAC;oBAEN,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;oBACtG,IAAI,GAAG,EAAE,CAAC;wBACR,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;oBACtB,CAAC;yBAAM,CAAC;wBAEN,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;4BAChD,KAAK,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE;4BACzB,OAAO,EAAE,EAAE,GAAG,EAALine truncated
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 844 KiB |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 2.4 MiB |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 408 KiB |
@@ -0,0 +1 @@
|
||||
data:application/octet-stream;base64,AAEAAAASAQAABAAgR0RFRrRCsIIAAh3kAAACYkdQT1P5bkuGAAIgSAAAZS5HU1VC64LkWQAChXgAABWQT1MvMpiusakAAAGoAAAAYGNtYXABd1geAAAbWAAAEkZjdnQgK34EtQAAMIgAAABIZnBnbV/yGqsAAC2gAAABvGdhc3AACAATAAId2AAAAAxnbHlmn5ZI2QAAOvAAAd6QaGRteICPjqUAABZAAAAFGGhlYWT819JcAAABLAAAADZoaGVhCyYK2gAAAWQAAAAkaG10eCecEV0AAAIIAAAUOGxvY2F38/pDAAAw0AAACh5tYXhwBz4DEQAAAYgAAAAgbmFtZahtokEAAhmAAAAENXBvc3T/bQBkAAIduAAAACBwcmVwKnY2MAAAL1wAAAEpAAEAAAACIxIFTnAdXw889QAZCAAAAAAAxPARLgAAAADVAVLW+jD91QmHCHMAAQAJAAIAAAAAAAAAAQAAB2z+DAAACYr6MP41CYcAAQAAAAAAAAAAAAAAAAAABQ4AAQAABQ4AjwAWAE4ABQABAAAAAAAOAAACAAIyAAYAAQADBKcCvAAFAAAFmgUzAAABHwWaBTMAAAPRAGYCAAAAAgAAAAAAAAAAAOAAAv9QACBbAAAAIAAAAABHT09HACAAAP/9BgD+AABmB5oCACAAAZ8AAAAABDoFsAAgACAAAwOMAGQAAAAAAAAAAAH+AAAB/gAAAi0AfAKRAEAExABABJcAXAXoAF8FQABHAUsAPwLPAHwC0gAoA6AAGwReADkB9AAjAxoAbgJTAH4C/f/zBJcAXwSXAKcElwBGBJcAQASXADcElwBpBJcAZASXAD0ElwBfBJcAVgJCAH0CGQA5BBIANgSUAIgEIgB4A/sALQcpAEsFYgAHBRsAggU8AFYFMwCCBIAAggRiAIIFcwBeBacAggJVAJUEeAAoBRQAggRVAIIHAgCCBaYAggWGAFYFKQCCBYYAVAUbAIIE6wBFBPMAKAVEAHQFOwAHBv8AIwUVABYE8gACBNkASQI5AHgDYAAAAjkADQN/ACwDkgABAqUANARKAEQEgQBvBCwAQgSCAEIEUwBIAt4AHQSRAEUEegBoAh8AbQIU/6EERgBvAh8AfgbtAG8EewBpBIYAQgSBAG8EhQBCAusAbwQdADgCtAAKBHoAaAQLAA0F4QAcBBIAFQQEAAMEEgBKAqQAMAIGAK0CpAAiBTAAagJCAIAEmgBjBMEAYwWKAFEESgAKAgQAgAUHAFwDvABeBkYAVgONAIkD/wBNBGkAfgZGAFYEAgCoAxsAfgRMAFkC+wA3AvsAMAKnAGUE7QCLA+sASwJpAIwCJABiAvsAhwOoAHYD/wBVBb4AZQYXAFQGdwBeA/sARQeFAAIEQABBBYMAXQTeAIUFDACHBsEAQgSaAFQEkAA/BIQAQgSKAHEFCwBCBcIAIAIxAIYEuACCBHYAHQJyAB4FoACABIQAbAe/AGAHNwBTAhMAdQWPAEsC4//dBZwAUASmAEAFswB0BOEAaAJB/60EPABOA/cAewPEAFUEAgCoA40AagIfAHYCqgB3AmgAIQPZAHUDSAA5AoMAjgAA/IAAAP1WAAD8YQAA/R8AAPvwAAD9BwKyANoEYwBmAmkAjAR1AIQF2QAUBYEAUgUuABAEiQBfBakAhASJAEgGKABJBdAANAVgAGYEggBJBNAAjgQVABEEhABEBHMAXwQCAEwEhABsBLgAcAKyAIoEYwAHBD0AZwUmADQEhABxBB4APwSUAEIEKgAsBF4AcQX3ADYF9ABEBpEAUwTDAHUEuv/nBp4AFAX7AB0FRwBXCHYAKAh4AIQGLAAhBZoAdQUDAH8F+wAZB/sAEQTvAEMFmgB4BaYAKAUNAB8GiABJBhIAdQWQAIkHqwCACCsAgAYqABkG+QCFBQEAgAU0AD4HjACOBMb/5ASOAFQEhwCCA1oAbwUNACEG1QAnBBwARQSKAG8EggCCBIwAFgYTAIIEigBvBIoAbwQTAB8F2ABEBOAAbwRuAFgGngBvBzMAbAU/ACEGnwCCBHcAggQpAD8GfgCGBHkAKQR6/8wEKQBABt4AFQbkAG8EhP/aBIoAbweTAHcGkABkBHb/5QckAH0GCQB1BUkADwR5AAcHewCTBmMAfgb5AG0F3gBvCU0AlQgMAIYEHAAHBAcAHAWBAFoEhABABSQACwQVABEFgQBaBIQAQgeSAHcGdwBsB5MAdwaQAGQE+ABZBEcAVgT7AGsAAPxzAAD8eAAA/ZYAAP2nAAD6MAAA+nAGOAB4BTgAbwR2/+UFCACCBIIAbwRxAH8DsQBsBPsAhAQ7AGwIjQARB0UAJwXyAIQFMwCCBUsAgATRAIIGmwAlBbkAOgZAAIIFMQBvB+EAggWmAGwIXACEBu0AbAZtAF4FKgBVBVUAFgRXABUHKQAiBX8ALQYkAIkFFwBYBXEAbgR7AGgFlwCGBg7/5QTI/7wFMgCABJEAggZAACgFOAAWBagAhASEAGwGRACCBTUAbweaAIIGowCCBY8ASwSgAFAEogBSBM4AJQOrABYFmgAWBJwAFQUBAEkHQgB0BtQAWgZNAEEFJAAtBK8AQQR5AG0HuABABscAPwf0AIEGmgBdBREARgQ8AEYFpAAfBRkAQgU+AGoGgQAoBXkAFgMfAFsEFAAACCkAAAQUAAAIKQAAArkAAAIKAAABXAAABH8AAAIwAAABogAAAQAAAADRAAAAAAAAAxsAbgMbAG4FDgCYBhsAbQORAAEB3wBoAdYAOgH8AEIBrABHAz8AcANFAEgDOQBCBE4AOQShAGIC4ACHBCwAhQXrAIUCDwBlB60AVwJ+AGwCagBQA5EAHgL7ADUDWABXBMEAZgaDACUG4QCNCK4AggZ1ACUG8gBvBJcAWQX9ACUEOAAoBMAAJQV1AEQFpAAzBeAAZAPzACoIHQCABQ0AdAUQAJQGRABhBuQASAbRAFcG4ABbBJQAWQWLAKQFBAA5BHIAkwSFADcIXwBeAk//pQSdAGUElACIBBMANgQiAHgEEgAfAloAigKRAFoB1gA0BToAHQTeABQE5wAdB20AHQdtAB0FLAAdBs4AOAAAAAAILABXCDUAXAL6ADcC+gCHAvoARwQoAEgEKABPBCgAMQQnAE8EKABPBCgAMwQoAC8EKAA4BCgAlQQoAE8EMQA3BE3//wRkAAMF/QAfBIj//wSPAF0EUQAgBEkAOgR2AGMEwABBBHgAYwTAAEAE1gBjBgcAYwO6AGMEZABjA9wAIAIPAHYE1wBjBKIASQPDAGMESQA6BJIAQAOnAAYDxQBjBIj//wTAAEAEiP//A6sASgTgAGMEQgBIBdcAQQWNAEEE0QBKBasAIASDAEAHZQAeB14AYwW4ACAE4ABjBIUAYwWLACEGcAAWBEoAPgTaAGMEaQBjBNMAHgRuABsFkABjBKkARgavAGMHXwBjBZcACgY7AGMEewBjBIMAMQakAGMEgwA2BDcACgbmABYEvwBjBRYAYwWjACAGIABABFD//wTbAAMGwwAgBKkARgSpAGMGMQAVBNIAQARMAD4EwABABJIAQAQDAEcIOwBjBSwAKAL6ADAC+gA1AvoARQL6AEYC+gAzAvoARwL6AEMD0gCNAqoAkAPbAGMEO//7BK0ASQU5AIQFKwCEBEcAcQUwAIQEQABxBHUAYwSDAEAEbQBjBKz//wIBAIUDnQBqAAD8mgQHAIMEB/9FBAcAhAQHAIQDxQBjA50AagOdAGoC+wBHAvsANQL7AEUC+wBGAvsAMwL7AEcC+wBDBWoAWAWSAFgFcgCEBdYAWAXXAFgEaACPBIIAWARXAA8ErAAsBGsAaAQuADwDnQBqAdkAWgaOAEAEpwBgAhv/nwSXADcElwBhBJcANASXAFQElwBOBJcAMwSXAF8ElwBWBJcAXwSXANkCQf+tAkH/rQIxAIYCMf/8AjEAhgRtAGME0gBMBD4AOASRAG8ERgBEBJgARASWAEQEnAA8BJUAbwSaAEQEUwBIBJEAQgPUAGYFNQBWA9AABwZQ/9cEFABjBMAAQAUwADYE1gBjAf4AAAMaAG4FUf/sBVH/7ASY/8sE8wAoArT/4gViAAcFYgAHBWIABwViAAcFYgAHBWIABwViAAcFPABWBIAAggSAAIIEgACCBIAAggJV/7oCVQCVAlX/rwJV/60FpgCCBYYAVgWGAFYFhgBWBYYAVgWGAFYFRAB0BUQAdAVEAHQFRAB0BPIAAgRKAEQESgBEBEoARARKAEQESgBEBEoARARKAEQELABCBFMASARTAEgEUwBIBFMASAIx/6gCMQCGAjH/nQIx/5sEewBpBIYAQgSGAEIEhgBCBIYAQgSGAEIEegBoBHoAaAR6AGgEegBoBAQAAwQEAAMFYgAHBEoARAViAAcESgBEBWIABwRKAEQFPABWBCwAQgU8AFYELABCBTwAVgQsAEIFPABWBCwAQgUzAIIFGABCBIAAggRTAEgEgACCBFMASASAAIIEUwBIBIAAggRTAEgEgACCBFMASAVzAF4EkQBFBXMAXgSRAEUFcwBeBJEARQVzAF4EkQBFBacAggR6AGgCVf+yAjH/oAJV/9QCMf/CAlX/0gIx/8ACVQAXAh8AAwJVAJUGzQCVBDMAbQR4ACgCQf+XBRQAggRGAG8EVQCCAh8AfgRVAIICHwBbBFUAggK1AH4EVQCCAvsAfgWmAIIEewBpBaYAggR7AGkFpgCCBHsAaQR7/5IFhgBWBIYAQgWGAFYEhgBCBYYAVgSGAEIFGwCCAusAbwUbAIIC6wBQBRsAggLrABEE6wBFBB0AOATrAEUEHQA4BOsARQQdADgE6wBFBB0AOATrAEUEHQA4BPMAKAK0AAoE8wAoArQACgTzACgC3AAKBUQAdAR6AGgFRAB0BHoAaAVEAHQEegBoBUQAdAR6AGgFRAB0BHoAaAVEAHQEegBoBvLine truncated
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
import{n as e}from"./index-FtyTkPzF.js";var t=e(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.html2canvas=r())})(e,(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};function r(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function i(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function a(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||t)}for(var o=function(){function e(e,t,n,r){this.left=e,this.top=t,this.width=n,this.height=r}return e.prototype.add=function(t,n,r,i){return new e(this.left+t,this.top+n,this.width+r,this.height+i)},e.fromClientRect=function(t,n){return new e(n.left+t.windowBounds.left,n.top+t.windowBounds.top,n.width,n.height)},e.fromDOMRectList=function(t,n){var r=Array.from(n).find(function(e){return e.width!==0});return r?new e(r.left+t.windowBounds.left,r.top+t.windowBounds.top,r.width,r.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),s=function(e,t){return o.fromClientRect(e,t.getBoundingClientRect())},c=function(e){var t=e.body,n=e.documentElement;if(!t||!n)throw Error(`Unable to get document size`);return new o(0,0,Math.max(Math.max(t.scrollWidth,n.scrollWidth),Math.max(t.offsetWidth,n.offsetWidth),Math.max(t.clientWidth,n.clientWidth)),Math.max(Math.max(t.scrollHeight,n.scrollHeight),Math.max(t.offsetHeight,n.offsetHeight),Math.max(t.clientHeight,n.clientHeight)))},l=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var a=e.charCodeAt(n++);(a&64512)==56320?t.push(((i&1023)<<10)+(a&1023)+65536):(t.push(i),n--)}else t.push(i)}return t},u=function(){var e=[...arguments];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var t=e.length;if(!t)return``;for(var n=[],r=-1,i=``;++r<t;){var a=e[r];a<=65535?n.push(a):(a-=65536,n.push((a>>10)+55296,a%1024+56320)),(r+1===t||n.length>16384)&&(i+=String.fromCharCode.apply(String,n),n.length=0)}return i},d=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,f=typeof Uint8Array>`u`?[]:new Uint8Array(256),p=0;p<d.length;p++)f[d.charCodeAt(p)]=p;for(var m=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,h=typeof Uint8Array>`u`?[]:new Uint8Array(256),g=0;g<m.length;g++)h[m.charCodeAt(g)]=g;for(var _=function(e){var t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);var l=typeof ArrayBuffer<`u`&&typeof Uint8Array<`u`&&Uint8Array.prototype.slice!==void 0?new ArrayBuffer(t):Array(t),u=Array.isArray(l)?l:new Uint8Array(l);for(r=0;r<n;r+=4)a=h[e.charCodeAt(r)],o=h[e.charCodeAt(r+1)],s=h[e.charCodeAt(r+2)],c=h[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},v=function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n.push(e[r+1]<<8|e[r]);return n},y=function(e){for(var t=e.length,n=[],r=0;r<t;r+=4)n.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return n},b=5,x=11,S=2,C=x-b,w=65536>>b,T=(1<<b)-1,E=w+(1024>>b)+32,D=65536>>x,O=(1<<C)-1,ee=functLine truncated
|
||||
import{n as e}from"./index-D6jMbgMg.js";var t=e(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.html2canvas=r())})(e,(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};function r(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function i(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function a(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||t)}for(var o=function(){function e(e,t,n,r){this.left=e,this.top=t,this.width=n,this.height=r}return e.prototype.add=function(t,n,r,i){return new e(this.left+t,this.top+n,this.width+r,this.height+i)},e.fromClientRect=function(t,n){return new e(n.left+t.windowBounds.left,n.top+t.windowBounds.top,n.width,n.height)},e.fromDOMRectList=function(t,n){var r=Array.from(n).find(function(e){return e.width!==0});return r?new e(r.left+t.windowBounds.left,r.top+t.windowBounds.top,r.width,r.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),s=function(e,t){return o.fromClientRect(e,t.getBoundingClientRect())},c=function(e){var t=e.body,n=e.documentElement;if(!t||!n)throw Error(`Unable to get document size`);return new o(0,0,Math.max(Math.max(t.scrollWidth,n.scrollWidth),Math.max(t.offsetWidth,n.offsetWidth),Math.max(t.clientWidth,n.clientWidth)),Math.max(Math.max(t.scrollHeight,n.scrollHeight),Math.max(t.offsetHeight,n.offsetHeight),Math.max(t.clientHeight,n.clientHeight)))},l=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var a=e.charCodeAt(n++);(a&64512)==56320?t.push(((i&1023)<<10)+(a&1023)+65536):(t.push(i),n--)}else t.push(i)}return t},u=function(){var e=[...arguments];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var t=e.length;if(!t)return``;for(var n=[],r=-1,i=``;++r<t;){var a=e[r];a<=65535?n.push(a):(a-=65536,n.push((a>>10)+55296,a%1024+56320)),(r+1===t||n.length>16384)&&(i+=String.fromCharCode.apply(String,n),n.length=0)}return i},d=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,f=typeof Uint8Array>`u`?[]:new Uint8Array(256),p=0;p<d.length;p++)f[d.charCodeAt(p)]=p;for(var m=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,h=typeof Uint8Array>`u`?[]:new Uint8Array(256),g=0;g<m.length;g++)h[m.charCodeAt(g)]=g;for(var _=function(e){var t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);var l=typeof ArrayBuffer<`u`&&typeof Uint8Array<`u`&&Uint8Array.prototype.slice!==void 0?new ArrayBuffer(t):Array(t),u=Array.isArray(l)?l:new Uint8Array(l);for(r=0;r<n;r+=4)a=h[e.charCodeAt(r)],o=h[e.charCodeAt(r+1)],s=h[e.charCodeAt(r+2)],c=h[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},v=function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n.push(e[r+1]<<8|e[r]);return n},y=function(e){for(var t=e.length,n=[],r=0;r<t;r+=4)n.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return n},b=5,x=11,S=2,C=x-b,w=65536>>b,T=(1<<b)-1,E=w+(1024>>b)+32,D=65536>>x,O=(1<<C)-1,ee=functLine truncated
|
||||
content: "" !important;
|
||||
display: none !important;
|
||||
}`,bc=function(e){xc(e,`.`+_c+hc+yc+`
|
||||
+213
@@ -0,0 +1,213 @@
|
||||
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=s((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=Line truncated
|
||||
`+V+e}var U=!1;function ee(e,t){if(!e||U)return``;U=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
|
||||
`),a=r.stack.split(`
|
||||
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
|
||||
`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{U=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?H(e):``}function W(e){switch(e.tag){case 5:return H(e.type);case 16:return H(`Lazy`);case 13:return H(`Suspense`);case 19:return H(`SuspenseList`);case 0:case 2:case 15:return e=ee(e.type,!1),e;case 11:return e=ee(e.type.render,!1),e;case 1:return e=ee(e.type,!0),e;default:return``}}function G(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?G(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return G(e(t))}catch{}}return null}function te(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return G(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function K(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function ne(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function re(e){var t=ne(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ie(e){e._valueTracker||=re(e)}function q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=ne(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function ae(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function oe(e,t){var n=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function se(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=K(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function ce(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function le(e,t){ce(e,t);var n=K(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?ue(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&ue(e,t.type,K(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function J(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function ue(e,t,n){(t!==`number`||ae(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var de=Array.isArray;function fe(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+K(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function pe(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return B({}
Line truncated
|
||||
`).replace(ci,``)}function ui(e,t,n){if(t=li(t),li(e)!==t&&n)throw Error(r(425))}function di(){}var fi=null,pi=null;function mi(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var hi=typeof setTimeout==`function`?setTimeout:void 0,gi=typeof clearTimeout==`function`?clearTimeout:void 0,_i=typeof Promise==`function`?Promise:void 0,vi=typeof queueMicrotask==`function`?queueMicrotask:_i===void 0?hi:function(e){return _i.resolve(null).then(e).catch(yi)};function yi(e){setTimeout(function(){throw e})}function bi(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),en(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);en(t)}function xi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function Si(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Ci=Math.random().toString(36).slice(2),wi=`__reactFiber$`+Ci,Ti=`__reactProps$`+Ci,Ei=`__reactContainer$`+Ci,Di=`__reactEvents$`+Ci,Oi=`__reactListeners$`+Ci,ki=`__reactHandles$`+Ci;function Ai(e){var t=e[wi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ei]||n[wi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Si(e);e!==null;){if(n=e[wi])return n;e=Si(e)}return t}e=n,n=e.parentNode}return null}function ji(e){return e=e[wi]||e[Ei],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Mi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Ni(e){return e[Ti]||null}var Pi=[],Fi=-1;function Ii(e){return{current:e}}function Li(e){0>Fi||(e.current=Pi[Fi],Pi[Fi]=null,Fi--)}function Ri(e,t){Fi++,Pi[Fi]=e.current,e.current=t}var zi={},Bi=Ii(zi),Vi=Ii(!1),Hi=zi;function Ui(e,t){var n=e.type.contextTypes;if(!n)return zi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Wi(e){return e=e.childContextTypes,e!=null}function Gi(){Li(Vi),Li(Bi)}function Ki(e,t,n){if(Bi.current!==zi)throw Error(r(168));Ri(Bi,t),Ri(Vi,n)}function qi(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,te(e)||`Unknown`,a));return B({},n,i)}function Ji(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zi,Hi=Bi.current,Ri(Bi,e),Ri(Vi,Vi.current),!0}function Yi(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=qi(e,t,Hi),i.__reactInternalMemoizedMergedChildContext=e,Li(Vi),Li(Bi),Ri(Bi,e)):Li(Vi),Ri(Vi,n)}var Xi=null,Zi=!1,Qi=!1;function $i(e){Xi===null?Xi=[e]:Xi.push(e)}function ea(e){Zi=!0,$i(e)}function ta(){if(!Qi&&Xi!==null){Qi=!0;var e=0,t=At;try{var n=Xi;for(At=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Xi=null,Zi=!1}catch(t){throw Xi!==null&&(Xi=Xi.slice(e+1)),tt(st,ta),t}finally{At=t,Qi=!1}}return null}var na=[],ra=0,ia=null,aa=0,oa=[],sa=0,ca=null,la=1,ua=``;function da(e,t){na[ra++]=aa,na[ra++]=ia,ia=e,aa=t}function fa(e,t,n){oa[sa++]=la,oa[sa++]=ua,oa[sa++]=ca,ca=e;var r=la;e=ua;var i=32-ht(r)-1;r&=~(1<<i),n+=1;var a=32-ht(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,la=1<<32-ht(t)+i|n<<i|r,ua=a+e}else la=1<<a|n<<i|r,ua=e}function pa(e){e.return!==null&&(da(e,1),fa(e,1,0))}function ma(e){for(;e===ia;)ia=na[--ra],na[ra]=null,aa=na[--ra],na[ra]=null;for(;e===ca;)ca=oa[--sa],oa[sa]=null,ua=oa[--sa],oa[sa]=null,la=oa[--sa],oa[sa]=null}var ha=null,ga=null,_a=!1,va=null;function ya(e,t){var n=Jl(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function ba(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t===null?!1:(e.stateNode=t,ha=e,ga=xi(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,ha=e,ga=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=ca===null?null:{id:la,overflow:ua},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Jl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ha=e,ga=null,!0);default:return!1}}function xa(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Sa(e){if(_a){var t=ga;if(t){var n=t;if(!ba(e,t)){if(xa(e))throw Error(r(418));t=xi(n.nextSibling);var i=ha;t&&ba(e,t)?ya(i,n):(e.flags=e.flags&-4097|2,_a=!1,ha=e)}}else{if(xa(e))throw Error(r(418));e.flags=e.flags&-4097|2,_a=!1,ha=e}}}function Ca(e){for(e=e.retu
Line truncated
|
||||
Error generating stack: `+e.message+`
|
||||
`+e.stack}return{value:e,source:t,stack:i,digest:null}}function Cs(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ws(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Ts=typeof WeakMap==`function`?WeakMap:Map;function Es(e,t,n){n=Za(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){il||(il=!0,al=r),ws(e,t)},n}function Ds(e,t,n){n=Za(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ws(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){ws(e,t),typeof r!=`function`&&(ol===null?ol=new Set([this]):ol.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Os(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ts;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Vl.bind(null,e,t,n),t.then(e,e))}function ks(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function As(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Za(-1,1),t.tag=2,Qa(n,t,1))),n.lanes|=1),e)}var js=C.ReactCurrentOwner,Ms=!1;function Ns(e,t,n,r){t.child=e===null?Pa(t,null,n,r):Na(t,e.child,n,r)}function Ps(e,t,n,r,i){n=n.render;var a=t.ref;return Ha(t,i),r=ko(e,t,n,r,a,i),n=Ao(),e!==null&&!Ms?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ec(e,t,i)):(_a&&n&&pa(t),t.flags|=1,Ns(e,t,r,i),t.child)}function Fs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Yl(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Is(e,t,a,r,i)):(e=Ql(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?br:n,n(o,r)&&e.ref===t.ref)return ec(e,t,i)}return t.flags|=1,e=Zl(a,r),e.ref=t.ref,e.return=t,t.child=e}function Is(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(br(a,r)&&e.ref===t.ref)if(Ms=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Ms=!0);else return t.lanes=e.lanes,ec(e,t,i)}return zs(e,t,n,r,i)}function Ls(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ri(qc,Kc),Kc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ri(qc,Kc),Kc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Ri(qc,Kc),Kc|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Ri(qc,Kc),Kc|=r;return Ns(e,t,i,n),t.child}function Rs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function zs(e,t,n,r,i){var a=Wi(n)?Hi:Bi.current;return a=Ui(t,a),Ha(t,i),n=ko(e,t,n,r,a,i),r=Ao(),e!==null&&!Ms?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ec(e,t,i)):(_a&&r&&pa(t),t.flags|=1,Ns(e,t,n,i),t.child)}function Bs(e,t,n,r,i){if(Wi(n)){var a=!0;Ji(t)}else a=!1;if(Ha(t,i),t.stateNode===null)$s(e,t),ys(t,n,r),xs(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Ua(l):(l=Wi(n)?Hi:Bi.current,l=Ui(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&bs(t,o,r,l),Ja=!1;var f=t.memoizedState;o.state=f,to(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Vi.current||Ja?(typeof u==`function`&&(gs(t,n,u,r),c=t.memoizedState),(s=Ja||vs(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Xa(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:hs(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Ua(c):(c=Wi(n)?Hi:Bi.current,c=Ui(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&bs(t,o,r,c),Ja=!1,f=t.memoizedState,o.state=f,to(t,r,o,i);var m=t.memoizedState;s!==d||
Line truncated
|
||||
.image-pan-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-behavior: smooth;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.image-pan-container::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.image-pan-container {
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.image-pan-element {
|
||||
width: auto;
|
||||
max-width: none !important;
|
||||
height: 100%;
|
||||
display: block;
|
||||
min-width: 100%;
|
||||
}
|
||||
`}),D.length>1&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{onClick:()=>F(e=>(e-1+D.length)%D.length),className:`absolute left-4 top-1/2 -translate-y-1/2 z-10 p-2 bg-black/30 hover:bg-black/50 backdrop-blur-md rounded-full text-white transition-all md:hidden`,"aria-label":`Previous photo`,children:(0,X.jsx)(`span`,{className:`text-xl`,children:`‹`})}),(0,X.jsx)(`button`,{onClick:()=>F(e=>(e+1)%D.length),className:`absolute right-4 top-1/2 -translate-y-1/2 z-10 p-2 bg-black/30 hover:bg-black/50 backdrop-blur-md rounded-full text-white transition-all md:hidden`,"aria-label":`Next photo`,children:(0,X.jsx)(`span`,{className:`text-xl`,children:`›`})})]}),D.length>1&&(0,X.jsx)(`div`,{className:`absolute bottom-20 left-1/2 -translate-x-1/2 z-10 flex gap-1.5`,children:D.slice(0,20).map((e,t)=>(0,X.jsx)(`button`,{onClick:()=>F(t),className:`w-2 h-2 rounded-full transition-all ${N===t?`bg-emerald-500 w-6`:`bg-white/40 hover:bg-white/60`}`},t))}),(0,X.jsxs)(`div`,{className:`absolute top-0 left-0 right-0 z-20 p-3 sm:p-4 pt-[calc(0.75rem+env(safe-area-inset-top,0px))] sm:pt-[calc(1rem+env(safe-area-inset-top,0px))] flex justify-between items-center bg-gradient-to-b from-slate-950/40 to-transparent`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 sm:gap-2 text-white drop-shadow-lg`,children:[(0,X.jsx)(W,{className:`w-7 h-7 sm:w-8 sm:h-8`}),(0,X.jsx)(`span`,{className:`text-lg sm:text-xl font-black tracking-tighter uppercase hidden sm:block`,children:`YoTrip`})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 sm:gap-3`,children:[(0,X.jsxs)(`select`,{value:C,onChange:e=>w(e.target.value),className:`bg-black/40 hover:bg-black/60 border border-white/20 text-white rounded-full px-2 py-1 sm:px-3 sm:py-1.5 text-[11px] sm:text-xs font-bold focus:outline-none backdrop-blur-md cursor-pointer max-w-[80px] sm:max-w-none`,children:[(0,X.jsx)(`option`,{value:`vi`,className:`text-black`,children:`Tiếng Việt`}),(0,X.jsx)(`option`,{value:`en`,className:`text-black`,children:`English`}),(0,X.jsx)(`option`,{value:`zh`,className:`text-black`,children:`中文`})]}),(0,X.jsxs)(`select`,{value:T,onChange:e=>E(e.target.value),className:`bg-black/40 hover:bg-black/60 border border-white/20 text-white rounded-full px-2 py-1 sm:px-3 sm:py-1.5 text-[11px] sm:text-xs font-bold focus:outline-none backdrop-blur-md cursor-pointer max-w-[80px] sm:max-w-none`,children:[(0,X.jsx)(`option`,{value:`light`,className:`text-black`,children:S(`themeLight`)||`Sáng`}),(0,X.jsx)(`option`,{value:`dark`,className:`text-black`,children:S(`themeDark`)||`Tối`}),(0,X.jsx)(`option`,{value:`system`,className:`text-black`,children:S(`themeSystem`)||`Hệ thống`})]}),(0,X.jsxs)(`button`,{onClick:()=>o(!0),className:`flex items-center justify-center gap-1.5 bg-red-600/80 backdrop-blur-md text-white font-bold py-1.5 px-2.5 sm:py-2 sm:px-3.5 rounded-full border border-red-500/30 hover:bg-red-500 transition-all shadow-md active:scale-95 text-xs sm:text-sm cursor-pointer`,children:[(0,X.jsx)(Me,{className:`w-3.5 h-3.5 sm:w-4 sm:h-4`}),(0,X.jsx)(`span`,{className:`hidden sm:inline`,children:S(`reportBusinessBtn`)})]}),(0,X.jsxs)(`button`,{onClick:()=>i(!0),className:`flex items-center justify-center gap-1 sm:gap-2 bg-white/15 backdrop-blur-md text-white font-bold py-1.5 px-2.5 sm:py-2 sm:px-4 rounded-full border border-white/25 hover:bg-white/25 transition-all shadow-md active:scale-95 text-xs sm:text-sm cursor-pointer`,children:[(0,X.jsx)(fe,{className:`w-3.5 h-3.5 sm:w-4 sm:h-4`}),(0,X.jsx)(`span`,{children:S(`login`)})]})]})]}),(0,X.jsxs)(`div`,{className:`absolute left-6 top-24 bottom-36 z-20 hidden md:flex flex-col w-72 bg-slate-900/60 backdrop-blur-md border border-white/10 rounded-[32px] p-5 text-white overflow-hidden shadow-2xl animate-in slide-in-from-left duration-500`,children:[(0,X.jsxs)(`h3`,{className:`text-base font-black flex items-center gap-2 mb-3 border-b border-white/10 pb-2`,children:[`🏆 `,S(`trustedMembers`)]}),(0,X.jsx)(`div`,{className:`flex-1 overflow-y-auto space-y-3 pr-1 no-scrollbar`,children:k.length===0?(0,X.jsx)(`div`,{className:`text-xs text-white/50 italic py-4`,children:`Chưa có đánh giá nào.`}):k.map((e,t)=>(0,X.jsxs)(`div`,{className:`flex items-center gap-3 bg-white/5 hover:bg-white/10 p-2.5 rounded-2xl border border-white/5 transition-all`,children:[(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`div`,{className:`w-10 h-10 rounded-full bg-slate-800 border border-white/10 flex items-center justify-center font-bold overflow-hidden`,children:e.avatar?(0,X.jsx)(`img`,{src:e.avatar,alt:`Avatar`,className:`w-full h-full object-cover`}):(0,X.jsx)(`span`,{children:e.name.charAt(0)})}),(0,X.jsx)(`span`,{className:`absolute -top-1 -left-1 bg-amber-500 text-[10px] text-white font-black px-1.5 py-0.5 rounded-full border border-slate-950`,children:t+1})]}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsx)(`div`,{className:`text-xs font-bold truncate`,children:e.na
Line truncated
|
||||
.no-scrollbar::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.no-scrollbar {
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
`})]}),(0,X.jsx)(Ye,{isOpen:r,onClose:()=>i(!1),onSwitchToSignup:e,onLoginSuccess:n}),(0,X.jsx)(Qe,{isOpen:a,onClose:()=>o(!1)}),(0,X.jsx)(Z,{isOpen:s,onClose:()=>{c(!1),h(null),_(null),v&&(URL.revokeObjectURL(v),b(``))},onConfirm:async e=>{if(m){c(!1),x({title:`Đang tải lên...`,message:`Vui lòng chờ trong giây lát.`,type:`info`});try{localStorage.removeItem(`token`),localStorage.removeItem(`user`);let t=localStorage.getItem(`guest_token`),n=JSON.parse(localStorage.getItem(`guest_user`)||`null`);if(!t){let e=await fetch(`/api/v1/auth/create-guest`,{method:`POST`});if(!e.ok)throw Error(`Không thể tạo phiên khách.`);let r=await e.json();t=r.access_token,n=r.user,localStorage.setItem(`guest_token`,t),localStorage.setItem(`guest_user`,JSON.stringify(n))}let r=new FormData;r.append(`images`,m),g&&(r.append(`latitude`,g.coords.latitude.toString()),r.append(`longitude`,g.coords.longitude.toString())),e.length>0&&r.append(`tags`,JSON.stringify(e));let i=await fetch(`/api/v1/photos/upload-anonymous`,{method:`POST`,headers:{Authorization:`Bearer ${t}`},body:r});if(i.status===401){console.warn(`Guest token invalid or expired. Creating a new guest user and retrying...`),localStorage.removeItem(`guest_token`),localStorage.removeItem(`guest_user`),localStorage.removeItem(`token`),localStorage.removeItem(`user`);let e=await fetch(`/api/v1/auth/create-guest`,{method:`POST`});if(!e.ok)throw Error(`Không thể tạo lại phiên khách.`);let a=await e.json();t=a.access_token,n=a.user,localStorage.setItem(`guest_token`,t),localStorage.setItem(`guest_user`,JSON.stringify(n)),i=await fetch(`/api/v1/photos/upload-anonymous`,{method:`POST`,headers:{Authorization:`Bearer ${t}`},body:r})}if(!i.ok){let e=await i.json();throw Error(e.message||`Tải ảnh thất bại.`)}x({title:`Thành công!`,message:`Ảnh của bạn đã được tải lên.`,type:`success`}),localStorage.removeItem(`pendingInviteToken`);let a=new URL(window.location.href);a.searchParams.delete(`token`),window.history.replaceState({},``,a.toString()),await ne(),F(0),h(null),_(null),v&&(URL.revokeObjectURL(v),b(``))}catch(e){x({title:`Lỗi`,message:e.message,type:`error`}),h(null),_(null),v&&(URL.revokeObjectURL(v),b(``))}}},photoUrl:v}),l&&(0,X.jsx)(`div`,{className:`fixed inset-0 z-[9999] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4`,children:(0,X.jsxs)(`div`,{className:`bg-[var(--surface)] rounded-3xl shadow-2xl max-w-sm w-full overflow-hidden animate-in fade-in zoom-in-95 duration-200`,children:[(0,X.jsxs)(`div`,{className:`bg-gradient-to-r from-blue-600 to-blue-500 px-6 py-6 flex items-center justify-between`,children:[(0,X.jsx)(`h2`,{className:`text-xl font-bold text-white`,children:`Chụp hoặc tải ảnh`}),(0,X.jsx)(`button`,{onClick:()=>u(!1),className:`p-1.5 hover:bg-white/20 rounded-full transition-colors`,children:(0,X.jsx)(Ke,{className:`w-5 h-5 text-white`})})]}),(0,X.jsxs)(`div`,{className:`p-6 space-y-3`,children:[(0,X.jsxs)(`button`,{onClick:()=>{u(!1),f.current?.click()},className:`w-full flex items-center gap-4 p-4 bg-[var(--background)] hover:bg-[var(--background-alt)] border border-[var(--border)] rounded-2xl transition-all active:scale-95`,children:[(0,X.jsx)(`div`,{className:`flex-shrink-0 p-3 bg-blue-100 rounded-full`,children:(0,X.jsx)(P,{className:`w-6 h-6 text-blue-600`})}),(0,X.jsxs)(`div`,{className:`flex-1 text-left`,children:[(0,X.jsx)(`div`,{className:`font-bold text-[var(--text-primary)]`,children:`Chụp ảnh bằng camera`}),(0,X.jsx)(`div`,{className:`text-sm text-[var(--text-muted)]`,children:`Dùng camera thiết bị của bạn`})]})]}),(0,X.jsxs)(`button`,{onClick:()=>{u(!1),p.current?.click()},className:`w-full flex items-center gap-4 p-4 bg-[var(--background)] hover:bg-[var(--background-alt)] border border-[var(--border)] rounded-2xl transition-all active:scale-95`,children:[(0,X.jsx)(`div`,{className:`flex-shrink-0 p-3 bg-emerald-100 rounded-full`,children:(0,X.jsx)(oe,{className:`w-6 h-6 text-emerald-600`})}),(0,X.jsxs)(`div`,{className:`flex-1 text-left`,children:[(0,X.jsx)(`div`,{className:`font-bold text-[var(--text-primary)]`,children:`Tải ảnh từ thư viện`}),(0,X.jsx)(`div`,{className:`text-sm text-[var(--text-muted)]`,children:`Chọn ảnh từ thiết bị của bạn`})]})]})]})]})})]})};function ut(e,t){let n=(0,dt.useRef)(t);(0,dt.useEffect)(function(){t!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),t!=null&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}var dt,ft=o((()=>{dt=u(p(),1)}));function pt(e,t,n){t.center!==n.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==n.radius&&e.setRadius(t.radius)}var mt=o((()=>{}));function ht(e){return Object.freeze({__version:1,map:e})}function gt(e,t){return Object.freeze({...e,...t})}function _t(){let e=(0,vt.useContext)(yt);if(e==null)throw Error(`No context provided: useLeafletContext() can only be used in a descendant of <Line truncated
|
||||
.no-scrollbar::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.no-scrollbar {
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
`})]})]}),(0,X.jsxs)(`div`,{className:`w-full md:w-2/5 md:flex-1 md:min-h-0 flex flex-col bg-slate-900 border-t md:border-t-0 md:border-l border-slate-800`,children:[(0,X.jsx)(`div`,{className:`hidden md:block p-6 border-b border-slate-800`,children:(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`h3`,{className:`text-lg font-black tracking-tight text-white flex items-center gap-2`,children:[(0,X.jsx)(_e,{className:`w-5 h-5 text-emerald-500`}),s(`commentSectionTitle`)]}),(0,X.jsx)(`p`,{className:`text-xs text-slate-400 mt-1`,children:`Ảnh chia sẻ công khai trên bản đồ`})]})}),(0,X.jsxs)(`div`,{className:`md:flex-1 md:overflow-y-auto p-6 space-y-4 bg-slate-900/50`,children:[m?(0,X.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-slate-500 gap-2`,children:[(0,X.jsx)(J,{className:`w-8 h-8 animate-spin text-emerald-500`}),(0,X.jsx)(`span`,{className:`text-xs font-semibold`,children:s(`loading`)})]}):u.length===0?(0,X.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-slate-500 gap-3`,children:[(0,X.jsx)(`div`,{className:`p-4 bg-slate-800/40 rounded-full text-slate-600`,children:(0,X.jsx)(_e,{className:`w-8 h-8`})}),(0,X.jsx)(`span`,{className:`text-sm font-semibold italic`,children:`Chưa có bình luận nào. Hãy bắt đầu cuộc trò chuyện!`})]}):u.map(e=>(0,X.jsxs)(`div`,{className:`flex gap-3 items-start animate-in fade-in slide-in-from-bottom-2 duration-200`,children:[(0,X.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-slate-800 flex items-center justify-center flex-shrink-0 border border-slate-700/60`,children:(0,X.jsx)(Ue,{className:`w-4.5 h-4.5 text-slate-400`})}),(0,X.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,X.jsxs)(`div`,{className:`bg-slate-800/55 p-3.5 rounded-2xl rounded-tl-none border border-slate-800 shadow-lg`,children:[(0,X.jsxs)(`div`,{className:`flex justify-between items-center mb-1`,children:[(0,X.jsx)(`span`,{className:`text-xs font-black text-slate-200 truncate`,children:e.userName}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`text-[9px] font-medium text-slate-500`,children:new Date(e.createdAt).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}),(b?.isAdmin||b?.id===e.userId||b?.id===n.uploaderId||b?.id===n.uploader?.id)&&(0,X.jsx)(`button`,{onClick:t=>{t.stopPropagation(),q(e.id)},className:`text-slate-500 hover:text-rose-500 transition-colors p-0.5`,title:s(`delete`)||`Xóa`,children:(0,X.jsx)(ze,{className:`w-3.5 h-3.5`})})]})]}),(0,X.jsx)(`p`,{className:`text-sm text-slate-300 leading-relaxed break-words`,children:e.content})]})})]},e.id)),(0,X.jsx)(`div`,{ref:v})]}),(0,X.jsx)(`div`,{className:`sticky bottom-0 md:static p-4 bg-slate-950 md:bg-slate-950/40 border-t border-slate-800/80 pb-[calc(1rem+env(safe-area-inset-bottom,0px))] md:pb-4 z-40`,children:(0,X.jsxs)(`div`,{className:`relative flex items-center gap-2`,children:[(0,X.jsx)(`input`,{type:`text`,value:f,onChange:e=>p(e.target.value),onKeyDown:e=>e.key===`Enter`&&!g&&ie(),placeholder:`Viết bình luận công khai...`,className:`flex-1 bg-slate-800/65 border border-slate-700/70 text-slate-100 placeholder-slate-500 rounded-2xl px-4 py-3 text-base md:text-sm focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-transparent transition-all`,disabled:g}),(0,X.jsx)(`button`,{onClick:e=>{e.stopPropagation(),ie()},disabled:!f.trim()||g,className:`p-3 bg-emerald-600 hover:bg-emerald-500 disabled:bg-slate-800 disabled:opacity-40 text-white rounded-2xl transition-all active:scale-95 shadow-lg shadow-emerald-950/30 flex items-center justify-center`,children:g?(0,X.jsx)(J,{className:`w-4.5 h-4.5 animate-spin`}):(0,X.jsx)(ke,{className:`w-4.5 h-4.5`})})]})})]})]}),(0,X.jsx)(Ki,{isOpen:F,onClose:()=>I(!1),initialLat:typeof O==`number`?O:void 0,initialLng:typeof A==`number`?A:void 0,onSelect:(e,t)=>{k(e),j(t)}}),B&&(0,X.jsxs)(`div`,{className:`fixed inset-0 z-[9999] bg-black/95 flex items-center justify-center cursor-zoom-out animate-in fade-in duration-200`,onClick:()=>V(!1),children:[(0,X.jsx)(`button`,{onClick:()=>V(!1),className:`fixed top-6 right-6 p-3 bg-black/50 hover:bg-black/75 border border-white/10 rounded-full text-white transition-colors z-[10000]`,children:(0,X.jsx)(Ke,{className:`w-6 h-6`})}),(0,X.jsx)(`img`,{src:n.imageUrl,alt:`Fullscreen photo`,onContextMenu:e=>{H||e.preventDefault()},onDragStart:e=>{H||e.preventDefault()},className:`max-w-full max-h-full object-contain select-none animate-in zoom-in-95 duration-200 ${H?``:`pointer-events-none`}`})]})]}):null},Ji=zn.default.default||zn.default,Yi=vn.default.icon({iconUrl:`https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png`,shadowUrl:`https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png`,iconSize:[25,41],iconAnchor:[12,41]});vn.default.Marker.prototype.options.icon=Yi;var Xi={"phong-canh":`🏞️ Phong cảnh`,"con-nguoi":`👥 Con người`,"doi-thuong":`🎒 Đời thường`,bien:`🌊 Biển`,nui:
Line truncated
|
||||
<div class="relative group w-14 h-14">
|
||||
<div class="w-14 h-14 rounded-full border-4 ${o.borderClass} shadow-lg overflow-hidden transition-transform group-hover:scale-110 flex items-center justify-center bg-[var(--background)]">
|
||||
<img src="${i}" class="w-full h-full object-cover" onerror="this.src='https://images.unsplash.com/photo-1476514525535-07fb3b4ae5f1?w=100'"/>
|
||||
</div>
|
||||
<div class="absolute -bottom-1 -right-1 bg-blue-600 rounded-full w-5 h-5 border-2 border-white flex items-center justify-center text-[10px] font-black text-white">
|
||||
S
|
||||
</div>
|
||||
</div>
|
||||
`,iconSize:[56,56],iconAnchor:[28,28]}),children:(0,X.jsx)(En,{direction:`top`,offset:[0,-28],opacity:1,children:(0,X.jsxs)(`div`,{className:`p-1.5 max-w-[180px]`,children:[(0,X.jsx)(`div`,{className:`font-black text-blue-600 text-[11px] mb-1 uppercase tracking-tight truncate`,children:e.title}),e.tags&&e.tags.length>0&&(0,X.jsx)(`div`,{className:`flex flex-wrap gap-1 mb-1`,children:e.tags.map(e=>(0,X.jsx)(`span`,{className:`px-1.5 py-0.5 bg-blue-50 text-blue-500 rounded text-[8px] font-bold border border-blue-100`,children:e},e))}),e.description&&(0,X.jsx)(`div`,{className:`text-[10px] text-[var(--text-muted)] line-clamp-2 leading-tight italic mb-1.5`,children:e.description}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 pt-1 border-t border-[var(--border)]`,children:[(0,X.jsx)(`span`,{className:`w-2 h-2 rounded-full ${o.color===`green`?`bg-emerald-500`:o.color===`red`?`bg-rose-500`:`bg-[var(--text-muted)]`}`}),(0,X.jsx)(`span`,{className:`text-[9px] font-bold text-[var(--text-secondary)]`,children:o.label})]})]})})},e.id)})},`cluster-${pt.length}`),R.map(e=>{let t=e[0],n=t.metadata?.lat,r=t.metadata?.lng;return typeof n!=`number`||typeof r!=`number`?null:(0,X.jsx)(Sn,{position:[n,r],eventHandlers:{click:()=>{M(t),P(e);let n=new URLSearchParams(window.location.search);n.set(`photoId`,t.id),window.history.replaceState({},``,`${window.location.pathname}?${n.toString()}`)}},icon:vn.default.divIcon({className:`custom-photo-bubble`,html:`
|
||||
<a href="${window.location.origin}/api/v1/public-photos/${t.id}/share" onclick="event.preventDefault();" class="relative group block">
|
||||
<div class="w-12 h-12 rounded-full border-4 border-emerald-500 shadow-lg overflow-hidden transition-transform group-hover:scale-110 relative">
|
||||
<img src="${t.imageUrl}" class="w-full h-full object-cover select-none" draggable="false" />
|
||||
<div class="absolute inset-0 bg-transparent select-none z-10"></div>
|
||||
</div>
|
||||
<div class="absolute -bottom-1 -right-1 bg-emerald-600 rounded-full w-5 h-5 border-2 border-white flex items-center justify-center text-[10px] font-black text-white">
|
||||
📸
|
||||
</div>
|
||||
${e.length>1?`
|
||||
<div class="absolute -top-1 -left-1 bg-rose-600 rounded-full w-5 h-5 border-2 border-white flex items-center justify-center text-[9px] font-black text-white shadow-md animate-bounce">
|
||||
${e.length}
|
||||
</div>
|
||||
`:``}
|
||||
</a>
|
||||
`,iconSize:[48,48],iconAnchor:[24,24]})},t.id)}),ie.map(e=>typeof e.latitude!=`number`||typeof e.longitude!=`number`?null:(0,X.jsx)(Sn,{position:[e.latitude,e.longitude],icon:vn.default.divIcon({html:`<div class="bg-red-600 text-white p-2 rounded-full shadow-lg border-2 border-white flex items-center justify-center animate-pulse"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-shield-alert"><path d="M20 13c0 5-3.5 7.5-7.66 9.7a1 1 0 0 1-.68 0C7.5 20.5 4 18 4 13V6a1 1 0 0 1 .76-.97l8-2a1 1 0 0 1 .48 0l8 2A1 1 0 0 1 20 6z"/><path d="M12 8v4"/><path d="M12 16h.01"/></svg></div>`,className:`custom-blacklist-marker`,iconSize:[32,32],iconAnchor:[16,16]}),children:(0,X.jsx)(En,{direction:`top`,offset:[0,-16],opacity:1,children:(0,X.jsxs)(`div`,{className:`p-2 max-w-[200px] text-left`,children:[(0,X.jsxs)(`div`,{className:`font-black text-red-600 text-xs mb-1 uppercase tracking-tight flex items-center gap-1`,children:[`⚠️ Blacklist: `,e.name]}),(0,X.jsx)(`div`,{className:`text-[10px] bg-red-50 text-red-700 px-1.5 py-0.5 rounded font-black uppercase tracking-wider mb-1 w-max`,children:e.type}),e.address&&(0,X.jsx)(`div`,{className:`text-[10px] text-gray-500 mb-1 font-semibold`,children:e.address}),e.phone&&(0,X.jsxs)(`div`,{className:`text-[9px] text-gray-400`,children:[`SĐT: `,e.phone]}),(0,X.jsxs)(`div`,{className:`text-[10px] text-red-600 font-medium italic mt-1 pt-1 border-t border-red-100`,children:[`Lý do: `,e.reason]})]})})},`blacklist-${e.id}`)),me.map(e=>typeof e.latitude!=`number`||typeof e.longitude!=`number`?null:(0,X.jsx)(Sn,{position:[e.latitude,e.longitude],icon:vn.default.divIcon({html:`<div class="bg-emerald-600 text-white p-2 rounded-full shadow-lg border-2 border-white flex items-center justify-center animate-pulse"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg></div>`,className:`custom-recommended-marker`,iconSize:[32,32],iconAnchor:[16,16]}),children:(0,X.jsx)(En,{direction:`top`,offset:[0,-16],opacity:1,children:(0,X.jsxs)(`div`,{className:`p-2.5 max-w-[220px] text-left`,children:[(0,X.jsxs)(`div`,{className:`font-black text-emerald-600 text-xs mb-1 uppercase tracking-tight flex items-center gap-1`,children:[`🌟 `,e.name]}),(0,X.jsx)(`div`,{className:`flex items-center gap-0.5 text-amber-500 mb-1`,children:Array.from({length:e.stars}).map((e,t)=>(0,X.jsx)(`span`,{children:`★`},t))}),(0,X.jsx)(`div`,{className:`text-[10px] bg-emerald-50 text-emerald-700 px-1.5 py-0.5 rounded font-black uppercase tracking-wider mb-1 w-max`,children:e.type===`RESTAURANT`?h(`businessRestaurant`):e.type===`HOTEL`?h(`businessHotel`):h(`businessHomestay`)}),e.address&&(0,X.jsx)(`div`,{className:`text-[10px] text-[var(--text-muted)] mb-1 font-semibold`,children:e.address}),e.phone&&(0,X.jsxs)(`div`,{className:`text-[9px] text-[var(--text-muted)]`,children:[`SĐT: `,e.phone]}),e.email&&(0,X.jsxs)(`div`,{className:`text-[9px] text-[var(--text-muted)]`,children:[`Email: `,e.email]}),(0,X.jsx)(`div`,{className:`text-[10px] text-slate-600 font-medium italic mt-1 pt-1 border-t border-emerald-100 whitespace-pre-line`,children:e.description})]})})},`recommendation-${e.id}`))]}),ct&&(0,X.jsx)(`div`,{className:`absolute z-[2000] bg-[var(--surface)] rounded-2xl shadow-2xl border border-[var(--border)] py-2 w-48 animate-in zoom-in-95 duration-200`,style:{top:ct.y,left:ct.x},onClick:e=>e.stopPropagation(),children:ct.isParticipant?ct.canShare?(0,X.jsxs)(`button`,{onClick:()=>ut(ct.id,ct.title),className:`w-full text-left px-4 py-2 hover:bg-blue-50 text-sm font-bold text-blue-700 flex items-center gap-2 transition-colors`,children:[(0,X.jsx)(je,{className:`w-4 h-4 text-blue-600`}),` Sao chép liên kết`]}):(0,X.jsx)(`div`,{className:`px-4 py-2 text-xs text-[var(--text-muted)] italic font-bold`,children:`Bạn đã gia nhập tour này`}):ct.hasPendingRequest?(0,X.jsxs)(`button`,{disabled:!0,className:`w-full text-left px-4 py-2 text-sm font-bold text-[var(--text-muted)] flex items-center gap-2 cursor-not-allowed bg-[var(--background)]/50`,children:[(0,X.jsx)(ee,{className:`w-4 h-4 text-[var(--text-muted)]`}),` Đang chờ duyệt...`]}):(0,X.jsxs)(`button`,{onClick:()=>dt(ct.id),className:`w-full text-left px-4 py-2 hover:bg-blue-50 text-sm font-bold text-blue-700 flex items-center gap-2 transition-colors`,children:[(0,X.jsx)(He,{className:`w-4 h-4 text-blue-600`}),` Yêu cầu tham gia Tour`]})}),(0,X.jsx)(Xn,{isOpen:B,onClose:()=>H(!1)}),(0,X.jsx)(Zn,{isOpen:U,onClose:()=>W(!1),onSuccess:e=>{let t=localStorage.getItem(`my_journey_notes`),n=[];try{n=t?JSON.parse(t):[]}catch{nLine truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ka(e,t){return Va(e)||Ha(e,t)||Wa(e,t)||Ga()}function qa(e,t=`utf8`){return new TextDecoder(t).decode(e)}var Ja=new TextEncoder;function Ya(e){return Ja.encode(e)}var Xa=1024*8,Za=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),Qa={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array},$a=class e{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(t=Xa,n={}){let r=!1;typeof t==`number`?t=new ArrayBuffer(t):(r=!0,this.lastWrittenByte=t.byteLength);let i=n.offset?n.offset>>>0:0,a=t.byteLength-i,o=i;(ArrayBuffer.isView(t)||t instanceof e)&&(t.byteLength!==t.buffer.byteLength&&(o=t.byteOffset+i),t=t.buffer),r?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=t,this.length=a,this.byteLength=a,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,a),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){let e=this._marks.pop();if(e===void 0)throw Error(`Mark stack empty`);return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){let t=(this.offset+e)*2,n=new Uint8Array(t);n.set(new Uint8Array(this.buffer)),this.buffer=n.buffer,this.length=t,this.byteLength=t,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,`uint8`)}readArray(e,t){let n=Qa[t].BYTES_PER_ELEMENT*e,r=this.byteOffset+this.offset,i=this.buffer.slice(r,r+n);if(this.littleEndian===Za&&t!==`uint8`&&t!==`int8`){let e=new Uint8Array(this.buffer.slice(r,r+n));e.reverse();let i=new Qa[t](e.buffer);return this.offset+=n,i.reverse(),i}let a=new Qa[t](i);return this.offset+=n,a}readInt16(){let e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){let e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){let e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){let e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){let e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){let e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){let e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){let e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let t=``;for(let n=0;n<e;n++)t+=this.readChar();return t}readUtf8(e=1){return qa(this.readBytes(e))}decodeText(e=1,t=`utf8`){return qa(this.readBytes(e),t)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLast
Line truncated
|
||||
`),Be(e,t),Me.publish(`endTilingPattern`,t),Ie.pop().restore()};var Y,Ve=p.__private__.newObject=function(){var e=He();return Ue(e,!0),e},He=p.__private__.newObjectDeferred=function(){return U++,ee[U]=function(){return G},U},Ue=function(e,t){return t=typeof t==`boolean`&&t,ee[e]=G,t&&q(e+` 0 obj`),e},We=p.__private__.newAdditionalObject=function(){var e={objId:He(),content:``};return te.push(e),e},Ge=He(),Ke=He(),qe=p.__private__.decodeColorString=function(e){var t=e.split(` `);if(t.length!==2||t[1]!==`g`&&t[1]!==`G`)t.length!==5||t[4]!==`k`&&t[4]!==`K`||(t=[(1-t[0])*(1-t[3]),(1-t[1])*(1-t[3]),(1-t[2])*(1-t[3]),`r`]);else{var n=parseFloat(t[0]);t=[n,n,n,`r`]}for(var r=`#`,i=0;i<3;i++)r+=(`0`+Math.floor(255*parseFloat(t[i])).toString(16)).slice(-2);return r},Je=p.__private__.encodeColorString=function(e){var t;typeof e==`string`&&(e={ch1:e});var n=e.ch1,r=e.ch2,i=e.ch3,a=e.ch4,o=e.pdfColorType===`draw`?[`G`,`RG`,`K`]:[`g`,`rg`,`k`];if(typeof n==`string`&&n.charAt(0)!==`#`){var s=new Jd(n);if(s.ok)n=s.toHex();else if(!/^\d*\.?\d*$/.test(n))throw Error(`Invalid color "`+n+`" passed to jsPDF.encodeColorString.`)}if(typeof n==`string`&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n=`#`+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]),typeof n==`string`&&/^#[0-9A-Fa-f]{6}$/.test(n)){var c=parseInt(n.substr(1),16);n=c>>16&255,r=c>>8&255,i=255&c}if(r===void 0||a===void 0&&n===r&&r===i)t=typeof n==`string`?n+` `+o[0]:e.precision===2?D(n/255)+` `+o[0]:O(n/255)+` `+o[0];else if(a===void 0||ta(a)===`object`){if(a&&!isNaN(a.a)&&a.a===0)return[`1.`,`1.`,`1.`,o[1]].join(` `);t=typeof n==`string`?[n,r,i,o[1]].join(` `):e.precision===2?[D(n/255),D(r/255),D(i/255),o[1]].join(` `):[O(n/255),O(r/255),O(i/255),o[1]].join(` `)}else t=typeof n==`string`?[n,r,i,a,o[2]].join(` `):e.precision===2?[D(n),D(r),D(i),D(a),o[2]].join(` `):[O(n),O(r),O(i),O(a),o[2]].join(` `);return t},X=p.__private__.getFilters=function(){return o},Ye=p.__private__.putStream=function(e){var t=(e||={}).data||``,n=e.filters||X(),r=e.alreadyAppliedFilters||[],i=e.addLength1||!1,a=t.length,o=e.objectId,s=function(e){return e};if(u!==null&&o===void 0)throw Error(`ObjectId must be passed to putStream for file encryption`);u!==null&&(s=Q.encryptor(o,0));var c={};!0===n&&(n=[`FlateEncode`]);var l=e.additionalKeyValues||[],d=(c=xf.API.processDataByFilters===void 0?{data:t,reverseChain:[]}:xf.API.processDataByFilters(t,n)).reverseChain+(Array.isArray(r)?r.join(` `):r.toString());if(c.data.length!==0&&(l.push({key:`Length`,value:c.data.length}),!0===i&&l.push({key:`Length1`,value:a})),d.length!=0)if(d.split(`/`).length-1==1)l.push({key:`Filter`,value:d});else{l.push({key:`Filter`,value:`[`+d+`]`});for(var f=0;f<l.length;f+=1)if(l[f].key===`DecodeParms`){for(var p=[],m=0;m<c.reverseChain.split(`/`).length-1;m+=1)p.push(`null`);p.push(l[f].value),l[f].value=`[`+p.join(` `)+`]`}}q(`<<`);for(var h=0;h<l.length;h++)q(`/`+l[h].key+` `+l[h].value);q(`>>`),c.data.length!==0&&(q(`stream`),q(s(c.data)),q(`endstream`))},Xe=p.__private__.putPage=function(e){var t=e.number,n=e.data,r=e.objId,i=e.contentsObjId;Ue(r,!0),q(`<</Type /Page`),q(`/Parent `+e.rootDictionaryObjId+` 0 R`),q(`/Resources `+e.resourceDictionaryObjId+` 0 R`),q(`/MediaBox [`+parseFloat(w(e.mediaBox.bottomLeftX))+` `+parseFloat(w(e.mediaBox.bottomLeftY))+` `+w(e.mediaBox.topRightX)+` `+w(e.mediaBox.topRightY)+`]`),e.cropBox!==null&&q(`/CropBox [`+w(e.cropBox.bottomLeftX)+` `+w(e.cropBox.bottomLeftY)+` `+w(e.cropBox.topRightX)+` `+w(e.cropBox.topRightY)+`]`),e.bleedBox!==null&&q(`/BleedBox [`+w(e.bleedBox.bottomLeftX)+` `+w(e.bleedBox.bottomLeftY)+` `+w(e.bleedBox.topRightX)+` `+w(e.bleedBox.topRightY)+`]`),e.trimBox!==null&&q(`/TrimBox [`+w(e.trimBox.bottomLeftX)+` `+w(e.trimBox.bottomLeftY)+` `+w(e.trimBox.topRightX)+` `+w(e.trimBox.topRightY)+`]`),e.artBox!==null&&q(`/ArtBox [`+w(e.artBox.bottomLeftX)+` `+w(e.artBox.bottomLeftY)+` `+w(e.artBox.topRightX)+` `+w(e.artBox.topRightY)+`]`),typeof e.userUnit==`number`&&e.userUnit!==1&&q(`/UserUnit `+e.userUnit),Me.publish(`putPage`,{objId:r,pageContext:je[t],pageNumber:t,page:n}),q(`/Contents `+i+` 0 R`),q(`>>`),q(`endobj`);var a=n.join(`
|
||||
`);return b===y&&(a+=`
|
||||
Q`),Ue(i,!0),Ye({data:a,filters:X(),objectId:i}),q(`endobj`),r},Ze=p.__private__.putPages=function(){var e,t,n=[];for(e=1;e<=Ae;e++)je[e].objId=He(),je[e].contentsObjId=He();for(e=1;e<=Ae;e++)n.push(Xe({number:e,data:K[e],objId:je[e].objId,contentsObjId:je[e].contentsObjId,mediaBox:je[e].mediaBox,cropBox:je[e].cropBox,bleedBox:je[e].bleedBox,trimBox:je[e].trimBox,artBox:je[e].artBox,userUnit:je[e].userUnit,rootDictionaryObjId:Ge,resourceDictionaryObjId:Ke}));Ue(Ge,!0),q(`<</Type /Pages`);var r=`/Kids [`;for(t=0;t<Ae;t++)r+=n[t]+` 0 R `;q(r+`]`),q(`/Count `+Ae),q(`>>`),q(`endobj`),Me.publish(`postPutPages`)},Qe=function(e){Me.publish(`putFont`,{font:e,out:q,newObject:Ve,putStream:Ye}),!0!==e.isAlreadyPutted&&(e.objectNumber=Ve(),q(`<<`),q(`/Type /Font`),q(`/BaseFont /`+hf(e.postScriptName)),q(`/Subtype /Type1`),typeof e.encoding==`string`&&q(`/Encoding /`+e.encoding),q(`/FirstChar 32`),q(`/LastChar 255`),q(`>>`),q(`endobj`))},$e=function(e){e.objectNumber=Ve();var t=[];t.push({key:`Type`,value:`/XObject`}),t.push({key:`Subtype`,value:`/Form`}),t.push({key:`BBox`,value:`[`+[w(e.x),w(e.y),w(e.x+e.width),w(e.y+e.height)].join(` `)+`]`}),t.push({key:`Matrix`,value:`[`+e.matrix.toString()+`]`}),Ye({data:e.pages[1].join(`
|
||||
`),additionalKeyValues:t,objectId:e.objectNumber}),q(`endobj`)},Z=function(e,t){t||=21;var n=Ve(),r=function(e,t){var n,r=[],i=1/(t-1);for(n=0;n<1;n+=i)r.push(n);if(r.push(1),e[0].offset!=0){var a={offset:0,color:e[0].color};e.unshift(a)}if(e[e.length-1].offset!=1){var o={offset:1,color:e[e.length-1].color};e.push(o)}for(var s=``,c=0,l=0;l<r.length;l++){for(n=r[l];n>e[c+1].offset;)c++;var u=e[c].offset,d=(n-u)/(e[c+1].offset-u),f=e[c].color,p=e[c+1].color;s+=H(Math.round((1-d)*f[0]+d*p[0]).toString(16))+H(Math.round((1-d)*f[1]+d*p[1]).toString(16))+H(Math.round((1-d)*f[2]+d*p[2]).toString(16))}return s.trim()}(e.colors,t),i=[];i.push({key:`FunctionType`,value:`0`}),i.push({key:`Domain`,value:`[0.0 1.0]`}),i.push({key:`Size`,value:`[`+t+`]`}),i.push({key:`BitsPerSample`,value:`8`}),i.push({key:`Range`,value:`[0.0 1.0 0.0 1.0 0.0 1.0]`}),i.push({key:`Decode`,value:`[0.0 1.0 0.0 1.0 0.0 1.0]`}),Ye({data:r,additionalKeyValues:i,alreadyAppliedFilters:[`/ASCIIHexDecode`],objectId:n}),q(`endobj`),e.objectNumber=Ve(),q(`<< /ShadingType `+e.type),q(`/ColorSpace /DeviceRGB`);var a=`/Coords [`+w(parseFloat(e.coords[0]))+` `+w(parseFloat(e.coords[1]))+` `;e.type===2?a+=w(parseFloat(e.coords[2]))+` `+w(parseFloat(e.coords[3])):a+=w(parseFloat(e.coords[2]))+` `+w(parseFloat(e.coords[3]))+` `+w(parseFloat(e.coords[4]))+` `+w(parseFloat(e.coords[5])),q(a+=`]`),e.matrix&&q(`/Matrix [`+e.matrix.toString()+`]`),q(`/Function `+n+` 0 R`),q(`/Extend [true true]`),q(`>>`),q(`endobj`)},et=function(e,t){var n=He(),r=Ve();t.push({resourcesOid:n,objectOid:r}),e.objectNumber=r;var i=[];i.push({key:`Type`,value:`/Pattern`}),i.push({key:`PatternType`,value:`1`}),i.push({key:`PaintType`,value:`1`}),i.push({key:`TilingType`,value:`1`}),i.push({key:`BBox`,value:`[`+e.boundingBox.map(w).join(` `)+`]`}),i.push({key:`XStep`,value:w(e.xStep)}),i.push({key:`YStep`,value:w(e.yStep)}),i.push({key:`Resources`,value:n+` 0 R`}),e.matrix&&i.push({key:`Matrix`,value:`[`+e.matrix.toString()+`]`}),Ye({data:e.stream,additionalKeyValues:i,objectId:e.objectNumber}),q(`endobj`)},tt=function(e){for(var t in e.objectNumber=Ve(),q(`<<`),e)switch(t){case`opacity`:q(`/ca `+D(e[t]));break;case`stroke-opacity`:q(`/CA `+D(e[t]))}q(`>>`),q(`endobj`)},nt=function(e){Ue(e.resourcesOid,!0),q(`<<`),q(`/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]`),function(){for(var e in q(`/Font <<`),Se)Se.hasOwnProperty(e)&&(!1===d||!0===d&&f.hasOwnProperty(e))&&q(`/`+e+` `+Se[e].objectNumber+` 0 R`);q(`>>`)}(),function(){if(Object.keys(Te).length>0){for(var e in q(`/Shading <<`),Te)Te.hasOwnProperty(e)&&Te[e]instanceof yf&&Te[e].objectNumber>=0&&q(`/`+e+` `+Te[e].objectNumber+` 0 R`);Me.publish(`putShadingPatternDict`),q(`>>`)}}(),function(e){if(Object.keys(Te).length>0){for(var t in q(`/Pattern <<`),Te)Te.hasOwnProperty(t)&&Te[t]instanceof p.TilingPattern&&Te[t].objectNumber>=0&&Te[t].objectNumber<e&&q(`/`+t+` `+Te[t].objectNumber+` 0 R`);Me.publish(`putTilingPatternDict`),q(`>>`)}}(e.objectOid),function(){if(Object.keys(De).length>0){for(var e in q(`/ExtGState <<`),De)De.hasOwnProperty(e)&&De[e].objectNumber>=0&&q(`/`+e+` `+De[e].objectNumber+` 0 R`);Me.publish(`putGStateDict`),q(`>>`)}}(),function(){for(var e in q(`/XObject <<`),Pe)Pe.hasOwnProperty(e)&&Pe[e].objectNumber>=0&&q(`/`+e+` `+Pe[e].objectNumber+` 0 R`);Me.publish(`putXobjectDict`),q(`>>`)}(),q(`>>`),q(`endobj`)},rt=function(e){Ce[e.fontName]=Ce[e.fontName]||{},Ce[e.fontName][e.fontStyle]=e.id},it=function(e,t,n,r,i){var a={id:`F`+(Object.keys(Se).length+1).toString(10),postScriptName:e,fontName:t,fontStyle:n,encoding:r,isStandardFont:i||!1,metadata:{}};return Me.publish(`addFont`,{font:a,instance:this}),Se[a.id]=a,rt(a),a.id},at=p.__private__.pdfEscape=p.pdfEscape=function(e,t){return function(e,t){var n,r,i,a,o,s,c,l,u;if(i=(t||={}).sourceEncoding||`Unicode`,o=t.outputEncoding,(t.autoencode||o)&&Se[_e].metadata&&Se[_e].metadata[i]&&Se[_e].metadata[i].encoding&&(a=Se[_e].metadata[i].encoding,!o&&Se[_e].encoding&&(o=Se[_e].encoding),!o&&a.codePages&&(o=a.codePages[0]),typeof o==`string`&&(o=a[o]),o)){for(c=!1,s=[],n=0,r=e.length;n<r;n++)(l=o[e.charCodeAt(n)])?s.push(String.fromCharCode(l)):s.push(e[n]),s[n].charCodeAt(0)>>8&&(c=!0);e=s.join(``)}for(n=e.length;c===void 0&&n!==0;)e.charCodeAt(n-1)>>8&&(c=!0),n--;if(!c)return e;for(s=t.noBOM?[]:[254,255],n=0,r=e.length;n<r;n++){if((u=(l=e.charCodeAt(n))>>8)>>8)throw Error(`Character at position `+n+` of string '`+e+`' exceeds 16bits. Cannot be encoded into UCS-2 BE`);s.push(u),s.push(l-(u<<8))}return String.fromCharCode.apply(void 0,s)}(e,t).replace(/\\/g,`\\\\`).replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)},ot=p.__private__.beginPage=function(e){K[++Ae]=[],je[Ae]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(e[0]),topRightY:Number(e[1])}},lt(Ae),ie(K[B])},st=function(e,t){var r,a,o;switch(n=t||n,typeof e==`string`&&(r=_(e.toLowerCase()),Array.isArray(r)&&(a=r[0],o=r[1])Line truncated
|
||||
`)},vt=p.__private__.getBlob=function(e){return new Blob([oe(e)],{type:`application/pdf`})},yt=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},bt=function(e){var t,n=e.document,r=n.documentElement,i=n.head,a=n.body;return i||(i=n.createElement(`head`),r.appendChild(i)),a||(a=n.createElement(`body`),r.appendChild(a)),yt(i),yt(a),(t=n.createElement(`style`)).appendChild(n.createTextNode(`html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}`)),i.appendChild(t),{document:n,body:a}},xt=p.output=p.__private__.output=(Y=function(e,t){switch(typeof(t||={})==`string`?t={filename:t}:t.filename=t.filename||`generated.pdf`,e){case void 0:return _t();case`save`:p.save(t.filename);break;case`arraybuffer`:return oe(_t());case`blob`:return vt(_t());case`bloburi`:case`bloburl`:if(Vd.URL!==void 0&&typeof Vd.URL.createObjectURL==`function`)return Vd.URL&&Vd.URL.createObjectURL(vt(_t()))||void 0;Ud.warn(`bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.`);break;case`datauristring`:case`dataurlstring`:var n=``,r=_t();try{n=Xd(r)}catch{n=Xd(unescape(encodeURIComponent(r)))}return`data:application/pdf;filename=`+encodeURIComponent(t.filename)+`;base64,`+n;case`pdfobjectnewwindow`:if(Object.prototype.toString.call(Vd)===`[object Window]`){var i=`https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js`,a=!t.pdfObjectUrl;a||(i=t.pdfObjectUrl);var o=Vd.open();if(o!==null){var s=bt(o),c=s.document.createElement(`script`),l=this;c.src=i,a&&(c.integrity=`sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==`,c.crossOrigin=`anonymous`),c.onload=function(){o.PDFObject.embed(l.output(`dataurlstring`),t)},s.body.appendChild(c)}return o}throw Error(`The option pdfobjectnewwindow just works in a browser-environment.`);case`pdfjsnewwindow`:if(Object.prototype.toString.call(Vd)===`[object Window]`){var u=t.pdfJsUrl||`examples/PDF.js/web/viewer.html`,d=Vd.open();if(d!==null){var f=bt(d),m=f.document.createElement(`iframe`),h=u.indexOf(`?`)===-1?`?`:`&`;l=this,m.id=`pdfViewer`,m.width=`500px`,m.height=`400px`,m.src=u+h+`file=&downloadName=`+encodeURIComponent(t.filename),m.onload=function(){d.document.title=t.filename,m.contentWindow.PDFViewerApplication.open(l.output(`bloburl`))},f.body.appendChild(m)}return d}throw Error(`The option pdfjsnewwindow just works in a browser-environment.`);case`dataurlnewwindow`:if(Object.prototype.toString.call(Vd)!==`[object Window]`)throw Error(`The option dataurlnewwindow just works in a browser-environment.`);var g=Vd.open();if(g!==null){var _=bt(g),v=_.document.createElement(`iframe`);v.src=this.output(`datauristring`,t),_.body.appendChild(v),g.document.title=t.filename}if(g||typeof safari>`u`)return g;break;case`datauri`:case`dataurl`:return Vd.document.location.href=this.output(`datauristring`,t);default:return null}},Y.foo=function(){try{return Y.apply(this,arguments)}catch(n){var e=n.stack||``;~e.indexOf(` at `)&&(e=e.split(` at `)[1]);var t=`Error in function `+e.split(`
|
||||
`)[0].split(`<`)[0]+`: `+n.message;if(!Vd.console)throw Error(t);Vd.console.error(t,n),Vd.alert&&alert(t)}},Y.foo.bar=Y,Y.foo),St=function(e){return!0===Array.isArray(Ne)&&Ne.indexOf(e)>-1};switch(r){case`pt`:ve=1;break;case`mm`:ve=72/25.4;break;case`cm`:ve=72/2.54;break;case`in`:ve=72;break;case`px`:ve=St(`px_scaling`)==1?.75:96/72;break;case`pc`:case`em`:ve=12;break;case`ex`:ve=6;break;default:if(typeof r!=`number`)throw Error(`Invalid unit: `+r);ve=r}var Q=null;R(),P();var Ct=p.__private__.getPageInfo=p.getPageInfo=function(e){if(isNaN(e)||e%1!=0)throw Error(`Invalid argument passed to jsPDF.getPageInfo`);return{objId:je[e].objId,pageNumber:e,pageContext:je[e]}},wt=p.__private__.getPageInfoByObjId=function(e){if(isNaN(e)||e%1!=0)throw Error(`Invalid argument passed to jsPDF.getPageInfoByObjId`);for(var t in je)if(je[t].objId===e)break;return Ct(t)},Tt=p.__private__.getCurrentPageInfo=p.getCurrentPageInfo=function(){return{objId:je[B].objId,pageNumber:B,pageContext:je[B]}};p.addPage=function(){return st.apply(this,arguments),this},p.setPage=function(){return lt.apply(this,arguments),ie.call(this,K[B]),this},p.insertPage=function(e){return this.addPage(),this.movePage(B,e),this},p.movePage=function(e,t){var n,r;if(e>t){n=K[e],r=je[e];for(var i=e;i>t;i--)K[i]=K[i-1],je[i]=je[i-1];K[t]=n,je[t]=r,this.setPage(t)}else if(e<t){n=K[e],r=je[e];for(var a=e;a<t;a++)K[a]=K[a+1],je[a]=je[a+1];K[t]=n,je[t]=r,this.setPage(t)}return this},p.deletePage=function(){return ct.apply(this,arguments),this},p.__private__.text=p.text=function(e,t,n,r,i){var a,o,s,c,l,u,d,p,m,h=(r||={}).scope||this;if(typeof e==`number`&&typeof t==`number`&&(typeof n==`string`||Array.isArray(n))){var g=n;n=t,t=e,e=g}if(arguments[3]instanceof Le==0?(s=arguments[4],c=arguments[5],ta(d=arguments[3])===`object`&&d!==null||(typeof s==`string`&&(c=s,s=null),typeof d==`string`&&(c=d,d=null),typeof d==`number`&&(s=d,d=null),r={flags:d,angle:s,align:c})):(T(`The transform parameter of text() with a Matrix value`),m=i),isNaN(t)||isNaN(n)||e==null)throw Error(`Invalid arguments passed to jsPDF.text`);if(e.length===0)return h;var _,v=``,x=typeof r.lineHeightFactor==`number`?r.lineHeightFactor:zt,S=h.internal.scaleFactor;function C(e){return e=e.split(` `).join(Array(r.TabLen||9).join(` `)),at(e,d)}function E(e){for(var t,n=e.concat(),r=[],i=n.length;i--;)typeof(t=n.shift())==`string`?r.push(t):Array.isArray(e)&&(t.length===1||t[1]===void 0&&t[2]===void 0)?r.push(t[0]):r.push([t[0],t[1],t[2]]);return r}function D(e,t){var n;if(typeof e==`string`)n=t(e)[0];else if(Array.isArray(e)){for(var r,i,a=e.concat(),o=[],s=a.length;s--;)typeof(r=a.shift())==`string`?o.push(t(r)[0]):Array.isArray(r)&&typeof r[0]==`string`&&(i=t(r[0],r[1],r[2]),o.push([i[0],i[1],i[2]]));n=o}return n}var O=!1,A=!0;if(typeof e==`string`)O=!0;else if(Array.isArray(e)){var j=e.concat();o=[];for(var M,N=j.length;N--;)(typeof(M=j.shift())!=`string`||Array.isArray(M)&&typeof M[0]!=`string`)&&(A=!1);O=A}if(!1===O)throw Error(`Type of text must be string or Array. "`+e+`" is not recognized.`);typeof e==`string`&&(e=e.match(/[\r?\n]/)?e.split(/\r\n|\r|\n/g):[e]);var P=ce/h.internal.scaleFactor,F=P*(x-1);switch(r.baseline){case`bottom`:n-=F;break;case`top`:n+=P-F;break;case`hanging`:n+=P-2*F;break;case`middle`:n+=P/2-F}if((u=r.maxWidth||0)>0&&(typeof e==`string`?e=h.splitTextToSize(e,u):Object.prototype.toString.call(e)===`[object Array]`&&(e=e.reduce(function(e,t){return e.concat(h.splitTextToSize(t,u))},[]))),a={text:e,x:t,y:n,options:r,mutex:{pdfEscape:at,activeFontKey:_e,fonts:Se,activeFontSize:ce}},Me.publish(`preProcessText`,a),e=a.text,s=(r=a.options).angle,m instanceof Le==0&&s&&typeof s==`number`){s*=Math.PI/180,r.rotationDirection===0&&(s=-s),b===y&&(s=-s);var I=Math.cos(s),R=Math.sin(s);m=new Le(I,R,-R,I,0,0)}else s&&s instanceof Le&&(m=s);b!==y||m||(m=ze),(l=r.charSpace||en)!==void 0&&(v+=w(k(l))+` Tc
|
||||
`,this.setCharSpace(this.getCharSpace()||0)),(p=r.horizontalScale)!==void 0&&(v+=w(100*p)+` Tz
|
||||
`),r.lang;var z=-1,B=r.renderingMode===void 0?r.stroke:r.renderingMode,V=h.internal.getCurrentPageInfo().pageContext;switch(B){case 0:case!1:case`fill`:z=0;break;case 1:case!0:case`stroke`:z=1;break;case 2:case`fillThenStroke`:z=2;break;case 3:case`invisible`:z=3;break;case 4:case`fillAndAddForClipping`:z=4;break;case 5:case`strokeAndAddPathForClipping`:z=5;break;case 6:case`fillThenStrokeAndAddToPathForClipping`:z=6;break;case 7:case`addToPathForClipping`:z=7}var H=V.usedRenderingMode===void 0?-1:V.usedRenderingMode;z===-1?H!==-1&&(v+=`0 Tr
|
||||
`):v+=z+` Tr
|
||||
`,z!==-1&&(V.usedRenderingMode=z),c=r.align||`left`;var U,ee=ce*x,W=h.internal.pageSize.getWidth(),G=Se[_e];l=r.charSpace||en,u=r.maxWidth||0,d=Object.assign({autoencode:!0,noBOM:!0},r.flags);var te=[],K=function(e){return h.getStringUnitWidth(e,{font:G,charSpace:l,fontSize:ce,doKerning:!1})*ce/S};if(Object.prototype.toString.call(e)===`[object Array]`){var ne;o=E(e),c!==`left`&&(U=o.map(K));var re,ie=0;if(c===`right`){t-=U[0],e=[],N=o.length;for(var ae=0;ae<N;ae++)ae===0?(re=Kt(t),ne=qt(n)):(re=k(ie-U[ae]),ne=-ee),e.push([o[ae],re,ne]),ie=U[ae]}else if(c===`center`){t-=U[0]/2,e=[],N=o.length;for(var oe=0;oe<N;oe++)oe===0?(re=Kt(t),ne=qt(n)):(re=k((ie-U[oe])/2),ne=-ee),e.push([o[oe],re,ne]),ie=U[oe]}else if(c===`left`){e=[],N=o.length;for(var se=0;se<N;se++)e.push(o[se])}else if(c===`justify`&&G.encoding===`Identity-H`){e=[],N=o.length,u=u===0?W:u;for(var le=0,J=0;J<N;J++)if(ne=J===0?qt(n):-ee,re=J===0?Kt(t):le,J<N-1){var de=k((u-U[J])/(o[J].split(` `).length-1)),fe=o[J].split(` `);e.push([fe[0]+` `,re,ne]),le=0;for(var pe=1;pe<fe.length;pe++){var me=(K(fe[pe-1]+` `+fe[pe])-K(fe[pe]))*S+de;pe==fe.length-1?e.push([fe[pe],me,0]):e.push([fe[pe]+` `,me,0]),le-=me}}else e.push([o[J],re,ne]);e.push([``,le,0])}else{if(c!==`justify`)throw Error(`Unrecognized alignment option, use "left", "center", "right" or "justify".`);for(e=[],N=o.length,u=u===0?W:u,J=0;J<N;J++){ne=J===0?qt(n):-ee,re=J===0?Kt(t):0;var he=o[J].split(` `).length-1,ge=he>0?(u-U[J])/he:0;J<N-1?te.push(w(k(ge))):te.push(0),e.push([o[J],re,ne])}}}!0===(typeof r.R2L==`boolean`?r.R2L:ue)&&(e=D(e,function(e,t,n){return[e.split(``).reverse().join(``),t,n]})),a={text:e,x:t,y:n,options:r,mutex:{pdfEscape:at,activeFontKey:_e,fonts:Se,activeFontSize:ce}},Me.publish(`postProcessText`,a),e=a.text,_=a.mutex.isHex||!1;var ve=Se[_e].encoding;ve!==`WinAnsiEncoding`&&ve!==`StandardEncoding`||(e=D(e,function(e,t,n){return[C(e),t,n]})),o=E(e),e=[];for(var ye,be,xe,Ce=+!!Array.isArray(o[0]),we=``,Te=function(e,t,n){var i=``;return n instanceof Le?(n=typeof r.angle==`number`?Re(n,new Le(1,0,0,1,e,t)):Re(new Le(1,0,0,1,e,t),n),b===y&&(n=Re(new Le(1,0,0,-1,0,0),n)),i=n.join(` `)+` Tm
|
||||
`):i=w(e)+` `+w(t)+` Td
|
||||
`,i},Ee=0;Ee<o.length;Ee++){switch(we=``,Ce){case 1:xe=(_?`<`:`(`)+o[Ee][0]+(_?`>`:`)`),ye=parseFloat(o[Ee][1]),be=parseFloat(o[Ee][2]);break;case 0:xe=(_?`<`:`(`)+o[Ee]+(_?`>`:`)`),ye=Kt(t),be=qt(n)}te!==void 0&&te[Ee]!==void 0&&(we=te[Ee]+` Tw
|
||||
`),Ee===0?e.push(we+Te(ye,be,m)+xe):Ce===0?e.push(we+xe):Ce===1&&e.push(we+Te(ye,be,m)+xe)}e=Ce===0?e.join(` Tj
|
||||
T* `):e.join(` Tj
|
||||
`),e+=` Tj
|
||||
`;var De=`BT
|
||||
/`;return De+=_e+` `+ce+` Tf
|
||||
`,De+=w(ce*x)+` TL
|
||||
`,De+=Qt+`
|
||||
`,De+=v,De+=e,q(De+=`ET`),f[_e]=!0,h};var Et=p.__private__.clip=p.clip=function(e){return q(e===`evenodd`?`W*`:`W`),this};p.clipEvenOdd=function(){return Et(`evenodd`)},p.__private__.discardPath=p.discardPath=function(){return q(`n`),this};var Dt=p.__private__.isValidStyle=function(e){var t=!1;return[void 0,null,`S`,`D`,`F`,`DF`,`FD`,`f`,`f*`,`B`,`B*`,`n`].indexOf(e)!==-1&&(t=!0),t};p.__private__.setDefaultPathOperation=p.setDefaultPathOperation=function(e){return Dt(e)&&(l=e),this};var Ot=p.__private__.getStyle=p.getStyle=function(e){var t=l;switch(e){case`D`:case`S`:t=`S`;break;case`F`:t=`f`;break;case`FD`:case`DF`:t=`B`;break;case`f`:case`f*`:case`B`:case`B*`:t=e}return t},kt=p.close=function(){return q(`h`),this};p.stroke=function(){return q(`S`),this},p.fill=function(e){return At(`f`,e),this},p.fillEvenOdd=function(e){return At(`f*`,e),this},p.fillStroke=function(e){return At(`B`,e),this},p.fillStrokeEvenOdd=function(e){return At(`B*`,e),this};var At=function(e,t){ta(t)===`object`?Nt(t,e):q(e)},jt=function(e){e===null||b===y&&e===void 0||(e=Ot(e),q(e))};function Mt(e,t,n,r,i){var a=new bf(t||this.boundingBox,n||this.xStep,r||this.yStep,this.gState,i||this.matrix);return a.stream=this.stream,Be(e+`$$`+ this.cloneIndex+++`$$`,a),a}var Nt=function(e,t){var n=Ee[e.key],r=Te[n];if(r instanceof yf)q(`q`),q(Pt(t)),r.gState&&p.setGState(r.gState),q(e.matrix.toString()+` cm`),q(`/`+n+` sh`),q(`Q`);else if(r instanceof bf){var i=new Le(1,0,0,-1,0,_n());e.matrix&&(i=i.multiply(e.matrix||ze),n=Mt.call(r,e.key,e.boundingBox,e.xStep,e.yStep,i).id),q(`q`),q(`/Pattern cs`),q(`/`+n+` scn`),r.gState&&p.setGState(r.gState),q(t),q(`Q`)}},Pt=function(e){switch(e){case`f`:case`F`:case`n`:return`W n`;case`f*`:return`W* n`;case`B`:case`S`:return`W S`;case`B*`:return`W* S`}},Ft=p.moveTo=function(e,t){return q(w(k(e))+` `+w(A(t))+` m`),this},It=p.lineTo=function(e,t){return q(w(k(e))+` `+w(A(t))+` l`),this},Lt=p.curveTo=function(e,t,n,r,i,a){return q([w(k(e)),w(A(t)),w(k(n)),w(A(r)),w(k(i)),w(A(a)),`c`].join(` `)),this};p.__private__.line=p.line=function(e,t,n,r,i){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||!Dt(i))throw Error(`Invalid arguments passed to jsPDF.line`);return b===v?this.lines([[n-e,r-t]],e,t,[1,1],i||`S`):this.lines([[n-e,r-t]],e,t,[1,1]).stroke()},p.__private__.lines=p.lines=function(e,t,n,r,i,a){var o,s,c,l,u,d,f,p,m,h,g,_;if(typeof e==`number`&&(_=n,n=t,t=e,e=_),r||=[1,1],a||=!1,isNaN(t)||isNaN(n)||!Array.isArray(e)||!Array.isArray(r)||!Dt(i)||typeof a!=`boolean`)throw Error(`Invalid arguments passed to jsPDF.lines`);for(Ft(t,n),o=r[0],s=r[1],l=e.length,h=t,g=n,c=0;c<l;c++)(u=e[c]).length===2?(h=u[0]*o+h,g=u[1]*s+g,It(h,g)):(d=u[0]*o+h,f=u[1]*s+g,p=u[2]*o+h,m=u[3]*s+g,h=u[4]*o+h,g=u[5]*s+g,Lt(d,f,p,m,h,g));return a&&kt(),jt(i),this},p.path=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n.c;switch(n.op){case`m`:Ft(r[0],r[1]);break;case`l`:It(r[0],r[1]);break;case`c`:Lt.apply(this,r);break;case`h`:kt()}}return this},p.__private__.rect=p.rect=function(e,t,n,r,i){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||!Dt(i))throw Error(`Invalid arguments passed to jsPDF.rect`);return b===v&&(r=-r),q([w(k(e)),w(A(t)),w(k(n)),w(k(r)),`re`].join(` `)),jt(i),this},p.__private__.triangle=p.triangle=function(e,t,n,r,i,a,o){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(a)||!Dt(o))throw Error(`Invalid arguments passed to jsPDF.triangle`);return this.lines([[n-e,r-t],[i-n,a-r],[e-i,t-a]],e,t,[1,1],o,!0),this},p.__private__.roundedRect=p.roundedRect=function(e,t,n,r,i,a,o){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(a)||!Dt(o))throw Error(`Invalid arguments passed to jsPDF.roundedRect`);var s=4/3*(Math.SQRT2-1);return i=Math.min(i,.5*n),a=Math.min(a,.5*r),this.lines([[n-2*i,0],[i*s,0,i,a-a*s,i,a],[0,r-2*a],[0,a*s,-i*s,a,-i,a],[2*i-n,0],[-i*s,0,-i,-a*s,-i,-a],[0,2*a-r],[0,-a*s,i*s,-a,i,-a]],e+i,t,[1,1],o,!0),this},p.__private__.ellipse=p.ellipse=function(e,t,n,r,i){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||!Dt(i))throw Error(`Invalid arguments passed to jsPDF.ellipse`);var a=4/3*(Math.SQRT2-1)*n,o=4/3*(Math.SQRT2-1)*r;return Ft(e+n,t),Lt(e+n,t-o,e+a,t-r,e,t-r),Lt(e-a,t-r,e-n,t-o,e-n,t),Lt(e-n,t+o,e-a,t+r,e,t+r),Lt(e+a,t+r,e+n,t+o,e+n,t),jt(i),this},p.__private__.circle=p.circle=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||!Dt(r))throw Error(`Invalid arguments passed to jsPDF.circle`);return this.ellipse(e,t,n,n,r)},p.setFont=function(e,t,n){return n&&(t=C(t,n)),_e=dt(e,t,{disableWarning:!1}),this};var Rt=p.__private__.getFont=p.getFont=function(){return Se[dt.apply(p,arguments)]};p.__private__.getFontList=p.getFontList=function(){var e,t,n={};for(e in Ce)if(Ce.hasOwnProperty(e))for(t in n[e]=[],Ce[e])Ce[e].hasOwnProperty(t)&&n[e].push(t);return n},p.addFont=function(e,t,n,r,i){var a=[`StandardEncoding`,`MacRomanEncoding`,`Identity-H`,`WinAnsiEncoding`];return arguments[3]&&a.indexOf(arguments[3])!==-1?i=arguments[3]:arguments[3]&&a.indexOf(arguments[3])==-1&&(n=C(n,r)),it.call(this,e,t,n,i||=`IdLine truncated
|
||||
`),i}},Bf=function(e,t){var n=e.fontSize===0?e.maxFontSize:e.fontSize,r={text:``,fontSize:``},i=(t=(t=t.substr(0,1)==`(`?t.substr(1):t).substr(t.length-1)==`)`?t.substr(0,t.length-1):t).split(` `);i=e.multiline?i.map(function(e){return e.split(`
|
||||
`)}):i.map(function(e){return[e]});var a=n,o=cp.internal.getHeight(e)||0;o=o<0?-o:o;var s=cp.internal.getWidth(e)||0;s=s<0?-s:s;var c=function(t,n,r){return t+1<i.length?Vf(n+` `+i[t+1][0],e,r).width<=s-4:!1};a++;t:for(;a>0;){t=``,a--;var l,u,d=Vf(`3`,e,a).height,f=e.multiline?o-a:(o-d)/2,p=f+=2,m=0,h=0,g=0;if(a<=0){t=`(...) Tj
|
||||
`,t+=`% Width of Text: `+Vf(t,e,a=12).width+`, FieldWidth:`+s+`
|
||||
`;break}for(var _=``,v=0,y=0;y<i.length;y++)if(i.hasOwnProperty(y)){var b=!1;if(i[y].length!==1&&g!==i[y].length-1){if((d+2)*(v+2)+2>o)continue t;_+=i[y][g],b=!0,h=y,y--}else{_=(_+=i[y][g]+` `).substr(_.length-1)==` `?_.substr(0,_.length-1):_;var x=parseInt(y),S=c(x,_,a),C=y>=i.length-1;if(S&&!C){_+=` `,g=0;continue}if(S||C){if(C)h=x;else if(e.multiline&&(d+2)*(v+2)+2>o)continue t}else{if(!e.multiline||(d+2)*(v+2)+2>o)continue t;h=x}}for(var w=``,T=m;T<=h;T++){var E=i[T];if(e.multiline){if(T===h){w+=E[g]+` `,g=(g+1)%E.length;continue}if(T===m){w+=E[E.length-1]+` `;continue}}w+=E[0]+` `}switch(w=w.substr(w.length-1)==` `?w.substr(0,w.length-1):w,u=Vf(w,e,a).width,e.textAlign){case`right`:l=s-u-2;break;case`center`:l=(s-u)/2;break;default:l=2}t+=Df(l)+` `+Df(p)+` Td
|
||||
`,t+=`(`+wf(w)+`) Tj
|
||||
`,t+=-Df(l)+` 0 Td
|
||||
`,p=-(a+2),u=0,m=b?h:h+1,v++,_=``}break}return r.text=t,r.fontSize=a,r},Vf=function(e,t,n){var r=t.scope.internal.getFont(t.fontName,t.fontStyle),i=t.scope.getStringUnitWidth(e,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:t.scope.getStringUnitWidth(`3`,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},Hf={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},Uf=function(e,t){var n={type:`reference`,object:e};t.internal.getPageInfo(e.page).pageContext.annotations.find(function(e){return e.type===n.type&&e.object===n.object})===void 0&&t.internal.getPageInfo(e.page).pageContext.annotations.push(n)},Wf=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||!1===e.internal.acroformPlugin.isInitialized)){if(Xf.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(Hf)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw Error(`Exception while creating AcroformDictionary`);Cf=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new Yf,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe(`postPutResources`,function(){(function(e){e.internal.events.unsubscribe(e.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete e.internal.acroformPlugin.acroFormDictionaryRoot._eventID,e.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe(`buildDocument`,function(){(function(e){e.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=e.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];r.objId=void 0,r.hasAnnotation&&Uf(r,e)}})(e)}),e.internal.events.subscribe(`putCatalog`,function(){(function(e){if(e.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw Error(`putCatalogCallback: Root missing.`);e.internal.write(`/AcroForm `+e.internal.acroformPlugin.acroFormDictionaryRoot.objId+` 0 R`)})(e)}),e.internal.events.subscribe(`postPutPages`,function(t){(function(e,t){var n=!e;for(var r in e||(t.internal.newObjectDeferredBegin(t.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),t.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),e||=t.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(e.hasOwnProperty(r)){var i=e[r],a=[],o=i.Rect;if(i.Rect&&=Rf(i.Rect,t),t.internal.newObjectDeferredBegin(i.objId,!0),i.DA=cp.createDefaultAppearanceStream(i),ta(i)===`object`&&typeof i.getKeyValueListForStream==`function`&&(a=i.getKeyValueListForStream()),i.Rect=o,i.hasAppearanceStream&&!i.appearanceStreamContent){var s=zf(i);a.push({key:`AP`,value:`<</N `+s+`>>`}),t.internal.acroformPlugin.xForms.push(s)}if(i.appearanceStreamContent){var c=``;for(var l in i.appearanceStreamContent)if(i.appearanceStreamContent.hasOwnProperty(l)){var u=i.appearanceStreamContent[l];if(c+=`/`+l+` `,c+=`<<`,Object.keys(u).length>=1||Array.isArray(u)){for(var r in u)if(u.hasOwnProperty(r)){var d=u[r];typeof d==`function`&&(d=d.call(t,i)),c+=`/`+r+` `+d+` `,t.internal.acroformPlugin.xForms.indexOf(d)>=0||t.internal.acroformPlugin.xForms.push(d)}}else typeof(d=u)==`function`&&(d=d.call(t,i)),c+=`/`+r+` `+d,t.internal.acroformPlugin.xForms.indexOf(d)>=0||t.internal.acroformPlugin.xForms.push(d);c+=`>>`}a.push({key:`AP`,value:`<<
|
||||
`+c+`>>`})}t.internal.putStream({additionalKeyValues:a,objectId:i.objId}),t.internal.out(`endobj`)}n&&function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=n,i=e[n];t.internal.newObjectDeferredBegin(i.objId,!0),ta(i)===`object`&&typeof i.putStream==`function`&&i.putStream(),delete e[r]}}(t.internal.acroformPlugin.xForms,t)})(t,e)}),e.internal.acroformPlugin.isInitialized=!0}},Gf=Sf.__acroform__.arrayToPdfArray=function(e,t,n){var r=function(e){return e};if(Array.isArray(e)){for(var i=`[`,a=0;a<e.length;a++)switch(a!==0&&(i+=` `),ta(e[a])){case`boolean`:case`number`:case`object`:i+=e[a].toString();break;case`string`:e[a].substr(0,1)===`/`?i+=`/`+Ef(e[a].substr(1)):(t!==void 0&&n&&(r=n.internal.getEncryptor(t)),i+=`(`+wf(r(e[a].toString()))+`)`)}return i+`]`}throw Error(`Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray`)},Kf=function(e,t,n){var r=function(e){return e};return t!==void 0&&n&&(r=n.internal.getEncryptor(t)),(e||=``).toString(),`(`+wf(r(e))+`)`},qf=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};qf.prototype.toString=function(){return this.objId+` 0 R`},qf.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out(`endobj`)},qf.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(e){return e!=`content`&&e!=`appearanceStreamContent`&&e!=`scope`&&e!=`objId`&&e.substring(0,1)!=`_`});for(var n in t)if(!1===Object.getOwnPropertyDescriptor(this,t[n]).configurable){var r=t[n],i=this[r];i&&(Array.isArray(i)?e.push({key:r,value:Gf(i,this.objId,this.scope)}):i instanceof qf?(i.scope=this.scope,e.push({key:r,value:i.objId+` 0 R`})):typeof i!=`function`&&e.push({key:r,value:i}))}return e};var Jf=function(){qf.call(this),Object.defineProperty(this,"Type",{value:`/XObject`,configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:`/Form`,configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"Resources",{value:`2 0 R`,configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){e=t.trim()},get:function(){return e||null}})};kf(Jf,qf);var Yf=function(){qf.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),`(`+wf(t(e))+`)`}},set:function(t){e=t}})};kf(Yf,qf);var Xf=function e(){qf.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){if(isNaN(e))throw Error(`Invalid value "`+e+`" for attribute F supplied.`);t=e}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Ff(t,3)},set:function(e){!!e==1?this.F=If(t,3):this.F=Lf(t,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(e){if(isNaN(e))throw Error(`Invalid value "`+e+`" for attribute Ff supplied.`);n=e}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(e){r=e===void 0?[]:e}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(e){r[0]=e}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(e){r[1]=e}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(e){r[2]=e}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(e){r[3]=e}});var i=``;Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(e){switch(e){case`/Btn`:case`/Tx`:case`/Ch`:case`/Sig`:i=e;break;default:throw Error(`Invalid value "`+e+`" for attribute FT supplied.`)}}});var a=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof ip)return;a=`FieldObject`+ e.FieldNum++}var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),`(`+wf(t(a))+`)`},set:functio
Line truncated
|
||||
`)}},set:function(e){ta(e)===`object`&&(t=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||``},set:function(e){typeof e==`string`&&(t.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){var n=t==null?``:t.toString();n.substr(0,1)===`/`&&(n=n.substr(1)),e=`/`+Ef(n)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e=`/`+Ef(t)}})};kf(tp,Xf);var np=function(){tp.call(this),this.pushButton=!0};kf(np,tp);var rp=function(){tp.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t===void 0?[]:t}})};kf(rp,tp);var ip=function(){var e,t;Xf.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(e){t=e}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var e=function(e){return e};this.scope&&(e=this.scope.internal.getEncryptor(this.objId));var t,n=[];for(t in n.push(`<<`),r)n.push(`/`+t+` (`+wf(e(r[t]))+`)`);return n.push(`>>`),n.join(`
|
||||
`)},set:function(e){ta(e)===`object`&&(r=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||``},set:function(e){typeof e==`string`&&(r.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(e){var t=e==null?``:e.toString();t.substr(0,1)===`/`&&(t=t.substr(1)),n=`/`+Ef(t)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(e){var t=e==null?``:e.toString();t.substr(0,1)===`/`&&(t=t.substr(1)),n=`/`+Ef(t)}}),this.caption=`l`,this.appearanceState=`Off`,this._AppearanceType=cp.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};kf(ip,Xf),rp.prototype.setAppearance=function(e){if(!(`createAppearanceStream`in e)||!(`getCA`in e))throw Error(`Couldn't assign Appearance to RadioButton. Appearance was Invalid!`);for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var n=this.Kids[t];n.appearanceStreamContent=e.createAppearanceStream(n.optionName),n.caption=e.getCA()}},rp.prototype.createOption=function(e){var t=new ip;return t.Parent=this,t.optionName=e,this.Kids.push(t),lp.call(this.scope,t),t};var ap=function(){tp.call(this),this.fontName=`zapfdingbats`,this.caption=`3`,this.appearanceState=`On`,this.value=`On`,this.textAlign=`center`,this.appearanceStreamContent=cp.CheckBox.createAppearanceStream()};kf(ap,tp);var op=function(){Xf.call(this),this.FT=`/Tx`,Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Ff(this.Ff,13)},set:function(e){!!e==1?this.Ff=If(this.Ff,13):this.Ff=Lf(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ff(this.Ff,21)},set:function(e){!!e==1?this.Ff=If(this.Ff,21):this.Ff=Lf(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ff(this.Ff,23)},set:function(e){!!e==1?this.Ff=If(this.Ff,23):this.Ff=Lf(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Ff(this.Ff,24)},set:function(e){!!e==1?this.Ff=If(this.Ff,24):this.Ff=Lf(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Ff(this.Ff,25)},set:function(e){!!e==1?this.Ff=If(this.Ff,25):this.Ff=Lf(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Ff(this.Ff,26)},set:function(e){!!e==1?this.Ff=If(this.Ff,26):this.Ff=Lf(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};kf(op,Xf);var sp=function(){op.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Ff(this.Ff,14)},set:function(e){!!e==1?this.Ff=If(this.Ff,14):this.Ff=Lf(this.Ff,14)}}),this.password=!0};kf(sp,op);var cp={CheckBox:{createAppearanceStream:function(){return{N:{On:cp.CheckBox.YesNormal},D:{On:cp.CheckBox.YesPushDown,Off:cp.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=jf(e);t.scope=e.scope;var n=[],r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,i=e.scope.__private__.encodeColorString(e.color),a=Bf(e,e.caption);return n.push(`0.749023 g`),n.push(`0 0 `+Df(cp.internal.getWidth(e))+` `+Df(cp.internal.getHeight(e))+` re`),n.push(`f`),n.push(`BMC`),n.push(`q`),n.push(`0 0 1 rg`),n.push(`/`+r+` `+Df(a.fontSize)+` Tf `+i),n.push(`BT`),n.push(a.text),n.push(`ET`),n.push(`Q`),n.push(`EMC`),t.stream=n.join(`
|
||||
`),t},YesNormal:function(e){var t=jf(e);t.scope=e.scope;var n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color),i=[],a=cp.internal.getHeight(e),o=cp.internal.getWidth(e),s=Bf(e,e.caption);return i.push(`1 g`),i.push(`0 0 `+Df(o)+` `+Df(a)+` re`),i.push(`f`),i.push(`q`),i.push(`0 0 1 rg`),i.push(`0 0 `+Df(o-1)+` `+Df(a-1)+` re`),i.push(`W`),i.push(`n`),i.push(`0 g`),i.push(`BT`),i.push(`/`+n+` `+Df(s.fontSize)+` Tf `+r),i.push(s.text),i.push(`ET`),i.push(`Q`),t.stream=i.join(`
|
||||
`),t},OffPushDown:function(e){var t=jf(e);t.scope=e.scope;var n=[];return n.push(`0.749023 g`),n.push(`0 0 `+Df(cp.internal.getWidth(e))+` `+Df(cp.internal.getHeight(e))+` re`),n.push(`f`),t.stream=n.join(`
|
||||
`),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:cp.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=cp.RadioButton.Circle.YesNormal,t.D[e]=cp.RadioButton.Circle.YesPushDown,t},getCA:function(){return`l`},YesNormal:function(e){var t=jf(e);t.scope=e.scope;var n=[],r=cp.internal.getWidth(e)<=cp.internal.getHeight(e)?cp.internal.getWidth(e)/4:cp.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=cp.internal.Bezier_C,a=Number((r*i).toFixed(5));return n.push(`q`),n.push(`1 0 0 1 `+Of(cp.internal.getWidth(e)/2)+` `+Of(cp.internal.getHeight(e)/2)+` cm`),n.push(r+` 0 m`),n.push(r+` `+a+` `+a+` `+r+` 0 `+r+` c`),n.push(`-`+a+` `+r+` -`+r+` `+a+` -`+r+` 0 c`),n.push(`-`+r+` -`+a+` -`+a+` -`+r+` 0 -`+r+` c`),n.push(a+` -`+r+` `+r+` -`+a+` `+r+` 0 c`),n.push(`f`),n.push(`Q`),t.stream=n.join(`
|
||||
`),t},YesPushDown:function(e){var t=jf(e);t.scope=e.scope;var n=[],r=cp.internal.getWidth(e)<=cp.internal.getHeight(e)?cp.internal.getWidth(e)/4:cp.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),a=Number((i*cp.internal.Bezier_C).toFixed(5)),o=Number((r*cp.internal.Bezier_C).toFixed(5));return n.push(`0.749023 g`),n.push(`q`),n.push(`1 0 0 1 `+Of(cp.internal.getWidth(e)/2)+` `+Of(cp.internal.getHeight(e)/2)+` cm`),n.push(i+` 0 m`),n.push(i+` `+a+` `+a+` `+i+` 0 `+i+` c`),n.push(`-`+a+` `+i+` -`+i+` `+a+` -`+i+` 0 c`),n.push(`-`+i+` -`+a+` -`+a+` -`+i+` 0 -`+i+` c`),n.push(a+` -`+i+` `+i+` -`+a+` `+i+` 0 c`),n.push(`f`),n.push(`Q`),n.push(`0 g`),n.push(`q`),n.push(`1 0 0 1 `+Of(cp.internal.getWidth(e)/2)+` `+Of(cp.internal.getHeight(e)/2)+` cm`),n.push(r+` 0 m`),n.push(r+` `+o+` `+o+` `+r+` 0 `+r+` c`),n.push(`-`+o+` `+r+` -`+r+` `+o+` -`+r+` 0 c`),n.push(`-`+r+` -`+o+` -`+o+` -`+r+` 0 -`+r+` c`),n.push(o+` -`+r+` `+r+` -`+o+` `+r+` 0 c`),n.push(`f`),n.push(`Q`),t.stream=n.join(`
|
||||
`),t},OffPushDown:function(e){var t=jf(e);t.scope=e.scope;var n=[],r=cp.internal.getWidth(e)<=cp.internal.getHeight(e)?cp.internal.getWidth(e)/4:cp.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),a=Number((i*cp.internal.Bezier_C).toFixed(5));return n.push(`0.749023 g`),n.push(`q`),n.push(`1 0 0 1 `+Of(cp.internal.getWidth(e)/2)+` `+Of(cp.internal.getHeight(e)/2)+` cm`),n.push(i+` 0 m`),n.push(i+` `+a+` `+a+` `+i+` 0 `+i+` c`),n.push(`-`+a+` `+i+` -`+i+` `+a+` -`+i+` 0 c`),n.push(`-`+i+` -`+a+` -`+a+` -`+i+` 0 -`+i+` c`),n.push(a+` -`+i+` `+i+` -`+a+` `+i+` 0 c`),n.push(`f`),n.push(`Q`),t.stream=n.join(`
|
||||
`),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:cp.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=cp.RadioButton.Cross.YesNormal,t.D[e]=cp.RadioButton.Cross.YesPushDown,t},getCA:function(){return`8`},YesNormal:function(e){var t=jf(e);t.scope=e.scope;var n=[],r=cp.internal.calculateCross(e);return n.push(`q`),n.push(`1 1 `+Df(cp.internal.getWidth(e)-2)+` `+Df(cp.internal.getHeight(e)-2)+` re`),n.push(`W`),n.push(`n`),n.push(Df(r.x1.x)+` `+Df(r.x1.y)+` m`),n.push(Df(r.x2.x)+` `+Df(r.x2.y)+` l`),n.push(Df(r.x4.x)+` `+Df(r.x4.y)+` m`),n.push(Df(r.x3.x)+` `+Df(r.x3.y)+` l`),n.push(`s`),n.push(`Q`),t.stream=n.join(`
|
||||
`),t},YesPushDown:function(e){var t=jf(e);t.scope=e.scope;var n=cp.internal.calculateCross(e),r=[];return r.push(`0.749023 g`),r.push(`0 0 `+Df(cp.internal.getWidth(e))+` `+Df(cp.internal.getHeight(e))+` re`),r.push(`f`),r.push(`q`),r.push(`1 1 `+Df(cp.internal.getWidth(e)-2)+` `+Df(cp.internal.getHeight(e)-2)+` re`),r.push(`W`),r.push(`n`),r.push(Df(n.x1.x)+` `+Df(n.x1.y)+` m`),r.push(Df(n.x2.x)+` `+Df(n.x2.y)+` l`),r.push(Df(n.x4.x)+` `+Df(n.x4.y)+` m`),r.push(Df(n.x3.x)+` `+Df(n.x3.y)+` l`),r.push(`s`),r.push(`Q`),t.stream=r.join(`
|
||||
`),t},OffPushDown:function(e){var t=jf(e);t.scope=e.scope;var n=[];return n.push(`0.749023 g`),n.push(`0 0 `+Df(cp.internal.getWidth(e))+` `+Df(cp.internal.getHeight(e))+` re`),n.push(`f`),t.stream=n.join(`
|
||||
`),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color);return`/`+t+` `+e.fontSize+` Tf `+n}};cp.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=cp.internal.getWidth(e),n=cp.internal.getHeight(e),r=Math.min(t,n);return{x1:{x:(t-r)/2,y:(n-r)/2+r},x2:{x:(t-r)/2+r,y:(n-r)/2},x3:{x:(t-r)/2,y:(n-r)/2},x4:{x:(t-r)/2+r,y:(n-r)/2+r}}}},cp.internal.getWidth=function(e){var t=0;return ta(e)===`object`&&(t=Af(e.Rect[2])),t},cp.internal.getHeight=function(e){var t=0;return ta(e)===`object`&&(t=Af(e.Rect[3])),t};var lp=Sf.addField=function(e){if(Wf(this,e),!(e instanceof Xf))throw Error(`Invalid argument passed to jsPDF.addField.`);var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};Sf.AcroFormChoiceField=Zf,Sf.AcroFormListBox=Qf,Sf.AcroFormComboBox=$f,Sf.AcroFormEditBox=ep,Sf.AcroFormButton=tp,Sf.AcroFormPushButton=np,Sf.AcroFormRadioButton=rp,Sf.AcroFormCheckBox=ap,Sf.AcroFormTextField=op,Sf.AcroFormPasswordField=sp,Sf.AcroFormAppearance=cp,Sf.AcroForm={ChoiceField:Zf,ListBox:Qf,ComboBox:$f,EditBox:ep,Button:tp,PushButton:np,RadioButton:rp,CheckBox:ap,TextField:op,PasswordField:sp,Appearance:cp},xf.AcroForm={ChoiceField:Zf,ListBox:Qf,ComboBox:$f,EditBox:ep,Button:tp,PushButton:np,RadioButton:rp,CheckBox:ap,TextField:op,PasswordField:sp,Appearance:cp},xf.AcroForm;function up(e){return e.reduce(function(e,t,n){return e[t]=n,e},{})}(function(e){var t=`addImage_`;e.__addimage__={};var n=`UNKNOWN`,r={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},i=e.__addimage__.getImageFileTypeByImageData=function(e,t){var i,a,o,s,c,l=n;if((t||=n)===`RGBA`||e.data!==void 0&&e.data instanceof Uint8ClampedArray&&`height`in e&&`width`in e)return`RGBA`;if(S(e))for(c in r)for(o=r[c],i=0;i<o.length;i+=1){for(s=!0,a=0;a<o[i].length;a+=1)if(o[i][a]!==void 0&&o[i][a]!==e[a]){s=!1;break}if(!0===s){l=c;break}}else for(c in r)for(o=r[c],i=0;i<o.length;i+=1){for(s=!0,a=0;a<o[i].length;a+=1)if(o[i][a]!==void 0&&o[i][a]!==e.charCodeAt(a)){s=!1;break}if(!0===s){l=c;break}}return l===n&&t!==n&&(l=t),l},a=function e(t){for(var n=this.internal.write,r=this.internal.putStream,i=(0,this.internal.getFilters)();i.indexOf(`FlateEncode`)!==-1;)i.splice(i.indexOf(`FlateEncode`),1);t.objectId=this.internal.newObject();var a=[];if(a.push({key:`Type`,value:`/XObject`}),a.push({key:`Subtype`,value:`/Image`}),a.push({key:`Width`,value:t.width}),a.push({key:`Height`,value:t.height}),t.colorSpace===_.INDEXED?a.push({key:`ColorSpace`,value:`[/Indexed /DeviceRGB `+(t.palette.length/3-1)+` `+(`sMask`in t&&t.sMask!==void 0?t.objectId+2:t.objectId+1)+` 0 R]`}):(a.push({key:`ColorSpace`,value:`/`+t.colorSpace}),t.colorSpace===_.DEVICE_CMYK&&a.push({key:`Decode`,value:`[1 0 1 0 1 0 1 0]`})),a.push({key:`BitsPerComponent`,value:t.bitsPerComponent}),`decodeParameters`in t&&t.decodeParameters!==void 0&&a.push({key:`DecodeParms`,value:`<<`+t.decodeParameters+`>>`}),`transparency`in t&&Array.isArray(t.transparency)&&t.transparency.length>0){for(var o=``,s=0,c=t.transparency.length;s<c;s++)o+=t.transparency[s]+` `+t.transparency[s]+` `;a.push({key:`Mask`,value:`[`+o+`]`})}t.sMask!==void 0&&a.push({key:`SMask`,value:t.objectId+1+` 0 R`});var l=t.filter===void 0?void 0:[`/`+t.filter];if(r({data:t.data,additionalKeyValues:a,alreadyAppliedFilters:l,objectId:t.objectId}),n(`endobj`),`sMask`in t&&t.sMask!==void 0){var u=t.sMaskBitsPerComponent??t.bitsPerComponent,d={width:t.width,height:t.height,colorSpace:`DeviceGray`,bitsPerComponent:u,data:t.sMask};`filter`in t&&(d.decodeParameters=`/Predictor ${t.predictor} /Colors 1 /BitsPerComponent ${u} /Columns ${t.width}`,d.filter=t.filter),e.call(this,d)}if(t.colorSpace===_.INDEXED){var f=this.internal.newObject();r({data:w(new Uint8Array(t.palette)),objectId:f}),n(`endobj`)}},o=function(){var e=this.internal.collections[t+`images`];for(var n in e)a.call(this,e[n])},s=function(){var e,n=this.internal.collections[t+`images`],r=this.internal.write;for(var i in n)r(`/I`+(e=n[i]).index,e.objectId,`0`,`R`)},c=function(){this.internal.collections[t+`images`]||(this.internal.collections[t+`images`]={},this.internal.events.subscribe(`putResources`,o),this.internal.events.subscribe(`putXobjectDict`,s))},l=function(){var e=this.internal.collections[t+`images`];return c.call(this),e},u=function(){return Object.keys(this.internal.collections[t+`imLine truncated
|
||||
`},e.outline.makeRef=function(e){return e.id+` 0 R`},e.outline.makeString=function(t){return`(`+e.internal.pdfEscape(t)+`)`},e.outline.objStart=function(e){this.ctx.val+=`\r
|
||||
`+e.id+` 0 obj\r
|
||||
<<\r
|
||||
`},e.outline.objEnd=function(){this.ctx.val+=`>> \r
|
||||
endobj\r
|
||||
`},e.outline.count_r=function(e,t){for(var n=0;n<t.children.length;n++)e.count++,this.count_r(e,t.children[n]);return e.count}}])}(xf.API),function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(e,n,r,i,a,o){var s,c=this.decode.DCT_DECODE,l=null;if(typeof e==`string`||this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e)){switch(e=a||e,e=this.__addimage__.isArrayBuffer(e)?new Uint8Array(e):e,s=function(e){for(var n,r=256*e.charCodeAt(4)+e.charCodeAt(5),i=e.length,a={width:0,height:0,numcomponents:1},o=4;o<i;o+=2){if(o+=r,t.indexOf(e.charCodeAt(o+1))!==-1){n=256*e.charCodeAt(o+5)+e.charCodeAt(o+6),a={width:256*e.charCodeAt(o+7)+e.charCodeAt(o+8),height:n,numcomponents:e.charCodeAt(o+9)};break}r=256*e.charCodeAt(o+2)+e.charCodeAt(o+3)}return a}(e=this.__addimage__.isArrayBufferView(e)?this.__addimage__.arrayBufferToBinaryString(e):e),s.numcomponents){case 1:o=this.color_spaces.DEVICE_GRAY;break;case 4:o=this.color_spaces.DEVICE_CMYK;break;case 3:o=this.color_spaces.DEVICE_RGB}l={data:e,width:s.width,height:s.height,colorSpace:o,bitsPerComponent:8,filter:c,index:n,alias:r}}return l}}(xf.API),xf.API.processPNG=function(e,t,n,r){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var i,a=Id(e,{checkCrc:!0}),o=a.width,s=a.height,c=a.channels,l=a.palette,u=a.depth;i=l&&c===1?function(e){for(var t=e.width,n=e.height,r=e.data,i=e.palette,a=e.depth,o=!1,s=[],c=[],l=void 0,u=!1,d=0,f=0;f<i.length;f++){var p=Ka(i[f],4),m=p[0],h=p[1],g=p[2],_=p[3];s.push(m,h,g),_!=null&&(_===0?(d++,c.length<1&&c.push(f)):_<255&&(u=!0))}if(u||d>1){o=!0,c=void 0;var v=t*n;l=new Uint8Array(v);for(var y=new DataView(r.buffer),b=0;b<v;b++){var x=Ka(i[Rp(y,b,a)],4)[3];l[b]=x}}else d===0&&(c=void 0);return{colorSpace:`Indexed`,colorsPerPixel:1,sMaskBitsPerComponent:o?8:void 0,colorBytes:r,alphaBytes:l,needSMask:o,palette:s,mask:c}}(a):c===2||c===4?function(e){for(var t=e.data,n=e.width,r=e.height,i=e.channels,a=e.depth,o=i===2?`DeviceGray`:`DeviceRGB`,s=i-1,c=n*r,l=s,u=c*l,d=1*c,f=Math.ceil(u*a/8),p=Math.ceil(d*a/8),m=new Uint8Array(f),h=new Uint8Array(p),g=new DataView(t.buffer),_=new DataView(m.buffer),v=new DataView(h.buffer),y=!1,b=0;b<c;b++){for(var x=b*i,S=0;S<l;S++)zp(_,Rp(g,x+S,a),b*l+S,a);var C=Rp(g,x+l,a);C<(1<<a)-1&&(y=!0),zp(v,C,1*b,a)}return{colorSpace:o,colorsPerPixel:s,sMaskBitsPerComponent:y?a:void 0,colorBytes:m,alphaBytes:h,needSMask:y}}(a):function(e){var t=e.data,n=e.channels===1?`DeviceGray`:`DeviceRGB`;return{colorSpace:n,colorsPerPixel:n===`DeviceGray`?1:3,colorBytes:t instanceof Uint16Array?function(e){for(var t=e.length,n=new Uint8Array(2*t),r=new DataView(n.buffer,n.byteOffset,n.byteLength),i=0;i<t;i++)r.setUint16(2*i,e[i],!1);return n}(t):t,needSMask:!1}}(a);var d,f,p,m=i,h=m.colorSpace,g=m.colorsPerPixel,_=m.sMaskBitsPerComponent,v=m.colorBytes,y=m.alphaBytes,b=m.needSMask,x=m.palette,S=m.mask,C=null;return r!==xf.API.image_compression.NONE&&typeof za==`function`?(C=function(e){var t;switch(e){case xf.API.image_compression.FAST:t=11;break;case xf.API.image_compression.MEDIUM:t=13;break;case xf.API.image_compression.SLOW:t=14;break;default:t=12}return t}(r),d=this.decode.FLATE_DECODE,f=`/Predictor ${C} /Colors ${g} /BitsPerComponent ${u} /Columns ${o}`,e=Ap(v,Math.ceil(o*g*u/8),g,u,r),b&&(p=Ap(y,Math.ceil(o*_/8),1,_,r))):(d=void 0,f=void 0,e=v,b&&(p=y)),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(p&&this.__addimage__.isArrayBuffer(p)||this.__addimage__.isArrayBufferView(p))&&(p=this.__addimage__.arrayBufferToBinaryString(p)),{alias:n,data:e,index:t,filter:d,decodeParameters:f,transparency:S,palette:x,sMask:p,predictor:C,width:o,height:s,bitsPerComponent:u,sMaskBitsPerComponent:_,colorSpace:h}}},function(e){e.processGIF89A=function(t,n,r,i){var a=new Vp(t),o=a.width,s=a.height,c=[];a.decodeAndBlitFrameRGBA(0,c);var l={data:c,width:o,height:s},u=new Up(100).encode(l,100);return e.processJPEG.call(this,u,n,r,i)},e.processGIF87A=e.processGIF89A}(xf.API),Wp.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15)
Line truncated
|
||||
`:``)+e})):v.push(e[0])}),h=v,c=Ep.apply(this,[_,n])}for(a=0,o=h.length;a<o;a++){var y=0;if(r=h[a],c&&r[0]==`
|
||||
`&&(r=r.substr(1),y=1),f+p+(m=(i=Tp.apply(this,[r,n])).reduce(function(e,t){return e+t},0))>t||y){if(m>t){for(s=Dp.apply(this,[r,i,t-(f+p),t]),u.push(s.shift()),u=[s.pop()];s.length;)d.push([s.shift()]);m=i.slice(r.length-(u[0]?u[0].length:0)).reduce(function(e,t){return e+t},0)}else u=[r];d.push(u),f=m+c,p=g}else u.push(r),f+=p+m,p=g}return l=c?function(e,t){return(t?_:``)+e.join(` `)}:function(e){return e.join(` `)},d.map(l)},wp.splitTextToSize=function(e,t,n){var r,i=(n||={}).fontSize||this.internal.getFontSize(),a=function(e){if(e.widths&&e.kerning)return{widths:e.widths,kerning:e.kerning};var t=this.internal.getFont(e.fontName,e.fontStyle),n=`Unicode`;return t.metadata[n]?{widths:t.metadata[n].widths||{0:1},kerning:t.metadata[n].kerning||{}}:{font:t.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,n);r=Array.isArray(e)?e:String(e).split(/\r?\n/);var o=1*this.internal.scaleFactor*t/i;a.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=n.lineIndent;var s,c,l=[];for(s=0,c=r.length;s<c;s++)l=l.concat(Op.apply(this,[r[s],o,a]));return l},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t=`0123456789abcdef`,n=`klmnopqrstuvwxyz`,r={},i={},a=0;a<16;a++)r[n[a]]=t[a],i[t[a]]=n[a];var o=function(e){return`0x`+parseInt(e,10).toString(16)},s=e.__fontmetrics__.compress=function(e){var t,n,r,a,c=[`{`];for(var l in e){if(t=e[l],isNaN(parseInt(l,10))?n=`'`+l+`'`:(l=parseInt(l,10),n=(n=o(l).slice(2)).slice(0,-1)+i[n.slice(-1)]),typeof t==`number`)t<0?(r=o(t).slice(3),a=`-`):(r=o(t).slice(2),a=``),r=a+r.slice(0,-1)+i[r.slice(-1)];else{if(ta(t)!==`object`)throw Error(`Don't know what to do with value type `+ta(t)+`.`);r=s(t)}c.push(n+r)}return c.push(`}`),c.join(``)},c=e.__fontmetrics__.uncompress=function(e){if(typeof e!=`string`)throw Error(`Invalid argument passed to uncompress.`);for(var t,n,i,a,o={},s=1,c=o,l=[],u=``,d=``,f=e.length-1,p=1;p<f;p+=1)(a=e[p])==`'`?t?(i=t.join(``),t=void 0):t=[]:t?t.push(a):a==`{`?(l.push([c,i]),c={},i=void 0):a==`}`?((n=l.pop())[0][n[1]]=c,i=void 0,c=n[0]):a==`-`?s=-1:i===void 0?r.hasOwnProperty(a)?(u+=r[a],i=parseInt(u,16)*s,s=1,u=``):u+=a:r.hasOwnProperty(a)?(d+=r[a],c[i]=parseInt(d,16)*s,s=1,i=void 0,d=``):d+=a;return o},l={codePages:[`WinAnsiEncoding`],WinAnsiEncoding:c(`{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}`)},u={Unicode:{Courier:l,"Courier-Bold":l,"Courier-BoldOblique":l,"Courier-Oblique":l,Helvetica:l,"Helvetica-Bold":l,"Helvetica-BoldOblique":l,"Helvetica-Oblique":l,"Times-Roman":l,"Times-Bold":l,"Times-BoldItalic":l,"Times-Italic":l}},d={Unicode:{"Courier-Oblique":c(`{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}`),"Times-BoldItalic":c(`{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}`),"Helvetica-Bold":c(`{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6Line truncated
|
||||
<<
|
||||
`+t.join(`
|
||||
`)+`
|
||||
>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},xf.API.addMetadata=function(e,t){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:e,namespaceUri:t??`http://jspdf.default.namespaceuri/`,rawXml:typeof t==`boolean`&&t},this.internal.events.subscribe(`putCatalog`,qp),this.internal.events.subscribe(`postPutResources`,Kp)),this},function(e){var t=e.API,n=t.pdfEscape16=function(e,t){for(var n,r=t.metadata.Unicode.widths,i=[``,`0`,`00`,`000`,`0000`],a=[``],o=0,s=e.length;o<s;++o){if(n=t.metadata.characterToGlyph(e.charCodeAt(o)),t.metadata.glyIdsUsed.push(n),t.metadata.toUnicode[n]=e.charCodeAt(o),r.indexOf(n)==-1&&(r.push(n),r.push([parseInt(t.metadata.widthOfGlyph(n),10)])),n==`0`)return a.join(``);n=n.toString(16),a.push(i[4-n.length],n)}return a.join(``)},r=function(e){var t,n,r,i,a,o,s;for(a=`/CIDInit /ProcSet findresource begin
|
||||
12 dict begin
|
||||
begincmap
|
||||
/CIDSystemInfo <<
|
||||
/Registry (Adobe)
|
||||
/Ordering (UCS)
|
||||
/Supplement 0
|
||||
>> def
|
||||
/CMapName /Adobe-Identity-UCS def
|
||||
/CMapType 2 def
|
||||
1 begincodespacerange
|
||||
<0000><ffff>
|
||||
endcodespacerange`,r=[],o=0,s=(n=Object.keys(e).sort(function(e,t){return e-t})).length;o<s;o++)t=n[o],r.length>=100&&(a+=`
|
||||
`+r.length+` beginbfchar
|
||||
`+r.join(`
|
||||
`)+`
|
||||
endbfchar`,r=[]),e[t]!==void 0&&e[t]!==null&&typeof e[t].toString==`function`&&(i=(`0000`+e[t].toString(16)).slice(-4),t=(`0000`+(+t).toString(16)).slice(-4),r.push(`<`+t+`><`+i+`>`));return r.length&&(a+=`
|
||||
`+r.length+` beginbfchar
|
||||
`+r.join(`
|
||||
`)+`
|
||||
endbfchar
|
||||
`),a+`endcmap
|
||||
CMapName currentdict /CMap defineresource pop
|
||||
end
|
||||
end`};t.events.push([`putFont`,function(t){(function(t){var n=t.font,i=t.out,a=t.newObject,o=t.putStream;if(n.metadata instanceof e.API.TTFFont&&n.encoding===`Identity-H`){for(var s=n.metadata.Unicode.widths,c=n.metadata.subset.encode(n.metadata.glyIdsUsed,1),l=``,u=0;u<c.length;u++)l+=String.fromCharCode(c[u]);var d=a();o({data:l,addLength1:!0,objectId:d}),i(`endobj`);var f=a();o({data:r(n.metadata.toUnicode),addLength1:!0,objectId:f}),i(`endobj`);var p=a();i(`<<`),i(`/Type /FontDescriptor`),i(`/FontName /`+hf(n.fontName)),i(`/FontFile2 `+d+` 0 R`),i(`/FontBBox `+e.API.PDFObject.convert(n.metadata.bbox)),i(`/Flags `+n.metadata.flags),i(`/StemV `+n.metadata.stemV),i(`/ItalicAngle `+n.metadata.italicAngle),i(`/Ascent `+n.metadata.ascender),i(`/Descent `+n.metadata.decender),i(`/CapHeight `+n.metadata.capHeight),i(`>>`),i(`endobj`);var m=a();i(`<<`),i(`/Type /Font`),i(`/BaseFont /`+hf(n.fontName)),i(`/FontDescriptor `+p+` 0 R`),i(`/W `+e.API.PDFObject.convert(s)),i(`/CIDToGIDMap /Identity`),i(`/DW 1000`),i(`/Subtype /CIDFontType2`),i(`/CIDSystemInfo`),i(`<<`),i(`/Supplement 0`),i(`/Registry (Adobe)`),i(`/Ordering (`+n.encoding+`)`),i(`>>`),i(`>>`),i(`endobj`),n.objectNumber=a(),i(`<<`),i(`/Type /Font`),i(`/Subtype /Type0`),i(`/ToUnicode `+f+` 0 R`),i(`/BaseFont /`+hf(n.fontName)),i(`/Encoding /`+n.encoding),i(`/DescendantFonts [`+m+` 0 R]`),i(`>>`),i(`endobj`),n.isAlreadyPutted=!0}})(t)}]),t.events.push([`putFont`,function(t){(function(t){var n=t.font,i=t.out,a=t.newObject,o=t.putStream;if(n.metadata instanceof e.API.TTFFont&&n.encoding===`WinAnsiEncoding`){for(var s=n.metadata.rawData,c=``,l=0;l<s.length;l++)c+=String.fromCharCode(s[l]);var u=a();o({data:c,addLength1:!0,objectId:u}),i(`endobj`);var d=a();o({data:r(n.metadata.toUnicode),addLength1:!0,objectId:d}),i(`endobj`);var f=a();i(`<<`),i(`/Descent `+n.metadata.decender),i(`/CapHeight `+n.metadata.capHeight),i(`/StemV `+n.metadata.stemV),i(`/Type /FontDescriptor`),i(`/FontFile2 `+u+` 0 R`),i(`/Flags 96`),i(`/FontBBox `+e.API.PDFObject.convert(n.metadata.bbox)),i(`/FontName /`+hf(n.fontName)),i(`/ItalicAngle `+n.metadata.italicAngle),i(`/Ascent `+n.metadata.ascender),i(`>>`),i(`endobj`),n.objectNumber=a();for(var p=0;p<n.metadata.hmtx.widths.length;p++)n.metadata.hmtx.widths[p]=parseInt(n.metadata.hmtx.widths[p]*(1e3/n.metadata.head.unitsPerEm));i(`<</Subtype/TrueType/Type/Font/ToUnicode `+d+` 0 R/BaseFont/`+hf(n.fontName)+`/FontDescriptor `+f+` 0 R/Encoding/`+n.encoding+` /FirstChar 29 /LastChar 255 /Widths `+e.API.PDFObject.convert(n.metadata.hmtx.widths)+`>>`),i(`endobj`),n.isAlreadyPutted=!0}})(t)}]);var i=function(e){var t,r=e.text||``,i=e.x,a=e.y,o=e.options||{},s=e.mutex||{},c=s.pdfEscape,l=s.activeFontKey,u=s.fonts,d=l,f=``,p=0,m=``,h=u[d].encoding;if(u[d].encoding!==`Identity-H`)return{text:r,x:i,y:a,options:o,mutex:s};for(m=r,d=l,Array.isArray(r)&&(m=r[0]),p=0;p<m.length;p+=1)u[d].metadata.hasOwnProperty(`cmap`)&&(t=u[d].metadata.cmap.unicode.codeMap[m[p].charCodeAt(0)]),t||m[p].charCodeAt(0)<256&&u[d].metadata.hasOwnProperty(`Unicode`)?f+=m[p]:f+=``;var g=``;return parseInt(d.slice(1))<14||h===`WinAnsiEncoding`?g=c(f,d).split(``).map(function(e){return e.charCodeAt(0).toString(16)}).join(``):h===`Identity-H`&&(g=n(f,u[d])),s.isHex=!0,{text:g,x:i,y:a,options:o,mutex:s}};t.events.push([`postProcessText`,function(e){var t=e.text||``,n=[],r={text:t,x:e.x,y:e.y,options:e.options,mutex:e.mutex};if(Array.isArray(t)){var a=0;for(a=0;a<t.length;a+=1)Array.isArray(t[a])&&t[a].length===3?n.push([i(Object.assign({},r,{text:t[a][0]})).text,t[a][1],t[a][2]]):n.push(i(Object.assign({},r,{text:t[a]})).text);e.text=n}else e.text=i(Object.assign({},r,{text:t})).text}])}(xf),function(e){var t=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(e){return t.call(this),this.internal.vFS[e]!==void 0},e.addFileToVFS=function(e,n){return t.call(this),this.internal.vFS[e]=n,this},e.getFileFromVFS=function(e){return t.call(this),this.internal.vFS[e]===void 0?null:this.internal.vFS[e]}}(xf.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(e){var n,r,i,a,o,s,c,l=t,u=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],d=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],f={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},p={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},m=`(.).(.<.>.<.[.].[.{.}.{.«.».«.‹.›.‹.⁅.⁆.⁅.⁽.⁾.⁽.₍.₎.₍.≤.≥.≤.〈.〉.〈.﹙.﹚.﹙.﹛.﹜.﹛.﹝.﹞.﹝.﹤.﹥.﹤`.split(`.`),h=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),g=!1,_=0;this.__bidiEngine__={};var v=function(e){var t=e.charCodeAt(),n=t>>8,r=p[n];return r===void 0?n===252||n===253?`AL`:h.test(n)?`L`:n===8?`R`:`N`:l[256*r+(255&t)]},y=function(e){for(var t,n=0;n<e.length;n++){if((t=v(e.charAt(n)))===`L`)return!1;if(t===`R`)return!0}return!1},b=function(e,t,o,s){var c,l,u,d,f=t[s];switLine truncated
|
||||
`)}return``+n},t}();function hm(e,t,n,r,i){r||={};var a=1.15,o=i.internal.scaleFactor,s=i.internal.getFontSize()/o,c=s*(i.getLineHeightFactor?i.getLineHeightFactor():a),l=/\r\n|\r|\n/g,u=``,d=1;if((r.valign===`middle`||r.valign===`bottom`||r.halign===`center`||r.halign===`right`)&&(u=typeof e==`string`?e.split(l):e,d=u.length||1),n+=s*(2-a),r.valign===`middle`?n-=d/2*c:r.valign===`bottom`&&(n-=d*c),r.halign===`center`||r.halign===`right`){var f=s;if(r.halign===`center`&&(f*=.5),u&&d>=1){for(var p=0;p<u.length;p++)i.text(u[p],t-i.getStringUnitWidth(u[p])*f,n),n+=c;return i}t-=i.getStringUnitWidth(e)*f}return r.halign===`justify`?i.text(e,t,n,{maxWidth:r.maxWidth||100,align:`justify`}):i.text(e,t,n),i}var gm={},_m=function(){function e(e){this.jsPDFDocument=e,this.userStyles={textColor:e.getTextColor?this.jsPDFDocument.getTextColor():0,fontSize:e.internal.getFontSize(),fontStyle:e.internal.getFont().fontStyle,font:e.internal.getFont().fontName,lineWidth:e.getLineWidth?this.jsPDFDocument.getLineWidth():0,lineColor:e.getDrawColor?this.jsPDFDocument.getDrawColor():0}}return e.setDefaults=function(e,t){t===void 0&&(t=null),t?t.__autoTableDocumentDefaults=e:gm=e},e.unifyColor=function(e){return Array.isArray(e)?e:typeof e==`number`?[e,e,e]:typeof e==`string`?[e]:null},e.prototype.applyStyles=function(t,n){var r,i,a;n===void 0&&(n=!1),t.fontStyle&&this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(t.fontStyle);var o=this.jsPDFDocument.internal.getFont(),s=o.fontStyle,c=o.fontName;if(t.font&&(c=t.font),t.fontStyle){s=t.fontStyle;var l=this.getFontList()[c];l&&l.indexOf(s)===-1&&this.jsPDFDocument.setFontStyle&&(this.jsPDFDocument.setFontStyle(l[0]),s=l[0])}if(this.jsPDFDocument.setFont(c,s),t.fontSize&&this.jsPDFDocument.setFontSize(t.fontSize),!n){var u=e.unifyColor(t.fillColor);u&&(r=this.jsPDFDocument).setFillColor.apply(r,u),u=e.unifyColor(t.textColor),u&&(i=this.jsPDFDocument).setTextColor.apply(i,u),u=e.unifyColor(t.lineColor),u&&(a=this.jsPDFDocument).setDrawColor.apply(a,u),typeof t.lineWidth==`number`&&this.jsPDFDocument.setLineWidth(t.lineWidth)}},e.prototype.splitTextToSize=function(e,t,n){return this.jsPDFDocument.splitTextToSize(e,t,n)},e.prototype.rect=function(e,t,n,r,i){return this.jsPDFDocument.rect(e,t,n,r,i)},e.prototype.getLastAutoTable=function(){return this.jsPDFDocument.lastAutoTable||null},e.prototype.getTextWidth=function(e){return this.jsPDFDocument.getTextWidth(e)},e.prototype.getDocument=function(){return this.jsPDFDocument},e.prototype.setPage=function(e){this.jsPDFDocument.setPage(e)},e.prototype.addPage=function(){return this.jsPDFDocument.addPage()},e.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},e.prototype.getGlobalOptions=function(){return gm||{}},e.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},e.prototype.pageSize=function(){var e=this.jsPDFDocument.internal.pageSize;return e.width??(e={width:e.getWidth(),height:e.getHeight()}),e},e.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},e.prototype.getLineHeightFactor=function(){var e=this.jsPDFDocument;return e.getLineHeightFactor?e.getLineHeightFactor():1.15},e.prototype.getLineHeight=function(e){return e/this.scaleFactor()*this.getLineHeightFactor()},e.prototype.pageNumber=function(){var e=this.jsPDFDocument.internal.getCurrentPageInfo();return e?e.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},e}(),vm=function(e,t){return vm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},vm(e,t)};function ym(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);vm(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var bm=function(e){ym(t,e);function t(t){var n=e.call(this)||this;return n._element=t,n}return t}(Array);function xm(e){return{font:`helvetica`,fontStyle:`normal`,overflow:`linebreak`,fillColor:!1,textColor:20,halign:`left`,valign:`top`,fontSize:10,cellPadding:5/e,lineColor:200,lineWidth:0,cellWidth:`auto`,minCellHeight:0,minCellWidth:0}}function Sm(e){return{striped:{table:{fillColor:255,textColor:80,fontStyle:`normal`},head:{textColor:255,fillColor:[41,128,185],fontStyle:`bold`},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:`bold`},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:`normal`,lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:`bold`,lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:`bold`,lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:`bold`},foot:{fontStyle:`bold`}}}[e]}function Cm(e,t,n){return n.applyStyles(t,!0),(Array.isArray(e)?e:[e]).map(function(e){return n.getTextWidth(e)}).reduce(function(e,t){return Math.max(e,t)},0)}function wm(e,t,n,r){var i=t
Line truncated
|
||||
`),t.innerText||t.textContent||``}function Im(e,t,n){for(var r=0,i=[e,t,n];r<i.length;r++){var a=i[r];a&&typeof a!=`object`&&console.error(`The options parameter should be of type object, is: `+typeof a),a.startY&&typeof a.startY!=`number`&&(console.error(`Invalid value for startY option`,a.startY),delete a.startY)}}function Lm(e,t,n,r,i){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var a=Object(e),o=1;o<arguments.length;o++){var s=arguments[o];if(s!=null)for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(a[c]=s[c])}return a}function Rm(e,t){var n=new _m(e),r=n.getDocumentOptions(),i=n.getGlobalOptions();Im(i,r,t);var a=Lm({},i,r,t),o;typeof window<`u`&&(o=window);var s=zm(i,r,t),c=Bm(i,r,t),l=Vm(n,a),u=Um(n,a,o);return{id:t.tableId,content:u,hooks:c,styles:s,settings:l}}function zm(e,t,n){for(var r={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},i=function(i){if(i===`columnStyles`){var a=e[i],o=t[i],s=n[i];r.columnStyles=Lm({},a,o,s)}else{var c=[e,t,n].map(function(e){return e[i]||{}});r[i]=Lm({},c[0],c[1],c[2])}},a=0,o=Object.keys(r);a<o.length;a++){var s=o[a];i(s)}return r}function Bm(e,t,n){for(var r=[e,t,n],i={didParseCell:[],willDrawCell:[],didDrawCell:[],willDrawPage:[],didDrawPage:[]},a=0,o=r;a<o.length;a++){var s=o[a];s.didParseCell&&i.didParseCell.push(s.didParseCell),s.willDrawCell&&i.willDrawCell.push(s.willDrawCell),s.didDrawCell&&i.didDrawCell.push(s.didDrawCell),s.willDrawPage&&i.willDrawPage.push(s.willDrawPage),s.didDrawPage&&i.didDrawPage.push(s.didDrawPage)}return i}function Vm(e,t){var n=Em(t.margin,40/e.scaleFactor()),r=Hm(e,t.startY)??n.top,i=t.showFoot===!0?`everyPage`:t.showFoot===!1?`never`:t.showFoot??`everyPage`,a=t.showHead===!0?`everyPage`:t.showHead===!1?`never`:t.showHead??`everyPage`,o=t.useCss??!1,s=t.theme||(o?`plain`:`striped`),c=!!t.horizontalPageBreak,l=t.horizontalPageBreakRepeat??null;return{includeHiddenHtml:t.includeHiddenHtml??!1,useCss:o,theme:s,startY:r,margin:n,pageBreak:t.pageBreak??`auto`,rowPageBreak:t.rowPageBreak??`auto`,tableWidth:t.tableWidth??`auto`,showHead:a,showFoot:i,tableLineWidth:t.tableLineWidth??0,tableLineColor:t.tableLineColor??200,horizontalPageBreak:c,horizontalPageBreakRepeat:l,horizontalPageBreakBehaviour:t.horizontalPageBreakBehaviour??`afterAllRows`}}function Hm(e,t){var n=e.getLastAutoTable(),r=e.scaleFactor(),i=e.pageNumber(),a=!1;return n&&n.startPageNumber&&(a=n.startPageNumber+n.pageNumber-1===i),typeof t==`number`?t:(t==null||t===!1)&&a&&n?.finalY!=null?n.finalY+20/r:null}function Um(e,t,n){var r=t.head||[],i=t.body||[],a=t.foot||[];if(t.html){var o=t.includeHiddenHtml;if(n){var s=Nm(e,t.html,n,o,t.useCss)||{};r=s.head||r,i=s.body||r,a=s.foot||r}else console.error(`Cannot parse html in non browser environment`)}return{columns:t.columns||Wm(r,i,a),head:r,body:i,foot:a}}function Wm(e,t,n){var r=e[0]||t[0]||n[0]||[],i=[];return Object.keys(r).filter(function(e){return e!==`_element`}).forEach(function(e){var t=1,n=Array.isArray(r)?r[parseInt(e)]:r[e];typeof n==`object`&&!Array.isArray(n)&&(t=n?.colSpan||1);for(var a=0;a<t;a++){var o=void 0;o=Array.isArray(r)?i.length:e+(a>0?`_${a}`:``);var s={dataKey:o};i.push(s)}}),i}var Gm=function(){function e(e,t,n){this.table=t,this.pageNumber=t.pageNumber,this.settings=t.settings,this.cursor=n,this.doc=e.getDocument()}return e}(),Km=function(e){ym(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t,n,o)||this;return s.cell=r,s.row=i,s.column=a,s.section=i.section,s}return t}(Gm),qm=function(){function e(e,t){this.pageNumber=1,this.id=e.id,this.settings=e.settings,this.styles=e.styles,this.hooks=e.hooks,this.columns=t.columns,this.head=t.head,this.body=t.body,this.foot=t.foot}return e.prototype.getHeadHeight=function(e){return this.head.reduce(function(t,n){return t+n.getMaxCellHeight(e)},0)},e.prototype.getFootHeight=function(e){return this.foot.reduce(function(t,n){return t+n.getMaxCellHeight(e)},0)},e.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},e.prototype.callCellHooks=function(e,t,n,r,i,a){for(var o=0,s=t;o<s.length;o++){var c=s[o],l=c(new Km(e,this,n,r,i,a))===!1;if(n.text=Array.isArray(n.text)?n.text:[n.text],l)return!1}return!0},e.prototype.callEndPageHooks=function(e,t){e.applyStyles(e.userStyles);for(var n=0,r=this.hooks.didDrawPage;n<r.length;n++){var i=r[n];i(new Gm(e,this,t))}},e.prototype.callWillDrawPageHooks=function(e,t){for(var n=0,r=this.hooks.willDrawPage;n<r.length;n++){var i=r[n];i(new Gm(e,this,t))}},e.prototype.getWidth=function(e){if(typeof this.settings.tableWidth==`number`)return this.settings.tableWidth;if(this.settings.tableWidth===`wrap`)return this.columns.reduce(function(e,t){return e+t.wrappedWidth},0);var t=this.settings.margin;return e-t.left-t.right},e}(),Jm=function(){function e(e,t,n,r,i){i===void 0&&(i=!1),this.height=0,this.raw=e,e instanceof bm&&(this.raw=e._element,this.element=e._element),this.index=t,this.section=n,this.cells=r,this.spa
Line truncated
|
||||
`),p=t.note||``,m=``;t.latitude&&t.longitude?m=`https://www.google.com/maps/search/?api=1&query=${t.latitude},${t.longitude}`:(s||a)&&(m=`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(s||a)}`);let h=o.length;m&&(l[h]=m);let g={content:c,styles:m?{textColor:[40,83,107],fontStyle:`bold`}:{}};o.push([u++,i,r===0?n:``,g,p]),d++});else{let t=f(null,e);c[e.id]={start:i,count:1},o.push([u++,t,n,`Chưa có địa điểm trong chặng này`,``]),d++}}),o.length===0&&o.push([`-`,`-`,`-`,`Chưa có chặng hoặc địa điểm nào trong hành trình.`,`-`]),jh(e,{head:[i],headStyles:{fillColor:[37,99,235],textColor:[255,255,255],font:`Roboto`,fontStyle:`bold`,halign:`center`,valign:`middle`},body:o,startY:n,theme:`grid`,styles:{font:`Roboto`,fontSize:9,cellPadding:3,overflow:`linebreak`,valign:`top`},columnStyles:{0:{cellWidth:12,halign:`center`,valign:`middle`},1:{cellWidth:50,halign:`center`,valign:`middle`},2:{cellWidth:45,halign:`center`,valign:`middle`},3:{cellWidth:90,valign:`top`},4:{cellWidth:70,valign:`top`}},margin:{left:15,right:15},didParseCell:e=>{if(e.section===`body`&&e.column.index===2){let t=!1;for(let n of s?.legs||[]){let r=c[n.id];if(r&&e.row.index>=r.start&&e.row.index<r.start+r.count){e.row.index===r.start?e.rowSpan=r.count:e.rowSpan=0,t=!0;break}}t||(e.rowSpan=1)}},willDrawCell:e=>{e.section===`body`&&e.column.index===1&&(e.cell.text&&e.cell.text.length>0&&(e.cell.customInlineBuffer=e.cell.text.join(``)),e.cell.text=[])},didDrawCell:e=>{if(e.section===`body`&&e.column.index===1){let t=e.cell.customInlineBuffer||e.cell.raw;if(t&&typeof t==`string`&&t.includes(`|`)){let[n,r]=t.split(`|`);e.doc.setFont(e.cell.styles.font,`bold`);let i=e.doc.getTextWidth(n);e.doc.setFont(e.cell.styles.font,`normal`);let a=e.doc.getTextWidth(` `),o=e.doc.getTextWidth(r),s=i+a+o,c=e.cell.x+(e.cell.width-s)/2,l=e.cell.y+e.cell.height/2+e.cell.styles.fontSize/2-1;e.doc.setFont(e.cell.styles.font,`bold`),e.doc.setTextColor(239,68,68),e.doc.text(n,c,l),e.doc.setFont(e.cell.styles.font,`normal`),e.doc.setTextColor(37,99,235),e.doc.text(r,c+i+a,l)}}if(e.section===`body`&&e.column.index===3){let t=l[e.row.index];t&&e.doc.link(e.cell.x,e.cell.y,e.cell.width,e.cell.height,{url:t})}}});try{a({title:`Đang tạo PDF...`,message:`Vui lòng chờ trong giây lát.`,type:`info`}),e.save(`Lich_trinh_${s?.title||`tour`}.pdf`),a({title:`Thành công`,message:`Lịch trình đã được xuất ra tập tin PDF thành công.`,type:`success`})}catch(e){console.error(e),a({title:`Lỗi`,message:`Không thể xuất PDF lịch trình.`,type:`error`})}},Me=()=>{if(!s)return;let e=``;e+=`Chặng,Địa điểm,Địa chỉ,Thời gian đến,Thời gian đi,Ghi chú
|
||||
`,s.legs&&s.legs.length>0&&s.legs.forEach((t,n)=>{let r=t.note||`Chặng ${n+1}`;t.locations&&t.locations.length>0?t.locations.forEach(t=>{let n=[r,t.name||``,t.address||``,t.arrivalTime?new Date(t.arrivalTime).toLocaleString(`vi-VN`):``,t.departureTime?new Date(t.departureTime).toLocaleString(`vi-VN`):``,t.notes||``].map(e=>`"${e.replace(/"/g,`""`)}"`).join(`,`);e+=n+`
|
||||
`}):e+=`"${r.replace(/"/g,`""`)}","Chưa có địa điểm",,,,\n`});let t=new Blob([e],{type:`text/csv;charset=utf-8;`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.setAttribute(`download`,`Lich_trinh_${s.title||`tour`}.csv`),document.body.appendChild(r),r.click(),document.body.removeChild(r),a({title:`Thành công`,message:`Đã xuất lịch trình ra tệp CSV (Google Sheets) thành công.`,type:`success`})};(0,y.useEffect)(()=>{we()},[t]);let[Ne,Pe]=(0,y.useState)(null),Fe=(0,y.useMemo)(()=>p!==null&&h!==null&&h>.5?p:Ne===null?0:Ne,[p,h,Ne]),Ie=(0,y.useMemo)(()=>({start:vn.default.divIcon({className:`!bg-transparent !border-none`,html:`<div class="w-7 h-7 bg-blue-600 rounded-full border-2 border-white shadow-xl flex items-center justify-center text-[11px] font-black text-white animate-in zoom-in duration-300">S</div>`,iconSize:[28,28],iconAnchor:[14,14]}),end:vn.default.divIcon({className:`!bg-transparent !border-none`,html:`<div class="w-7 h-7 bg-green-600 rounded-full border-2 border-white shadow-xl flex items-center justify-center text-[11px] font-black text-white animate-in zoom-in duration-300">E</div>`,iconSize:[28,28],iconAnchor:[14,14]}),visit:vn.default.divIcon({className:`!bg-transparent !border-none`,html:`<div class="w-5 h-5 bg-indigo-500 rounded-full border-2 border-white shadow-lg hover:scale-125 transition-transform flex items-center justify-center"><div class="w-1.5 h-1.5 bg-white rounded-full opacity-50"></div></div>`,iconSize:[20,20],iconAnchor:[10,10]}),user:vn.default.divIcon({className:`!bg-transparent !border-none`,html:`
|
||||
<div class="relative flex items-center justify-center">
|
||||
<!-- Hiệu ứng ping tỏa lan -->
|
||||
<div class="absolute w-8 h-8 bg-blue-400 rounded-full opacity-30 animate-ping"></div>
|
||||
|
||||
<!-- Marker chính màu xanh -->
|
||||
<div class="w-5 h-5 bg-blue-600 rounded-full border-2 border-white shadow-xl flex items-center justify-center z-10">
|
||||
<!-- Mũi tên chỉ hướng nhìn (xoay theo heading) -->
|
||||
<div style="transform: rotate(${Fe}deg); transition: transform 0.2s ease-out;" class="absolute inset-0 flex flex-col items-center">
|
||||
<div class="w-0 h-0 border-l-[5px] border-l-transparent border-r-[5px] border-r-transparent border-b-[8px] border-b-white mt-[1px]"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`,iconSize:[32,32],iconAnchor:[16,16]})}),[Fe]);(0,y.useEffect)(()=>{if(!n&&navigator.geolocation){let e=navigator.geolocation.watchPosition(e=>{f([e.coords.latitude,e.coords.longitude]),m(e.coords.heading),g(e.coords.speed)},e=>console.warn(`Lỗi định vị người dùng:`,e),{enableHighAccuracy:!0});return()=>navigator.geolocation.clearWatch(e)}else m(null),g(null)},[n]),(0,y.useEffect)(()=>{let e=e=>{let t=null;e.webkitCompassHeading!==void 0&&e.webkitCompassHeading!==null?t=e.webkitCompassHeading:e.alpha!==null&&e.alpha!==void 0&&(e.absolute===!0||e.type===`deviceorientationabsolute`)&&(t=(360-e.alpha)%360),t!==null&&Pe(t)};return window.addEventListener(`deviceorientation`,e,!0),window.addEventListener(`deviceorientationabsolute`,e,!0),()=>{window.removeEventListener(`deviceorientation`,e,!0),window.removeEventListener(`deviceorientationabsolute`,e,!0)}},[]),(0,y.useEffect)(()=>{if(!E){k(0);return}let e=null;p!==null&&h!==null&&h>.5?e=-p:Ne!==null&&(e=-Ne),e!==null&&k(e)},[E,p,h,Ne]);let[Le,Be]=(0,y.useState)(!1),[Y,Ve]=(0,y.useState)(!1),[He,Ue]=(0,y.useState)(null),[qe,Je]=(0,y.useState)(null),[Ye,Xe]=(0,y.useState)(null),[Qe,$e]=(0,y.useState)(!1),[Z,et]=(0,y.useState)(null),tt=(0,y.useMemo)(()=>{let e=localStorage.getItem(`token`)||localStorage.getItem(`guest_token`);if(!e)return null;try{return JSON.parse(atob(e.split(`.`)[1])).sub}catch{return null}},[]),nt=(0,y.useMemo)(()=>{let e=localStorage.getItem(`user`)||localStorage.getItem(`guest_user`);if(!e)return null;try{return JSON.parse(e)}catch{return null}},[]),[it,at]=(0,y.useState)(!1),[ot,st]=(0,y.useState)(``),[ct,lt]=(0,y.useState)(``),[ut,dt]=(0,y.useState)(``),[ft,pt]=(0,y.useState)(``),[mt,ht]=(0,y.useState)(!1),[gt,_t]=(0,y.useState)(!1),[vt,yt]=(0,y.useState)(``),[bt,xt]=(0,y.useState)(!1),St=Z&&Z.metadata&&Array.isArray(Z.metadata.likedUserIds)?Z.metadata.likedUserIds:[],Q=nt&&St.includes(nt.id),Ct=St.length,wt=async()=>{if(Z)try{let e=await fetch(`/api/v1/photos/${Z.id}/toggle-like`,{method:`POST`,headers:{Authorization:`Bearer ${localStorage.getItem(`token`)||localStorage.getItem(`guest_token`)}`}});if(e.ok){let t=await e.json();et(e=>e?{...e,metadata:{...e.metadata,likedUserIds:t.likedUserIds}}:null),s&&Vn(s.id)}}catch(e){console.error(`Error toggling like:`,e)}};(0,y.useEffect)(()=>{let e=Z?.metadata?.lat,t=Z?.metadata?.lng;typeof e==`number`&&typeof t==`number`?(yt(`Đang xác định địa điểm...`),fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${e}&lon=${t}&accept-language=vi`).then(e=>{if(!e.ok)throw Error();return e.json()}).then(n=>{n&&n.display_name?yt(n.display_name.split(`,`).slice(0,3).join(`,`).trim()||n.display_name):yt(`${e.toFixed(4)}, ${t.toFixed(4)}`)}).catch(()=>{yt(`${e.toFixed(4)}, ${t.toFixed(4)}`)})):yt(`Chưa xác định tọa độ`)},[Z?.id,Z?.metadata?.lat,Z?.metadata?.lng]),(0,y.useEffect)(()=>{Z&&(st(Z.metadata?.title||``),lt(Z.metadata?.description||``),dt(Z.metadata?.lat??``),pt(Z.metadata?.lng??``),at(!1))},[Z]);let Tt=async()=>{if(Z){if(ut!==``&&(isNaN(ut)||ut<-90||ut>90)){a({title:`Lỗi`,message:`Vĩ độ không hợp lệ (-90 đến 90).`,type:`error`});return}if(ft!==``&&(isNaN(ft)||ft<-180||ft>180)){a({title:`Lỗi`,message:`Kinh độ không hợp lệ (-180 đến 180).`,type:`error`});return}ht(!0);try{let e=await fetch(`/api/v1/photos/${Z.id}`,{method:`PATCH`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${localStorage.getItem(`token`)||localStorage.getItem(`guest_token`)}`},body:JSON.stringify({title:ot,description:ct,latitude:ut===``?void 0:ut,longitude:ft===``?void 0:ft})});if(!e.ok)throw Error(`Failed to update photo info`);let t=await e.json();a({title:`Thành công`,message:`Thông tin ảnh đã được cập nhật.`,type:`success`}),et(e=>e?{...e,metadata:t.metadata}:null),s&&Vn(s.id),at(!1)}catch{a({title:`Lỗi`,message:`Không thể cập nhật thông tin ảnh. Vui lòng thử lại.`,type:`error`})}finally{ht(!1)}}},[Et,Dt]=(0,y.useState)([]),[Ot,kt]=(0,y.useState)(s?.title??``),[At,jt]=(0,y.useState)(s?.description??``),[Mt,Nt]=(0,y.useState)(s?.adultCount??0),[Pt,Ft]=(0,y.useState)(s?.childCount??0),[It,Lt]=(0,y.useState)(s?.childDiscount??0),[Rt,zt]=(0,y.useState)(s?.tags??[]),[Bt,Vt]=(0,y.useState)(``),Ht=[`Văn hóa`,`Mạo hiểm`,`Nghỉ dưỡng`,`Thư giãn`,`Ẩm thực`,`Khám phá`,`Gia đình`],[Ut,Wt]=(0,y.useState)(`all`),Gt=(0,y.useMemo)(()=>{if(!s?.photos)return[];let e=s.photos;if(Ut!==`all`){let t=c.find(e=>e.id===Ut);if(t){let n=t.locations.map(e=>e.id);e=e.filter(e=>e.locationId&&n.includes(e.locationId))}else e=[]}return e},[s?.photos,Ut,c]);(0,y.useEffect)(()=>{Gt.length>0&&!Z?et(R_(Gt)):Z&&!Gt.some(e=>e.id===Z.id)&&et(Gt.length>0?R_(Gt):null)},[Gt,Z]);let[Kt,qt]=(0,y.useState)(!1),[Jt,Yt]=(0,y.useState)(``),[Xt,Zt]=(0,y.useState)(``),[Qt,$t]=(0,y.useState)(null),[en,tn]=(0,y.useState)(null),[nn,rn]=(0,y.useState)(null),[an,on]=(0,y.useState)(null),[sn,cn]=(0,y.useState)(``);(0,y.useEffect)(()=>{s
Line truncated
|
||||
`){let r=new s.default(this.ops),i=new e,a=0;for(;r.hasNext();){if(r.peekType()!==`insert`)return;let s=r.peek(),c=o.default.length(s)-r.peekLength(),l=typeof s.insert==`string`?s.insert.indexOf(n,c)-c:-1;if(l<0)i.push(r.next());else if(l>0)i.push(r.next(l));else{if(t(i,r.next(1).attributes||{},a)===!1)return;a+=1,i=new e}}i.length()>0&&t(i,{},a)}invert(t){let n=new e;return this.reduce((r,i)=>{if(i.insert)n.delete(o.default.length(i));else if(typeof i.retain==`number`&&i.attributes==null)return n.retain(i.retain),r+i.retain;else if(i.delete||typeof i.retain==`number`){let e=i.delete||i.retain;return t.slice(r,r+e).forEach(e=>{i.delete?n.push(e):i.retain&&i.attributes&&n.retain(o.default.length(e),a.default.invert(i.attributes,e.attributes))}),r+e}else if(typeof i.retain==`object`&&i.retain!==null){let o=t.slice(r,r+1),c=new s.default(o.ops).next(),[u,d,f]=l(i.retain,c.insert),p=e.getHandler(u);return n.retain({[u]:p.invert(d,f)},a.default.invert(i.attributes,c.attributes)),r+1}return r},0),n.chop()}transform(t,n=!1){if(n=!!n,typeof t==`number`)return this.transformPosition(t,n);let r=t,i=new s.default(this.ops),c=new s.default(r.ops),l=new e;for(;i.hasNext()||c.hasNext();)if(i.peekType()===`insert`&&(n||c.peekType()!==`insert`))l.retain(o.default.length(i.next()));else if(c.peekType()===`insert`)l.push(c.next());else{let t=Math.min(i.peekLength(),c.peekLength()),r=i.next(t),o=c.next(t);if(r.delete)continue;if(o.delete)l.push(o);else{let i=r.retain,s=o.retain,c=typeof s==`object`&&s?s:t;if(typeof i==`object`&&i&&typeof s==`object`&&s){let t=Object.keys(i)[0];if(t===Object.keys(s)[0]){let r=e.getHandler(t);r&&(c={[t]:r.transform(i[t],s[t],n)})}}l.retain(c,a.default.transform(r.attributes,o.attributes,n))}}return l.chop()}transformPosition(e,t=!1){t=!!t;let n=new s.default(this.ops),r=0;for(;n.hasNext()&&r<=e;){let i=n.peekLength(),a=n.peekType();if(n.next(),a===`delete`){e-=Math.min(i,e-r);continue}else a===`insert`&&(r<e||!t)&&(e+=i);r+=i}return e}};u.Op=o.default,u.OpIterator=s.default,u.AttributeMap=a.default,u.handlers={},e.default=u,typeof t==`object`&&(t.exports=u,t.exports.default=u)}))(),1),Aw=class extends gw{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return``}};Aw.blotName=`break`,Aw.tagName=`BR`;var jw=class extends Sw{},Mw={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function Nw(e){return e.replace(/[&<>"']/g,e=>Mw[e])}var Pw=class e extends dw{static allowedChildren=[e,Aw,gw,jw];static order=[`cursor`,`inline`,`link`,`underline`,`strike`,`italic`,`bold`,`script`,`code`];static compare(t,n){let r=e.order.indexOf(t),i=e.order.indexOf(n);return r>=0||i>=0?r-i:t===n?0:t<n?-1:1}formatAt(t,n,r,i){if(e.compare(this.statics.blotName,r)<0&&this.scroll.query(r,GC.BLOT)){let e=this.isolate(t,n);i&&e.wrap(r,i)}else super.formatAt(t,n,r,i)}optimize(t){if(super.optimize(t),this.parent instanceof e&&e.compare(this.statics.blotName,this.parent.statics.blotName)>0){let e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}},Fw=1,Iw=class extends pw{cache={};delta(){return this.cache.delta??(this.cache.delta=Rw(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,n,r){t<=0||(this.scroll.query(n,GC.BLOCK)?e+t===this.length()&&this.format(n,r):super.formatAt(e,Math.min(t,this.length()-e-1),n,r),this.cache={})}insertAt(e,t,n){if(n!=null){super.insertAt(e,t,n),this.cache={};return}if(t.length===0)return;let r=t.split(`
|
||||
`),i=r.shift();i.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let a=this;r.reduce((e,t)=>(a=a.split(e,!0),a.insertAt(0,t),t.length),e+i.length)}insertBefore(e,t){let{head:n}=this.children;super.insertBefore(e,t),n instanceof Aw&&n.remove(),this.cache={}}length(){return this.cache.length??(this.cache.length=super.length()+Fw),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t&&(e===0||e>=this.length()-Fw)){let t=this.clone();return e===0?(this.parent.insertBefore(t,this),this):(this.parent.insertBefore(t,this.next),t)}let n=super.split(e,t);return this.cache={},n}};Iw.blotName=`block`,Iw.tagName=`P`,Iw.defaultChild=Aw,Iw.allowedChildren=[Aw,Pw,gw,jw];var Lw=class extends gw{attach(){super.attach(),this.attributes=new ew(this.domNode)}delta(){return new kw.default().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){let n=this.scroll.query(e,GC.BLOCK_ATTRIBUTE);n!=null&&this.attributes.attribute(n,t)}formatAt(e,t,n,r){this.format(n,r)}insertAt(e,t,n){if(n!=null){super.insertAt(e,t,n);return}let r=t.split(`
|
||||
`),i=r.pop(),a=r.map(e=>{let t=this.scroll.create(Iw.blotName);return t.insertAt(0,e),t}),o=this.split(e);a.forEach(e=>{this.parent.insertBefore(e,o)}),i&&this.parent.insertBefore(this.scroll.create(`text`,i),o)}};Lw.scope=GC.BLOCK_BLOT;function Rw(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.descendants(iw).reduce((e,n)=>n.length()===0?e:e.insert(n.value(),zw(n,{},t)),new kw.default).insert(`
|
||||
`,zw(e))}function zw(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e==null||(`formats`in e&&typeof e.formats==`function`&&(t={...t,...e.formats()},n&&delete t[`code-token`]),e.parent==null||e.parent.statics.blotName===`scroll`||e.parent.statics.scope!==e.statics.scope)?t:zw(e.parent,t,n)}var Bw=class e extends gw{static blotName=`cursor`;static className=`ql-cursor`;static tagName=`span`;static CONTENTS=``;static value(){}constructor(t,n,r){super(t,n),this.selection=r,this.textNode=document.createTextNode(e.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(t,n){if(this.savedLength!==0){super.format(t,n);return}let r=this,i=0;for(;r!=null&&r.statics.scope!==GC.BLOCK_BLOT;)i+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=e.CONTENTS.length,r.optimize(),r.formatAt(i,e.CONTENTS.length,t,n),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;let t=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);let n=this.prev instanceof jw?this.prev:null,r=n?n.length():0,i=this.next instanceof jw?this.next:null,a=i?i.text:``,{textNode:o}=this,s=o.data.split(e.CONTENTS).join(``);o.data=e.CONTENTS;let c;if(n)c=n,(s||i)&&(n.insertAt(n.length(),s+a),i&&i.remove());else if(i)c=i,i.insertAt(0,s);else{let e=document.createTextNode(s);c=this.scroll.create(e),this.parent.insertBefore(c,this)}if(this.remove(),t){let e=(e,t)=>n&&e===n.domNode?t:e===o?r+t-1:i&&e===i.domNode?r+s.length+t:null,a=e(t.start.node,t.start.offset),l=e(t.end.node,t.end.offset);if(a!==null&&l!==null)return{startNode:c.domNode,startOffset:a,endNode:c.domNode,endOffset:l}}return null}update(e,t){if(e.some(e=>e.type===`characterData`&&e.target===this.textNode)){let e=this.restore();e&&(t.range=e)}}optimize(t){super.optimize(t);let{parent:n}=this;for(;n;){if(n.domNode.tagName===`A`){this.savedLength=e.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return``}},Vw=u(s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this.
Line truncated
|
||||
`)&&(t<=e||!!this.scroll.descendant(Lw,e)[0]),this.scroll.insertAt(e,r);let[i,o]=this.scroll.line(e),c=UC({},zw(i));if(i instanceof Iw){let[e]=i.descendant(iw,o);e&&(c=UC(c,zw(e)))}a=kw.AttributeMap.diff(c,a)||{}}else if(typeof n.insert==`object`){let r=Object.keys(n.insert)[0];if(r==null)return e;let i=this.scroll.query(r,GC.INLINE)!=null;if(i)(t<=e||this.scroll.descendant(Lw,e)[0])&&(s=!0);else if(e>0){let[t,n]=this.scroll.descendant(iw,e-1);t instanceof jw?t.value()[n]!==`
|
||||
`&&(o=!0):t instanceof gw&&t.statics.scope===GC.INLINE_BLOT&&(o=!0)}if(this.scroll.insertAt(e,r,n.insert[r]),i){let[t]=this.scroll.descendant(iw,e);if(t){let e=UC({},zw(t));a=kw.AttributeMap.diff(e,a)||{}}}}t+=i}else if(r.push(n),n.retain!==null&&typeof n.retain==`object`){let t=Object.keys(n.retain)[0];if(t==null)return e;this.scroll.updateEmbedAt(e,t,n.retain[t])}Object.keys(a).forEach(t=>{this.scroll.formatAt(e,i,t,a[t])});let c=+!!o,l=+!!s;return t+=c+l,r.retain(c),r.delete(l),e+i+c+l},0),r.reduce((e,t)=>typeof t.delete==`number`?(this.scroll.deleteAt(e,t.delete),e):e+kw.Op.length(t),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update(new kw.default().retain(e).delete(t))}formatLine(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach(r=>{this.scroll.lines(e,Math.max(t,1)).forEach(e=>{e.format(r,n[r])})}),this.scroll.optimize();let r=new kw.default().retain(e).retain(t,XS(n));return this.update(r)}formatText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n).forEach(r=>{this.scroll.formatAt(e,t,r,n[r])});let r=new kw.default().retain(e).retain(t,XS(n));return this.update(r)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new kw.default)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],r=[];t===0?this.scroll.path(e).forEach(e=>{let[t]=e;t instanceof Iw?n.push(t):t instanceof iw&&r.push(t)}):(n=this.scroll.lines(e,t),r=this.scroll.descendants(iw,e,t));let[i,a]=[n,r].map(e=>{let t=e.shift();if(t==null)return{};let n=zw(t);for(;Object.keys(n).length>0;){let t=e.shift();if(t==null)return n;n=rT(zw(t),n)}return n});return{...i,...a}}getHTML(e,t){let[n,r]=this.scroll.line(e);if(n){let i=n.length();return n.length()>=r+t&&!(r===0&&t===i)?nT(n,r,t,!0):nT(this.scroll,e,t,!0)}return``}getText(e,t){return this.getContents(e,t).filter(e=>typeof e.insert==`string`).map(e=>e.insert).join(``)}insertContents(e,t){let n=aT(t),r=new kw.default().retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(r)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update(new kw.default().retain(e).insert({[t]:n}))}insertText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`
|
||||
`).replace(/\r/g,`
|
||||
`),this.scroll.insertAt(e,t),Object.keys(n).forEach(r=>{this.scroll.formatAt(e,t.length,r,n[r])}),this.update(new kw.default().retain(e).insert(t,XS(n)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;let e=this.scroll.children.head;if(e?.statics.blotName!==Iw.blotName)return!1;let t=e;return t.children.length>1?!1:t.children.head instanceof Aw}removeFormat(e,t){let n=this.getText(e,t),[r,i]=this.scroll.line(e+t),a=0,o=new kw.default;r!=null&&(a=r.length()-i,o=r.delta().slice(i,i+a-1).insert(`
|
||||
`));let s=this.getContents(e,t+a).diff(new kw.default().insert(n).concat(o)),c=new kw.default().retain(e).concat(s);return this.applyDelta(c)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this.delta;if(t.length===1&&t[0].type===`characterData`&&t[0].target.data.match($w)&&this.scroll.find(t[0].target)){let i=this.scroll.find(t[0].target),a=zw(i),o=i.offset(this.scroll),s=t[0].oldValue.replace(Bw.CONTENTS,``),c=new kw.default().insert(s),l=new kw.default().insert(i.value()),u=n&&{oldRange:oT(n.oldRange,-o),newRange:oT(n.newRange,-o)};e=new kw.default().retain(o).concat(c.diff(l,u)).reduce((e,t)=>t.insert?e.insert(t.insert,a):e.push(t),new kw.default),this.delta=r.compose(e)}else this.delta=this.getDelta(),(!e||!HC(r.compose(e),this.delta))&&(e=r.diff(this.delta,n));return e}};function tT(e,t,n){if(e.length===0){let[e]=iT(n.pop());return t<=0?`</li></${e}>`:`</li></${e}>${tT([],t-1,n)}`}let[{child:r,offset:i,length:a,indent:o,type:s},...c]=e,[l,u]=iT(s);if(o>t)return n.push(s),o===t+1?`<${l}><li${u}>${nT(r,i,a)}${tT(c,o,n)}`:`<${l}><li>${tT(e,t+1,n)}`;let d=n[n.length-1];if(o===t&&s===d)return`</li><li${u}>${nT(r,i,a)}${tT(c,o,n)}`;let[f]=iT(n.pop());return`</li></${f}>${tT(e,t-1,n)}`}function nT(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(`html`in e&&typeof e.html==`function`)return e.html(t,n);if(e instanceof jw)return Nw(e.value().slice(t,t+n)).replaceAll(` `,` `);if(e instanceof cw){if(e.statics.blotName===`list-container`){let r=[];return e.children.forEachAt(t,n,(e,t,n)=>{let i=`formats`in e&&typeof e.formats==`function`?e.formats():{};r.push({child:e,offset:t,length:n,indent:i.indent||0,type:i.list})}),tT(r,-1,[])}let i=[];if(e.children.forEachAt(t,n,(e,t,n)=>{i.push(nT(e,t,n))}),r||e.statics.blotName===`list`)return i.join(``);let{outerHTML:a,innerHTML:o}=e.domNode,[s,c]=a.split(`>${o}<`);return s===`<table`?`<table style="border: 1px solid #000;">${i.join(``)}<${c}`:`${s}>${i.join(``)}<${c}`}return e.domNode instanceof Element?e.domNode.outerHTML:``}function rT(e,t){return Object.keys(t).reduce((n,r)=>{if(e[r]==null)return n;let i=t[r];return i===e[r]?n[r]=i:Array.isArray(i)?i.indexOf(e[r])<0?n[r]=i.concat([e[r]]):n[r]=i:n[r]=[i,e[r]],n},{})}function iT(e){let t=e===`ordered`?`ol`:`ul`;switch(e){case`checked`:return[t,` data-list="checked"`];case`unchecked`:return[t,` data-list="unchecked"`];default:return[t,``]}}function aT(e){return e.reduce((e,t)=>{if(typeof t.insert==`string`){let n=t.insert.replace(/\r\n/g,`
|
||||
`).replace(/\r/g,`
|
||||
`);return e.insert(n,t.attributes)}return e.push(t)},new kw.default)}function oT(e,t){let{index:n,length:r}=e;return new Xw(n+t,r)}function sT(e){let t=[];return e.forEach(e=>{typeof e.insert==`string`?e.insert.split(`
|
||||
`).forEach((n,r)=>{r&&t.push({insert:`
|
||||
`,attributes:e.attributes}),n&&t.push({insert:n,attributes:e.attributes})}):t.push(e)}),t}var cT=class{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}},lT=``,uT=class extends gw{constructor(e,t){super(e,t),this.contentNode=document.createElement(`span`),this.contentNode.setAttribute(`contenteditable`,`false`),Array.from(this.domNode.childNodes).forEach(e=>{this.contentNode.appendChild(e)}),this.leftGuard=document.createTextNode(lT),this.rightGuard=document.createTextNode(lT),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,n,r=e.data.split(lT).join(``);if(e===this.leftGuard)if(this.prev instanceof jw){let e=this.prev.length();this.prev.insertAt(e,r),t={startNode:this.prev.domNode,startOffset:e+r.length}}else n=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(n),this),t={startNode:n,startOffset:r.length};else e===this.rightGuard&&(this.next instanceof jw?(this.next.insertAt(0,r),t={startNode:this.next.domNode,startOffset:r.length}):(n=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(n),this.next),t={startNode:n,startOffset:r.length}));return e.data=lT,t}update(e,t){e.forEach(e=>{if(e.type===`characterData`&&(e.target===this.leftGuard||e.target===this.rightGuard)){let n=this.restore(e.target);n&&(t.range=n)}})}},dT=class{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener(`compositionstart`,e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener(`compositionend`,e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){let t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof uT)&&(this.emitter.emit(Jw.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Jw.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Jw.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Jw.events.COMPOSITION_END,e),this.isComposing=!1}},fT=class e{static DEFAULTS={modules:{}};static themes={default:e};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]??this.addModule(e)})}addModule(e){let t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}},pT=e=>e.parentElement||e.getRootNode().host||null,mT=e=>{let t=e.getBoundingClientRect(),n=`offsetWidth`in e&&Math.abs(t.width)/e.offsetWidth||1,r=`offsetHeight`in e&&Math.abs(t.height)/e.offsetHeight||1;return{top:t.top,right:t.left+e.clientWidth*n,bottom:t.top+e.clientHeight*r,left:t.left}},hT=e=>{let t=parseInt(e,10);return Number.isNaN(t)?0:t},gT=(e,t,n,r,i,a)=>e<n&&t>r?0:e<n?-(n-e+i):t>r?t-e>r-n?e+i-n:t-r+a:0,_T=(e,t)=>{let n=e.ownerDocument,r=t,i=e;for(;i;){let e=i===n.body,t=e?{top:0,right:window.visualViewport?.width??n.documentElement.clientWidth,bottom:window.visualViewport?.height??n.documentElement.clientHeight,left:0}:mT(i),a=getComputedStyle(i),o=gT(r.left,r.right,t.left,t.right,hT(a.scrollPaddingLeft),hT(a.scrollPaddingRight)),s=gT(r.top,r.bottom,t.top,t.bottom,hT(a.scrollPaddingTop),hT(a.scrollPaddingBottom));if(o||s)if(e)n.defaultView?.scrollBy(o,s);else{let{scrollLeft:e,scrollTop:t}=i;s&&(i.scrollTop+=s),o&&(i.scrollLeft+=o);let n=i.scrollLeft-e,a=i.scrollTop-t;r={left:r.left-n,top:r.top-a,right:r.right-n,bottom:r.bottom-a}}i=e||a.position===`fixed`?null:pT(i)}},vT=100,yT=[`block`,`break`,`cursor`,`inline`,`scroll`,`text`],bT=(e,t,n)=>{let r=new YC;return yT.forEach(e=>{let n=t.query(e);n&&r.register(n)}),e.forEach(e=>{let i=t.query(e);i||n.error(`Cannot register "${e}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;i;)if(r.register(i),i=`blotName`in i?i.requiredContainer??null:null,a+=1,a>vT){n.error(`Cycle detected in registering blot requiredContainer: "${e}"`);break}}),r},xT=Kw(`quill`),ST=new YC;cw.uiClass=`ql-ui`;var $=class e{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:``,readOnly:!1,registry:ST,theme:`default`};static events=Jw.events;static sources=Jw.sources;static version=`2.0.3`;static imports={delta:kw.default,parchment:WC,"core/module":cT,"core/theme":fT};static debug(e){e===!0&&(e=`log`),Kw.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Hw.get(e)||ST.find(e,t)}static import(e){return this.imports[e]??xT.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!=`string`){let e=arguments.length<=0?void 0:arguments[0],t=!!(!(ar
Line truncated
|
||||
`});this.setContents(e)}this.history.clear(),this.options.placeholder&&this.root.setAttribute(`data-placeholder`,this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e==`string`){let t=e;e=document.createElement(`div`),e.classList.add(t)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,n){return[e,t,,n]=OT(e,t,n),DT.call(this,()=>this.editor.deleteText(e,t),n,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;let t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle(`ql-disabled`,!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Jw.sources.API;return DT.call(this,()=>{let n=this.getSelection(!0),r=new kw.default;if(n==null)return r;if(this.scroll.query(e,GC.BLOCK))r=this.editor.formatLine(n.index,n.length,{[e]:t});else if(n.length===0)return this.selection.format(e,t),r;else r=this.editor.formatText(n.index,n.length,{[e]:t});return this.setSelection(n,Jw.sources.SILENT),r},n)}formatLine(e,t,n,r,i){let a;return[e,t,a,i]=OT(e,t,n,r,i),DT.call(this,()=>this.editor.formatLine(e,t,a),i,e,0)}formatText(e,t,n,r,i){let a;return[e,t,a,i]=OT(e,t,n,r,i),DT.call(this,()=>this.editor.formatText(e,t,a),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=null;if(n=typeof e==`number`?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length),!n)return null;let r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=OT(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e==`number`?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e==`number`?this.scroll.lines(e,t):this.scroll.lines(e.index,e.length)}getModule(e){return this.theme.modules[e]}getSelection(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e==`number`&&(t??=this.getLength()-e),[e,t]=OT(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e==`number`&&(t??=this.getLength()-e),[e,t]=OT(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e.sources.API;return DT.call(this,()=>this.editor.insertEmbed(t,n,r),i,t)}insertText(e,t,n,r,i){let a;return[e,,a,i]=OT(e,0,n,r,i),DT.call(this,()=>this.editor.insertText(e,t,a),i,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,n){return[e,t,,n]=OT(e,t,n),DT.call(this,()=>this.editor.removeFormat(e,t),n,e)}scrollRectIntoView(e){_T(this.root,e)}scrollIntoView(){console.warn(`Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead.`),this.scrollSelectionIntoView()}scrollSelectionIntoView(){let e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Jw.sources.API;return DT.call(this,()=>{e=new kw.default(e);let t=this.getLength(),n=this.editor.deleteText(0,t),r=this.editor.insertContents(0,e),i=this.editor.deleteText(this.getLength()-1,1);return n.compose(r).compose(i)},t)}setSelection(t,n,r){t==null?this.selection.setRange(null,n||e.sources.API):([t,n,,r]=OT(t,n,r),this.selection.setRange(new Xw(Math.max(0,t),n),r),r!==Jw.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Jw.sources.API,n=new kw.default().insert(e);return this.setContents(n,t)
Line truncated
|
||||
`)?e.insertAt(0,t.slice(0,-1),n):e.insertAt(0,t,n)}else{let e=this.scroll.create(t,n);this.appendChild(e)}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===GC.INLINE_BLOT){let n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(e),super.insertBefore(n,t)}else super.insertBefore(e,t)}insertContents(e,t){let n=this.deltaToRenderBlocks(t.concat(new kw.default().insert(`
|
||||
`))),r=n.pop();if(r==null)return;this.batchStart();let i=n.shift();if(i){let t=i.type===`block`&&(i.delta.length()===0||!this.descendant(Lw,e)[0]&&e<this.length()),n=i.type===`block`?i.delta:new kw.default().insert({[i.key]:i.value});PT(this,e,n);let r=+(i.type===`block`),a=e+n.length()+r;t&&this.insertAt(a-1,`
|
||||
`);let o=zw(this.line(e)[0]),s=kw.AttributeMap.diff(o,i.attributes)||{};Object.keys(s).forEach(e=>{this.formatAt(a-1,1,e,s[e])}),e=a}let[a,o]=this.children.find(e);if(n.length&&(a&&(a=a.split(o),o=0),n.forEach(e=>{if(e.type===`block`)PT(this.createBlock(e.attributes,a||void 0),0,e.delta);else{let t=this.create(e.key,e.value);this.insertBefore(t,a||void 0),Object.keys(e.attributes).forEach(n=>{t.format(n,e.attributes[n])})}})),r.type===`block`&&r.delta.length()){let e=a?a.offset(a.scroll)+o:this.length();PT(this,e,r.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute(`contenteditable`)===`true`}leaf(e){let t=this.path(e).pop();if(!t)return[null,-1];let[n,r]=t;return n instanceof iw?[n,r]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(jT,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,n=(e,t,r)=>{let i=[],a=r;return e.children.forEachAt(t,r,(e,t,r)=>{jT(e)?i.push(e):e instanceof hw&&(i=i.concat(n(e,t,a))),a-=r}),i};return n(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(Jw.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=Jw.sources.USER;typeof e==`string`&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(e=>{let{target:t}=e,n=this.find(t,!0);return n&&!MT(n)}),e.length>0&&this.emitter.emit(Jw.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Jw.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){let[r]=this.descendant(e=>e instanceof Lw,e);r&&r.statics.blotName===t&&MT(r)&&r.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){let t=[],n=new kw.default;return e.forEach(e=>{let r=e?.insert;if(r)if(typeof r==`string`){let i=r.split(`
|
||||
`);i.slice(0,-1).forEach(r=>{n.insert(r,e.attributes),t.push({type:`block`,delta:n,attributes:e.attributes??{}}),n=new kw.default});let a=i[i.length-1];a&&n.insert(a,e.attributes)}else{let i=Object.keys(r)[0];if(!i)return;this.query(i,GC.INLINE)?n.push(e):(n.length()&&t.push({type:`block`,delta:n,attributes:{}}),n=new kw.default,t.push({type:`blockEmbed`,key:i,value:r[i],attributes:e.attributes??{}}))}}),n.length()&&t.push({type:`block`,delta:n,attributes:{}}),t}createBlock(e,t){let n,r={};Object.entries(e).forEach(e=>{let[t,i]=e;this.query(t,GC.BLOCK&GC.BLOT)==null?r[t]=i:n=t});let i=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(i,t||void 0);let a=i.length();return Object.entries(r).forEach(e=>{let[t,n]=e;i.formatAt(0,a,t,n)}),i}};function PT(e,t,n){n.reduce((t,n)=>{let r=kw.Op.length(n),i=n.attributes||{};if(n.insert!=null){if(typeof n.insert==`string`){let r=n.insert;e.insertAt(t,r);let[a]=e.descendant(iw,t),o=zw(a);i=kw.AttributeMap.diff(o,i)||{}}else if(typeof n.insert==`object`){let r=Object.keys(n.insert)[0];if(r==null)return t;if(e.insertAt(t,r,n.insert[r]),e.scroll.query(r,GC.INLINE)!=null){let[n]=e.descendant(iw,t),r=zw(n);i=kw.AttributeMap.diff(r,i)||{}}}}return Object.keys(i).forEach(n=>{e.formatAt(t,r,n,i[n])}),t+r},t)}var FT={scope:GC.BLOCK,whitelist:[`right`,`center`,`justify`]},IT=new KC(`align`,`align`,FT),LT=new ZC(`align`,`ql-align`,FT),RT=new $C(`align`,`text-align`,FT),zT=class extends $C{value(e){let t=super.value(e);return t.startsWith(`rgb(`)?(t=t.replace(/^[^\d]+/,``).replace(/[^\d]+$/,``),`#${t.split(`,`).map(e=>`00${parseInt(e,10).toString(16)}`.slice(-2)).join(``)}`):t}},BT=new ZC(`color`,`ql-color`,{scope:GC.INLINE}),VT=new zT(`color`,`color`,{scope:GC.INLINE}),HT=new ZC(`background`,`ql-bg`,{scope:GC.INLINE}),UT=new zT(`background`,`background-color`,{scope:GC.INLINE}),WT=class extends AT{static create(e){let t=super.create(e);return t.setAttribute(`spellcheck`,`false`),t}code(e,t){return this.children.map(e=>e.length()<=1?``:e.domNode.innerText).join(`
|
||||
`).slice(e,e+t)}html(e,t){return`<pre>\n${Nw(this.code(e,t))}\n</pre>`}},GT=class extends Iw{static TAB=` `;static register(){$.register(WT)}},KT=class extends Pw{};KT.blotName=`code`,KT.tagName=`CODE`,GT.blotName=`code-block`,GT.className=`ql-code-block`,GT.tagName=`DIV`,WT.blotName=`code-block-container`,WT.className=`ql-code-block-container`,WT.tagName=`DIV`,WT.allowedChildren=[GT],GT.allowedChildren=[jw,Aw,Bw],GT.requiredContainer=WT;var qT={scope:GC.BLOCK,whitelist:[`rtl`]},JT=new KC(`direction`,`dir`,qT),YT=new ZC(`direction`,`ql-direction`,qT),XT=new $C(`direction`,`direction`,qT),ZT={scope:GC.INLINE,whitelist:[`serif`,`monospace`]},QT=new ZC(`font`,`ql-font`,ZT),$T=new class extends $C{value(e){return super.value(e).replace(/["']/g,``)}}(`font`,`font-family`,ZT),eE=new ZC(`size`,`ql-size`,{scope:GC.INLINE,whitelist:[`small`,`large`,`huge`]}),tE=new $C(`size`,`font-size`,{scope:GC.INLINE,whitelist:[`10px`,`18px`,`32px`]}),nE=Kw(`quill:keyboard`),rE=/Mac/i.test(navigator.platform)?`metaKey`:`ctrlKey`,iE=class e extends cT{static match(e,t){return[`altKey`,`ctrlKey`,`metaKey`,`shiftKey`].some(n=>!!t[n]!==e[n]&&t[n]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(e=>{this.options.bindings[e]&&this.addBinding(this.options.bindings[e])}),this.addBinding({key:`Enter`,shiftKey:null},this.handleEnter),this.addBinding({key:`Enter`,metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:`Backspace`},{collapsed:!0},this.handleBackspace),this.addBinding({key:`Delete`},{collapsed:!0},this.handleDelete)):(this.addBinding({key:`Backspace`},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:`Delete`},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:`Backspace`},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:`Delete`},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:`Backspace`,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=lE(e);if(r==null){nE.warn(`Attempted to add invalid keyboard binding`,r);return}typeof t==`function`&&(t={handler:t}),typeof n==`function`&&(n={handler:n}),(Array.isArray(r.key)?r.key:[r.key]).forEach(e=>{let i={...r,key:e,...t,...n};this.bindings[i.key]=this.bindings[i.key]||[],this.bindings[i.key].push(i)})}listen(){this.quill.root.addEventListener(`keydown`,t=>{if(t.defaultPrevented||t.isComposing||t.keyCode===229&&(t.key===`Enter`||t.key===`Backspace`))return;let n=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(n=>e.match(t,n));if(n.length===0)return;let r=$.find(t.target,!0);if(r&&r.scroll!==this.quill.scroll)return;let i=this.quill.getSelection();if(i==null||!this.quill.hasFocus())return;let[a,o]=this.quill.getLine(i.index),[s,c]=this.quill.getLeaf(i.index),[l,u]=i.length===0?[s,c]:this.quill.getLeaf(i.index+i.length),d=s instanceof Sw?s.value().slice(0,c):``,f=l instanceof Sw?l.value().slice(u):``,p={collapsed:i.length===0,empty:i.length===0&&a.length()<=1,format:this.quill.getFormat(i),line:a,offset:o,prefix:d,suffix:f,event:t};n.some(e=>{if(e.collapsed!=null&&e.collapsed!==p.collapsed||e.empty!=null&&e.empty!==p.empty||e.offset!=null&&e.offset!==p.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(e=>p.format[e]==null))return!1}else if(typeof e.format==`object`&&!Object.keys(e.format).every(t=>e.format[t]===!0?p.format[t]!=null:e.format[t]===!1?p.format[t]==null:HC(e.format[t],p.format[t])))return!1;return e.prefix!=null&&!e.prefix.test(p.prefix)||e.suffix!=null&&!e.suffix.test(p.suffix)?!1:e.handler.call(this,i,p,e)!==!0})&&t.preventDefault()})}handleBackspace(e,t){let n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let r={},[i]=this.quill.getLine(e.index),a=new kw.default().retain(e.index-n).delete(n);if(t.offset===0){let[t]=this.quill.getLine(e.index-1);if(t&&!(t.statics.blotName===`block`&&t.length()<=1)){let t=i.formats(),n=this.quill.getFormat(e.index-1,1);if(r=kw.AttributeMap.diff(t,n)||{},Object.keys(r).length>0){let t=new kw.default().retain(e.index+i.length()-2).retain(1,r);a=a.compose(t)}}}this.quill.updateContents(a,$.sources.USER),this.quill.focus()}handleDelete(e,t){let n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-n)return;let r={},[i]=this.quill.getLine(e.index),a=new kw.default().retain(e.index).delete(n);if(t.offset>=i.length()-1){let[t]=this.quill.getLine(e.index+1);if(t){let n=i.formats(),o=this.quill.getFormat(e.index,1);r=kw.AttributeMap.diff(n,o)||{},Object.keys(r).length>0&&(a=a.retain(t.length()-1).retain(1,r))}}this.quill.updateContents(a,$.sources.USER),this.quill.focus()}handleDeleteRange(e){uE({range:e,quill:this.quill}),this.quillLine truncated
|
||||
`,n);this.quill.updateContents(r,$.sources.USER),this.quill.setSelection(e.index+1,$.sources.SILENT),this.quill.focus()}};iE.DEFAULTS={bindings:{bold:sE(`bold`),italic:sE(`italic`),underline:sE(`underline`),indent:{key:`Tab`,format:[`blockquote`,`indent`,`list`],handler(e,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format(`indent`,`+1`,$.sources.USER),!1)}},outdent:{key:`Tab`,shiftKey:!0,format:[`blockquote`,`indent`,`list`],handler(e,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format(`indent`,`-1`,$.sources.USER),!1)}},"outdent backspace":{key:`Backspace`,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:[`indent`,`list`],offset:0,handler(e,t){t.format.indent==null?t.format.list!=null&&this.quill.format(`list`,!1,$.sources.USER):this.quill.format(`indent`,`-1`,$.sources.USER)}},"indent code-block":aE(!0),"outdent code-block":aE(!1),"remove tab":{key:`Tab`,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(e){this.quill.deleteText(e.index-1,1,$.sources.USER)}},tab:{key:`Tab`,handler(e,t){if(t.format.table)return!0;this.quill.history.cutoff();let n=new kw.default().retain(e.index).delete(e.length).insert(` `);return this.quill.updateContents(n,$.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,$.sources.SILENT),!1}},"blockquote empty enter":{key:`Enter`,collapsed:!0,format:[`blockquote`],empty:!0,handler(){this.quill.format(`blockquote`,!1,$.sources.USER)}},"list empty enter":{key:`Enter`,collapsed:!0,format:[`list`],empty:!0,handler(e,t){let n={list:!1};t.format.indent&&(n.indent=!1),this.quill.formatLine(e.index,e.length,n,$.sources.USER)}},"checklist enter":{key:`Enter`,collapsed:!0,format:{list:`checked`},handler(e){let[t,n]=this.quill.getLine(e.index),r={...t.formats(),list:`checked`},i=new kw.default().retain(e.index).insert(`
|
||||
`,r).retain(t.length()-n-1).retain(1,{list:`unchecked`});this.quill.updateContents(i,$.sources.USER),this.quill.setSelection(e.index+1,$.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:`Enter`,collapsed:!0,format:[`header`],suffix:/^$/,handler(e,t){let[n,r]=this.quill.getLine(e.index),i=new kw.default().retain(e.index).insert(`
|
||||
`,t.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,$.sources.USER),this.quill.setSelection(e.index+1,$.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:`Backspace`,format:[`table`],collapsed:!0,offset:0,handler(){}},"table delete":{key:`Delete`,format:[`table`],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:`Enter`,shiftKey:null,format:[`table`],handler(e){let t=this.quill.getModule(`table`);if(t){let[n,r,i,a]=t.getTable(e),o=dE(n,r,i,a);if(o==null)return;let s=n.offset();if(o<0){let t=new kw.default().retain(s).insert(`
|
||||
`);this.quill.updateContents(t,$.sources.USER),this.quill.setSelection(e.index+1,e.length,$.sources.SILENT)}else if(o>0){s+=n.length();let e=new kw.default().retain(s).insert(`
|
||||
`);this.quill.updateContents(e,$.sources.USER),this.quill.setSelection(s,$.sources.USER)}}}},"table tab":{key:`Tab`,shiftKey:null,format:[`table`],handler(e,t){let{event:n,line:r}=t,i=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(i-1,$.sources.USER):this.quill.setSelection(i+r.length(),$.sources.USER)}},"list autofill":{key:` `,shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(e,t){if(this.quill.scroll.query(`list`)==null)return!0;let{length:n}=t.prefix,[r,i]=this.quill.getLine(e.index);if(i>n)return!0;let a;switch(t.prefix.trim()){case`[]`:case`[ ]`:a=`unchecked`;break;case`[x]`:a=`checked`;break;case`-`:case`*`:a=`bullet`;break;default:a=`ordered`}this.quill.insertText(e.index,` `,$.sources.USER),this.quill.history.cutoff();let o=new kw.default().retain(e.index-i).delete(n+1).retain(r.length()-2-i).retain(1,{list:a});return this.quill.updateContents(o,$.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,$.sources.SILENT),!1}},"code exit":{key:`Enter`,collapsed:!0,format:[`code-block`],prefix:/^$/,suffix:/^\s*$/,handler(e){let[t,n]=this.quill.getLine(e.index),r=2,i=t;for(;i!=null&&i.length()<=1&&i.formats()[`code-block`];)if(i=i.prev,--r,r<=0){let r=new kw.default().retain(e.index+t.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(r,$.sources.USER),this.quill.setSelection(e.index-1,$.sources.SILENT),!1}return!0}},"embed left":oE(`ArrowLeft`,!1),"embed left shift":oE(`ArrowLeft`,!0),"embed right":oE(`ArrowRight`,!1),"embed right shift":oE(`ArrowRight`,!0),"table down":cE(!1),"table up":cE(!0)}};function aE(e){return{key:`Tab`,shiftKey:!e,format:{"code-block":!0},handler(t,n){let{event:r}=n,{TAB:i}=this.quill.scroll.query(`code-block`);if(t.length===0&&!r.shiftKey){this.quill.insertText(t.index,i,$.sources.USER),this.quill.setSelection(t.index+i.length,$.sources.SILENT);return}let a=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t),{index:o,length:s}=t;a.forEach((t,n)=>{e?(t.insertAt(0,i),n===0?o+=i.length:s+=i.length):t.domNode.textContent.startsWith(i)&&(t.deleteAt(0,i.length),n===0?o-=i.length:s-=i.length)}),this.quill.update($.sources.USER),this.quill.setSelection(o,s,$.sources.SILENT)}}}function oE(e,t){return{key:e,shiftKey:t,altKey:null,[e===`ArrowLeft`?`prefix`:`suffix`]:/^$/,handler(n){let{index:r}=n;e===`ArrowRight`&&(r+=n.length+1);let[i]=this.quill.getLeaf(r);return i instanceof gw?(e===`ArrowLeft`?t?this.quill.setSelection(n.index-1,n.length+1,$.sources.USER):this.quill.setSelection(n.index-1,$.sources.USER):t?this.quill.setSelection(n.index,n.length+1,$.sources.USER):this.quill.setSelection(n.index+n.length+1,$.sources.USER),!1):!0}}}function sE(e){return{key:e[0],shortKey:!0,handler(t,n){this.quill.format(e,!n.format[e],$.sources.USER)}}}function cE(e){return{key:e?`ArrowUp`:`ArrowDown`,collapsed:!0,format:[`table`],handler(t,n){let r=e?`prev`:`next`,i=n.line,a=i.parent[r];if(a!=null){if(a.statics.blotName===`table-row`){let e=a.children.head,t=i;for(;t.prev!=null;)t=t.prev,e=e.next;let r=e.offset(this.quill.scroll)+Math.min(n.offset,e.length()-1);this.quill.setSelection(r,0,$.sources.USER)}}else{let t=i.table()[r];t!=null&&(e?this.quill.setSelection(t.offset(this.quill.scroll)+t.length()-1,0,$.sources.USER):this.quill.setSelection(t.offset(this.quill.scroll),0,$.sources.USER))}return!1}}}function lE(e){if(typeof e==`string`||typeof e==`number`)e={key:e};else if(typeof e==`object`)e=XS(e);else return null;return e.shortKey&&(e[rE]=e.shortKey,delete e.shortKey),e}function uE(e){let{quill:t,range:n}=e,r=t.getLines(n),i={};if(r.length>1){let e=r[0].formats(),t=r[r.length-1].formats();i=kw.AttributeMap.diff(t,e)||{}}t.deleteText(n,$.sources.USER),Object.keys(i).length>0&&t.formatLine(n.index,1,i,$.sources.USER),t.setSelection(n.index,$.sources.SILENT)}function dE(e,t,n,r){return t.prev==null&&t.next==null?n.prev==null&&n.next==null?r===0?-1:1:n.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}var fE=/font-weight:\s*normal/,pE=[`P`,`OL`,`UL`],mE=e=>e&&pE.includes(e.tagName),hE=e=>{Array.from(e.querySelectorAll(`br`)).filter(e=>mE(e.previousElementSibling)&&mE(e.nextElementSibling)).forEach(e=>{e.parentNode?.removeChild(e)})},gE=e=>{Array.from(e.querySelectorAll(`b[style*="font-weight"]`)).filter(e=>e.getAttribute(`style`)?.match(fE)).forEach(t=>{let n=e.createDocumentFragment();n.append(...t.childNodes),t.parentNode?.replaceChild(n,t)})};function _E(e){e.querySelector(`[id^="docs-internal-guid-"]`)&&(gE(e),hE(e))}var vE=/\bmso-list:[^;]*ignore/i,yE=/\bmso-list:[^;]*\bl(\d+)/i,bE=/\bmso-list:[^;]*\blevel(\d+)/i,xE=(e,t)=>{let n=e.getAttribute(`style`),r=n?.match(yE);if(!r)return null;let i=Number(r[1]),a=n?.match(bE),o=a?Number(a[1]):1,s=RegExp(`@list l${i}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,`i`),c=t.match(s);return{id:i,indent:o,type:c&&c[1]===`bullet`?`bullet`:`ordered`,element:e}},SE=e=>{let t=Arra
Line truncated
|
||||
`)&&(i.ops[i.ops.length-1].attributes==null||r.table)?i.compose(new kw.default().retain(i.length()-1).delete(1)):i}normalizeHTML(e){TE(e)}convertHTML(e){let t=new DOMParser().parseFromString(e,`text/html`);this.normalizeHTML(t);let n=t.body,r=new WeakMap,[i,a]=this.prepareMatching(n,r);return LE(this.quill.scroll,n,i,a,r)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$.sources.API;if(typeof e==`string`){let n=this.convert({html:e,text:``});this.quill.setContents(n,t),this.quill.setSelection(0,$.sources.SILENT)}else{let r=this.convert({html:t,text:``});this.quill.updateContents(new kw.default().retain(e).concat(r),n),this.quill.setSelection(e+r.length(),$.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();let[n]=this.quill.selection.getRange();if(n==null)return;let{html:r,text:i}=this.onCopy(n,t);e.clipboardData?.setData(`text/plain`,i),e.clipboardData?.setData(`text/html`,r),t&&uE({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(e=>e[0]!==`#`).join(`
|
||||
`)}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();let t=this.quill.getSelection(!0);if(t==null)return;let n=e.clipboardData?.getData(`text/html`),r=e.clipboardData?.getData(`text/plain`);if(!n&&!r){let t=e.clipboardData?.getData(`text/uri-list`);t&&(r=this.normalizeURIList(t))}let i=Array.from(e.clipboardData?.files||[]);if(!n&&i.length>0){this.quill.uploader.upload(t,i);return}if(n&&i.length>0){let e=new DOMParser().parseFromString(n,`text/html`);if(e.body.childElementCount===1&&e.body.firstElementChild?.tagName===`IMG`){this.quill.uploader.upload(t,i);return}}this.onPaste(t,{html:n,text:r})}onCopy(e){let t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:r}=t,i=this.quill.getFormat(e.index),a=this.convert({text:n,html:r},i);EE.log(`onPaste`,a,{text:n,html:r});let o=new kw.default().retain(e.index).delete(e.length).concat(a);this.quill.updateContents(o,$.sources.USER),this.quill.setSelection(o.length()-e.length,$.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){let n=[],r=[];return this.matchers.forEach(i=>{let[a,o]=i;switch(a){case Node.TEXT_NODE:r.push(o);break;case Node.ELEMENT_NODE:n.push(o);break;default:Array.from(e.querySelectorAll(a)).forEach(e=>{t.has(e)?t.get(e)?.push(o):t.set(e,[o])});break}}),[n,r]}};function jE(e,t,n,r){return r.query(t)?e.reduce((e,r)=>{if(!r.insert)return e;if(r.attributes&&r.attributes[t])return e.push(r);let i=n?{[t]:n}:{};return e.insert(r.insert,{...i,...r.attributes})},new kw.default):e}function ME(e,t){let n=``;for(let r=e.ops.length-1;r>=0&&n.length<t.length;--r){let t=e.ops[r];if(typeof t.insert!=`string`)break;n=t.insert+n}return n.slice(-1*t.length)===t}function NE(e,t){if(!(e instanceof Element))return!1;let n=t.query(e);return n&&n.prototype instanceof gw?!1:`address.article.blockquote.canvas.dd.div.dl.dt.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.iframe.li.main.nav.ol.output.p.pre.section.table.td.tr.ul.video`.split(`.`).includes(e.tagName.toLowerCase())}function PE(e,t){return e.previousElementSibling&&e.nextElementSibling&&!NE(e.previousElementSibling,t)&&!NE(e.nextElementSibling,t)}var FE=new WeakMap;function IE(e){return e==null?!1:(FE.has(e)||(e.tagName===`PRE`?FE.set(e,!0):FE.set(e,IE(e.parentNode))),FE.get(e))}function LE(e,t,n,r,i){return t.nodeType===t.TEXT_NODE?r.reduce((n,r)=>r(t,n,e),new kw.default):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((a,o)=>{let s=LE(e,o,n,r,i);return o.nodeType===t.ELEMENT_NODE&&(s=n.reduce((t,n)=>n(o,t,e),s),s=(i.get(o)||[]).reduce((t,n)=>n(o,t,e),s)),a.concat(s)},new kw.default):new kw.default}function RE(e){return(t,n,r)=>jE(n,e,!0,r)}function zE(e,t,n){let r=KC.keys(e),i=ZC.keys(e),a=$C.keys(e),o={};return r.concat(i).concat(a).forEach(t=>{let r=n.query(t,GC.ATTRIBUTE);r!=null&&(o[r.attrName]=r.value(e),o[r.attrName])||(r=OE[t],r!=null&&(r.attrName===t||r.keyName===t)&&(o[r.attrName]=r.value(e)||void 0),r=kE[t],r!=null&&(r.attrName===t||r.keyName===t)&&(r=kE[t],o[r.attrName]=r.value(e)||void 0))}),Object.entries(o).reduce((e,t)=>{let[r,i]=t;return jE(e,r,i,n)},t)}function BE(e,t,n){let r=n.query(e);if(r==null)return t;if(r.prototype instanceof gw){let t={},i=r.value(e);if(i!=null)return t[r.blotName]=i,new kw.default().insert(t,r.formats(e,n))}else if(r.prototype instanceof pw&&!ME(t,`
|
||||
`)&&t.insert(`
|
||||
`),`blotName`in r&&`formats`in r&&typeof r.formats==`function`)return jE(t,r.blotName,r.formats(e,n),n);return t}function VE(e,t){return ME(t,`
|
||||
`)||t.insert(`
|
||||
`),t}function HE(e,t,n){let r=n.query(`code-block`);return jE(t,`code-block`,r&&`formats`in r&&typeof r.formats==`function`?r.formats(e,n):!0,n)}function UE(){return new kw.default}function WE(e,t,n){let r=n.query(e);if(r==null||r.blotName!==`list`||!ME(t,`
|
||||
`))return t;let i=-1,a=e.parentNode;for(;a!=null;)[`OL`,`UL`].includes(a.tagName)&&(i+=1),a=a.parentNode;return i<=0?t:t.reduce((e,t)=>t.insert?t.attributes&&typeof t.attributes.indent==`number`?e.push(t):e.insert(t.insert,{indent:i,...t.attributes||{}}):e,new kw.default)}function GE(e,t,n){let r=e,i=r.tagName===`OL`?`ordered`:`bullet`,a=r.getAttribute(`data-checked`);return a&&(i=a===`true`?`checked`:`unchecked`),jE(t,`list`,i,n)}function KE(e,t,n){if(!ME(t,`
|
||||
`)){if(NE(e,n)&&(e.childNodes.length>0||e instanceof HTMLParagraphElement))return t.insert(`
|
||||
`);if(t.length()>0&&e.nextSibling){let r=e.nextSibling;for(;r!=null;){if(NE(r,n))return t.insert(`
|
||||
`);let e=n.query(r);if(e&&e.prototype instanceof Lw)return t.insert(`
|
||||
`);r=r.firstChild}}}return t}function qE(e,t,n){let r={},i=e.style||{};return i.fontStyle===`italic`&&(r.italic=!0),i.textDecoration===`underline`&&(r.underline=!0),i.textDecoration===`line-through`&&(r.strike=!0),(i.fontWeight?.startsWith(`bold`)||parseInt(i.fontWeight,10)>=700)&&(r.bold=!0),t=Object.entries(r).reduce((e,t)=>{let[r,i]=t;return jE(e,r,i,n)},t),parseFloat(i.textIndent||0)>0?new kw.default().insert(` `).concat(t):t}function JE(e,t,n){let r=e.parentElement?.tagName===`TABLE`?e.parentElement:e.parentElement?.parentElement;return r==null?t:jE(t,`table`,Array.from(r.querySelectorAll(`tr`)).indexOf(e)+1,n)}function YE(e,t,n){let r=e.data;if(e.parentElement?.tagName===`O:P`)return t.insert(r.trim());if(!IE(e)){if(r.trim().length===0&&r.includes(`
|
||||
`)&&!PE(e,n))return t;r=r.replace(/[^\S\u00a0]/g,` `),r=r.replace(/ {2,}/g,` `),(e.previousSibling==null&&e.parentElement!=null&&NE(e.parentElement,n)||e.previousSibling instanceof Element&&NE(e.previousSibling,n))&&(r=r.replace(/^ /,``)),(e.nextSibling==null&&e.parentElement!=null&&NE(e.parentElement,n)||e.nextSibling instanceof Element&&NE(e.nextSibling,n))&&(r=r.replace(/ $/,``)),r=r.replaceAll(`\xA0`,` `)}return t.insert(r)}var XE=class extends cT{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on($.events.EDITOR_CHANGE,(e,t,n,r)=>{e===$.events.SELECTION_CHANGE?t&&r!==$.sources.SILENT&&(this.currentRange=t):e===$.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||r===$.sources.USER?this.record(t,n):this.transform(t)),this.currentRange=eD(this.currentRange,t))}),this.quill.keyboard.addBinding({key:`z`,shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:[`z`,`Z`],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:`y`,shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener(`beforeinput`,e=>{e.inputType===`historyUndo`?(this.undo(),e.preventDefault()):e.inputType===`historyRedo`&&(this.redo(),e.preventDefault())})}change(e,t){if(this.stack[e].length===0)return;let n=this.stack[e].pop();if(!n)return;let r=this.quill.getContents(),i=n.delta.invert(r);this.stack[t].push({delta:i,range:eD(n.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,$.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(e.ops.length===0)return;this.stack.redo=[];let n=e.invert(t),r=this.currentRange,i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){let e=this.stack.undo.pop();e&&(n=n.compose(e.delta),r=e.range)}else this.lastRecorded=i;n.length()!==0&&(this.stack.undo.push({delta:n,range:r}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change(`redo`,`undo`)}transform(e){ZE(this.stack.undo,e),ZE(this.stack.redo,e)}undo(){this.change(`undo`,`redo`)}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,$.sources.USER);else{let t=$E(this.quill.scroll,e.delta);this.quill.setSelection(t,$.sources.USER)}}};function ZE(e,t){let n=t;for(let t=e.length-1;t>=0;--t){let r=e[t];e[t]={delta:n.transform(r.delta,!0),range:r.range&&eD(r.range,n)},n=r.delta.transform(n),e[t].delta.length()===0&&e.splice(t,1)}}function QE(e,t){let n=t.ops[t.ops.length-1];return n==null?!1:n.insert==null?n.attributes==null?!1:Object.keys(n.attributes).some(t=>e.query(t,GC.BLOCK)!=null):typeof n.insert==`string`&&n.insert.endsWith(`
|
||||
`)}function $E(e,t){let n=t.reduce((e,t)=>e+(t.delete||0),0),r=t.length()-n;return QE(e,t)&&--r,r}function eD(e,t){if(!e)return e;let n=t.transformPosition(e.index);return{index:n,length:t.transformPosition(e.index+e.length)-n}}var tD=class extends cT{constructor(e,t){super(e,t),e.root.addEventListener(`drop`,t=>{t.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(t.clientX,t.clientY);else if(document.caretPositionFromPoint){let e=document.caretPositionFromPoint(t.clientX,t.clientY);n=document.createRange(),n.setStart(e.offsetNode,e.offset),n.setEnd(e.offsetNode,e.offset)}let r=n&&e.selection.normalizeNative(n);if(r){let n=e.selection.normalizedToRange(r);t.dataTransfer?.files&&this.upload(n,t.dataTransfer.files)}})}upload(e,t){let n=[];Array.from(t).forEach(e=>{e&&this.options.mimetypes?.includes(e.type)&&n.push(e)}),n.length>0&&this.options.handler.call(this,e,n)}};tD.DEFAULTS={mimetypes:[`image/png`,`image/jpeg`],handler(e,t){if(!this.quill.scroll.query(`image`))return;let n=t.map(e=>new Promise(t=>{let n=new FileReader;n.onload=()=>{t(n.result)},n.readAsDataURL(e)}));Promise.all(n).then(t=>{let n=t.reduce((e,t)=>e.insert({image:t}),new kw.default().retain(e.index).delete(e.length));this.quill.updateContents(n,Jw.sources.USER),this.quill.setSelection(e.index+t.length,Jw.sources.SILENT)})}};var nD=[`insertText`,`insertReplacementText`],rD=class extends cT{constructor(e,t){super(e,t),e.root.addEventListener(`beforeinput`,e=>{this.handleBeforeInput(e)}),/Android/i.test(navigator.userAgent)||e.on($.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){uE({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``;if(e.length===0)return!1;if(t){let n=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new kw.default().retain(e.index).insert(t,n),$.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,$.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!nD.includes(e.inputType))return;let t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;let n=iD(e);if(n==null)return;let r=this.quill.selection.normalizeNative(t),i=r?this.quill.selection.normalizedToRange(r):null;i&&this.replaceText(i,n)&&e.preventDefault()}handleCompositionStart(){let e=this.quill.getSelection();e&&this.replaceText(e)}};function iD(e){return typeof e.data==`string`?e.data:e.dataTransfer?.types.includes(`text/plain`)?e.dataTransfer.getData(`text/plain`):null}var aD=/Mac/i.test(navigator.platform),oD=e=>!!(e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Home`||aD&&e.key===`a`&&e.ctrlKey===!0),sD=class extends cT{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:[`ArrowLeft`,`ArrowRight`],offset:0,shiftKey:null,handler(e,t){let{line:n,event:r}=t;if(!(n instanceof cw)||!n.uiNode)return!0;let i=getComputedStyle(n.domNode).direction===`rtl`;return i&&r.key!==`ArrowRight`||!i&&r.key!==`ArrowLeft`?!0:(this.quill.setSelection(e.index-1,e.length+ +!!r.shiftKey,$.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener(`keydown`,e=>{!e.defaultPrevented&&oD(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){this.selectionChangeDeadline=Date.now()+100,!this.isListening&&(this.isListening=!0,document.addEventListener(`selectionchange`,()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()},{once:!0}))}handleSelectionChange(){let e=document.getSelection();if(!e)return;let t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;let n=this.quill.scroll.find(t.startContainer);if(!(n instanceof cw)||!n.uiNode)return;let r=document.createRange();r.setStartAfter(n.uiNode),r.setEndAfter(n.uiNode),e.removeAllRanges(),e.addRange(r)}};$.register({"blots/block":Iw,"blots/block/embed":Lw,"blots/break":Aw,"blots/container":AT,"blots/cursor":Bw,"blots/embed":uT,"blots/inline":Pw,"blots/scroll":NT,"blots/text":jw,"modules/clipboard":AE,"modules/history":XE,"modules/keyboard":iE,"modules/uploader":tD,"modules/input":rD,"modules/uiNode":sD});var cD=$,lD=new class extends ZC{add(e,t){let n=0;if(t===`+1`||t===`-1`){let r=this.value(e)||0;n=t===`+1`?r+1:r-1}else typeof t==`number`&&(n=t);return n===0?(this.remove(e),!0):super.add(e,n.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}(`indent`,`ql-indent`,{scope:GC.BLOCK,whitelist:[1,2,3,4,5,6,7,8]}),uD=class extends Iw{static blotName=`blockquote`;static tagName=`blockquote`},dD=class extends Iw{static blotName=`header`;static tagName=[`H1`,`H2`,`H3`,`H4`,`H5`,`H6`];static formats(e){return this.tagName.indexOf(e.tagName
Line truncated
|
||||
`)}\n`,r=OD.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==n){if(n.trim().length>0||this.cachedText==null){let t=this.children.reduce((e,t)=>e.concat(Rw(t,!1)),new kw.default),i=e(n,r);t.diff(i).reduce((e,t)=>{let{retain:n,attributes:r}=t;return n?(r&&Object.keys(r).forEach(t=>{[OD.blotName,DD.blotName].includes(t)&&this.formatAt(e,n,t,r[t])}),e+n):e},0)}this.cachedText=n,this.forceNext=!1}}html(e,t){let[n]=this.children.find(e);return`<pre data-language="${n?OD.formats(n.domNode):`plain`}">\n${Nw(this.code(e,t))}\n</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){let e=OD.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}};kD.allowedChildren=[OD],OD.requiredContainer=kD,OD.allowedChildren=[DD,Bw,jw,Aw];var AD=(e,t,n)=>{if(typeof e.versionString==`string`){let r=e.versionString.split(`.`)[0];if(parseInt(r,10)>=11)return e.highlight(n,{language:t}).value}return e.highlight(t,n).value},jD=class extends cT{static register(){$.register(DD,!0),$.register(OD,!0),$.register(kD,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw Error(`Syntax module requires highlight.js. Please include the library on the page before Quill.`);this.languages=this.options.languages.reduce((e,t)=>{let{key:n}=t;return e[n]=!0,e},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on($.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof kD))return;let t=this.quill.root.ownerDocument.createElement(`select`);this.options.languages.forEach(e=>{let{key:n,label:r}=e,i=t.ownerDocument.createElement(`option`);i.textContent=r,i.setAttribute(`value`,n),t.appendChild(i)}),t.addEventListener(`change`,()=>{e.format(OD.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode??(e.attachUI(t),e.children.head&&(t.value=OD.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on($.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update($.sources.USER);let n=this.quill.getSelection();(e==null?this.quill.scroll.descendants(kD):[e]).forEach(e=>{e.highlight(this.highlightBlot,t)}),this.quill.update($.sources.SILENT),n!=null&&this.quill.setSelection(n,$.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`plain`;if(t=this.languages[t]?t:`plain`,t===`plain`)return Nw(e).split(`
|
||||
`).reduce((e,n,r)=>(r!==0&&e.insert(`
|
||||
`,{[GT.blotName]:t}),e.insert(n)),new kw.default);let n=this.quill.root.ownerDocument.createElement(`div`);return n.classList.add(GT.className),n.innerHTML=AD(this.options.hljs,t,e),LE(this.quill.scroll,n,[(e,t)=>{let n=ED.value(e);return n?t.compose(new kw.default().retain(t.length(),{[DD.blotName]:n})):t}],[(e,n)=>e.data.split(`
|
||||
`).reduce((e,n,r)=>(r!==0&&e.insert(`
|
||||
`,{[GT.blotName]:t}),e.insert(n)),n)],new WeakMap)}};jD.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:`plain`,label:`Plain`},{key:`bash`,label:`Bash`},{key:`cpp`,label:`C++`},{key:`cs`,label:`C#`},{key:`css`,label:`CSS`},{key:`diff`,label:`Diff`},{key:`xml`,label:`HTML/XML`},{key:`java`,label:`Java`},{key:`javascript`,label:`JavaScript`},{key:`markdown`,label:`Markdown`},{key:`php`,label:`PHP`},{key:`python`,label:`Python`},{key:`ruby`,label:`Ruby`},{key:`sql`,label:`SQL`}]};var MD=class e extends Iw{static blotName=`table`;static tagName=`TD`;static create(e){let t=super.create();return e?t.setAttribute(`data-row`,e):t.setAttribute(`data-row`,ID()),t}static formats(e){if(e.hasAttribute(`data-row`))return e.getAttribute(`data-row`)}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,n){t===e.blotName&&n?this.domNode.setAttribute(`data-row`,n):super.format(t,n)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}},ND=class extends AT{static blotName=`table-row`;static tagName=`TR`;checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){let e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===r.table}return!1}optimize(e){super.optimize(e),this.children.forEach(e=>{if(e.next==null)return;let t=e.formats(),n=e.next.formats();if(t.table!==n.table){let t=this.splitAfter(e);t&&t.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}},PD=class extends AT{static blotName=`table-body`;static tagName=`TBODY`},FD=class extends AT{static blotName=`table-container`;static tagName=`TABLE`;balanceCells(){let e=this.descendants(ND),t=e.reduce((e,t)=>Math.max(t.children.length,e),0);e.forEach(e=>{Array(t-e.children.length).fill(0).forEach(()=>{let t;e.children.head!=null&&(t=MD.formats(e.children.head.domNode));let n=this.scroll.create(MD.blotName,t);e.appendChild(n),n.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){let[t]=this.descendant(PD);t==null||t.children.head==null||t.children.forEach(t=>{t.children.at(e)?.remove()})}insertColumn(e){let[t]=this.descendant(PD);t==null||t.children.head==null||t.children.forEach(t=>{let n=t.children.at(e),r=MD.formats(t.children.head.domNode),i=this.scroll.create(MD.blotName,r);t.insertBefore(i,n)})}insertRow(e){let[t]=this.descendant(PD);if(t==null||t.children.head==null)return;let n=ID(),r=this.scroll.create(ND.blotName);t.children.head.children.forEach(()=>{let e=this.scroll.create(MD.blotName,n);r.appendChild(e)});let i=t.children.at(e);t.insertBefore(r,i)}rows(){let e=this.children.head;return e==null?[]:e.children.map(e=>e)}};FD.allowedChildren=[PD],PD.requiredContainer=FD,PD.allowedChildren=[ND],ND.requiredContainer=PD,ND.allowedChildren=[MD],MD.requiredContainer=ND;function ID(){return`row-${Math.random().toString(36).slice(2,6)}`}var LD=class extends cT{static register(){$.register(MD),$.register(ND),$.register(PD),$.register(FD)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(FD).forEach(e=>{e.balanceCells()})}deleteColumn(){let[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update($.sources.USER))}deleteRow(){let[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update($.sources.USER))}deleteTable(){let[e]=this.getTable();if(e==null)return;let t=e.offset();e.remove(),this.quill.update($.sources.USER),this.quill.setSelection(t,$.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];let[t,n]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==MD.blotName)return[null,null,null,-1];let r=t.parent;return[r.parent.parent,r,t,n]}insertColumn(e){let t=this.quill.getSelection();if(!t)return;let[n,r,i]=this.getTable(t);if(i==null)return;let a=i.cellOffset();n.insertColumn(a+e),this.quill.update($.sources.USER);let o=r.rowOffset();e===0&&(o+=1),this.quill.setSelection(t.index+o,t.length,$.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){let t=this.quill.getSelection();if(!t)return;let[n,r,i]=this.getTable(t);if(i==null)return;let a=r.rowOffset();n.insertRow(a+e),this.quill.update($.sources.USER),e>0?this.quill.setSelection(t,$.sources.SILENT):this.quill.setSelection(t.index+r.children.length,t.length,$.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){let n=this.quill.getSelection();if(n==null)return;let r=Array(e).fill(0).reduce(e=>{let n=Array(t).fill(`
|
||||
`).join(``);return e.insert(n,{table:ID()})},new kw.default().retain(n.index));this.quill.updateContents(r,$.sources.USER),this.quill.setSelection(n.index,$.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on($.events.SCROLL_OPTIMIZE,e=>{e.some(e=>[`TD`,`TR`,`TBODY`,`TABLE`].includes(e.target.tagName)?(this.quill.once($.events.TEXT_CHANGE,(e,t,n)=>{n===$.sources.USER&&this.balanceTables()}),!0):!1)})}},RD=Kw(`quill:toolbar`),zD=class extends cT{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){let t=document.createElement(`div`);t.setAttribute(`role`,`toolbar`),VD(t,this.options.container),e.container?.parentNode?.insertBefore(t,e.container),this.container=t}else typeof this.options.container==`string`?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){RD.error(`Container required for toolbar`,this.options);return}this.container.classList.add(`ql-toolbar`),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(e=>{let t=this.options.handlers?.[e];t&&this.addHandler(e,t)}),Array.from(this.container.querySelectorAll(`button, select`)).forEach(e=>{this.attach(e)}),this.quill.on($.events.EDITOR_CHANGE,()=>{let[e]=this.quill.selection.getRange();this.update(e)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(e=>e.indexOf(`ql-`)===0);if(!t)return;if(t=t.slice(3),e.tagName===`BUTTON`&&e.setAttribute(`type`,`button`),this.handlers[t]==null&&this.quill.scroll.query(t)==null){RD.warn(`ignoring attaching to nonexistent format`,t,e);return}let n=e.tagName===`SELECT`?`change`:`click`;e.addEventListener(n,n=>{let r;if(e.tagName===`SELECT`){if(e.selectedIndex<0)return;let t=e.options[e.selectedIndex];r=t.hasAttribute(`selected`)?!1:t.value||!1}else r=e.classList.contains(`ql-active`)?!1:e.value||!e.hasAttribute(`value`),n.preventDefault();this.quill.focus();let[i]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,r);else if(this.quill.scroll.query(t).prototype instanceof gw){if(r=prompt(`Enter ${t}`),!r)return;this.quill.updateContents(new kw.default().retain(i.index).delete(i.length).insert({[t]:r}),$.sources.USER)}else this.quill.format(t,r,$.sources.USER);this.update(i)}),this.controls.push([t,e])}update(e){let t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(n=>{let[r,i]=n;if(i.tagName===`SELECT`){let n=null;if(e==null)n=null;else if(t[r]==null)n=i.querySelector(`option[selected]`);else if(!Array.isArray(t[r])){let e=t[r];typeof e==`string`&&(e=e.replace(/"/g,`\\"`)),n=i.querySelector(`option[value="${e}"]`)}n==null?(i.value=``,i.selectedIndex=-1):n.selected=!0}else if(e==null)i.classList.remove(`ql-active`),i.setAttribute(`aria-pressed`,`false`);else if(i.hasAttribute(`value`)){let e=t[r],n=e===i.getAttribute(`value`)||e!=null&&e.toString()===i.getAttribute(`value`)||e==null&&!i.getAttribute(`value`);i.classList.toggle(`ql-active`,n),i.setAttribute(`aria-pressed`,n.toString())}else{let e=t[r]!=null;i.classList.toggle(`ql-active`,e),i.setAttribute(`aria-pressed`,e.toString())}})}};zD.DEFAULTS={};function BD(e,t,n){let r=document.createElement(`button`);r.setAttribute(`type`,`button`),r.classList.add(`ql-${t}`),r.setAttribute(`aria-pressed`,`false`),n==null?r.setAttribute(`aria-label`,t):(r.value=n,r.setAttribute(`aria-label`,`${t}: ${n}`)),e.appendChild(r)}function VD(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(t=>{let n=document.createElement(`span`);n.classList.add(`ql-formats`),t.forEach(e=>{if(typeof e==`string`)BD(n,e);else{let t=Object.keys(e)[0],r=e[t];Array.isArray(r)?HD(n,t,r):BD(n,t,r)}}),e.appendChild(n)})}function HD(e,t,n){let r=document.createElement(`select`);r.classList.add(`ql-${t}`),n.forEach(e=>{let t=document.createElement(`option`);e===!1?t.setAttribute(`selected`,`selected`):t.setAttribute(`value`,String(e)),r.appendChild(t)}),e.appendChild(r)}zD.DEFAULTS={container:null,handlers:{clean(){let e=this.quill.getSelection();if(e!=null)if(e.length===0){let e=this.quill.getFormat();Object.keys(e).forEach(e=>{this.quill.scroll.query(e,GC.INLINE)!=null&&this.quill.format(e,!1,$.sources.USER)})}else this.quill.removeFormat(e.index,e.length,$.sources.USER)},direction(e){let{align:t}=this.quill.getFormat();e===`rtl`&&t==null?this.quill.format(`align`,`right`,$.sources.USER):!e&&t===`right`&&this.quill.format(`align`,!1,$.sources.USER),this.quill.format(`direction`,e,$.sources.USER)},indent(e){let t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0,10);if(e===`+1`||e===`-1`){let t=e===`+1`?1:-1;n.direction===`rtl`&&(t*=-1),this.quill.format(`indent`,r+t,$.sources.USER)}},link(e){e===!0&&(e=prompt(`Enter link URL:`)),this.quill.format(`link`,e,$.sources.USER)},list(e){let t=this.quill.getSelection(),n=this.quill.getFormat(t);e===`check`?n.list===`checked`||n.list===`unchecked`?this.quill.format(`list`,!1,$.sources.USER):this.quill.
Line truncated
|
||||
<div class="relative flex items-center justify-center">
|
||||
<div class="absolute w-8 h-8 bg-blue-400 rounded-full opacity-35 animate-ping"></div>
|
||||
<div class="w-5 h-5 bg-blue-600 rounded-full border-2 border-white shadow-xl flex items-center justify-center z-10"></div>
|
||||
</div>
|
||||
`,iconSize:[32,32],iconAnchor:[16,16]})},[]);return l?(0,X.jsxs)(`div`,{className:`min-h-screen flex flex-col items-center justify-center bg-slate-50 dark:bg-slate-950 text-slate-800 dark:text-slate-100 transition-colors`,children:[(0,X.jsx)(J,{className:`w-12 h-12 text-rose-500 animate-spin mb-4`}),(0,X.jsx)(`p`,{className:`font-bold text-sm`,children:n(`loading`)})]}):d||!s?(0,X.jsx)(`div`,{className:`min-h-screen flex flex-col items-center justify-center bg-slate-50 dark:bg-slate-950 text-slate-800 dark:text-slate-100 p-4 transition-colors`,children:(0,X.jsxs)(`div`,{className:`bg-[var(--surface)] dark:bg-slate-900 border border-[var(--border)] dark:border-slate-800 shadow-2xl rounded-[32px] p-8 max-w-md w-full text-center flex flex-col items-center gap-5`,children:[(0,X.jsx)(`div`,{className:`w-16 h-16 bg-rose-50 dark:bg-rose-950/20 border border-rose-100 dark:border-rose-900/30 rounded-full flex items-center justify-center text-rose-500`,children:(0,X.jsx)(Me,{className:`w-8 h-8`})}),(0,X.jsx)(`h2`,{className:`text-xl font-black tracking-tight`,children:n(`error`)}),(0,X.jsx)(`p`,{className:`text-sm text-slate-500 dark:text-slate-400 leading-relaxed`,children:n(`linkExpired`)}),(0,X.jsx)(`button`,{onClick:t,className:`w-full bg-slate-900 dark:bg-slate-100 hover:bg-slate-800 dark:hover:bg-white text-white dark:text-slate-900 font-bold py-3 px-6 rounded-2xl transition-all active:scale-95 text-sm`,children:n(`appName`)})]})}):(0,X.jsxs)(`div`,{className:`h-screen w-screen flex flex-col bg-slate-50 dark:bg-slate-950 text-slate-800 dark:text-slate-100 transition-colors overflow-hidden`,children:[(0,X.jsxs)(`header`,{className:`h-16 shrink-0 bg-[var(--surface)]/70 dark:bg-slate-900/70 backdrop-blur-md border-b border-[var(--border)] dark:border-slate-800 px-4 md:px-6 flex items-center justify-between z-20`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`button`,{onClick:t,className:`p-2 hover:bg-[var(--background)] dark:hover:bg-slate-800 rounded-xl transition-all active:scale-95 text-[var(--text-muted)] dark:text-slate-400`,children:(0,X.jsx)(V,{className:`w-5 h-5`})}),(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`w-2.5 h-2.5 bg-rose-500 rounded-full animate-pulse`}),(0,X.jsx)(`h1`,{className:`text-sm md:text-base font-black uppercase tracking-tight`,children:n(`emergencyJourney`)})]}),(0,X.jsx)(`p`,{className:`text-[10px] text-[var(--text-muted)] dark:text-slate-400 truncate max-w-[200px] sm:max-w-xs`,children:s.title})]})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 md:gap-3`,children:[(0,X.jsxs)(`select`,{value:r,onChange:e=>i(e.target.value),className:`bg-[var(--background)] dark:bg-slate-800 border border-[var(--border)] dark:border-slate-700 text-[var(--text-primary)] dark:text-slate-100 rounded-xl px-2 py-1.5 text-xs font-bold focus:outline-none cursor-pointer`,children:[(0,X.jsx)(`option`,{value:`vi`,children:`VI`}),(0,X.jsx)(`option`,{value:`en`,children:`EN`}),(0,X.jsx)(`option`,{value:`zh`,children:`ZH`})]}),(0,X.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),className:`bg-[var(--background)] dark:bg-slate-800 border border-[var(--border)] dark:border-slate-700 text-[var(--text-primary)] dark:text-slate-100 rounded-xl px-2 py-1.5 text-xs font-bold focus:outline-none cursor-pointer`,children:[(0,X.jsx)(`option`,{value:`light`,children:n(`themeLight`)}),(0,X.jsx)(`option`,{value:`dark`,children:n(`themeDark`)}),(0,X.jsx)(`option`,{value:`system`,children:n(`themeSystem`)})]})]})]}),(0,X.jsxs)(`div`,{className:`lg:hidden h-12 shrink-0 bg-[var(--surface)] dark:bg-slate-900 border-b border-[var(--border)] dark:border-slate-800 flex items-center z-10 p-1`,children:[(0,X.jsxs)(`button`,{onClick:()=>v(`map`),className:`flex-1 h-full flex items-center justify-center gap-2 text-xs font-bold rounded-lg transition-all ${_===`map`?`bg-rose-500 text-white shadow-md`:`text-slate-500 dark:text-slate-400`}`,children:[(0,X.jsx)(ge,{className:`w-4 h-4`}),n(`viewMap`)]}),(0,X.jsxs)(`button`,{onClick:()=>v(`itinerary`),className:`flex-1 h-full flex items-center justify-center gap-2 text-xs font-bold rounded-lg transition-all ${_===`itinerary`?`bg-rose-500 text-white shadow-md`:`text-slate-500 dark:text-slate-400`}`,children:[(0,X.jsx)(le,{className:`w-4 h-4`}),n(`viewTimeline`)]})]}),(0,X.jsxs)(`div`,{className:`flex-1 flex flex-col lg:grid lg:grid-cols-12 overflow-hidden`,children:[(0,X.jsx)(`div`,{className:`flex-col lg:col-span-4 bg-[var(--surface)] dark:bg-slate-900 border-r border-[var(--border)] dark:border-slate-800 overflow-y-auto no-scrollbar ${_===`itinerary`?`flex h-full`:`hidden lg:flex`}`,children:(0,X.jsxs)(`div`,{className:`p-4 md:p-6 space-y-6`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`h2`,{className:`text-lg md:text-xl font-black text-[var(--text-primary)] dark:text-white leading-tight`,children:s.title}),s.st
Line truncated
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
||||
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:""}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-orange-50:oklch(98% .016 73.684);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-900:oklch(41.4% .112 45.904);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-emerald-800:oklch(43.2% .095 166.913);--color-emerald-900:oklch(37.8% .077 168.94);--color-emerald-950:oklch(26.2% .051 172.552);--color-teal-50:oklch(98.4% .014 180.72);--color-teal-600:oklch(60% .118 184.704);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-blue-950:oklch(28.2% .091 267.935);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-indigo-800:oklch(39.8% .195 277.366);--color-indigo-900:oklch(35.9% .144 278.697);--color-indigo-950:oklch(25.7% .09 281.288);--color-violet-500:oklch(60.6% .25 292.717);--color-violet-600:oklch(54.1% .281 293.009);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-600:oklchLine truncated
|
||||
-221
@@ -1,221 +0,0 @@
|
||||
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=s((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=Line truncated
|
||||
`+V+e}var U=!1;function ee(e,t){if(!e||U)return``;U=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
|
||||
`),a=r.stack.split(`
|
||||
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
|
||||
`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{U=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?H(e):``}function te(e){switch(e.tag){case 5:return H(e.type);case 16:return H(`Lazy`);case 13:return H(`Suspense`);case 19:return H(`SuspenseList`);case 0:case 2:case 15:return e=ee(e.type,!1),e;case 11:return e=ee(e.type.render,!1),e;case 1:return e=ee(e.type,!0),e;default:return``}}function ne(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?ne(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return ne(e(t))}catch{}}return null}function re(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return ne(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function W(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function ie(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ae(e){var t=ie(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function oe(e){e._valueTracker||=ae(e)}function G(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=ie(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function se(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function ce(e,t){var n=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function le(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=W(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function ue(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function K(e,t){ue(e,t);var n=W(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?fe(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&fe(e,t.type,W(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function de(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function fe(e,t,n){(t!==`number`||se(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var pe=Array.isArray;function me(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+W(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function he(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return
Line truncated
|
||||
`).replace(li,``)}function di(e,t,n){if(t=ui(t),ui(e)!==t&&n)throw Error(r(425))}function fi(){}var pi=null,mi=null;function hi(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var gi=typeof setTimeout==`function`?setTimeout:void 0,_i=typeof clearTimeout==`function`?clearTimeout:void 0,vi=typeof Promise==`function`?Promise:void 0,yi=typeof queueMicrotask==`function`?queueMicrotask:vi===void 0?gi:function(e){return vi.resolve(null).then(e).catch(bi)};function bi(e){setTimeout(function(){throw e})}function xi(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),tn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);tn(t)}function Si(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function Ci(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var wi=Math.random().toString(36).slice(2),Ti=`__reactFiber$`+wi,Ei=`__reactProps$`+wi,Di=`__reactContainer$`+wi,Oi=`__reactEvents$`+wi,ki=`__reactListeners$`+wi,Ai=`__reactHandles$`+wi;function ji(e){var t=e[Ti];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Di]||n[Ti]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ci(e);e!==null;){if(n=e[Ti])return n;e=Ci(e)}return t}e=n,n=e.parentNode}return null}function Mi(e){return e=e[Ti]||e[Di],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ni(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Pi(e){return e[Ei]||null}var Fi=[],Ii=-1;function Li(e){return{current:e}}function Ri(e){0>Ii||(e.current=Fi[Ii],Fi[Ii]=null,Ii--)}function zi(e,t){Ii++,Fi[Ii]=e.current,e.current=t}var Bi={},Vi=Li(Bi),Hi=Li(!1),Ui=Bi;function Wi(e,t){var n=e.type.contextTypes;if(!n)return Bi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Gi(e){return e=e.childContextTypes,e!=null}function Ki(){Ri(Hi),Ri(Vi)}function qi(e,t,n){if(Vi.current!==Bi)throw Error(r(168));zi(Vi,t),zi(Hi,n)}function Ji(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,re(e)||`Unknown`,a));return B({},n,i)}function Yi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bi,Ui=Vi.current,zi(Vi,e),zi(Hi,Hi.current),!0}function Xi(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=Ji(e,t,Ui),i.__reactInternalMemoizedMergedChildContext=e,Ri(Hi),Ri(Vi),zi(Vi,e)):Ri(Hi),zi(Hi,n)}var Zi=null,Qi=!1,$i=!1;function ea(e){Zi===null?Zi=[e]:Zi.push(e)}function ta(e){Qi=!0,ea(e)}function na(){if(!$i&&Zi!==null){$i=!0;var e=0,t=jt;try{var n=Zi;for(jt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Zi=null,Qi=!1}catch(t){throw Zi!==null&&(Zi=Zi.slice(e+1)),nt(ct,na),t}finally{jt=t,$i=!1}}return null}var ra=[],ia=0,aa=null,oa=0,sa=[],ca=0,la=null,ua=1,da=``;function fa(e,t){ra[ia++]=oa,ra[ia++]=aa,aa=e,oa=t}function pa(e,t,n){sa[ca++]=ua,sa[ca++]=da,sa[ca++]=la,la=e;var r=ua;e=da;var i=32-gt(r)-1;r&=~(1<<i),n+=1;var a=32-gt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ua=1<<32-gt(t)+i|n<<i|r,da=a+e}else ua=1<<a|n<<i|r,da=e}function ma(e){e.return!==null&&(fa(e,1),pa(e,1,0))}function ha(e){for(;e===aa;)aa=ra[--ia],ra[ia]=null,oa=ra[--ia],ra[ia]=null;for(;e===la;)la=sa[--ca],sa[ca]=null,da=sa[--ca],sa[ca]=null,ua=sa[--ca],sa[ca]=null}var ga=null,_a=null,va=!1,ya=null;function ba(e,t){var n=Yl(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function xa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t===null?!1:(e.stateNode=t,ga=e,_a=Si(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,ga=e,_a=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=la===null?null:{id:ua,overflow:da},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Yl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ga=e,_a=null,!0);default:return!1}}function Sa(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Ca(e){if(va){var t=_a;if(t){var n=t;if(!xa(e,t)){if(Sa(e))throw Error(r(418));t=Si(n.nextSibling);var i=ga;t&&xa(e,t)?ba(i,n):(e.flags=e.flags&-4097|2,va=!1,ga=e)}}else{if(Sa(e))throw Error(r(418));e.flags=e.flags&-4097|2,va=!1,ga=e}}}function wa(e){for(e=e.retu
Line truncated
|
||||
Error generating stack: `+e.message+`
|
||||
`+e.stack}return{value:e,source:t,stack:i,digest:null}}function ws(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ts(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Es=typeof WeakMap==`function`?WeakMap:Map;function Ds(e,t,n){n=Qa(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){al||(al=!0,ol=r),Ts(e,t)},n}function Os(e,t,n){n=Qa(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Ts(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Ts(e,t),typeof r!=`function`&&(sl===null?sl=new Set([this]):sl.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function ks(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Es;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Hl.bind(null,e,t,n),t.then(e,e))}function As(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function js(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Qa(-1,1),t.tag=2,$a(n,t,1))),n.lanes|=1),e)}var Ms=C.ReactCurrentOwner,Ns=!1;function Ps(e,t,n,r){t.child=e===null?Fa(t,null,n,r):Pa(t,e.child,n,r)}function Fs(e,t,n,r,i){n=n.render;var a=t.ref;return Ua(t,i),r=Ao(e,t,n,r,a,i),n=jo(),e!==null&&!Ns?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,tc(e,t,i)):(va&&n&&ma(t),t.flags|=1,Ps(e,t,r,i),t.child)}function Is(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Xl(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Ls(e,t,a,r,i)):(e=$l(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?xr:n,n(o,r)&&e.ref===t.ref)return tc(e,t,i)}return t.flags|=1,e=Ql(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ls(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(xr(a,r)&&e.ref===t.ref)if(Ns=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Ns=!0);else return t.lanes=e.lanes,tc(e,t,i)}return Bs(e,t,n,r,i)}function Rs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},zi(Jc,qc),qc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,zi(Jc,qc),qc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,zi(Jc,qc),qc|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),zi(Jc,qc),qc|=r;return Ps(e,t,i,n),t.child}function zs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Bs(e,t,n,r,i){var a=Gi(n)?Ui:Vi.current;return a=Wi(t,a),Ua(t,i),n=Ao(e,t,n,r,a,i),r=jo(),e!==null&&!Ns?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,tc(e,t,i)):(va&&r&&ma(t),t.flags|=1,Ps(e,t,n,i),t.child)}function Vs(e,t,n,r,i){if(Gi(n)){var a=!0;Yi(t)}else a=!1;if(Ua(t,i),t.stateNode===null)ec(e,t),bs(t,n,r),Ss(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Wa(l):(l=Gi(n)?Ui:Vi.current,l=Wi(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&xs(t,o,r,l),Ya=!1;var f=t.memoizedState;o.state=f,no(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Hi.current||Ya?(typeof u==`function`&&(_s(t,n,u,r),c=t.memoizedState),(s=Ya||ys(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Za(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:gs(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Wa(c):(c=Gi(n)?Ui:Vi.current,c=Wi(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&xs(t,o,r,c),Ya=!1,f=t.memoizedState,o.state=f,no(t,r,o,i);var m=t.memoizedState;s!==d||
Line truncated
|
||||
.image-pan-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-behavior: smooth;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.image-pan-container::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.image-pan-container {
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.image-pan-element {
|
||||
width: auto;
|
||||
max-width: none !important;
|
||||
height: 100%;
|
||||
display: block;
|
||||
min-width: 100%;
|
||||
}
|
||||
`}),f.length>1&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`button`,{onClick:()=>S(e=>(e-1+f.length)%f.length),className:`absolute left-4 top-1/2 -translate-y-1/2 z-10 p-2 bg-black/30 hover:bg-black/50 backdrop-blur-md rounded-full text-white transition-all md:hidden`,"aria-label":`Previous photo`,children:(0,Y.jsx)(`span`,{className:`text-xl`,children:`‹`})}),(0,Y.jsx)(`button`,{onClick:()=>S(e=>(e+1)%f.length),className:`absolute right-4 top-1/2 -translate-y-1/2 z-10 p-2 bg-black/30 hover:bg-black/50 backdrop-blur-md rounded-full text-white transition-all md:hidden`,"aria-label":`Next photo`,children:(0,Y.jsx)(`span`,{className:`text-xl`,children:`›`})})]}),f.length>1&&(0,Y.jsx)(`div`,{className:`absolute bottom-20 left-1/2 -translate-x-1/2 z-10 flex gap-1.5`,children:f.slice(0,20).map((e,t)=>(0,Y.jsx)(`button`,{onClick:()=>S(t),className:`w-2 h-2 rounded-full transition-all ${x===t?`bg-emerald-500 w-6`:`bg-white/40 hover:bg-white/60`}`},t))}),(0,Y.jsxs)(`div`,{className:`absolute top-0 left-0 right-0 z-20 p-3 sm:p-4 pt-[calc(0.75rem+env(safe-area-inset-top,0px))] sm:pt-[calc(1rem+env(safe-area-inset-top,0px))] flex justify-between items-center bg-gradient-to-b from-slate-950/40 to-transparent`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 sm:gap-2 text-white drop-shadow-lg`,children:[(0,Y.jsx)(ee,{className:`w-7 h-7 sm:w-8 sm:h-8`}),(0,Y.jsx)(`span`,{className:`text-lg sm:text-xl font-black tracking-tighter uppercase hidden sm:block`,children:`YoTrip`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 sm:gap-3`,children:[(0,Y.jsxs)(`select`,{value:c,onChange:e=>l(e.target.value),className:`bg-black/40 hover:bg-black/60 border border-white/20 text-white rounded-full px-2 py-1 sm:px-3 sm:py-1.5 text-[11px] sm:text-xs font-bold focus:outline-none backdrop-blur-md cursor-pointer max-w-[80px] sm:max-w-none`,children:[(0,Y.jsx)(`option`,{value:`vi`,className:`text-black`,children:`Tiếng Việt`}),(0,Y.jsx)(`option`,{value:`en`,className:`text-black`,children:`English`}),(0,Y.jsx)(`option`,{value:`zh`,className:`text-black`,children:`中文`})]}),(0,Y.jsxs)(`select`,{value:u,onChange:e=>d(e.target.value),className:`bg-black/40 hover:bg-black/60 border border-white/20 text-white rounded-full px-2 py-1 sm:px-3 sm:py-1.5 text-[11px] sm:text-xs font-bold focus:outline-none backdrop-blur-md cursor-pointer max-w-[80px] sm:max-w-none`,children:[(0,Y.jsx)(`option`,{value:`light`,className:`text-black`,children:s(`themeLight`)||`Sáng`}),(0,Y.jsx)(`option`,{value:`dark`,className:`text-black`,children:s(`themeDark`)||`Tối`}),(0,Y.jsx)(`option`,{value:`system`,className:`text-black`,children:s(`themeSystem`)||`Hệ thống`})]}),(0,Y.jsxs)(`button`,{onClick:()=>b(!0),className:`flex items-center justify-center gap-1.5 bg-red-600/80 backdrop-blur-md text-white font-bold py-1.5 px-2.5 sm:py-2 sm:px-3.5 rounded-full border border-red-500/30 hover:bg-red-500 transition-all shadow-md active:scale-95 text-xs sm:text-sm cursor-pointer`,children:[(0,Y.jsx)(q,{className:`w-3.5 h-3.5 sm:w-4 sm:h-4`}),(0,Y.jsx)(`span`,{className:`hidden sm:inline`,children:s(`reportBusinessBtn`)})]}),(0,Y.jsxs)(`button`,{onClick:()=>i(!0),className:`flex items-center justify-center gap-1 sm:gap-2 bg-white/15 backdrop-blur-md text-white font-bold py-1.5 px-2.5 sm:py-2 sm:px-4 rounded-full border border-white/25 hover:bg-white/25 transition-all shadow-md active:scale-95 text-xs sm:text-sm cursor-pointer`,children:[(0,Y.jsx)(pe,{className:`w-3.5 h-3.5 sm:w-4 sm:h-4`}),(0,Y.jsx)(`span`,{children:s(`login`)})]})]})]}),(0,Y.jsxs)(`div`,{className:`absolute left-6 top-24 bottom-36 z-20 hidden md:flex flex-col w-72 bg-slate-900/60 backdrop-blur-md border border-white/10 rounded-[32px] p-5 text-white overflow-hidden shadow-2xl animate-in slide-in-from-left duration-500`,children:[(0,Y.jsxs)(`h3`,{className:`text-base font-black flex items-center gap-2 mb-3 border-b border-white/10 pb-2`,children:[`🏆 `,s(`trustedMembers`)]}),(0,Y.jsx)(`div`,{className:`flex-1 overflow-y-auto space-y-3 pr-1 no-scrollbar`,children:m.length===0?(0,Y.jsx)(`div`,{className:`text-xs text-white/50 italic py-4`,children:`Chưa có đánh giá nào.`}):m.map((e,t)=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 bg-white/5 hover:bg-white/10 p-2.5 rounded-2xl border border-white/5 transition-all`,children:[(0,Y.jsxs)(`div`,{className:`relative`,children:[(0,Y.jsx)(`div`,{className:`w-10 h-10 rounded-full bg-slate-800 border border-white/10 flex items-center justify-center font-bold overflow-hidden`,children:e.avatar?(0,Y.jsx)(`img`,{src:e.avatar,alt:`Avatar`,className:`w-full h-full object-cover`}):(0,Y.jsx)(`span`,{children:e.name.charAt(0)})}),(0,Y.jsx)(`span`,{className:`absolute -top-1 -left-1 bg-amber-500 text-[10px] text-white font-black px-1.5 py-0.5 rounded-full border border-slate-950`,children:t+1})]}),(0,Y.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Y.jsx)(`div`,{className:`text-xs font-bold truncate`,children:e.na
Line truncated
|
||||
.no-scrollbar::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.no-scrollbar {
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
`})]}),(0,Y.jsx)(Ye,{isOpen:r,onClose:()=>i(!1),onSwitchToSignup:e,onLoginSuccess:n}),(0,Y.jsx)(Qe,{isOpen:v,onClose:()=>b(!1)})]})};function ct(e,t){let n=(0,lt.useRef)(t);(0,lt.useEffect)(function(){t!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),t!=null&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}var lt,ut=o((()=>{lt=u(p(),1)}));function dt(e,t,n){t.center!==n.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==n.radius&&e.setRadius(t.radius)}var ft=o((()=>{}));function pt(e){return Object.freeze({__version:1,map:e})}function mt(e,t){return Object.freeze({...e,...t})}function ht(){let e=(0,gt.useContext)(_t);if(e==null)throw Error(`No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>`);return e}var gt,_t,vt,yt=o((()=>{gt=u(p(),1),_t=(0,gt.createContext)(null),vt=_t.Provider}));function bt(e){function t(t,n){let{instance:r,context:i}=e(t).current;return(0,Ct.useImperativeHandle)(n,()=>r),t.children==null?null:Ct.createElement(vt,{value:i},t.children)}return(0,Ct.forwardRef)(t)}function xt(e){function t(t,n){let[r,i]=(0,Ct.useState)(!1),{instance:a}=e(t,i).current;(0,Ct.useImperativeHandle)(n,()=>a),(0,Ct.useEffect)(function(){r&&a.update()},[a,r,t.children]);let o=a._contentNode;return o?(0,Z.createPortal)(t.children,o):null}return(0,Ct.forwardRef)(t)}function St(e){function t(t,n){let{instance:r}=e(t).current;return(0,Ct.useImperativeHandle)(n,()=>r),null}return(0,Ct.forwardRef)(t)}var Ct,Z,wt=o((()=>{Ct=u(p(),1),Z=_(),yt()}));function Tt(e){return function(t){let n=ht(),r=e(t,n),{instance:i}=r.current,a=(0,Et.useRef)(t.position),{position:o}=t;return(0,Et.useEffect)(function(){return i.addTo(n.map),function(){i.remove()}},[n.map,i]),(0,Et.useEffect)(function(){o!=null&&o!==a.current&&(i.setPosition(o),a.current=o)},[i,o]),r}}var Et,Dt=o((()=>{Et=u(p(),1),yt()}));function Ot(e,t){let n=(0,kt.useRef)();(0,kt.useEffect)(function(){return t!=null&&e.instance.on(t),n.current=t,function(){n.current!=null&&e.instance.off(n.current),n.current=null}},[e,t])}var kt,At=o((()=>{kt=u(p(),1)}));function jt(e,t){let n=e.pane??t.pane;return n?{...e,pane:n}:e}var Mt=o((()=>{}));function Nt(e,t){return function(n,r){let i=ht(),a=e(jt(n,i),i);return ct(i.map,n.attribution),Ot(a.current,n.eventHandlers),t(a.current,i,n,r),a}}var Pt=o((()=>{ut(),yt(),At(),Mt()})),Ft=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.leaflet={}))})(e,(function(e){var t=`1.9.4`;function n(e){var t,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(t in i=arguments[n],i)e[t]=i[t];return e}var r=Object.create||(function(){function e(){}return function(t){return e.prototype=t,new e}})();function i(e,t){var n=Array.prototype.slice;if(e.bind)return e.bind.apply(e,n.call(arguments,1));var r=n.call(arguments,2);return function(){return e.apply(t,r.length?r.concat(n.call(arguments)):arguments)}}var a=0;function o(e){return`_leaflet_id`in e||(e._leaflet_id=++a),e._leaflet_id}function s(e,t,n){var r,i,a,o=function(){r=!1,i&&=(a.apply(n,i),!1)};return a=function(){r?i=arguments:(e.apply(n,arguments),setTimeout(o,t),r=!0)},a}function c(e,t,n){var r=t[1],i=t[0],a=r-i;return e===r&&n?e:((e-i)%a+a)%a+i}function l(){return!1}function u(e,t){if(t===!1)return e;var n=10**(t===void 0?6:t);return Math.round(e*n)/n}function d(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,``)}function f(e){return d(e).split(/\s+/)}function p(e,t){for(var n in Object.prototype.hasOwnProperty.call(e,`options`)||(e.options=e.options?r(e.options):{}),t)e.options[n]=t[n];return e.options}function m(e,t,n){var r=[];for(var i in e)r.push(encodeURIComponent(n?i.toUpperCase():i)+`=`+encodeURIComponent(e[i]));return(!t||t.indexOf(`?`)===-1?`?`:`&`)+r.join(`&`)}var h=/\{ *([\w_ -]+) *\}/g;function g(e,t){return e.replace(h,function(e,n){var r=t[n];if(r===void 0)throw Error(`No value provided for variable `+e);return typeof r==`function`&&(r=r(t)),r})}var _=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`};function v(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}var y=`data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=`;function b(e){return window[`webkit`+e]||window[`moz`+e]||window[`ms`+e]}var x=0;function S(e){var t=+new Date,n=Math.max(0,16-(t-x));return x=t+n,window.setTimeout(e,n)}var C=window.requestAnimationFrame||b(`RequestAnimationFrame`)||S,w=window.cancelAnimationFrame||b(`CancelAnimationFrame`)||b(`CancelRequestAnimationFrame`)||function(e){window.clearTimeout(e)};function T(e,t,n){if(n&&C===S)e.call(t);else return C.call(window,i(e,t))}function E(e){e&&w.call(window,e)}var D={__proto__:null,extend:n,create:r,bind:i,get lastId(){return a},stamp:o,throttle:s,wrapNum:c,falseFn:l,formatNum:u,trim:d,splitWords:f,setOptions:p,getParamString:m,template:g,isArray:_,indexOf:v,emptyI
Line truncated
|
||||
.no-scrollbar::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.no-scrollbar {
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
`})]})]}),(0,Y.jsxs)(`div`,{className:`w-full md:w-2/5 md:flex-1 md:min-h-0 flex flex-col bg-slate-900 border-t md:border-t-0 md:border-l border-slate-800`,children:[(0,Y.jsx)(`div`,{className:`hidden md:block p-6 border-b border-slate-800`,children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`h3`,{className:`text-lg font-black tracking-tight text-white flex items-center gap-2`,children:[(0,Y.jsx)(ve,{className:`w-5 h-5 text-emerald-500`}),s(`commentSectionTitle`)]}),(0,Y.jsx)(`p`,{className:`text-xs text-slate-400 mt-1`,children:`Ảnh chia sẻ công khai trên bản đồ`})]})}),(0,Y.jsxs)(`div`,{className:`md:flex-1 md:overflow-y-auto p-6 space-y-4 bg-slate-900/50`,children:[f?(0,Y.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-slate-500 gap-2`,children:[(0,Y.jsx)(K,{className:`w-8 h-8 animate-spin text-emerald-500`}),(0,Y.jsx)(`span`,{className:`text-xs font-semibold`,children:s(`loading`)})]}):c.length===0?(0,Y.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-slate-500 gap-3`,children:[(0,Y.jsx)(`div`,{className:`p-4 bg-slate-800/40 rounded-full text-slate-600`,children:(0,Y.jsx)(ve,{className:`w-8 h-8`})}),(0,Y.jsx)(`span`,{className:`text-sm font-semibold italic`,children:`Chưa có bình luận nào. Hãy bắt đầu cuộc trò chuyện!`})]}):c.map(e=>(0,Y.jsxs)(`div`,{className:`flex gap-3 items-start animate-in fade-in slide-in-from-bottom-2 duration-200`,children:[(0,Y.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-slate-800 flex items-center justify-center flex-shrink-0 border border-slate-700/60`,children:(0,Y.jsx)(Ue,{className:`w-4.5 h-4.5 text-slate-400`})}),(0,Y.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,Y.jsxs)(`div`,{className:`bg-slate-800/55 p-3.5 rounded-2xl rounded-tl-none border border-slate-800 shadow-lg`,children:[(0,Y.jsxs)(`div`,{className:`flex justify-between items-center mb-1`,children:[(0,Y.jsx)(`span`,{className:`text-xs font-black text-slate-200 truncate`,children:e.userName}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[9px] font-medium text-slate-500`,children:new Date(e.createdAt).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}),(_?.isAdmin||_?.id===e.userId||_?.id===n.uploaderId||_?.id===n.uploader?.id)&&(0,Y.jsx)(`button`,{onClick:t=>{t.stopPropagation(),ae(e.id)},className:`text-slate-500 hover:text-rose-500 transition-colors p-0.5`,title:s(`delete`)||`Xóa`,children:(0,Y.jsx)(ze,{className:`w-3.5 h-3.5`})})]})]}),(0,Y.jsx)(`p`,{className:`text-sm text-slate-300 leading-relaxed break-words`,children:e.content})]})})]},e.id)),(0,Y.jsx)(`div`,{ref:g})]}),(0,Y.jsx)(`div`,{className:`sticky bottom-0 md:static p-4 bg-slate-950 md:bg-slate-950/40 border-t border-slate-800/80 pb-[calc(1rem+env(safe-area-inset-bottom,0px))] md:pb-4 z-40`,children:(0,Y.jsxs)(`div`,{className:`relative flex items-center gap-2`,children:[(0,Y.jsx)(`input`,{type:`text`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>e.key===`Enter`&&!m&&ie(),placeholder:`Viết bình luận công khai...`,className:`flex-1 bg-slate-800/65 border border-slate-700/70 text-slate-100 placeholder-slate-500 rounded-2xl px-4 py-3 text-base md:text-sm focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-transparent transition-all`,disabled:m}),(0,Y.jsx)(`button`,{onClick:e=>{e.stopPropagation(),ie()},disabled:!u.trim()||m,className:`p-3 bg-emerald-600 hover:bg-emerald-500 disabled:bg-slate-800 disabled:opacity-40 text-white rounded-2xl transition-all active:scale-95 shadow-lg shadow-emerald-950/30 flex items-center justify-center`,children:m?(0,Y.jsx)(K,{className:`w-4.5 h-4.5 animate-spin`}):(0,Y.jsx)(Ae,{className:`w-4.5 h-4.5`})})]})})]})]}),(0,Y.jsx)(Wi,{isOpen:M,onClose:()=>P(!1),initialLat:typeof E==`number`?E:void 0,initialLng:typeof O==`number`?O:void 0,onSelect:(e,t)=>{D(e),k(t)}}),R&&(0,Y.jsxs)(`div`,{className:`fixed inset-0 z-[9999] bg-black/95 flex items-center justify-center cursor-zoom-out animate-in fade-in duration-200`,onClick:()=>z(!1),children:[(0,Y.jsx)(`button`,{onClick:()=>z(!1),className:`fixed top-6 right-6 p-3 bg-black/50 hover:bg-black/75 border border-white/10 rounded-full text-white transition-colors z-[10000]`,children:(0,Y.jsx)(Ke,{className:`w-6 h-6`})}),(0,Y.jsx)(`img`,{src:n.imageUrl,alt:`Fullscreen photo`,onContextMenu:e=>{B||e.preventDefault()},onDragStart:e=>{B||e.preventDefault()},className:`max-w-full max-h-full object-contain select-none animate-in zoom-in-95 duration-200 ${B?``:`pointer-events-none`}`})]})]}):null},Ki=Ln.default.default||Ln.default,qi=gn.default.icon({iconUrl:`https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png`,shadowUrl:`https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png`,iconSize:[25,41],iconAnchor:[12,41]});gn.default.Marker.prototype.options.icon=qi;function Ji({position:e}){let t=mn();return(0,y.useEffect)(()=>{t.setView(e,t.getZoom())},[e,t]),null}function Yi({onMapAction:e}){retu
Line truncated
|
||||
<div class="relative group w-14 h-14">
|
||||
<div class="w-14 h-14 rounded-full border-4 ${o.borderClass} shadow-lg overflow-hidden transition-transform group-hover:scale-110 flex items-center justify-center bg-gray-100">
|
||||
<img src="${i}" class="w-full h-full object-cover" onerror="this.src='https://images.unsplash.com/photo-1476514525535-07fb3b4ae5f1?w=100'"/>
|
||||
</div>
|
||||
<div class="absolute -bottom-1 -right-1 bg-blue-600 rounded-full w-5 h-5 border-2 border-white flex items-center justify-center text-[10px] font-black text-white">
|
||||
S
|
||||
</div>
|
||||
</div>
|
||||
`,iconSize:[56,56],iconAnchor:[28,28]}),children:(0,Y.jsx)(wn,{direction:`top`,offset:[0,-28],opacity:1,children:(0,Y.jsxs)(`div`,{className:`p-1.5 max-w-[180px]`,children:[(0,Y.jsx)(`div`,{className:`font-black text-blue-600 text-[11px] mb-1 uppercase tracking-tight truncate`,children:e.title}),e.tags&&e.tags.length>0&&(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-1 mb-1`,children:e.tags.map(e=>(0,Y.jsx)(`span`,{className:`px-1.5 py-0.5 bg-blue-50 text-blue-500 rounded text-[8px] font-bold border border-blue-100`,children:e},e))}),e.description&&(0,Y.jsx)(`div`,{className:`text-[10px] text-gray-500 line-clamp-2 leading-tight italic mb-1.5`,children:e.description}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 pt-1 border-t border-gray-100`,children:[(0,Y.jsx)(`span`,{className:`w-2 h-2 rounded-full ${o.color===`green`?`bg-emerald-500`:o.color===`red`?`bg-rose-500`:`bg-gray-400`}`}),(0,Y.jsx)(`span`,{className:`text-[9px] font-bold text-gray-600`,children:o.label})]})]})})},e.id)})},`cluster-${dt.length}`),F.map(e=>{let t=e[0],n=t.metadata?.lat,r=t.metadata?.lng;return typeof n!=`number`||typeof r!=`number`?null:(0,Y.jsx)(bn,{position:[n,r],eventHandlers:{click:()=>{M(t),P(e);let n=new URLSearchParams(window.location.search);n.set(`photoId`,t.id),window.history.replaceState({},``,`${window.location.pathname}?${n.toString()}`)}},icon:gn.default.divIcon({className:`custom-photo-bubble`,html:`
|
||||
<a href="${window.location.origin}/api/v1/public-photos/${t.id}/share" onclick="event.preventDefault();" class="relative group block">
|
||||
<div class="w-12 h-12 rounded-full border-4 border-emerald-500 shadow-lg overflow-hidden transition-transform group-hover:scale-110 relative">
|
||||
<img src="${t.imageUrl}" class="w-full h-full object-cover select-none" draggable="false" />
|
||||
<div class="absolute inset-0 bg-transparent select-none z-10"></div>
|
||||
</div>
|
||||
<div class="absolute -bottom-1 -right-1 bg-emerald-600 rounded-full w-5 h-5 border-2 border-white flex items-center justify-center text-[10px] font-black text-white">
|
||||
📸
|
||||
</div>
|
||||
${e.length>1?`
|
||||
<div class="absolute -top-1 -left-1 bg-rose-600 rounded-full w-5 h-5 border-2 border-white flex items-center justify-center text-[9px] font-black text-white shadow-md animate-bounce">
|
||||
${e.length}
|
||||
</div>
|
||||
`:``}
|
||||
</a>
|
||||
`,iconSize:[48,48],iconAnchor:[24,24]})},t.id)}),ie.map(e=>typeof e.latitude!=`number`||typeof e.longitude!=`number`?null:(0,Y.jsx)(bn,{position:[e.latitude,e.longitude],icon:gn.default.divIcon({html:`<div class="bg-red-600 text-white p-2 rounded-full shadow-lg border-2 border-white flex items-center justify-center animate-pulse"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-shield-alert"><path d="M20 13c0 5-3.5 7.5-7.66 9.7a1 1 0 0 1-.68 0C7.5 20.5 4 18 4 13V6a1 1 0 0 1 .76-.97l8-2a1 1 0 0 1 .48 0l8 2A1 1 0 0 1 20 6z"/><path d="M12 8v4"/><path d="M12 16h.01"/></svg></div>`,className:`custom-blacklist-marker`,iconSize:[32,32],iconAnchor:[16,16]}),children:(0,Y.jsx)(wn,{direction:`top`,offset:[0,-16],opacity:1,children:(0,Y.jsxs)(`div`,{className:`p-2 max-w-[200px] text-left`,children:[(0,Y.jsxs)(`div`,{className:`font-black text-red-600 text-xs mb-1 uppercase tracking-tight flex items-center gap-1`,children:[`⚠️ Blacklist: `,e.name]}),(0,Y.jsx)(`div`,{className:`text-[10px] bg-red-50 text-red-700 px-1.5 py-0.5 rounded font-black uppercase tracking-wider mb-1 w-max`,children:e.type}),e.address&&(0,Y.jsx)(`div`,{className:`text-[10px] text-gray-500 mb-1 font-semibold`,children:e.address}),e.phone&&(0,Y.jsxs)(`div`,{className:`text-[9px] text-gray-400`,children:[`SĐT: `,e.phone]}),(0,Y.jsxs)(`div`,{className:`text-[10px] text-red-600 font-medium italic mt-1 pt-1 border-t border-red-100`,children:[`Lý do: `,e.reason]})]})})},`blacklist-${e.id}`)),pe.map(e=>typeof e.latitude!=`number`||typeof e.longitude!=`number`?null:(0,Y.jsx)(bn,{position:[e.latitude,e.longitude],icon:gn.default.divIcon({html:`<div class="bg-emerald-600 text-white p-2 rounded-full shadow-lg border-2 border-white flex items-center justify-center animate-pulse"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg></div>`,className:`custom-recommended-marker`,iconSize:[32,32],iconAnchor:[16,16]}),children:(0,Y.jsx)(wn,{direction:`top`,offset:[0,-16],opacity:1,children:(0,Y.jsxs)(`div`,{className:`p-2.5 max-w-[220px] text-left`,children:[(0,Y.jsxs)(`div`,{className:`font-black text-emerald-600 text-xs mb-1 uppercase tracking-tight flex items-center gap-1`,children:[`🌟 `,e.name]}),(0,Y.jsx)(`div`,{className:`flex items-center gap-0.5 text-amber-500 mb-1`,children:Array.from({length:e.stars}).map((e,t)=>(0,Y.jsx)(`span`,{children:`★`},t))}),(0,Y.jsx)(`div`,{className:`text-[10px] bg-emerald-50 text-emerald-700 px-1.5 py-0.5 rounded font-black uppercase tracking-wider mb-1 w-max`,children:e.type===`RESTAURANT`?h(`businessRestaurant`):e.type===`HOTEL`?h(`businessHotel`):h(`businessHomestay`)}),e.address&&(0,Y.jsx)(`div`,{className:`text-[10px] text-gray-500 mb-1 font-semibold`,children:e.address}),e.phone&&(0,Y.jsxs)(`div`,{className:`text-[9px] text-gray-400`,children:[`SĐT: `,e.phone]}),e.email&&(0,Y.jsxs)(`div`,{className:`text-[9px] text-gray-400`,children:[`Email: `,e.email]}),(0,Y.jsx)(`div`,{className:`text-[10px] text-slate-600 font-medium italic mt-1 pt-1 border-t border-emerald-100 whitespace-pre-line`,children:e.description})]})})},`recommendation-${e.id}`))]}),ot&&(0,Y.jsx)(`div`,{className:`absolute z-[2000] bg-white rounded-2xl shadow-2xl border border-gray-100 py-2 w-48 animate-in zoom-in-95 duration-200`,style:{top:ot.y,left:ot.x},onClick:e=>e.stopPropagation(),children:ot.isParticipant?ot.canShare?(0,Y.jsxs)(`button`,{onClick:()=>ct(ot.id,ot.title),className:`w-full text-left px-4 py-2 hover:bg-blue-50 text-sm font-bold text-gray-700 flex items-center gap-2 transition-colors`,children:[(0,Y.jsx)(Me,{className:`w-4 h-4 text-blue-600`}),` Sao chép liên kết`]}):(0,Y.jsx)(`div`,{className:`px-4 py-2 text-xs text-gray-400 italic font-bold`,children:`Bạn đã gia nhập tour này`}):ot.hasPendingRequest?(0,Y.jsxs)(`button`,{disabled:!0,className:`w-full text-left px-4 py-2 text-sm font-bold text-gray-400 flex items-center gap-2 cursor-not-allowed bg-gray-50/50`,children:[(0,Y.jsx)(U,{className:`w-4 h-4 text-gray-400`}),` Đang chờ duyệt...`]}):(0,Y.jsxs)(`button`,{onClick:()=>lt(ot.id),className:`w-full text-left px-4 py-2 hover:bg-blue-50 text-sm font-bold text-blue-700 flex items-center gap-2 transition-colors`,children:[(0,Y.jsx)(He,{className:`w-4 h-4 text-blue-600`}),` Yêu cầu tham gia Tour`]})}),(0,Y.jsx)(Jn,{isOpen:R,onClose:()=>z(!1)}),(0,Y.jsx)(Yn,{isOpen:V,onClose:()=>H(!1),onSuccess:e=>{let t=localStorage.getItem(`my_journey_notes`),n=[];try{n=t?JSON.parse(t):[]}catch{n=[]}let i={id:Date.now().toString(),tourId:e.id,title:`Ghi chú của hành trình: ${e.title}`,cLine truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ua(e,t){return Ra(e)||za(e,t)||Va(e,t)||Ha()}function Wa(e,t=`utf8`){return new TextDecoder(t).decode(e)}var Ga=new TextEncoder;function Ka(e){return Ga.encode(e)}var qa=1024*8,Ja=(()=>{let e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),Ya={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array},Xa=class e{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(t=qa,n={}){let r=!1;typeof t==`number`?t=new ArrayBuffer(t):(r=!0,this.lastWrittenByte=t.byteLength);let i=n.offset?n.offset>>>0:0,a=t.byteLength-i,o=i;(ArrayBuffer.isView(t)||t instanceof e)&&(t.byteLength!==t.buffer.byteLength&&(o=t.byteOffset+i),t=t.buffer),r?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=t,this.length=a,this.byteLength=a,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,a),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){let e=this._marks.pop();if(e===void 0)throw Error(`Mark stack empty`);return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){let t=(this.offset+e)*2,n=new Uint8Array(t);n.set(new Uint8Array(this.buffer)),this.buffer=n.buffer,this.length=t,this.byteLength=t,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,`uint8`)}readArray(e,t){let n=Ya[t].BYTES_PER_ELEMENT*e,r=this.byteOffset+this.offset,i=this.buffer.slice(r,r+n);if(this.littleEndian===Ja&&t!==`uint8`&&t!==`int8`){let e=new Uint8Array(this.buffer.slice(r,r+n));e.reverse();let i=new Ya[t](e.buffer);return this.offset+=n,i.reverse(),i}let a=new Ya[t](i);return this.offset+=n,a}readInt16(){let e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){let e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){let e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){let e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){let e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){let e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){let e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){let e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let t=``;for(let n=0;n<e;n++)t+=this.readChar();return t}readUtf8(e=1){return Wa(this.readBytes(e))}decodeText(e=1,t=`utf8`){return Wa(this.readBytes(e),t)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLast
Line truncated
|
||||
`),Ve(e,t),Ne.publish(`endTilingPattern`,t),Le.pop().restore()};var J,He=p.__private__.newObject=function(){var e=Ue();return We(e,!0),e},Ue=p.__private__.newObjectDeferred=function(){return U++,ee[U]=function(){return ne},U},We=function(e,t){return t=typeof t==`boolean`&&t,ee[e]=ne,t&&G(e+` 0 obj`),e},Ge=p.__private__.newAdditionalObject=function(){var e={objId:Ue(),content:``};return re.push(e),e},Ke=Ue(),qe=Ue(),Je=p.__private__.decodeColorString=function(e){var t=e.split(` `);if(t.length!==2||t[1]!==`g`&&t[1]!==`G`)t.length!==5||t[4]!==`k`&&t[4]!==`K`||(t=[(1-t[0])*(1-t[3]),(1-t[1])*(1-t[3]),(1-t[2])*(1-t[3]),`r`]);else{var n=parseFloat(t[0]);t=[n,n,n,`r`]}for(var r=`#`,i=0;i<3;i++)r+=(`0`+Math.floor(255*parseFloat(t[i])).toString(16)).slice(-2);return r},Y=p.__private__.encodeColorString=function(e){var t;typeof e==`string`&&(e={ch1:e});var n=e.ch1,r=e.ch2,i=e.ch3,a=e.ch4,o=e.pdfColorType===`draw`?[`G`,`RG`,`K`]:[`g`,`rg`,`k`];if(typeof n==`string`&&n.charAt(0)!==`#`){var s=new Gd(n);if(s.ok)n=s.toHex();else if(!/^\d*\.?\d*$/.test(n))throw Error(`Invalid color "`+n+`" passed to jsPDF.encodeColorString.`)}if(typeof n==`string`&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n=`#`+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]),typeof n==`string`&&/^#[0-9A-Fa-f]{6}$/.test(n)){var c=parseInt(n.substr(1),16);n=c>>16&255,r=c>>8&255,i=255&c}if(r===void 0||a===void 0&&n===r&&r===i)t=typeof n==`string`?n+` `+o[0]:e.precision===2?D(n/255)+` `+o[0]:O(n/255)+` `+o[0];else if(a===void 0||Qi(a)===`object`){if(a&&!isNaN(a.a)&&a.a===0)return[`1.`,`1.`,`1.`,o[1]].join(` `);t=typeof n==`string`?[n,r,i,o[1]].join(` `):e.precision===2?[D(n/255),D(r/255),D(i/255),o[1]].join(` `):[O(n/255),O(r/255),O(i/255),o[1]].join(` `)}else t=typeof n==`string`?[n,r,i,a,o[2]].join(` `):e.precision===2?[D(n),D(r),D(i),D(a),o[2]].join(` `):[O(n),O(r),O(i),O(a),o[2]].join(` `);return t},Ye=p.__private__.getFilters=function(){return o},Xe=p.__private__.putStream=function(e){var t=(e||={}).data||``,n=e.filters||Ye(),r=e.alreadyAppliedFilters||[],i=e.addLength1||!1,a=t.length,o=e.objectId,s=function(e){return e};if(u!==null&&o===void 0)throw Error(`ObjectId must be passed to putStream for file encryption`);u!==null&&(s=Z.encryptor(o,0));var c={};!0===n&&(n=[`FlateEncode`]);var l=e.additionalKeyValues||[],d=(c=vf.API.processDataByFilters===void 0?{data:t,reverseChain:[]}:vf.API.processDataByFilters(t,n)).reverseChain+(Array.isArray(r)?r.join(` `):r.toString());if(c.data.length!==0&&(l.push({key:`Length`,value:c.data.length}),!0===i&&l.push({key:`Length1`,value:a})),d.length!=0)if(d.split(`/`).length-1==1)l.push({key:`Filter`,value:d});else{l.push({key:`Filter`,value:`[`+d+`]`});for(var f=0;f<l.length;f+=1)if(l[f].key===`DecodeParms`){for(var p=[],m=0;m<c.reverseChain.split(`/`).length-1;m+=1)p.push(`null`);p.push(l[f].value),l[f].value=`[`+p.join(` `)+`]`}}G(`<<`);for(var h=0;h<l.length;h++)G(`/`+l[h].key+` `+l[h].value);G(`>>`),c.data.length!==0&&(G(`stream`),G(s(c.data)),G(`endstream`))},Ze=p.__private__.putPage=function(e){var t=e.number,n=e.data,r=e.objId,i=e.contentsObjId;We(r,!0),G(`<</Type /Page`),G(`/Parent `+e.rootDictionaryObjId+` 0 R`),G(`/Resources `+e.resourceDictionaryObjId+` 0 R`),G(`/MediaBox [`+parseFloat(w(e.mediaBox.bottomLeftX))+` `+parseFloat(w(e.mediaBox.bottomLeftY))+` `+w(e.mediaBox.topRightX)+` `+w(e.mediaBox.topRightY)+`]`),e.cropBox!==null&&G(`/CropBox [`+w(e.cropBox.bottomLeftX)+` `+w(e.cropBox.bottomLeftY)+` `+w(e.cropBox.topRightX)+` `+w(e.cropBox.topRightY)+`]`),e.bleedBox!==null&&G(`/BleedBox [`+w(e.bleedBox.bottomLeftX)+` `+w(e.bleedBox.bottomLeftY)+` `+w(e.bleedBox.topRightX)+` `+w(e.bleedBox.topRightY)+`]`),e.trimBox!==null&&G(`/TrimBox [`+w(e.trimBox.bottomLeftX)+` `+w(e.trimBox.bottomLeftY)+` `+w(e.trimBox.topRightX)+` `+w(e.trimBox.topRightY)+`]`),e.artBox!==null&&G(`/ArtBox [`+w(e.artBox.bottomLeftX)+` `+w(e.artBox.bottomLeftY)+` `+w(e.artBox.topRightX)+` `+w(e.artBox.topRightY)+`]`),typeof e.userUnit==`number`&&e.userUnit!==1&&G(`/UserUnit `+e.userUnit),Ne.publish(`putPage`,{objId:r,pageContext:q[t],pageNumber:t,page:n}),G(`/Contents `+i+` 0 R`),G(`>>`),G(`endobj`);var a=n.join(`
|
||||
`);return b===y&&(a+=`
|
||||
Q`),We(i,!0),Xe({data:a,filters:Ye(),objectId:i}),G(`endobj`),r},Qe=p.__private__.putPages=function(){var e,t,n=[];for(e=1;e<=Me;e++)q[e].objId=Ue(),q[e].contentsObjId=Ue();for(e=1;e<=Me;e++)n.push(Ze({number:e,data:W[e],objId:q[e].objId,contentsObjId:q[e].contentsObjId,mediaBox:q[e].mediaBox,cropBox:q[e].cropBox,bleedBox:q[e].bleedBox,trimBox:q[e].trimBox,artBox:q[e].artBox,userUnit:q[e].userUnit,rootDictionaryObjId:Ke,resourceDictionaryObjId:qe}));We(Ke,!0),G(`<</Type /Pages`);var r=`/Kids [`;for(t=0;t<Me;t++)r+=n[t]+` 0 R `;G(r+`]`),G(`/Count `+Me),G(`>>`),G(`endobj`),Ne.publish(`postPutPages`)},$e=function(e){Ne.publish(`putFont`,{font:e,out:G,newObject:He,putStream:Xe}),!0!==e.isAlreadyPutted&&(e.objectNumber=He(),G(`<<`),G(`/Type /Font`),G(`/BaseFont /`+ff(e.postScriptName)),G(`/Subtype /Type1`),typeof e.encoding==`string`&&G(`/Encoding /`+e.encoding),G(`/FirstChar 32`),G(`/LastChar 255`),G(`>>`),G(`endobj`))},et=function(e){e.objectNumber=He();var t=[];t.push({key:`Type`,value:`/XObject`}),t.push({key:`Subtype`,value:`/Form`}),t.push({key:`BBox`,value:`[`+[w(e.x),w(e.y),w(e.x+e.width),w(e.y+e.height)].join(` `)+`]`}),t.push({key:`Matrix`,value:`[`+e.matrix.toString()+`]`}),Xe({data:e.pages[1].join(`
|
||||
`),additionalKeyValues:t,objectId:e.objectNumber}),G(`endobj`)},X=function(e,t){t||=21;var n=He(),r=function(e,t){var n,r=[],i=1/(t-1);for(n=0;n<1;n+=i)r.push(n);if(r.push(1),e[0].offset!=0){var a={offset:0,color:e[0].color};e.unshift(a)}if(e[e.length-1].offset!=1){var o={offset:1,color:e[e.length-1].color};e.push(o)}for(var s=``,c=0,l=0;l<r.length;l++){for(n=r[l];n>e[c+1].offset;)c++;var u=e[c].offset,d=(n-u)/(e[c+1].offset-u),f=e[c].color,p=e[c+1].color;s+=H(Math.round((1-d)*f[0]+d*p[0]).toString(16))+H(Math.round((1-d)*f[1]+d*p[1]).toString(16))+H(Math.round((1-d)*f[2]+d*p[2]).toString(16))}return s.trim()}(e.colors,t),i=[];i.push({key:`FunctionType`,value:`0`}),i.push({key:`Domain`,value:`[0.0 1.0]`}),i.push({key:`Size`,value:`[`+t+`]`}),i.push({key:`BitsPerSample`,value:`8`}),i.push({key:`Range`,value:`[0.0 1.0 0.0 1.0 0.0 1.0]`}),i.push({key:`Decode`,value:`[0.0 1.0 0.0 1.0 0.0 1.0]`}),Xe({data:r,additionalKeyValues:i,alreadyAppliedFilters:[`/ASCIIHexDecode`],objectId:n}),G(`endobj`),e.objectNumber=He(),G(`<< /ShadingType `+e.type),G(`/ColorSpace /DeviceRGB`);var a=`/Coords [`+w(parseFloat(e.coords[0]))+` `+w(parseFloat(e.coords[1]))+` `;e.type===2?a+=w(parseFloat(e.coords[2]))+` `+w(parseFloat(e.coords[3])):a+=w(parseFloat(e.coords[2]))+` `+w(parseFloat(e.coords[3]))+` `+w(parseFloat(e.coords[4]))+` `+w(parseFloat(e.coords[5])),G(a+=`]`),e.matrix&&G(`/Matrix [`+e.matrix.toString()+`]`),G(`/Function `+n+` 0 R`),G(`/Extend [true true]`),G(`>>`),G(`endobj`)},tt=function(e,t){var n=Ue(),r=He();t.push({resourcesOid:n,objectOid:r}),e.objectNumber=r;var i=[];i.push({key:`Type`,value:`/Pattern`}),i.push({key:`PatternType`,value:`1`}),i.push({key:`PaintType`,value:`1`}),i.push({key:`TilingType`,value:`1`}),i.push({key:`BBox`,value:`[`+e.boundingBox.map(w).join(` `)+`]`}),i.push({key:`XStep`,value:w(e.xStep)}),i.push({key:`YStep`,value:w(e.yStep)}),i.push({key:`Resources`,value:n+` 0 R`}),e.matrix&&i.push({key:`Matrix`,value:`[`+e.matrix.toString()+`]`}),Xe({data:e.stream,additionalKeyValues:i,objectId:e.objectNumber}),G(`endobj`)},nt=function(e){for(var t in e.objectNumber=He(),G(`<<`),e)switch(t){case`opacity`:G(`/ca `+D(e[t]));break;case`stroke-opacity`:G(`/CA `+D(e[t]))}G(`>>`),G(`endobj`)},rt=function(e){We(e.resourcesOid,!0),G(`<<`),G(`/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]`),function(){for(var e in G(`/Font <<`),we)we.hasOwnProperty(e)&&(!1===d||!0===d&&f.hasOwnProperty(e))&&G(`/`+e+` `+we[e].objectNumber+` 0 R`);G(`>>`)}(),function(){if(Object.keys(De).length>0){for(var e in G(`/Shading <<`),De)De.hasOwnProperty(e)&&De[e]instanceof gf&&De[e].objectNumber>=0&&G(`/`+e+` `+De[e].objectNumber+` 0 R`);Ne.publish(`putShadingPatternDict`),G(`>>`)}}(),function(e){if(Object.keys(De).length>0){for(var t in G(`/Pattern <<`),De)De.hasOwnProperty(t)&&De[t]instanceof p.TilingPattern&&De[t].objectNumber>=0&&De[t].objectNumber<e&&G(`/`+t+` `+De[t].objectNumber+` 0 R`);Ne.publish(`putTilingPatternDict`),G(`>>`)}}(e.objectOid),function(){if(Object.keys(ke).length>0){for(var e in G(`/ExtGState <<`),ke)ke.hasOwnProperty(e)&&ke[e].objectNumber>=0&&G(`/`+e+` `+ke[e].objectNumber+` 0 R`);Ne.publish(`putGStateDict`),G(`>>`)}}(),function(){for(var e in G(`/XObject <<`),Fe)Fe.hasOwnProperty(e)&&Fe[e].objectNumber>=0&&G(`/`+e+` `+Fe[e].objectNumber+` 0 R`);Ne.publish(`putXobjectDict`),G(`>>`)}(),G(`>>`),G(`endobj`)},it=function(e){Te[e.fontName]=Te[e.fontName]||{},Te[e.fontName][e.fontStyle]=e.id},at=function(e,t,n,r,i){var a={id:`F`+(Object.keys(we).length+1).toString(10),postScriptName:e,fontName:t,fontStyle:n,encoding:r,isStandardFont:i||!1,metadata:{}};return Ne.publish(`addFont`,{font:a,instance:this}),we[a.id]=a,it(a),a.id},ot=p.__private__.pdfEscape=p.pdfEscape=function(e,t){return function(e,t){var n,r,i,a,o,s,c,l,u;if(i=(t||={}).sourceEncoding||`Unicode`,o=t.outputEncoding,(t.autoencode||o)&&we[ye].metadata&&we[ye].metadata[i]&&we[ye].metadata[i].encoding&&(a=we[ye].metadata[i].encoding,!o&&we[ye].encoding&&(o=we[ye].encoding),!o&&a.codePages&&(o=a.codePages[0]),typeof o==`string`&&(o=a[o]),o)){for(c=!1,s=[],n=0,r=e.length;n<r;n++)(l=o[e.charCodeAt(n)])?s.push(String.fromCharCode(l)):s.push(e[n]),s[n].charCodeAt(0)>>8&&(c=!0);e=s.join(``)}for(n=e.length;c===void 0&&n!==0;)e.charCodeAt(n-1)>>8&&(c=!0),n--;if(!c)return e;for(s=t.noBOM?[]:[254,255],n=0,r=e.length;n<r;n++){if((u=(l=e.charCodeAt(n))>>8)>>8)throw Error(`Character at position `+n+` of string '`+e+`' exceeds 16bits. Cannot be encoded into UCS-2 BE`);s.push(u),s.push(l-(u<<8))}return String.fromCharCode.apply(void 0,s)}(e,t).replace(/\\/g,`\\\\`).replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)},st=p.__private__.beginPage=function(e){W[++Me]=[],q[Me]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(e[0]),topRightY:Number(e[1])}},ut(Me),oe(W[B])},ct=function(e,t){var r,a,o;switch(n=t||n,typeof e==`string`&&(r=_(e.toLowerCase()),Array.isArray(r)&&(a=r[0],o=r[1]))Line truncated
|
||||
`)},yt=p.__private__.getBlob=function(e){return new Blob([ce(e)],{type:`application/pdf`})},bt=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},xt=function(e){var t,n=e.document,r=n.documentElement,i=n.head,a=n.body;return i||(i=n.createElement(`head`),r.appendChild(i)),a||(a=n.createElement(`body`),r.appendChild(a)),bt(i),bt(a),(t=n.createElement(`style`)).appendChild(n.createTextNode(`html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}`)),i.appendChild(t),{document:n,body:a}},St=p.output=p.__private__.output=(J=function(e,t){switch(typeof(t||={})==`string`?t={filename:t}:t.filename=t.filename||`generated.pdf`,e){case void 0:return vt();case`save`:p.save(t.filename);break;case`arraybuffer`:return ce(vt());case`blob`:return yt(vt());case`bloburi`:case`bloburl`:if(Rd.URL!==void 0&&typeof Rd.URL.createObjectURL==`function`)return Rd.URL&&Rd.URL.createObjectURL(yt(vt()))||void 0;Bd.warn(`bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.`);break;case`datauristring`:case`dataurlstring`:var n=``,r=vt();try{n=qd(r)}catch{n=qd(unescape(encodeURIComponent(r)))}return`data:application/pdf;filename=`+encodeURIComponent(t.filename)+`;base64,`+n;case`pdfobjectnewwindow`:if(Object.prototype.toString.call(Rd)===`[object Window]`){var i=`https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js`,a=!t.pdfObjectUrl;a||(i=t.pdfObjectUrl);var o=Rd.open();if(o!==null){var s=xt(o),c=s.document.createElement(`script`),l=this;c.src=i,a&&(c.integrity=`sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==`,c.crossOrigin=`anonymous`),c.onload=function(){o.PDFObject.embed(l.output(`dataurlstring`),t)},s.body.appendChild(c)}return o}throw Error(`The option pdfobjectnewwindow just works in a browser-environment.`);case`pdfjsnewwindow`:if(Object.prototype.toString.call(Rd)===`[object Window]`){var u=t.pdfJsUrl||`examples/PDF.js/web/viewer.html`,d=Rd.open();if(d!==null){var f=xt(d),m=f.document.createElement(`iframe`),h=u.indexOf(`?`)===-1?`?`:`&`;l=this,m.id=`pdfViewer`,m.width=`500px`,m.height=`400px`,m.src=u+h+`file=&downloadName=`+encodeURIComponent(t.filename),m.onload=function(){d.document.title=t.filename,m.contentWindow.PDFViewerApplication.open(l.output(`bloburl`))},f.body.appendChild(m)}return d}throw Error(`The option pdfjsnewwindow just works in a browser-environment.`);case`dataurlnewwindow`:if(Object.prototype.toString.call(Rd)!==`[object Window]`)throw Error(`The option dataurlnewwindow just works in a browser-environment.`);var g=Rd.open();if(g!==null){var _=xt(g),v=_.document.createElement(`iframe`);v.src=this.output(`datauristring`,t),_.body.appendChild(v),g.document.title=t.filename}if(g||typeof safari>`u`)return g;break;case`datauri`:case`dataurl`:return Rd.document.location.href=this.output(`datauristring`,t);default:return null}},J.foo=function(){try{return J.apply(this,arguments)}catch(n){var e=n.stack||``;~e.indexOf(` at `)&&(e=e.split(` at `)[1]);var t=`Error in function `+e.split(`
|
||||
`)[0].split(`<`)[0]+`: `+n.message;if(!Rd.console)throw Error(t);Rd.console.error(t,n),Rd.alert&&alert(t)}},J.foo.bar=J,J.foo),Ct=function(e){return!0===Array.isArray(Pe)&&Pe.indexOf(e)>-1};switch(r){case`pt`:be=1;break;case`mm`:be=72/25.4;break;case`cm`:be=72/2.54;break;case`in`:be=72;break;case`px`:be=Ct(`px_scaling`)==1?.75:96/72;break;case`pc`:case`em`:be=12;break;case`ex`:be=6;break;default:if(typeof r!=`number`)throw Error(`Invalid unit: `+r);be=r}var Z=null;R(),P();var wt=p.__private__.getPageInfo=p.getPageInfo=function(e){if(isNaN(e)||e%1!=0)throw Error(`Invalid argument passed to jsPDF.getPageInfo`);return{objId:q[e].objId,pageNumber:e,pageContext:q[e]}},Tt=p.__private__.getPageInfoByObjId=function(e){if(isNaN(e)||e%1!=0)throw Error(`Invalid argument passed to jsPDF.getPageInfoByObjId`);for(var t in q)if(q[t].objId===e)break;return wt(t)},Et=p.__private__.getCurrentPageInfo=p.getCurrentPageInfo=function(){return{objId:q[B].objId,pageNumber:B,pageContext:q[B]}};p.addPage=function(){return ct.apply(this,arguments),this},p.setPage=function(){return ut.apply(this,arguments),oe.call(this,W[B]),this},p.insertPage=function(e){return this.addPage(),this.movePage(B,e),this},p.movePage=function(e,t){var n,r;if(e>t){n=W[e],r=q[e];for(var i=e;i>t;i--)W[i]=W[i-1],q[i]=q[i-1];W[t]=n,q[t]=r,this.setPage(t)}else if(e<t){n=W[e],r=q[e];for(var a=e;a<t;a++)W[a]=W[a+1],q[a]=q[a+1];W[t]=n,q[t]=r,this.setPage(t)}return this},p.deletePage=function(){return lt.apply(this,arguments),this},p.__private__.text=p.text=function(e,t,n,r,i){var a,o,s,c,l,u,d,p,m,h=(r||={}).scope||this;if(typeof e==`number`&&typeof t==`number`&&(typeof n==`string`||Array.isArray(n))){var g=n;n=t,t=e,e=g}if(arguments[3]instanceof Re==0?(s=arguments[4],c=arguments[5],Qi(d=arguments[3])===`object`&&d!==null||(typeof s==`string`&&(c=s,s=null),typeof d==`string`&&(c=d,d=null),typeof d==`number`&&(s=d,d=null),r={flags:d,angle:s,align:c})):(T(`The transform parameter of text() with a Matrix value`),m=i),isNaN(t)||isNaN(n)||e==null)throw Error(`Invalid arguments passed to jsPDF.text`);if(e.length===0)return h;var _,v=``,x=typeof r.lineHeightFactor==`number`?r.lineHeightFactor:Bt,S=h.internal.scaleFactor;function C(e){return e=e.split(` `).join(Array(r.TabLen||9).join(` `)),ot(e,d)}function E(e){for(var t,n=e.concat(),r=[],i=n.length;i--;)typeof(t=n.shift())==`string`?r.push(t):Array.isArray(e)&&(t.length===1||t[1]===void 0&&t[2]===void 0)?r.push(t[0]):r.push([t[0],t[1],t[2]]);return r}function D(e,t){var n;if(typeof e==`string`)n=t(e)[0];else if(Array.isArray(e)){for(var r,i,a=e.concat(),o=[],s=a.length;s--;)typeof(r=a.shift())==`string`?o.push(t(r)[0]):Array.isArray(r)&&typeof r[0]==`string`&&(i=t(r[0],r[1],r[2]),o.push([i[0],i[1],i[2]]));n=o}return n}var O=!1,A=!0;if(typeof e==`string`)O=!0;else if(Array.isArray(e)){var j=e.concat();o=[];for(var M,N=j.length;N--;)(typeof(M=j.shift())!=`string`||Array.isArray(M)&&typeof M[0]!=`string`)&&(A=!1);O=A}if(!1===O)throw Error(`Type of text must be string or Array. "`+e+`" is not recognized.`);typeof e==`string`&&(e=e.match(/[\r?\n]/)?e.split(/\r\n|\r|\n/g):[e]);var P=ue/h.internal.scaleFactor,F=P*(x-1);switch(r.baseline){case`bottom`:n-=F;break;case`top`:n+=P-F;break;case`hanging`:n+=P-2*F;break;case`middle`:n+=P/2-F}if((u=r.maxWidth||0)>0&&(typeof e==`string`?e=h.splitTextToSize(e,u):Object.prototype.toString.call(e)===`[object Array]`&&(e=e.reduce(function(e,t){return e.concat(h.splitTextToSize(t,u))},[]))),a={text:e,x:t,y:n,options:r,mutex:{pdfEscape:ot,activeFontKey:ye,fonts:we,activeFontSize:ue}},Ne.publish(`preProcessText`,a),e=a.text,s=(r=a.options).angle,m instanceof Re==0&&s&&typeof s==`number`){s*=Math.PI/180,r.rotationDirection===0&&(s=-s),b===y&&(s=-s);var I=Math.cos(s),R=Math.sin(s);m=new Re(I,R,-R,I,0,0)}else s&&s instanceof Re&&(m=s);b!==y||m||(m=Be),(l=r.charSpace||tn)!==void 0&&(v+=w(k(l))+` Tc
|
||||
`,this.setCharSpace(this.getCharSpace()||0)),(p=r.horizontalScale)!==void 0&&(v+=w(100*p)+` Tz
|
||||
`),r.lang;var z=-1,B=r.renderingMode===void 0?r.stroke:r.renderingMode,V=h.internal.getCurrentPageInfo().pageContext;switch(B){case 0:case!1:case`fill`:z=0;break;case 1:case!0:case`stroke`:z=1;break;case 2:case`fillThenStroke`:z=2;break;case 3:case`invisible`:z=3;break;case 4:case`fillAndAddForClipping`:z=4;break;case 5:case`strokeAndAddPathForClipping`:z=5;break;case 6:case`fillThenStrokeAndAddToPathForClipping`:z=6;break;case 7:case`addToPathForClipping`:z=7}var H=V.usedRenderingMode===void 0?-1:V.usedRenderingMode;z===-1?H!==-1&&(v+=`0 Tr
|
||||
`):v+=z+` Tr
|
||||
`,z!==-1&&(V.usedRenderingMode=z),c=r.align||`left`;var U,ee=ue*x,te=h.internal.pageSize.getWidth(),ne=we[ye];l=r.charSpace||tn,u=r.maxWidth||0,d=Object.assign({autoencode:!0,noBOM:!0},r.flags);var re=[],W=function(e){return h.getStringUnitWidth(e,{font:ne,charSpace:l,fontSize:ue,doKerning:!1})*ue/S};if(Object.prototype.toString.call(e)===`[object Array]`){var ie;o=E(e),c!==`left`&&(U=o.map(W));var ae,oe=0;if(c===`right`){t-=U[0],e=[],N=o.length;for(var se=0;se<N;se++)se===0?(ae=qt(t),ie=Jt(n)):(ae=k(oe-U[se]),ie=-ee),e.push([o[se],ae,ie]),oe=U[se]}else if(c===`center`){t-=U[0]/2,e=[],N=o.length;for(var ce=0;ce<N;ce++)ce===0?(ae=qt(t),ie=Jt(n)):(ae=k((oe-U[ce])/2),ie=-ee),e.push([o[ce],ae,ie]),oe=U[ce]}else if(c===`left`){e=[],N=o.length;for(var le=0;le<N;le++)e.push(o[le])}else if(c===`justify`&&ne.encoding===`Identity-H`){e=[],N=o.length,u=u===0?te:u;for(var K=0,de=0;de<N;de++)if(ie=de===0?Jt(n):-ee,ae=de===0?qt(t):K,de<N-1){var pe=k((u-U[de])/(o[de].split(` `).length-1)),me=o[de].split(` `);e.push([me[0]+` `,ae,ie]),K=0;for(var he=1;he<me.length;he++){var ge=(W(me[he-1]+` `+me[he])-W(me[he]))*S+pe;he==me.length-1?e.push([me[he],ge,0]):e.push([me[he]+` `,ge,0]),K-=ge}}else e.push([o[de],ae,ie]);e.push([``,K,0])}else{if(c!==`justify`)throw Error(`Unrecognized alignment option, use "left", "center", "right" or "justify".`);for(e=[],N=o.length,u=u===0?te:u,de=0;de<N;de++){ie=de===0?Jt(n):-ee,ae=de===0?qt(t):0;var _e=o[de].split(` `).length-1,ve=_e>0?(u-U[de])/_e:0;de<N-1?re.push(w(k(ve))):re.push(0),e.push([o[de],ae,ie])}}}!0===(typeof r.R2L==`boolean`?r.R2L:fe)&&(e=D(e,function(e,t,n){return[e.split(``).reverse().join(``),t,n]})),a={text:e,x:t,y:n,options:r,mutex:{pdfEscape:ot,activeFontKey:ye,fonts:we,activeFontSize:ue}},Ne.publish(`postProcessText`,a),e=a.text,_=a.mutex.isHex||!1;var be=we[ye].encoding;be!==`WinAnsiEncoding`&&be!==`StandardEncoding`||(e=D(e,function(e,t,n){return[C(e),t,n]})),o=E(e),e=[];for(var xe,Se,Ce,Te=+!!Array.isArray(o[0]),Ee=``,De=function(e,t,n){var i=``;return n instanceof Re?(n=typeof r.angle==`number`?ze(n,new Re(1,0,0,1,e,t)):ze(new Re(1,0,0,1,e,t),n),b===y&&(n=ze(new Re(1,0,0,-1,0,0),n)),i=n.join(` `)+` Tm
|
||||
`):i=w(e)+` `+w(t)+` Td
|
||||
`,i},Oe=0;Oe<o.length;Oe++){switch(Ee=``,Te){case 1:Ce=(_?`<`:`(`)+o[Oe][0]+(_?`>`:`)`),xe=parseFloat(o[Oe][1]),Se=parseFloat(o[Oe][2]);break;case 0:Ce=(_?`<`:`(`)+o[Oe]+(_?`>`:`)`),xe=qt(t),Se=Jt(n)}re!==void 0&&re[Oe]!==void 0&&(Ee=re[Oe]+` Tw
|
||||
`),Oe===0?e.push(Ee+De(xe,Se,m)+Ce):Te===0?e.push(Ee+Ce):Te===1&&e.push(Ee+De(xe,Se,m)+Ce)}e=Te===0?e.join(` Tj
|
||||
T* `):e.join(` Tj
|
||||
`),e+=` Tj
|
||||
`;var ke=`BT
|
||||
/`;return ke+=ye+` `+ue+` Tf
|
||||
`,ke+=w(ue*x)+` TL
|
||||
`,ke+=$t+`
|
||||
`,ke+=v,ke+=e,G(ke+=`ET`),f[ye]=!0,h};var Dt=p.__private__.clip=p.clip=function(e){return G(e===`evenodd`?`W*`:`W`),this};p.clipEvenOdd=function(){return Dt(`evenodd`)},p.__private__.discardPath=p.discardPath=function(){return G(`n`),this};var Ot=p.__private__.isValidStyle=function(e){var t=!1;return[void 0,null,`S`,`D`,`F`,`DF`,`FD`,`f`,`f*`,`B`,`B*`,`n`].indexOf(e)!==-1&&(t=!0),t};p.__private__.setDefaultPathOperation=p.setDefaultPathOperation=function(e){return Ot(e)&&(l=e),this};var kt=p.__private__.getStyle=p.getStyle=function(e){var t=l;switch(e){case`D`:case`S`:t=`S`;break;case`F`:t=`f`;break;case`FD`:case`DF`:t=`B`;break;case`f`:case`f*`:case`B`:case`B*`:t=e}return t},At=p.close=function(){return G(`h`),this};p.stroke=function(){return G(`S`),this},p.fill=function(e){return jt(`f`,e),this},p.fillEvenOdd=function(e){return jt(`f*`,e),this},p.fillStroke=function(e){return jt(`B`,e),this},p.fillStrokeEvenOdd=function(e){return jt(`B*`,e),this};var jt=function(e,t){Qi(t)===`object`?Pt(t,e):G(e)},Mt=function(e){e===null||b===y&&e===void 0||(e=kt(e),G(e))};function Nt(e,t,n,r,i){var a=new _f(t||this.boundingBox,n||this.xStep,r||this.yStep,this.gState,i||this.matrix);return a.stream=this.stream,Ve(e+`$$`+ this.cloneIndex+++`$$`,a),a}var Pt=function(e,t){var n=Oe[e.key],r=De[n];if(r instanceof gf)G(`q`),G(Ft(t)),r.gState&&p.setGState(r.gState),G(e.matrix.toString()+` cm`),G(`/`+n+` sh`),G(`Q`);else if(r instanceof _f){var i=new Re(1,0,0,-1,0,vn());e.matrix&&(i=i.multiply(e.matrix||Be),n=Nt.call(r,e.key,e.boundingBox,e.xStep,e.yStep,i).id),G(`q`),G(`/Pattern cs`),G(`/`+n+` scn`),r.gState&&p.setGState(r.gState),G(t),G(`Q`)}},Ft=function(e){switch(e){case`f`:case`F`:case`n`:return`W n`;case`f*`:return`W* n`;case`B`:case`S`:return`W S`;case`B*`:return`W* S`}},It=p.moveTo=function(e,t){return G(w(k(e))+` `+w(A(t))+` m`),this},Lt=p.lineTo=function(e,t){return G(w(k(e))+` `+w(A(t))+` l`),this},Rt=p.curveTo=function(e,t,n,r,i,a){return G([w(k(e)),w(A(t)),w(k(n)),w(A(r)),w(k(i)),w(A(a)),`c`].join(` `)),this};p.__private__.line=p.line=function(e,t,n,r,i){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||!Ot(i))throw Error(`Invalid arguments passed to jsPDF.line`);return b===v?this.lines([[n-e,r-t]],e,t,[1,1],i||`S`):this.lines([[n-e,r-t]],e,t,[1,1]).stroke()},p.__private__.lines=p.lines=function(e,t,n,r,i,a){var o,s,c,l,u,d,f,p,m,h,g,_;if(typeof e==`number`&&(_=n,n=t,t=e,e=_),r||=[1,1],a||=!1,isNaN(t)||isNaN(n)||!Array.isArray(e)||!Array.isArray(r)||!Ot(i)||typeof a!=`boolean`)throw Error(`Invalid arguments passed to jsPDF.lines`);for(It(t,n),o=r[0],s=r[1],l=e.length,h=t,g=n,c=0;c<l;c++)(u=e[c]).length===2?(h=u[0]*o+h,g=u[1]*s+g,Lt(h,g)):(d=u[0]*o+h,f=u[1]*s+g,p=u[2]*o+h,m=u[3]*s+g,h=u[4]*o+h,g=u[5]*s+g,Rt(d,f,p,m,h,g));return a&&At(),Mt(i),this},p.path=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n.c;switch(n.op){case`m`:It(r[0],r[1]);break;case`l`:Lt(r[0],r[1]);break;case`c`:Rt.apply(this,r);break;case`h`:At()}}return this},p.__private__.rect=p.rect=function(e,t,n,r,i){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||!Ot(i))throw Error(`Invalid arguments passed to jsPDF.rect`);return b===v&&(r=-r),G([w(k(e)),w(A(t)),w(k(n)),w(k(r)),`re`].join(` `)),Mt(i),this},p.__private__.triangle=p.triangle=function(e,t,n,r,i,a,o){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(a)||!Ot(o))throw Error(`Invalid arguments passed to jsPDF.triangle`);return this.lines([[n-e,r-t],[i-n,a-r],[e-i,t-a]],e,t,[1,1],o,!0),this},p.__private__.roundedRect=p.roundedRect=function(e,t,n,r,i,a,o){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(a)||!Ot(o))throw Error(`Invalid arguments passed to jsPDF.roundedRect`);var s=4/3*(Math.SQRT2-1);return i=Math.min(i,.5*n),a=Math.min(a,.5*r),this.lines([[n-2*i,0],[i*s,0,i,a-a*s,i,a],[0,r-2*a],[0,a*s,-i*s,a,-i,a],[2*i-n,0],[-i*s,0,-i,-a*s,-i,-a],[0,2*a-r],[0,-a*s,i*s,-a,i,-a]],e+i,t,[1,1],o,!0),this},p.__private__.ellipse=p.ellipse=function(e,t,n,r,i){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||!Ot(i))throw Error(`Invalid arguments passed to jsPDF.ellipse`);var a=4/3*(Math.SQRT2-1)*n,o=4/3*(Math.SQRT2-1)*r;return It(e+n,t),Rt(e+n,t-o,e+a,t-r,e,t-r),Rt(e-a,t-r,e-n,t-o,e-n,t),Rt(e-n,t+o,e-a,t+r,e,t+r),Rt(e+a,t+r,e+n,t+o,e+n,t),Mt(i),this},p.__private__.circle=p.circle=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||!Ot(r))throw Error(`Invalid arguments passed to jsPDF.circle`);return this.ellipse(e,t,n,n,r)},p.setFont=function(e,t,n){return n&&(t=C(t,n)),ye=ft(e,t,{disableWarning:!1}),this};var zt=p.__private__.getFont=p.getFont=function(){return we[ft.apply(p,arguments)]};p.__private__.getFontList=p.getFontList=function(){var e,t,n={};for(e in Te)if(Te.hasOwnProperty(e))for(t in n[e]=[],Te[e])Te[e].hasOwnProperty(t)&&n[e].push(t);return n},p.addFont=function(e,t,n,r,i){var a=[`StandardEncoding`,`MacRomanEncoding`,`Identity-H`,`WinAnsiEncoding`];return arguments[3]&&a.indexOf(arguments[3])!==-1?i=arguments[3]:arguments[3]&&a.indexOf(arguments[3])==-1&&(n=C(n,r)),at.call(this,e,t,n,i||=`IdLine truncated
|
||||
`),i}},Lf=function(e,t){var n=e.fontSize===0?e.maxFontSize:e.fontSize,r={text:``,fontSize:``},i=(t=(t=t.substr(0,1)==`(`?t.substr(1):t).substr(t.length-1)==`)`?t.substr(0,t.length-1):t).split(` `);i=e.multiline?i.map(function(e){return e.split(`
|
||||
`)}):i.map(function(e){return[e]});var a=n,o=ap.internal.getHeight(e)||0;o=o<0?-o:o;var s=ap.internal.getWidth(e)||0;s=s<0?-s:s;var c=function(t,n,r){return t+1<i.length?Rf(n+` `+i[t+1][0],e,r).width<=s-4:!1};a++;t:for(;a>0;){t=``,a--;var l,u,d=Rf(`3`,e,a).height,f=e.multiline?o-a:(o-d)/2,p=f+=2,m=0,h=0,g=0;if(a<=0){t=`(...) Tj
|
||||
`,t+=`% Width of Text: `+Rf(t,e,a=12).width+`, FieldWidth:`+s+`
|
||||
`;break}for(var _=``,v=0,y=0;y<i.length;y++)if(i.hasOwnProperty(y)){var b=!1;if(i[y].length!==1&&g!==i[y].length-1){if((d+2)*(v+2)+2>o)continue t;_+=i[y][g],b=!0,h=y,y--}else{_=(_+=i[y][g]+` `).substr(_.length-1)==` `?_.substr(0,_.length-1):_;var x=parseInt(y),S=c(x,_,a),C=y>=i.length-1;if(S&&!C){_+=` `,g=0;continue}if(S||C){if(C)h=x;else if(e.multiline&&(d+2)*(v+2)+2>o)continue t}else{if(!e.multiline||(d+2)*(v+2)+2>o)continue t;h=x}}for(var w=``,T=m;T<=h;T++){var E=i[T];if(e.multiline){if(T===h){w+=E[g]+` `,g=(g+1)%E.length;continue}if(T===m){w+=E[E.length-1]+` `;continue}}w+=E[0]+` `}switch(w=w.substr(w.length-1)==` `?w.substr(0,w.length-1):w,u=Rf(w,e,a).width,e.textAlign){case`right`:l=s-u-2;break;case`center`:l=(s-u)/2;break;default:l=2}t+=wf(l)+` `+wf(p)+` Td
|
||||
`,t+=`(`+xf(w)+`) Tj
|
||||
`,t+=-wf(l)+` 0 Td
|
||||
`,p=-(a+2),u=0,m=b?h:h+1,v++,_=``}break}return r.text=t,r.fontSize=a,r},Rf=function(e,t,n){var r=t.scope.internal.getFont(t.fontName,t.fontStyle),i=t.scope.getStringUnitWidth(e,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:t.scope.getStringUnitWidth(`3`,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},zf={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},Bf=function(e,t){var n={type:`reference`,object:e};t.internal.getPageInfo(e.page).pageContext.annotations.find(function(e){return e.type===n.type&&e.object===n.object})===void 0&&t.internal.getPageInfo(e.page).pageContext.annotations.push(n)},Vf=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||!1===e.internal.acroformPlugin.isInitialized)){if(qf.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(zf)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw Error(`Exception while creating AcroformDictionary`);bf=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new Kf,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe(`postPutResources`,function(){(function(e){e.internal.events.unsubscribe(e.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete e.internal.acroformPlugin.acroFormDictionaryRoot._eventID,e.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe(`buildDocument`,function(){(function(e){e.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=e.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];r.objId=void 0,r.hasAnnotation&&Bf(r,e)}})(e)}),e.internal.events.subscribe(`putCatalog`,function(){(function(e){if(e.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw Error(`putCatalogCallback: Root missing.`);e.internal.write(`/AcroForm `+e.internal.acroformPlugin.acroFormDictionaryRoot.objId+` 0 R`)})(e)}),e.internal.events.subscribe(`postPutPages`,function(t){(function(e,t){var n=!e;for(var r in e||(t.internal.newObjectDeferredBegin(t.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),t.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),e||=t.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(e.hasOwnProperty(r)){var i=e[r],a=[],o=i.Rect;if(i.Rect&&=Ff(i.Rect,t),t.internal.newObjectDeferredBegin(i.objId,!0),i.DA=ap.createDefaultAppearanceStream(i),Qi(i)===`object`&&typeof i.getKeyValueListForStream==`function`&&(a=i.getKeyValueListForStream()),i.Rect=o,i.hasAppearanceStream&&!i.appearanceStreamContent){var s=If(i);a.push({key:`AP`,value:`<</N `+s+`>>`}),t.internal.acroformPlugin.xForms.push(s)}if(i.appearanceStreamContent){var c=``;for(var l in i.appearanceStreamContent)if(i.appearanceStreamContent.hasOwnProperty(l)){var u=i.appearanceStreamContent[l];if(c+=`/`+l+` `,c+=`<<`,Object.keys(u).length>=1||Array.isArray(u)){for(var r in u)if(u.hasOwnProperty(r)){var d=u[r];typeof d==`function`&&(d=d.call(t,i)),c+=`/`+r+` `+d+` `,t.internal.acroformPlugin.xForms.indexOf(d)>=0||t.internal.acroformPlugin.xForms.push(d)}}else typeof(d=u)==`function`&&(d=d.call(t,i)),c+=`/`+r+` `+d,t.internal.acroformPlugin.xForms.indexOf(d)>=0||t.internal.acroformPlugin.xForms.push(d);c+=`>>`}a.push({key:`AP`,value:`<<
|
||||
`+c+`>>`})}t.internal.putStream({additionalKeyValues:a,objectId:i.objId}),t.internal.out(`endobj`)}n&&function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=n,i=e[n];t.internal.newObjectDeferredBegin(i.objId,!0),Qi(i)===`object`&&typeof i.putStream==`function`&&i.putStream(),delete e[r]}}(t.internal.acroformPlugin.xForms,t)})(t,e)}),e.internal.acroformPlugin.isInitialized=!0}},Hf=yf.__acroform__.arrayToPdfArray=function(e,t,n){var r=function(e){return e};if(Array.isArray(e)){for(var i=`[`,a=0;a<e.length;a++)switch(a!==0&&(i+=` `),Qi(e[a])){case`boolean`:case`number`:case`object`:i+=e[a].toString();break;case`string`:e[a].substr(0,1)===`/`?i+=`/`+Cf(e[a].substr(1)):(t!==void 0&&n&&(r=n.internal.getEncryptor(t)),i+=`(`+xf(r(e[a].toString()))+`)`)}return i+`]`}throw Error(`Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray`)},Uf=function(e,t,n){var r=function(e){return e};return t!==void 0&&n&&(r=n.internal.getEncryptor(t)),(e||=``).toString(),`(`+xf(r(e))+`)`},Wf=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};Wf.prototype.toString=function(){return this.objId+` 0 R`},Wf.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out(`endobj`)},Wf.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(e){return e!=`content`&&e!=`appearanceStreamContent`&&e!=`scope`&&e!=`objId`&&e.substring(0,1)!=`_`});for(var n in t)if(!1===Object.getOwnPropertyDescriptor(this,t[n]).configurable){var r=t[n],i=this[r];i&&(Array.isArray(i)?e.push({key:r,value:Hf(i,this.objId,this.scope)}):i instanceof Wf?(i.scope=this.scope,e.push({key:r,value:i.objId+` 0 R`})):typeof i!=`function`&&e.push({key:r,value:i}))}return e};var Gf=function(){Wf.call(this),Object.defineProperty(this,"Type",{value:`/XObject`,configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:`/Form`,configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"Resources",{value:`2 0 R`,configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){e=t.trim()},get:function(){return e||null}})};Ef(Gf,Wf);var Kf=function(){Wf.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),`(`+xf(t(e))+`)`}},set:function(t){e=t}})};Ef(Kf,Wf);var qf=function e(){Wf.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){if(isNaN(e))throw Error(`Invalid value "`+e+`" for attribute F supplied.`);t=e}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Mf(t,3)},set:function(e){!!e==1?this.F=Nf(t,3):this.F=Pf(t,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(e){if(isNaN(e))throw Error(`Invalid value "`+e+`" for attribute Ff supplied.`);n=e}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(e){r=e===void 0?[]:e}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(e){r[0]=e}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(e){r[1]=e}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(e){r[2]=e}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(e){r[3]=e}});var i=``;Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(e){switch(e){case`/Btn`:case`/Tx`:case`/Ch`:case`/Sig`:i=e;break;default:throw Error(`Invalid value "`+e+`" for attribute FT supplied.`)}}});var a=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof tp)return;a=`FieldObject`+ e.FieldNum++}var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),`(`+xf(t(a))+`)`},set:functio
Line truncated
|
||||
`)}},set:function(e){Qi(e)===`object`&&(t=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||``},set:function(e){typeof e==`string`&&(t.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){var n=t==null?``:t.toString();n.substr(0,1)===`/`&&(n=n.substr(1)),e=`/`+Cf(n)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e=`/`+Cf(t)}})};Ef(Qf,qf);var $f=function(){Qf.call(this),this.pushButton=!0};Ef($f,Qf);var ep=function(){Qf.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t===void 0?[]:t}})};Ef(ep,Qf);var tp=function(){var e,t;qf.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(e){t=e}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var e=function(e){return e};this.scope&&(e=this.scope.internal.getEncryptor(this.objId));var t,n=[];for(t in n.push(`<<`),r)n.push(`/`+t+` (`+xf(e(r[t]))+`)`);return n.push(`>>`),n.join(`
|
||||
`)},set:function(e){Qi(e)===`object`&&(r=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||``},set:function(e){typeof e==`string`&&(r.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(e){var t=e==null?``:e.toString();t.substr(0,1)===`/`&&(t=t.substr(1)),n=`/`+Cf(t)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(e){var t=e==null?``:e.toString();t.substr(0,1)===`/`&&(t=t.substr(1)),n=`/`+Cf(t)}}),this.caption=`l`,this.appearanceState=`Off`,this._AppearanceType=ap.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Ef(tp,qf),ep.prototype.setAppearance=function(e){if(!(`createAppearanceStream`in e)||!(`getCA`in e))throw Error(`Couldn't assign Appearance to RadioButton. Appearance was Invalid!`);for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var n=this.Kids[t];n.appearanceStreamContent=e.createAppearanceStream(n.optionName),n.caption=e.getCA()}},ep.prototype.createOption=function(e){var t=new tp;return t.Parent=this,t.optionName=e,this.Kids.push(t),op.call(this.scope,t),t};var np=function(){Qf.call(this),this.fontName=`zapfdingbats`,this.caption=`3`,this.appearanceState=`On`,this.value=`On`,this.textAlign=`center`,this.appearanceStreamContent=ap.CheckBox.createAppearanceStream()};Ef(np,Qf);var rp=function(){qf.call(this),this.FT=`/Tx`,Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Mf(this.Ff,13)},set:function(e){!!e==1?this.Ff=Nf(this.Ff,13):this.Ff=Pf(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Mf(this.Ff,21)},set:function(e){!!e==1?this.Ff=Nf(this.Ff,21):this.Ff=Pf(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Mf(this.Ff,23)},set:function(e){!!e==1?this.Ff=Nf(this.Ff,23):this.Ff=Pf(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Mf(this.Ff,24)},set:function(e){!!e==1?this.Ff=Nf(this.Ff,24):this.Ff=Pf(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Mf(this.Ff,25)},set:function(e){!!e==1?this.Ff=Nf(this.Ff,25):this.Ff=Pf(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Mf(this.Ff,26)},set:function(e){!!e==1?this.Ff=Nf(this.Ff,26):this.Ff=Pf(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Ef(rp,qf);var ip=function(){rp.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Mf(this.Ff,14)},set:function(e){!!e==1?this.Ff=Nf(this.Ff,14):this.Ff=Pf(this.Ff,14)}}),this.password=!0};Ef(ip,rp);var ap={CheckBox:{createAppearanceStream:function(){return{N:{On:ap.CheckBox.YesNormal},D:{On:ap.CheckBox.YesPushDown,Off:ap.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=Of(e);t.scope=e.scope;var n=[],r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,i=e.scope.__private__.encodeColorString(e.color),a=Lf(e,e.caption);return n.push(`0.749023 g`),n.push(`0 0 `+wf(ap.internal.getWidth(e))+` `+wf(ap.internal.getHeight(e))+` re`),n.push(`f`),n.push(`BMC`),n.push(`q`),n.push(`0 0 1 rg`),n.push(`/`+r+` `+wf(a.fontSize)+` Tf `+i),n.push(`BT`),n.push(a.text),n.push(`ET`),n.push(`Q`),n.push(`EMC`),t.stream=n.join(`
|
||||
`),t},YesNormal:function(e){var t=Of(e);t.scope=e.scope;var n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color),i=[],a=ap.internal.getHeight(e),o=ap.internal.getWidth(e),s=Lf(e,e.caption);return i.push(`1 g`),i.push(`0 0 `+wf(o)+` `+wf(a)+` re`),i.push(`f`),i.push(`q`),i.push(`0 0 1 rg`),i.push(`0 0 `+wf(o-1)+` `+wf(a-1)+` re`),i.push(`W`),i.push(`n`),i.push(`0 g`),i.push(`BT`),i.push(`/`+n+` `+wf(s.fontSize)+` Tf `+r),i.push(s.text),i.push(`ET`),i.push(`Q`),t.stream=i.join(`
|
||||
`),t},OffPushDown:function(e){var t=Of(e);t.scope=e.scope;var n=[];return n.push(`0.749023 g`),n.push(`0 0 `+wf(ap.internal.getWidth(e))+` `+wf(ap.internal.getHeight(e))+` re`),n.push(`f`),t.stream=n.join(`
|
||||
`),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:ap.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=ap.RadioButton.Circle.YesNormal,t.D[e]=ap.RadioButton.Circle.YesPushDown,t},getCA:function(){return`l`},YesNormal:function(e){var t=Of(e);t.scope=e.scope;var n=[],r=ap.internal.getWidth(e)<=ap.internal.getHeight(e)?ap.internal.getWidth(e)/4:ap.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=ap.internal.Bezier_C,a=Number((r*i).toFixed(5));return n.push(`q`),n.push(`1 0 0 1 `+Tf(ap.internal.getWidth(e)/2)+` `+Tf(ap.internal.getHeight(e)/2)+` cm`),n.push(r+` 0 m`),n.push(r+` `+a+` `+a+` `+r+` 0 `+r+` c`),n.push(`-`+a+` `+r+` -`+r+` `+a+` -`+r+` 0 c`),n.push(`-`+r+` -`+a+` -`+a+` -`+r+` 0 -`+r+` c`),n.push(a+` -`+r+` `+r+` -`+a+` `+r+` 0 c`),n.push(`f`),n.push(`Q`),t.stream=n.join(`
|
||||
`),t},YesPushDown:function(e){var t=Of(e);t.scope=e.scope;var n=[],r=ap.internal.getWidth(e)<=ap.internal.getHeight(e)?ap.internal.getWidth(e)/4:ap.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),a=Number((i*ap.internal.Bezier_C).toFixed(5)),o=Number((r*ap.internal.Bezier_C).toFixed(5));return n.push(`0.749023 g`),n.push(`q`),n.push(`1 0 0 1 `+Tf(ap.internal.getWidth(e)/2)+` `+Tf(ap.internal.getHeight(e)/2)+` cm`),n.push(i+` 0 m`),n.push(i+` `+a+` `+a+` `+i+` 0 `+i+` c`),n.push(`-`+a+` `+i+` -`+i+` `+a+` -`+i+` 0 c`),n.push(`-`+i+` -`+a+` -`+a+` -`+i+` 0 -`+i+` c`),n.push(a+` -`+i+` `+i+` -`+a+` `+i+` 0 c`),n.push(`f`),n.push(`Q`),n.push(`0 g`),n.push(`q`),n.push(`1 0 0 1 `+Tf(ap.internal.getWidth(e)/2)+` `+Tf(ap.internal.getHeight(e)/2)+` cm`),n.push(r+` 0 m`),n.push(r+` `+o+` `+o+` `+r+` 0 `+r+` c`),n.push(`-`+o+` `+r+` -`+r+` `+o+` -`+r+` 0 c`),n.push(`-`+r+` -`+o+` -`+o+` -`+r+` 0 -`+r+` c`),n.push(o+` -`+r+` `+r+` -`+o+` `+r+` 0 c`),n.push(`f`),n.push(`Q`),t.stream=n.join(`
|
||||
`),t},OffPushDown:function(e){var t=Of(e);t.scope=e.scope;var n=[],r=ap.internal.getWidth(e)<=ap.internal.getHeight(e)?ap.internal.getWidth(e)/4:ap.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),a=Number((i*ap.internal.Bezier_C).toFixed(5));return n.push(`0.749023 g`),n.push(`q`),n.push(`1 0 0 1 `+Tf(ap.internal.getWidth(e)/2)+` `+Tf(ap.internal.getHeight(e)/2)+` cm`),n.push(i+` 0 m`),n.push(i+` `+a+` `+a+` `+i+` 0 `+i+` c`),n.push(`-`+a+` `+i+` -`+i+` `+a+` -`+i+` 0 c`),n.push(`-`+i+` -`+a+` -`+a+` -`+i+` 0 -`+i+` c`),n.push(a+` -`+i+` `+i+` -`+a+` `+i+` 0 c`),n.push(`f`),n.push(`Q`),t.stream=n.join(`
|
||||
`),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:ap.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=ap.RadioButton.Cross.YesNormal,t.D[e]=ap.RadioButton.Cross.YesPushDown,t},getCA:function(){return`8`},YesNormal:function(e){var t=Of(e);t.scope=e.scope;var n=[],r=ap.internal.calculateCross(e);return n.push(`q`),n.push(`1 1 `+wf(ap.internal.getWidth(e)-2)+` `+wf(ap.internal.getHeight(e)-2)+` re`),n.push(`W`),n.push(`n`),n.push(wf(r.x1.x)+` `+wf(r.x1.y)+` m`),n.push(wf(r.x2.x)+` `+wf(r.x2.y)+` l`),n.push(wf(r.x4.x)+` `+wf(r.x4.y)+` m`),n.push(wf(r.x3.x)+` `+wf(r.x3.y)+` l`),n.push(`s`),n.push(`Q`),t.stream=n.join(`
|
||||
`),t},YesPushDown:function(e){var t=Of(e);t.scope=e.scope;var n=ap.internal.calculateCross(e),r=[];return r.push(`0.749023 g`),r.push(`0 0 `+wf(ap.internal.getWidth(e))+` `+wf(ap.internal.getHeight(e))+` re`),r.push(`f`),r.push(`q`),r.push(`1 1 `+wf(ap.internal.getWidth(e)-2)+` `+wf(ap.internal.getHeight(e)-2)+` re`),r.push(`W`),r.push(`n`),r.push(wf(n.x1.x)+` `+wf(n.x1.y)+` m`),r.push(wf(n.x2.x)+` `+wf(n.x2.y)+` l`),r.push(wf(n.x4.x)+` `+wf(n.x4.y)+` m`),r.push(wf(n.x3.x)+` `+wf(n.x3.y)+` l`),r.push(`s`),r.push(`Q`),t.stream=r.join(`
|
||||
`),t},OffPushDown:function(e){var t=Of(e);t.scope=e.scope;var n=[];return n.push(`0.749023 g`),n.push(`0 0 `+wf(ap.internal.getWidth(e))+` `+wf(ap.internal.getHeight(e))+` re`),n.push(`f`),t.stream=n.join(`
|
||||
`),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color);return`/`+t+` `+e.fontSize+` Tf `+n}};ap.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=ap.internal.getWidth(e),n=ap.internal.getHeight(e),r=Math.min(t,n);return{x1:{x:(t-r)/2,y:(n-r)/2+r},x2:{x:(t-r)/2+r,y:(n-r)/2},x3:{x:(t-r)/2,y:(n-r)/2},x4:{x:(t-r)/2+r,y:(n-r)/2+r}}}},ap.internal.getWidth=function(e){var t=0;return Qi(e)===`object`&&(t=Df(e.Rect[2])),t},ap.internal.getHeight=function(e){var t=0;return Qi(e)===`object`&&(t=Df(e.Rect[3])),t};var op=yf.addField=function(e){if(Vf(this,e),!(e instanceof qf))throw Error(`Invalid argument passed to jsPDF.addField.`);var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};yf.AcroFormChoiceField=Jf,yf.AcroFormListBox=Yf,yf.AcroFormComboBox=Xf,yf.AcroFormEditBox=Zf,yf.AcroFormButton=Qf,yf.AcroFormPushButton=$f,yf.AcroFormRadioButton=ep,yf.AcroFormCheckBox=np,yf.AcroFormTextField=rp,yf.AcroFormPasswordField=ip,yf.AcroFormAppearance=ap,yf.AcroForm={ChoiceField:Jf,ListBox:Yf,ComboBox:Xf,EditBox:Zf,Button:Qf,PushButton:$f,RadioButton:ep,CheckBox:np,TextField:rp,PasswordField:ip,Appearance:ap},vf.AcroForm={ChoiceField:Jf,ListBox:Yf,ComboBox:Xf,EditBox:Zf,Button:Qf,PushButton:$f,RadioButton:ep,CheckBox:np,TextField:rp,PasswordField:ip,Appearance:ap},vf.AcroForm;function sp(e){return e.reduce(function(e,t,n){return e[t]=n,e},{})}(function(e){var t=`addImage_`;e.__addimage__={};var n=`UNKNOWN`,r={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},i=e.__addimage__.getImageFileTypeByImageData=function(e,t){var i,a,o,s,c,l=n;if((t||=n)===`RGBA`||e.data!==void 0&&e.data instanceof Uint8ClampedArray&&`height`in e&&`width`in e)return`RGBA`;if(S(e))for(c in r)for(o=r[c],i=0;i<o.length;i+=1){for(s=!0,a=0;a<o[i].length;a+=1)if(o[i][a]!==void 0&&o[i][a]!==e[a]){s=!1;break}if(!0===s){l=c;break}}else for(c in r)for(o=r[c],i=0;i<o.length;i+=1){for(s=!0,a=0;a<o[i].length;a+=1)if(o[i][a]!==void 0&&o[i][a]!==e.charCodeAt(a)){s=!1;break}if(!0===s){l=c;break}}return l===n&&t!==n&&(l=t),l},a=function e(t){for(var n=this.internal.write,r=this.internal.putStream,i=(0,this.internal.getFilters)();i.indexOf(`FlateEncode`)!==-1;)i.splice(i.indexOf(`FlateEncode`),1);t.objectId=this.internal.newObject();var a=[];if(a.push({key:`Type`,value:`/XObject`}),a.push({key:`Subtype`,value:`/Image`}),a.push({key:`Width`,value:t.width}),a.push({key:`Height`,value:t.height}),t.colorSpace===_.INDEXED?a.push({key:`ColorSpace`,value:`[/Indexed /DeviceRGB `+(t.palette.length/3-1)+` `+(`sMask`in t&&t.sMask!==void 0?t.objectId+2:t.objectId+1)+` 0 R]`}):(a.push({key:`ColorSpace`,value:`/`+t.colorSpace}),t.colorSpace===_.DEVICE_CMYK&&a.push({key:`Decode`,value:`[1 0 1 0 1 0 1 0]`})),a.push({key:`BitsPerComponent`,value:t.bitsPerComponent}),`decodeParameters`in t&&t.decodeParameters!==void 0&&a.push({key:`DecodeParms`,value:`<<`+t.decodeParameters+`>>`}),`transparency`in t&&Array.isArray(t.transparency)&&t.transparency.length>0){for(var o=``,s=0,c=t.transparency.length;s<c;s++)o+=t.transparency[s]+` `+t.transparency[s]+` `;a.push({key:`Mask`,value:`[`+o+`]`})}t.sMask!==void 0&&a.push({key:`SMask`,value:t.objectId+1+` 0 R`});var l=t.filter===void 0?void 0:[`/`+t.filter];if(r({data:t.data,additionalKeyValues:a,alreadyAppliedFilters:l,objectId:t.objectId}),n(`endobj`),`sMask`in t&&t.sMask!==void 0){var u=t.sMaskBitsPerComponent??t.bitsPerComponent,d={width:t.width,height:t.height,colorSpace:`DeviceGray`,bitsPerComponent:u,data:t.sMask};`filter`in t&&(d.decodeParameters=`/Predictor ${t.predictor} /Colors 1 /BitsPerComponent ${u} /Columns ${t.width}`,d.filter=t.filter),e.call(this,d)}if(t.colorSpace===_.INDEXED){var f=this.internal.newObject();r({data:w(new Uint8Array(t.palette)),objectId:f}),n(`endobj`)}},o=function(){var e=this.internal.collections[t+`images`];for(var n in e)a.call(this,e[n])},s=function(){var e,n=this.internal.collections[t+`images`],r=this.internal.write;for(var i in n)r(`/I`+(e=n[i]).index,e.objectId,`0`,`R`)},c=function(){this.internal.collections[t+`images`]||(this.internal.collections[t+`images`]={},this.internal.events.subscribe(`putResources`,o),this.internal.events.subscribe(`putXobjectDict`,s))},l=function(){var e=this.internal.collections[t+`images`];return c.call(this),e},u=function(){return Object.keys(this.internal.collections[t+`imLine truncated
|
||||
`},e.outline.makeRef=function(e){return e.id+` 0 R`},e.outline.makeString=function(t){return`(`+e.internal.pdfEscape(t)+`)`},e.outline.objStart=function(e){this.ctx.val+=`\r
|
||||
`+e.id+` 0 obj\r
|
||||
<<\r
|
||||
`},e.outline.objEnd=function(){this.ctx.val+=`>> \r
|
||||
endobj\r
|
||||
`},e.outline.count_r=function(e,t){for(var n=0;n<t.children.length;n++)e.count++,this.count_r(e,t.children[n]);return e.count}}])}(vf.API),function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(e,n,r,i,a,o){var s,c=this.decode.DCT_DECODE,l=null;if(typeof e==`string`||this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e)){switch(e=a||e,e=this.__addimage__.isArrayBuffer(e)?new Uint8Array(e):e,s=function(e){for(var n,r=256*e.charCodeAt(4)+e.charCodeAt(5),i=e.length,a={width:0,height:0,numcomponents:1},o=4;o<i;o+=2){if(o+=r,t.indexOf(e.charCodeAt(o+1))!==-1){n=256*e.charCodeAt(o+5)+e.charCodeAt(o+6),a={width:256*e.charCodeAt(o+7)+e.charCodeAt(o+8),height:n,numcomponents:e.charCodeAt(o+9)};break}r=256*e.charCodeAt(o+2)+e.charCodeAt(o+3)}return a}(e=this.__addimage__.isArrayBufferView(e)?this.__addimage__.arrayBufferToBinaryString(e):e),s.numcomponents){case 1:o=this.color_spaces.DEVICE_GRAY;break;case 4:o=this.color_spaces.DEVICE_CMYK;break;case 3:o=this.color_spaces.DEVICE_RGB}l={data:e,width:s.width,height:s.height,colorSpace:o,bitsPerComponent:8,filter:c,index:n,alias:r}}return l}}(vf.API),vf.API.processPNG=function(e,t,n,r){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var i,a=Nd(e,{checkCrc:!0}),o=a.width,s=a.height,c=a.channels,l=a.palette,u=a.depth;i=l&&c===1?function(e){for(var t=e.width,n=e.height,r=e.data,i=e.palette,a=e.depth,o=!1,s=[],c=[],l=void 0,u=!1,d=0,f=0;f<i.length;f++){var p=Ua(i[f],4),m=p[0],h=p[1],g=p[2],_=p[3];s.push(m,h,g),_!=null&&(_===0?(d++,c.length<1&&c.push(f)):_<255&&(u=!0))}if(u||d>1){o=!0,c=void 0;var v=t*n;l=new Uint8Array(v);for(var y=new DataView(r.buffer),b=0;b<v;b++){var x=Ua(i[Fp(y,b,a)],4)[3];l[b]=x}}else d===0&&(c=void 0);return{colorSpace:`Indexed`,colorsPerPixel:1,sMaskBitsPerComponent:o?8:void 0,colorBytes:r,alphaBytes:l,needSMask:o,palette:s,mask:c}}(a):c===2||c===4?function(e){for(var t=e.data,n=e.width,r=e.height,i=e.channels,a=e.depth,o=i===2?`DeviceGray`:`DeviceRGB`,s=i-1,c=n*r,l=s,u=c*l,d=1*c,f=Math.ceil(u*a/8),p=Math.ceil(d*a/8),m=new Uint8Array(f),h=new Uint8Array(p),g=new DataView(t.buffer),_=new DataView(m.buffer),v=new DataView(h.buffer),y=!1,b=0;b<c;b++){for(var x=b*i,S=0;S<l;S++)Ip(_,Fp(g,x+S,a),b*l+S,a);var C=Fp(g,x+l,a);C<(1<<a)-1&&(y=!0),Ip(v,C,1*b,a)}return{colorSpace:o,colorsPerPixel:s,sMaskBitsPerComponent:y?a:void 0,colorBytes:m,alphaBytes:h,needSMask:y}}(a):function(e){var t=e.data,n=e.channels===1?`DeviceGray`:`DeviceRGB`;return{colorSpace:n,colorsPerPixel:n===`DeviceGray`?1:3,colorBytes:t instanceof Uint16Array?function(e){for(var t=e.length,n=new Uint8Array(2*t),r=new DataView(n.buffer,n.byteOffset,n.byteLength),i=0;i<t;i++)r.setUint16(2*i,e[i],!1);return n}(t):t,needSMask:!1}}(a);var d,f,p,m=i,h=m.colorSpace,g=m.colorsPerPixel,_=m.sMaskBitsPerComponent,v=m.colorBytes,y=m.alphaBytes,b=m.needSMask,x=m.palette,S=m.mask,C=null;return r!==vf.API.image_compression.NONE&&typeof Ia==`function`?(C=function(e){var t;switch(e){case vf.API.image_compression.FAST:t=11;break;case vf.API.image_compression.MEDIUM:t=13;break;case vf.API.image_compression.SLOW:t=14;break;default:t=12}return t}(r),d=this.decode.FLATE_DECODE,f=`/Predictor ${C} /Colors ${g} /BitsPerComponent ${u} /Columns ${o}`,e=Dp(v,Math.ceil(o*g*u/8),g,u,r),b&&(p=Dp(y,Math.ceil(o*_/8),1,_,r))):(d=void 0,f=void 0,e=v,b&&(p=y)),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(p&&this.__addimage__.isArrayBuffer(p)||this.__addimage__.isArrayBufferView(p))&&(p=this.__addimage__.arrayBufferToBinaryString(p)),{alias:n,data:e,index:t,filter:d,decodeParameters:f,transparency:S,palette:x,sMask:p,predictor:C,width:o,height:s,bitsPerComponent:u,sMaskBitsPerComponent:_,colorSpace:h}}},function(e){e.processGIF89A=function(t,n,r,i){var a=new Rp(t),o=a.width,s=a.height,c=[];a.decodeAndBlitFrameRGBA(0,c);var l={data:c,width:o,height:s},u=new Bp(100).encode(l,100);return e.processJPEG.call(this,u,n,r,i)},e.processGIF87A=e.processGIF89A}(vf.API),Vp.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15)
Line truncated
|
||||
`:``)+e})):v.push(e[0])}),h=v,c=Cp.apply(this,[_,n])}for(a=0,o=h.length;a<o;a++){var y=0;if(r=h[a],c&&r[0]==`
|
||||
`&&(r=r.substr(1),y=1),f+p+(m=(i=Sp.apply(this,[r,n])).reduce(function(e,t){return e+t},0))>t||y){if(m>t){for(s=wp.apply(this,[r,i,t-(f+p),t]),u.push(s.shift()),u=[s.pop()];s.length;)d.push([s.shift()]);m=i.slice(r.length-(u[0]?u[0].length:0)).reduce(function(e,t){return e+t},0)}else u=[r];d.push(u),f=m+c,p=g}else u.push(r),f+=p+m,p=g}return l=c?function(e,t){return(t?_:``)+e.join(` `)}:function(e){return e.join(` `)},d.map(l)},xp.splitTextToSize=function(e,t,n){var r,i=(n||={}).fontSize||this.internal.getFontSize(),a=function(e){if(e.widths&&e.kerning)return{widths:e.widths,kerning:e.kerning};var t=this.internal.getFont(e.fontName,e.fontStyle),n=`Unicode`;return t.metadata[n]?{widths:t.metadata[n].widths||{0:1},kerning:t.metadata[n].kerning||{}}:{font:t.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,n);r=Array.isArray(e)?e:String(e).split(/\r?\n/);var o=1*this.internal.scaleFactor*t/i;a.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=n.lineIndent;var s,c,l=[];for(s=0,c=r.length;s<c;s++)l=l.concat(Tp.apply(this,[r[s],o,a]));return l},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t=`0123456789abcdef`,n=`klmnopqrstuvwxyz`,r={},i={},a=0;a<16;a++)r[n[a]]=t[a],i[t[a]]=n[a];var o=function(e){return`0x`+parseInt(e,10).toString(16)},s=e.__fontmetrics__.compress=function(e){var t,n,r,a,c=[`{`];for(var l in e){if(t=e[l],isNaN(parseInt(l,10))?n=`'`+l+`'`:(l=parseInt(l,10),n=(n=o(l).slice(2)).slice(0,-1)+i[n.slice(-1)]),typeof t==`number`)t<0?(r=o(t).slice(3),a=`-`):(r=o(t).slice(2),a=``),r=a+r.slice(0,-1)+i[r.slice(-1)];else{if(Qi(t)!==`object`)throw Error(`Don't know what to do with value type `+Qi(t)+`.`);r=s(t)}c.push(n+r)}return c.push(`}`),c.join(``)},c=e.__fontmetrics__.uncompress=function(e){if(typeof e!=`string`)throw Error(`Invalid argument passed to uncompress.`);for(var t,n,i,a,o={},s=1,c=o,l=[],u=``,d=``,f=e.length-1,p=1;p<f;p+=1)(a=e[p])==`'`?t?(i=t.join(``),t=void 0):t=[]:t?t.push(a):a==`{`?(l.push([c,i]),c={},i=void 0):a==`}`?((n=l.pop())[0][n[1]]=c,i=void 0,c=n[0]):a==`-`?s=-1:i===void 0?r.hasOwnProperty(a)?(u+=r[a],i=parseInt(u,16)*s,s=1,u=``):u+=a:r.hasOwnProperty(a)?(d+=r[a],c[i]=parseInt(d,16)*s,s=1,i=void 0,d=``):d+=a;return o},l={codePages:[`WinAnsiEncoding`],WinAnsiEncoding:c(`{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}`)},u={Unicode:{Courier:l,"Courier-Bold":l,"Courier-BoldOblique":l,"Courier-Oblique":l,Helvetica:l,"Helvetica-Bold":l,"Helvetica-BoldOblique":l,"Helvetica-Oblique":l,"Times-Roman":l,"Times-Bold":l,"Times-BoldItalic":l,"Times-Italic":l}},d={Unicode:{"Courier-Oblique":c(`{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}`),"Times-BoldItalic":c(`{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}`),"Helvetica-Bold":c(`{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6Line truncated
|
||||
<<
|
||||
`+t.join(`
|
||||
`)+`
|
||||
>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},vf.API.addMetadata=function(e,t){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:e,namespaceUri:t??`http://jspdf.default.namespaceuri/`,rawXml:typeof t==`boolean`&&t},this.internal.events.subscribe(`putCatalog`,Wp),this.internal.events.subscribe(`postPutResources`,Up)),this},function(e){var t=e.API,n=t.pdfEscape16=function(e,t){for(var n,r=t.metadata.Unicode.widths,i=[``,`0`,`00`,`000`,`0000`],a=[``],o=0,s=e.length;o<s;++o){if(n=t.metadata.characterToGlyph(e.charCodeAt(o)),t.metadata.glyIdsUsed.push(n),t.metadata.toUnicode[n]=e.charCodeAt(o),r.indexOf(n)==-1&&(r.push(n),r.push([parseInt(t.metadata.widthOfGlyph(n),10)])),n==`0`)return a.join(``);n=n.toString(16),a.push(i[4-n.length],n)}return a.join(``)},r=function(e){var t,n,r,i,a,o,s;for(a=`/CIDInit /ProcSet findresource begin
|
||||
12 dict begin
|
||||
begincmap
|
||||
/CIDSystemInfo <<
|
||||
/Registry (Adobe)
|
||||
/Ordering (UCS)
|
||||
/Supplement 0
|
||||
>> def
|
||||
/CMapName /Adobe-Identity-UCS def
|
||||
/CMapType 2 def
|
||||
1 begincodespacerange
|
||||
<0000><ffff>
|
||||
endcodespacerange`,r=[],o=0,s=(n=Object.keys(e).sort(function(e,t){return e-t})).length;o<s;o++)t=n[o],r.length>=100&&(a+=`
|
||||
`+r.length+` beginbfchar
|
||||
`+r.join(`
|
||||
`)+`
|
||||
endbfchar`,r=[]),e[t]!==void 0&&e[t]!==null&&typeof e[t].toString==`function`&&(i=(`0000`+e[t].toString(16)).slice(-4),t=(`0000`+(+t).toString(16)).slice(-4),r.push(`<`+t+`><`+i+`>`));return r.length&&(a+=`
|
||||
`+r.length+` beginbfchar
|
||||
`+r.join(`
|
||||
`)+`
|
||||
endbfchar
|
||||
`),a+`endcmap
|
||||
CMapName currentdict /CMap defineresource pop
|
||||
end
|
||||
end`};t.events.push([`putFont`,function(t){(function(t){var n=t.font,i=t.out,a=t.newObject,o=t.putStream;if(n.metadata instanceof e.API.TTFFont&&n.encoding===`Identity-H`){for(var s=n.metadata.Unicode.widths,c=n.metadata.subset.encode(n.metadata.glyIdsUsed,1),l=``,u=0;u<c.length;u++)l+=String.fromCharCode(c[u]);var d=a();o({data:l,addLength1:!0,objectId:d}),i(`endobj`);var f=a();o({data:r(n.metadata.toUnicode),addLength1:!0,objectId:f}),i(`endobj`);var p=a();i(`<<`),i(`/Type /FontDescriptor`),i(`/FontName /`+ff(n.fontName)),i(`/FontFile2 `+d+` 0 R`),i(`/FontBBox `+e.API.PDFObject.convert(n.metadata.bbox)),i(`/Flags `+n.metadata.flags),i(`/StemV `+n.metadata.stemV),i(`/ItalicAngle `+n.metadata.italicAngle),i(`/Ascent `+n.metadata.ascender),i(`/Descent `+n.metadata.decender),i(`/CapHeight `+n.metadata.capHeight),i(`>>`),i(`endobj`);var m=a();i(`<<`),i(`/Type /Font`),i(`/BaseFont /`+ff(n.fontName)),i(`/FontDescriptor `+p+` 0 R`),i(`/W `+e.API.PDFObject.convert(s)),i(`/CIDToGIDMap /Identity`),i(`/DW 1000`),i(`/Subtype /CIDFontType2`),i(`/CIDSystemInfo`),i(`<<`),i(`/Supplement 0`),i(`/Registry (Adobe)`),i(`/Ordering (`+n.encoding+`)`),i(`>>`),i(`>>`),i(`endobj`),n.objectNumber=a(),i(`<<`),i(`/Type /Font`),i(`/Subtype /Type0`),i(`/ToUnicode `+f+` 0 R`),i(`/BaseFont /`+ff(n.fontName)),i(`/Encoding /`+n.encoding),i(`/DescendantFonts [`+m+` 0 R]`),i(`>>`),i(`endobj`),n.isAlreadyPutted=!0}})(t)}]),t.events.push([`putFont`,function(t){(function(t){var n=t.font,i=t.out,a=t.newObject,o=t.putStream;if(n.metadata instanceof e.API.TTFFont&&n.encoding===`WinAnsiEncoding`){for(var s=n.metadata.rawData,c=``,l=0;l<s.length;l++)c+=String.fromCharCode(s[l]);var u=a();o({data:c,addLength1:!0,objectId:u}),i(`endobj`);var d=a();o({data:r(n.metadata.toUnicode),addLength1:!0,objectId:d}),i(`endobj`);var f=a();i(`<<`),i(`/Descent `+n.metadata.decender),i(`/CapHeight `+n.metadata.capHeight),i(`/StemV `+n.metadata.stemV),i(`/Type /FontDescriptor`),i(`/FontFile2 `+u+` 0 R`),i(`/Flags 96`),i(`/FontBBox `+e.API.PDFObject.convert(n.metadata.bbox)),i(`/FontName /`+ff(n.fontName)),i(`/ItalicAngle `+n.metadata.italicAngle),i(`/Ascent `+n.metadata.ascender),i(`>>`),i(`endobj`),n.objectNumber=a();for(var p=0;p<n.metadata.hmtx.widths.length;p++)n.metadata.hmtx.widths[p]=parseInt(n.metadata.hmtx.widths[p]*(1e3/n.metadata.head.unitsPerEm));i(`<</Subtype/TrueType/Type/Font/ToUnicode `+d+` 0 R/BaseFont/`+ff(n.fontName)+`/FontDescriptor `+f+` 0 R/Encoding/`+n.encoding+` /FirstChar 29 /LastChar 255 /Widths `+e.API.PDFObject.convert(n.metadata.hmtx.widths)+`>>`),i(`endobj`),n.isAlreadyPutted=!0}})(t)}]);var i=function(e){var t,r=e.text||``,i=e.x,a=e.y,o=e.options||{},s=e.mutex||{},c=s.pdfEscape,l=s.activeFontKey,u=s.fonts,d=l,f=``,p=0,m=``,h=u[d].encoding;if(u[d].encoding!==`Identity-H`)return{text:r,x:i,y:a,options:o,mutex:s};for(m=r,d=l,Array.isArray(r)&&(m=r[0]),p=0;p<m.length;p+=1)u[d].metadata.hasOwnProperty(`cmap`)&&(t=u[d].metadata.cmap.unicode.codeMap[m[p].charCodeAt(0)]),t||m[p].charCodeAt(0)<256&&u[d].metadata.hasOwnProperty(`Unicode`)?f+=m[p]:f+=``;var g=``;return parseInt(d.slice(1))<14||h===`WinAnsiEncoding`?g=c(f,d).split(``).map(function(e){return e.charCodeAt(0).toString(16)}).join(``):h===`Identity-H`&&(g=n(f,u[d])),s.isHex=!0,{text:g,x:i,y:a,options:o,mutex:s}};t.events.push([`postProcessText`,function(e){var t=e.text||``,n=[],r={text:t,x:e.x,y:e.y,options:e.options,mutex:e.mutex};if(Array.isArray(t)){var a=0;for(a=0;a<t.length;a+=1)Array.isArray(t[a])&&t[a].length===3?n.push([i(Object.assign({},r,{text:t[a][0]})).text,t[a][1],t[a][2]]):n.push(i(Object.assign({},r,{text:t[a]})).text);e.text=n}else e.text=i(Object.assign({},r,{text:t})).text}])}(vf),function(e){var t=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(e){return t.call(this),this.internal.vFS[e]!==void 0},e.addFileToVFS=function(e,n){return t.call(this),this.internal.vFS[e]=n,this},e.getFileFromVFS=function(e){return t.call(this),this.internal.vFS[e]===void 0?null:this.internal.vFS[e]}}(vf.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(e){var n,r,i,a,o,s,c,l=t,u=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],d=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],f={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},p={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},m=`(.).(.<.>.<.[.].[.{.}.{.«.».«.‹.›.‹.⁅.⁆.⁅.⁽.⁾.⁽.₍.₎.₍.≤.≥.≤.〈.〉.〈.﹙.﹚.﹙.﹛.﹜.﹛.﹝.﹞.﹝.﹤.﹥.﹤`.split(`.`),h=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),g=!1,_=0;this.__bidiEngine__={};var v=function(e){var t=e.charCodeAt(),n=t>>8,r=p[n];return r===void 0?n===252||n===253?`AL`:h.test(n)?`L`:n===8?`R`:`N`:l[256*r+(255&t)]},y=function(e){for(var t,n=0;n<e.length;n++){if((t=v(e.charAt(n)))===`L`)return!1;if(t===`R`)return!0}return!1},b=function(e,t,o,s){var c,l,u,d,f=t[s];switLine truncated
|
||||
`)}return``+n},t}();function fm(e,t,n,r,i){r||={};var a=1.15,o=i.internal.scaleFactor,s=i.internal.getFontSize()/o,c=s*(i.getLineHeightFactor?i.getLineHeightFactor():a),l=/\r\n|\r|\n/g,u=``,d=1;if((r.valign===`middle`||r.valign===`bottom`||r.halign===`center`||r.halign===`right`)&&(u=typeof e==`string`?e.split(l):e,d=u.length||1),n+=s*(2-a),r.valign===`middle`?n-=d/2*c:r.valign===`bottom`&&(n-=d*c),r.halign===`center`||r.halign===`right`){var f=s;if(r.halign===`center`&&(f*=.5),u&&d>=1){for(var p=0;p<u.length;p++)i.text(u[p],t-i.getStringUnitWidth(u[p])*f,n),n+=c;return i}t-=i.getStringUnitWidth(e)*f}return r.halign===`justify`?i.text(e,t,n,{maxWidth:r.maxWidth||100,align:`justify`}):i.text(e,t,n),i}var pm={},mm=function(){function e(e){this.jsPDFDocument=e,this.userStyles={textColor:e.getTextColor?this.jsPDFDocument.getTextColor():0,fontSize:e.internal.getFontSize(),fontStyle:e.internal.getFont().fontStyle,font:e.internal.getFont().fontName,lineWidth:e.getLineWidth?this.jsPDFDocument.getLineWidth():0,lineColor:e.getDrawColor?this.jsPDFDocument.getDrawColor():0}}return e.setDefaults=function(e,t){t===void 0&&(t=null),t?t.__autoTableDocumentDefaults=e:pm=e},e.unifyColor=function(e){return Array.isArray(e)?e:typeof e==`number`?[e,e,e]:typeof e==`string`?[e]:null},e.prototype.applyStyles=function(t,n){var r,i,a;n===void 0&&(n=!1),t.fontStyle&&this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(t.fontStyle);var o=this.jsPDFDocument.internal.getFont(),s=o.fontStyle,c=o.fontName;if(t.font&&(c=t.font),t.fontStyle){s=t.fontStyle;var l=this.getFontList()[c];l&&l.indexOf(s)===-1&&this.jsPDFDocument.setFontStyle&&(this.jsPDFDocument.setFontStyle(l[0]),s=l[0])}if(this.jsPDFDocument.setFont(c,s),t.fontSize&&this.jsPDFDocument.setFontSize(t.fontSize),!n){var u=e.unifyColor(t.fillColor);u&&(r=this.jsPDFDocument).setFillColor.apply(r,u),u=e.unifyColor(t.textColor),u&&(i=this.jsPDFDocument).setTextColor.apply(i,u),u=e.unifyColor(t.lineColor),u&&(a=this.jsPDFDocument).setDrawColor.apply(a,u),typeof t.lineWidth==`number`&&this.jsPDFDocument.setLineWidth(t.lineWidth)}},e.prototype.splitTextToSize=function(e,t,n){return this.jsPDFDocument.splitTextToSize(e,t,n)},e.prototype.rect=function(e,t,n,r,i){return this.jsPDFDocument.rect(e,t,n,r,i)},e.prototype.getLastAutoTable=function(){return this.jsPDFDocument.lastAutoTable||null},e.prototype.getTextWidth=function(e){return this.jsPDFDocument.getTextWidth(e)},e.prototype.getDocument=function(){return this.jsPDFDocument},e.prototype.setPage=function(e){this.jsPDFDocument.setPage(e)},e.prototype.addPage=function(){return this.jsPDFDocument.addPage()},e.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},e.prototype.getGlobalOptions=function(){return pm||{}},e.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},e.prototype.pageSize=function(){var e=this.jsPDFDocument.internal.pageSize;return e.width??(e={width:e.getWidth(),height:e.getHeight()}),e},e.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},e.prototype.getLineHeightFactor=function(){var e=this.jsPDFDocument;return e.getLineHeightFactor?e.getLineHeightFactor():1.15},e.prototype.getLineHeight=function(e){return e/this.scaleFactor()*this.getLineHeightFactor()},e.prototype.pageNumber=function(){var e=this.jsPDFDocument.internal.getCurrentPageInfo();return e?e.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},e}(),hm=function(e,t){return hm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},hm(e,t)};function gm(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);hm(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var _m=function(e){gm(t,e);function t(t){var n=e.call(this)||this;return n._element=t,n}return t}(Array);function vm(e){return{font:`helvetica`,fontStyle:`normal`,overflow:`linebreak`,fillColor:!1,textColor:20,halign:`left`,valign:`top`,fontSize:10,cellPadding:5/e,lineColor:200,lineWidth:0,cellWidth:`auto`,minCellHeight:0,minCellWidth:0}}function ym(e){return{striped:{table:{fillColor:255,textColor:80,fontStyle:`normal`},head:{textColor:255,fillColor:[41,128,185],fontStyle:`bold`},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:`bold`},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:`normal`,lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:`bold`,lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:`bold`,lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:`bold`},foot:{fontStyle:`bold`}}}[e]}function bm(e,t,n){return n.applyStyles(t,!0),(Array.isArray(e)?e:[e]).map(function(e){return n.getTextWidth(e)}).reduce(function(e,t){return Math.max(e,t)},0)}function xm(e,t,n,r){var i=t
Line truncated
|
||||
`),t.innerText||t.textContent||``}function Nm(e,t,n){for(var r=0,i=[e,t,n];r<i.length;r++){var a=i[r];a&&typeof a!=`object`&&console.error(`The options parameter should be of type object, is: `+typeof a),a.startY&&typeof a.startY!=`number`&&(console.error(`Invalid value for startY option`,a.startY),delete a.startY)}}function Pm(e,t,n,r,i){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var a=Object(e),o=1;o<arguments.length;o++){var s=arguments[o];if(s!=null)for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(a[c]=s[c])}return a}function Fm(e,t){var n=new mm(e),r=n.getDocumentOptions(),i=n.getGlobalOptions();Nm(i,r,t);var a=Pm({},i,r,t),o;typeof window<`u`&&(o=window);var s=Im(i,r,t),c=Lm(i,r,t),l=Rm(n,a),u=Bm(n,a,o);return{id:t.tableId,content:u,hooks:c,styles:s,settings:l}}function Im(e,t,n){for(var r={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},i=function(i){if(i===`columnStyles`){var a=e[i],o=t[i],s=n[i];r.columnStyles=Pm({},a,o,s)}else{var c=[e,t,n].map(function(e){return e[i]||{}});r[i]=Pm({},c[0],c[1],c[2])}},a=0,o=Object.keys(r);a<o.length;a++){var s=o[a];i(s)}return r}function Lm(e,t,n){for(var r=[e,t,n],i={didParseCell:[],willDrawCell:[],didDrawCell:[],willDrawPage:[],didDrawPage:[]},a=0,o=r;a<o.length;a++){var s=o[a];s.didParseCell&&i.didParseCell.push(s.didParseCell),s.willDrawCell&&i.willDrawCell.push(s.willDrawCell),s.didDrawCell&&i.didDrawCell.push(s.didDrawCell),s.willDrawPage&&i.willDrawPage.push(s.willDrawPage),s.didDrawPage&&i.didDrawPage.push(s.didDrawPage)}return i}function Rm(e,t){var n=Cm(t.margin,40/e.scaleFactor()),r=zm(e,t.startY)??n.top,i=t.showFoot===!0?`everyPage`:t.showFoot===!1?`never`:t.showFoot??`everyPage`,a=t.showHead===!0?`everyPage`:t.showHead===!1?`never`:t.showHead??`everyPage`,o=t.useCss??!1,s=t.theme||(o?`plain`:`striped`),c=!!t.horizontalPageBreak,l=t.horizontalPageBreakRepeat??null;return{includeHiddenHtml:t.includeHiddenHtml??!1,useCss:o,theme:s,startY:r,margin:n,pageBreak:t.pageBreak??`auto`,rowPageBreak:t.rowPageBreak??`auto`,tableWidth:t.tableWidth??`auto`,showHead:a,showFoot:i,tableLineWidth:t.tableLineWidth??0,tableLineColor:t.tableLineColor??200,horizontalPageBreak:c,horizontalPageBreakRepeat:l,horizontalPageBreakBehaviour:t.horizontalPageBreakBehaviour??`afterAllRows`}}function zm(e,t){var n=e.getLastAutoTable(),r=e.scaleFactor(),i=e.pageNumber(),a=!1;return n&&n.startPageNumber&&(a=n.startPageNumber+n.pageNumber-1===i),typeof t==`number`?t:(t==null||t===!1)&&a&&n?.finalY!=null?n.finalY+20/r:null}function Bm(e,t,n){var r=t.head||[],i=t.body||[],a=t.foot||[];if(t.html){var o=t.includeHiddenHtml;if(n){var s=Am(e,t.html,n,o,t.useCss)||{};r=s.head||r,i=s.body||r,a=s.foot||r}else console.error(`Cannot parse html in non browser environment`)}return{columns:t.columns||Vm(r,i,a),head:r,body:i,foot:a}}function Vm(e,t,n){var r=e[0]||t[0]||n[0]||[],i=[];return Object.keys(r).filter(function(e){return e!==`_element`}).forEach(function(e){var t=1,n=Array.isArray(r)?r[parseInt(e)]:r[e];typeof n==`object`&&!Array.isArray(n)&&(t=n?.colSpan||1);for(var a=0;a<t;a++){var o=void 0;o=Array.isArray(r)?i.length:e+(a>0?`_${a}`:``);var s={dataKey:o};i.push(s)}}),i}var Hm=function(){function e(e,t,n){this.table=t,this.pageNumber=t.pageNumber,this.settings=t.settings,this.cursor=n,this.doc=e.getDocument()}return e}(),Um=function(e){gm(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t,n,o)||this;return s.cell=r,s.row=i,s.column=a,s.section=i.section,s}return t}(Hm),Wm=function(){function e(e,t){this.pageNumber=1,this.id=e.id,this.settings=e.settings,this.styles=e.styles,this.hooks=e.hooks,this.columns=t.columns,this.head=t.head,this.body=t.body,this.foot=t.foot}return e.prototype.getHeadHeight=function(e){return this.head.reduce(function(t,n){return t+n.getMaxCellHeight(e)},0)},e.prototype.getFootHeight=function(e){return this.foot.reduce(function(t,n){return t+n.getMaxCellHeight(e)},0)},e.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},e.prototype.callCellHooks=function(e,t,n,r,i,a){for(var o=0,s=t;o<s.length;o++){var c=s[o],l=c(new Um(e,this,n,r,i,a))===!1;if(n.text=Array.isArray(n.text)?n.text:[n.text],l)return!1}return!0},e.prototype.callEndPageHooks=function(e,t){e.applyStyles(e.userStyles);for(var n=0,r=this.hooks.didDrawPage;n<r.length;n++){var i=r[n];i(new Hm(e,this,t))}},e.prototype.callWillDrawPageHooks=function(e,t){for(var n=0,r=this.hooks.willDrawPage;n<r.length;n++){var i=r[n];i(new Hm(e,this,t))}},e.prototype.getWidth=function(e){if(typeof this.settings.tableWidth==`number`)return this.settings.tableWidth;if(this.settings.tableWidth===`wrap`)return this.columns.reduce(function(e,t){return e+t.wrappedWidth},0);var t=this.settings.margin;return e-t.left-t.right},e}(),Gm=function(){function e(e,t,n,r,i){i===void 0&&(i=!1),this.height=0,this.raw=e,e instanceof _m&&(this.raw=e._element,this.element=e._element),this.index=t,this.section=n,this.cells=r,this.spa
Line truncated
|
||||
`),i=`${e.name}${e.address?`\n📍 Địa chỉ: ${e.address}`:``}`,a=e.notes||``;o.push([t,r,n,i,a])})}),o.length===0&&o.push([`-`,`-`,`-`,`Chưa có chặng hoặc địa điểm nào trong hành trình.`,`-`]),Oh(e,{head:[i],body:o,startY:n,theme:`grid`,headStyles:{fillColor:[37,99,235],textColor:[255,255,255],fontStyle:`normal`},styles:{font:`Roboto`,fontSize:9,cellPadding:3,overflow:`linebreak`},columnStyles:{0:{cellWidth:12,halign:`center`},1:{cellWidth:50},2:{cellWidth:45},3:{cellWidth:90},4:{cellWidth:70}},margin:{left:15,right:15}});try{a({title:`Đang tạo PDF...`,message:`Vui lòng chờ trong giây lát.`,type:`info`}),e.save(`Lich_trinh_${s?.title||`tour`}.pdf`),a({title:`Thành công`,message:`Lịch trình đã được xuất ra tập tin PDF thành công.`,type:`success`})}catch(e){console.error(e),a({title:`Lỗi`,message:`Không thể xuất PDF lịch trình.`,type:`error`})}},Ne=()=>{if(!s)return;let e=``;e+=`Chặng,Địa điểm,Địa chỉ,Thời gian đến,Thời gian đi,Ghi chú
|
||||
`,s.legs&&s.legs.length>0&&s.legs.forEach((t,n)=>{let r=t.note||`Chặng ${n+1}`;t.locations&&t.locations.length>0?t.locations.forEach(t=>{let n=[r,t.name||``,t.address||``,t.arrivalTime?new Date(t.arrivalTime).toLocaleString(`vi-VN`):``,t.departureTime?new Date(t.departureTime).toLocaleString(`vi-VN`):``,t.notes||``].map(e=>`"${e.replace(/"/g,`""`)}"`).join(`,`);e+=n+`
|
||||
`}):e+=`"${r.replace(/"/g,`""`)}","Chưa có địa điểm",,,,\n`});let t=new Blob([e],{type:`text/csv;charset=utf-8;`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.setAttribute(`download`,`Lich_trinh_${s.title||`tour`}.csv`),document.body.appendChild(r),r.click(),document.body.removeChild(r),a({title:`Thành công`,message:`Đã xuất lịch trình ra tệp CSV (Google Sheets) thành công.`,type:`success`})};(0,y.useEffect)(()=>{Oe()},[t]);let[Pe,Fe]=(0,y.useState)(null),Ie=(0,y.useMemo)(()=>p!==null&&h!==null&&h>.5?p:Pe===null?0:Pe,[p,h,Pe]),Le=(0,y.useMemo)(()=>({start:gn.default.divIcon({className:`!bg-transparent !border-none`,html:`<div class="w-7 h-7 bg-blue-600 rounded-full border-2 border-white shadow-xl flex items-center justify-center text-[11px] font-black text-white animate-in zoom-in duration-300">S</div>`,iconSize:[28,28],iconAnchor:[14,14]}),end:gn.default.divIcon({className:`!bg-transparent !border-none`,html:`<div class="w-7 h-7 bg-green-600 rounded-full border-2 border-white shadow-xl flex items-center justify-center text-[11px] font-black text-white animate-in zoom-in duration-300">E</div>`,iconSize:[28,28],iconAnchor:[14,14]}),visit:gn.default.divIcon({className:`!bg-transparent !border-none`,html:`<div class="w-5 h-5 bg-indigo-500 rounded-full border-2 border-white shadow-lg hover:scale-125 transition-transform flex items-center justify-center"><div class="w-1.5 h-1.5 bg-white rounded-full opacity-50"></div></div>`,iconSize:[20,20],iconAnchor:[10,10]}),user:gn.default.divIcon({className:`!bg-transparent !border-none`,html:`
|
||||
<div class="relative flex items-center justify-center">
|
||||
<!-- Hiệu ứng ping tỏa lan -->
|
||||
<div class="absolute w-8 h-8 bg-blue-400 rounded-full opacity-30 animate-ping"></div>
|
||||
|
||||
<!-- Marker chính màu xanh -->
|
||||
<div class="w-5 h-5 bg-blue-600 rounded-full border-2 border-white shadow-xl flex items-center justify-center z-10">
|
||||
<!-- Mũi tên chỉ hướng nhìn (xoay theo heading) -->
|
||||
<div style="transform: rotate(${Ie}deg); transition: transform 0.2s ease-out;" class="absolute inset-0 flex flex-col items-center">
|
||||
<div class="w-0 h-0 border-l-[5px] border-l-transparent border-r-[5px] border-r-transparent border-b-[8px] border-b-white mt-[1px]"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`,iconSize:[32,32],iconAnchor:[16,16]})}),[Ie]);(0,y.useEffect)(()=>{if(!n&&navigator.geolocation){let e=navigator.geolocation.watchPosition(e=>{f([e.coords.latitude,e.coords.longitude]),m(e.coords.heading),g(e.coords.speed)},e=>console.warn(`Lỗi định vị người dùng:`,e),{enableHighAccuracy:!0});return()=>navigator.geolocation.clearWatch(e)}else m(null),g(null)},[n]),(0,y.useEffect)(()=>{let e=e=>{let t=null;e.webkitCompassHeading!==void 0&&e.webkitCompassHeading!==null?t=e.webkitCompassHeading:e.alpha!==null&&e.alpha!==void 0&&(e.absolute===!0||e.type===`deviceorientationabsolute`)&&(t=(360-e.alpha)%360),t!==null&&Fe(t)};return window.addEventListener(`deviceorientation`,e,!0),window.addEventListener(`deviceorientationabsolute`,e,!0),()=>{window.removeEventListener(`deviceorientation`,e,!0),window.removeEventListener(`deviceorientationabsolute`,e,!0)}},[]),(0,y.useEffect)(()=>{if(!E){k(0);return}let e=null;p!==null&&h!==null&&h>.5?e=-p:Pe!==null&&(e=-Pe),e!==null&&k(e)},[E,p,h,Pe]);let[Be,Ve]=(0,y.useState)(!1),[J,He]=(0,y.useState)(!1),[Ue,qe]=(0,y.useState)(null),[Je,Ye]=(0,y.useState)(null),[Xe,Qe]=(0,y.useState)(null),[$e,et]=(0,y.useState)(!1),[X,nt]=(0,y.useState)(null),rt=(0,y.useMemo)(()=>{let e=localStorage.getItem(`token`)||localStorage.getItem(`guest_token`);if(!e)return null;try{return JSON.parse(atob(e.split(`.`)[1])).sub}catch{return null}},[]),it=(0,y.useMemo)(()=>{let e=localStorage.getItem(`user`)||localStorage.getItem(`guest_user`);if(!e)return null;try{return JSON.parse(e)}catch{return null}},[]),[at,ot]=(0,y.useState)(!1),[st,ct]=(0,y.useState)(``),[lt,ut]=(0,y.useState)(``),[dt,ft]=(0,y.useState)(``),[pt,mt]=(0,y.useState)(``),[ht,gt]=(0,y.useState)(!1),[_t,vt]=(0,y.useState)(!1),[yt,bt]=(0,y.useState)(``),[xt,St]=(0,y.useState)(!1),Ct=X&&X.metadata&&Array.isArray(X.metadata.likedUserIds)?X.metadata.likedUserIds:[],Z=it&&Ct.includes(it.id),wt=Ct.length,Tt=async()=>{if(X)try{let e=await fetch(`/api/v1/photos/${X.id}/toggle-like`,{method:`POST`,headers:{Authorization:`Bearer ${localStorage.getItem(`token`)||localStorage.getItem(`guest_token`)}`}});if(e.ok){let t=await e.json();nt(e=>e?{...e,metadata:{...e.metadata,likedUserIds:t.likedUserIds}}:null),s&&Rn(s.id)}}catch(e){console.error(`Error toggling like:`,e)}};(0,y.useEffect)(()=>{let e=X?.metadata?.lat,t=X?.metadata?.lng;typeof e==`number`&&typeof t==`number`?(bt(`Đang xác định địa điểm...`),fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${e}&lon=${t}&accept-language=vi`).then(e=>{if(!e.ok)throw Error();return e.json()}).then(n=>{n&&n.display_name?bt(n.display_name.split(`,`).slice(0,3).join(`,`).trim()||n.display_name):bt(`${e.toFixed(4)}, ${t.toFixed(4)}`)}).catch(()=>{bt(`${e.toFixed(4)}, ${t.toFixed(4)}`)})):bt(`Chưa xác định tọa độ`)},[X?.id,X?.metadata?.lat,X?.metadata?.lng]),(0,y.useEffect)(()=>{X&&(ct(X.metadata?.title||``),ut(X.metadata?.description||``),ft(X.metadata?.lat??``),mt(X.metadata?.lng??``),ot(!1))},[X]);let Et=async()=>{if(X){if(dt!==``&&(isNaN(dt)||dt<-90||dt>90)){a({title:`Lỗi`,message:`Vĩ độ không hợp lệ (-90 đến 90).`,type:`error`});return}if(pt!==``&&(isNaN(pt)||pt<-180||pt>180)){a({title:`Lỗi`,message:`Kinh độ không hợp lệ (-180 đến 180).`,type:`error`});return}gt(!0);try{let e=await fetch(`/api/v1/photos/${X.id}`,{method:`PATCH`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${localStorage.getItem(`token`)||localStorage.getItem(`guest_token`)}`},body:JSON.stringify({title:st,description:lt,latitude:dt===``?void 0:dt,longitude:pt===``?void 0:pt})});if(!e.ok)throw Error(`Failed to update photo info`);let t=await e.json();a({title:`Thành công`,message:`Thông tin ảnh đã được cập nhật.`,type:`success`}),nt(e=>e?{...e,metadata:t.metadata}:null),s&&Rn(s.id),ot(!1)}catch{a({title:`Lỗi`,message:`Không thể cập nhật thông tin ảnh. Vui lòng thử lại.`,type:`error`})}finally{gt(!1)}}},[Dt,Ot]=(0,y.useState)([]),[kt,At]=(0,y.useState)(s?.title??``),[jt,Mt]=(0,y.useState)(s?.description??``),[Nt,Pt]=(0,y.useState)(s?.adultCount??0),[Ft,It]=(0,y.useState)(s?.childCount??0),[Lt,Rt]=(0,y.useState)(s?.childDiscount??0),[zt,Bt]=(0,y.useState)(s?.tags??[]),[Vt,Ht]=(0,y.useState)(``),Ut=[`Văn hóa`,`Mạo hiểm`,`Nghỉ dưỡng`,`Thư giãn`,`Ẩm thực`,`Khám phá`,`Gia đình`],[Wt,Gt]=(0,y.useState)(`all`),Kt=(0,y.useMemo)(()=>{if(!s?.photos)return[];let e=s.photos;if(Wt!==`all`){let t=c.find(e=>e.id===Wt);if(t){let n=t.locations.map(e=>e.id);e=e.filter(e=>e.locationId&&n.includes(e.locationId))}else e=[]}return e},[s?.photos,Wt,c]);(0,y.useEffect)(()=>{Kt.length>0&&!X?nt(M_(Kt)):X&&!Kt.some(e=>e.id===X.id)&&nt(Kt.length>0?M_(Kt):null)},[Kt,X]);let[qt,Jt]=(0,y.useState)(!1),[Yt,Xt]=(0,y.useState)(``),[Zt,Qt]=(0,y.useState)(``),[$t,en]=(0,y.useState)(null),[tn,nn]=(0,y.useState)(null),[rn,an]=(0,y.useState)(``);(0,y.useEffect)(()=>{s&&(At(s.title??``),Mt(s.description??``),Pt(s.adultCount??
Line truncated
|
||||
<div class="quick-note-box" style="border-left: 4px solid #f59e0b; padding: 12px; margin: 16px 0; background: #fffbeb; border-radius: 8px; border: 1px solid #fef3c7; box-shadow: 0 2px 4px rgba(0,0,0,0.02);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;">
|
||||
<span style="font-size: 10px; color: #b45309; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;">🕒 ${r} • 👤 ${n}</span>
|
||||
</div>
|
||||
<p style="margin: 0; color: #4b5563; font-size: 14px; line-height: 1.5;"><strong>📍 ${tn}:</strong> ${e}</p>
|
||||
</div>
|
||||
<p></p>
|
||||
`;if(l)l.tourId=s.id,l.title=i,l.content+=u;else{let e={id:Date.now().toString(),tourId:s.id,title:i,content:`<p>Bắt đầu lập kế hoạch cho chuyến đi <strong>${s.title}</strong> của bạn tại đây...</p>`+u,createdAt:new Date().toISOString()};c.unshift(e)}localStorage.setItem(`my_journey_notes`,JSON.stringify(c)),a({title:`Thành công`,message:`Đã lưu vào ghi chú chung!`,type:`success`}),nn(null),an(``)},yr=async()=>{if(s&&await o({title:`Xóa Tour vĩnh viễn?`,message:`Toàn bộ dữ liệu về lộ trình, chi phí và hình ảnh của chuyến đi này sẽ bị xóa bỏ hoàn toàn. Bạn có chắc chắn muốn thực hiện?`}))try{await $n(s.id),a({title:`Thành công`,message:`Hành trình đã được xóa.`,type:`success`}),e()}catch(e){a({title:`Lỗi`,message:e.message||`Không thể xóa hành trình.`,type:`error`})}},br=y.useRef(null);(0,y.useEffect)(()=>{An&&br.current&&gn.default.DomEvent.disableClickPropagation(br.current)},[An]),(0,y.useEffect)(()=>{jn(null)},[_,w]);let xr=(0,y.useMemo)(()=>c.flatMap(e=>e.locations).find(e=>e.plannedStart&&new Date(e.plannedStart).getTime()===0),[c]),Sr=(0,y.useMemo)(()=>c.flatMap(e=>e.locations).find(e=>e.plannedEnd&&new Date(e.plannedEnd).getTime()===0),[c]),Cr=[{id:`plan`,label:`Lộ trình`,icon:_e,visible:!0},{id:`expense`,label:`Chi phí`,icon:Ge,visible:[`OWNER`,`MANAGER`,`MEMBER`].includes(l||``)},{id:`photo`,label:`Ảnh`,icon:se,visible:!0},{id:`chat`,label:`Trò chuyện`,icon:ve,visible:!!l,hasBadge:S>0,badgeCount:S},{id:`members`,label:`Thành viên`,icon:We,visible:or},{id:`settings`,label:`Cài đặt`,icon:je,visible:l===`OWNER`}].filter(e=>e.visible),wr=[`OWNER`,`MANAGER`,`MEMBER`].includes(l||``),Tr=(0,y.useMemo)(()=>{if(s?.startDate&&s?.endDate)return`${new Date(s.startDate).toLocaleDateString(`vi-VN`)} - ${new Date(s.endDate).toLocaleDateString(`vi-VN`)}`;let e=c[0],t=c[c.length-1],n=e?.startDate,r=t?.endDate||t?.startDate;return n&&r?`${new Date(n).toLocaleDateString(`vi-VN`)} - ${new Date(r).toLocaleDateString(`vi-VN`)}`:n?`Từ ${new Date(n).toLocaleDateString(`vi-VN`)}`:`Chưa xác định ngày`},[s,c]),Er=[`Đừng nghe họ nói, hãy tự mình đi xem.`,`Thế giới là một cuốn sách, và ai không đi du lịch thì chỉ mới đọc được một trang.`,`Hành trình ngàn dặm bắt đầu từ một bước chân.`,`Đi là để trở về, nhưng với một tâm hồn mới.`],Dr=(0,y.useMemo)(()=>Er[Math.floor(Math.random()*Er.length)],[]),Or={title:s?.title||`Hành trình khám phá TP.HCM`,date:Tr,membersCount:s?.participants?.filter(e=>e.user||e.displayName)?.length||0,budget:s?.totalCost?`${Number(s.totalCost).toLocaleString()} VND`:`0 VND`,coverImage:M_(s?.photos||[])?.imageUrl||`https://images.unsplash.com/photo-1476514525535-07fb3b4ae5f1?q=80&w=2070&auto=format&fit=crop`};return(0,Y.jsxs)(`div`,{className:`min-h-screen bg-gray-50 pb-20`,children:[(0,Y.jsxs)(`div`,{className:`sticky top-0 z-30 bg-white/80 backdrop-blur-md border-b border-gray-100 px-4 py-3 flex items-center justify-between`,children:[(0,Y.jsx)(`button`,{onClick:e,className:`p-2 hover:bg-gray-100 rounded-full transition-colors`,children:(0,Y.jsx)(B,{className:`w-6 h-6 text-gray-600`})}),(0,Y.jsx)(`h1`,{className:`text-lg font-bold text-gray-800 truncate px-4 flex-1 text-center`,children:Or.title}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[!n&&r&&(0,Y.jsx)(`button`,{onClick:r,className:`p-2 hover:bg-amber-50 text-amber-600 rounded-full transition-colors`,title:`Ghi chú của tôi`,children:(0,Y.jsx)(ne,{className:`w-5 h-5`})}),ar&&(0,Y.jsx)(`button`,{onClick:pr,className:`p-2 hover:bg-blue-50 text-blue-600 rounded-full transition-colors`,title:`Chia sẻ tour`,children:(0,Y.jsx)(Me,{className:`w-5 h-5`})})]})]}),(0,Y.jsxs)(`div`,{className:`relative min-h-[480px] w-full bg-blue-900 flex flex-col justify-end`,children:[(0,Y.jsx)(`img`,{src:Or.coverImage,className:`absolute inset-0 w-full h-full object-cover opacity-60`,alt:`Tour Cover`}),(0,Y.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-t from-black/80 via-black/20 to-transparent`}),(0,Y.jsx)(`div`,{className:`relative z-10 p-6 text-white pt-28 pb-20`,children:(0,Y.jsxs)(`div`,{className:`max-w-2xl mx-auto space-y-4`,children:[(0,Y.jsx)(`h2`,{className:`text-3xl font-black tracking-tight drop-shadow-md`,children:Or.title}),s?.tags&&s.tags.length>0&&(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-2 pt-1`,children:s.tags.map(e=>(0,Y.jsx)(`span`,{className:`px-2.5 py-1 bg-white/20 backdrop-blur-md border border-white/30 rounded-lg text-[10px] font-black uppercase tracking-wider`,children:e},e))}),s?.description&&(0,Y.jsxs)(`p`,{className:`text-sm md:text-base text-white/90 max-w-xl line-clamp-3 md:line-clamp-none bg-black/20 backdrop-blur-sm p-4 rounded-2xl border border-white/10 italic leading-relaxed`,children:[(0,Y.jsx)(De,{className:`w-4 h-4 inline-block mr-2 opacity-50`}),s.description]}),(0,Y.jsxs)(`div`,{className:`mt-Line truncated
|
||||
`){let r=new s.default(this.ops),i=new e,a=0;for(;r.hasNext();){if(r.peekType()!==`insert`)return;let s=r.peek(),c=o.default.length(s)-r.peekLength(),l=typeof s.insert==`string`?s.insert.indexOf(n,c)-c:-1;if(l<0)i.push(r.next());else if(l>0)i.push(r.next(l));else{if(t(i,r.next(1).attributes||{},a)===!1)return;a+=1,i=new e}}i.length()>0&&t(i,{},a)}invert(t){let n=new e;return this.reduce((r,i)=>{if(i.insert)n.delete(o.default.length(i));else if(typeof i.retain==`number`&&i.attributes==null)return n.retain(i.retain),r+i.retain;else if(i.delete||typeof i.retain==`number`){let e=i.delete||i.retain;return t.slice(r,r+e).forEach(e=>{i.delete?n.push(e):i.retain&&i.attributes&&n.retain(o.default.length(e),a.default.invert(i.attributes,e.attributes))}),r+e}else if(typeof i.retain==`object`&&i.retain!==null){let o=t.slice(r,r+1),c=new s.default(o.ops).next(),[u,d,f]=l(i.retain,c.insert),p=e.getHandler(u);return n.retain({[u]:p.invert(d,f)},a.default.invert(i.attributes,c.attributes)),r+1}return r},0),n.chop()}transform(t,n=!1){if(n=!!n,typeof t==`number`)return this.transformPosition(t,n);let r=t,i=new s.default(this.ops),c=new s.default(r.ops),l=new e;for(;i.hasNext()||c.hasNext();)if(i.peekType()===`insert`&&(n||c.peekType()!==`insert`))l.retain(o.default.length(i.next()));else if(c.peekType()===`insert`)l.push(c.next());else{let t=Math.min(i.peekLength(),c.peekLength()),r=i.next(t),o=c.next(t);if(r.delete)continue;if(o.delete)l.push(o);else{let i=r.retain,s=o.retain,c=typeof s==`object`&&s?s:t;if(typeof i==`object`&&i&&typeof s==`object`&&s){let t=Object.keys(i)[0];if(t===Object.keys(s)[0]){let r=e.getHandler(t);r&&(c={[t]:r.transform(i[t],s[t],n)})}}l.retain(c,a.default.transform(r.attributes,o.attributes,n))}}return l.chop()}transformPosition(e,t=!1){t=!!t;let n=new s.default(this.ops),r=0;for(;n.hasNext()&&r<=e;){let i=n.peekLength(),a=n.peekType();if(n.next(),a===`delete`){e-=Math.min(i,e-r);continue}else a===`insert`&&(r<e||!t)&&(e+=i);r+=i}return e}};u.Op=o.default,u.OpIterator=s.default,u.AttributeMap=a.default,u.handlers={},e.default=u,typeof t==`object`&&(t.exports=u,t.exports.default=u)}))(),1),Cw=class extends uw{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return``}};Cw.blotName=`break`,Cw.tagName=`BR`;var ww=class extends gw{},Tw={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function Ew(e){return e.replace(/[&<>"']/g,e=>Tw[e])}var Dw=class e extends aw{static allowedChildren=[e,Cw,uw,ww];static order=[`cursor`,`inline`,`link`,`underline`,`strike`,`italic`,`bold`,`script`,`code`];static compare(t,n){let r=e.order.indexOf(t),i=e.order.indexOf(n);return r>=0||i>=0?r-i:t===n?0:t<n?-1:1}formatAt(t,n,r,i){if(e.compare(this.statics.blotName,r)<0&&this.scroll.query(r,zC.BLOT)){let e=this.isolate(t,n);i&&e.wrap(r,i)}else super.formatAt(t,n,r,i)}optimize(t){if(super.optimize(t),this.parent instanceof e&&e.compare(this.statics.blotName,this.parent.statics.blotName)>0){let e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}},Ow=1,kw=class extends sw{cache={};delta(){return this.cache.delta??(this.cache.delta=jw(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,n,r){t<=0||(this.scroll.query(n,zC.BLOCK)?e+t===this.length()&&this.format(n,r):super.formatAt(e,Math.min(t,this.length()-e-1),n,r),this.cache={})}insertAt(e,t,n){if(n!=null){super.insertAt(e,t,n),this.cache={};return}if(t.length===0)return;let r=t.split(`
|
||||
`),i=r.shift();i.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let a=this;r.reduce((e,t)=>(a=a.split(e,!0),a.insertAt(0,t),t.length),e+i.length)}insertBefore(e,t){let{head:n}=this.children;super.insertBefore(e,t),n instanceof Cw&&n.remove(),this.cache={}}length(){return this.cache.length??(this.cache.length=super.length()+Ow),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t&&(e===0||e>=this.length()-Ow)){let t=this.clone();return e===0?(this.parent.insertBefore(t,this),this):(this.parent.insertBefore(t,this.next),t)}let n=super.split(e,t);return this.cache={},n}};kw.blotName=`block`,kw.tagName=`P`,kw.defaultChild=Cw,kw.allowedChildren=[Cw,Dw,uw,ww];var Aw=class extends uw{attach(){super.attach(),this.attributes=new JC(this.domNode)}delta(){return new Q.default().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){let n=this.scroll.query(e,zC.BLOCK_ATTRIBUTE);n!=null&&this.attributes.attribute(n,t)}formatAt(e,t,n,r){this.format(n,r)}insertAt(e,t,n){if(n!=null){super.insertAt(e,t,n);return}let r=t.split(`
|
||||
`),i=r.pop(),a=r.map(e=>{let t=this.scroll.create(kw.blotName);return t.insertAt(0,e),t}),o=this.split(e);a.forEach(e=>{this.parent.insertBefore(e,o)}),i&&this.parent.insertBefore(this.scroll.create(`text`,i),o)}};Aw.scope=zC.BLOCK_BLOT;function jw(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.descendants(QC).reduce((e,n)=>n.length()===0?e:e.insert(n.value(),Mw(n,{},t)),new Q.default).insert(`
|
||||
`,Mw(e))}function Mw(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e==null||(`formats`in e&&typeof e.formats==`function`&&(t={...t,...e.formats()},n&&delete t[`code-token`]),e.parent==null||e.parent.statics.blotName===`scroll`||e.parent.statics.scope!==e.statics.scope)?t:Mw(e.parent,t,n)}var Nw=class e extends uw{static blotName=`cursor`;static className=`ql-cursor`;static tagName=`span`;static CONTENTS=``;static value(){}constructor(t,n,r){super(t,n),this.selection=r,this.textNode=document.createTextNode(e.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(t,n){if(this.savedLength!==0){super.format(t,n);return}let r=this,i=0;for(;r!=null&&r.statics.scope!==zC.BLOCK_BLOT;)i+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=e.CONTENTS.length,r.optimize(),r.formatAt(i,e.CONTENTS.length,t,n),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;let t=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);let n=this.prev instanceof ww?this.prev:null,r=n?n.length():0,i=this.next instanceof ww?this.next:null,a=i?i.text:``,{textNode:o}=this,s=o.data.split(e.CONTENTS).join(``);o.data=e.CONTENTS;let c;if(n)c=n,(s||i)&&(n.insertAt(n.length(),s+a),i&&i.remove());else if(i)c=i,i.insertAt(0,s);else{let e=document.createTextNode(s);c=this.scroll.create(e),this.parent.insertBefore(c,this)}if(this.remove(),t){let e=(e,t)=>n&&e===n.domNode?t:e===o?r+t-1:i&&e===i.domNode?r+s.length+t:null,a=e(t.start.node,t.start.offset),l=e(t.end.node,t.end.offset);if(a!==null&&l!==null)return{startNode:c.domNode,startOffset:a,endNode:c.domNode,endOffset:l}}return null}update(e,t){if(e.some(e=>e.type===`characterData`&&e.target===this.textNode)){let e=this.restore();e&&(t.range=e)}}optimize(t){super.optimize(t);let{parent:n}=this;for(;n;){if(n.domNode.tagName===`A`){this.savedLength=e.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return``}},Pw=u(s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this.
Line truncated
|
||||
`)&&(t<=e||!!this.scroll.descendant(Aw,e)[0]),this.scroll.insertAt(e,r);let[i,o]=this.scroll.line(e),c=LC({},Mw(i));if(i instanceof kw){let[e]=i.descendant(QC,o);e&&(c=LC(c,Mw(e)))}a=Q.AttributeMap.diff(c,a)||{}}else if(typeof n.insert==`object`){let r=Object.keys(n.insert)[0];if(r==null)return e;let i=this.scroll.query(r,zC.INLINE)!=null;if(i)(t<=e||this.scroll.descendant(Aw,e)[0])&&(s=!0);else if(e>0){let[t,n]=this.scroll.descendant(QC,e-1);t instanceof ww?t.value()[n]!==`
|
||||
`&&(o=!0):t instanceof uw&&t.statics.scope===zC.INLINE_BLOT&&(o=!0)}if(this.scroll.insertAt(e,r,n.insert[r]),i){let[t]=this.scroll.descendant(QC,e);if(t){let e=LC({},Mw(t));a=Q.AttributeMap.diff(e,a)||{}}}}t+=i}else if(r.push(n),n.retain!==null&&typeof n.retain==`object`){let t=Object.keys(n.retain)[0];if(t==null)return e;this.scroll.updateEmbedAt(e,t,n.retain[t])}Object.keys(a).forEach(t=>{this.scroll.formatAt(e,i,t,a[t])});let c=+!!o,l=+!!s;return t+=c+l,r.retain(c),r.delete(l),e+i+c+l},0),r.reduce((e,t)=>typeof t.delete==`number`?(this.scroll.deleteAt(e,t.delete),e):e+Q.Op.length(t),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update(new Q.default().retain(e).delete(t))}formatLine(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach(r=>{this.scroll.lines(e,Math.max(t,1)).forEach(e=>{e.format(r,n[r])})}),this.scroll.optimize();let r=new Q.default().retain(e).retain(t,WS(n));return this.update(r)}formatText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n).forEach(r=>{this.scroll.formatAt(e,t,r,n[r])});let r=new Q.default().retain(e).retain(t,WS(n));return this.update(r)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new Q.default)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],r=[];t===0?this.scroll.path(e).forEach(e=>{let[t]=e;t instanceof kw?n.push(t):t instanceof QC&&r.push(t)}):(n=this.scroll.lines(e,t),r=this.scroll.descendants(QC,e,t));let[i,a]=[n,r].map(e=>{let t=e.shift();if(t==null)return{};let n=Mw(t);for(;Object.keys(n).length>0;){let t=e.shift();if(t==null)return n;n=Xw(Mw(t),n)}return n});return{...i,...a}}getHTML(e,t){let[n,r]=this.scroll.line(e);if(n){let i=n.length();return n.length()>=r+t&&!(r===0&&t===i)?Yw(n,r,t,!0):Yw(this.scroll,e,t,!0)}return``}getText(e,t){return this.getContents(e,t).filter(e=>typeof e.insert==`string`).map(e=>e.insert).join(``)}insertContents(e,t){let n=Qw(t),r=new Q.default().retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(r)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update(new Q.default().retain(e).insert({[t]:n}))}insertText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`
|
||||
`).replace(/\r/g,`
|
||||
`),this.scroll.insertAt(e,t),Object.keys(n).forEach(r=>{this.scroll.formatAt(e,t.length,r,n[r])}),this.update(new Q.default().retain(e).insert(t,WS(n)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;let e=this.scroll.children.head;if(e?.statics.blotName!==kw.blotName)return!1;let t=e;return t.children.length>1?!1:t.children.head instanceof Cw}removeFormat(e,t){let n=this.getText(e,t),[r,i]=this.scroll.line(e+t),a=0,o=new Q.default;r!=null&&(a=r.length()-i,o=r.delta().slice(i,i+a-1).insert(`
|
||||
`));let s=this.getContents(e,t+a).diff(new Q.default().insert(n).concat(o)),c=new Q.default().retain(e).concat(s);return this.applyDelta(c)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this.delta;if(t.length===1&&t[0].type===`characterData`&&t[0].target.data.match(Kw)&&this.scroll.find(t[0].target)){let i=this.scroll.find(t[0].target),a=Mw(i),o=i.offset(this.scroll),s=t[0].oldValue.replace(Nw.CONTENTS,``),c=new Q.default().insert(s),l=new Q.default().insert(i.value()),u=n&&{oldRange:$w(n.oldRange,-o),newRange:$w(n.newRange,-o)};e=new Q.default().retain(o).concat(c.diff(l,u)).reduce((e,t)=>t.insert?e.insert(t.insert,a):e.push(t),new Q.default),this.delta=r.compose(e)}else this.delta=this.getDelta(),(!e||!IC(r.compose(e),this.delta))&&(e=r.diff(this.delta,n));return e}};function Jw(e,t,n){if(e.length===0){let[e]=Zw(n.pop());return t<=0?`</li></${e}>`:`</li></${e}>${Jw([],t-1,n)}`}let[{child:r,offset:i,length:a,indent:o,type:s},...c]=e,[l,u]=Zw(s);if(o>t)return n.push(s),o===t+1?`<${l}><li${u}>${Yw(r,i,a)}${Jw(c,o,n)}`:`<${l}><li>${Jw(e,t+1,n)}`;let d=n[n.length-1];if(o===t&&s===d)return`</li><li${u}>${Yw(r,i,a)}${Jw(c,o,n)}`;let[f]=Zw(n.pop());return`</li></${f}>${Jw(e,t-1,n)}`}function Yw(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(`html`in e&&typeof e.html==`function`)return e.html(t,n);if(e instanceof ww)return Ew(e.value().slice(t,t+n)).replaceAll(` `,` `);if(e instanceof nw){if(e.statics.blotName===`list-container`){let r=[];return e.children.forEachAt(t,n,(e,t,n)=>{let i=`formats`in e&&typeof e.formats==`function`?e.formats():{};r.push({child:e,offset:t,length:n,indent:i.indent||0,type:i.list})}),Jw(r,-1,[])}let i=[];if(e.children.forEachAt(t,n,(e,t,n)=>{i.push(Yw(e,t,n))}),r||e.statics.blotName===`list`)return i.join(``);let{outerHTML:a,innerHTML:o}=e.domNode,[s,c]=a.split(`>${o}<`);return s===`<table`?`<table style="border: 1px solid #000;">${i.join(``)}<${c}`:`${s}>${i.join(``)}<${c}`}return e.domNode instanceof Element?e.domNode.outerHTML:``}function Xw(e,t){return Object.keys(t).reduce((n,r)=>{if(e[r]==null)return n;let i=t[r];return i===e[r]?n[r]=i:Array.isArray(i)?i.indexOf(e[r])<0?n[r]=i.concat([e[r]]):n[r]=i:n[r]=[i,e[r]],n},{})}function Zw(e){let t=e===`ordered`?`ol`:`ul`;switch(e){case`checked`:return[t,` data-list="checked"`];case`unchecked`:return[t,` data-list="unchecked"`];default:return[t,``]}}function Qw(e){return e.reduce((e,t)=>{if(typeof t.insert==`string`){let n=t.insert.replace(/\r\n/g,`
|
||||
`).replace(/\r/g,`
|
||||
`);return e.insert(n,t.attributes)}return e.push(t)},new Q.default)}function $w(e,t){let{index:n,length:r}=e;return new Uw(n+t,r)}function eT(e){let t=[];return e.forEach(e=>{typeof e.insert==`string`?e.insert.split(`
|
||||
`).forEach((n,r)=>{r&&t.push({insert:`
|
||||
`,attributes:e.attributes}),n&&t.push({insert:n,attributes:e.attributes})}):t.push(e)}),t}var tT=class{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}},nT=``,rT=class extends uw{constructor(e,t){super(e,t),this.contentNode=document.createElement(`span`),this.contentNode.setAttribute(`contenteditable`,`false`),Array.from(this.domNode.childNodes).forEach(e=>{this.contentNode.appendChild(e)}),this.leftGuard=document.createTextNode(nT),this.rightGuard=document.createTextNode(nT),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,n,r=e.data.split(nT).join(``);if(e===this.leftGuard)if(this.prev instanceof ww){let e=this.prev.length();this.prev.insertAt(e,r),t={startNode:this.prev.domNode,startOffset:e+r.length}}else n=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(n),this),t={startNode:n,startOffset:r.length};else e===this.rightGuard&&(this.next instanceof ww?(this.next.insertAt(0,r),t={startNode:this.next.domNode,startOffset:r.length}):(n=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(n),this.next),t={startNode:n,startOffset:r.length}));return e.data=nT,t}update(e,t){e.forEach(e=>{if(e.type===`characterData`&&(e.target===this.leftGuard||e.target===this.rightGuard)){let n=this.restore(e.target);n&&(t.range=n)}})}},iT=class{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener(`compositionstart`,e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener(`compositionend`,e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){let t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof rT)&&(this.emitter.emit(Vw.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Vw.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Vw.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Vw.events.COMPOSITION_END,e),this.isComposing=!1}},aT=class e{static DEFAULTS={modules:{}};static themes={default:e};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]??this.addModule(e)})}addModule(e){let t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}},oT=e=>e.parentElement||e.getRootNode().host||null,sT=e=>{let t=e.getBoundingClientRect(),n=`offsetWidth`in e&&Math.abs(t.width)/e.offsetWidth||1,r=`offsetHeight`in e&&Math.abs(t.height)/e.offsetHeight||1;return{top:t.top,right:t.left+e.clientWidth*n,bottom:t.top+e.clientHeight*r,left:t.left}},cT=e=>{let t=parseInt(e,10);return Number.isNaN(t)?0:t},lT=(e,t,n,r,i,a)=>e<n&&t>r?0:e<n?-(n-e+i):t>r?t-e>r-n?e+i-n:t-r+a:0,uT=(e,t)=>{let n=e.ownerDocument,r=t,i=e;for(;i;){let e=i===n.body,t=e?{top:0,right:window.visualViewport?.width??n.documentElement.clientWidth,bottom:window.visualViewport?.height??n.documentElement.clientHeight,left:0}:sT(i),a=getComputedStyle(i),o=lT(r.left,r.right,t.left,t.right,cT(a.scrollPaddingLeft),cT(a.scrollPaddingRight)),s=lT(r.top,r.bottom,t.top,t.bottom,cT(a.scrollPaddingTop),cT(a.scrollPaddingBottom));if(o||s)if(e)n.defaultView?.scrollBy(o,s);else{let{scrollLeft:e,scrollTop:t}=i;s&&(i.scrollTop+=s),o&&(i.scrollLeft+=o);let n=i.scrollLeft-e,a=i.scrollTop-t;r={left:r.left-n,top:r.top-a,right:r.right-n,bottom:r.bottom-a}}i=e||a.position===`fixed`?null:oT(i)}},dT=100,fT=[`block`,`break`,`cursor`,`inline`,`scroll`,`text`],pT=(e,t,n)=>{let r=new UC;return fT.forEach(e=>{let n=t.query(e);n&&r.register(n)}),e.forEach(e=>{let i=t.query(e);i||n.error(`Cannot register "${e}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;i;)if(r.register(i),i=`blotName`in i?i.requiredContainer??null:null,a+=1,a>dT){n.error(`Cycle detected in registering blot requiredContainer: "${e}"`);break}}),r},mT=zw(`quill`),hT=new UC;nw.uiClass=`ql-ui`;var $=class e{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:``,readOnly:!1,registry:hT,theme:`default`};static events=Vw.events;static sources=Vw.sources;static version=`2.0.3`;static imports={delta:Q.default,parchment:RC,"core/module":tT,"core/theme":aT};static debug(e){e===!0&&(e=`log`),zw.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Fw.get(e)||hT.find(e,t)}static import(e){return this.imports[e]??mT.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!=`string`){let e=arguments.length<=0?void 0:arguments[0],t=!!(!(arg
Line truncated
|
||||
`});this.setContents(e)}this.history.clear(),this.options.placeholder&&this.root.setAttribute(`data-placeholder`,this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e==`string`){let t=e;e=document.createElement(`div`),e.classList.add(t)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,n){return[e,t,,n]=xT(e,t,n),bT.call(this,()=>this.editor.deleteText(e,t),n,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;let t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle(`ql-disabled`,!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vw.sources.API;return bT.call(this,()=>{let n=this.getSelection(!0),r=new Q.default;if(n==null)return r;if(this.scroll.query(e,zC.BLOCK))r=this.editor.formatLine(n.index,n.length,{[e]:t});else if(n.length===0)return this.selection.format(e,t),r;else r=this.editor.formatText(n.index,n.length,{[e]:t});return this.setSelection(n,Vw.sources.SILENT),r},n)}formatLine(e,t,n,r,i){let a;return[e,t,a,i]=xT(e,t,n,r,i),bT.call(this,()=>this.editor.formatLine(e,t,a),i,e,0)}formatText(e,t,n,r,i){let a;return[e,t,a,i]=xT(e,t,n,r,i),bT.call(this,()=>this.editor.formatText(e,t,a),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=null;if(n=typeof e==`number`?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length),!n)return null;let r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=xT(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e==`number`?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e==`number`?this.scroll.lines(e,t):this.scroll.lines(e.index,e.length)}getModule(e){return this.theme.modules[e]}getSelection(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e==`number`&&(t??=this.getLength()-e),[e,t]=xT(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e==`number`&&(t??=this.getLength()-e),[e,t]=xT(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e.sources.API;return bT.call(this,()=>this.editor.insertEmbed(t,n,r),i,t)}insertText(e,t,n,r,i){let a;return[e,,a,i]=xT(e,0,n,r,i),bT.call(this,()=>this.editor.insertText(e,t,a),i,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,n){return[e,t,,n]=xT(e,t,n),bT.call(this,()=>this.editor.removeFormat(e,t),n,e)}scrollRectIntoView(e){uT(this.root,e)}scrollIntoView(){console.warn(`Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead.`),this.scrollSelectionIntoView()}scrollSelectionIntoView(){let e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vw.sources.API;return bT.call(this,()=>{e=new Q.default(e);let t=this.getLength(),n=this.editor.deleteText(0,t),r=this.editor.insertContents(0,e),i=this.editor.deleteText(this.getLength()-1,1);return n.compose(r).compose(i)},t)}setSelection(t,n,r){t==null?this.selection.setRange(null,n||e.sources.API):([t,n,,r]=xT(t,n,r),this.selection.setRange(new Uw(Math.max(0,t),n),r),r!==Vw.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vw.sources.API,n=new Q.default().insert(e);return this.setContents(n,t)}up
Line truncated
|
||||
`)?e.insertAt(0,t.slice(0,-1),n):e.insertAt(0,t,n)}else{let e=this.scroll.create(t,n);this.appendChild(e)}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===zC.INLINE_BLOT){let n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(e),super.insertBefore(n,t)}else super.insertBefore(e,t)}insertContents(e,t){let n=this.deltaToRenderBlocks(t.concat(new Q.default().insert(`
|
||||
`))),r=n.pop();if(r==null)return;this.batchStart();let i=n.shift();if(i){let t=i.type===`block`&&(i.delta.length()===0||!this.descendant(Aw,e)[0]&&e<this.length()),n=i.type===`block`?i.delta:new Q.default().insert({[i.key]:i.value});DT(this,e,n);let r=+(i.type===`block`),a=e+n.length()+r;t&&this.insertAt(a-1,`
|
||||
`);let o=Mw(this.line(e)[0]),s=Q.AttributeMap.diff(o,i.attributes)||{};Object.keys(s).forEach(e=>{this.formatAt(a-1,1,e,s[e])}),e=a}let[a,o]=this.children.find(e);if(n.length&&(a&&(a=a.split(o),o=0),n.forEach(e=>{if(e.type===`block`)DT(this.createBlock(e.attributes,a||void 0),0,e.delta);else{let t=this.create(e.key,e.value);this.insertBefore(t,a||void 0),Object.keys(e.attributes).forEach(n=>{t.format(n,e.attributes[n])})}})),r.type===`block`&&r.delta.length()){let e=a?a.offset(a.scroll)+o:this.length();DT(this,e,r.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute(`contenteditable`)===`true`}leaf(e){let t=this.path(e).pop();if(!t)return[null,-1];let[n,r]=t;return n instanceof QC?[n,r]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(wT,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,n=(e,t,r)=>{let i=[],a=r;return e.children.forEachAt(t,r,(e,t,r)=>{wT(e)?i.push(e):e instanceof lw&&(i=i.concat(n(e,t,a))),a-=r}),i};return n(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(Vw.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=Vw.sources.USER;typeof e==`string`&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(e=>{let{target:t}=e,n=this.find(t,!0);return n&&!TT(n)}),e.length>0&&this.emitter.emit(Vw.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Vw.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){let[r]=this.descendant(e=>e instanceof Aw,e);r&&r.statics.blotName===t&&TT(r)&&r.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){let t=[],n=new Q.default;return e.forEach(e=>{let r=e?.insert;if(r)if(typeof r==`string`){let i=r.split(`
|
||||
`);i.slice(0,-1).forEach(r=>{n.insert(r,e.attributes),t.push({type:`block`,delta:n,attributes:e.attributes??{}}),n=new Q.default});let a=i[i.length-1];a&&n.insert(a,e.attributes)}else{let i=Object.keys(r)[0];if(!i)return;this.query(i,zC.INLINE)?n.push(e):(n.length()&&t.push({type:`block`,delta:n,attributes:{}}),n=new Q.default,t.push({type:`blockEmbed`,key:i,value:r[i],attributes:e.attributes??{}}))}}),n.length()&&t.push({type:`block`,delta:n,attributes:{}}),t}createBlock(e,t){let n,r={};Object.entries(e).forEach(e=>{let[t,i]=e;this.query(t,zC.BLOCK&zC.BLOT)==null?r[t]=i:n=t});let i=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(i,t||void 0);let a=i.length();return Object.entries(r).forEach(e=>{let[t,n]=e;i.formatAt(0,a,t,n)}),i}};function DT(e,t,n){n.reduce((t,n)=>{let r=Q.Op.length(n),i=n.attributes||{};if(n.insert!=null){if(typeof n.insert==`string`){let r=n.insert;e.insertAt(t,r);let[a]=e.descendant(QC,t),o=Mw(a);i=Q.AttributeMap.diff(o,i)||{}}else if(typeof n.insert==`object`){let r=Object.keys(n.insert)[0];if(r==null)return t;if(e.insertAt(t,r,n.insert[r]),e.scroll.query(r,zC.INLINE)!=null){let[n]=e.descendant(QC,t),r=Mw(n);i=Q.AttributeMap.diff(r,i)||{}}}}return Object.keys(i).forEach(n=>{e.formatAt(t,r,n,i[n])}),t+r},t)}var OT={scope:zC.BLOCK,whitelist:[`right`,`center`,`justify`]},kT=new BC(`align`,`align`,OT),AT=new GC(`align`,`ql-align`,OT),jT=new qC(`align`,`text-align`,OT),MT=class extends qC{value(e){let t=super.value(e);return t.startsWith(`rgb(`)?(t=t.replace(/^[^\d]+/,``).replace(/[^\d]+$/,``),`#${t.split(`,`).map(e=>`00${parseInt(e,10).toString(16)}`.slice(-2)).join(``)}`):t}},NT=new GC(`color`,`ql-color`,{scope:zC.INLINE}),PT=new MT(`color`,`color`,{scope:zC.INLINE}),FT=new GC(`background`,`ql-bg`,{scope:zC.INLINE}),IT=new MT(`background`,`background-color`,{scope:zC.INLINE}),LT=class extends CT{static create(e){let t=super.create(e);return t.setAttribute(`spellcheck`,`false`),t}code(e,t){return this.children.map(e=>e.length()<=1?``:e.domNode.innerText).join(`
|
||||
`).slice(e,e+t)}html(e,t){return`<pre>\n${Ew(this.code(e,t))}\n</pre>`}},RT=class extends kw{static TAB=` `;static register(){$.register(LT)}},zT=class extends Dw{};zT.blotName=`code`,zT.tagName=`CODE`,RT.blotName=`code-block`,RT.className=`ql-code-block`,RT.tagName=`DIV`,LT.blotName=`code-block-container`,LT.className=`ql-code-block-container`,LT.tagName=`DIV`,LT.allowedChildren=[RT],RT.allowedChildren=[ww,Cw,Nw],RT.requiredContainer=LT;var BT={scope:zC.BLOCK,whitelist:[`rtl`]},VT=new BC(`direction`,`dir`,BT),HT=new GC(`direction`,`ql-direction`,BT),UT=new qC(`direction`,`direction`,BT),WT={scope:zC.INLINE,whitelist:[`serif`,`monospace`]},GT=new GC(`font`,`ql-font`,WT),KT=new class extends qC{value(e){return super.value(e).replace(/["']/g,``)}}(`font`,`font-family`,WT),qT=new GC(`size`,`ql-size`,{scope:zC.INLINE,whitelist:[`small`,`large`,`huge`]}),JT=new qC(`size`,`font-size`,{scope:zC.INLINE,whitelist:[`10px`,`18px`,`32px`]}),YT=zw(`quill:keyboard`),XT=/Mac/i.test(navigator.platform)?`metaKey`:`ctrlKey`,ZT=class e extends tT{static match(e,t){return[`altKey`,`ctrlKey`,`metaKey`,`shiftKey`].some(n=>!!t[n]!==e[n]&&t[n]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(e=>{this.options.bindings[e]&&this.addBinding(this.options.bindings[e])}),this.addBinding({key:`Enter`,shiftKey:null},this.handleEnter),this.addBinding({key:`Enter`,metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:`Backspace`},{collapsed:!0},this.handleBackspace),this.addBinding({key:`Delete`},{collapsed:!0},this.handleDelete)):(this.addBinding({key:`Backspace`},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:`Delete`},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:`Backspace`},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:`Delete`},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:`Backspace`,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=nE(e);if(r==null){YT.warn(`Attempted to add invalid keyboard binding`,r);return}typeof t==`function`&&(t={handler:t}),typeof n==`function`&&(n={handler:n}),(Array.isArray(r.key)?r.key:[r.key]).forEach(e=>{let i={...r,key:e,...t,...n};this.bindings[i.key]=this.bindings[i.key]||[],this.bindings[i.key].push(i)})}listen(){this.quill.root.addEventListener(`keydown`,t=>{if(t.defaultPrevented||t.isComposing||t.keyCode===229&&(t.key===`Enter`||t.key===`Backspace`))return;let n=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(n=>e.match(t,n));if(n.length===0)return;let r=$.find(t.target,!0);if(r&&r.scroll!==this.quill.scroll)return;let i=this.quill.getSelection();if(i==null||!this.quill.hasFocus())return;let[a,o]=this.quill.getLine(i.index),[s,c]=this.quill.getLeaf(i.index),[l,u]=i.length===0?[s,c]:this.quill.getLeaf(i.index+i.length),d=s instanceof gw?s.value().slice(0,c):``,f=l instanceof gw?l.value().slice(u):``,p={collapsed:i.length===0,empty:i.length===0&&a.length()<=1,format:this.quill.getFormat(i),line:a,offset:o,prefix:d,suffix:f,event:t};n.some(e=>{if(e.collapsed!=null&&e.collapsed!==p.collapsed||e.empty!=null&&e.empty!==p.empty||e.offset!=null&&e.offset!==p.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(e=>p.format[e]==null))return!1}else if(typeof e.format==`object`&&!Object.keys(e.format).every(t=>e.format[t]===!0?p.format[t]!=null:e.format[t]===!1?p.format[t]==null:IC(e.format[t],p.format[t])))return!1;return e.prefix!=null&&!e.prefix.test(p.prefix)||e.suffix!=null&&!e.suffix.test(p.suffix)?!1:e.handler.call(this,i,p,e)!==!0})&&t.preventDefault()})}handleBackspace(e,t){let n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let r={},[i]=this.quill.getLine(e.index),a=new Q.default().retain(e.index-n).delete(n);if(t.offset===0){let[t]=this.quill.getLine(e.index-1);if(t&&!(t.statics.blotName===`block`&&t.length()<=1)){let t=i.formats(),n=this.quill.getFormat(e.index-1,1);if(r=Q.AttributeMap.diff(t,n)||{},Object.keys(r).length>0){let t=new Q.default().retain(e.index+i.length()-2).retain(1,r);a=a.compose(t)}}}this.quill.updateContents(a,$.sources.USER),this.quill.focus()}handleDelete(e,t){let n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-n)return;let r={},[i]=this.quill.getLine(e.index),a=new Q.default().retain(e.index).delete(n);if(t.offset>=i.length()-1){let[t]=this.quill.getLine(e.index+1);if(t){let n=i.formats(),o=this.quill.getFormat(e.index,1);r=Q.AttributeMap.diff(n,o)||{},Object.keys(r).length>0&&(a=a.retain(t.length()-1).retain(1,r))}}this.quill.updateContents(a,$.sources.USER),this.quill.focus()}handleDeleteRange(e){rE({range:e,quill:this.quill}),this.quill.focuLine truncated
|
||||
`,n);this.quill.updateContents(r,$.sources.USER),this.quill.setSelection(e.index+1,$.sources.SILENT),this.quill.focus()}};ZT.DEFAULTS={bindings:{bold:eE(`bold`),italic:eE(`italic`),underline:eE(`underline`),indent:{key:`Tab`,format:[`blockquote`,`indent`,`list`],handler(e,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format(`indent`,`+1`,$.sources.USER),!1)}},outdent:{key:`Tab`,shiftKey:!0,format:[`blockquote`,`indent`,`list`],handler(e,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format(`indent`,`-1`,$.sources.USER),!1)}},"outdent backspace":{key:`Backspace`,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:[`indent`,`list`],offset:0,handler(e,t){t.format.indent==null?t.format.list!=null&&this.quill.format(`list`,!1,$.sources.USER):this.quill.format(`indent`,`-1`,$.sources.USER)}},"indent code-block":QT(!0),"outdent code-block":QT(!1),"remove tab":{key:`Tab`,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(e){this.quill.deleteText(e.index-1,1,$.sources.USER)}},tab:{key:`Tab`,handler(e,t){if(t.format.table)return!0;this.quill.history.cutoff();let n=new Q.default().retain(e.index).delete(e.length).insert(` `);return this.quill.updateContents(n,$.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,$.sources.SILENT),!1}},"blockquote empty enter":{key:`Enter`,collapsed:!0,format:[`blockquote`],empty:!0,handler(){this.quill.format(`blockquote`,!1,$.sources.USER)}},"list empty enter":{key:`Enter`,collapsed:!0,format:[`list`],empty:!0,handler(e,t){let n={list:!1};t.format.indent&&(n.indent=!1),this.quill.formatLine(e.index,e.length,n,$.sources.USER)}},"checklist enter":{key:`Enter`,collapsed:!0,format:{list:`checked`},handler(e){let[t,n]=this.quill.getLine(e.index),r={...t.formats(),list:`checked`},i=new Q.default().retain(e.index).insert(`
|
||||
`,r).retain(t.length()-n-1).retain(1,{list:`unchecked`});this.quill.updateContents(i,$.sources.USER),this.quill.setSelection(e.index+1,$.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:`Enter`,collapsed:!0,format:[`header`],suffix:/^$/,handler(e,t){let[n,r]=this.quill.getLine(e.index),i=new Q.default().retain(e.index).insert(`
|
||||
`,t.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,$.sources.USER),this.quill.setSelection(e.index+1,$.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:`Backspace`,format:[`table`],collapsed:!0,offset:0,handler(){}},"table delete":{key:`Delete`,format:[`table`],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:`Enter`,shiftKey:null,format:[`table`],handler(e){let t=this.quill.getModule(`table`);if(t){let[n,r,i,a]=t.getTable(e),o=iE(n,r,i,a);if(o==null)return;let s=n.offset();if(o<0){let t=new Q.default().retain(s).insert(`
|
||||
`);this.quill.updateContents(t,$.sources.USER),this.quill.setSelection(e.index+1,e.length,$.sources.SILENT)}else if(o>0){s+=n.length();let e=new Q.default().retain(s).insert(`
|
||||
`);this.quill.updateContents(e,$.sources.USER),this.quill.setSelection(s,$.sources.USER)}}}},"table tab":{key:`Tab`,shiftKey:null,format:[`table`],handler(e,t){let{event:n,line:r}=t,i=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(i-1,$.sources.USER):this.quill.setSelection(i+r.length(),$.sources.USER)}},"list autofill":{key:` `,shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(e,t){if(this.quill.scroll.query(`list`)==null)return!0;let{length:n}=t.prefix,[r,i]=this.quill.getLine(e.index);if(i>n)return!0;let a;switch(t.prefix.trim()){case`[]`:case`[ ]`:a=`unchecked`;break;case`[x]`:a=`checked`;break;case`-`:case`*`:a=`bullet`;break;default:a=`ordered`}this.quill.insertText(e.index,` `,$.sources.USER),this.quill.history.cutoff();let o=new Q.default().retain(e.index-i).delete(n+1).retain(r.length()-2-i).retain(1,{list:a});return this.quill.updateContents(o,$.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,$.sources.SILENT),!1}},"code exit":{key:`Enter`,collapsed:!0,format:[`code-block`],prefix:/^$/,suffix:/^\s*$/,handler(e){let[t,n]=this.quill.getLine(e.index),r=2,i=t;for(;i!=null&&i.length()<=1&&i.formats()[`code-block`];)if(i=i.prev,--r,r<=0){let r=new Q.default().retain(e.index+t.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(r,$.sources.USER),this.quill.setSelection(e.index-1,$.sources.SILENT),!1}return!0}},"embed left":$T(`ArrowLeft`,!1),"embed left shift":$T(`ArrowLeft`,!0),"embed right":$T(`ArrowRight`,!1),"embed right shift":$T(`ArrowRight`,!0),"table down":tE(!1),"table up":tE(!0)}};function QT(e){return{key:`Tab`,shiftKey:!e,format:{"code-block":!0},handler(t,n){let{event:r}=n,{TAB:i}=this.quill.scroll.query(`code-block`);if(t.length===0&&!r.shiftKey){this.quill.insertText(t.index,i,$.sources.USER),this.quill.setSelection(t.index+i.length,$.sources.SILENT);return}let a=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t),{index:o,length:s}=t;a.forEach((t,n)=>{e?(t.insertAt(0,i),n===0?o+=i.length:s+=i.length):t.domNode.textContent.startsWith(i)&&(t.deleteAt(0,i.length),n===0?o-=i.length:s-=i.length)}),this.quill.update($.sources.USER),this.quill.setSelection(o,s,$.sources.SILENT)}}}function $T(e,t){return{key:e,shiftKey:t,altKey:null,[e===`ArrowLeft`?`prefix`:`suffix`]:/^$/,handler(n){let{index:r}=n;e===`ArrowRight`&&(r+=n.length+1);let[i]=this.quill.getLeaf(r);return i instanceof uw?(e===`ArrowLeft`?t?this.quill.setSelection(n.index-1,n.length+1,$.sources.USER):this.quill.setSelection(n.index-1,$.sources.USER):t?this.quill.setSelection(n.index,n.length+1,$.sources.USER):this.quill.setSelection(n.index+n.length+1,$.sources.USER),!1):!0}}}function eE(e){return{key:e[0],shortKey:!0,handler(t,n){this.quill.format(e,!n.format[e],$.sources.USER)}}}function tE(e){return{key:e?`ArrowUp`:`ArrowDown`,collapsed:!0,format:[`table`],handler(t,n){let r=e?`prev`:`next`,i=n.line,a=i.parent[r];if(a!=null){if(a.statics.blotName===`table-row`){let e=a.children.head,t=i;for(;t.prev!=null;)t=t.prev,e=e.next;let r=e.offset(this.quill.scroll)+Math.min(n.offset,e.length()-1);this.quill.setSelection(r,0,$.sources.USER)}}else{let t=i.table()[r];t!=null&&(e?this.quill.setSelection(t.offset(this.quill.scroll)+t.length()-1,0,$.sources.USER):this.quill.setSelection(t.offset(this.quill.scroll),0,$.sources.USER))}return!1}}}function nE(e){if(typeof e==`string`||typeof e==`number`)e={key:e};else if(typeof e==`object`)e=WS(e);else return null;return e.shortKey&&(e[XT]=e.shortKey,delete e.shortKey),e}function rE(e){let{quill:t,range:n}=e,r=t.getLines(n),i={};if(r.length>1){let e=r[0].formats(),t=r[r.length-1].formats();i=Q.AttributeMap.diff(t,e)||{}}t.deleteText(n,$.sources.USER),Object.keys(i).length>0&&t.formatLine(n.index,1,i,$.sources.USER),t.setSelection(n.index,$.sources.SILENT)}function iE(e,t,n,r){return t.prev==null&&t.next==null?n.prev==null&&n.next==null?r===0?-1:1:n.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}var aE=/font-weight:\s*normal/,oE=[`P`,`OL`,`UL`],sE=e=>e&&oE.includes(e.tagName),cE=e=>{Array.from(e.querySelectorAll(`br`)).filter(e=>sE(e.previousElementSibling)&&sE(e.nextElementSibling)).forEach(e=>{e.parentNode?.removeChild(e)})},lE=e=>{Array.from(e.querySelectorAll(`b[style*="font-weight"]`)).filter(e=>e.getAttribute(`style`)?.match(aE)).forEach(t=>{let n=e.createDocumentFragment();n.append(...t.childNodes),t.parentNode?.replaceChild(n,t)})};function uE(e){e.querySelector(`[id^="docs-internal-guid-"]`)&&(lE(e),cE(e))}var dE=/\bmso-list:[^;]*ignore/i,fE=/\bmso-list:[^;]*\bl(\d+)/i,pE=/\bmso-list:[^;]*\blevel(\d+)/i,mE=(e,t)=>{let n=e.getAttribute(`style`),r=n?.match(fE);if(!r)return null;let i=Number(r[1]),a=n?.match(pE),o=a?Number(a[1]):1,s=RegExp(`@list l${i}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,`i`),c=t.match(s);return{id:i,indent:o,type:c&&c[1]===`bullet`?`bullet`:`ordered`,element:e}},hE=e=>{let t=Array.f
Line truncated
|
||||
`)&&(i.ops[i.ops.length-1].attributes==null||r.table)?i.compose(new Q.default().retain(i.length()-1).delete(1)):i}normalizeHTML(e){vE(e)}convertHTML(e){let t=new DOMParser().parseFromString(e,`text/html`);this.normalizeHTML(t);let n=t.body,r=new WeakMap,[i,a]=this.prepareMatching(n,r);return AE(this.quill.scroll,n,i,a,r)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$.sources.API;if(typeof e==`string`){let n=this.convert({html:e,text:``});this.quill.setContents(n,t),this.quill.setSelection(0,$.sources.SILENT)}else{let r=this.convert({html:t,text:``});this.quill.updateContents(new Q.default().retain(e).concat(r),n),this.quill.setSelection(e+r.length(),$.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();let[n]=this.quill.selection.getRange();if(n==null)return;let{html:r,text:i}=this.onCopy(n,t);e.clipboardData?.setData(`text/plain`,i),e.clipboardData?.setData(`text/html`,r),t&&rE({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(e=>e[0]!==`#`).join(`
|
||||
`)}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();let t=this.quill.getSelection(!0);if(t==null)return;let n=e.clipboardData?.getData(`text/html`),r=e.clipboardData?.getData(`text/plain`);if(!n&&!r){let t=e.clipboardData?.getData(`text/uri-list`);t&&(r=this.normalizeURIList(t))}let i=Array.from(e.clipboardData?.files||[]);if(!n&&i.length>0){this.quill.uploader.upload(t,i);return}if(n&&i.length>0){let e=new DOMParser().parseFromString(n,`text/html`);if(e.body.childElementCount===1&&e.body.firstElementChild?.tagName===`IMG`){this.quill.uploader.upload(t,i);return}}this.onPaste(t,{html:n,text:r})}onCopy(e){let t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:r}=t,i=this.quill.getFormat(e.index),a=this.convert({text:n,html:r},i);yE.log(`onPaste`,a,{text:n,html:r});let o=new Q.default().retain(e.index).delete(e.length).concat(a);this.quill.updateContents(o,$.sources.USER),this.quill.setSelection(o.length()-e.length,$.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){let n=[],r=[];return this.matchers.forEach(i=>{let[a,o]=i;switch(a){case Node.TEXT_NODE:r.push(o);break;case Node.ELEMENT_NODE:n.push(o);break;default:Array.from(e.querySelectorAll(a)).forEach(e=>{t.has(e)?t.get(e)?.push(o):t.set(e,[o])});break}}),[n,r]}};function wE(e,t,n,r){return r.query(t)?e.reduce((e,r)=>{if(!r.insert)return e;if(r.attributes&&r.attributes[t])return e.push(r);let i=n?{[t]:n}:{};return e.insert(r.insert,{...i,...r.attributes})},new Q.default):e}function TE(e,t){let n=``;for(let r=e.ops.length-1;r>=0&&n.length<t.length;--r){let t=e.ops[r];if(typeof t.insert!=`string`)break;n=t.insert+n}return n.slice(-1*t.length)===t}function EE(e,t){if(!(e instanceof Element))return!1;let n=t.query(e);return n&&n.prototype instanceof uw?!1:`address.article.blockquote.canvas.dd.div.dl.dt.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.iframe.li.main.nav.ol.output.p.pre.section.table.td.tr.ul.video`.split(`.`).includes(e.tagName.toLowerCase())}function DE(e,t){return e.previousElementSibling&&e.nextElementSibling&&!EE(e.previousElementSibling,t)&&!EE(e.nextElementSibling,t)}var OE=new WeakMap;function kE(e){return e==null?!1:(OE.has(e)||(e.tagName===`PRE`?OE.set(e,!0):OE.set(e,kE(e.parentNode))),OE.get(e))}function AE(e,t,n,r,i){return t.nodeType===t.TEXT_NODE?r.reduce((n,r)=>r(t,n,e),new Q.default):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((a,o)=>{let s=AE(e,o,n,r,i);return o.nodeType===t.ELEMENT_NODE&&(s=n.reduce((t,n)=>n(o,t,e),s),s=(i.get(o)||[]).reduce((t,n)=>n(o,t,e),s)),a.concat(s)},new Q.default):new Q.default}function jE(e){return(t,n,r)=>wE(n,e,!0,r)}function ME(e,t,n){let r=BC.keys(e),i=GC.keys(e),a=qC.keys(e),o={};return r.concat(i).concat(a).forEach(t=>{let r=n.query(t,zC.ATTRIBUTE);r!=null&&(o[r.attrName]=r.value(e),o[r.attrName])||(r=xE[t],r!=null&&(r.attrName===t||r.keyName===t)&&(o[r.attrName]=r.value(e)||void 0),r=SE[t],r!=null&&(r.attrName===t||r.keyName===t)&&(r=SE[t],o[r.attrName]=r.value(e)||void 0))}),Object.entries(o).reduce((e,t)=>{let[r,i]=t;return wE(e,r,i,n)},t)}function NE(e,t,n){let r=n.query(e);if(r==null)return t;if(r.prototype instanceof uw){let t={},i=r.value(e);if(i!=null)return t[r.blotName]=i,new Q.default().insert(t,r.formats(e,n))}else if(r.prototype instanceof sw&&!TE(t,`
|
||||
`)&&t.insert(`
|
||||
`),`blotName`in r&&`formats`in r&&typeof r.formats==`function`)return wE(t,r.blotName,r.formats(e,n),n);return t}function PE(e,t){return TE(t,`
|
||||
`)||t.insert(`
|
||||
`),t}function FE(e,t,n){let r=n.query(`code-block`);return wE(t,`code-block`,r&&`formats`in r&&typeof r.formats==`function`?r.formats(e,n):!0,n)}function IE(){return new Q.default}function LE(e,t,n){let r=n.query(e);if(r==null||r.blotName!==`list`||!TE(t,`
|
||||
`))return t;let i=-1,a=e.parentNode;for(;a!=null;)[`OL`,`UL`].includes(a.tagName)&&(i+=1),a=a.parentNode;return i<=0?t:t.reduce((e,t)=>t.insert?t.attributes&&typeof t.attributes.indent==`number`?e.push(t):e.insert(t.insert,{indent:i,...t.attributes||{}}):e,new Q.default)}function RE(e,t,n){let r=e,i=r.tagName===`OL`?`ordered`:`bullet`,a=r.getAttribute(`data-checked`);return a&&(i=a===`true`?`checked`:`unchecked`),wE(t,`list`,i,n)}function zE(e,t,n){if(!TE(t,`
|
||||
`)){if(EE(e,n)&&(e.childNodes.length>0||e instanceof HTMLParagraphElement))return t.insert(`
|
||||
`);if(t.length()>0&&e.nextSibling){let r=e.nextSibling;for(;r!=null;){if(EE(r,n))return t.insert(`
|
||||
`);let e=n.query(r);if(e&&e.prototype instanceof Aw)return t.insert(`
|
||||
`);r=r.firstChild}}}return t}function BE(e,t,n){let r={},i=e.style||{};return i.fontStyle===`italic`&&(r.italic=!0),i.textDecoration===`underline`&&(r.underline=!0),i.textDecoration===`line-through`&&(r.strike=!0),(i.fontWeight?.startsWith(`bold`)||parseInt(i.fontWeight,10)>=700)&&(r.bold=!0),t=Object.entries(r).reduce((e,t)=>{let[r,i]=t;return wE(e,r,i,n)},t),parseFloat(i.textIndent||0)>0?new Q.default().insert(` `).concat(t):t}function VE(e,t,n){let r=e.parentElement?.tagName===`TABLE`?e.parentElement:e.parentElement?.parentElement;return r==null?t:wE(t,`table`,Array.from(r.querySelectorAll(`tr`)).indexOf(e)+1,n)}function HE(e,t,n){let r=e.data;if(e.parentElement?.tagName===`O:P`)return t.insert(r.trim());if(!kE(e)){if(r.trim().length===0&&r.includes(`
|
||||
`)&&!DE(e,n))return t;r=r.replace(/[^\S\u00a0]/g,` `),r=r.replace(/ {2,}/g,` `),(e.previousSibling==null&&e.parentElement!=null&&EE(e.parentElement,n)||e.previousSibling instanceof Element&&EE(e.previousSibling,n))&&(r=r.replace(/^ /,``)),(e.nextSibling==null&&e.parentElement!=null&&EE(e.parentElement,n)||e.nextSibling instanceof Element&&EE(e.nextSibling,n))&&(r=r.replace(/ $/,``)),r=r.replaceAll(`\xA0`,` `)}return t.insert(r)}var UE=class extends tT{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on($.events.EDITOR_CHANGE,(e,t,n,r)=>{e===$.events.SELECTION_CHANGE?t&&r!==$.sources.SILENT&&(this.currentRange=t):e===$.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||r===$.sources.USER?this.record(t,n):this.transform(t)),this.currentRange=qE(this.currentRange,t))}),this.quill.keyboard.addBinding({key:`z`,shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:[`z`,`Z`],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:`y`,shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener(`beforeinput`,e=>{e.inputType===`historyUndo`?(this.undo(),e.preventDefault()):e.inputType===`historyRedo`&&(this.redo(),e.preventDefault())})}change(e,t){if(this.stack[e].length===0)return;let n=this.stack[e].pop();if(!n)return;let r=this.quill.getContents(),i=n.delta.invert(r);this.stack[t].push({delta:i,range:qE(n.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,$.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(e.ops.length===0)return;this.stack.redo=[];let n=e.invert(t),r=this.currentRange,i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){let e=this.stack.undo.pop();e&&(n=n.compose(e.delta),r=e.range)}else this.lastRecorded=i;n.length()!==0&&(this.stack.undo.push({delta:n,range:r}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change(`redo`,`undo`)}transform(e){WE(this.stack.undo,e),WE(this.stack.redo,e)}undo(){this.change(`undo`,`redo`)}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,$.sources.USER);else{let t=KE(this.quill.scroll,e.delta);this.quill.setSelection(t,$.sources.USER)}}};function WE(e,t){let n=t;for(let t=e.length-1;t>=0;--t){let r=e[t];e[t]={delta:n.transform(r.delta,!0),range:r.range&&qE(r.range,n)},n=r.delta.transform(n),e[t].delta.length()===0&&e.splice(t,1)}}function GE(e,t){let n=t.ops[t.ops.length-1];return n==null?!1:n.insert==null?n.attributes==null?!1:Object.keys(n.attributes).some(t=>e.query(t,zC.BLOCK)!=null):typeof n.insert==`string`&&n.insert.endsWith(`
|
||||
`)}function KE(e,t){let n=t.reduce((e,t)=>e+(t.delete||0),0),r=t.length()-n;return GE(e,t)&&--r,r}function qE(e,t){if(!e)return e;let n=t.transformPosition(e.index);return{index:n,length:t.transformPosition(e.index+e.length)-n}}var JE=class extends tT{constructor(e,t){super(e,t),e.root.addEventListener(`drop`,t=>{t.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(t.clientX,t.clientY);else if(document.caretPositionFromPoint){let e=document.caretPositionFromPoint(t.clientX,t.clientY);n=document.createRange(),n.setStart(e.offsetNode,e.offset),n.setEnd(e.offsetNode,e.offset)}let r=n&&e.selection.normalizeNative(n);if(r){let n=e.selection.normalizedToRange(r);t.dataTransfer?.files&&this.upload(n,t.dataTransfer.files)}})}upload(e,t){let n=[];Array.from(t).forEach(e=>{e&&this.options.mimetypes?.includes(e.type)&&n.push(e)}),n.length>0&&this.options.handler.call(this,e,n)}};JE.DEFAULTS={mimetypes:[`image/png`,`image/jpeg`],handler(e,t){if(!this.quill.scroll.query(`image`))return;let n=t.map(e=>new Promise(t=>{let n=new FileReader;n.onload=()=>{t(n.result)},n.readAsDataURL(e)}));Promise.all(n).then(t=>{let n=t.reduce((e,t)=>e.insert({image:t}),new Q.default().retain(e.index).delete(e.length));this.quill.updateContents(n,Vw.sources.USER),this.quill.setSelection(e.index+t.length,Vw.sources.SILENT)})}};var YE=[`insertText`,`insertReplacementText`],XE=class extends tT{constructor(e,t){super(e,t),e.root.addEventListener(`beforeinput`,e=>{this.handleBeforeInput(e)}),/Android/i.test(navigator.userAgent)||e.on($.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){rE({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``;if(e.length===0)return!1;if(t){let n=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new Q.default().retain(e.index).insert(t,n),$.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,$.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!YE.includes(e.inputType))return;let t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;let n=ZE(e);if(n==null)return;let r=this.quill.selection.normalizeNative(t),i=r?this.quill.selection.normalizedToRange(r):null;i&&this.replaceText(i,n)&&e.preventDefault()}handleCompositionStart(){let e=this.quill.getSelection();e&&this.replaceText(e)}};function ZE(e){return typeof e.data==`string`?e.data:e.dataTransfer?.types.includes(`text/plain`)?e.dataTransfer.getData(`text/plain`):null}var QE=/Mac/i.test(navigator.platform),$E=e=>!!(e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Home`||QE&&e.key===`a`&&e.ctrlKey===!0),eD=class extends tT{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:[`ArrowLeft`,`ArrowRight`],offset:0,shiftKey:null,handler(e,t){let{line:n,event:r}=t;if(!(n instanceof nw)||!n.uiNode)return!0;let i=getComputedStyle(n.domNode).direction===`rtl`;return i&&r.key!==`ArrowRight`||!i&&r.key!==`ArrowLeft`?!0:(this.quill.setSelection(e.index-1,e.length+ +!!r.shiftKey,$.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener(`keydown`,e=>{!e.defaultPrevented&&$E(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){this.selectionChangeDeadline=Date.now()+100,!this.isListening&&(this.isListening=!0,document.addEventListener(`selectionchange`,()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()},{once:!0}))}handleSelectionChange(){let e=document.getSelection();if(!e)return;let t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;let n=this.quill.scroll.find(t.startContainer);if(!(n instanceof nw)||!n.uiNode)return;let r=document.createRange();r.setStartAfter(n.uiNode),r.setEndAfter(n.uiNode),e.removeAllRanges(),e.addRange(r)}};$.register({"blots/block":kw,"blots/block/embed":Aw,"blots/break":Cw,"blots/container":CT,"blots/cursor":Nw,"blots/embed":rT,"blots/inline":Dw,"blots/scroll":ET,"blots/text":ww,"modules/clipboard":CE,"modules/history":UE,"modules/keyboard":ZT,"modules/uploader":JE,"modules/input":XE,"modules/uiNode":eD});var tD=$,nD=new class extends GC{add(e,t){let n=0;if(t===`+1`||t===`-1`){let r=this.value(e)||0;n=t===`+1`?r+1:r-1}else typeof t==`number`&&(n=t);return n===0?(this.remove(e),!0):super.add(e,n.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}(`indent`,`ql-indent`,{scope:zC.BLOCK,whitelist:[1,2,3,4,5,6,7,8]}),rD=class extends kw{static blotName=`blockquote`;static tagName=`blockquote`},iD=class extends kw{static blotName=`header`;static tagName=[`H1`,`H2`,`H3`,`H4`,`H5`,`H6`];static formats(e){return this.tagName.indexOf(e.tagName)+
Line truncated
|
||||
`)}\n`,r=xD.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==n){if(n.trim().length>0||this.cachedText==null){let t=this.children.reduce((e,t)=>e.concat(jw(t,!1)),new Q.default),i=e(n,r);t.diff(i).reduce((e,t)=>{let{retain:n,attributes:r}=t;return n?(r&&Object.keys(r).forEach(t=>{[xD.blotName,bD.blotName].includes(t)&&this.formatAt(e,n,t,r[t])}),e+n):e},0)}this.cachedText=n,this.forceNext=!1}}html(e,t){let[n]=this.children.find(e);return`<pre data-language="${n?xD.formats(n.domNode):`plain`}">\n${Ew(this.code(e,t))}\n</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){let e=xD.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}};SD.allowedChildren=[xD],xD.requiredContainer=SD,xD.allowedChildren=[bD,Nw,ww,Cw];var CD=(e,t,n)=>{if(typeof e.versionString==`string`){let r=e.versionString.split(`.`)[0];if(parseInt(r,10)>=11)return e.highlight(n,{language:t}).value}return e.highlight(t,n).value},wD=class extends tT{static register(){$.register(bD,!0),$.register(xD,!0),$.register(SD,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw Error(`Syntax module requires highlight.js. Please include the library on the page before Quill.`);this.languages=this.options.languages.reduce((e,t)=>{let{key:n}=t;return e[n]=!0,e},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on($.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof SD))return;let t=this.quill.root.ownerDocument.createElement(`select`);this.options.languages.forEach(e=>{let{key:n,label:r}=e,i=t.ownerDocument.createElement(`option`);i.textContent=r,i.setAttribute(`value`,n),t.appendChild(i)}),t.addEventListener(`change`,()=>{e.format(xD.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode??(e.attachUI(t),e.children.head&&(t.value=xD.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on($.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update($.sources.USER);let n=this.quill.getSelection();(e==null?this.quill.scroll.descendants(SD):[e]).forEach(e=>{e.highlight(this.highlightBlot,t)}),this.quill.update($.sources.SILENT),n!=null&&this.quill.setSelection(n,$.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`plain`;if(t=this.languages[t]?t:`plain`,t===`plain`)return Ew(e).split(`
|
||||
`).reduce((e,n,r)=>(r!==0&&e.insert(`
|
||||
`,{[RT.blotName]:t}),e.insert(n)),new Q.default);let n=this.quill.root.ownerDocument.createElement(`div`);return n.classList.add(RT.className),n.innerHTML=CD(this.options.hljs,t,e),AE(this.quill.scroll,n,[(e,t)=>{let n=yD.value(e);return n?t.compose(new Q.default().retain(t.length(),{[bD.blotName]:n})):t}],[(e,n)=>e.data.split(`
|
||||
`).reduce((e,n,r)=>(r!==0&&e.insert(`
|
||||
`,{[RT.blotName]:t}),e.insert(n)),n)],new WeakMap)}};wD.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:`plain`,label:`Plain`},{key:`bash`,label:`Bash`},{key:`cpp`,label:`C++`},{key:`cs`,label:`C#`},{key:`css`,label:`CSS`},{key:`diff`,label:`Diff`},{key:`xml`,label:`HTML/XML`},{key:`java`,label:`Java`},{key:`javascript`,label:`JavaScript`},{key:`markdown`,label:`Markdown`},{key:`php`,label:`PHP`},{key:`python`,label:`Python`},{key:`ruby`,label:`Ruby`},{key:`sql`,label:`SQL`}]};var TD=class e extends kw{static blotName=`table`;static tagName=`TD`;static create(e){let t=super.create();return e?t.setAttribute(`data-row`,e):t.setAttribute(`data-row`,kD()),t}static formats(e){if(e.hasAttribute(`data-row`))return e.getAttribute(`data-row`)}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,n){t===e.blotName&&n?this.domNode.setAttribute(`data-row`,n):super.format(t,n)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}},ED=class extends CT{static blotName=`table-row`;static tagName=`TR`;checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){let e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===r.table}return!1}optimize(e){super.optimize(e),this.children.forEach(e=>{if(e.next==null)return;let t=e.formats(),n=e.next.formats();if(t.table!==n.table){let t=this.splitAfter(e);t&&t.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}},DD=class extends CT{static blotName=`table-body`;static tagName=`TBODY`},OD=class extends CT{static blotName=`table-container`;static tagName=`TABLE`;balanceCells(){let e=this.descendants(ED),t=e.reduce((e,t)=>Math.max(t.children.length,e),0);e.forEach(e=>{Array(t-e.children.length).fill(0).forEach(()=>{let t;e.children.head!=null&&(t=TD.formats(e.children.head.domNode));let n=this.scroll.create(TD.blotName,t);e.appendChild(n),n.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){let[t]=this.descendant(DD);t==null||t.children.head==null||t.children.forEach(t=>{t.children.at(e)?.remove()})}insertColumn(e){let[t]=this.descendant(DD);t==null||t.children.head==null||t.children.forEach(t=>{let n=t.children.at(e),r=TD.formats(t.children.head.domNode),i=this.scroll.create(TD.blotName,r);t.insertBefore(i,n)})}insertRow(e){let[t]=this.descendant(DD);if(t==null||t.children.head==null)return;let n=kD(),r=this.scroll.create(ED.blotName);t.children.head.children.forEach(()=>{let e=this.scroll.create(TD.blotName,n);r.appendChild(e)});let i=t.children.at(e);t.insertBefore(r,i)}rows(){let e=this.children.head;return e==null?[]:e.children.map(e=>e)}};OD.allowedChildren=[DD],DD.requiredContainer=OD,DD.allowedChildren=[ED],ED.requiredContainer=DD,ED.allowedChildren=[TD],TD.requiredContainer=ED;function kD(){return`row-${Math.random().toString(36).slice(2,6)}`}var AD=class extends tT{static register(){$.register(TD),$.register(ED),$.register(DD),$.register(OD)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(OD).forEach(e=>{e.balanceCells()})}deleteColumn(){let[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update($.sources.USER))}deleteRow(){let[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update($.sources.USER))}deleteTable(){let[e]=this.getTable();if(e==null)return;let t=e.offset();e.remove(),this.quill.update($.sources.USER),this.quill.setSelection(t,$.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];let[t,n]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==TD.blotName)return[null,null,null,-1];let r=t.parent;return[r.parent.parent,r,t,n]}insertColumn(e){let t=this.quill.getSelection();if(!t)return;let[n,r,i]=this.getTable(t);if(i==null)return;let a=i.cellOffset();n.insertColumn(a+e),this.quill.update($.sources.USER);let o=r.rowOffset();e===0&&(o+=1),this.quill.setSelection(t.index+o,t.length,$.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){let t=this.quill.getSelection();if(!t)return;let[n,r,i]=this.getTable(t);if(i==null)return;let a=r.rowOffset();n.insertRow(a+e),this.quill.update($.sources.USER),e>0?this.quill.setSelection(t,$.sources.SILENT):this.quill.setSelection(t.index+r.children.length,t.length,$.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){let n=this.quill.getSelection();if(n==null)return;let r=Array(e).fill(0).reduce(e=>{let n=Array(t).fill(`
|
||||
`).join(``);return e.insert(n,{table:kD()})},new Q.default().retain(n.index));this.quill.updateContents(r,$.sources.USER),this.quill.setSelection(n.index,$.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on($.events.SCROLL_OPTIMIZE,e=>{e.some(e=>[`TD`,`TR`,`TBODY`,`TABLE`].includes(e.target.tagName)?(this.quill.once($.events.TEXT_CHANGE,(e,t,n)=>{n===$.sources.USER&&this.balanceTables()}),!0):!1)})}},jD=zw(`quill:toolbar`),MD=class extends tT{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){let t=document.createElement(`div`);t.setAttribute(`role`,`toolbar`),PD(t,this.options.container),e.container?.parentNode?.insertBefore(t,e.container),this.container=t}else typeof this.options.container==`string`?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){jD.error(`Container required for toolbar`,this.options);return}this.container.classList.add(`ql-toolbar`),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(e=>{let t=this.options.handlers?.[e];t&&this.addHandler(e,t)}),Array.from(this.container.querySelectorAll(`button, select`)).forEach(e=>{this.attach(e)}),this.quill.on($.events.EDITOR_CHANGE,()=>{let[e]=this.quill.selection.getRange();this.update(e)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(e=>e.indexOf(`ql-`)===0);if(!t)return;if(t=t.slice(3),e.tagName===`BUTTON`&&e.setAttribute(`type`,`button`),this.handlers[t]==null&&this.quill.scroll.query(t)==null){jD.warn(`ignoring attaching to nonexistent format`,t,e);return}let n=e.tagName===`SELECT`?`change`:`click`;e.addEventListener(n,n=>{let r;if(e.tagName===`SELECT`){if(e.selectedIndex<0)return;let t=e.options[e.selectedIndex];r=t.hasAttribute(`selected`)?!1:t.value||!1}else r=e.classList.contains(`ql-active`)?!1:e.value||!e.hasAttribute(`value`),n.preventDefault();this.quill.focus();let[i]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,r);else if(this.quill.scroll.query(t).prototype instanceof uw){if(r=prompt(`Enter ${t}`),!r)return;this.quill.updateContents(new Q.default().retain(i.index).delete(i.length).insert({[t]:r}),$.sources.USER)}else this.quill.format(t,r,$.sources.USER);this.update(i)}),this.controls.push([t,e])}update(e){let t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(n=>{let[r,i]=n;if(i.tagName===`SELECT`){let n=null;if(e==null)n=null;else if(t[r]==null)n=i.querySelector(`option[selected]`);else if(!Array.isArray(t[r])){let e=t[r];typeof e==`string`&&(e=e.replace(/"/g,`\\"`)),n=i.querySelector(`option[value="${e}"]`)}n==null?(i.value=``,i.selectedIndex=-1):n.selected=!0}else if(e==null)i.classList.remove(`ql-active`),i.setAttribute(`aria-pressed`,`false`);else if(i.hasAttribute(`value`)){let e=t[r],n=e===i.getAttribute(`value`)||e!=null&&e.toString()===i.getAttribute(`value`)||e==null&&!i.getAttribute(`value`);i.classList.toggle(`ql-active`,n),i.setAttribute(`aria-pressed`,n.toString())}else{let e=t[r]!=null;i.classList.toggle(`ql-active`,e),i.setAttribute(`aria-pressed`,e.toString())}})}};MD.DEFAULTS={};function ND(e,t,n){let r=document.createElement(`button`);r.setAttribute(`type`,`button`),r.classList.add(`ql-${t}`),r.setAttribute(`aria-pressed`,`false`),n==null?r.setAttribute(`aria-label`,t):(r.value=n,r.setAttribute(`aria-label`,`${t}: ${n}`)),e.appendChild(r)}function PD(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(t=>{let n=document.createElement(`span`);n.classList.add(`ql-formats`),t.forEach(e=>{if(typeof e==`string`)ND(n,e);else{let t=Object.keys(e)[0],r=e[t];Array.isArray(r)?FD(n,t,r):ND(n,t,r)}}),e.appendChild(n)})}function FD(e,t,n){let r=document.createElement(`select`);r.classList.add(`ql-${t}`),n.forEach(e=>{let t=document.createElement(`option`);e===!1?t.setAttribute(`selected`,`selected`):t.setAttribute(`value`,String(e)),r.appendChild(t)}),e.appendChild(r)}MD.DEFAULTS={container:null,handlers:{clean(){let e=this.quill.getSelection();if(e!=null)if(e.length===0){let e=this.quill.getFormat();Object.keys(e).forEach(e=>{this.quill.scroll.query(e,zC.INLINE)!=null&&this.quill.format(e,!1,$.sources.USER)})}else this.quill.removeFormat(e.index,e.length,$.sources.USER)},direction(e){let{align:t}=this.quill.getFormat();e===`rtl`&&t==null?this.quill.format(`align`,`right`,$.sources.USER):!e&&t===`right`&&this.quill.format(`align`,!1,$.sources.USER),this.quill.format(`direction`,e,$.sources.USER)},indent(e){let t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0,10);if(e===`+1`||e===`-1`){let t=e===`+1`?1:-1;n.direction===`rtl`&&(t*=-1),this.quill.format(`indent`,r+t,$.sources.USER)}},link(e){e===!0&&(e=prompt(`Enter link URL:`)),this.quill.format(`link`,e,$.sources.USER)},list(e){let t=this.quill.getSelection(),n=this.quill.getFormat(t);e===`check`?n.list===`checked`||n.list===`unchecked`?this.quill.format(`list`,!1,$.sources.USER):this.quill.fo
Line truncated
|
||||
<div class="relative flex items-center justify-center">
|
||||
<div class="absolute w-8 h-8 bg-blue-400 rounded-full opacity-35 animate-ping"></div>
|
||||
<div class="w-5 h-5 bg-blue-600 rounded-full border-2 border-white shadow-xl flex items-center justify-center z-10"></div>
|
||||
</div>
|
||||
`,iconSize:[32,32],iconAnchor:[16,16]})},[]);return l?(0,Y.jsxs)(`div`,{className:`min-h-screen flex flex-col items-center justify-center bg-slate-50 dark:bg-slate-950 text-slate-800 dark:text-slate-100 transition-colors`,children:[(0,Y.jsx)(K,{className:`w-12 h-12 text-rose-500 animate-spin mb-4`}),(0,Y.jsx)(`p`,{className:`font-bold text-sm`,children:n(`loading`)})]}):d||!s?(0,Y.jsx)(`div`,{className:`min-h-screen flex flex-col items-center justify-center bg-slate-50 dark:bg-slate-950 text-slate-800 dark:text-slate-100 p-4 transition-colors`,children:(0,Y.jsxs)(`div`,{className:`bg-white dark:bg-slate-900 border border-gray-100 dark:border-slate-800 shadow-2xl rounded-[32px] p-8 max-w-md w-full text-center flex flex-col items-center gap-5`,children:[(0,Y.jsx)(`div`,{className:`w-16 h-16 bg-rose-50 dark:bg-rose-950/20 border border-rose-100 dark:border-rose-900/30 rounded-full flex items-center justify-center text-rose-500`,children:(0,Y.jsx)(q,{className:`w-8 h-8`})}),(0,Y.jsx)(`h2`,{className:`text-xl font-black tracking-tight`,children:n(`error`)}),(0,Y.jsx)(`p`,{className:`text-sm text-slate-500 dark:text-slate-400 leading-relaxed`,children:n(`linkExpired`)}),(0,Y.jsx)(`button`,{onClick:t,className:`w-full bg-slate-900 dark:bg-slate-100 hover:bg-slate-800 dark:hover:bg-white text-white dark:text-slate-900 font-bold py-3 px-6 rounded-2xl transition-all active:scale-95 text-sm`,children:n(`appName`)})]})}):(0,Y.jsxs)(`div`,{className:`h-screen w-screen flex flex-col bg-slate-50 dark:bg-slate-950 text-slate-800 dark:text-slate-100 transition-colors overflow-hidden`,children:[(0,Y.jsxs)(`header`,{className:`h-16 shrink-0 bg-white/70 dark:bg-slate-900/70 backdrop-blur-md border-b border-gray-100 dark:border-slate-800 px-4 md:px-6 flex items-center justify-between z-20`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`button`,{onClick:t,className:`p-2 hover:bg-gray-100 dark:hover:bg-slate-800 rounded-xl transition-all active:scale-95 text-slate-500 dark:text-slate-400`,children:(0,Y.jsx)(B,{className:`w-5 h-5`})}),(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`w-2.5 h-2.5 bg-rose-500 rounded-full animate-pulse`}),(0,Y.jsx)(`h1`,{className:`text-sm md:text-base font-black uppercase tracking-tight`,children:n(`emergencyJourney`)})]}),(0,Y.jsx)(`p`,{className:`text-[10px] text-slate-500 dark:text-slate-400 truncate max-w-[200px] sm:max-w-xs`,children:s.title})]})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 md:gap-3`,children:[(0,Y.jsxs)(`select`,{value:r,onChange:e=>i(e.target.value),className:`bg-gray-50 dark:bg-slate-800 border border-gray-100 dark:border-slate-700 text-slate-800 dark:text-slate-100 rounded-xl px-2 py-1.5 text-xs font-bold focus:outline-none cursor-pointer`,children:[(0,Y.jsx)(`option`,{value:`vi`,children:`VI`}),(0,Y.jsx)(`option`,{value:`en`,children:`EN`}),(0,Y.jsx)(`option`,{value:`zh`,children:`ZH`})]}),(0,Y.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),className:`bg-gray-50 dark:bg-slate-800 border border-gray-100 dark:border-slate-700 text-slate-800 dark:text-slate-100 rounded-xl px-2 py-1.5 text-xs font-bold focus:outline-none cursor-pointer`,children:[(0,Y.jsx)(`option`,{value:`light`,children:n(`themeLight`)}),(0,Y.jsx)(`option`,{value:`dark`,children:n(`themeDark`)}),(0,Y.jsx)(`option`,{value:`system`,children:n(`themeSystem`)})]})]})]}),(0,Y.jsxs)(`div`,{className:`lg:hidden h-12 shrink-0 bg-white dark:bg-slate-900 border-b border-gray-100 dark:border-slate-800 flex items-center z-10 p-1`,children:[(0,Y.jsxs)(`button`,{onClick:()=>v(`map`),className:`flex-1 h-full flex items-center justify-center gap-2 text-xs font-bold rounded-lg transition-all ${_===`map`?`bg-rose-500 text-white shadow-md`:`text-slate-500 dark:text-slate-400`}`,children:[(0,Y.jsx)(_e,{className:`w-4 h-4`}),n(`viewMap`)]}),(0,Y.jsxs)(`button`,{onClick:()=>v(`itinerary`),className:`flex-1 h-full flex items-center justify-center gap-2 text-xs font-bold rounded-lg transition-all ${_===`itinerary`?`bg-rose-500 text-white shadow-md`:`text-slate-500 dark:text-slate-400`}`,children:[(0,Y.jsx)(ue,{className:`w-4 h-4`}),n(`viewTimeline`)]})]}),(0,Y.jsxs)(`div`,{className:`flex-1 flex flex-col lg:grid lg:grid-cols-12 overflow-hidden`,children:[(0,Y.jsx)(`div`,{className:`flex-col lg:col-span-4 bg-white dark:bg-slate-900 border-r border-gray-100 dark:border-slate-800 overflow-y-auto no-scrollbar ${_===`itinerary`?`flex h-full`:`hidden lg:flex`}`,children:(0,Y.jsxs)(`div`,{className:`p-4 md:p-6 space-y-6`,children:[(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(`h2`,{className:`text-lg md:text-xl font-black text-slate-900 dark:text-white leading-tight`,children:s.title}),s.startDate&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-slate-500 dark:text-slate-400`,children:[(0,Y.jsx)(N,{className:`w-4 h-4 text-rose-500`}),(0,Y.jsxs)(`sLine truncated
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
||||
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:""}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-orange-50:oklch(98% .016 73.684);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-900:oklch(41.4% .112 45.904);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-emerald-800:oklch(43.2% .095 166.913);--color-emerald-900:oklch(37.8% .077 168.94);--color-emerald-950:oklch(26.2% .051 172.552);--color-teal-50:oklch(98.4% .014 180.72);--color-teal-600:oklch(60% .118 184.704);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-blue-950:oklch(28.2% .091 267.935);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-indigo-800:oklch(39.8% .195 277.366);--color-indigo-900:oklch(35.9% .144 278.697);--color-indigo-950:oklch(25.7% .09 281.288);--color-violet-500:oklch(60.6% .25 292.717);--color-violet-600:oklch(54.1% .281 293.009);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-600:oklchLine truncated
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import{n as e,r as t,t as n}from"./index-FtyTkPzF.js";var r=e(((e,t)=>{var n=function(e){return e&&e.Math===Math&&e};t.exports=n(typeof globalThis==`object`&&globalThis)||n(typeof window==`object`&&window)||n(typeof self==`object`&&self)||n(typeof global==`object`&&global)||n(typeof e==`object`&&e)||(function(){return this})()||Function(`return this`)()})),i=e(((e,t)=>{t.exports=function(e){try{return!!e()}catch{return!0}}})),a=e(((e,t)=>{t.exports=!i()(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})})),o=e(((e,t)=>{t.exports=!i()(function(){var e=function(){}.bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)})})),s=e(((e,t)=>{var n=o(),r=Function.prototype.call;t.exports=n?r.bind(r):function(){return r.apply(r,arguments)}})),c=e((e=>{var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor;e.f=n&&!t.call({1:2},1)?function(e){var t=n(this,e);return!!t&&t.enumerable}:t})),l=e(((e,t)=>{t.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}})),u=e(((e,t)=>{var n=o(),r=Function.prototype,i=r.call,a=n&&r.bind.bind(i,i);t.exports=n?a:function(e){return function(){return i.apply(e,arguments)}}})),d=e(((e,t)=>{var n=u(),r=n({}.toString),i=n(``.slice);t.exports=function(e){return i(r(e),8,-1)}})),f=e(((e,t)=>{var n=u(),r=i(),a=d(),o=Object,s=n(``.split);t.exports=r(function(){return!o(`z`).propertyIsEnumerable(0)})?function(e){return a(e)===`String`?s(e,``):o(e)}:o})),p=e(((e,t)=>{t.exports=function(e){return e==null}})),m=e(((e,t)=>{var n=p(),r=TypeError;t.exports=function(e){if(n(e))throw new r(`Can't call method on `+e);return e}})),h=e(((e,t)=>{var n=f(),r=m();t.exports=function(e){return n(r(e))}})),g=e(((e,t)=>{var n=typeof document==`object`&&document.all;t.exports=n===void 0&&n!==void 0?function(e){return typeof e==`function`||e===n}:function(e){return typeof e==`function`}})),_=e(((e,t)=>{var n=g();t.exports=function(e){return typeof e==`object`?e!==null:n(e)}})),v=e(((e,t)=>{var n=r(),i=g(),a=function(e){return i(e)?e:void 0};t.exports=function(e,t){return arguments.length<2?a(n[e]):n[e]&&n[e][t]}})),y=e(((e,t)=>{t.exports=u()({}.isPrototypeOf)})),b=e(((e,t)=>{var n=r().navigator,i=n&&n.userAgent;t.exports=i?String(i):``})),x=e(((e,t)=>{var n=r(),i=b(),a=n.process,o=n.Deno,s=a&&a.versions||o&&o.version,c=s&&s.v8,l,u;c&&(l=c.split(`.`),u=l[0]>0&&l[0]<4?1:+(l[0]+l[1])),!u&&i&&(l=i.match(/Edge\/(\d+)/),(!l||l[1]>=74)&&(l=i.match(/Chrome\/(\d+)/),l&&(u=+l[1]))),t.exports=u})),S=e(((e,t)=>{var n=x(),a=i(),o=r().String;t.exports=!!Object.getOwnPropertySymbols&&!a(function(){var e=Symbol(`symbol detection`);return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})})),C=e(((e,t)=>{t.exports=S()&&!Symbol.sham&&typeof Symbol.iterator==`symbol`})),w=e(((e,t)=>{var n=v(),r=g(),i=y(),a=C(),o=Object;t.exports=a?function(e){return typeof e==`symbol`}:function(e){var t=n(`Symbol`);return r(t)&&i(t.prototype,o(e))}})),T=e(((e,t)=>{var n=String;t.exports=function(e){try{return n(e)}catch{return`Object`}}})),E=e(((e,t)=>{var n=g(),r=T(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+` is not a function`)}})),D=e(((e,t)=>{var n=E(),r=p();t.exports=function(e,t){var i=e[t];return r(i)?void 0:n(i)}})),O=e(((e,t)=>{var n=s(),r=g(),i=_(),a=TypeError;t.exports=function(e,t){var o,s;if(t===`string`&&r(o=e.toString)&&!i(s=n(o,e))||r(o=e.valueOf)&&!i(s=n(o,e))||t!==`string`&&r(o=e.toString)&&!i(s=n(o,e)))return s;throw new a(`Can't convert object to primitive value`)}})),k=e(((e,t)=>{t.exports=!1})),A=e(((e,t)=>{var n=r(),i=Object.defineProperty;t.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch{n[e]=t}return t}})),j=e(((e,t)=>{var n=k(),i=r(),a=A(),o=`__core-js_shared__`,s=t.exports=i[o]||a(o,{});(s.versions||=[]).push({version:`3.49.0`,mode:n?`pure`:`global`,copyright:`© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.`,license:`https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE`,source:`https://github.com/zloirock/core-js`})})),M=e(((e,t)=>{var n=j();t.exports=function(e,t){return n[e]||(n[e]=t||{})}})),N=e(((e,t)=>{var n=m(),r=Object;t.exports=function(e){return r(n(e))}})),P=e(((e,t)=>{var n=u(),r=N(),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return i(r(e),t)}})),F=e(((e,t)=>{var n=u(),r=0,i=Math.random(),a=n(1.1.toString);t.exports=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+a(++r+i,36)}})),I=e(((e,t)=>{var n=r(),i=M(),a=P(),o=F(),s=S(),c=C(),l=n.Symbol,u=i(`wks`),d=c?l.for||l:l&&l.withoutSetter||o;t.exports=function(e){return a(u,e)||(u[e]=s&&a(l,e)?l[e]:d(`Symbol.`+e)),u[e]}})),L=e(((e,t)=>{var n=s(),r=_(),i=w(),a=D(),o=O(),c=I(),l=TypeError,u=c(`toPrimitive`);t.exports=function(e,t){if(!r(e)||i(e))return e;var s=a(e,u),c;if(s){if(t===void 0&&(t=`default`),c=n(s,e,t),!r(c)||i(c))return c;throw new l(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),o(e,t)}}))Line truncated
|
||||
import{n as e,r as t,t as n}from"./index-D6jMbgMg.js";var r=e(((e,t)=>{var n=function(e){return e&&e.Math===Math&&e};t.exports=n(typeof globalThis==`object`&&globalThis)||n(typeof window==`object`&&window)||n(typeof self==`object`&&self)||n(typeof global==`object`&&global)||n(typeof e==`object`&&e)||(function(){return this})()||Function(`return this`)()})),i=e(((e,t)=>{t.exports=function(e){try{return!!e()}catch{return!0}}})),a=e(((e,t)=>{t.exports=!i()(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})})),o=e(((e,t)=>{t.exports=!i()(function(){var e=function(){}.bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)})})),s=e(((e,t)=>{var n=o(),r=Function.prototype.call;t.exports=n?r.bind(r):function(){return r.apply(r,arguments)}})),c=e((e=>{var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor;e.f=n&&!t.call({1:2},1)?function(e){var t=n(this,e);return!!t&&t.enumerable}:t})),l=e(((e,t)=>{t.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}})),u=e(((e,t)=>{var n=o(),r=Function.prototype,i=r.call,a=n&&r.bind.bind(i,i);t.exports=n?a:function(e){return function(){return i.apply(e,arguments)}}})),d=e(((e,t)=>{var n=u(),r=n({}.toString),i=n(``.slice);t.exports=function(e){return i(r(e),8,-1)}})),f=e(((e,t)=>{var n=u(),r=i(),a=d(),o=Object,s=n(``.split);t.exports=r(function(){return!o(`z`).propertyIsEnumerable(0)})?function(e){return a(e)===`String`?s(e,``):o(e)}:o})),p=e(((e,t)=>{t.exports=function(e){return e==null}})),m=e(((e,t)=>{var n=p(),r=TypeError;t.exports=function(e){if(n(e))throw new r(`Can't call method on `+e);return e}})),h=e(((e,t)=>{var n=f(),r=m();t.exports=function(e){return n(r(e))}})),g=e(((e,t)=>{var n=typeof document==`object`&&document.all;t.exports=n===void 0&&n!==void 0?function(e){return typeof e==`function`||e===n}:function(e){return typeof e==`function`}})),_=e(((e,t)=>{var n=g();t.exports=function(e){return typeof e==`object`?e!==null:n(e)}})),v=e(((e,t)=>{var n=r(),i=g(),a=function(e){return i(e)?e:void 0};t.exports=function(e,t){return arguments.length<2?a(n[e]):n[e]&&n[e][t]}})),y=e(((e,t)=>{t.exports=u()({}.isPrototypeOf)})),b=e(((e,t)=>{var n=r().navigator,i=n&&n.userAgent;t.exports=i?String(i):``})),x=e(((e,t)=>{var n=r(),i=b(),a=n.process,o=n.Deno,s=a&&a.versions||o&&o.version,c=s&&s.v8,l,u;c&&(l=c.split(`.`),u=l[0]>0&&l[0]<4?1:+(l[0]+l[1])),!u&&i&&(l=i.match(/Edge\/(\d+)/),(!l||l[1]>=74)&&(l=i.match(/Chrome\/(\d+)/),l&&(u=+l[1]))),t.exports=u})),S=e(((e,t)=>{var n=x(),a=i(),o=r().String;t.exports=!!Object.getOwnPropertySymbols&&!a(function(){var e=Symbol(`symbol detection`);return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})})),C=e(((e,t)=>{t.exports=S()&&!Symbol.sham&&typeof Symbol.iterator==`symbol`})),w=e(((e,t)=>{var n=v(),r=g(),i=y(),a=C(),o=Object;t.exports=a?function(e){return typeof e==`symbol`}:function(e){var t=n(`Symbol`);return r(t)&&i(t.prototype,o(e))}})),T=e(((e,t)=>{var n=String;t.exports=function(e){try{return n(e)}catch{return`Object`}}})),E=e(((e,t)=>{var n=g(),r=T(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+` is not a function`)}})),D=e(((e,t)=>{var n=E(),r=p();t.exports=function(e,t){var i=e[t];return r(i)?void 0:n(i)}})),O=e(((e,t)=>{var n=s(),r=g(),i=_(),a=TypeError;t.exports=function(e,t){var o,s;if(t===`string`&&r(o=e.toString)&&!i(s=n(o,e))||r(o=e.valueOf)&&!i(s=n(o,e))||t!==`string`&&r(o=e.toString)&&!i(s=n(o,e)))return s;throw new a(`Can't convert object to primitive value`)}})),k=e(((e,t)=>{t.exports=!1})),A=e(((e,t)=>{var n=r(),i=Object.defineProperty;t.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch{n[e]=t}return t}})),j=e(((e,t)=>{var n=k(),i=r(),a=A(),o=`__core-js_shared__`,s=t.exports=i[o]||a(o,{});(s.versions||=[]).push({version:`3.49.0`,mode:n?`pure`:`global`,copyright:`© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.`,license:`https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE`,source:`https://github.com/zloirock/core-js`})})),M=e(((e,t)=>{var n=j();t.exports=function(e,t){return n[e]||(n[e]=t||{})}})),N=e(((e,t)=>{var n=m(),r=Object;t.exports=function(e){return r(n(e))}})),P=e(((e,t)=>{var n=u(),r=N(),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return i(r(e),t)}})),F=e(((e,t)=>{var n=u(),r=0,i=Math.random(),a=n(1.1.toString);t.exports=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+a(++r+i,36)}})),I=e(((e,t)=>{var n=r(),i=M(),a=P(),o=F(),s=S(),c=C(),l=n.Symbol,u=i(`wks`),d=c?l.for||l:l&&l.withoutSetter||o;t.exports=function(e){return a(u,e)||(u[e]=s&&a(l,e)?l[e]:d(`Symbol.`+e)),u[e]}})),L=e(((e,t)=>{var n=s(),r=_(),i=w(),a=D(),o=O(),c=I(),l=TypeError,u=c(`toPrimitive`);t.exports=function(e,t){if(!r(e)||i(e))return e;var s=a(e,u),c;if(s){if(t===void 0&&(t=`default`),c=n(s,e,t),!r(c)||i(c))return c;throw new l(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),o(e,t)}}))Line truncated
|
||||
`)&&e.flags===`s`)})})),Dt=e(((e,t)=>{var n=i(),a=r().RegExp;t.exports=n(function(){var e=a(`(?<a>b)`,`g`);return e.exec(`b`).groups.a!==`b`||`b`.replace(e,`$<a>c`)!==`bc`})})),Ot=e(((e,t)=>{var n=s(),r=u(),i=bt(),a=xt(),o=St(),c=M(),l=Tt(),d=ue().get,f=Et(),p=Dt(),m=c(`native-string-replace`,String.prototype.replace),h=RegExp.prototype.exec,g=h,_=r(``.charAt),v=r(``.indexOf),y=r(``.replace),b=r(``.slice),x=(function(){var e=/a/,t=/b*/g;return n(h,e,`a`),n(h,t,`a`),e.lastIndex!==0||t.lastIndex!==0})(),S=o.BROKEN_CARET,C=/()??/.exec(``)[1]!==void 0,w=x||C||S||f||p,T=function(e,t){for(var n=e.groups=l(null),r=0;r<t.length;r++){var i=t[r];n[i[0]]=e[i[1]]}};w&&(g=function(e){var t=this,r=d(t),o=i(e),s=r.raw,c,l,u;if(s)return s.lastIndex=t.lastIndex,c=n(g,s,o),t.lastIndex=s.lastIndex,c&&r.groups&&T(c,r.groups),c;var f=r.groups,p=S&&t.sticky,w=n(a,t),E=t.source,D=0,O=o;if(p){w=y(w,`y`,``),v(w,`g`)===-1&&(w+=`g`),O=b(o,t.lastIndex);var k=t.lastIndex>0&&_(o,t.lastIndex-1);t.lastIndex>0&&(!t.multiline||t.multiline&&k!==`
|
||||
`&&k!==`\r`&&k!==`\u2028`&&k!==`\u2029`)&&(E=`(?: (?:`+E+`))`,O=` `+O,D++),l=RegExp(`^(?:`+E+`)`,w)}C&&(l=RegExp(`^`+E+`$(?!\\s)`,w)),x&&(u=t.lastIndex);var A=n(h,p?l:t,O);return p?A?(A.input=o,A[0]=b(A[0],D),A.index=t.lastIndex,t.lastIndex+=A[0].length):t.lastIndex=0:x&&A&&(t.lastIndex=t.global?A.index+A[0].length:u),C&&A&&A.length>1&&n(m,A[0],l,function(){for(var e=1;e<arguments.length-2;e++)arguments[e]===void 0&&(A[e]=void 0)}),A&&f&&T(A,f),A}),t.exports=g})),kt=e((()=>{var e=U(),t=Ot();e({target:`RegExp`,proto:!0,forced:/./.exec!==t},{exec:t})})),At=e(((e,t)=>{kt();var n=s(),r=fe(),a=Ot(),o=i(),c=I(),l=ie(),u=c(`species`),d=RegExp.prototype;t.exports=function(e,t,i,s){var f=c(e),p=!o(function(){var t={};return t[f]=function(){return 7},``[e](t)!==7}),m=p&&!o(function(){var t=!1,n=/a/;if(e===`split`){var r={};r[u]=function(){return n},n={constructor:r,flags:``},n[f]=/./[f]}return n.exec=function(){return t=!0,null},n[f](``),!t});if(!p||!m||i){var h=/./[f],g=t(f,``[e],function(e,t,r,i,o){var s=t.exec;return s===a||s===d.exec?p&&!o?{done:!0,value:n(h,t,r,i)}:{done:!0,value:n(e,r,t,i)}:{done:!1}});r(String.prototype,e,g[0]),r(d,f,g[1])}s&&l(d[f],`sham`,!0)}})),jt=e(((e,t)=>{var n=u(),r=me(),i=bt(),a=m(),o=n(``.charAt),s=n(``.charCodeAt),c=n(``.slice),l=function(e){return function(t,n){var l=i(a(t)),u=r(n),d=l.length,f,p;return u<0||u>=d?e?``:void 0:(f=s(l,u),f<55296||f>56319||u+1===d||(p=s(l,u+1))<56320||p>57343?e?o(l,u):f:e?c(l,u,u+2):(f-55296<<10)+(p-56320)+65536)}};t.exports={codeAt:l(!1),charAt:l(!0)}})),Mt=e(((e,t)=>{var n=jt().charAt;t.exports=function(e,t,r){return t+(r&&n(e,t).length||1)}})),Nt=e(((e,t)=>{var n=r(),a=i(),o=n.RegExp;t.exports={correct:!a(function(){var e=!0;try{o(`.`,`d`)}catch{e=!1}var t={},n=``,r=e?`dgimsy`:`gimsy`,i=function(e,r){Object.defineProperty(t,e,{get:function(){return n+=r,!0}})},a={dotAll:`s`,global:`g`,ignoreCase:`i`,multiline:`m`,sticky:`y`};for(var s in e&&(a.hasIndices=`d`),a)i(s,a[s]);return Object.getOwnPropertyDescriptor(o.prototype,`flags`).get.call(t)!==r||n!==r})}})),Pt=e(((e,t)=>{var n=s(),r=P(),i=y(),a=Nt(),o=xt(),c=RegExp.prototype;t.exports=a.correct?function(e){return e.flags}:function(e){return!a.correct&&i(c,e)&&!r(e,`flags`)?n(o,e):e.flags}})),Ft=e(((e,t)=>{var n=s(),r=B(),i=g(),a=d(),o=Ot(),c=TypeError;t.exports=function(e,t){var s=e.exec;if(i(s)){var l=n(s,e,t);return l!==null&&r(l),l}if(a(e)===`RegExp`)return n(o,e,t);throw new c(`RegExp#exec called on incompatible receiver`)}})),It=e((()=>{var e=s(),t=u(),n=At(),r=B(),i=_(),a=V(),o=bt(),c=m(),l=D(),d=Mt(),f=Pt(),p=Ft(),h=t(``.indexOf);n(`match`,function(t,n,s){return[function(n){var r=c(this),a=i(n)?l(n,t):void 0;return a?e(a,n,r):new RegExp(n)[t](o(r))},function(e){var t=r(this),i=o(e),c=s(n,t,i);if(c.done)return c.value;var l=o(f(t));if(!~h(l,`g`))return p(t,i);var u=!!~h(l,`u`)||!!~h(l,`v`);t.lastIndex=0;for(var m=[],g=0,_;(_=p(t,i))!==null;){var v=o(_[0]);m[g]=v,v===``&&(t.lastIndex=d(i,a(t.lastIndex),u)),g++}return g===0?null:m}]})})),Lt=e(((e,t)=>{var n=u(),r=N(),i=Math.floor,a=n(``.charAt),o=n(``.replace),s=n(``.slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(e,t,n,u,d,f){var p=n+e.length,m=u.length,h=l;return d!==void 0&&(d=r(d),h=c),o(f,h,function(r,o){var c;switch(a(o,0)){case`$`:return`$`;case`&`:return e;case"`":return s(t,0,n);case`'`:return s(t,p);case`<`:c=d[s(o,1,-1)];break;default:var l=+o;if(l===0)return r;if(l>m){var f=i(l/10);return f===0?r:f<=m?u[f-1]===void 0?a(o,1):u[f-1]+a(o,1):r}c=u[l-1]}return c===void 0?``:c})}})),Rt=e((()=>{var e=ze(),t=s(),n=u(),r=At(),a=i(),o=B(),c=g(),l=_(),d=me(),f=V(),p=bt(),h=m(),v=Mt(),y=D(),b=Lt(),x=Pt(),S=Ft(),C=I()(`replace`),w=Math.max,T=Math.min,E=n([].concat),O=n([].push),k=n(``.indexOf),A=n(``.slice),j=function(e){return e===void 0?e:String(e)},M=(function(){return`a`.replace(/./,`$0`)===`$0`})(),N=(function(){return/./[C]?/./[C](`a`,`$0`)===``:!1})();r(`replace`,function(n,r,i){var a=N?`$`:`$0`;return[function(e,n){var i=h(this),a=l(e)?y(e,C):void 0;return a?t(a,e,i,n):t(r,p(i),e,n)},function(t,n){var s=o(this),l=p(t),u=c(n);u||(n=p(n));var m=p(x(s));if(typeof n==`string`&&!~k(n,a)&&!~k(n,`$<`)&&!~k(m,`y`)){var h=i(r,s,l,n);if(h.done)return h.value}var g=!!~k(m,`g`),_;g&&(_=!!~k(m,`u`)||!!~k(m,`v`),s.lastIndex=0);for(var y=[],C;C=S(s,l),!(C===null||(O(y,C),!g));)p(C[0])===``&&(s.lastIndex=v(l,f(s.lastIndex),_));for(var D=``,M=0,N=0;N<y.length;N++){C=y[N];for(var P=p(C[0]),F=w(T(d(C.index),l.length),0),I=[],L,R=1;R<C.length;R++)O(I,j(C[R]));var z=C.groups;if(u){var ee=E([P],I,F,l);z!==void 0&&O(ee,z),L=p(e(n,void 0,ee))}else L=b(P,l,F,I,z,n);F>=M&&(D+=A(l,M,F)+L,M=F+P.length)}return D+A(l,M)}]},!!a(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:`7`},e},``.replace(e,`$<a>`)!==`7`})||!M||N)})),zt=e(((e,t)=>{var n=_(),r=d(),i=I()(`match`);t.exports=function(e){var t;return n(e)&&((t=e[i])===void 0?r(e)===`RegExp`:!!t)}})),Bt=e(((e,t)=>{var n=zt(),r=TypeError;t.exports=function(e){iLine truncated
|
||||
\v\f\r \xA0 \u2028\u2029`})),fn=e(((e,t)=>{var n=u(),r=m(),i=bt(),a=dn(),o=n(``.replace),s=RegExp(`^[`+a+`]+`),c=RegExp(`(^|[^`+a+`])[`+a+`]+$`),l=function(e){return function(t){var n=i(r(t));return e&1&&(n=o(n,s,``)),e&2&&(n=o(n,c,`$1`)),n}};t.exports={start:l(1),end:l(2),trim:l(3)}})),pn=e(((e,t)=>{var n=ae().PROPER,r=i(),a=dn(),o=`
`;t.exports=function(e){return r(function(){return!!a[e]()||o[e]()!==o||n&&a[e].name!==e})}})),mn=e((()=>{var e=U(),t=fn().trim;e({target:`String`,proto:!0,forced:pn()(`trim`)},{trim:function(){return t(this)}})})),hn=e(((e,t)=>{t.exports=function(e){this.ok=!1,this.alpha=1,e.charAt(0)==`#`&&(e=e.substr(1,6)),e=e.replace(/ /g,``),e=e.toLowerCase();var t={aliceblue:`f0f8ff`,antiquewhite:`faebd7`,aqua:`00ffff`,aquamarine:`7fffd4`,azure:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`000000`,blanchedalmond:`ffebcd`,blue:`0000ff`,blueviolet:`8a2be2`,brown:`a52a2a`,burlywood:`deb887`,cadetblue:`5f9ea0`,chartreuse:`7fff00`,chocolate:`d2691e`,coral:`ff7f50`,cornflowerblue:`6495ed`,cornsilk:`fff8dc`,crimson:`dc143c`,cyan:`00ffff`,darkblue:`00008b`,darkcyan:`008b8b`,darkgoldenrod:`b8860b`,darkgray:`a9a9a9`,darkgreen:`006400`,darkkhaki:`bdb76b`,darkmagenta:`8b008b`,darkolivegreen:`556b2f`,darkorange:`ff8c00`,darkorchid:`9932cc`,darkred:`8b0000`,darksalmon:`e9967a`,darkseagreen:`8fbc8f`,darkslateblue:`483d8b`,darkslategray:`2f4f4f`,darkturquoise:`00ced1`,darkviolet:`9400d3`,deeppink:`ff1493`,deepskyblue:`00bfff`,dimgray:`696969`,dodgerblue:`1e90ff`,feldspar:`d19275`,firebrick:`b22222`,floralwhite:`fffaf0`,forestgreen:`228b22`,fuchsia:`ff00ff`,gainsboro:`dcdcdc`,ghostwhite:`f8f8ff`,gold:`ffd700`,goldenrod:`daa520`,gray:`808080`,green:`008000`,greenyellow:`adff2f`,honeydew:`f0fff0`,hotpink:`ff69b4`,indianred:`cd5c5c`,indigo:`4b0082`,ivory:`fffff0`,khaki:`f0e68c`,lavender:`e6e6fa`,lavenderblush:`fff0f5`,lawngreen:`7cfc00`,lemonchiffon:`fffacd`,lightblue:`add8e6`,lightcoral:`f08080`,lightcyan:`e0ffff`,lightgoldenrodyellow:`fafad2`,lightgrey:`d3d3d3`,lightgreen:`90ee90`,lightpink:`ffb6c1`,lightsalmon:`ffa07a`,lightseagreen:`20b2aa`,lightskyblue:`87cefa`,lightslateblue:`8470ff`,lightslategray:`778899`,lightsteelblue:`b0c4de`,lightyellow:`ffffe0`,lime:`00ff00`,limegreen:`32cd32`,linen:`faf0e6`,magenta:`ff00ff`,maroon:`800000`,mediumaquamarine:`66cdaa`,mediumblue:`0000cd`,mediumorchid:`ba55d3`,mediumpurple:`9370d8`,mediumseagreen:`3cb371`,mediumslateblue:`7b68ee`,mediumspringgreen:`00fa9a`,mediumturquoise:`48d1cc`,mediumvioletred:`c71585`,midnightblue:`191970`,mintcream:`f5fffa`,mistyrose:`ffe4e1`,moccasin:`ffe4b5`,navajowhite:`ffdead`,navy:`000080`,oldlace:`fdf5e6`,olive:`808000`,olivedrab:`6b8e23`,orange:`ffa500`,orangered:`ff4500`,orchid:`da70d6`,palegoldenrod:`eee8aa`,palegreen:`98fb98`,paleturquoise:`afeeee`,palevioletred:`d87093`,papayawhip:`ffefd5`,peachpuff:`ffdab9`,peru:`cd853f`,pink:`ffc0cb`,plum:`dda0dd`,powderblue:`b0e0e6`,purple:`800080`,rebeccapurple:`663399`,red:`ff0000`,rosybrown:`bc8f8f`,royalblue:`4169e1`,saddlebrown:`8b4513`,salmon:`fa8072`,sandybrown:`f4a460`,seagreen:`2e8b57`,seashell:`fff5ee`,sienna:`a0522d`,silver:`c0c0c0`,skyblue:`87ceeb`,slateblue:`6a5acd`,slategray:`708090`,snow:`fffafa`,springgreen:`00ff7f`,steelblue:`4682b4`,tan:`d2b48c`,teal:`008080`,thistle:`d8bfd8`,tomato:`ff6347`,turquoise:`40e0d0`,violet:`ee82ee`,violetred:`d02090`,wheat:`f5deb3`,white:`ffffff`,whitesmoke:`f5f5f5`,yellow:`ffff00`,yellowgreen:`9acd32`};e=t[e]||e;for(var n=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:[`rgba(123, 234, 45, 0.8)`,`rgba(255,234,245,1.0)`],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3]),parseFloat(e[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:[`rgb(123, 234, 45)`,`rgb(255,234,245)`],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:[`#00ff00`,`336699`],process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:[`#fb0`,`f0f`],process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,a=n[r].process,o=i.exec(e);if(o){var s=a(o);this.r=s[0],this.g=s[1],this.b=s[2],s.length>3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return`rgb(`+this.r+`, `+this.g+`, `+this.b+`)`},this.toRGBA=function(){return`rgba(`+this.r+`, `+this.g+`, `+this.b+`, `+this.alpha+`)`},this.toHex=function(){var e=this.r.toString(16),t=this.g.toString(16),n=this.b.toString(16);return e.length==1&&(e=`0`+e),t.length==1&&(t=`0`+t),n.length==1&&(n=`0`+n),`#`+e+t+n},this.getHelpXML=functi
Line truncated
|
||||
Vendored
+17
-2
@@ -6,8 +6,23 @@
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
||||
<script src="https://accounts.google.com/gsi/client" async defer></script>
|
||||
<title>Travel Planner</title>
|
||||
<script type="module" crossorigin src="/assets/index-FtyTkPzF.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DQ8dDKht.css">
|
||||
|
||||
<!-- Open Graph Meta Tags for Social Media Sharing -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="https://yotrip.labz.io.vn" />
|
||||
<meta property="og:title" content="Travel Planner - Lên kế hoạch chuyến đi của bạn" />
|
||||
<meta property="og:description" content="Khám phá những hành trình tuyệt vời và chia sẻ khoảnh khắc đẹp với cộng đồng du lịch." />
|
||||
<meta property="og:image" content="https://yotrip.labz.io.vn/background.avif" />
|
||||
<meta property="og:image:width" content="1200" />
|
||||
<meta property="og:image:height" content="630" />
|
||||
|
||||
<!-- Twitter Card Meta Tags -->
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content="Travel Planner - Lên kế hoạch chuyến đi của bạn" />
|
||||
<meta name="twitter:description" content="Khám phá những hành trình tuyệt vời và chia sẻ khoảnh khắc đẹp với cộng đồng du lịch." />
|
||||
<meta name="twitter:image" content="https://yotrip.labz.io.vn/background.avif" />
|
||||
<script type="module" crossorigin src="/assets/index-D6jMbgMg.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-nLng8wU9.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
+27
-7
@@ -9,6 +9,7 @@ import { JoinTourPage } from './pages/JoinTourPage';
|
||||
import { MemberDashboard } from './pages/MemberDashboard';
|
||||
import { AdminDashboard } from './pages/AdminDashboard';
|
||||
import { ShareJourneyPage } from './pages/ShareJourneyPage';
|
||||
import { TourNavigationPage } from './pages/TourNavigationPage';
|
||||
import { ConfirmProvider } from './hooks/useConfirm';
|
||||
import { NotificationProvider } from './hooks/useNotification';
|
||||
|
||||
@@ -21,12 +22,13 @@ function App() {
|
||||
|
||||
const [user, setUser] = useState<any>(null);
|
||||
const [shareJourneyToken, setShareJourneyToken] = useState<string | null>(journeyTokenVal);
|
||||
const [currentPage, setCurrentPage] = useState<'landing' | 'dashboard' | 'admin' | 'explore' | 'tourDetail' | 'signup' | 'myPhotos' | 'notes' | 'joinTour' | 'shareJourney'>(
|
||||
const [currentPage, setCurrentPage] = useState<'landing' | 'dashboard' | 'admin' | 'explore' | 'tourDetail' | 'signup' | 'myPhotos' | 'notes' | 'joinTour' | 'shareJourney' | 'tourNavigation'>(
|
||||
journeyTokenVal ? 'shareJourney' : (viewTourId ? 'tourDetail' : (window.location.pathname === '/join-tour' || params.has('token') ? 'joinTour' : 'landing'))
|
||||
);
|
||||
const [currentTourId, setCurrentTourId] = useState<string | null>(viewTourId);
|
||||
const [isPublicTourView, setIsPublicTourView] = useState(!!viewTourId);
|
||||
const [previousPage, setPreviousPage] = useState<'explore' | 'dashboard' | 'landing'>('explore');
|
||||
const [navigationPayload, setNavigationPayload] = useState<{ tourId: string; origin: { lat: number; lng: number }; destination: { lat: number; lng: number; name: string }; tourTitle: string } | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
@@ -122,26 +124,30 @@ function App() {
|
||||
};
|
||||
|
||||
const handleBackFromTourDetail = () => {
|
||||
// Check if this was a public view BEFORE clearing the flag
|
||||
const wasPublicView = isPublicTourView;
|
||||
|
||||
setCurrentTourId(null);
|
||||
setIsPublicTourView(false);
|
||||
|
||||
// If user was viewing a public tour, redirect to index/landing page
|
||||
// Otherwise redirect based on authentication and previous page
|
||||
if (wasPublicView) {
|
||||
// Public tour view - always redirect to index/landing
|
||||
setCurrentPage('landing');
|
||||
} else if (user) {
|
||||
// Authenticated user viewing their own tour - go back to previous page
|
||||
setCurrentPage(previousPage);
|
||||
} else {
|
||||
// Not authenticated and not public view - go to landing
|
||||
setCurrentPage('landing');
|
||||
}
|
||||
};
|
||||
|
||||
const handleOpenNavigationPage = (payload: { tourId: string; origin: { lat: number; lng: number }; destination: { lat: number; lng: number; name: string }; tourTitle: string }) => {
|
||||
setNavigationPayload(payload);
|
||||
setCurrentPage('tourNavigation');
|
||||
};
|
||||
|
||||
const handleBackFromNavigation = () => {
|
||||
setNavigationPayload(null);
|
||||
setCurrentPage('tourDetail');
|
||||
};
|
||||
|
||||
const handleBackFromSignup = () => {
|
||||
const pendingInviteToken = localStorage.getItem('pendingInviteToken');
|
||||
if (pendingInviteToken) {
|
||||
@@ -259,6 +265,7 @@ function App() {
|
||||
onBack={handleBackFromTourDetail}
|
||||
isPublicView={isPublicTourView}
|
||||
onOpenNotes={() => setCurrentPage('notes')}
|
||||
onOpenNavigationPage={handleOpenNavigationPage}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -267,6 +274,19 @@ function App() {
|
||||
return <MyNotePage tourId={currentTourId!} onBack={() => setCurrentPage('tourDetail')} />;
|
||||
}
|
||||
|
||||
if (currentPage === 'tourNavigation' && navigationPayload) {
|
||||
return (
|
||||
<TourNavigationPage
|
||||
tourId={navigationPayload.tourId}
|
||||
routeData={{
|
||||
origin: navigationPayload.origin,
|
||||
destination: navigationPayload.destination
|
||||
}}
|
||||
onBack={handleBackFromNavigation}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (currentPage === 'explore') {
|
||||
return (
|
||||
<ExploreMap
|
||||
|
||||
@@ -50,6 +50,7 @@ export const ItineraryTimeline = ({
|
||||
onEditLocation?: (location: any) => void,
|
||||
onQuickNote?: (data: { legId: string; location: any; leg: any }) => void,
|
||||
onNavigate?: (location: any) => void,
|
||||
onOpenNavigationPage?: (routeData: { origin: { lat: number; lng: number }; destination: { lat: number; lng: number; name: string }; tourTitle: string }) => void,
|
||||
onSuccess?: () => void,
|
||||
isPublicView?: boolean
|
||||
}) => {
|
||||
@@ -127,6 +128,40 @@ export const ItineraryTimeline = ({
|
||||
}
|
||||
};
|
||||
|
||||
const handleTriggerNavigation = (location: any) => {
|
||||
if (!location.latitude || !location.longitude) {
|
||||
alert("Địa điểm này chưa được cấu hình tọa độ GPS chính xác.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!navigator.geolocation) {
|
||||
alert("Trình duyệt hoặc thiết bị của bạn không hỗ trợ định vị toàn cầu GPS.");
|
||||
return;
|
||||
}
|
||||
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(position) => {
|
||||
onOpenNavigationPage?.({
|
||||
origin: {
|
||||
lat: position.coords.latitude,
|
||||
lng: position.coords.longitude
|
||||
},
|
||||
destination: {
|
||||
lat: parseFloat(location.latitude),
|
||||
lng: parseFloat(location.longitude),
|
||||
name: location.name || "Điểm đến chọn sẵn"
|
||||
},
|
||||
tourTitle: currentTour?.title || "Chi tiết hành trình"
|
||||
});
|
||||
},
|
||||
(error) => {
|
||||
console.error("Error fetching native geolocation metrics:", error);
|
||||
alert("Không thể truy cập vị trí hiện tại của bạn. Vui lòng bật định vị GPS của thiết bị.");
|
||||
},
|
||||
{ enableHighAccuracy: true, timeout: 8000 }
|
||||
);
|
||||
};
|
||||
|
||||
const handleAddLeg = async () => {
|
||||
const note = window.prompt("Nhập ghi chú cho chặng mới:", `Chặng ${legs.length + 1}`);
|
||||
if (note && currentTour) {
|
||||
@@ -203,12 +238,25 @@ export const ItineraryTimeline = ({
|
||||
const allLocations = useMemo(() => legs.flatMap(l => l.locations), [legs]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("ItineraryTimeline: Legs updated", legs);
|
||||
// Initialize first leg as expanded when legs change
|
||||
if (legs.length > 0 && !expandedStageId) {
|
||||
const storedLegId = sessionStorage.getItem('defaultExpandedLegId');
|
||||
if (storedLegId) {
|
||||
setExpandedStageId(storedLegId);
|
||||
sessionStorage.removeItem('defaultExpandedLegId');
|
||||
|
||||
setTimeout(() => {
|
||||
const targetElement = document.getElementById(`leg-anchor-node-${storedLegId}`);
|
||||
if (targetElement) {
|
||||
targetElement.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'start'
|
||||
});
|
||||
}
|
||||
window.history.replaceState({}, document.title);
|
||||
}, 150);
|
||||
} else if (legs.length > 0 && !expandedStageId) {
|
||||
setExpandedStageId(legs[0].id);
|
||||
}
|
||||
}, [legs]);
|
||||
}, [legs, expandedStageId]);
|
||||
|
||||
return (
|
||||
<div id="itinerary-timeline-print-zone" className="timeline-scroll-container itinerary-timeline-container">
|
||||
@@ -230,7 +278,7 @@ export const ItineraryTimeline = ({
|
||||
const prevLegLastLoc = legIdx > 0 ? legs[legIdx - 1]?.locations.slice(-1)[0] : null;
|
||||
|
||||
return (
|
||||
<section key={leg.id} className={`folder-node-wrapper ${expandedStageId === leg.id ? 'expanded' : 'collapsed'}`}>
|
||||
<section key={leg.id} id={`leg-anchor-node-${leg.id}`} className={`folder-node-wrapper scroll-mt-[70px] ${expandedStageId === leg.id ? 'expanded' : 'collapsed'}`}>
|
||||
{/* Folder header row - clickable to toggle exclusive expansion */}
|
||||
<div
|
||||
onClick={() => toggleStageExpanded(leg.id)}
|
||||
@@ -490,6 +538,16 @@ export const ItineraryTimeline = ({
|
||||
<MessageSquare className="w-3 h-3" />
|
||||
{location._count?.comments > 0 && `(${location._count.comments})`}
|
||||
</button>
|
||||
<button
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
handleTriggerNavigation(location);
|
||||
}}
|
||||
className="flex items-center gap-1 px-2 py-1 bg-gray-50 hover:bg-blue-50 text-gray-400 hover:text-blue-600 rounded-lg text-[10px] font-bold transition-all border border-gray-100 hover:border-blue-100"
|
||||
title="Chỉ đường từ vị trí của bạn"
|
||||
>
|
||||
<Navigation className="w-4 h-4" />
|
||||
</button>
|
||||
</div>
|
||||
<div className="flex items-center text-sm font-black text-blue-600">
|
||||
<Clock className="w-3 h-3 mr-1" />
|
||||
@@ -699,7 +757,7 @@ export const ItineraryTimeline = ({
|
||||
isPublicView={isPublicView}
|
||||
onCommentAdded={() => handleCommentIncrement(commentLocationId)}
|
||||
onCommentDeleted={() => handleCommentDecrement(commentLocationId)}
|
||||
/>
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,183 @@
|
||||
import React, { useState, useEffect, useRef, useMemo } from 'react';
|
||||
import { MapContainer, TileLayer, Marker, Polyline, Popup, useMap } from 'react-leaflet';
|
||||
import L from 'leaflet';
|
||||
import 'leaflet/dist/leaflet.css';
|
||||
|
||||
interface NavModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
routeData: {
|
||||
origin: { lat: number; lng: number } | null;
|
||||
destination: { lat: number; lng: number; name: string } | null;
|
||||
};
|
||||
}
|
||||
|
||||
interface OSRMRoute {
|
||||
geometry: {
|
||||
coordinates: number[][];
|
||||
type: string;
|
||||
};
|
||||
legs: { distance: number; duration: number }[];
|
||||
distance: number;
|
||||
duration: number;
|
||||
}
|
||||
|
||||
const FitBounds = ({ coords }: { coords: [number, number][] }) => {
|
||||
const map = useMap();
|
||||
useEffect(() => {
|
||||
if (coords.length > 0) {
|
||||
map.fitBounds(coords, { padding: [60, 60], maxZoom: 15 });
|
||||
}
|
||||
}, [map, coords]);
|
||||
return null;
|
||||
};
|
||||
|
||||
export const LocationNavigationModal: React.FC<NavModalProps> = ({ isOpen, onClose, routeData }) => {
|
||||
const [routeGeometry, setRouteGeometry] = useState<[number, number][] | null>(null);
|
||||
const [isSearchingRoute, setIsSearchingRoute] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [routeInfo, setRouteInfo] = useState<{ distance: string; duration: string } | null>(null);
|
||||
|
||||
const fetchLockRef = useRef(false);
|
||||
|
||||
const originLat = routeData?.origin?.lat;
|
||||
const originLng = routeData?.origin?.lng;
|
||||
const destLat = routeData?.destination?.lat;
|
||||
const destLng = routeData?.destination?.lng;
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen || !originLat || !originLng || !destLat || !destLng) {
|
||||
setRouteGeometry(null);
|
||||
setError(null);
|
||||
setRouteInfo(null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fetchLockRef.current) return;
|
||||
|
||||
const calculateOptimalRoute = async () => {
|
||||
try {
|
||||
setIsSearchingRoute(true);
|
||||
fetchLockRef.current = true;
|
||||
|
||||
const url = `https://router.project-osrm.org/route/v1/driving/${originLng},${originLat};${destLng},${destLat}?overview=full&geometries=geojson`;
|
||||
const res = await fetch(url);
|
||||
if (!res.ok) throw new Error(`OSRM error: ${res.status}`);
|
||||
const data: { code: string; routes: OSRMRoute[] } = await res.json();
|
||||
if (data.code !== 'Ok' || !data.routes?.length) throw new Error('Không tìm thấy lộ trình phù hợp');
|
||||
|
||||
const route = data.routes[0];
|
||||
const coords = route.geometry.coordinates.map((c: number[]) => [c[1], c[0]] as [number, number]);
|
||||
setRouteGeometry(coords);
|
||||
|
||||
const hours = Math.floor(route.duration / 3600);
|
||||
const minutes = Math.round((route.duration % 3600) / 60);
|
||||
const durationStr = hours > 0 ? `${hours}h${minutes}p` : `${minutes}p`;
|
||||
setRouteInfo({
|
||||
distance: (route.distance / 1000).toFixed(1),
|
||||
duration: durationStr
|
||||
});
|
||||
} catch (err: any) {
|
||||
setError(err.message);
|
||||
} finally {
|
||||
setIsSearchingRoute(false);
|
||||
fetchLockRef.current = false;
|
||||
}
|
||||
};
|
||||
|
||||
calculateOptimalRoute();
|
||||
|
||||
return () => {
|
||||
fetchLockRef.current = false;
|
||||
setIsSearchingRoute(false);
|
||||
};
|
||||
}, [isOpen, originLat, originLng, destLat, destLng]);
|
||||
|
||||
const userIcon = useMemo(() => L.divIcon({
|
||||
className: '!bg-transparent !border-none',
|
||||
html: `<div class="w-8 h-8 bg-blue-600 rounded-full border-2 border-white shadow-xl flex items-center justify-center"><div class="w-2 h-2 bg-white rounded-full"></div></div>`,
|
||||
iconSize: [32, 32],
|
||||
iconAnchor: [16, 16]
|
||||
}), []);
|
||||
|
||||
const destIcon = useMemo(() => L.divIcon({
|
||||
className: '!bg-transparent !border-none',
|
||||
html: `<div class="w-8 h-8 bg-red-600 rounded-full border-2 border-white shadow-xl flex items-center justify-center text-white text-xs font-black">Đ</div>`,
|
||||
iconSize: [32, 32],
|
||||
iconAnchor: [16, 16]
|
||||
}), []);
|
||||
|
||||
if (!isOpen) return null;
|
||||
|
||||
const center: [number, number] = routeData.origin && routeData.destination
|
||||
? [(routeData.origin.lat + routeData.destination.lat) / 2, (routeData.origin.lng + routeData.destination.lng) / 2]
|
||||
: [0, 0];
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4">
|
||||
<div className="bg-slate-900 border border-slate-700 w-full max-w-4xl h-[80vh] rounded-2xl overflow-hidden flex flex-col shadow-2xl">
|
||||
{/* Modal Header */}
|
||||
<div className="p-4 bg-slate-800 border-b border-slate-700 flex items-center justify-between">
|
||||
<div>
|
||||
<h3 className="text-md font-bold text-white flex items-center gap-2">
|
||||
📍 Chỉ đường đến: <span className="text-blue-400">{routeData.destination?.name}</span>
|
||||
</h3>
|
||||
<p className="text-xs text-gray-400 mt-0.5">Tuyến đường ngắn nhất từ vị trí hiện tại của bạn</p>
|
||||
{routeInfo && (
|
||||
<div className="flex items-center gap-3 mt-1.5">
|
||||
<span className="text-xs font-bold text-blue-300">{routeInfo.distance} km</span>
|
||||
<span className="text-xs text-gray-500">|</span>
|
||||
<span className="text-xs font-bold text-green-300">~{routeInfo.duration}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<button
|
||||
onClick={onClose}
|
||||
className="text-gray-400 hover:text-white text-sm font-bold px-3 py-1.5 rounded-lg bg-gray-800 hover:bg-gray-700 transition-colors"
|
||||
>
|
||||
Đóng [X]
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Map Container */}
|
||||
<div className="relative flex-1 bg-slate-950">
|
||||
<MapContainer
|
||||
center={center}
|
||||
zoom={14}
|
||||
className="h-full w-full"
|
||||
zoomControl={true}
|
||||
attributionControl={false}
|
||||
>
|
||||
<TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" attribution="" />
|
||||
{routeData.origin && (
|
||||
<Marker position={[routeData.origin.lat, routeData.origin.lng]} icon={userIcon}>
|
||||
<Popup>
|
||||
<div className="text-xs font-bold text-blue-600">Bạn đang ở đây</div>
|
||||
</Popup>
|
||||
</Marker>
|
||||
)}
|
||||
{routeData.destination && (
|
||||
<Marker position={[routeData.destination.lat, routeData.destination.lng]} icon={destIcon}>
|
||||
<Popup>
|
||||
<div className="text-xs font-bold text-red-600">{routeData.destination.name}</div>
|
||||
</Popup>
|
||||
</Marker>
|
||||
)}
|
||||
{routeGeometry && <FitBounds coords={routeGeometry} />}
|
||||
{routeGeometry && (
|
||||
<Polyline positions={routeGeometry} color="#2563eb" weight={6} opacity={0.9} smoothFactor={1} />
|
||||
)}
|
||||
</MapContainer>
|
||||
|
||||
|
||||
|
||||
{error && (
|
||||
<div className="absolute top-4 left-1/2 -translate-x-1/2 bg-red-900 text-white text-xs px-3 py-1.5 rounded-lg shadow-lg z-[1000]">
|
||||
{error}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -39,15 +39,6 @@ const PHOTO_TAG_LABELS: { [key: string]: string } = {
|
||||
'thu-cung': '🐕 Thú cưng'
|
||||
};
|
||||
|
||||
// Component Helper để cập nhật tâm bản đồ khi vị trí người dùng thay đổi
|
||||
function RecenterMap({ position }: { position: [number, number] }) {
|
||||
const map = useMap();
|
||||
useEffect(() => {
|
||||
map.setView(position, map.getZoom());
|
||||
}, [position, map]);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Component Helper để đóng menu khi tương tác với bản đồ
|
||||
function MapEvents({ onMapAction }: { onMapAction: () => void }) {
|
||||
useMapEvents({
|
||||
@@ -202,7 +193,11 @@ export const ExploreMap = ({ onBack, onLogout, user, onViewTour, onOpenMyPhotos,
|
||||
return null;
|
||||
});
|
||||
|
||||
const [userPos, setUserPos] = useState<[number, number]>(initialViewState?.center || [10.7769, 106.7009]);
|
||||
// Map dùng center cố định để không bị GPS tự nhảy vị trí người dùng
|
||||
const defaultCenter = initialViewState?.center || [10.7769, 106.7009];
|
||||
|
||||
const [userPos, setUserPos] = useState<[number, number]>(defaultCenter);
|
||||
const [mapCenter, setLocalMapCenter] = useState<[number, number]>(initialViewState?.center || defaultCenter);
|
||||
const [mapZoom] = useState(initialViewState?.zoom || 13);
|
||||
const [publicPhotos, setPublicPhotos] = useState<any[]>([]);
|
||||
const [selectedPhoto, setSelectedPhoto] = useState<any | null>(null);
|
||||
@@ -262,7 +257,7 @@ export const ExploreMap = ({ onBack, onLogout, user, onViewTour, onOpenMyPhotos,
|
||||
const [blacklist, setBlacklist] = useState<any[]>([]);
|
||||
const [isReportModalOpen, setIsReportModalOpen] = useState(false);
|
||||
const [isBlacklistOpen, setIsBlacklistOpen] = useState(false);
|
||||
const mapCenter = useTourStore(state => state.mapCenter);
|
||||
const storeMapCenter = useTourStore(state => state.mapCenter);
|
||||
|
||||
// Recommendations and GPS States
|
||||
const [recommendedLocations, setRecommendedLocations] = useState<any[]>([]);
|
||||
@@ -342,6 +337,7 @@ export const ExploreMap = ({ onBack, onLogout, user, onViewTour, onOpenMyPhotos,
|
||||
const posArray: [number, number] = [pos.coords.latitude, pos.coords.longitude];
|
||||
setUserGpsPos(posArray);
|
||||
setUserPos(posArray);
|
||||
setLocalMapCenter(posArray);
|
||||
setMapCenter(posArray);
|
||||
},
|
||||
() => {
|
||||
@@ -435,7 +431,28 @@ export const ExploreMap = ({ onBack, onLogout, user, onViewTour, onOpenMyPhotos,
|
||||
fetchTrustedUsers();
|
||||
fetchBlacklist();
|
||||
fetchRecommendations();
|
||||
// Luôn tải danh sách ảnh công khai để hiển thị trên bản đồ cho tất cả mọi người
|
||||
fetchPublicPhotos();
|
||||
|
||||
// Chỉ tải danh sách tour khi người dùng đã đăng nhập và có token
|
||||
if (user || localStorage.getItem('token')) {
|
||||
fetchPublicTours();
|
||||
}
|
||||
}, []);
|
||||
|
||||
// Chỉ lấy vị trí GPS ban đầu để hiển thị marker, KHÔNG tự động nhảy bản đồ đến vị trí đó
|
||||
// Người dùng phải chủ động nhấn nút định vị mới nhảy bản đồ đến vị trí của mình
|
||||
useEffect(() => {
|
||||
if (!initialViewState && navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(pos) => {
|
||||
const posArray: [number, number] = [pos.coords.latitude, pos.coords.longitude];
|
||||
setUserPos(posArray);
|
||||
},
|
||||
() => console.log("Không thể lấy vị trí người dùng")
|
||||
);
|
||||
}
|
||||
}, [initialViewState]);
|
||||
const [isFilterDropdownOpen, setIsFilterDropdownOpen] = useState(false); // State để điều khiển hiển thị dropdown lọc
|
||||
const [searchQuery, setSearchQuery] = useState(''); // State cho giá trị tìm kiếm
|
||||
const [suggestions, setSuggestions] = useState<{ type: 'tour' | 'location', id: string, name: string, lat?: number, lon?: number }[]>([]);
|
||||
@@ -576,6 +593,7 @@ export const ExploreMap = ({ onBack, onLogout, user, onViewTour, onOpenMyPhotos,
|
||||
} else if (s.lat && s.lon) {
|
||||
const pos: [number, number] = [s.lat, s.lon];
|
||||
setUserPos(pos);
|
||||
setLocalMapCenter(pos);
|
||||
setMapCenter(pos);
|
||||
notify({
|
||||
title: 'Tìm thấy địa điểm',
|
||||
@@ -783,6 +801,18 @@ export const ExploreMap = ({ onBack, onLogout, user, onViewTour, onOpenMyPhotos,
|
||||
|
||||
{/* Nhóm bên phải: Các thao tác người dùng */}
|
||||
<div className="flex items-center gap-2 pointer-events-auto">
|
||||
{/* Nút định vị người dùng */}
|
||||
<button
|
||||
onClick={requestGpsPosition}
|
||||
className="w-11 h-11 bg-[var(--surface)] rounded-full shadow-xl hover:bg-blue-100 text-blue-600 transition-all flex items-center justify-center border border-[var(--border)] shrink-0"
|
||||
title="Vị trí của tôi"
|
||||
>
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
<path d="M12 2v4M12 18v4M2 12h4M18 12h4" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
{/* Nút Ảnh của tôi */}
|
||||
{isLoggedInOrGuest && (
|
||||
<button
|
||||
@@ -890,13 +920,13 @@ export const ExploreMap = ({ onBack, onLogout, user, onViewTour, onOpenMyPhotos,
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<MapContainer
|
||||
center={userPos}
|
||||
zoom={mapZoom}
|
||||
className="h-full w-full"
|
||||
preferCanvas={true}
|
||||
attributionControl={false}
|
||||
>
|
||||
<MapContainer
|
||||
center={mapCenter}
|
||||
zoom={mapZoom}
|
||||
className="h-full w-full"
|
||||
preferCanvas={true}
|
||||
attributionControl={false}
|
||||
>
|
||||
<TileLayer
|
||||
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
||||
/>
|
||||
@@ -905,9 +935,6 @@ export const ExploreMap = ({ onBack, onLogout, user, onViewTour, onOpenMyPhotos,
|
||||
<MapTracker />
|
||||
{/* Đóng menu và dropdown khi tương tác bản đồ */}
|
||||
<MapEvents onMapAction={() => { setShareMenu(null); setSuggestions([]); setIsFilterDropdownOpen(false); }} />
|
||||
|
||||
{/* Tự động di chuyển bản đồ đến vị trí người dùng khi tìm thấy tọa độ */}
|
||||
<RecenterMap position={userPos} />
|
||||
|
||||
<MarkerClusterGroup key={`cluster-${filteredTours.length}`} chunkedLoading>
|
||||
{filteredTours.map((tour) => {
|
||||
@@ -1403,6 +1430,7 @@ export const ExploreMap = ({ onBack, onLogout, user, onViewTour, onOpenMyPhotos,
|
||||
<button
|
||||
onClick={() => {
|
||||
setUserPos([item.latitude, item.longitude]);
|
||||
setLocalMapCenter([item.latitude, item.longitude]);
|
||||
setMapCenter([item.latitude, item.longitude]);
|
||||
}}
|
||||
className="text-[9px] font-bold text-blue-600 dark:text-blue-400 text-left hover:underline flex items-center gap-1 mt-0.5 cursor-pointer bg-transparent border-none p-0"
|
||||
@@ -1481,6 +1509,7 @@ export const ExploreMap = ({ onBack, onLogout, user, onViewTour, onOpenMyPhotos,
|
||||
<button
|
||||
onClick={() => {
|
||||
setUserPos([item.latitude, item.longitude]);
|
||||
setLocalMapCenter([item.latitude, item.longitude]);
|
||||
setMapCenter([item.latitude, item.longitude]);
|
||||
}}
|
||||
className="text-[9px] font-bold text-blue-600 dark:text-blue-400 text-left hover:underline flex items-center gap-1 mt-0.5 cursor-pointer bg-transparent border-none p-0"
|
||||
|
||||
@@ -109,6 +109,42 @@ export const MemberDashboard: React.FC<MemberDashboardProps> = ({
|
||||
const [shareStatus, setShareStatus] = useState<any | null>(null);
|
||||
const [loadingShare, setLoadingShare] = useState(false);
|
||||
|
||||
const handleNavigateToItinerary = (tour: any) => {
|
||||
let targetLegId = null;
|
||||
|
||||
if (tour?.legs && tour.legs.length > 0) {
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
|
||||
for (const leg of tour.legs) {
|
||||
const rawStart = leg.startDate || leg.plannedStart || leg.date;
|
||||
const rawEnd = leg.endDate || leg.plannedEnd || leg.date;
|
||||
|
||||
if (rawStart) {
|
||||
const startBound = new Date(rawStart);
|
||||
startBound.setHours(0, 0, 0, 0);
|
||||
|
||||
const endBound = rawEnd ? new Date(rawEnd) : new Date(rawStart);
|
||||
endBound.setHours(23, 59, 59, 999);
|
||||
|
||||
if (today >= startBound && today <= endBound) {
|
||||
targetLegId = leg.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!targetLegId) {
|
||||
targetLegId = tour.legs[0].id;
|
||||
}
|
||||
}
|
||||
|
||||
if (targetLegId) {
|
||||
sessionStorage.setItem('defaultExpandedLegId', targetLegId);
|
||||
}
|
||||
onViewTour(tour.id, 'dashboard');
|
||||
};
|
||||
|
||||
const handleOpenShareModal = async (tour: any) => {
|
||||
setSharingTour(tour);
|
||||
setShareStatus(null);
|
||||
@@ -1459,13 +1495,13 @@ const renderInitialsAvatar = (name: string, sizeClass = 'w-10 h-10 text-sm') =>
|
||||
<span>Chụp ảnh</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
onClick={() => onViewTour(tour.id, 'dashboard')}
|
||||
className="flex-1 py-2 px-2 bg-slate-900 hover:bg-slate-800 text-slate-850 hover:text-white rounded-xl text-xs font-bold transition-all border border-slate-800 hover:border-slate-700 flex items-center justify-center gap-1"
|
||||
>
|
||||
<span>Chi tiết hành trình</span>
|
||||
<ChevronRight className="w-3.5 h-3.5" />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleNavigateToItinerary(tour)}
|
||||
className="flex-1 py-2 px-2 bg-slate-900 hover:bg-slate-800 text-slate-850 hover:text-white rounded-xl text-xs font-bold transition-all border border-slate-800 hover:border-slate-700 flex items-center justify-center gap-1"
|
||||
>
|
||||
<span>Chi tiết hành trình</span>
|
||||
<ChevronRight className="w-3.5 h-3.5" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Emergency Share Button - moved to bottom */}
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { useState, useEffect, useMemo, useRef } from 'react';
|
||||
import { io } from 'socket.io-client';
|
||||
import { jsPDF } from 'jspdf';
|
||||
import autoTable from 'jspdf-autotable';
|
||||
import { robotoBase64 } from '../utils/pdfFont';
|
||||
import { robotoBase64, robotoBoldBase64 } from '../utils/pdfFont';
|
||||
import { ItineraryTimeline } from '../components/ItineraryTimeline';
|
||||
import { ExpenseManager } from '../components/ExpenseManager';
|
||||
import { useTourStore } from '@/store/useTourStore';
|
||||
@@ -148,28 +148,40 @@ const combineSegmentRoutes = (segmentRoutes: OSRMRoute[][], selectedIndices: num
|
||||
// Component Helper để tự động điều chỉnh khung nhìn bản đồ bao phủ toàn bộ lộ trình
|
||||
const MapTourBounds = ({ locations }: { locations: any[] }) => {
|
||||
const map = useMap();
|
||||
// Tạo một key dựa trên giá trị tọa độ để tránh chạy lại khi chỉ thay đổi tham chiếu mảng
|
||||
const locKey = useMemo(() => JSON.stringify(locations.map(l => [l.latitude, l.longitude])), [locations]);
|
||||
const shouldFitRef = useRef(true);
|
||||
const prevLocKeyRef = useRef<string | null>(null);
|
||||
|
||||
const locKey = useMemo(() => JSON.stringify(locations.map((l: any) => [l.latitude, l.longitude])), [locations]);
|
||||
|
||||
useEffect(() => {
|
||||
if (locations.length > 0) {
|
||||
const bounds = L.latLngBounds(locations.map(l => [l.latitude, l.longitude]));
|
||||
if (locations.length === 1) {
|
||||
// Chỉ thực hiện nếu bản đồ chưa ở đúng vị trí (tránh trigger moveend liên tục)
|
||||
map.setView([locations[0].latitude, locations[0].longitude], 15, { animate: true });
|
||||
} else {
|
||||
map.fitBounds(bounds, { padding: [50, 50], maxZoom: 15 });
|
||||
}
|
||||
if (locations.length === 0) return;
|
||||
|
||||
if (prevLocKeyRef.current !== null && prevLocKeyRef.current !== locKey) {
|
||||
shouldFitRef.current = true;
|
||||
}
|
||||
}, [locKey, map]);
|
||||
prevLocKeyRef.current = locKey;
|
||||
|
||||
if (!shouldFitRef.current) return;
|
||||
|
||||
const bounds = L.latLngBounds(locations.map((l: any) => [l.latitude, l.longitude]));
|
||||
if (locations.length === 1) {
|
||||
map.setView([locations[0].latitude, locations[0].longitude], 15, { animate: true });
|
||||
} else {
|
||||
map.fitBounds(bounds, { padding: [50, 50], maxZoom: 15 });
|
||||
}
|
||||
shouldFitRef.current = false;
|
||||
}, [locKey, map, locations.length]);
|
||||
|
||||
return null;
|
||||
};
|
||||
// Component Helper để di chuyển tâm bản đồ về vị trí người dùng khi nhấn nút
|
||||
const RecenterUser = ({ position, trigger }: { position: [number, number] | null, trigger: number }) => {
|
||||
const map = useMap();
|
||||
const lastTriggerRef = useRef(0);
|
||||
|
||||
useEffect(() => {
|
||||
if (position && trigger > 0) {
|
||||
if (position && trigger > lastTriggerRef.current) {
|
||||
lastTriggerRef.current = trigger;
|
||||
map.setView(position, 16, { animate: true });
|
||||
}
|
||||
}, [trigger, position, map]);
|
||||
@@ -210,7 +222,7 @@ const MapRotationHandler = ({ rotation }: { rotation: number }) => {
|
||||
// 1. Dùng translateZ(0) để kích hoạt GPU trên iOS.
|
||||
// 2. Giảm scale xuống ~1.6 (vừa đủ che góc) để giảm tải cho bộ nhớ đệm đồ họa.
|
||||
container.style.transform = `rotate(${cumulativeRotationRef.current}deg) scale(2.2) translateZ(0)`;
|
||||
container.style.transition = 'transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1)';
|
||||
container.style.transition = 'transform 0.15s ease-out';
|
||||
}, [rotation, map]);
|
||||
return null;
|
||||
};
|
||||
@@ -348,12 +360,14 @@ export const TourDetailPage = ({
|
||||
onBack,
|
||||
tourId,
|
||||
isPublicView = false,
|
||||
onOpenNotes
|
||||
onOpenNotes,
|
||||
onOpenNavigationPage
|
||||
}: {
|
||||
onBack: () => void,
|
||||
tourId: string,
|
||||
isPublicView?: boolean,
|
||||
onOpenNotes?: () => void
|
||||
onOpenNotes?: () => void,
|
||||
onOpenNavigationPage?: (routeData: { origin: { lat: number; lng: number }; destination: { lat: number; lng: number; name: string }; tourTitle: string }) => void
|
||||
}) => {
|
||||
// Tách biệt các state và actions để tối ưu performance - Chuyển lên đầu để tránh lỗi initialization
|
||||
const { t } = useTranslation();
|
||||
@@ -486,12 +500,12 @@ export const TourDetailPage = ({
|
||||
const handleExportPDF = async () => {
|
||||
const doc = new jsPDF({ orientation: 'landscape', unit: 'mm', format: 'a4' });
|
||||
|
||||
// 1. Thêm font vào Virtual File System của jsPDF để hỗ trợ tiếng Việt
|
||||
doc.addFileToVFS("Roboto-Regular.ttf", robotoBase64);
|
||||
doc.addFont("Roboto-Regular.ttf", "Roboto", "normal");
|
||||
doc.addFileToVFS("Roboto-Bold.ttf", robotoBoldBase64);
|
||||
doc.addFont("Roboto-Bold.ttf", "Roboto", "bold");
|
||||
doc.setFont("Roboto");
|
||||
|
||||
// 2. Vẽ Tiêu đề & Thông tin Tour ở đầu trang
|
||||
const titleText = `LỊCH TRÌNH TOUR: ${currentTour?.title?.toUpperCase() || 'HÀNH TRÌNH TOUR'}`;
|
||||
doc.setFontSize(16);
|
||||
doc.text(titleText, 148.5, 15, { align: 'center' });
|
||||
@@ -508,48 +522,99 @@ export const TourDetailPage = ({
|
||||
doc.text(dateRangeStr, 148.5, startY, { align: 'center' });
|
||||
startY += 8;
|
||||
|
||||
// 3. Chuẩn bị dữ liệu bảng
|
||||
const tableColumn = ["STT", "Ngày giờ", "Chặng", "Địa điểm", "Ghi chú"];
|
||||
const tableRows: any[] = [];
|
||||
|
||||
const formatDateTime = (dateStr: string) => {
|
||||
if (!dateStr) return '';
|
||||
const d = new Date(dateStr);
|
||||
if (isNaN(d.getTime())) return '';
|
||||
const hours = String(d.getHours()).padStart(2, '0');
|
||||
const minutes = String(d.getMinutes()).padStart(2, '0');
|
||||
const day = String(d.getDate()).padStart(2, '0');
|
||||
const month = String(d.getMonth() + 1).padStart(2, '0');
|
||||
const year = d.getFullYear();
|
||||
return `${hours}:${minutes} ${day}/${month}/${year}`;
|
||||
};
|
||||
const legRowRanges: Record<string, { start: number; count: number }> = {};
|
||||
const pdfMapLinks: { [key: number]: string } = {};
|
||||
|
||||
let stt = 1;
|
||||
let globalRowIndex = 0;
|
||||
|
||||
const extractAndFormatTimeInline = (primaryTime: any, fallbackLegObj: any) => {
|
||||
const absoluteTimeSource = primaryTime ||
|
||||
fallbackLegObj?.plannedStart ||
|
||||
fallbackLegObj?.startDate ||
|
||||
fallbackLegObj?.start_date ||
|
||||
fallbackLegObj?.date ||
|
||||
fallbackLegObj?.createdAt;
|
||||
|
||||
if (!absoluteTimeSource) return '';
|
||||
|
||||
const d = new Date(absoluteTimeSource);
|
||||
if (isNaN(d.getTime())) return '';
|
||||
|
||||
const hhmm = `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;
|
||||
const ddmmyyyy = `${String(d.getDate()).padStart(2, '0')}/${String(d.getMonth() + 1).padStart(2, '0')}/${d.getFullYear()}`;
|
||||
return `${hhmm}|${ddmmyyyy}`;
|
||||
};
|
||||
|
||||
if (currentTour?.legs && currentTour.legs.length > 0) {
|
||||
currentTour.legs.forEach((leg: any, legIdx: number) => {
|
||||
const legName = leg.note || `Chặng ${legIdx + 1}`;
|
||||
if (leg.locations && leg.locations.length > 0) {
|
||||
leg.locations.forEach((loc: any) => {
|
||||
const currentStt = stt++;
|
||||
|
||||
const arrivalStr = loc.arrivalTime ? `Đến: ${formatDateTime(loc.arrivalTime)}` : '';
|
||||
const departureStr = loc.departureTime ? `Đi: ${formatDateTime(loc.departureTime)}` : '';
|
||||
const timeText = [arrivalStr, departureStr].filter(Boolean).join('\n');
|
||||
|
||||
const locName = loc.name;
|
||||
const addressStr = loc.address ? `\n📍 Địa chỉ: ${loc.address}` : '';
|
||||
const locationText = `${locName}${addressStr}`;
|
||||
|
||||
const noteText = loc.notes || '';
|
||||
|
||||
const legNameCellObj = {
|
||||
content: legName,
|
||||
styles: { fontStyle: 'bold' as const }
|
||||
};
|
||||
|
||||
const legLocations = (leg.locations || []).filter((loc: any) =>
|
||||
loc && (loc.plannedStart || loc.plannedEnd || loc.name)
|
||||
);
|
||||
|
||||
const startRow = globalRowIndex;
|
||||
|
||||
if (legLocations.length > 0) {
|
||||
legRowRanges[leg.id] = { start: startRow, count: legLocations.length };
|
||||
|
||||
legLocations.forEach((loc: any, locIdx: number) => {
|
||||
const isStartPoint = loc.plannedStart && new Date(loc.plannedStart).getTime() === 0;
|
||||
const initialTimeSource = isStartPoint ? loc.plannedEnd : loc.plannedStart;
|
||||
|
||||
const timeStr = extractAndFormatTimeInline(initialTimeSource, leg);
|
||||
|
||||
const locName = loc.name || '';
|
||||
const addressStr = loc.address || '';
|
||||
const coordStr = loc.latitude && loc.longitude ? `\n${loc.latitude}, ${loc.longitude}` : '';
|
||||
const locationText = [locName, addressStr, coordStr].filter(Boolean).join('\n');
|
||||
const noteText = loc.note || '';
|
||||
|
||||
let mapUrl = '';
|
||||
if (loc.latitude && loc.longitude) {
|
||||
mapUrl = `https://www.google.com/maps/search/?api=1&query=${loc.latitude},${loc.longitude}`;
|
||||
} else if (addressStr || locName) {
|
||||
mapUrl = `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(addressStr || locName)}`;
|
||||
}
|
||||
|
||||
const currentRowPosition = tableRows.length;
|
||||
if (mapUrl) {
|
||||
pdfMapLinks[currentRowPosition] = mapUrl;
|
||||
}
|
||||
|
||||
const locationCellObj = {
|
||||
content: locationText,
|
||||
styles: mapUrl ? { textColor: [40, 83, 107], fontStyle: 'bold' as const } : {}
|
||||
};
|
||||
|
||||
tableRows.push([
|
||||
currentStt,
|
||||
timeText,
|
||||
legName,
|
||||
locationText,
|
||||
stt++,
|
||||
timeStr,
|
||||
locIdx === 0 ? legNameCellObj : '',
|
||||
locationCellObj,
|
||||
noteText
|
||||
]);
|
||||
globalRowIndex++;
|
||||
});
|
||||
} else {
|
||||
const legTimeStr = extractAndFormatTimeInline(null, leg);
|
||||
|
||||
legRowRanges[leg.id] = { start: startRow, count: 1 };
|
||||
tableRows.push([
|
||||
stt++,
|
||||
legTimeStr,
|
||||
legNameCellObj,
|
||||
'Chưa có địa điểm trong chặng này',
|
||||
''
|
||||
]);
|
||||
globalRowIndex++;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -558,22 +623,108 @@ export const TourDetailPage = ({
|
||||
tableRows.push(["-", "-", "-", "Chưa có chặng hoặc địa điểm nào trong hành trình.", "-"]);
|
||||
}
|
||||
|
||||
// 4. Vẽ bảng dùng autoTable
|
||||
autoTable(doc, {
|
||||
head: [tableColumn],
|
||||
headStyles: {
|
||||
fillColor: [37, 99, 235],
|
||||
textColor: [255, 255, 255],
|
||||
font: 'Roboto',
|
||||
fontStyle: 'bold',
|
||||
halign: 'center',
|
||||
valign: 'middle'
|
||||
},
|
||||
body: tableRows,
|
||||
startY: startY,
|
||||
theme: 'grid',
|
||||
headStyles: { fillColor: [37, 99, 235], textColor: [255, 255, 255], fontStyle: 'normal' },
|
||||
styles: { font: "Roboto", fontSize: 9, cellPadding: 3, overflow: 'linebreak' },
|
||||
columnStyles: {
|
||||
0: { cellWidth: 12, halign: 'center' }, // STT
|
||||
1: { cellWidth: 50 }, // Ngày giờ
|
||||
2: { cellWidth: 45 }, // Chặng
|
||||
3: { cellWidth: 90 }, // Địa điểm
|
||||
4: { cellWidth: 70 } // Ghi chú
|
||||
styles: {
|
||||
font: "Roboto",
|
||||
fontSize: 9,
|
||||
cellPadding: 3,
|
||||
overflow: 'linebreak',
|
||||
valign: 'top'
|
||||
},
|
||||
margin: { left: 15, right: 15 }
|
||||
columnStyles: {
|
||||
0: { cellWidth: 12, halign: 'center', valign: 'middle' },
|
||||
1: { cellWidth: 50, halign: 'center', valign: 'middle' },
|
||||
2: { cellWidth: 45, halign: 'center', valign: 'middle' },
|
||||
3: { cellWidth: 90, valign: 'top' },
|
||||
4: { cellWidth: 70, valign: 'top' }
|
||||
},
|
||||
margin: { left: 15, right: 15 },
|
||||
didParseCell: (cell: any) => {
|
||||
if (cell.section === 'body') {
|
||||
if (cell.column.index === 2) {
|
||||
let assigned = false;
|
||||
for (const leg of currentTour?.legs || []) {
|
||||
const range = legRowRanges[leg.id];
|
||||
if (range && cell.row.index >= range.start && cell.row.index < range.start + range.count) {
|
||||
if (cell.row.index === range.start) {
|
||||
cell.rowSpan = range.count;
|
||||
} else {
|
||||
cell.rowSpan = 0;
|
||||
}
|
||||
assigned = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!assigned) {
|
||||
cell.rowSpan = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
willDrawCell: (data: any) => {
|
||||
if (data.section === 'body' && data.column.index === 1) {
|
||||
if (data.cell.text && data.cell.text.length > 0) {
|
||||
data.cell.customInlineBuffer = data.cell.text.join('');
|
||||
}
|
||||
data.cell.text = [];
|
||||
}
|
||||
},
|
||||
didDrawCell: (data: any) => {
|
||||
if (data.section === 'body' && data.column.index === 1) {
|
||||
const rawTextStr = data.cell.customInlineBuffer || data.cell.raw;
|
||||
|
||||
if (rawTextStr && typeof rawTextStr === 'string' && rawTextStr.includes('|')) {
|
||||
const [timePart, datePart] = rawTextStr.split('|');
|
||||
const separatorSpace = " ";
|
||||
|
||||
data.doc.setFont(data.cell.styles.font, 'bold');
|
||||
const timeWidth = data.doc.getTextWidth(timePart);
|
||||
|
||||
data.doc.setFont(data.cell.styles.font, 'normal');
|
||||
const spaceWidth = data.doc.getTextWidth(separatorSpace);
|
||||
const dateWidth = data.doc.getTextWidth(datePart);
|
||||
|
||||
const totalBlockWidth = timeWidth + spaceWidth + dateWidth;
|
||||
|
||||
const targetX = data.cell.x + (data.cell.width - totalBlockWidth) / 2;
|
||||
const targetY = data.cell.y + (data.cell.height / 2) + (data.cell.styles.fontSize / 2) - 1;
|
||||
|
||||
data.doc.setFont(data.cell.styles.font, 'bold');
|
||||
data.doc.setTextColor(239, 68, 68);
|
||||
data.doc.text(timePart, targetX, targetY);
|
||||
|
||||
data.doc.setFont(data.cell.styles.font, 'normal');
|
||||
data.doc.setTextColor(37, 99, 235);
|
||||
data.doc.text(datePart, targetX + timeWidth + spaceWidth, targetY);
|
||||
}
|
||||
}
|
||||
|
||||
if (data.section === 'body' && data.column.index === 3) {
|
||||
const activeRowIndex = data.row.index;
|
||||
const targetMapUrl = pdfMapLinks[activeRowIndex];
|
||||
if (targetMapUrl) {
|
||||
data.doc.link(
|
||||
data.cell.x,
|
||||
data.cell.y,
|
||||
data.cell.width,
|
||||
data.cell.height,
|
||||
{ url: targetMapUrl }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
@@ -716,6 +867,8 @@ export const TourDetailPage = ({
|
||||
|
||||
// Theo dõi hướng thiết bị (la bàn)
|
||||
useEffect(() => {
|
||||
let lastHeading: number | null = null;
|
||||
|
||||
const handleOrientation = (event: any) => {
|
||||
let heading: number | null = null;
|
||||
|
||||
@@ -725,17 +878,17 @@ export const TourDetailPage = ({
|
||||
}
|
||||
// 2. Đối với Android (Chrome): Cần kiểm tra tính tuyệt đối của dữ liệu
|
||||
else if (event.alpha !== null && event.alpha !== undefined) {
|
||||
// Chrome trên Android chỉ cung cấp hướng la bàn chuẩn khi event.absolute là true
|
||||
// hoặc khi nhận từ sự kiện 'deviceorientationabsolute'
|
||||
if (event.absolute === true || event.type === 'deviceorientationabsolute') {
|
||||
// Alpha trên Android tăng theo chiều ngược kim đồng hồ (0=North, 90=West)
|
||||
// Cần chuyển đổi sang chiều kim đồng hồ để khớp với logic quay bản đồ
|
||||
heading = (360 - event.alpha) % 360;
|
||||
}
|
||||
}
|
||||
|
||||
if (heading !== null) {
|
||||
setDeviceOrientationHeading(heading);
|
||||
// Chỉ cập nhật nếu hướng thay đổi lớn hơn 2 độ để giảm tải vẽ lại
|
||||
if (lastHeading === null || Math.abs(heading - lastHeading) > 2) {
|
||||
lastHeading = heading;
|
||||
setDeviceOrientationHeading(heading);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1091,6 +1244,31 @@ export const TourDetailPage = ({
|
||||
const rejectJoinRequest = useTourStore(state => state.rejectJoinRequest);
|
||||
const deleteTour = useTourStore(state => state.deleteTour);
|
||||
|
||||
const toggleCompassMode = async () => {
|
||||
if (!isHeadingMode) {
|
||||
if (
|
||||
typeof DeviceOrientationEvent !== 'undefined' &&
|
||||
typeof (DeviceOrientationEvent as any).requestPermission === 'function'
|
||||
) {
|
||||
try {
|
||||
const permissionState = await (DeviceOrientationEvent as any).requestPermission();
|
||||
if (permissionState === 'granted') {
|
||||
setIsHeadingMode(true);
|
||||
} else {
|
||||
alert("Để xoay bản đồ theo hướng di chuyển, vui lòng cấp quyền truy cập cảm biến hướng (La bàn).");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error requesting compass permission:", error);
|
||||
setIsHeadingMode(true);
|
||||
}
|
||||
} else {
|
||||
setIsHeadingMode(true);
|
||||
}
|
||||
} else {
|
||||
setIsHeadingMode(false);
|
||||
setMapRotation(0);
|
||||
}
|
||||
};
|
||||
|
||||
// Khôi phục vị trí và mức zoom từ localStorage
|
||||
const [initialViewState] = useState(() => {
|
||||
@@ -1754,7 +1932,9 @@ export const TourDetailPage = ({
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{/* Tour Header Info */}
|
||||
{!(activeTab === 'plan' && viewMode === 'map') && (
|
||||
<>
|
||||
{/* Tour Header Info */}
|
||||
<div className="relative min-h-[480px] w-full bg-blue-900 flex flex-col justify-end">
|
||||
<img
|
||||
src={tourInfo.coverImage}
|
||||
@@ -2017,11 +2197,14 @@ export const TourDetailPage = ({
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* Main Content Area - Điều chỉnh max-width khi ở chế độ bản đồ */}
|
||||
<div className={`${activeTab === 'plan' && viewMode === 'map' ? 'w-full' : 'max-w-2xl mx-auto'} px-4 pb-24`}>
|
||||
<div className={`${activeTab === 'plan' && viewMode === 'map' ? 'w-full !px-0 !pb-0' : 'max-w-2xl mx-auto px-4 pb-24'}`}>
|
||||
{/* Tab Switcher */}
|
||||
<div className="bg-white rounded-2xl shadow-lg border border-gray-100 p-1 flex mb-6 sticky top-[60px] z-40">
|
||||
{!(activeTab === 'plan' && viewMode === 'map') && (
|
||||
<div className="bg-white rounded-2xl shadow-lg border border-gray-100 p-1 flex mb-6 sticky top-[60px] z-40">
|
||||
{tabs.map((tab) => (
|
||||
<button
|
||||
key={tab.id}
|
||||
@@ -2045,44 +2228,49 @@ export const TourDetailPage = ({
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Tab Panels */}
|
||||
<div className="transition-opacity duration-300">
|
||||
{activeTab === 'plan' && (
|
||||
<div className="animate-in fade-in slide-in-from-bottom-2">
|
||||
{/* View Mode Toggle */}
|
||||
<div className="flex justify-center items-center mb-3">
|
||||
<div className="bg-gray-100 dark:bg-slate-800 p-1 rounded-2xl flex gap-1">
|
||||
<button
|
||||
onClick={() => setViewMode('timeline')}
|
||||
className={`flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold transition-all ${viewMode === 'timeline' ? 'bg-white dark:bg-slate-900 shadow-sm text-blue-600 dark:text-blue-400' : 'text-gray-500'}`}
|
||||
>
|
||||
<List className="w-3.5 h-3.5" /> Danh sách
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setViewMode('map')}
|
||||
className={`flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold transition-all ${viewMode === 'map' ? 'bg-white dark:bg-slate-900 shadow-sm text-blue-600 dark:text-blue-400' : 'text-gray-500'}`}
|
||||
>
|
||||
<MapIconLucide className="w-3.5 h-3.5" /> Bản đồ
|
||||
</button>
|
||||
{viewMode !== 'map' && (
|
||||
<div className="flex justify-center items-center mb-3">
|
||||
<div className="bg-gray-100 dark:bg-slate-800 p-1 rounded-2xl flex gap-1">
|
||||
<button
|
||||
onClick={() => setViewMode('timeline')}
|
||||
className={`flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold transition-all ${viewMode === 'timeline' ? 'bg-white dark:bg-slate-900 shadow-sm text-blue-600 dark:text-blue-400' : 'text-gray-500'}`}
|
||||
>
|
||||
<List className="w-3.5 h-3.5" /> Danh sách
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setViewMode('map')}
|
||||
className={`flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold transition-all ${viewMode === 'map' ? 'bg-white dark:bg-slate-900 shadow-sm text-blue-600 dark:text-blue-400' : 'text-gray-500'}`}
|
||||
>
|
||||
<MapIconLucide className="w-3.5 h-3.5" /> Bản đồ
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Export Buttons */}
|
||||
<div className="flex justify-center gap-2 mb-6">
|
||||
<button
|
||||
onClick={handleExportCSV}
|
||||
className="flex items-center gap-1 px-3 py-1.5 bg-emerald-600 hover:bg-emerald-700 text-white rounded-lg text-[11px] font-bold shadow-md transition-all active:scale-95 whitespace-nowrap"
|
||||
>
|
||||
📊 Google Sheets
|
||||
</button>
|
||||
<button
|
||||
onClick={handleExportPDF}
|
||||
className="flex items-center gap-1 px-3 py-1.5 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-[11px] font-bold shadow-md transition-all active:scale-95 whitespace-nowrap"
|
||||
>
|
||||
📥 {t('exportPDF') || 'Xuất PDF'}
|
||||
</button>
|
||||
</div>
|
||||
{viewMode !== 'map' && (
|
||||
<div className="flex justify-center gap-2 mb-6">
|
||||
<button
|
||||
onClick={handleExportCSV}
|
||||
className="flex items-center gap-1 px-3 py-1.5 bg-emerald-600 hover:bg-emerald-700 text-white rounded-lg text-[11px] font-bold shadow-md transition-all active:scale-95 whitespace-nowrap"
|
||||
>
|
||||
📊 Google Sheets
|
||||
</button>
|
||||
<button
|
||||
onClick={handleExportPDF}
|
||||
className="flex items-center gap-1 px-3 py-1.5 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-[11px] font-bold shadow-md transition-all active:scale-95 whitespace-nowrap"
|
||||
>
|
||||
📥 {t('exportPDF') || 'Xuất PDF'}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{viewMode === 'timeline' ? (
|
||||
<ItineraryTimeline onAddLocation={(legId, isStart, isEnd) => {
|
||||
@@ -2095,22 +2283,20 @@ export const TourDetailPage = ({
|
||||
setEditingLocation(loc);
|
||||
setTargetLegId(loc.legId);
|
||||
setMapCenter([loc.latitude, loc.longitude]);
|
||||
|
||||
// Kiểm tra xem địa điểm đang sửa có phải là điểm mốc đặc biệt không (dựa trên timestamp 1970)
|
||||
const isStart = loc.plannedStart && new Date(loc.plannedStart).getTime() === 0;
|
||||
const isEnd = loc.plannedEnd && new Date(loc.plannedEnd).getTime() === 0;
|
||||
setIsStartPointAction(!!isStart);
|
||||
setIsEndPointAction(!!isEnd);
|
||||
|
||||
setIsAddLocationOpen(true);
|
||||
}}
|
||||
onQuickNote={(data) => handleQuickNote(data)}
|
||||
onSuccess={() => fetchTour(tourId)}
|
||||
isPublicView={isPublicView}
|
||||
onNavigate={handleNavigateToLocation}
|
||||
onOpenNavigationPage={onOpenNavigationPage}
|
||||
/>
|
||||
) : (
|
||||
<div className="h-[60vh] w-full rounded-3xl overflow-hidden shadow-xl border-4 border-white relative animate-in fade-in duration-500">
|
||||
<div className="h-[calc(100vh-53px)] w-full md:rounded-3xl overflow-hidden md:shadow-xl md:border-4 md:border-white relative animate-in fade-in duration-500">
|
||||
{/* Search Bar Overlay - Thanh tìm kiếm địa điểm trên bản đồ lộ trình */}
|
||||
{!isPublicView && (
|
||||
<div className="absolute top-3 right-3 z-[1001] w-48 md:w-64">
|
||||
@@ -2335,6 +2521,38 @@ export const TourDetailPage = ({
|
||||
})}
|
||||
</MarkerClusterGroup>
|
||||
</MapContainer>
|
||||
|
||||
{/* Floating Compass Button */}
|
||||
<button
|
||||
onClick={toggleCompassMode}
|
||||
className={`absolute bottom-16 right-4 z-[1001] w-10 h-10 rounded-xl border flex items-center justify-center shadow-xl transition-all active:scale-95 ${
|
||||
isHeadingMode
|
||||
? 'bg-blue-600 border-blue-400 text-white shadow-md'
|
||||
: 'bg-white/90 backdrop-blur-md border-white text-gray-500 hover:bg-gray-100'
|
||||
}`}
|
||||
title={isHeadingMode ? "Khóa hướng Bắc" : "Xoay theo hướng nhìn"}
|
||||
>
|
||||
<Compass className="w-5 h-5 transition-transform duration-300" style={{ transform: `rotate(${mapRotation}deg)` }} />
|
||||
</button>
|
||||
|
||||
{/* Floating Locate User Button */}
|
||||
<button
|
||||
onClick={() => setLocateTrigger(prev => prev + 1)}
|
||||
disabled={!userLocation}
|
||||
className={`absolute bottom-4 right-4 z-[1001] w-10 h-10 bg-white/90 backdrop-blur-md rounded-xl border border-white shadow-xl text-blue-600 hover:bg-blue-50 transition-all active:scale-95 flex items-center justify-center disabled:opacity-30 disabled:cursor-not-allowed`}
|
||||
title="Vị trí của tôi"
|
||||
>
|
||||
<LocateFixed className="w-5 h-5" />
|
||||
</button>
|
||||
|
||||
{/* Floating Back to Timeline Button */}
|
||||
<button
|
||||
onClick={() => setViewMode('timeline')}
|
||||
className="absolute top-3 left-14 z-[1001] h-9 px-3 bg-white/90 backdrop-blur-md rounded-xl shadow-xl border border-white text-gray-700 hover:bg-gray-50 hover:text-blue-600 transition-all active:scale-95 flex items-center gap-1.5 text-xs font-bold"
|
||||
title="Quay lại danh sách chặng"
|
||||
>
|
||||
<List className="w-4 h-4" /> Danh sách
|
||||
</button>
|
||||
|
||||
{/* Menu ngữ cảnh khi click chuột phải vào con đường */}
|
||||
{routeMenu && (
|
||||
@@ -2448,13 +2666,7 @@ export const TourDetailPage = ({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Chỉ báo đang tìm đường */}
|
||||
{isRoutingLoading && (
|
||||
<div className="bg-white/90 backdrop-blur-md px-3 py-2 rounded-xl shadow-lg border border-white flex items-center gap-2 animate-pulse animate-in slide-in-from-left-2">
|
||||
<Loader2 className="w-3.5 h-3.5 animate-spin text-blue-600" />
|
||||
<span className="text-[10px] font-black text-gray-500 uppercase tracking-tighter">Đang tìm đường tối ưu...</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -3041,7 +3253,7 @@ export const TourDetailPage = ({
|
||||
</div>
|
||||
|
||||
{/* Floating Action Button (Mobile) */}
|
||||
{((activeTab === 'plan' && canEdit) || (activeTab === 'photo' && canUploadPhoto)) && !isPublicView && (
|
||||
{((activeTab === 'plan' && viewMode === 'timeline' && canEdit) || (activeTab === 'photo' && canUploadPhoto)) && !isPublicView && (
|
||||
<div className="fixed bottom-6 left-1/2 -translate-x-1/2 z-40">
|
||||
<button
|
||||
onClick={() => {
|
||||
@@ -3128,6 +3340,29 @@ export const TourDetailPage = ({
|
||||
})}
|
||||
</MapContainer>
|
||||
|
||||
{/* Floating Compass Button (Fullscreen) */}
|
||||
<button
|
||||
onClick={toggleCompassMode}
|
||||
className={`absolute bottom-22 right-6 z-[1001] w-12 h-12 rounded-2xl border flex items-center justify-center shadow-xl transition-all active:scale-95 ${
|
||||
isHeadingMode
|
||||
? 'bg-blue-600 border-blue-400 text-white shadow-md'
|
||||
: 'bg-white/90 backdrop-blur-md border-white text-gray-500 hover:bg-gray-100'
|
||||
}`}
|
||||
title={isHeadingMode ? "Khóa hướng Bắc" : "Xoay theo hướng nhìn"}
|
||||
>
|
||||
<Compass className="w-6 h-6 transition-transform duration-300" style={{ transform: `rotate(${mapRotation}deg)` }} />
|
||||
</button>
|
||||
|
||||
{/* Floating Locate User Button (Fullscreen) */}
|
||||
<button
|
||||
onClick={() => setLocateTrigger(prev => prev + 1)}
|
||||
disabled={!userLocation}
|
||||
className={`absolute bottom-8 right-6 z-[1001] w-12 h-12 bg-white/90 backdrop-blur-md rounded-2xl border border-white shadow-xl text-blue-600 hover:bg-blue-50 transition-all active:scale-95 flex items-center justify-center disabled:opacity-30 disabled:cursor-not-allowed`}
|
||||
title="Vị trí của tôi"
|
||||
>
|
||||
<LocateFixed className="w-6 h-6" />
|
||||
</button>
|
||||
|
||||
{/* Overlay điều khiển trên bản đồ toàn màn hình */}
|
||||
<div className="absolute top-[calc(1rem+env(safe-area-inset-top,0px))] right-4 z-[1001] flex flex-col gap-2">
|
||||
<button
|
||||
@@ -3144,9 +3379,7 @@ export const TourDetailPage = ({
|
||||
<button onClick={() => { setTravelMode('foot'); setIsMapControlsOpen(false); }} className={`w-9 h-9 flex items-center justify-center rounded-xl ${travelMode === 'foot' ? 'bg-blue-600 text-white' : 'text-gray-500'}`}><Footprints className="w-4 h-4" /></button>
|
||||
<button
|
||||
onClick={() => {
|
||||
const newMode = !isHeadingMode;
|
||||
setIsHeadingMode(newMode);
|
||||
if (!newMode) setMapRotation(0);
|
||||
toggleCompassMode();
|
||||
setIsMapControlsOpen(false);
|
||||
}}
|
||||
className={`w-9 h-9 flex items-center justify-center rounded-xl border-t border-gray-100 transition-all ${isHeadingMode ? 'bg-blue-600 text-white' : 'text-gray-500'}`}
|
||||
|
||||
@@ -0,0 +1,462 @@
|
||||
import React, { useState, useEffect, useRef, useMemo, useCallback } from 'react';
|
||||
import { MapContainer, TileLayer, Marker, Polyline, Popup, useMap, useMapEvents } from 'react-leaflet';
|
||||
import L from 'leaflet';
|
||||
import 'leaflet/dist/leaflet.css';
|
||||
import { ChevronLeft, Compass } from 'lucide-react';
|
||||
|
||||
interface NavigationRouteData {
|
||||
origin: { lat: number; lng: number };
|
||||
destination: { lat: number; lng: number; name: string };
|
||||
tourTitle?: string;
|
||||
}
|
||||
|
||||
interface TourNavigationPageProps {
|
||||
tourId: string;
|
||||
routeData: NavigationRouteData | null;
|
||||
onBack: () => void;
|
||||
}
|
||||
|
||||
const FitBounds = ({ coords, destination, hasInteractedRef }: { coords: [number, number][], destination: { lat: number; lng: number; name: string } | null, hasInteractedRef: React.MutableRefObject<boolean> }) => {
|
||||
const map = useMap();
|
||||
useEffect(() => {
|
||||
if (coords.length > 0 && !hasInteractedRef.current && destination) {
|
||||
map.fitBounds(coords, { padding: [60, 60], maxZoom: 15 });
|
||||
}
|
||||
}, [map, coords, destination, hasInteractedRef]);
|
||||
return null;
|
||||
};
|
||||
|
||||
const MapRotationHandler = ({ rotation }: { rotation: number }) => {
|
||||
const map = useMap();
|
||||
const cumulativeRotationRef = useRef(0);
|
||||
const prevRotationRef = useRef(0);
|
||||
|
||||
useEffect(() => {
|
||||
const container = map.getContainer();
|
||||
container.style.transformOrigin = 'center center';
|
||||
container.style.willChange = 'transform';
|
||||
|
||||
if (rotation === 0) {
|
||||
cumulativeRotationRef.current = 0;
|
||||
prevRotationRef.current = 0;
|
||||
container.style.transform = '';
|
||||
return;
|
||||
}
|
||||
|
||||
let delta = rotation - prevRotationRef.current;
|
||||
if (delta > 180) delta -= 360;
|
||||
else if (delta < -180) delta += 360;
|
||||
|
||||
cumulativeRotationRef.current += delta;
|
||||
prevRotationRef.current = rotation;
|
||||
|
||||
container.style.transform = `rotate(${cumulativeRotationRef.current}deg) scale(2.2) translateZ(0)`;
|
||||
container.style.transition = 'transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1)';
|
||||
}, [rotation, map]);
|
||||
return null;
|
||||
};
|
||||
|
||||
const CompassInteractionDetector = ({
|
||||
onUserInteraction,
|
||||
hasInteractedRef
|
||||
}: {
|
||||
onUserInteraction: () => void;
|
||||
hasInteractedRef: React.MutableRefObject<boolean>;
|
||||
}) => {
|
||||
useMapEvents({
|
||||
movestart: () => { hasInteractedRef.current = true; },
|
||||
zoomstart: () => { hasInteractedRef.current = true; },
|
||||
dragstart: () => { hasInteractedRef.current = true; },
|
||||
});
|
||||
return null;
|
||||
};
|
||||
|
||||
const MapRefSetter = ({ mapRef }: { mapRef: React.MutableRefObject<L.Map | null> }) => {
|
||||
const map = useMap();
|
||||
useEffect(() => {
|
||||
mapRef.current = map;
|
||||
}, [map, mapRef]);
|
||||
return null;
|
||||
};
|
||||
|
||||
const MapInteractionWatcher = ({ hasInteractedRef }: { hasInteractedRef: React.MutableRefObject<boolean> }) => {
|
||||
const map = useMap();
|
||||
useEffect(() => {
|
||||
const onZoomEnd = () => {
|
||||
map._userZoomLevel = map.getZoom();
|
||||
hasInteractedRef.current = true;
|
||||
};
|
||||
const onMoveEnd = () => {
|
||||
map._userCenter = map.getCenter();
|
||||
hasInteractedRef.current = true;
|
||||
};
|
||||
map.on('zoomend', onZoomEnd);
|
||||
map.on('moveend', onMoveEnd);
|
||||
return () => {
|
||||
map.off('zoomend', onZoomEnd);
|
||||
map.off('moveend', onMoveEnd);
|
||||
};
|
||||
}, [map, hasInteractedRef]);
|
||||
return null;
|
||||
};
|
||||
|
||||
const MapSizeHandler = ({ mapRef }: { mapRef: React.MutableRefObject<L.Map | null> }) => {
|
||||
const map = useMap();
|
||||
const prevSizeRef = useRef<{ width: number; height: number } | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const container = map.getContainer();
|
||||
if (!container) return;
|
||||
|
||||
prevSizeRef.current = { width: container.clientWidth, height: container.clientHeight };
|
||||
|
||||
const observer = new ResizeObserver(() => {
|
||||
const newWidth = container.clientWidth;
|
||||
const newHeight = container.clientHeight;
|
||||
const prev = prevSizeRef.current;
|
||||
|
||||
if ((prev && (Math.abs(newWidth - prev.width) > 2 || Math.abs(newHeight - prev.height) > 2)) || newWidth === 0 || newHeight === 0) {
|
||||
prevSizeRef.current = { width: newWidth, height: newHeight };
|
||||
const userZoom = (map as any)._userZoomLevel as number | undefined;
|
||||
|
||||
map.invalidateSize({ animate: false });
|
||||
|
||||
if (userZoom !== undefined && Math.abs(map.getZoom() - userZoom) > 0.01) {
|
||||
map.setZoom(userZoom, { animate: false });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
observer.observe(container);
|
||||
return () => observer.disconnect();
|
||||
}, [map, mapRef]);
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
export const TourNavigationPage: React.FC<TourNavigationPageProps> = ({ tourId, routeData, onBack }) => {
|
||||
const [isCompassActive, setIsCompassActive] = useState(false);
|
||||
const [isLocatingUser, setIsLocatingUser] = useState(false);
|
||||
const [isTrackingLocation, setIsTrackingLocation] = useState(false);
|
||||
const [currentHeading, setCurrentHeading] = useState(0);
|
||||
const [routeGeometry, setRouteGeometry] = useState<[number, number][] | null>(null);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const mapRef = useRef<L.Map | null>(null);
|
||||
const trackingWatchIdRef = useRef<number | null>(null);
|
||||
const compassWatchIdRef = useRef<number | null>(null);
|
||||
const fetchLockRef = useRef(false);
|
||||
const hasInteractedRef = useRef(false);
|
||||
const isProgrammaticMoveRef = useRef(false);
|
||||
|
||||
const originLat = routeData?.origin?.lat;
|
||||
const originLng = routeData?.origin?.lng;
|
||||
const destLat = routeData?.destination?.lat;
|
||||
const destLng = routeData?.destination?.lng;
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!routeData || !originLat || !originLng || !destLat || !destLng) {
|
||||
setRouteGeometry(null);
|
||||
setError(null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fetchLockRef.current) return;
|
||||
|
||||
const calculateOptimalRoute = async () => {
|
||||
try {
|
||||
fetchLockRef.current = true;
|
||||
const url = `https://router.project-osrm.org/route/v1/driving/${originLng},${originLat};${destLng},${destLat}?overview=full&geometries=geojson`;
|
||||
const res = await fetch(url);
|
||||
if (!res.ok) throw new Error(`OSRM error: ${res.status}`);
|
||||
const data: { code: string; routes: Array<{ geometry: { coordinates: number[][] } }> } = await res.json();
|
||||
if (data.code !== 'Ok' || !data.routes?.length) throw new Error('Không tìm thấy lộ trình phù hợp');
|
||||
|
||||
const coords = data.routes[0].geometry.coordinates.map((c: number[]) => [c[1], c[0]] as [number, number]);
|
||||
setRouteGeometry(coords);
|
||||
} catch (err: any) {
|
||||
setError(err.message);
|
||||
} finally {
|
||||
fetchLockRef.current = false;
|
||||
}
|
||||
};
|
||||
|
||||
calculateOptimalRoute();
|
||||
|
||||
return () => {
|
||||
fetchLockRef.current = false;
|
||||
};
|
||||
}, [routeData, originLat, originLng, destLat, destLng]);
|
||||
|
||||
// Effect 1: Live tracking using watchPosition
|
||||
useEffect(() => {
|
||||
if (isTrackingLocation) {
|
||||
if (navigator.geolocation) {
|
||||
console.log("GPS Location Tracking engaged. Syncing viewport to center...");
|
||||
|
||||
trackingWatchIdRef.current = navigator.geolocation.watchPosition(
|
||||
(position) => {
|
||||
const { latitude, longitude } = position.coords;
|
||||
if (mapRef.current) {
|
||||
const currentZoom = mapRef.current.getZoom();
|
||||
isProgrammaticMoveRef.current = true;
|
||||
mapRef.current.setView([latitude, longitude], Math.max(currentZoom, 16), { animate: true });
|
||||
setTimeout(() => {
|
||||
isProgrammaticMoveRef.current = false;
|
||||
}, 100);
|
||||
}
|
||||
},
|
||||
(error) => console.error("GPS stream tracking lost:", error),
|
||||
{ enableHighAccuracy: true }
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (trackingWatchIdRef.current !== null) {
|
||||
navigator.geolocation.clearWatch(trackingWatchIdRef.current);
|
||||
trackingWatchIdRef.current = null;
|
||||
console.log("GPS Location Tracking disabled. Map control released to user.");
|
||||
}
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (trackingWatchIdRef.current !== null) {
|
||||
navigator.geolocation.clearWatch(trackingWatchIdRef.current);
|
||||
trackingWatchIdRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [isTrackingLocation]);
|
||||
|
||||
// Effect 2: Gesture detection to auto-toggle tracking OFF when user interacts
|
||||
useEffect(() => {
|
||||
if (!mapRef.current) return;
|
||||
const map = mapRef.current;
|
||||
|
||||
const breakTrackingOnGesture = () => {
|
||||
if (isProgrammaticMoveRef.current) {
|
||||
return;
|
||||
}
|
||||
if (isTrackingLocation) {
|
||||
console.log("User touch map interaction detected. Disengaging auto-center lock.");
|
||||
setIsTrackingLocation(false);
|
||||
}
|
||||
if (isCompassActive) {
|
||||
console.log("User touch map interaction detected. Disengaging compass lock.");
|
||||
setIsCompassActive(false);
|
||||
}
|
||||
};
|
||||
|
||||
map.on('dragstart', breakTrackingOnGesture);
|
||||
map.on('zoomstart', breakTrackingOnGesture);
|
||||
map.on('movestart', breakTrackingOnGesture);
|
||||
|
||||
return () => {
|
||||
map.off('dragstart', breakTrackingOnGesture);
|
||||
map.off('zoomstart', breakTrackingOnGesture);
|
||||
map.off('movestart', breakTrackingOnGesture);
|
||||
};
|
||||
}, [isTrackingLocation, isCompassActive]);
|
||||
|
||||
const handleUserInteraction = useCallback(() => {
|
||||
hasInteractedRef.current = true;
|
||||
if (isCompassActive) {
|
||||
setIsCompassActive(false);
|
||||
}
|
||||
}, [isCompassActive]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isCompassActive) {
|
||||
setCurrentHeading(0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (navigator.geolocation) {
|
||||
compassWatchIdRef.current = navigator.geolocation.watchPosition(
|
||||
(position) => {
|
||||
if (mapRef.current) {
|
||||
isProgrammaticMoveRef.current = true;
|
||||
mapRef.current.setView([position.coords.latitude, position.coords.longitude], undefined, { animate: true });
|
||||
setTimeout(() => {
|
||||
isProgrammaticMoveRef.current = false;
|
||||
}, 100);
|
||||
}
|
||||
if (position.coords.heading !== null) {
|
||||
setCurrentHeading(position.coords.heading);
|
||||
}
|
||||
},
|
||||
(err) => console.error("Compass tracking acquisition error:", err),
|
||||
{ enableHighAccuracy: true }
|
||||
);
|
||||
}
|
||||
|
||||
const handleOrientation = (event: any) => {
|
||||
let heading: number | null = null;
|
||||
if (event.webkitCompassHeading !== undefined && event.webkitCompassHeading !== null) {
|
||||
heading = event.webkitCompassHeading;
|
||||
} else if (event.alpha !== null && event.alpha !== undefined) {
|
||||
if (event.absolute === true || event.type === 'deviceorientationabsolute') {
|
||||
heading = (360 - event.alpha) % 360;
|
||||
}
|
||||
}
|
||||
if (heading !== null) {
|
||||
setCurrentHeading(heading);
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('deviceorientation', handleOrientation, true);
|
||||
window.addEventListener('deviceorientationabsolute', handleOrientation, true);
|
||||
|
||||
return () => {
|
||||
if (compassWatchIdRef.current !== null) {
|
||||
navigator.geolocation.clearWatch(compassWatchIdRef.current);
|
||||
compassWatchIdRef.current = null;
|
||||
}
|
||||
window.removeEventListener('deviceorientation', handleOrientation, true);
|
||||
window.removeEventListener('deviceorientationabsolute', handleOrientation, true);
|
||||
};
|
||||
}, [isCompassActive]);
|
||||
|
||||
const userIcon = useMemo(() => L.divIcon({
|
||||
className: '!bg-transparent !border-none',
|
||||
html: `<div class="w-8 h-8 bg-blue-600 rounded-full border-2 border-white shadow-xl flex items-center justify-center"><div class="w-2 h-2 bg-white rounded-full"></div></div>`,
|
||||
iconSize: [32, 32],
|
||||
iconAnchor: [16, 16]
|
||||
}), []);
|
||||
|
||||
const destIcon = useMemo(() => L.divIcon({
|
||||
className: '!bg-transparent !border-none',
|
||||
html: `<div class="w-10 h-10 bg-red-600 rounded-full border-2 border-white shadow-xl flex items-center justify-center text-white text-xs font-black">Đ</div>`,
|
||||
iconSize: [40, 40],
|
||||
iconAnchor: [20, 20]
|
||||
}), []);
|
||||
|
||||
if (!routeData) return null;
|
||||
|
||||
const center: [number, number] = routeData.origin && routeData.destination
|
||||
? [(routeData.origin.lat + routeData.destination.lat) / 2, (routeData.origin.lng + routeData.destination.lng) / 2]
|
||||
: [0, 0];
|
||||
|
||||
const centerOnUser = () => {
|
||||
if (navigator.geolocation) {
|
||||
setIsLocatingUser(true);
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(position) => {
|
||||
setIsLocatingUser(false);
|
||||
if (mapRef.current) {
|
||||
const currentZoom = mapRef.current.getZoom();
|
||||
isProgrammaticMoveRef.current = true;
|
||||
mapRef.current.setView([position.coords.latitude, position.coords.longitude], Math.max(currentZoom, 16), { animate: true });
|
||||
setTimeout(() => {
|
||||
isProgrammaticMoveRef.current = false;
|
||||
}, 100);
|
||||
hasInteractedRef.current = true;
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
setIsLocatingUser(false);
|
||||
console.error("Cannot get user location:", err);
|
||||
},
|
||||
{ enableHighAccuracy: true }
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 bg-slate-950 flex flex-col overflow-hidden select-none text-white antialiased">
|
||||
<div className="w-full bg-[#1e293b]/95 backdrop-blur-md border-b border-slate-800 px-4 py-3.5 flex items-center gap-3 z-50 shrink-0"
|
||||
style={{ paddingTop: 'calc(0.75rem + env(safe-area-inset-top, 0px))' }}>
|
||||
<button
|
||||
onClick={onBack}
|
||||
className="text-slate-300 hover:text-white p-1 rounded-lg hover:bg-slate-800 transition-colors"
|
||||
title="Quay lại danh sách lộ trình"
|
||||
>
|
||||
<ChevronLeft className="w-6 h-6" />
|
||||
</button>
|
||||
<h2 className="text-sm font-bold truncate tracking-wide text-slate-100">
|
||||
{routeData.tourTitle || "Bản đồ chỉ đường"}
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 relative min-h-0" style={{ paddingBottom: 'env(safe-area-inset-bottom, 0px)' }}>
|
||||
<MapContainer
|
||||
center={center}
|
||||
zoom={14}
|
||||
className="absolute inset-0 h-full w-full"
|
||||
zoomControl={true}
|
||||
attributionControl={false}
|
||||
scrollWheelZoom={true}
|
||||
doubleClickZoom={true}
|
||||
touchZoom={true}
|
||||
dragging={true}
|
||||
inertia={true}
|
||||
maxZoom={20}
|
||||
minZoom={2}
|
||||
>
|
||||
<TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" attribution="" />
|
||||
<MapRefSetter mapRef={mapRef} />
|
||||
<MapInteractionWatcher hasInteractedRef={hasInteractedRef} />
|
||||
<FitBounds coords={routeGeometry || []} destination={routeData?.destination || null} hasInteractedRef={hasInteractedRef} />
|
||||
{routeGeometry && (
|
||||
<Polyline positions={routeGeometry} color="#2563eb" weight={6} opacity={0.9} smoothFactor={1} />
|
||||
)}
|
||||
<MapSizeHandler mapRef={mapRef} />
|
||||
<MapRotationHandler rotation={currentHeading} />
|
||||
<CompassInteractionDetector onUserInteraction={handleUserInteraction} hasInteractedRef={hasInteractedRef} />
|
||||
</MapContainer>
|
||||
|
||||
{/* Locate User Button */}
|
||||
<button
|
||||
onClick={centerOnUser}
|
||||
className={`absolute bottom-8 left-6 z-[999] w-14 h-14 rounded-full border-2 flex items-center justify-center shadow-2xl transition-all active:scale-95 ${
|
||||
isLocatingUser
|
||||
? 'bg-blue-600 border-blue-400 text-white animate-pulse'
|
||||
: 'bg-white dark:bg-slate-900 border-slate-200 dark:border-slate-700 text-slate-600 dark:text-blue-400'
|
||||
}`}
|
||||
style={{ bottom: 'calc(2rem + env(safe-area-inset-bottom, 0px))' }}
|
||||
title="Định vị vị trí hiện tại của bạn"
|
||||
>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
<path d="M12 2v4M12 18v4M2 12h4M18 12h4" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
{/* FLOATING LIVE GPS TRACKING CENTER LOCK BUTTON */}
|
||||
<button
|
||||
onClick={() => setIsTrackingLocation(!isTrackingLocation)}
|
||||
className={`absolute bottom-24 right-6 z-[999] w-14 h-14 rounded-full border-2 flex items-center justify-center shadow-2xl transition-all active:scale-95 ${
|
||||
isTrackingLocation
|
||||
? 'bg-green-600 border-green-400 text-white animate-pulse'
|
||||
: 'bg-white dark:bg-slate-900 border-slate-200 dark:border-slate-700 text-slate-600 dark:text-green-500'
|
||||
}`}
|
||||
style={{ bottom: 'calc(6rem + env(safe-area-inset-bottom, 0px))' }}
|
||||
title={isTrackingLocation ? "Tắt tự động định tâm vị trí" : "Bật tự động định tâm theo vị trí của bạn"}
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" className="w-7 h-7" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round">
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
<path d="M12 2v4M12 18v4M2 12h4M18 12h4" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<button
|
||||
onClick={() => setIsCompassActive(!isCompassActive)}
|
||||
className={`absolute bottom-8 right-6 z-[999] w-14 h-14 rounded-full border-2 flex items-center justify-center shadow-2xl transition-all active:scale-95 ${
|
||||
isCompassActive
|
||||
? 'bg-blue-600 border-blue-400 text-white animate-pulse'
|
||||
: 'bg-white dark:bg-slate-900 border-slate-200 dark:border-slate-700 text-slate-600 dark:text-blue-400'
|
||||
}`}
|
||||
style={{ bottom: 'calc(2rem + env(safe-area-inset-bottom, 0px))' }}
|
||||
>
|
||||
<Compass className="w-7 h-7" />
|
||||
</button>
|
||||
|
||||
{error && (
|
||||
<div className="absolute top-4 left-1/2 -translate-x-1/2 bg-red-900 text-white text-xs px-3 py-1.5 rounded-lg shadow-lg z-[1000]">
|
||||
{error}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1 +1,3 @@
|
||||
export const robotoBase64 = "AAEAAAAOAIAAAwBgR0RFRgslCyYAAU70AAAAQEdQT1OW7t6tAAFPNAAAUZJHU1VCLJENOgABoMgAAAQsT1MvMrivKbYAAAFoAAAAYFZETVhu6nZPAAASiAAABeBjbWFwe1eWmQAAGGgAAAh+Z2x5ZnKsuk0AAClMAAD8BGhlYWT3/7sxAAAA7AAAADZoaGVhCywJXgAAASQAAAAkaG10eMBzVnEAAAHIAAAQwGxvY2Hm+KbaAAAg6AAACGJtYXhwBE8BKgAAAUgAAAAgbmFtZfDWLcMAASVQAAAEo3Bvc3RDYN+ZAAEp9AAAJP0AAQAAAAEAAOqeVyxfDzz1AAsIAAAAAADE8BEuAAAAANAzXr36jf3VCTAIcwAAAAkAAgAAAAAAAAABAAAHbP4MAAAJSfqN/dgJMAABAAAAAAAAAAAAAAAAAAAEMAABAAAEMACwABYAeAAFAAEAAAAAAAAAAAAAAAAAAwABAAMEigGQAAUAAAWaBTMAAAEfBZoFMwAAA9EAZgIAAAAAAAAAAAAAAAAA4AAC/1AAIFsAAAAgAAAAAHB5cnMAQAAA//0GAP4AAGYHmgIAIAABn08BAAAEOgWwAAAAIAACAfsAAAAAAAAB+wAAAfsAAAKPAIgE+wBGBH4AbgXcAGkE+QBlAWUAZwK8AIUCyAAmA3IAHASJAE4BkgAdAjUAJQIbAJADTAASBH4AcwR+AKoEfgBdBH4AXgR+ADUEfgCaBH0AgwR+AE0EfgBwBH4AZAHwAIYBsQApBBEASARkAJgELgCGA8cASwcvAGoFOAAcBPsAqQU1AHcFPwCpBIwAqQRsAKkFcwB6BbQAqQItALcEagA1BQQAqQROAKkG/ACpBbQAqQWAAHYFDACpBYAAbQTtAKgEvwBQBMYAMQUwAIwFFwAcBxkAPQUEADkEzgAPBMoAVgIfAJIDSAAoAh8ACQNYAEADnAAEAnkAOQRaAG0EfQCMBDAAXASDAF8EPQBdAscAPAR9AGAEaACMAfEAjQHp/78EDgCNAfEAnAcDAIsEagCMBJAAWwR9AIwEjABfArUAjAQgAF8CnQAJBGkAiAPgACEGAwArA/cAKQPJABYD9wBYArUAQAHzAK8CtQATBXEAgwHzAIsEYQBpBKYAWwW0AGkE2AAfAesAkwToAFoDWABmBkkAWwOTAJMDwQBmBG4AfwZKAFoDqgB4Av0AggRHAGEC7wBCAu8APgKCAHsEiACaA+kAQwIWAJMB+wB0ArkAegOjAHoDwABmBdwAVQY1AFAGOQBvA8kARAd6//IERABZBYEAdgS6AKYEwgCLBsEATgSwAH4EkQBHBIkAWwScAJUFmwAeAfoAmwRzAJoETwAjAioAIwWLAKIEiACRB6EAaQdEAGEB/ACgArn/5AV/AGUEkwBbBZAAjATzAIgCA/+0BDcAYgPEAKkDjQCMA2oAgQHxAI0CrQB5AioAMgPGAHsC/ABeAloAfgAA/TYAAP2GAAD8iwAA/V4AAPwnAe/9OAINALcECwBxAhcAkwRzALEFpAAfBXIAZwU+ADIEkQB4BbUAsgSRAEUFuwBNBYkAWgVSAHEEhQBkBL0AoAQCAC4EiABgBFAAYwQlAG0EiACRBI4AegKXAMMEbgAlA+wAZQTFACkEiACRBE0AZQSIAGAELABRBF0AjwWjAFcFmgBfBpcAegShAHkEQv/aBkgASgX/ACoFZAB7CJkAMQikALEGggA+BbQAsAULAKIGBAAyB0MAGwS/AFAFtACxBakALwUHAE0GLQBTBdkArwV6AJYHhwCwB8AAsAYSABEG6wCyBQUAowVkAJMHJwC3BRgAWQRsAGEEkgCdA1sAmgTUAC4GIAAVBBAAWASeAJwEUgCcBKAAKAXvAJ0EnQCcBJ4AnAPYACgFzQBkBL0AnARZAGcGeACcBp8AkQT3AB4GNgCdBFgAnQRNAGQGiACdBGQALwRo/+cETgBnBskAJwbkAJwEif/9BJ4AnAcIAJwGKwCBBFb/3AcsALgF+QCZBNIAKARGAA8HDADKBgwAvAbRAJMF4QCWCQUAtwfRAJsEJABQA9sATAVyAGcEjABbBQoAFgQDAC4FcgBnBIkAWwcBAJwGJAB+BwkAnAYsAIEFMgB1BEcAZAT9AHQAAPxnAAD8cQAA/WYAAP2kAAD6jQAA+qQEVv/cBRsAqASKAIwEZACiA5AAkQTbALEEBgCRBQkAowR+AJoGjABFBYQAPgfPAKgFtACRCDEAsAb0AJEF7gBxBNMAbQctADQFXAAfBXAAlgRrAIMFcACKBi8APwS+/90FCQCjBFoAmgWyALEEiACRBYcAXQSoAGgEqABpBLcAOgNJADsE9gBXBpQAWQbkAGQGVgA2BSsAMQRKAFMECAB5B8EARAZ1AD8H+wCpBqEAkAT2AHYEHQBlBa0AIwUgAEYFZACWBBQAAAgpAAAEFAAACCkAAAK5AAACCgAAAVwAAAR/AAACMAAAAaIAAADRAAAAAAAABUAAogY/AJADpgANAZkAYAGZADABlwAkAZoAUALUAGgC2wA8AsEAJARpAEYEjwBXArIAigPEAJQFWgCUB6oARAJmAGwCZgBZA6MAOwLvADYDYAB6BKYAWwaRAKcEfgBfBegAewPOAGgIOgCiBQEAZwUXAJgGJgBUBtcAZAbPAGMGagBZBI8AagWOAKkErwBFBJIAqATFAD8IOgBiAgz/sASCAGUEZACYBBEAPgQvAIUECAArAkwAtQKPAG4CAwBcBG4AHwAAAAAIMwBbCDUAXALvAFADC/+iA/P/XgPvAG4DpABbAf0AnwSFABMEUACKBHwAYASAAIoD5gCKA8sAigSsAGME4wCKAegAlwPPACsEVACKA7QAigYCAIoE4wCKBLsAYARcAIoEuwBZBEoAigQgAEMEJgAoBHwAdARnABQGFQAxBFQAJgQrAA0EIwBHBA8AYwQPAJgEDwBOBA8ATgQPADAEDwCABA4AcgQPAEIEDwBgBA8AVQOkAIMC7wB6Au8AQgLvAD4C7wA2Au8AWwLvAFYC7wA6Au8ATwLvAEkDlgCPArUAngNHAIEBkQBnAiUAGwH8/7YEDgBpBDoAHgN5AFcD9ABpBG8AWgTDAGQEiABgBUwAsQUkALIEEwCSBT0AsgQPAJIDnwCBA54AgQR+AE0FfgCDBYEAfgWuAH4FkwCyBeAAfgXjAH4D1QCgBIIAgwRYAA8EzwA+BGsAZQQuAEoEuQCCBQAAeAQgADsEfQCMBDIAXASTAFsEjABbBJ4AWgSNAIwEnABbBDAAXAQ9AF0EfQBgBH4AhQR+AFoFPwCpBYAAdwRaAG0DagCBAfsAAAI1ACUFXQAlBV0AJQSGAAAExgAxAp3/9AU4ABwFOAAcBTgAHAU4ABwFOAAcBTgAHAU4ABwFNQB3BIwAqQSMAKkEjACpBIwAqQIt/+ACLQCwAi3/6QIt/9YFtACpBYAAdgWAAHYFgAB2BYAAdgWAAHYFMACMBTAAjAUwAIwFMACMBM4ADwRaAG0EWgBtBFoAbQRaAG0EWgBtBFoAbQRaAG0EMABcBD0AXQQ9AF0EPQBdBD0AXQH6/8YB+gCWAfr/zwH6/7wEagCMBJAAWwSQAFsEkABbBJAAWwSQAFsEaQCIBGkAiARpAIgEaQCIA8kAFgPJABYFOAAcBFoAbQU4ABwEWgBtBTgAHARaAG0FNQB3BDAAXAU1AHcEMABcBTUAdwQwAFwFNQB3BDAAXAU/AKkFGQBfBIwAqQQ9AF0EjACpBD0AXQSMAKkEPQBdBIwAqQQ9AF0EjACpBD0AXQVzAHoEfQBgBXMAegR9AGAFcwB6BH0AYAVzAHoEfQBgBbQAqQRoAIwCLf+3Afr/nQIt/7YB+v+cAi3/7AH6/9ICLQAJAfH/+gItAKoGlwC3A9oAjQRqADUCA/+0BQQAqQQOAI0ETgChAfEAkwROAKkB8QBXBE4AqQKHAJwETgCpAs0AnAW0AKkEagCMBbQAqQRqAIwFtACpBGoAjARq/84FgAB2BJAAWwWAAHYEkABbBYAAdgSQAFsE7QCoArUAjATtAKgCtQBTBO0AqAK1AGMEvwBQBCAAXwS/AFAEIABfBL8AUAQgAF8EvwBQBCAAXwS/AFAEIABfBMYAMQKdAAkExgAxAp0ACQTGADECxQAJBTAAjARpAIgFMACMBGkAiAUwAIwEaQCIBTAAjARpAIgFMACMBGkAiAUwAIwEaQCIBxkAPQYDACsEzgAPA8kAFgTOAA8EygBWA/cAWATKAFYD9wBYBMoAVgP3AFgHev/yBsEATgWBAHYEiQBbBID/wQSA/8EEJgAoBIUAEwSFABMEhQATBIUAEwSFABMEhQATBIUAEwR8AGAD5gCKA+YAigPmAIoD5gCKAej/vgHoAI4B6P/HAej/tATjAIoEuwBgBLsAYAS7AGAEuwBgBLsAYAR8AHQEfAB0BHwAdAR8AHQEKwANBIUAEwSFABMEhQATBHwAYAR8AGAEfABgBHwAYASAAIoD5gCKA+YAigPmAIoD5gCKA+YAigSsAGMErABjBKwAYwSsAGME4wCKAej/lQHo/5QB6P/KAej/4wHoAIkDzwArBFQAigO0AIIDtACKA7QAigO0AIoE4wCKBOMAigTjAIoEuwBgBLsAYAS7AGAESgCKBEoAigRKAIoEIABDBCAAQwQgAEMEIABDBCYAKAQmACgEfAB0BHwAdAR8AHQEfAB0BHwAdAR8AHQGFQAxBCsADQQrAA0EIwBHBCMARwQjAEcIQABDBTgAHATw//AGGP/+ApEABAWUAD0FMv94BWYAMwKX/5sFOAAcBPsAqQSMAKkEygBWBbQAqQItALcFBACpBvwAqQW0AKkFgAB2BQwAqQTGADEEzgAPBQQAOQIt/9YEzgAPBIUAZARQAGMEiACRApcAwwRdAI8EcwCaBJAAWwSIAJoD4AAhA/cAKQKX/+YEXQCPBJAAWwRdAI
Line truncated
|
||||
|
||||
export const robotoBoldBase64 = "AAEAAAASAQAABAAgR0RFRrRCsIIAAh3kAAACYkdQT1P5bkuGAAIgSAAAZS5HU1VC64LkWQAChXgAABWQT1MvMpiusakAAAGoAAAAYGNtYXABd1geAAAbWAAAEkZjdnQgK34EtQAAMIgAAABIZnBnbV/yGqsAAC2gAAABvGdhc3AACAATAAId2AAAAAxnbHlmn5ZI2QAAOvAAAd6QaGRteICPjqUAABZAAAAFGGhlYWT819JcAAABLAAAADZoaGVhCyYK2gAAAWQAAAAkaG10eCecEV0AAAIIAAAUOGxvY2F38/pDAAAw0AAACh5tYXhwBz4DEQAAAYgAAAAgbmFtZahtokEAAhmAAAAENXBvc3T/bQBkAAIduAAAACBwcmVwKnY2MAAAL1wAAAEpAAEAAAACIxIFTnAdXw889QAZCAAAAAAAxPARLgAAAADVAVLW+jD91QmHCHMAAQAJAAIAAAAAAAAAAQAAB2z+DAAACYr6MP41CYcAAQAAAAAAAAAAAAAAAAAABQ4AAQAABQ4AjwAWAE4ABQABAAAAAAAOAAACAAIyAAYAAQADBKcCvAAFAAAFmgUzAAABHwWaBTMAAAPRAGYCAAAAAgAAAAAAAAAAAOAAAv9QACBbAAAAIAAAAABHT09HACAAAP/9BgD+AABmB5oCACAAAZ8AAAAABDoFsAAgACAAAwOMAGQAAAAAAAAAAAH+AAAB/gAAAi0AfAKRAEAExABABJcAXAXoAF8FQABHAUsAPwLPAHwC0gAoA6AAGwReADkB9AAjAxoAbgJTAH4C/f/zBJcAXwSXAKcElwBGBJcAQASXADcElwBpBJcAZASXAD0ElwBfBJcAVgJCAH0CGQA5BBIANgSUAIgEIgB4A/sALQcpAEsFYgAHBRsAggU8AFYFMwCCBIAAggRiAIIFcwBeBacAggJVAJUEeAAoBRQAggRVAIIHAgCCBaYAggWGAFYFKQCCBYYAVAUbAIIE6wBFBPMAKAVEAHQFOwAHBv8AIwUVABYE8gACBNkASQI5AHgDYAAAAjkADQN/ACwDkgABAqUANARKAEQEgQBvBCwAQgSCAEIEUwBIAt4AHQSRAEUEegBoAh8AbQIU/6EERgBvAh8AfgbtAG8EewBpBIYAQgSBAG8EhQBCAusAbwQdADgCtAAKBHoAaAQLAA0F4QAcBBIAFQQEAAMEEgBKAqQAMAIGAK0CpAAiBTAAagJCAIAEmgBjBMEAYwWKAFEESgAKAgQAgAUHAFwDvABeBkYAVgONAIkD/wBNBGkAfgZGAFYEAgCoAxsAfgRMAFkC+wA3AvsAMAKnAGUE7QCLA+sASwJpAIwCJABiAvsAhwOoAHYD/wBVBb4AZQYXAFQGdwBeA/sARQeFAAIEQABBBYMAXQTeAIUFDACHBsEAQgSaAFQEkAA/BIQAQgSKAHEFCwBCBcIAIAIxAIYEuACCBHYAHQJyAB4FoACABIQAbAe/AGAHNwBTAhMAdQWPAEsC4//dBZwAUASmAEAFswB0BOEAaAJB/60EPABOA/cAewPEAFUEAgCoA40AagIfAHYCqgB3AmgAIQPZAHUDSAA5AoMAjgAA/IAAAP1WAAD8YQAA/R8AAPvwAAD9BwKyANoEYwBmAmkAjAR1AIQF2QAUBYEAUgUuABAEiQBfBakAhASJAEgGKABJBdAANAVgAGYEggBJBNAAjgQVABEEhABEBHMAXwQCAEwEhABsBLgAcAKyAIoEYwAHBD0AZwUmADQEhABxBB4APwSUAEIEKgAsBF4AcQX3ADYF9ABEBpEAUwTDAHUEuv/nBp4AFAX7AB0FRwBXCHYAKAh4AIQGLAAhBZoAdQUDAH8F+wAZB/sAEQTvAEMFmgB4BaYAKAUNAB8GiABJBhIAdQWQAIkHqwCACCsAgAYqABkG+QCFBQEAgAU0AD4HjACOBMb/5ASOAFQEhwCCA1oAbwUNACEG1QAnBBwARQSKAG8EggCCBIwAFgYTAIIEigBvBIoAbwQTAB8F2ABEBOAAbwRuAFgGngBvBzMAbAU/ACEGnwCCBHcAggQpAD8GfgCGBHkAKQR6/8wEKQBABt4AFQbkAG8EhP/aBIoAbweTAHcGkABkBHb/5QckAH0GCQB1BUkADwR5AAcHewCTBmMAfgb5AG0F3gBvCU0AlQgMAIYEHAAHBAcAHAWBAFoEhABABSQACwQVABEFgQBaBIQAQgeSAHcGdwBsB5MAdwaQAGQE+ABZBEcAVgT7AGsAAPxzAAD8eAAA/ZYAAP2nAAD6MAAA+nAGOAB4BTgAbwR2/+UFCACCBIIAbwRxAH8DsQBsBPsAhAQ7AGwIjQARB0UAJwXyAIQFMwCCBUsAgATRAIIGmwAlBbkAOgZAAIIFMQBvB+EAggWmAGwIXACEBu0AbAZtAF4FKgBVBVUAFgRXABUHKQAiBX8ALQYkAIkFFwBYBXEAbgR7AGgFlwCGBg7/5QTI/7wFMgCABJEAggZAACgFOAAWBagAhASEAGwGRACCBTUAbweaAIIGowCCBY8ASwSgAFAEogBSBM4AJQOrABYFmgAWBJwAFQUBAEkHQgB0BtQAWgZNAEEFJAAtBK8AQQR5AG0HuABABscAPwf0AIEGmgBdBREARgQ8AEYFpAAfBRkAQgU+AGoGgQAoBXkAFgMfAFsEFAAACCkAAAQUAAAIKQAAArkAAAIKAAABXAAABH8AAAIwAAABogAAAQAAAADRAAAAAAAAAxsAbgMbAG4FDgCYBhsAbQORAAEB3wBoAdYAOgH8AEIBrABHAz8AcANFAEgDOQBCBE4AOQShAGIC4ACHBCwAhQXrAIUCDwBlB60AVwJ+AGwCagBQA5EAHgL7ADUDWABXBMEAZgaDACUG4QCNCK4AggZ1ACUG8gBvBJcAWQX9ACUEOAAoBMAAJQV1AEQFpAAzBeAAZAPzACoIHQCABQ0AdAUQAJQGRABhBuQASAbRAFcG4ABbBJQAWQWLAKQFBAA5BHIAkwSFADcIXwBeAk//pQSdAGUElACIBBMANgQiAHgEEgAfAloAigKRAFoB1gA0BToAHQTeABQE5wAdB20AHQdtAB0FLAAdBs4AOAAAAAAILABXCDUAXAL6ADcC+gCHAvoARwQoAEgEKABPBCgAMQQnAE8EKABPBCgAMwQoAC8EKAA4BCgAlQQoAE8EMQA3BE3//wRkAAMF/QAfBIj//wSPAF0EUQAgBEkAOgR2AGMEwABBBHgAYwTAAEAE1gBjBgcAYwO6AGMEZABjA9wAIAIPAHYE1wBjBKIASQPDAGMESQA6BJIAQAOnAAYDxQBjBIj//wTAAEAEiP//A6sASgTgAGMEQgBIBdcAQQWNAEEE0QBKBasAIASDAEAHZQAeB14AYwW4ACAE4ABjBIUAYwWLACEGcAAWBEoAPgTaAGMEaQBjBNMAHgRuABsFkABjBKkARgavAGMHXwBjBZcACgY7AGMEewBjBIMAMQakAGMEgwA2BDcACgbmABYEvwBjBRYAYwWjACAGIABABFD//wTbAAMGwwAgBKkARgSpAGMGMQAVBNIAQARMAD4EwABABJIAQAQDAEcIOwBjBSwAKAL6ADAC+gA1AvoARQL6AEYC+gAzAvoARwL6AEMD0gCNAqoAkAPbAGMEO//7BK0ASQU5AIQFKwCEBEcAcQUwAIQEQABxBHUAYwSDAEAEbQBjBKz//wIBAIUDnQBqAAD8mgQHAIMEB/9FBAcAhAQHAIQDxQBjA50AagOdAGoC+wBHAvsANQL7AEUC+wBGAvsAMwL7AEcC+wBDBWoAWAWSAFgFcgCEBdYAWAXXAFgEaACPBIIAWARXAA8ErAAsBGsAaAQuADwDnQBqAdkAWgaOAEAEpwBgAhv/nwSXADcElwBhBJcANASXAFQElwBOBJcAMwSXAF8ElwBWBJcAXwSXANkCQf+tAkH/rQIxAIYCMf/8AjEAhgRtAGME0gBMBD4AOASRAG8ERgBEBJgARASWAEQEnAA8BJUAbwSaAEQEUwBIBJEAQgPUAGYFNQBWA9AABwZQ/9cEFABjBMAAQAUwADYE1gBjAf4AAAMaAG4FUf/sBVH/7ASY/8sE8wAoArT/4gViAAcFYgAHBWIABwViAAcFYgAHBWIABwViAAcFPABWBIAAggSAAIIEgACCBIAAggJV/7oCVQCVAlX/rwJV/60FpgCCBYYAVgWGAFYFhgBWBYYAVgWGAFYFRAB0BUQAdAVEAHQFRAB0BPIAAgRKAEQESgBEBEoARARKAEQESgBEBEoARARKAEQELABCBFMASARTAEgEUwBIBFMASAIx/6gCMQCGAjH/nQIx/5sEewBpBIYAQgSGAEIEhgBCBIYAQgSGAEIEegBoBHoAaAR6AGgEegBoBAQAAwQEAAMFYgAHBEoARAViAAcESgBEBWIABwRKAEQFPABWBCwAQgU8AFYELABCBTwAVgQsAEIFPABWBCwAQgUzAIIFGABCBIAAggRTAEgEgACCBFMASASAAIIEUwBIBIAAggRTAEgEgACCBFMASAVzAF4EkQBFBXMAXgSRAEUFcwBeBJEARQVzAF4EkQBFBacAggR6AGgCVf+yAjH/oAJV/9QCMf/CAlX/0gIx/8ACVQAXAh8AAwJVAJUGzQCVBDMAbQR4ACgCQf+XBRQAggRGAG8EVQCCAh8AfgRVAIICHwBbBFUAggK1AH4EVQCCAvsAfgWmAIIEewBpBaYAggR7AGkFpgCCBHsAaQR7/5IFhgBWBIYAQgWGAFYEhgBCBYYAVgSGAEIFGwCCAusAbwUbAIIC6wBQBRsAggLrABEE6wBFBB0AOATrAEUEHQA4BOsARQQdADgE6wBFBB0AOATrAEUEHQA4BPMAKAK0AAoE8wAoArQACgTzACgC3AAKBUQAdAR6AGgFRAB0BHoAaAVEAHQEegBoBUQAdAR6AGgFRAB0BHoAaAVEAHQEegBoBv8AIw
Line truncated
|
||||
Reference in new issue
Block a user